diff --git a/Wiki/changelog/cli.md b/Wiki/changelog/cli.md index bcd6a05..14c996e 100644 --- a/Wiki/changelog/cli.md +++ b/Wiki/changelog/cli.md @@ -3,7 +3,7 @@ type: Changelog title: CLI Changelog description: Release-level history for the Open Knowledge CLI. tags: [openknowledge, cli, changelog] -timestamp: 2026-07-30T00:00:00Z +timestamp: 2026-07-31T00:00:00Z --- # CLI Changelog @@ -13,6 +13,19 @@ page records release-level changes. ## Unreleased +### 2026-07-31 — Mermaid diagram viewport + +- A click, Enter, or Space now opens a rendered Mermaid diagram in a + viewport-filling dialog. +- Toolbar, wheel, pinch, drag, and arrow-key controls provide zoom and pan. +- **Fit** fits the complete diagram in the viewport. + **100%** centers the diagram at its original scale. +- The local viewer and interactive HTML exports use the same controls. +- Source: `packages/web/src/viewer/`, + `packages/web/scripts/browser.e2e.mjs`. +- Docs: `Wiki/features/commands/view.md`, + `Wiki/features/exporters/html.md`. + ### 2026-07-31 — Bounded scheduled-job storage - A scheduled job now runs at most once for each job ID and schedule slot. diff --git a/Wiki/features/commands/view.md b/Wiki/features/commands/view.md index b052583..74101b6 100644 --- a/Wiki/features/commands/view.md +++ b/Wiki/features/commands/view.md @@ -3,7 +3,7 @@ type: Command Documentation title: openknowledge view description: Browse a local or connected knowledge base in the web viewer. tags: [openknowledge, cli, command, viewer] -timestamp: 2026-07-30T00:00:00Z +timestamp: 2026-07-31T00:00:00Z --- # `openknowledge view` @@ -40,6 +40,13 @@ Head injection also reads `OPENKNOWLEDGE_HEAD_FILE`, - The viewer renders Markdown and follows local links. It renders fenced `mermaid` blocks as diagrams. It also shows note panels, source graphs, validation context, highlighted assets, and media or PDF previews. +- Click a rendered Mermaid diagram to open a viewport-filling dialog. + You can also focus the diagram and press Enter or Space. + Use the toolbar, wheel, or pinch gesture to zoom. + Drag the diagram, or use the arrow keys, to pan. + Select **Fit** to fit the complete diagram in the viewport. + Select **100%** to center the diagram at its original scale. + Press Escape to close the dialog. - The link behavior control is next to viewer settings. Open-beside mode is the default. The control can select the current panel mode. The browser stores this selection. Hold Shift during activation to use the @@ -110,6 +117,7 @@ Theme and source-link configuration comes from > - `packages/cli/cmd/openknowledge/viewer_templates.go` > - `packages/cli/cmd/openknowledge/viewer_assets/` > - `packages/web/src/viewer/` +> - `packages/web/scripts/browser.e2e.mjs` > - `packages/cli/cmd/openknowledge/viewer_test.go` > - `packages/cli/internal/okf/search.go` > diff --git a/Wiki/features/exporters/html.md b/Wiki/features/exporters/html.md index 9975936..79d9ead 100644 --- a/Wiki/features/exporters/html.md +++ b/Wiki/features/exporters/html.md @@ -3,7 +3,7 @@ type: Exporter Documentation title: HTML Exporter description: Publish an Open Knowledge bundle as a static site. tags: [openknowledge, cli, exporter, html] -timestamp: 2026-07-18T00:00:00Z +timestamp: 2026-07-31T00:00:00Z --- # HTML Exporter @@ -59,6 +59,10 @@ The deployment owns trusted inline scripts from `--head-file` or `--head-html`. These scripts can require a CSP nonce or hash. Use `--script-src` for trusted external scripts. +The local viewer and interactive HTML exports use the same diagram controls. +Both viewer modes provide zoom, pan, **Fit**, and **100%** controls in a +viewport-filling dialog. + Plain mode writes only semantic HTML pages. It omits viewer assets, discovery files, search data, source controls, and frontmatter chrome. @@ -138,6 +142,7 @@ Then, it registers the materialized source. > - `packages/cli/cmd/openknowledge/viewer_discovery.go` > - `packages/cli/cmd/openknowledge/viewer_theme.go` > - `packages/web/src/viewer/` +> - `packages/web/scripts/browser.e2e.mjs` > - `packages/web/vite.viewer.config.ts` > - `packages/cli/internal/okf/export_test.go` > diff --git a/packages/cli/cmd/openknowledge/viewer_assets/viewer.css b/packages/cli/cmd/openknowledge/viewer_assets/viewer.css index cc7cd55..1614c8d 100644 --- a/packages/cli/cmd/openknowledge/viewer_assets/viewer.css +++ b/packages/cli/cmd/openknowledge/viewer_assets/viewer.css @@ -1 +1 @@ -:root{--ok-viewport-height: 100vh}@supports (height: 100svh){:root{--ok-viewport-height: 100svh}}*{box-sizing:border-box}html{background:var(--ok-color-viewer-canvas);-webkit-text-size-adjust:100%;text-size-adjust:100%}body{margin:0;color:var(--ok-color-text);background:var(--ok-color-page);font-family:var(--ok-font-body);font-feature-settings:"cv02","cv03","cv04","cv11";font-synthesis:none;letter-spacing:-.006em;line-height:1.55;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}body.viewer-document{height:var(--ok-viewport-height);overflow:hidden}body.viewer-asset-document{overflow:auto}header{display:flex;min-height:var(--ok-header-height);justify-content:space-between;align-items:center;gap:16px;padding:14px 22px;border-bottom:1px solid var(--ok-color-border);background:var(--ok-color-header-bg);color:var(--ok-color-muted);font-size:13px}body.viewer-document>header{position:relative;height:var(--ok-header-height);min-height:0;z-index:6;justify-content:center;padding:0 22px;border-bottom:0;background:var(--ok-color-viewer-header-bg);backdrop-filter:blur(18px) saturate(1.08);-webkit-backdrop-filter:blur(18px) saturate(1.08);transition:transform .22s cubic-bezier(.22,.8,.2,1)}body.viewer-document.is-sidebar-open>header{transform:translate(var(--ok-sidebar-width))}.header-left{position:absolute;left:22px;top:50%;display:inline-flex;min-width:0;align-items:center;gap:10px;transform:translateY(-50%)}.brand{overflow:hidden;color:var(--ok-color-text);font-size:13px;font-weight:680;letter-spacing:-.014em;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.asset-open-raw{position:absolute;right:22px;color:var(--ok-color-muted);font-weight:700;text-decoration:none}.asset-open-raw:hover{color:var(--ok-color-accent)}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}.sidebar-toggle{display:inline-flex;flex:0 0 auto;width:32px;height:32px;align-items:center;justify-content:center;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--ok-color-control-text);cursor:pointer;transition:border-color .14s ease,background-color .14s ease,color .14s ease}.sidebar-toggle:hover,body.is-sidebar-open .sidebar-toggle{border-color:var(--ok-color-control-hover-border);background:var(--ok-color-control-hover-bg);color:var(--ok-color-control-hover-text)}.sidebar-toggle:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.sidebar-toggle-icon{width:19px;height:19px}.sidebar-shortcut{display:inline-flex;min-width:44px;height:22px;align-items:center;justify-content:center;border:1px solid var(--ok-color-search-shortcut-border);border-radius:5px;background:var(--ok-color-search-shortcut-bg);color:var(--ok-color-search-shortcut-text);font:600 11px/1 var(--ok-font-body);pointer-events:none}.control-icon{display:block;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.viewer-settings{position:absolute;top:50%;right:22px;z-index:8;transform:translateY(-50%)}.viewer-settings-trigger{display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--ok-color-control-text);cursor:pointer;transition:border-color .14s ease,background-color .14s ease,color .14s ease}.viewer-settings-trigger:hover,.viewer-settings-trigger[aria-expanded=true]{border-color:var(--ok-color-control-hover-border);background:var(--ok-color-control-hover-bg);color:var(--ok-color-control-hover-text)}.viewer-settings-trigger:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.viewer-settings-icon{width:18px;height:18px}.viewer-settings-menu{position:absolute;top:calc(100% + 9px);right:0;display:grid;gap:10px;width:min(304px,calc(100vw - 36px));max-height:calc(var(--ok-viewport-height) - var(--ok-header-height) - 20px);overflow:auto;overscroll-behavior:contain;padding:12px;border:1px solid var(--ok-color-editor-menu-border);border-radius:12px;background:var(--ok-color-editor-menu-bg);box-shadow:0 12px 32px var(--ok-color-editor-menu-shadow),0 2px 8px var(--ok-color-shadow)}.viewer-settings-menu[hidden]{display:none}.viewer-settings-title{color:var(--ok-color-muted);font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.theme-options{display:grid;grid-template-columns:1fr 1fr;gap:6px}.theme-option{display:flex;min-width:0;min-height:36px;align-items:center;gap:9px;padding:7px 9px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--ok-color-editor-menu-item-text);cursor:pointer;font:600 12px/1 var(--ok-font-body);text-align:left;transition:background-color .14s ease,color .14s ease}.theme-option:hover{background:var(--ok-color-editor-menu-item-hover-bg)}.theme-option:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:1px}.theme-option.is-selected{border-color:var(--ok-color-accent-border);background:var(--ok-color-accent-selected);color:var(--ok-color-accent-strong)}.theme-swatch{flex:0 0 auto;width:18px;height:18px;border:1px solid var(--ok-color-editor-option-border);border-radius:999px;background:linear-gradient(135deg,#f0f0f0 0,#f0f0f0 50%,#0f7a4d 50%);box-shadow:0 0 0 2px var(--ok-color-editor-option-bg)}.theme-swatch-default{background:linear-gradient(135deg,#f4f5f4 0,#f4f5f4 50%,#0b7a53 50%)}.theme-swatch-night{background:linear-gradient(135deg,#0d100e 0,#0d100e 50%,#68e0ad 50%)}.theme-swatch-paper{background:linear-gradient(135deg,#f7f1e6 0,#f7f1e6 50%,#9b4f1f 50%)}.theme-swatch-ocean{background:linear-gradient(135deg,#eef6f8 0,#eef6f8 50%,#0f6f8f 50%)}.theme-swatch-rose{background:linear-gradient(135deg,#fbf3f6 0,#fbf3f6 50%,#b33b6b 50%)}.theme-swatch-custom{background:conic-gradient(from 90deg,var(--ok-color-accent),var(--ok-color-surface),var(--ok-color-text),var(--ok-color-accent))}.theme-custom-fields{display:grid;grid-template-columns:1fr 1fr;gap:7px 8px;padding-top:8px;border-top:1px solid var(--ok-color-editor-menu-separator)}.theme-custom-fields[hidden]{display:none}.theme-custom-fields label{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:8px;color:var(--ok-color-muted);font-size:12px;font-weight:700}.theme-custom-fields input{flex:0 0 auto;width:34px;height:26px;padding:0;overflow:hidden;border:1px solid var(--ok-color-editor-trigger-border);border-radius:5px;background:transparent;cursor:pointer}.theme-custom-fields input:focus-visible{border-color:var(--ok-color-editor-trigger-focus-border);box-shadow:0 0 0 2px var(--ok-color-accent-focus);outline:none}.viewer-settings-section{display:grid;gap:7px;padding-top:9px;border-top:1px solid var(--ok-color-editor-menu-separator)}.viewer-setting-toggle{position:relative;display:flex;min-width:0;align-items:center;justify-content:space-between;gap:14px;padding:7px 8px;border-radius:6px;color:var(--ok-color-editor-menu-item-text);cursor:pointer}.viewer-setting-toggle:hover{background:var(--ok-color-editor-menu-item-hover-bg)}.viewer-setting-copy{display:grid;min-width:0;gap:3px}.viewer-setting-copy strong{color:inherit;font-size:12px;line-height:1.2}.viewer-setting-copy small{color:var(--ok-color-muted);font-size:11px;line-height:1.3}.viewer-setting-toggle input{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none}.viewer-setting-switch{position:relative;flex:0 0 auto;width:34px;height:20px;border:1px solid var(--ok-color-editor-trigger-border);border-radius:999px;background:var(--ok-color-page);transition:border-color .14s ease,background-color .14s ease}.viewer-setting-switch:after{position:absolute;top:3px;left:3px;width:12px;height:12px;border-radius:999px;background:var(--ok-color-muted);content:"";transition:background-color .14s ease,transform .14s ease}.viewer-setting-toggle input:checked+.viewer-setting-switch{border-color:var(--ok-color-accent-border-strong);background:var(--ok-color-accent-soft)}.viewer-setting-toggle input:checked+.viewer-setting-switch:after{background:var(--ok-color-accent);transform:translate(14px)}.viewer-setting-toggle input:focus-visible+.viewer-setting-switch{box-shadow:0 0 0 3px var(--ok-color-accent-focus);outline:1px solid var(--ok-color-accent-border-strong)}.viewer-setting-select{display:grid;gap:5px;padding:7px 8px;border-radius:6px;color:var(--ok-color-editor-menu-item-text)}.viewer-setting-select:hover,.viewer-setting-select:focus-within{background:var(--ok-color-editor-menu-item-hover-bg)}.viewer-setting-select select{width:100%;min-height:30px;padding:5px 28px 5px 8px;border:1px solid var(--ok-color-editor-trigger-border);border-radius:6px;background:var(--ok-color-editor-trigger-bg);color:var(--ok-color-editor-trigger-text);cursor:pointer;font:12px/1.2 var(--ok-font-body)}.viewer-setting-select select:focus-visible{border-color:var(--ok-color-editor-trigger-focus-border);box-shadow:0 0 0 2px var(--ok-color-accent-focus);outline:2px solid var(--ok-color-focus-ring);outline-offset:1px}.viewer-settings-footer{position:sticky;bottom:-12px;display:flex;justify-content:flex-end;margin:0 -12px -12px;padding:10px 12px 12px;border-top:1px solid var(--ok-color-editor-menu-separator);background:var(--ok-color-editor-menu-bg);box-shadow:0 -10px 18px var(--ok-color-editor-menu-bg)}.viewer-settings-reset{min-height:30px;padding:5px 9px;border:1px solid var(--ok-color-editor-trigger-border);border-radius:7px;background:var(--ok-color-editor-trigger-bg);color:var(--ok-color-editor-trigger-text);cursor:pointer;font:700 11px/1 var(--ok-font-body)}.viewer-settings-reset:hover{border-color:var(--ok-color-editor-trigger-focus-border);background:var(--ok-color-code-inline-bg);color:var(--ok-color-text)}.viewer-settings-reset:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.file-sidebar{position:fixed;top:0;bottom:0;left:0;z-index:7;display:flex;width:var(--ok-sidebar-width);flex-direction:column;border-right:1px solid var(--ok-color-sidebar-border);background:var(--ok-color-sidebar);box-shadow:12px 0 36px var(--ok-color-shadow);transform:translate(-100%);transition:transform .22s cubic-bezier(.22,.8,.2,1)}body.is-sidebar-open .file-sidebar{transform:translate(0)}.file-sidebar-head{display:flex;min-height:var(--ok-header-height);align-items:center;justify-content:space-between;gap:12px;padding:0 14px 0 18px;border-bottom:1px solid var(--ok-color-sidebar-border);background:var(--ok-color-sidebar-header);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);color:var(--ok-color-sidebar-text);font-size:11px;font-weight:700;letter-spacing:.07em;text-transform:uppercase}.file-sidebar-actions{display:inline-flex;align-items:center;gap:4px}.file-sidebar-collapse{min-height:28px;padding:5px 7px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--ok-color-sidebar-text);cursor:pointer;font:650 10px/1 var(--ok-font-body);letter-spacing:0;text-transform:none}.file-sidebar-collapse:hover{border-color:var(--ok-color-close-hover-border);background:var(--ok-color-close-hover-bg);color:var(--ok-color-control-hover-text)}.file-sidebar-collapse:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.file-sidebar-close{display:inline-flex;flex:0 0 auto;width:30px;height:30px;align-items:center;justify-content:center;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--ok-color-close-text);cursor:pointer}.file-sidebar-close:hover{border-color:var(--ok-color-close-hover-border);background:var(--ok-color-close-hover-bg);color:var(--ok-color-control-hover-text)}.file-sidebar-close:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.search.header-search{position:relative;z-index:6;width:min(460px,42vw);min-width:240px;margin:0}.search-field{position:relative;display:flex;align-items:center}.header-search .search-input{height:36px;min-height:0;padding:7px 48px 7px 12px;border-color:var(--ok-color-search-input-border);border-radius:9px;background:var(--ok-color-search-input-bg);box-shadow:0 1px 2px var(--ok-color-shadow);font-size:13px;transition:border-color .14s ease,box-shadow .14s ease,background-color .14s ease}.header-search .search-shortcut{position:absolute;right:7px;display:inline-flex;min-width:32px;height:22px;align-items:center;justify-content:center;border:1px solid var(--ok-color-search-shortcut-border);border-radius:5px;background:var(--ok-color-search-shortcut-bg);color:var(--ok-color-search-shortcut-text);font:600 11px/1 var(--ok-font-body);pointer-events:none}.header-search .search-status{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}.header-search .search-results{position:absolute;top:calc(100% + 8px);left:0;right:0;z-index:7;gap:2px;max-height:min(430px,58vh);overflow:auto;overscroll-behavior:contain;padding:7px;border:0;border-radius:12px;background:var(--ok-color-search-popover-bg);box-shadow:0 16px 36px var(--ok-color-search-popover-shadow),0 3px 10px var(--ok-color-shadow)}.header-search .search-result{gap:4px;padding:10px 11px;border:0;border-radius:8px;background:transparent}.header-search .search-result:hover,.header-search .search-result:focus-visible,.header-search .search-result.is-active{border-color:var(--ok-color-search-result-hover-border);background:var(--ok-color-search-result-hover-bg)}.header-search .search-result-title{color:var(--ok-color-text);font-size:13px;font-weight:700;line-height:1.25}.header-search .search-result-meta{color:var(--ok-color-muted);font-size:11px;letter-spacing:.01em;line-height:1.3}.header-search .search-result-snippet{color:var(--ok-color-document-text);font-size:12px;line-height:1.4}.search-result-title-row{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:10px}.search-result-count{flex:0 0 auto;padding:2px 6px;border:1px solid var(--ok-color-accent-border);border-radius:999px;background:var(--ok-color-accent-softer);color:var(--ok-color-accent-strong);font-size:10px;font-weight:700;line-height:1.2}.search-result-headings{overflow:hidden;color:var(--ok-color-muted);font-size:11px;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}.search-result-highlight{padding:0;border-radius:2px;background:var(--ok-color-accent-soft);color:inherit;font:inherit}.header-search .search-empty{padding:18px 14px;color:var(--ok-color-muted);font-size:12px;line-height:1.4;text-align:center}.navigation-mode-toggle{position:absolute;top:50%;right:62px;z-index:8;display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--ok-color-control-text);cursor:pointer;transform:translateY(-50%);transition:border-color .14s ease,background-color .14s ease,color .14s ease}.navigation-mode-toggle:hover,.navigation-mode-toggle[data-mode=beside]{border-color:var(--ok-color-control-hover-border);background:var(--ok-color-control-hover-bg);color:var(--ok-color-control-hover-text)}.navigation-mode-toggle:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.navigation-mode-icon{width:18px;height:18px}.navigation-mode-icon-split,.navigation-mode-toggle[data-mode=beside] .navigation-mode-icon-single{display:none}.navigation-mode-toggle[data-mode=beside] .navigation-mode-icon-split{display:block}.file-sidebar-tree{flex:1 1 auto;width:100%;overflow:auto;padding:8px 10px 20px;scrollbar-color:var(--ok-color-rail-thumb) transparent;scrollbar-width:thin}main{width:min(960px,calc(100% - 32px));margin:0 auto;padding:34px 0 56px}.asset-workspace{width:min(1180px,calc(100% - 32px));min-height:calc(var(--ok-viewport-height) - var(--ok-header-height));padding:22px 0 44px}.asset-panel.document{max-width:none;min-height:min(760px,calc(var(--ok-viewport-height) - 118px));padding:0 28px 30px;overflow:hidden;border:1px solid var(--ok-color-border);border-radius:12px;background:var(--ok-color-surface);box-shadow:0 1px 2px var(--ok-color-shadow),0 12px 36px var(--ok-color-shadow)}.asset-panel .note-chrome{margin:0 -28px 22px;padding-left:28px}.asset-kind{flex:0 0 auto;color:var(--ok-color-muted);font-family:var(--ok-font-mono);font-size:12px}.asset-frame{display:block;width:100%;height:min(78vh,900px);border:1px solid var(--ok-color-border);border-radius:6px;background:var(--ok-color-surface)}.asset-image{display:block;max-width:100%;height:auto;margin:0 auto;border:1px solid var(--ok-color-border);border-radius:6px;background:var(--ok-color-surface)}.asset-video,.asset-audio{display:block;width:100%}.asset-download{margin:0;color:var(--ok-color-muted)}.workspaces{margin:0 0 28px}.sidebar-label{margin:0 0 8px;color:var(--ok-color-muted);font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.workspace-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:9px}.workspace{display:grid;gap:2px;min-width:0;padding:10px 11px;border:1px solid var(--ok-color-card-border);border-radius:6px;background:var(--ok-color-card-bg);color:inherit;text-decoration:none}.workspace:hover,.workspace:focus-visible,.workspace.active{border-color:var(--ok-color-accent-border);background:var(--ok-color-card-hover-bg);outline:none}.workspace-name{overflow:hidden;color:var(--ok-color-text);font-weight:700;text-overflow:ellipsis;white-space:nowrap}.workspace-root{overflow:hidden;color:var(--ok-color-muted);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.note-workspace{position:relative;display:flex;width:100%;height:calc(var(--ok-viewport-height) - var(--ok-header-height));margin:0;padding:0;overflow:auto hidden;background:var(--ok-color-viewer-canvas);scroll-behavior:smooth;overscroll-behavior-x:contain;transition:transform .22s cubic-bezier(.22,.8,.2,1)}body.viewer-document.is-sidebar-open>.note-workspace{transform:translate(var(--ok-sidebar-width))}.note-stack{position:relative;z-index:1;display:flex;flex:0 0 auto;align-self:stretch;align-items:stretch;gap:16px;min-width:max-content;min-height:0;padding:16px max(24px,calc((100vw - 1180px)/2)) 24px 24px}.note-workspace.is-single-panel .note-stack{box-sizing:border-box;flex-basis:100%;min-width:100%;justify-content:center;padding-left:max(24px,calc((100vw - 1180px)/2));padding-right:max(24px,calc((100vw - 1180px)/2))}.note-workspace.is-single-panel,.note-workspace.is-multi-panel{scrollbar-width:none}.note-workspace.is-single-panel::-webkit-scrollbar,.note-workspace.is-multi-panel::-webkit-scrollbar{width:0;height:0}.note-workspace.is-single-panel .note-stack,.note-workspace.is-multi-panel .note-stack{padding-bottom:50px}.note-workspace.is-space-panning,.note-workspace.is-drag-scrolling{scroll-behavior:auto}.note-workspace.is-empty{overflow-x:hidden;overflow-y:auto}.note-workspace.is-empty .note-stack{display:none}.workspace-scroll-rail{position:fixed;right:max(190px,calc((100vw - 1180px)/2));bottom:11px;left:22px;z-index:4;display:flex;height:18px;align-items:center;padding:7px 0;opacity:.58;transition:transform .22s cubic-bezier(.22,.8,.2,1),opacity .16s ease}.workspace-scroll-rail[hidden]{display:none}body.viewer-document.is-sidebar-open>.workspace-scroll-rail{transform:translate(var(--ok-sidebar-width))}.workspace-scroll-rail:hover,.workspace-scroll-rail:focus-within,.workspace-scroll-rail.is-rail-dragging{opacity:1}.workspace-scroll-track{position:relative;flex:1 1 auto;height:1px;border-radius:999px;background:var(--ok-color-rail-track);cursor:pointer}.workspace-scroll-thumb{position:absolute;top:50%;left:0;min-width:44px;height:3px;border:0;border-radius:999px;background:var(--ok-color-rail-thumb);cursor:grab;transform:translate(var(--thumb-x, 0px),-50%);transition:height .14s ease,background-color .14s ease}.workspace-scroll-thumb:hover,.workspace-scroll-thumb:focus-visible,.workspace-scroll-rail.is-rail-dragging .workspace-scroll-thumb{height:5px;background:var(--ok-color-rail-thumb-hover);outline:none}.workspace-scroll-rail.is-rail-dragging .workspace-scroll-thumb{cursor:grabbing}.powered-by-openknowledge{position:fixed;right:22px;bottom:14px;z-index:4;color:var(--ok-color-muted);font-size:10px;font-weight:650;line-height:1;text-decoration:none;opacity:.82;transition:color .16s ease,opacity .16s ease,transform .22s cubic-bezier(.22,.8,.2,1)}body.viewer-document.is-sidebar-open>.powered-by-openknowledge{transform:translate(var(--ok-sidebar-width))}.powered-by-openknowledge:hover,.powered-by-openknowledge:focus-visible{color:var(--ok-color-accent);opacity:1;outline:none}.knowledge-empty{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;overflow:auto;background:var(--ok-color-viewer-canvas)}.knowledge-empty[hidden]{display:none}.knowledge-empty-inner{display:grid;min-height:100%;grid-template-columns:minmax(210px,260px) minmax(0,1fr);gap:28px;padding:32px max(24px,calc((100vw - 1420px)/2)) 42px}.knowledge-empty-pane{min-width:0;min-height:0}.knowledge-graph-sidebar{position:sticky;top:26px;align-self:start;padding:12px 24px 12px 4px;border-right:1px solid var(--ok-color-border)}.knowledge-graph-info{display:grid;gap:7px}.knowledge-graph-info h2{margin:0;padding:0;border:0;color:var(--ok-color-text);font-size:15px;line-height:1.3}.knowledge-graph-info p{margin:0;color:var(--ok-color-muted);font-size:12px;line-height:1.5}.knowledge-graph-info .knowledge-graph-status{margin-top:9px;padding-top:12px;border-top:1px solid var(--ok-color-border);color:var(--ok-color-accent-strong);font-weight:700;overflow-wrap:anywhere}.knowledge-empty-graph{position:sticky;top:26px;align-self:start;min-height:min(640px,calc(var(--ok-viewport-height) - 132px));overflow:hidden}.knowledge-graph-canvas{display:block;width:100%;height:min(640px,calc(var(--ok-viewport-height) - 132px));min-height:440px;outline:none}.knowledge-graph-canvas:focus-visible{outline:2px solid var(--ok-color-accent-border-strong);outline-offset:-3px}.knowledge-tree{width:min(720px,100%);color:var(--ok-color-tree-text);font-family:var(--ok-font-body);font-size:13px}.tree-row{display:flex;min-height:30px;align-items:center;gap:8px;padding:4px 9px 4px var(--indent);border-radius:7px;color:inherit;text-decoration:none}.tree-row[hidden]{display:none}.tree-directory{margin:7px 0 1px;background:transparent;color:var(--ok-color-tree-directory-text);cursor:pointer;font-weight:650;letter-spacing:-.006em}.file-sidebar .tree-directory{background:transparent;color:var(--ok-color-sidebar-text)}.tree-directory:before{content:none}.tree-directory:hover,.tree-directory:focus-visible{background:var(--ok-color-accent-softer);color:var(--ok-color-accent-strong);outline:none}.tree-directory:focus-visible{box-shadow:inset 0 0 0 2px var(--ok-color-focus-ring)}.tree-directory-icon{flex:0 0 auto;width:14px;height:14px;transform:rotate(-90deg);transition:transform .14s ease}.tree-directory[aria-expanded=true] .tree-directory-icon{transform:rotate(0)}.tree-file:hover{background:var(--ok-color-accent-softer);color:var(--ok-color-accent)}.tree-file.is-current-file{background:var(--ok-color-accent-selected);color:var(--ok-color-accent-strong);font-weight:700}.file-sidebar .tree-file:hover{background:var(--ok-color-sidebar-tree-hover-bg)}.tree-file-name{flex:0 1 auto;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tree-file-system{flex:0 0 auto;padding:1px 5px;border:1px solid var(--ok-color-tree-badge-border);border-radius:999px;color:var(--ok-color-tree-badge-text);font-size:10px;line-height:1.2;text-transform:lowercase}h1{margin:0 0 10px;font-size:34px;line-height:1.15}h2{margin-top:32px;padding-top:16px;border-top:1px solid var(--ok-color-border)}h3{margin-top:26px}hr{margin:28px 0;border:0;border-top:1px solid var(--ok-color-border)}.lede{margin:0 0 26px;color:var(--ok-color-muted)}.error{color:var(--ok-color-danger)}.search{position:relative;margin:0 0 22px}.search-label{display:block;margin:0 0 7px;color:var(--ok-color-muted);font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.search-input{width:100%;min-height:42px;border:1px solid var(--ok-color-search-input-border);border-radius:6px;background:var(--ok-color-surface);color:var(--ok-color-text);font:inherit;padding:8px 11px}.search-input:focus{border-color:var(--ok-color-accent-border-strong);box-shadow:0 0 0 3px var(--ok-color-accent-focus);outline:2px solid var(--ok-color-focus-ring);outline-offset:1px}.search-status{min-height:20px;margin-top:8px;color:var(--ok-color-muted);font-size:13px}.search-results{display:grid;gap:7px;margin-top:8px}.search-results[hidden]{display:none}.search-result{display:grid;gap:2px;padding:10px 11px;border:1px solid var(--ok-color-card-border);border-radius:6px;background:var(--ok-color-card-bg);color:inherit;text-decoration:none}.search-result:hover,.search-result:focus-visible,.search-result.is-active{border-color:var(--ok-color-accent-border);background:var(--ok-color-card-hover-bg);outline:none}.search-result-title{color:var(--ok-color-text);font-weight:700}.search-result-meta,.search-result-snippet,.search-result-headings{color:var(--ok-color-muted);font-size:13px}.list{border-top:1px solid var(--ok-color-border)}.row{display:grid;grid-template-columns:minmax(180px,1fr) minmax(160px,.7fr);gap:12px;padding:12px 0;border-bottom:1px solid var(--ok-color-border);color:inherit;text-decoration:none}.row:hover .path{color:var(--ok-color-accent)}.path{font-family:var(--ok-font-mono);font-size:14px}.meta,.issue{color:var(--ok-color-muted);font-size:13px}.issue{grid-column:1 / -1;color:var(--ok-color-danger)}.document{max-width:780px}.note-panel.document{position:relative;flex:0 0 var(--note-panel-width, var(--ok-note-panel-default-width));max-width:none;min-width:var(--ok-note-panel-min-width);min-height:0;padding:0 34px 34px;overflow-x:hidden;overflow-y:auto;border:1px solid var(--ok-color-border);border-radius:12px;background:var(--ok-color-surface);box-shadow:0 1px 2px var(--ok-color-shadow),0 12px 36px var(--ok-color-shadow);outline:none;scroll-padding-top:66px;scrollbar-color:var(--ok-color-rail-thumb) transparent;scrollbar-width:thin}.note-panel:focus{border-color:var(--ok-color-accent-border);box-shadow:0 0 0 3px var(--ok-color-accent-focus),0 1px 2px var(--ok-color-shadow),0 12px 36px var(--ok-color-shadow)}.note-panel.is-entering{animation:note-enter .28s cubic-bezier(.22,.8,.2,1)}body.is-view-transitioning .note-panel.is-entering{animation:none}.note-resize-handle{position:absolute;top:0;bottom:0;z-index:3;width:14px;padding:0;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ok-color-note-resize-hitarea);color:transparent;cursor:ew-resize;pointer-events:auto;touch-action:none;transform:translateY(var(--note-panel-scroll-top, 0px));will-change:transform}.note-resize-handle-left{left:-7px}.note-resize-handle-right{right:8px}.note-resize-handle:after{position:absolute;top:10px;bottom:10px;left:6px;width:2px;border-radius:999px;background:transparent;content:"";transition:background-color .12s ease}.note-resize-handle-right:after{left:auto;right:-9px}.note-resize-handle:hover:after,.note-resize-handle:focus-visible:after,.note-panel.is-panel-resizing .note-resize-handle:after{background:var(--ok-color-note-resize-active)}.note-resize-handle:focus-visible{outline:none}body.is-panel-resizing,body.is-panel-resizing *{cursor:ew-resize!important;-webkit-user-select:none;user-select:none}.note-chrome{position:sticky;top:0;z-index:5;display:flex;min-height:52px;align-items:center;justify-content:space-between;gap:14px;margin:0 -34px 28px;padding:0 12px 0 34px;border-bottom:1px solid var(--ok-color-border);background:var(--ok-color-note-chrome-bg);backdrop-filter:blur(16px) saturate(1.04);-webkit-backdrop-filter:blur(16px) saturate(1.04)}.note-path{display:flex;flex:1 1 auto;min-width:0;align-items:center;gap:2px;overflow:hidden;color:var(--ok-color-muted);font-family:var(--ok-font-mono);font-size:11.5px;letter-spacing:-.01em;white-space:nowrap}.note-breadcrumb-link,.note-breadcrumb-label{min-width:0;overflow:hidden;padding:3px 4px;border-radius:5px;color:inherit;text-decoration:none;text-overflow:ellipsis}.note-breadcrumb-link:hover,.note-breadcrumb-link:focus-visible{background:var(--ok-color-code-inline-bg);color:var(--ok-color-accent-strong);outline:none}.note-breadcrumb-link:focus-visible{box-shadow:0 0 0 2px var(--ok-color-accent-focus)}.note-breadcrumb-current{color:var(--ok-color-text);font-weight:650}.note-breadcrumb-separator{flex:0 0 auto;color:var(--ok-color-muted);opacity:.52}.note-actions{display:flex;flex:0 0 auto;align-items:center;gap:7px}.source-open{display:inline-flex;flex:0 0 auto;width:32px;height:30px;align-items:center;justify-content:center;border:1px solid var(--ok-color-editor-trigger-border);border-radius:8px;background:var(--ok-color-editor-trigger-bg);color:var(--ok-color-editor-trigger-text);box-shadow:0 1px 0 var(--ok-color-editor-trigger-shadow) inset;text-decoration:none;transition:border-color .14s ease,background-color .14s ease,color .14s ease}.source-open:hover{border-color:var(--ok-color-editor-trigger-focus-border);background:var(--ok-color-code-inline-bg);color:var(--ok-color-text)}.source-open:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.source-icon{width:17px;height:17px;fill:currentColor;stroke:none}.editor-picker{position:relative;flex:0 0 auto}.note-panel:not(.is-active-panel) .editor-picker{display:none}.editor-trigger{display:inline-flex;min-width:58px;height:30px;align-items:stretch;justify-content:center;overflow:hidden;border:1px solid var(--ok-color-editor-trigger-border);border-radius:8px;background:var(--ok-color-editor-trigger-bg);color:var(--ok-color-editor-trigger-text);line-height:1;box-shadow:0 1px 0 var(--ok-color-editor-trigger-shadow) inset}.editor-open,.editor-menu-trigger{display:inline-flex;height:100%;align-items:center;justify-content:center;border:0;background:transparent;color:inherit;cursor:pointer;font:inherit;line-height:1;text-decoration:none}.editor-open{min-width:32px;padding:0 6px}.editor-menu-trigger{width:25px;padding:0;border-left:1px solid var(--ok-color-editor-trigger-separator)}.editor-open:hover,.editor-open:focus-visible,.editor-menu-trigger:hover,.editor-menu-trigger:focus-visible{background:var(--ok-color-code-inline-bg);color:var(--ok-color-text);outline:none}.editor-trigger:focus-within{border-color:var(--ok-color-editor-trigger-focus-border);outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.editor-open .editor-mark{border:0;background:transparent}.editor-mark{display:inline-flex;min-width:20px;height:20px;align-items:center;justify-content:center;border:1px solid var(--ok-color-editor-mark-border);border-radius:5px;background:var(--ok-color-editor-mark-bg);color:var(--ok-color-editor-mark-text);font-size:10px;font-weight:700;line-height:1}.editor-mark[data-has-icon=true]{min-width:22px;height:22px;background:var(--ok-color-editor-mark-bg)}.editor-icon{display:block;width:18px;height:18px;border-radius:4px;object-fit:contain}.editor-caret{width:14px;height:14px;color:var(--ok-color-editor-caret)}.editor-menu{position:absolute;top:calc(100% + 9px);right:0;z-index:4;width:max-content;min-width:210px;max-width:min(280px,calc(100vw - 36px));max-height:min(420px,calc(var(--ok-viewport-height) - 90px));overflow:auto;overscroll-behavior:contain;padding:6px;border:1px solid var(--ok-color-editor-menu-border);border-radius:11px;background:var(--ok-color-editor-menu-bg);box-shadow:0 12px 32px var(--ok-color-editor-menu-shadow),0 2px 8px var(--ok-color-shadow)}.editor-menu[hidden]{display:none}.editor-menu-item{display:flex;width:100%;min-height:36px;align-items:center;gap:10px;padding:7px 9px;border:0;border-radius:8px;background:transparent;color:var(--ok-color-editor-menu-item-text);cursor:pointer;font:inherit;text-align:left}.editor-menu-item:hover{background:var(--ok-color-editor-menu-item-hover-bg)}.editor-menu-item:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:-2px}.editor-menu-item.is-selected{background:var(--ok-color-accent-selected);color:var(--ok-color-accent-strong)}.editor-option-mark{display:inline-flex;flex:0 0 24px;height:22px;align-items:center;justify-content:center;border:1px solid var(--ok-color-editor-option-border);border-radius:5px;background:var(--ok-color-editor-option-bg);color:var(--ok-color-editor-option-text);font-size:10px;font-weight:700;line-height:1}.editor-option-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.editor-menu-separator{height:1px;margin:6px 4px;background:var(--ok-color-editor-menu-separator)}.note-close{display:inline-flex;flex:0 0 auto;width:30px;height:30px;align-items:center;justify-content:center;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--ok-color-note-close-text);cursor:pointer;font:inherit;line-height:1;text-decoration:none;transition:border-color .14s ease,background-color .14s ease,color .14s ease}.note-close:hover{border-color:var(--ok-color-note-close-hover-border);background:var(--ok-color-code-inline-bg);color:var(--ok-color-note-close-hover-text)}.note-close:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.note-close-icon{width:16px;height:16px}.note-body{max-width:var(--ok-note-body-max-width, 70ch);margin:0 auto;padding-bottom:10vh;font-size:var(--ok-document-font-size, 15.5px);line-height:var(--ok-document-line-height, 1.62);letter-spacing:var(--ok-document-letter-spacing, normal)}html[data-viewer-underlines=off] .note-body a,.note-body a{text-decoration:none!important;text-decoration-line:none!important}html[data-viewer-underlines=on] .note-body a,body.is-links-underlined .note-body a{text-decoration:underline!important;text-decoration-line:underline!important;text-decoration-thickness:.08em;text-underline-offset:.16em}html[data-viewer-contrast=high]{--ok-color-document-text: var(--ok-color-text) !important;--ok-color-muted: var(--ok-color-text) !important;--ok-color-border: var(--ok-color-text) !important;--ok-color-focus-ring: var(--ok-color-text) !important;--ok-color-control-text: var(--ok-color-text) !important}body.is-frontmatter-hidden .ok-frontmatter{display:none}.ok-frontmatter{margin:0 0 30px;overflow:hidden;border:1px solid var(--ok-color-border);border-radius:10px;background:var(--ok-color-surface)}.ok-frontmatter-summary{display:flex;min-height:42px;align-items:center;gap:10px;padding:8px 13px;color:var(--ok-color-text);cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;transition:background-color .14s ease}.ok-frontmatter-summary::-webkit-details-marker{display:none}.ok-frontmatter-summary:after{width:7px;height:7px;margin:-4px 2px 0 auto;border-right:1.5px solid var(--ok-color-muted);border-bottom:1.5px solid var(--ok-color-muted);content:"";transform:rotate(45deg);transition:transform .14s ease}.ok-frontmatter[open]>.ok-frontmatter-summary:after{margin-top:3px;transform:rotate(225deg)}.ok-frontmatter-summary:hover{background:var(--ok-color-control-hover-bg)}.ok-frontmatter-summary:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:-2px}.ok-frontmatter-title{font-size:13px;font-weight:650;letter-spacing:-.006em}.ok-frontmatter-count{color:var(--ok-color-muted);font-size:11px}.ok-frontmatter-body{padding:11px 14px 14px;border-top:1px solid var(--ok-color-border);background:var(--ok-color-page)}.document .ok-frontmatter-notice{margin:0 0 10px;padding:7px 9px;border-radius:6px;background:var(--ok-color-accent-softer);color:var(--ok-color-muted);font-size:12px}.ok-frontmatter-map{display:grid;gap:0;margin:0}.ok-frontmatter-row{display:grid;grid-template-columns:minmax(96px,.34fr) minmax(0,1fr);gap:12px;padding:8px 0;border-bottom:1px solid var(--ok-color-border)}.ok-frontmatter-row:last-child{border-bottom:0}.ok-frontmatter-key{min-width:0;margin:0}.ok-frontmatter-key code{display:inline;padding:0;background:transparent;color:var(--ok-color-text);font-size:12px;overflow-wrap:anywhere}.ok-frontmatter-value{display:flex;min-width:0;flex-wrap:wrap;align-items:center;gap:6px 8px;margin:0;color:var(--ok-color-document-text)}.ok-frontmatter-scalar{min-width:0;overflow-wrap:anywhere}.ok-frontmatter-string{white-space:pre-wrap}.ok-frontmatter-multiline{display:block;width:100%;padding:7px 9px;border-radius:6px;background:var(--ok-color-code-inline-bg);font-family:var(--ok-font-mono);font-size:12px}.ok-frontmatter-number{font-family:var(--ok-font-mono);font-size:12px;font-variant-numeric:tabular-nums}.ok-frontmatter-null,.ok-frontmatter-empty{color:var(--ok-color-muted);font-family:var(--ok-font-mono);font-size:12px;font-style:italic}.ok-frontmatter-boolean{display:inline-flex;align-items:center;gap:5px;padding:3px 7px;border-radius:999px;background:var(--ok-color-accent-soft);color:var(--ok-color-accent-strong);font:700 11px/1 var(--ok-font-mono)}.ok-frontmatter-boolean[data-value=false]{background:var(--ok-color-code-inline-bg);color:var(--ok-color-muted)}.ok-frontmatter-boolean-dot{width:6px;height:6px;border-radius:999px;background:currentColor}.ok-frontmatter-link{min-width:0;overflow-wrap:anywhere}.document .ok-frontmatter-chips{display:flex;min-width:0;flex-wrap:wrap;gap:5px;margin:0;padding:0;list-style:none}.document .ok-frontmatter-chip{display:inline-flex;min-width:0;align-items:center;margin:0;padding:4px 8px;border:1px solid var(--ok-color-border);border-radius:999px;background:var(--ok-color-surface);color:var(--ok-color-document-text);font-size:11px;line-height:1.2}.document .ok-frontmatter-tag{padding:0;overflow:hidden}.ok-frontmatter-tag-link{display:inline-flex;min-width:0;align-items:center;padding:4px 8px;border-radius:inherit;color:inherit;text-decoration:none;transition:background-color .14s ease,color .14s ease}.ok-frontmatter-tag-link:hover,.ok-frontmatter-tag-link:focus-visible{background:var(--ok-color-accent-soft);color:var(--ok-color-accent-strong);outline:none}.ok-frontmatter-tag-link:focus-visible{box-shadow:inset 0 0 0 2px var(--ok-color-focus-ring)}.ok-frontmatter-chip .ok-frontmatter-boolean{padding:0;background:transparent}.ok-frontmatter-value>.ok-frontmatter-map,.ok-frontmatter-list-value>.ok-frontmatter-map{width:100%;padding:2px 0 0 10px;border-left:2px solid var(--ok-color-border)}.ok-frontmatter-value>.ok-frontmatter-map .ok-frontmatter-row,.ok-frontmatter-list-value>.ok-frontmatter-map .ok-frontmatter-row{grid-template-columns:minmax(86px,.3fr) minmax(0,1fr);padding:7px 0 7px 9px}.document .ok-frontmatter-list{display:grid;width:100%;gap:8px;margin:2px 0 0;padding:0;list-style:none}.document .ok-frontmatter-list-item{display:grid;grid-template-columns:22px minmax(0,1fr);gap:8px;margin:0;padding:8px;border:1px solid var(--ok-color-border);border-radius:6px;background:var(--ok-color-surface)}.ok-frontmatter-index{display:inline-flex;width:22px;height:22px;align-items:center;justify-content:center;border-radius:999px;background:var(--ok-color-code-inline-bg);color:var(--ok-color-muted);font:700 10px/1 var(--ok-font-mono)}.ok-frontmatter-list-value{display:flex;min-width:0;flex-wrap:wrap;align-items:center;gap:6px 8px}.document p,.document li{color:var(--ok-color-document-text)}.document h1{margin:0 0 20px;color:var(--ok-color-text);font-size:30px;font-weight:700;letter-spacing:-.03em;line-height:1.16}.document h2{margin:40px 0 13px;padding-top:0;border-top:0;color:var(--ok-color-text);font-size:21px;font-weight:680;letter-spacing:-.018em;line-height:1.25}.document h3{margin:28px 0 10px;color:var(--ok-color-text);font-size:17px;font-weight:680;letter-spacing:-.012em;line-height:1.3}.document h1 code,.document h2 code,.document h3 code{padding:0;border-radius:0;background:transparent;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit}.document p{margin:0 0 16px}.document ul,.document ol{margin:10px 0 20px;padding-left:22px}.document li{padding-left:2px;line-height:1.48}.document li+li{margin-top:6px}.document li::marker{color:var(--ok-color-muted)}.document h2+ul,.document h2+ol,.document h3+ul,.document h3+ol{margin-top:8px}a{color:var(--ok-color-accent);text-underline-offset:3px}a:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.note-body a{border-radius:4px;transition:background-color .16s ease,color .16s ease}.note-body a:hover,.note-body a.is-active-note{background:var(--ok-color-accent-soft)}.note-body a.is-active-note{color:var(--ok-color-accent-strong)}.ok-search-highlight{border-radius:4px;background:#f59e0b57;box-shadow:0 0 0 2px #f59e0b70;color:inherit}strong{color:var(--ok-color-text);font-weight:700}blockquote{margin:20px 0;padding:2px 0 2px 18px;border-left:3px solid var(--ok-color-border);color:var(--ok-color-muted)}blockquote p{color:var(--ok-color-muted)}.ok-agent-footer{margin-top:32px;padding-top:18px;border-top:1px solid var(--ok-color-border);color:var(--ok-color-muted);font-size:14px;opacity:.82}.ok-agent-footer blockquote{margin:0;padding:0;border-left:0;color:inherit}.ok-agent-footer blockquote p,.ok-agent-footer li,.ok-agent-footer strong{color:inherit}.ok-agent-footer a{color:var(--ok-color-muted);text-decoration-color:var(--ok-color-border)}.ok-agent-footer a:hover{background:transparent;color:var(--ok-color-accent)}code{padding:1px 4px;border-radius:4px;background:var(--ok-color-code-inline-bg);font-family:var(--ok-font-mono);font-size:.9em;letter-spacing:-.012em}pre,.code-block{overflow-x:auto;margin:22px 0 26px;padding:16px 18px;border:1px solid var(--ok-color-border);border-radius:10px;background:var(--ok-color-code-block-bg);color:var(--ok-color-code-block-text);font:400 .94em/1.6 var(--ok-font-mono);box-shadow:0 8px 24px var(--ok-color-shadow)}pre code,.code-block code{display:block;min-width:max-content;padding:0;background:transparent;color:inherit;font:inherit;white-space:pre}.code-block{position:relative;scrollbar-color:var(--ok-color-rail-thumb) transparent;-moz-tab-size:2;tab-size:2}.code-block[data-language]{padding-top:34px}.code-block[data-language]:before{position:absolute;top:11px;left:18px;color:var(--ok-color-syntax-comment);content:attr(data-language);font:600 11px/1 var(--ok-font-body);opacity:.78}.ok-mermaid{display:grid;gap:10px;margin:22px 0 26px}.ok-mermaid .code-block{margin:0}.ok-mermaid-output{width:100%;overflow:auto;padding:18px;border:1px solid var(--ok-color-border);border-radius:10px;background:var(--ok-color-surface);box-shadow:0 8px 24px var(--ok-color-shadow);scrollbar-color:var(--ok-color-rail-thumb) transparent}.ok-mermaid-output[hidden],.ok-mermaid-error[hidden],.ok-mermaid [data-mermaid-source][hidden]{display:none}.ok-mermaid-output svg{display:block;width:100%;max-width:100%;height:auto;margin:0 auto}.ok-mermaid-error{margin:0;padding:9px 11px;border:1px solid var(--ok-color-border);border-radius:7px;background:var(--ok-color-accent-softer);color:var(--ok-color-danger);font-size:12px;line-height:1.45}.asset-code .code-block,.asset-text .code-block{margin:0;min-height:440px}.ok-table-wrap{--ok-table-inner-radius: 6px;max-width:100%;margin:24px 0 28px;overflow:visible;border:1px solid var(--ok-color-border);border-radius:7px;background:var(--ok-color-surface)}.ok-table-scroller{overflow-x:auto;border-radius:0 0 var(--ok-table-inner-radius) var(--ok-table-inner-radius)}.ok-table-wrap>.ok-table-scroller:first-child{border-radius:var(--ok-table-inner-radius)}.ok-table{width:100%;min-width:max-content;border-collapse:separate;border-spacing:0;color:var(--ok-color-document-text);font-size:14px;line-height:1.42}.ok-table th,.ok-table td{max-width:360px;padding:9px 11px;border:0;border-right:1px solid var(--ok-color-border);border-bottom:1px solid var(--ok-color-border);text-align:left;vertical-align:top;overflow-wrap:anywhere}.ok-table th:last-child,.ok-table td:last-child{border-right:0}.ok-table tbody tr:last-child td{border-bottom:0}.ok-table th{background:var(--ok-color-code-inline-bg);color:var(--ok-color-text);font-size:12px;font-weight:700;letter-spacing:0}.ok-table tbody tr:nth-child(2n) td{background:var(--ok-color-page)}.ok-table tbody tr:hover td{background:var(--ok-color-accent-softer)}.ok-table [data-align=center]{text-align:center}.ok-table [data-align=right]{text-align:right}.ok-table code{overflow-wrap:anywhere;white-space:normal;word-break:break-word}.ok-table th[data-ok-table-sort]{cursor:pointer;-webkit-user-select:none;user-select:none}.ok-table th[data-ok-table-sort]:focus-visible{outline:2px solid var(--ok-color-accent-focus-strong);outline-offset:-2px}.ok-table-sort-indicator{position:relative;display:inline-block;width:8px;height:13px;margin-left:6px;color:var(--ok-color-muted);vertical-align:-2px;opacity:.58}.ok-table-sort-indicator:before,.ok-table-sort-indicator:after{position:absolute;left:0;width:0;height:0;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.ok-table-sort-indicator:before{top:1px;border-bottom:5px solid currentColor}.ok-table-sort-indicator:after{bottom:1px;border-top:5px solid currentColor}.ok-table th[data-sort-direction=asc] .ok-table-sort-indicator:before,.ok-table th[data-sort-direction=desc] .ok-table-sort-indicator:after{color:var(--ok-color-accent);opacity:1}.ok-table th[data-sort-direction=asc] .ok-table-sort-indicator:after,.ok-table th[data-sort-direction=desc] .ok-table-sort-indicator:before{opacity:.2}.ok-table-tools{position:relative;z-index:2;display:flex;align-items:center;gap:8px;padding:7px 8px;border-bottom:1px solid var(--ok-color-border);border-radius:var(--ok-table-inner-radius) var(--ok-table-inner-radius) 0 0;background:var(--ok-color-surface)}.ok-table-tools input,.ok-table-tools select{height:30px;border:1px solid var(--ok-color-search-input-border);border-radius:6px;background:var(--ok-color-search-input-bg);color:var(--ok-color-text);font:12px/1 var(--ok-font-body)}.ok-table-tools input:focus,.ok-table-tools select:focus{border-color:var(--ok-color-accent-border-strong);box-shadow:0 0 0 2px var(--ok-color-accent-focus);outline:2px solid var(--ok-color-focus-ring);outline-offset:1px}.ok-table-search{flex:1 1 150px;min-width:0;padding:5px 8px}.ok-table-filter-menu{position:relative;flex:0 0 auto}.ok-table-filter-menu[open]{z-index:3}.ok-table-filter-trigger{display:inline-flex;height:30px;align-items:center;gap:8px;padding:0 9px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--ok-color-editor-trigger-text);cursor:pointer;font:700 12px/1 var(--ok-font-body);list-style:none;-webkit-user-select:none;user-select:none}.ok-table-filter-trigger::-webkit-details-marker{display:none}.ok-table-filter-trigger:after{width:6px;height:6px;margin-top:-3px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;content:"";transform:rotate(45deg)}.ok-table-filter-trigger:hover{border-color:var(--ok-color-editor-trigger-border);background:var(--ok-color-code-inline-bg);color:var(--ok-color-text)}.ok-table-filter-menu[open] .ok-table-filter-trigger{border-color:var(--ok-color-editor-trigger-focus-border);background:var(--ok-color-code-inline-bg);color:var(--ok-color-text)}.ok-table-filter-menu[open] .ok-table-filter-trigger:after{margin-top:3px;transform:rotate(225deg)}.ok-table-filter-trigger:focus-visible{border-color:var(--ok-color-editor-trigger-focus-border);box-shadow:0 0 0 2px var(--ok-color-accent-focus);outline:2px solid var(--ok-color-focus-ring);outline-offset:1px}.ok-table-filter-panel{position:absolute;top:calc(100% + 6px);right:0;display:grid;gap:8px;width:min(280px,calc(100vw - 48px));padding:8px;border:1px solid var(--ok-color-editor-menu-border);border-radius:8px;background:var(--ok-color-editor-menu-bg);box-shadow:0 16px 38px var(--ok-color-editor-menu-shadow)}.ok-table-filter-list{display:grid;gap:8px;min-width:0}.ok-table-filter-list select{width:100%;max-width:none;padding:5px 26px 5px 8px}.ok-table-clear{height:30px;padding:0 9px;border:1px solid var(--ok-color-editor-trigger-border);border-radius:6px;background:var(--ok-color-editor-trigger-bg);color:var(--ok-color-editor-trigger-text);cursor:pointer;font:700 12px/1 var(--ok-font-body);text-align:center}.ok-table-clear:hover,.ok-table-clear:focus-visible{border-color:var(--ok-color-editor-trigger-focus-border);background:var(--ok-color-code-inline-bg);color:var(--ok-color-text);outline:none}.ok-table-clear:disabled{cursor:default;opacity:.48}.ok-table-count{margin-left:auto;color:var(--ok-color-muted);font-size:12px;white-space:nowrap}.tok-keyword{color:var(--ok-color-syntax-keyword);font-weight:700}.tok-string{color:var(--ok-color-syntax-string)}.tok-number{color:var(--ok-color-syntax-number)}.tok-comment{color:var(--ok-color-syntax-comment);font-style:italic}.tok-command{color:var(--ok-color-syntax-keyword);font-weight:inherit}.tok-flag{color:var(--ok-color-syntax-number)}.tok-variable{color:var(--ok-color-syntax-string)}ul,ol{padding-left:22px}.empty{color:var(--ok-color-muted)}.note-error{color:var(--ok-color-danger)}.theme-custom-fields input:focus-visible,.viewer-setting-select select:focus-visible,.viewer-setting-toggle input:focus-visible+.viewer-setting-switch,.header-search .search-result:focus-visible,.workspace:focus-visible,.workspace-scroll-thumb:focus-visible,.powered-by-openknowledge:focus-visible,.knowledge-graph-canvas:focus-visible,.search-result:focus-visible,.note-resize-handle:focus-visible,.ok-table th[data-ok-table-sort]:focus-visible,.ok-table-clear:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}@keyframes note-enter{0%{opacity:.001;transform:translate(34px) scale(.985)}to{opacity:1;transform:translate(0) scale(1)}}@keyframes stack-view-old{0%{opacity:1;transform:translate(0) scale(1)}to{opacity:.72;transform:translate(-18px) scale(.992)}}@keyframes stack-view-new{0%{opacity:.001;transform:translate(22px) scale(.992)}to{opacity:1;transform:translate(0) scale(1)}}@supports (view-transition-name: none){.note-workspace{view-transition-name:note-workspace}::view-transition-old(root),::view-transition-new(root){animation:none}::view-transition-old(note-workspace),::view-transition-new(note-workspace){animation-duration:.24s;animation-timing-function:cubic-bezier(.22,.8,.2,1);mix-blend-mode:normal}::view-transition-old(note-workspace){animation-name:stack-view-old}::view-transition-new(note-workspace){animation-name:stack-view-new}}@media(prefers-reduced-motion:reduce){.note-workspace{scroll-behavior:auto}.note-panel.is-entering{animation:none}.note-body a{transition:none}}html[data-viewer-motion=reduced] *,html[data-viewer-motion=reduced] *:before,html[data-viewer-motion=reduced] *:after{scroll-behavior:auto!important}html[data-viewer-motion=reduced] *,html[data-viewer-motion=reduced] *:before,html[data-viewer-motion=reduced] *:after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}@media(prefers-reduced-motion:reduce){html[data-viewer-motion=system] *,html[data-viewer-motion=system] *:before,html[data-viewer-motion=system] *:after{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}}html[data-viewer-motion=full] .note-workspace{scroll-behavior:smooth}html[data-viewer-motion=full] .note-panel.is-entering{animation:note-enter .28s cubic-bezier(.22,.8,.2,1)}html[data-viewer-motion=full] .note-body a{transition:background-color .16s ease,color .16s ease}@media(hover:hover)and (pointer:fine){.note-workspace.is-multi-panel{cursor:grab}.note-workspace.is-multi-panel .note-panel{cursor:auto}.note-workspace.is-multi-panel.is-space-panning,.note-workspace.is-multi-panel.is-space-panning *{cursor:grab}.note-workspace.is-multi-panel.is-drag-scrolling,.note-workspace.is-multi-panel.is-drag-scrolling *{cursor:grabbing;-webkit-user-select:none;user-select:none}}@media(max-width:680px){header{display:block}body:not(.viewer-document) header span{display:block;margin-top:4px;overflow-wrap:anywhere}.row{grid-template-columns:1fr}body.viewer-document header{display:flex;height:var(--ok-mobile-header-height);justify-content:flex-end;padding:0 12px}.header-left{left:12px;max-width:42%}.brand{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebar-shortcut{display:none}.navigation-mode-toggle{right:52px}.viewer-settings{right:12px}.search.header-search{width:min(34vw,280px);min-width:0;margin-right:84px}.header-search .search-shortcut{display:none}.header-search .search-input{padding-right:10px}.header-search .search-results{left:auto;width:min(320px,calc(100vw - 24px))}.viewer-settings-menu{width:min(300px,calc(100vw - 24px))}.note-workspace{height:calc(var(--ok-viewport-height) - var(--ok-mobile-header-height))}.note-stack{gap:12px;padding:8px 12px 12px}.note-workspace.is-single-panel .note-stack{padding-left:12px;padding-right:12px}.note-workspace.is-single-panel .note-stack,.note-workspace.is-multi-panel .note-stack{padding-bottom:18px}.workspace-scroll-rail{right:12px;bottom:8px;left:12px}.powered-by-openknowledge{right:12px;bottom:28px;font-size:8px}body.viewer-document.is-sidebar-open>.workspace-scroll-rail,body.viewer-document.is-sidebar-open>.powered-by-openknowledge{display:none}.knowledge-empty-inner{grid-template-columns:1fr;gap:22px;padding:28px 14px 44px}.knowledge-graph-sidebar{position:relative;top:auto;padding:0 0 18px;border-right:0;border-bottom:1px solid var(--ok-color-border)}.knowledge-empty-graph{position:relative;top:auto;min-height:380px}.knowledge-graph-canvas{height:380px;min-height:380px}.note-panel.document{--ok-note-panel-default-width: calc(100vw - 24px) ;--ok-note-panel-min-width: min(360px, calc(100vw - 24px) );padding:0 22px 28px;border-radius:11px}.note-chrome{margin:0 -22px 24px;padding:0 10px 0 22px}.document h1{font-size:28px}.ok-frontmatter-row,.ok-frontmatter-value>.ok-frontmatter-map .ok-frontmatter-row,.ok-frontmatter-list-value>.ok-frontmatter-map .ok-frontmatter-row{grid-template-columns:1fr;gap:5px}.ok-frontmatter-value>.ok-frontmatter-map,.ok-frontmatter-list-value>.ok-frontmatter-map{padding-left:6px}.ok-table-tools{gap:6px;padding:6px}.ok-table-search{flex-basis:110px}.ok-table-filter-trigger{padding:0 8px}.ok-table-filter-panel{width:min(260px,calc(100vw - 36px))}}.note-body h1{font-size:calc(30px * var(--ok-document-scale, 1))}.note-body h2{font-size:calc(21px * var(--ok-document-scale, 1))}.note-body h3{font-size:calc(17px * var(--ok-document-scale, 1))}.note-body li{line-height:var(--ok-document-line-height, 1.62)}.note-body .ok-frontmatter-title{font-size:calc(13px * var(--ok-document-scale, 1))}.note-body .ok-frontmatter-count,.note-body .ok-frontmatter-notice,.note-body .ok-frontmatter-key code,.note-body .ok-frontmatter-multiline,.note-body .ok-frontmatter-number,.note-body .ok-frontmatter-null,.note-body .ok-frontmatter-empty{font-size:calc(12px * var(--ok-document-scale, 1))}.note-body .ok-frontmatter-chip{font-size:calc(11px * var(--ok-document-scale, 1))}.note-body .ok-table{font-size:calc(14px * var(--ok-document-scale, 1))}.note-body .ok-table th{font-size:calc(12px * var(--ok-document-scale, 1))}.note-body .ok-agent-footer{font-size:calc(14px * var(--ok-document-scale, 1))}@media(max-width:680px){.note-body h1{font-size:calc(28px * var(--ok-document-scale, 1))}}@media(max-width:680px),(hover:none)and (pointer:coarse){.workspace-scroll-rail,.powered-by-openknowledge{display:none}} +:root{--ok-viewport-height: 100vh}@supports (height: 100svh){:root{--ok-viewport-height: 100svh}}*{box-sizing:border-box}html{background:var(--ok-color-viewer-canvas);-webkit-text-size-adjust:100%;text-size-adjust:100%}body{margin:0;color:var(--ok-color-text);background:var(--ok-color-page);font-family:var(--ok-font-body);font-feature-settings:"cv02","cv03","cv04","cv11";font-synthesis:none;letter-spacing:-.006em;line-height:1.55;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}body.viewer-document{height:var(--ok-viewport-height);overflow:hidden}body.viewer-asset-document{overflow:auto}header{display:flex;min-height:var(--ok-header-height);justify-content:space-between;align-items:center;gap:16px;padding:14px 22px;border-bottom:1px solid var(--ok-color-border);background:var(--ok-color-header-bg);color:var(--ok-color-muted);font-size:13px}body.viewer-document>header{position:relative;height:var(--ok-header-height);min-height:0;z-index:6;justify-content:center;padding:0 22px;border-bottom:0;background:var(--ok-color-viewer-header-bg);backdrop-filter:blur(18px) saturate(1.08);-webkit-backdrop-filter:blur(18px) saturate(1.08);transition:transform .22s cubic-bezier(.22,.8,.2,1)}body.viewer-document.is-sidebar-open>header{transform:translate(var(--ok-sidebar-width))}.header-left{position:absolute;left:22px;top:50%;display:inline-flex;min-width:0;align-items:center;gap:10px;transform:translateY(-50%)}.brand{overflow:hidden;color:var(--ok-color-text);font-size:13px;font-weight:680;letter-spacing:-.014em;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.asset-open-raw{position:absolute;right:22px;color:var(--ok-color-muted);font-weight:700;text-decoration:none}.asset-open-raw:hover{color:var(--ok-color-accent)}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}.sidebar-toggle{display:inline-flex;flex:0 0 auto;width:32px;height:32px;align-items:center;justify-content:center;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--ok-color-control-text);cursor:pointer;transition:border-color .14s ease,background-color .14s ease,color .14s ease}.sidebar-toggle:hover,body.is-sidebar-open .sidebar-toggle{border-color:var(--ok-color-control-hover-border);background:var(--ok-color-control-hover-bg);color:var(--ok-color-control-hover-text)}.sidebar-toggle:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.sidebar-toggle-icon{width:19px;height:19px}.sidebar-shortcut{display:inline-flex;min-width:44px;height:22px;align-items:center;justify-content:center;border:1px solid var(--ok-color-search-shortcut-border);border-radius:5px;background:var(--ok-color-search-shortcut-bg);color:var(--ok-color-search-shortcut-text);font:600 11px/1 var(--ok-font-body);pointer-events:none}.control-icon{display:block;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.viewer-settings{position:absolute;top:50%;right:22px;z-index:8;transform:translateY(-50%)}.viewer-settings-trigger{display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--ok-color-control-text);cursor:pointer;transition:border-color .14s ease,background-color .14s ease,color .14s ease}.viewer-settings-trigger:hover,.viewer-settings-trigger[aria-expanded=true]{border-color:var(--ok-color-control-hover-border);background:var(--ok-color-control-hover-bg);color:var(--ok-color-control-hover-text)}.viewer-settings-trigger:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.viewer-settings-icon{width:18px;height:18px}.viewer-settings-menu{position:absolute;top:calc(100% + 9px);right:0;display:grid;gap:10px;width:min(304px,calc(100vw - 36px));max-height:calc(var(--ok-viewport-height) - var(--ok-header-height) - 20px);overflow:auto;overscroll-behavior:contain;padding:12px;border:1px solid var(--ok-color-editor-menu-border);border-radius:12px;background:var(--ok-color-editor-menu-bg);box-shadow:0 12px 32px var(--ok-color-editor-menu-shadow),0 2px 8px var(--ok-color-shadow)}.viewer-settings-menu[hidden]{display:none}.viewer-settings-title{color:var(--ok-color-muted);font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.theme-options{display:grid;grid-template-columns:1fr 1fr;gap:6px}.theme-option{display:flex;min-width:0;min-height:36px;align-items:center;gap:9px;padding:7px 9px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--ok-color-editor-menu-item-text);cursor:pointer;font:600 12px/1 var(--ok-font-body);text-align:left;transition:background-color .14s ease,color .14s ease}.theme-option:hover{background:var(--ok-color-editor-menu-item-hover-bg)}.theme-option:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:1px}.theme-option.is-selected{border-color:var(--ok-color-accent-border);background:var(--ok-color-accent-selected);color:var(--ok-color-accent-strong)}.theme-swatch{flex:0 0 auto;width:18px;height:18px;border:1px solid var(--ok-color-editor-option-border);border-radius:999px;background:linear-gradient(135deg,#f0f0f0 0,#f0f0f0 50%,#0f7a4d 50%);box-shadow:0 0 0 2px var(--ok-color-editor-option-bg)}.theme-swatch-default{background:linear-gradient(135deg,#f4f5f4 0,#f4f5f4 50%,#0b7a53 50%)}.theme-swatch-night{background:linear-gradient(135deg,#0d100e 0,#0d100e 50%,#68e0ad 50%)}.theme-swatch-paper{background:linear-gradient(135deg,#f7f1e6 0,#f7f1e6 50%,#9b4f1f 50%)}.theme-swatch-ocean{background:linear-gradient(135deg,#eef6f8 0,#eef6f8 50%,#0f6f8f 50%)}.theme-swatch-rose{background:linear-gradient(135deg,#fbf3f6 0,#fbf3f6 50%,#b33b6b 50%)}.theme-swatch-custom{background:conic-gradient(from 90deg,var(--ok-color-accent),var(--ok-color-surface),var(--ok-color-text),var(--ok-color-accent))}.theme-custom-fields{display:grid;grid-template-columns:1fr 1fr;gap:7px 8px;padding-top:8px;border-top:1px solid var(--ok-color-editor-menu-separator)}.theme-custom-fields[hidden]{display:none}.theme-custom-fields label{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:8px;color:var(--ok-color-muted);font-size:12px;font-weight:700}.theme-custom-fields input{flex:0 0 auto;width:34px;height:26px;padding:0;overflow:hidden;border:1px solid var(--ok-color-editor-trigger-border);border-radius:5px;background:transparent;cursor:pointer}.theme-custom-fields input:focus-visible{border-color:var(--ok-color-editor-trigger-focus-border);box-shadow:0 0 0 2px var(--ok-color-accent-focus);outline:none}.viewer-settings-section{display:grid;gap:7px;padding-top:9px;border-top:1px solid var(--ok-color-editor-menu-separator)}.viewer-setting-toggle{position:relative;display:flex;min-width:0;align-items:center;justify-content:space-between;gap:14px;padding:7px 8px;border-radius:6px;color:var(--ok-color-editor-menu-item-text);cursor:pointer}.viewer-setting-toggle:hover{background:var(--ok-color-editor-menu-item-hover-bg)}.viewer-setting-copy{display:grid;min-width:0;gap:3px}.viewer-setting-copy strong{color:inherit;font-size:12px;line-height:1.2}.viewer-setting-copy small{color:var(--ok-color-muted);font-size:11px;line-height:1.3}.viewer-setting-toggle input{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none}.viewer-setting-switch{position:relative;flex:0 0 auto;width:34px;height:20px;border:1px solid var(--ok-color-editor-trigger-border);border-radius:999px;background:var(--ok-color-page);transition:border-color .14s ease,background-color .14s ease}.viewer-setting-switch:after{position:absolute;top:3px;left:3px;width:12px;height:12px;border-radius:999px;background:var(--ok-color-muted);content:"";transition:background-color .14s ease,transform .14s ease}.viewer-setting-toggle input:checked+.viewer-setting-switch{border-color:var(--ok-color-accent-border-strong);background:var(--ok-color-accent-soft)}.viewer-setting-toggle input:checked+.viewer-setting-switch:after{background:var(--ok-color-accent);transform:translate(14px)}.viewer-setting-toggle input:focus-visible+.viewer-setting-switch{box-shadow:0 0 0 3px var(--ok-color-accent-focus);outline:1px solid var(--ok-color-accent-border-strong)}.viewer-setting-select{display:grid;gap:5px;padding:7px 8px;border-radius:6px;color:var(--ok-color-editor-menu-item-text)}.viewer-setting-select:hover,.viewer-setting-select:focus-within{background:var(--ok-color-editor-menu-item-hover-bg)}.viewer-setting-select select{width:100%;min-height:30px;padding:5px 28px 5px 8px;border:1px solid var(--ok-color-editor-trigger-border);border-radius:6px;background:var(--ok-color-editor-trigger-bg);color:var(--ok-color-editor-trigger-text);cursor:pointer;font:12px/1.2 var(--ok-font-body)}.viewer-setting-select select:focus-visible{border-color:var(--ok-color-editor-trigger-focus-border);box-shadow:0 0 0 2px var(--ok-color-accent-focus);outline:2px solid var(--ok-color-focus-ring);outline-offset:1px}.viewer-settings-footer{position:sticky;bottom:-12px;display:flex;justify-content:flex-end;margin:0 -12px -12px;padding:10px 12px 12px;border-top:1px solid var(--ok-color-editor-menu-separator);background:var(--ok-color-editor-menu-bg);box-shadow:0 -10px 18px var(--ok-color-editor-menu-bg)}.viewer-settings-reset{min-height:30px;padding:5px 9px;border:1px solid var(--ok-color-editor-trigger-border);border-radius:7px;background:var(--ok-color-editor-trigger-bg);color:var(--ok-color-editor-trigger-text);cursor:pointer;font:700 11px/1 var(--ok-font-body)}.viewer-settings-reset:hover{border-color:var(--ok-color-editor-trigger-focus-border);background:var(--ok-color-code-inline-bg);color:var(--ok-color-text)}.viewer-settings-reset:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.file-sidebar{position:fixed;top:0;bottom:0;left:0;z-index:7;display:flex;width:var(--ok-sidebar-width);flex-direction:column;border-right:1px solid var(--ok-color-sidebar-border);background:var(--ok-color-sidebar);box-shadow:12px 0 36px var(--ok-color-shadow);transform:translate(-100%);transition:transform .22s cubic-bezier(.22,.8,.2,1)}body.is-sidebar-open .file-sidebar{transform:translate(0)}.file-sidebar-head{display:flex;min-height:var(--ok-header-height);align-items:center;justify-content:space-between;gap:12px;padding:0 14px 0 18px;border-bottom:1px solid var(--ok-color-sidebar-border);background:var(--ok-color-sidebar-header);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);color:var(--ok-color-sidebar-text);font-size:11px;font-weight:700;letter-spacing:.07em;text-transform:uppercase}.file-sidebar-actions{display:inline-flex;align-items:center;gap:4px}.file-sidebar-collapse{min-height:28px;padding:5px 7px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--ok-color-sidebar-text);cursor:pointer;font:650 10px/1 var(--ok-font-body);letter-spacing:0;text-transform:none}.file-sidebar-collapse:hover{border-color:var(--ok-color-close-hover-border);background:var(--ok-color-close-hover-bg);color:var(--ok-color-control-hover-text)}.file-sidebar-collapse:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.file-sidebar-close{display:inline-flex;flex:0 0 auto;width:30px;height:30px;align-items:center;justify-content:center;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--ok-color-close-text);cursor:pointer}.file-sidebar-close:hover{border-color:var(--ok-color-close-hover-border);background:var(--ok-color-close-hover-bg);color:var(--ok-color-control-hover-text)}.file-sidebar-close:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.search.header-search{position:relative;z-index:6;width:min(460px,42vw);min-width:240px;margin:0}.search-field{position:relative;display:flex;align-items:center}.header-search .search-input{height:36px;min-height:0;padding:7px 48px 7px 12px;border-color:var(--ok-color-search-input-border);border-radius:9px;background:var(--ok-color-search-input-bg);box-shadow:0 1px 2px var(--ok-color-shadow);font-size:13px;transition:border-color .14s ease,box-shadow .14s ease,background-color .14s ease}.header-search .search-shortcut{position:absolute;right:7px;display:inline-flex;min-width:32px;height:22px;align-items:center;justify-content:center;border:1px solid var(--ok-color-search-shortcut-border);border-radius:5px;background:var(--ok-color-search-shortcut-bg);color:var(--ok-color-search-shortcut-text);font:600 11px/1 var(--ok-font-body);pointer-events:none}.header-search .search-status{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}.header-search .search-results{position:absolute;top:calc(100% + 8px);left:0;right:0;z-index:7;gap:2px;max-height:min(430px,58vh);overflow:auto;overscroll-behavior:contain;padding:7px;border:0;border-radius:12px;background:var(--ok-color-search-popover-bg);box-shadow:0 16px 36px var(--ok-color-search-popover-shadow),0 3px 10px var(--ok-color-shadow)}.header-search .search-result{gap:4px;padding:10px 11px;border:0;border-radius:8px;background:transparent}.header-search .search-result:hover,.header-search .search-result:focus-visible,.header-search .search-result.is-active{border-color:var(--ok-color-search-result-hover-border);background:var(--ok-color-search-result-hover-bg)}.header-search .search-result-title{color:var(--ok-color-text);font-size:13px;font-weight:700;line-height:1.25}.header-search .search-result-meta{color:var(--ok-color-muted);font-size:11px;letter-spacing:.01em;line-height:1.3}.header-search .search-result-snippet{color:var(--ok-color-document-text);font-size:12px;line-height:1.4}.search-result-title-row{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:10px}.search-result-count{flex:0 0 auto;padding:2px 6px;border:1px solid var(--ok-color-accent-border);border-radius:999px;background:var(--ok-color-accent-softer);color:var(--ok-color-accent-strong);font-size:10px;font-weight:700;line-height:1.2}.search-result-headings{overflow:hidden;color:var(--ok-color-muted);font-size:11px;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}.search-result-highlight{padding:0;border-radius:2px;background:var(--ok-color-accent-soft);color:inherit;font:inherit}.header-search .search-empty{padding:18px 14px;color:var(--ok-color-muted);font-size:12px;line-height:1.4;text-align:center}.navigation-mode-toggle{position:absolute;top:50%;right:62px;z-index:8;display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--ok-color-control-text);cursor:pointer;transform:translateY(-50%);transition:border-color .14s ease,background-color .14s ease,color .14s ease}.navigation-mode-toggle:hover,.navigation-mode-toggle[data-mode=beside]{border-color:var(--ok-color-control-hover-border);background:var(--ok-color-control-hover-bg);color:var(--ok-color-control-hover-text)}.navigation-mode-toggle:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.navigation-mode-icon{width:18px;height:18px}.navigation-mode-icon-split,.navigation-mode-toggle[data-mode=beside] .navigation-mode-icon-single{display:none}.navigation-mode-toggle[data-mode=beside] .navigation-mode-icon-split{display:block}.file-sidebar-tree{flex:1 1 auto;width:100%;overflow:auto;padding:8px 10px 20px;scrollbar-color:var(--ok-color-rail-thumb) transparent;scrollbar-width:thin}main{width:min(960px,calc(100% - 32px));margin:0 auto;padding:34px 0 56px}.asset-workspace{width:min(1180px,calc(100% - 32px));min-height:calc(var(--ok-viewport-height) - var(--ok-header-height));padding:22px 0 44px}.asset-panel.document{max-width:none;min-height:min(760px,calc(var(--ok-viewport-height) - 118px));padding:0 28px 30px;overflow:hidden;border:1px solid var(--ok-color-border);border-radius:12px;background:var(--ok-color-surface);box-shadow:0 1px 2px var(--ok-color-shadow),0 12px 36px var(--ok-color-shadow)}.asset-panel .note-chrome{margin:0 -28px 22px;padding-left:28px}.asset-kind{flex:0 0 auto;color:var(--ok-color-muted);font-family:var(--ok-font-mono);font-size:12px}.asset-frame{display:block;width:100%;height:min(78vh,900px);border:1px solid var(--ok-color-border);border-radius:6px;background:var(--ok-color-surface)}.asset-image{display:block;max-width:100%;height:auto;margin:0 auto;border:1px solid var(--ok-color-border);border-radius:6px;background:var(--ok-color-surface)}.asset-video,.asset-audio{display:block;width:100%}.asset-download{margin:0;color:var(--ok-color-muted)}.workspaces{margin:0 0 28px}.sidebar-label{margin:0 0 8px;color:var(--ok-color-muted);font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.workspace-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:9px}.workspace{display:grid;gap:2px;min-width:0;padding:10px 11px;border:1px solid var(--ok-color-card-border);border-radius:6px;background:var(--ok-color-card-bg);color:inherit;text-decoration:none}.workspace:hover,.workspace:focus-visible,.workspace.active{border-color:var(--ok-color-accent-border);background:var(--ok-color-card-hover-bg);outline:none}.workspace-name{overflow:hidden;color:var(--ok-color-text);font-weight:700;text-overflow:ellipsis;white-space:nowrap}.workspace-root{overflow:hidden;color:var(--ok-color-muted);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.note-workspace{position:relative;display:flex;width:100%;height:calc(var(--ok-viewport-height) - var(--ok-header-height));margin:0;padding:0;overflow:auto hidden;background:var(--ok-color-viewer-canvas);scroll-behavior:smooth;overscroll-behavior-x:contain;transition:transform .22s cubic-bezier(.22,.8,.2,1)}body.viewer-document.is-sidebar-open>.note-workspace{transform:translate(var(--ok-sidebar-width))}.note-stack{position:relative;z-index:1;display:flex;flex:0 0 auto;align-self:stretch;align-items:stretch;gap:16px;min-width:max-content;min-height:0;padding:16px max(24px,calc((100vw - 1180px)/2)) 24px 24px}.note-workspace.is-single-panel .note-stack{box-sizing:border-box;flex-basis:100%;min-width:100%;justify-content:center;padding-left:max(24px,calc((100vw - 1180px)/2));padding-right:max(24px,calc((100vw - 1180px)/2))}.note-workspace.is-single-panel,.note-workspace.is-multi-panel{scrollbar-width:none}.note-workspace.is-single-panel::-webkit-scrollbar,.note-workspace.is-multi-panel::-webkit-scrollbar{width:0;height:0}.note-workspace.is-single-panel .note-stack,.note-workspace.is-multi-panel .note-stack{padding-bottom:50px}.note-workspace.is-space-panning,.note-workspace.is-drag-scrolling{scroll-behavior:auto}.note-workspace.is-empty{overflow-x:hidden;overflow-y:auto}.note-workspace.is-empty .note-stack{display:none}.workspace-scroll-rail{position:fixed;right:max(190px,calc((100vw - 1180px)/2));bottom:11px;left:22px;z-index:4;display:flex;height:18px;align-items:center;padding:7px 0;opacity:.58;transition:transform .22s cubic-bezier(.22,.8,.2,1),opacity .16s ease}.workspace-scroll-rail[hidden]{display:none}body.viewer-document.is-sidebar-open>.workspace-scroll-rail{transform:translate(var(--ok-sidebar-width))}.workspace-scroll-rail:hover,.workspace-scroll-rail:focus-within,.workspace-scroll-rail.is-rail-dragging{opacity:1}.workspace-scroll-track{position:relative;flex:1 1 auto;height:1px;border-radius:999px;background:var(--ok-color-rail-track);cursor:pointer}.workspace-scroll-thumb{position:absolute;top:50%;left:0;min-width:44px;height:3px;border:0;border-radius:999px;background:var(--ok-color-rail-thumb);cursor:grab;transform:translate(var(--thumb-x, 0px),-50%);transition:height .14s ease,background-color .14s ease}.workspace-scroll-thumb:hover,.workspace-scroll-thumb:focus-visible,.workspace-scroll-rail.is-rail-dragging .workspace-scroll-thumb{height:5px;background:var(--ok-color-rail-thumb-hover);outline:none}.workspace-scroll-rail.is-rail-dragging .workspace-scroll-thumb{cursor:grabbing}.powered-by-openknowledge{position:fixed;right:22px;bottom:14px;z-index:4;color:var(--ok-color-muted);font-size:10px;font-weight:650;line-height:1;text-decoration:none;opacity:.82;transition:color .16s ease,opacity .16s ease,transform .22s cubic-bezier(.22,.8,.2,1)}body.viewer-document.is-sidebar-open>.powered-by-openknowledge{transform:translate(var(--ok-sidebar-width))}.powered-by-openknowledge:hover,.powered-by-openknowledge:focus-visible{color:var(--ok-color-accent);opacity:1;outline:none}.knowledge-empty{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;overflow:auto;background:var(--ok-color-viewer-canvas)}.knowledge-empty[hidden]{display:none}.knowledge-empty-inner{display:grid;min-height:100%;grid-template-columns:minmax(210px,260px) minmax(0,1fr);gap:28px;padding:32px max(24px,calc((100vw - 1420px)/2)) 42px}.knowledge-empty-pane{min-width:0;min-height:0}.knowledge-graph-sidebar{position:sticky;top:26px;align-self:start;padding:12px 24px 12px 4px;border-right:1px solid var(--ok-color-border)}.knowledge-graph-info{display:grid;gap:7px}.knowledge-graph-info h2{margin:0;padding:0;border:0;color:var(--ok-color-text);font-size:15px;line-height:1.3}.knowledge-graph-info p{margin:0;color:var(--ok-color-muted);font-size:12px;line-height:1.5}.knowledge-graph-info .knowledge-graph-status{margin-top:9px;padding-top:12px;border-top:1px solid var(--ok-color-border);color:var(--ok-color-accent-strong);font-weight:700;overflow-wrap:anywhere}.knowledge-empty-graph{position:sticky;top:26px;align-self:start;min-height:min(640px,calc(var(--ok-viewport-height) - 132px));overflow:hidden}.knowledge-graph-canvas{display:block;width:100%;height:min(640px,calc(var(--ok-viewport-height) - 132px));min-height:440px;outline:none}.knowledge-graph-canvas:focus-visible{outline:2px solid var(--ok-color-accent-border-strong);outline-offset:-3px}.knowledge-tree{width:min(720px,100%);color:var(--ok-color-tree-text);font-family:var(--ok-font-body);font-size:13px}.tree-row{display:flex;min-height:30px;align-items:center;gap:8px;padding:4px 9px 4px var(--indent);border-radius:7px;color:inherit;text-decoration:none}.tree-row[hidden]{display:none}.tree-directory{margin:7px 0 1px;background:transparent;color:var(--ok-color-tree-directory-text);cursor:pointer;font-weight:650;letter-spacing:-.006em}.file-sidebar .tree-directory{background:transparent;color:var(--ok-color-sidebar-text)}.tree-directory:before{content:none}.tree-directory:hover,.tree-directory:focus-visible{background:var(--ok-color-accent-softer);color:var(--ok-color-accent-strong);outline:none}.tree-directory:focus-visible{box-shadow:inset 0 0 0 2px var(--ok-color-focus-ring)}.tree-directory-icon{flex:0 0 auto;width:14px;height:14px;transform:rotate(-90deg);transition:transform .14s ease}.tree-directory[aria-expanded=true] .tree-directory-icon{transform:rotate(0)}.tree-file:hover{background:var(--ok-color-accent-softer);color:var(--ok-color-accent)}.tree-file.is-current-file{background:var(--ok-color-accent-selected);color:var(--ok-color-accent-strong);font-weight:700}.file-sidebar .tree-file:hover{background:var(--ok-color-sidebar-tree-hover-bg)}.tree-file-name{flex:0 1 auto;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tree-file-system{flex:0 0 auto;padding:1px 5px;border:1px solid var(--ok-color-tree-badge-border);border-radius:999px;color:var(--ok-color-tree-badge-text);font-size:10px;line-height:1.2;text-transform:lowercase}h1{margin:0 0 10px;font-size:34px;line-height:1.15}h2{margin-top:32px;padding-top:16px;border-top:1px solid var(--ok-color-border)}h3{margin-top:26px}hr{margin:28px 0;border:0;border-top:1px solid var(--ok-color-border)}.lede{margin:0 0 26px;color:var(--ok-color-muted)}.error{color:var(--ok-color-danger)}.search{position:relative;margin:0 0 22px}.search-label{display:block;margin:0 0 7px;color:var(--ok-color-muted);font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.search-input{width:100%;min-height:42px;border:1px solid var(--ok-color-search-input-border);border-radius:6px;background:var(--ok-color-surface);color:var(--ok-color-text);font:inherit;padding:8px 11px}.search-input:focus{border-color:var(--ok-color-accent-border-strong);box-shadow:0 0 0 3px var(--ok-color-accent-focus);outline:2px solid var(--ok-color-focus-ring);outline-offset:1px}.search-status{min-height:20px;margin-top:8px;color:var(--ok-color-muted);font-size:13px}.search-results{display:grid;gap:7px;margin-top:8px}.search-results[hidden]{display:none}.search-result{display:grid;gap:2px;padding:10px 11px;border:1px solid var(--ok-color-card-border);border-radius:6px;background:var(--ok-color-card-bg);color:inherit;text-decoration:none}.search-result:hover,.search-result:focus-visible,.search-result.is-active{border-color:var(--ok-color-accent-border);background:var(--ok-color-card-hover-bg);outline:none}.search-result-title{color:var(--ok-color-text);font-weight:700}.search-result-meta,.search-result-snippet,.search-result-headings{color:var(--ok-color-muted);font-size:13px}.list{border-top:1px solid var(--ok-color-border)}.row{display:grid;grid-template-columns:minmax(180px,1fr) minmax(160px,.7fr);gap:12px;padding:12px 0;border-bottom:1px solid var(--ok-color-border);color:inherit;text-decoration:none}.row:hover .path{color:var(--ok-color-accent)}.path{font-family:var(--ok-font-mono);font-size:14px}.meta,.issue{color:var(--ok-color-muted);font-size:13px}.issue{grid-column:1 / -1;color:var(--ok-color-danger)}.document{max-width:780px}.note-panel.document{position:relative;flex:0 0 var(--note-panel-width, var(--ok-note-panel-default-width));max-width:none;min-width:var(--ok-note-panel-min-width);min-height:0;padding:0 34px 34px;overflow-x:hidden;overflow-y:auto;border:1px solid var(--ok-color-border);border-radius:12px;background:var(--ok-color-surface);box-shadow:0 1px 2px var(--ok-color-shadow),0 12px 36px var(--ok-color-shadow);outline:none;scroll-padding-top:66px;scrollbar-color:var(--ok-color-rail-thumb) transparent;scrollbar-width:thin}.note-panel:focus{border-color:var(--ok-color-accent-border);box-shadow:0 0 0 3px var(--ok-color-accent-focus),0 1px 2px var(--ok-color-shadow),0 12px 36px var(--ok-color-shadow)}.note-panel.is-entering{animation:note-enter .28s cubic-bezier(.22,.8,.2,1)}body.is-view-transitioning .note-panel.is-entering{animation:none}.note-resize-handle{position:absolute;top:0;bottom:0;z-index:3;width:14px;padding:0;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ok-color-note-resize-hitarea);color:transparent;cursor:ew-resize;pointer-events:auto;touch-action:none;transform:translateY(var(--note-panel-scroll-top, 0px));will-change:transform}.note-resize-handle-left{left:-7px}.note-resize-handle-right{right:8px}.note-resize-handle:after{position:absolute;top:10px;bottom:10px;left:6px;width:2px;border-radius:999px;background:transparent;content:"";transition:background-color .12s ease}.note-resize-handle-right:after{left:auto;right:-9px}.note-resize-handle:hover:after,.note-resize-handle:focus-visible:after,.note-panel.is-panel-resizing .note-resize-handle:after{background:var(--ok-color-note-resize-active)}.note-resize-handle:focus-visible{outline:none}body.is-panel-resizing,body.is-panel-resizing *{cursor:ew-resize!important;-webkit-user-select:none;user-select:none}.note-chrome{position:sticky;top:0;z-index:5;display:flex;min-height:52px;align-items:center;justify-content:space-between;gap:14px;margin:0 -34px 28px;padding:0 12px 0 34px;border-bottom:1px solid var(--ok-color-border);background:var(--ok-color-note-chrome-bg);backdrop-filter:blur(16px) saturate(1.04);-webkit-backdrop-filter:blur(16px) saturate(1.04)}.note-path{display:flex;flex:1 1 auto;min-width:0;align-items:center;gap:2px;overflow:hidden;color:var(--ok-color-muted);font-family:var(--ok-font-mono);font-size:11.5px;letter-spacing:-.01em;white-space:nowrap}.note-breadcrumb-link,.note-breadcrumb-label{min-width:0;overflow:hidden;padding:3px 4px;border-radius:5px;color:inherit;text-decoration:none;text-overflow:ellipsis}.note-breadcrumb-link:hover,.note-breadcrumb-link:focus-visible{background:var(--ok-color-code-inline-bg);color:var(--ok-color-accent-strong);outline:none}.note-breadcrumb-link:focus-visible{box-shadow:0 0 0 2px var(--ok-color-accent-focus)}.note-breadcrumb-current{color:var(--ok-color-text);font-weight:650}.note-breadcrumb-separator{flex:0 0 auto;color:var(--ok-color-muted);opacity:.52}.note-actions{display:flex;flex:0 0 auto;align-items:center;gap:7px}.source-open{display:inline-flex;flex:0 0 auto;width:32px;height:30px;align-items:center;justify-content:center;border:1px solid var(--ok-color-editor-trigger-border);border-radius:8px;background:var(--ok-color-editor-trigger-bg);color:var(--ok-color-editor-trigger-text);box-shadow:0 1px 0 var(--ok-color-editor-trigger-shadow) inset;text-decoration:none;transition:border-color .14s ease,background-color .14s ease,color .14s ease}.source-open:hover{border-color:var(--ok-color-editor-trigger-focus-border);background:var(--ok-color-code-inline-bg);color:var(--ok-color-text)}.source-open:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.source-icon{width:17px;height:17px;fill:currentColor;stroke:none}.editor-picker{position:relative;flex:0 0 auto}.note-panel:not(.is-active-panel) .editor-picker{display:none}.editor-trigger{display:inline-flex;min-width:58px;height:30px;align-items:stretch;justify-content:center;overflow:hidden;border:1px solid var(--ok-color-editor-trigger-border);border-radius:8px;background:var(--ok-color-editor-trigger-bg);color:var(--ok-color-editor-trigger-text);line-height:1;box-shadow:0 1px 0 var(--ok-color-editor-trigger-shadow) inset}.editor-open,.editor-menu-trigger{display:inline-flex;height:100%;align-items:center;justify-content:center;border:0;background:transparent;color:inherit;cursor:pointer;font:inherit;line-height:1;text-decoration:none}.editor-open{min-width:32px;padding:0 6px}.editor-menu-trigger{width:25px;padding:0;border-left:1px solid var(--ok-color-editor-trigger-separator)}.editor-open:hover,.editor-open:focus-visible,.editor-menu-trigger:hover,.editor-menu-trigger:focus-visible{background:var(--ok-color-code-inline-bg);color:var(--ok-color-text);outline:none}.editor-trigger:focus-within{border-color:var(--ok-color-editor-trigger-focus-border);outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.editor-open .editor-mark{border:0;background:transparent}.editor-mark{display:inline-flex;min-width:20px;height:20px;align-items:center;justify-content:center;border:1px solid var(--ok-color-editor-mark-border);border-radius:5px;background:var(--ok-color-editor-mark-bg);color:var(--ok-color-editor-mark-text);font-size:10px;font-weight:700;line-height:1}.editor-mark[data-has-icon=true]{min-width:22px;height:22px;background:var(--ok-color-editor-mark-bg)}.editor-icon{display:block;width:18px;height:18px;border-radius:4px;object-fit:contain}.editor-caret{width:14px;height:14px;color:var(--ok-color-editor-caret)}.editor-menu{position:absolute;top:calc(100% + 9px);right:0;z-index:4;width:max-content;min-width:210px;max-width:min(280px,calc(100vw - 36px));max-height:min(420px,calc(var(--ok-viewport-height) - 90px));overflow:auto;overscroll-behavior:contain;padding:6px;border:1px solid var(--ok-color-editor-menu-border);border-radius:11px;background:var(--ok-color-editor-menu-bg);box-shadow:0 12px 32px var(--ok-color-editor-menu-shadow),0 2px 8px var(--ok-color-shadow)}.editor-menu[hidden]{display:none}.editor-menu-item{display:flex;width:100%;min-height:36px;align-items:center;gap:10px;padding:7px 9px;border:0;border-radius:8px;background:transparent;color:var(--ok-color-editor-menu-item-text);cursor:pointer;font:inherit;text-align:left}.editor-menu-item:hover{background:var(--ok-color-editor-menu-item-hover-bg)}.editor-menu-item:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:-2px}.editor-menu-item.is-selected{background:var(--ok-color-accent-selected);color:var(--ok-color-accent-strong)}.editor-option-mark{display:inline-flex;flex:0 0 24px;height:22px;align-items:center;justify-content:center;border:1px solid var(--ok-color-editor-option-border);border-radius:5px;background:var(--ok-color-editor-option-bg);color:var(--ok-color-editor-option-text);font-size:10px;font-weight:700;line-height:1}.editor-option-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.editor-menu-separator{height:1px;margin:6px 4px;background:var(--ok-color-editor-menu-separator)}.note-close{display:inline-flex;flex:0 0 auto;width:30px;height:30px;align-items:center;justify-content:center;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--ok-color-note-close-text);cursor:pointer;font:inherit;line-height:1;text-decoration:none;transition:border-color .14s ease,background-color .14s ease,color .14s ease}.note-close:hover{border-color:var(--ok-color-note-close-hover-border);background:var(--ok-color-code-inline-bg);color:var(--ok-color-note-close-hover-text)}.note-close:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.note-close-icon{width:16px;height:16px}.note-body{max-width:var(--ok-note-body-max-width, 70ch);margin:0 auto;padding-bottom:10vh;font-size:var(--ok-document-font-size, 15.5px);line-height:var(--ok-document-line-height, 1.62);letter-spacing:var(--ok-document-letter-spacing, normal)}html[data-viewer-underlines=off] .note-body a,.note-body a{text-decoration:none!important;text-decoration-line:none!important}html[data-viewer-underlines=on] .note-body a,body.is-links-underlined .note-body a{text-decoration:underline!important;text-decoration-line:underline!important;text-decoration-thickness:.08em;text-underline-offset:.16em}html[data-viewer-contrast=high]{--ok-color-document-text: var(--ok-color-text) !important;--ok-color-muted: var(--ok-color-text) !important;--ok-color-border: var(--ok-color-text) !important;--ok-color-focus-ring: var(--ok-color-text) !important;--ok-color-control-text: var(--ok-color-text) !important}body.is-frontmatter-hidden .ok-frontmatter{display:none}.ok-frontmatter{margin:0 0 30px;overflow:hidden;border:1px solid var(--ok-color-border);border-radius:10px;background:var(--ok-color-surface)}.ok-frontmatter-summary{display:flex;min-height:42px;align-items:center;gap:10px;padding:8px 13px;color:var(--ok-color-text);cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;transition:background-color .14s ease}.ok-frontmatter-summary::-webkit-details-marker{display:none}.ok-frontmatter-summary:after{width:7px;height:7px;margin:-4px 2px 0 auto;border-right:1.5px solid var(--ok-color-muted);border-bottom:1.5px solid var(--ok-color-muted);content:"";transform:rotate(45deg);transition:transform .14s ease}.ok-frontmatter[open]>.ok-frontmatter-summary:after{margin-top:3px;transform:rotate(225deg)}.ok-frontmatter-summary:hover{background:var(--ok-color-control-hover-bg)}.ok-frontmatter-summary:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:-2px}.ok-frontmatter-title{font-size:13px;font-weight:650;letter-spacing:-.006em}.ok-frontmatter-count{color:var(--ok-color-muted);font-size:11px}.ok-frontmatter-body{padding:11px 14px 14px;border-top:1px solid var(--ok-color-border);background:var(--ok-color-page)}.document .ok-frontmatter-notice{margin:0 0 10px;padding:7px 9px;border-radius:6px;background:var(--ok-color-accent-softer);color:var(--ok-color-muted);font-size:12px}.ok-frontmatter-map{display:grid;gap:0;margin:0}.ok-frontmatter-row{display:grid;grid-template-columns:minmax(96px,.34fr) minmax(0,1fr);gap:12px;padding:8px 0;border-bottom:1px solid var(--ok-color-border)}.ok-frontmatter-row:last-child{border-bottom:0}.ok-frontmatter-key{min-width:0;margin:0}.ok-frontmatter-key code{display:inline;padding:0;background:transparent;color:var(--ok-color-text);font-size:12px;overflow-wrap:anywhere}.ok-frontmatter-value{display:flex;min-width:0;flex-wrap:wrap;align-items:center;gap:6px 8px;margin:0;color:var(--ok-color-document-text)}.ok-frontmatter-scalar{min-width:0;overflow-wrap:anywhere}.ok-frontmatter-string{white-space:pre-wrap}.ok-frontmatter-multiline{display:block;width:100%;padding:7px 9px;border-radius:6px;background:var(--ok-color-code-inline-bg);font-family:var(--ok-font-mono);font-size:12px}.ok-frontmatter-number{font-family:var(--ok-font-mono);font-size:12px;font-variant-numeric:tabular-nums}.ok-frontmatter-null,.ok-frontmatter-empty{color:var(--ok-color-muted);font-family:var(--ok-font-mono);font-size:12px;font-style:italic}.ok-frontmatter-boolean{display:inline-flex;align-items:center;gap:5px;padding:3px 7px;border-radius:999px;background:var(--ok-color-accent-soft);color:var(--ok-color-accent-strong);font:700 11px/1 var(--ok-font-mono)}.ok-frontmatter-boolean[data-value=false]{background:var(--ok-color-code-inline-bg);color:var(--ok-color-muted)}.ok-frontmatter-boolean-dot{width:6px;height:6px;border-radius:999px;background:currentColor}.ok-frontmatter-link{min-width:0;overflow-wrap:anywhere}.document .ok-frontmatter-chips{display:flex;min-width:0;flex-wrap:wrap;gap:5px;margin:0;padding:0;list-style:none}.document .ok-frontmatter-chip{display:inline-flex;min-width:0;align-items:center;margin:0;padding:4px 8px;border:1px solid var(--ok-color-border);border-radius:999px;background:var(--ok-color-surface);color:var(--ok-color-document-text);font-size:11px;line-height:1.2}.document .ok-frontmatter-tag{padding:0;overflow:hidden}.ok-frontmatter-tag-link{display:inline-flex;min-width:0;align-items:center;padding:4px 8px;border-radius:inherit;color:inherit;text-decoration:none;transition:background-color .14s ease,color .14s ease}.ok-frontmatter-tag-link:hover,.ok-frontmatter-tag-link:focus-visible{background:var(--ok-color-accent-soft);color:var(--ok-color-accent-strong);outline:none}.ok-frontmatter-tag-link:focus-visible{box-shadow:inset 0 0 0 2px var(--ok-color-focus-ring)}.ok-frontmatter-chip .ok-frontmatter-boolean{padding:0;background:transparent}.ok-frontmatter-value>.ok-frontmatter-map,.ok-frontmatter-list-value>.ok-frontmatter-map{width:100%;padding:2px 0 0 10px;border-left:2px solid var(--ok-color-border)}.ok-frontmatter-value>.ok-frontmatter-map .ok-frontmatter-row,.ok-frontmatter-list-value>.ok-frontmatter-map .ok-frontmatter-row{grid-template-columns:minmax(86px,.3fr) minmax(0,1fr);padding:7px 0 7px 9px}.document .ok-frontmatter-list{display:grid;width:100%;gap:8px;margin:2px 0 0;padding:0;list-style:none}.document .ok-frontmatter-list-item{display:grid;grid-template-columns:22px minmax(0,1fr);gap:8px;margin:0;padding:8px;border:1px solid var(--ok-color-border);border-radius:6px;background:var(--ok-color-surface)}.ok-frontmatter-index{display:inline-flex;width:22px;height:22px;align-items:center;justify-content:center;border-radius:999px;background:var(--ok-color-code-inline-bg);color:var(--ok-color-muted);font:700 10px/1 var(--ok-font-mono)}.ok-frontmatter-list-value{display:flex;min-width:0;flex-wrap:wrap;align-items:center;gap:6px 8px}.document p,.document li{color:var(--ok-color-document-text)}.document h1{margin:0 0 20px;color:var(--ok-color-text);font-size:30px;font-weight:700;letter-spacing:-.03em;line-height:1.16}.document h2{margin:40px 0 13px;padding-top:0;border-top:0;color:var(--ok-color-text);font-size:21px;font-weight:680;letter-spacing:-.018em;line-height:1.25}.document h3{margin:28px 0 10px;color:var(--ok-color-text);font-size:17px;font-weight:680;letter-spacing:-.012em;line-height:1.3}.document h1 code,.document h2 code,.document h3 code{padding:0;border-radius:0;background:transparent;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit}.document p{margin:0 0 16px}.document ul,.document ol{margin:10px 0 20px;padding-left:22px}.document li{padding-left:2px;line-height:1.48}.document li+li{margin-top:6px}.document li::marker{color:var(--ok-color-muted)}.document h2+ul,.document h2+ol,.document h3+ul,.document h3+ol{margin-top:8px}a{color:var(--ok-color-accent);text-underline-offset:3px}a:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.note-body a{border-radius:4px;transition:background-color .16s ease,color .16s ease}.note-body a:hover,.note-body a.is-active-note{background:var(--ok-color-accent-soft)}.note-body a.is-active-note{color:var(--ok-color-accent-strong)}.ok-search-highlight{border-radius:4px;background:#f59e0b57;box-shadow:0 0 0 2px #f59e0b70;color:inherit}strong{color:var(--ok-color-text);font-weight:700}blockquote{margin:20px 0;padding:2px 0 2px 18px;border-left:3px solid var(--ok-color-border);color:var(--ok-color-muted)}blockquote p{color:var(--ok-color-muted)}.ok-agent-footer{margin-top:32px;padding-top:18px;border-top:1px solid var(--ok-color-border);color:var(--ok-color-muted);font-size:14px;opacity:.82}.ok-agent-footer blockquote{margin:0;padding:0;border-left:0;color:inherit}.ok-agent-footer blockquote p,.ok-agent-footer li,.ok-agent-footer strong{color:inherit}.ok-agent-footer a{color:var(--ok-color-muted);text-decoration-color:var(--ok-color-border)}.ok-agent-footer a:hover{background:transparent;color:var(--ok-color-accent)}code{padding:1px 4px;border-radius:4px;background:var(--ok-color-code-inline-bg);font-family:var(--ok-font-mono);font-size:.9em;letter-spacing:-.012em}pre,.code-block{overflow-x:auto;margin:22px 0 26px;padding:16px 18px;border:1px solid var(--ok-color-border);border-radius:10px;background:var(--ok-color-code-block-bg);color:var(--ok-color-code-block-text);font:400 .94em/1.6 var(--ok-font-mono);box-shadow:0 8px 24px var(--ok-color-shadow)}pre code,.code-block code{display:block;min-width:max-content;padding:0;background:transparent;color:inherit;font:inherit;white-space:pre}.code-block{position:relative;scrollbar-color:var(--ok-color-rail-thumb) transparent;-moz-tab-size:2;tab-size:2}.code-block[data-language]{padding-top:34px}.code-block[data-language]:before{position:absolute;top:11px;left:18px;color:var(--ok-color-syntax-comment);content:attr(data-language);font:600 11px/1 var(--ok-font-body);opacity:.78}.ok-mermaid{display:grid;gap:10px;margin:22px 0 26px}.ok-mermaid .code-block{margin:0}.ok-mermaid-output{width:100%;overflow:auto;padding:18px;border:1px solid var(--ok-color-border);border-radius:10px;background:var(--ok-color-surface);box-shadow:0 8px 24px var(--ok-color-shadow);scrollbar-color:var(--ok-color-rail-thumb) transparent}.ok-mermaid-output[role=button]{position:relative;cursor:zoom-in;transition:background-color .14s ease,box-shadow .14s ease}.ok-mermaid-output[role=button]:after{position:absolute;top:8px;right:8px;padding:5px 8px;border:1px solid var(--ok-color-editor-trigger-border);border-radius:6px;background:var(--ok-color-editor-trigger-bg);color:var(--ok-color-editor-trigger-text);box-shadow:0 1px 0 var(--ok-color-editor-trigger-shadow) inset;content:"Expand";font:700 11px/1 var(--ok-font-body);pointer-events:none}.ok-mermaid-output[role=button]:hover{background:var(--ok-color-accent-softer);box-shadow:inset 0 0 0 1px var(--ok-color-accent-border)}.ok-mermaid-output[role=button]:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:3px}.ok-mermaid-output[hidden],.ok-mermaid-error[hidden],.ok-mermaid [data-mermaid-source][hidden]{display:none}.ok-mermaid-output svg{display:block;width:100%;max-width:100%;height:auto;margin:0 auto}.ok-mermaid-error{margin:0;padding:9px 11px;border:1px solid var(--ok-color-border);border-radius:7px;background:var(--ok-color-accent-softer);color:var(--ok-color-danger);font-size:12px;line-height:1.45}.ok-mermaid-viewport{position:fixed;top:0;right:0;bottom:0;left:0;width:100vw;max-width:none;height:var(--ok-viewport-height);max-height:none;margin:0;padding:0;overflow:hidden;border:0;background:var(--ok-color-viewer-canvas);color:var(--ok-color-text)}.ok-mermaid-viewport[open]{display:flex;flex-direction:column}.ok-mermaid-viewport::backdrop{background:#000000b8}.ok-mermaid-viewport-toolbar{z-index:1;display:flex;flex:0 0 auto;align-items:center;gap:7px;min-height:52px;overflow-x:auto;padding:9px 12px;border-bottom:1px solid var(--ok-color-border);background:var(--ok-color-surface);box-shadow:0 1px 4px var(--ok-color-shadow)}.ok-mermaid-viewport-toolbar button{flex:0 0 auto;min-width:34px;height:32px;padding:0 10px;border:1px solid var(--ok-color-editor-trigger-border);border-radius:7px;background:var(--ok-color-editor-trigger-bg);color:var(--ok-color-editor-trigger-text);cursor:pointer;font:700 12px/1 var(--ok-font-body)}.ok-mermaid-viewport-toolbar button:hover{border-color:var(--ok-color-editor-trigger-focus-border);background:var(--ok-color-control-hover-bg);color:var(--ok-color-control-hover-text)}.ok-mermaid-viewport-toolbar button:focus-visible,.ok-mermaid-viewport-canvas:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}.ok-mermaid-viewport-toolbar [data-ok-mermaid-action=close]{margin-left:auto}.ok-mermaid-viewport-zoom{min-width:48px;color:var(--ok-color-muted);font:700 12px/1 var(--ok-font-mono);text-align:center}.ok-mermaid-viewport-canvas{position:relative;flex:1 1 auto;min-height:0;overflow:hidden;background:var(--ok-color-viewer-canvas);cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none}.ok-mermaid-viewport-canvas[data-ok-mermaid-panning]{cursor:grabbing}.ok-mermaid-viewport-stage{position:absolute;top:0;left:0;transform-origin:0 0;will-change:transform}.ok-mermaid-viewport-stage svg{display:block;width:100%;max-width:none;height:100%;min-width:0;margin:0;pointer-events:none}.asset-code .code-block,.asset-text .code-block{margin:0;min-height:440px}.ok-table-wrap{--ok-table-inner-radius: 6px;max-width:100%;margin:24px 0 28px;overflow:visible;border:1px solid var(--ok-color-border);border-radius:7px;background:var(--ok-color-surface)}.ok-table-scroller{overflow-x:auto;border-radius:0 0 var(--ok-table-inner-radius) var(--ok-table-inner-radius)}.ok-table-wrap>.ok-table-scroller:first-child{border-radius:var(--ok-table-inner-radius)}.ok-table{width:100%;min-width:max-content;border-collapse:separate;border-spacing:0;color:var(--ok-color-document-text);font-size:14px;line-height:1.42}.ok-table th,.ok-table td{max-width:360px;padding:9px 11px;border:0;border-right:1px solid var(--ok-color-border);border-bottom:1px solid var(--ok-color-border);text-align:left;vertical-align:top;overflow-wrap:anywhere}.ok-table th:last-child,.ok-table td:last-child{border-right:0}.ok-table tbody tr:last-child td{border-bottom:0}.ok-table th{background:var(--ok-color-code-inline-bg);color:var(--ok-color-text);font-size:12px;font-weight:700;letter-spacing:0}.ok-table tbody tr:nth-child(2n) td{background:var(--ok-color-page)}.ok-table tbody tr:hover td{background:var(--ok-color-accent-softer)}.ok-table [data-align=center]{text-align:center}.ok-table [data-align=right]{text-align:right}.ok-table code{overflow-wrap:anywhere;white-space:normal;word-break:break-word}.ok-table th[data-ok-table-sort]{cursor:pointer;-webkit-user-select:none;user-select:none}.ok-table th[data-ok-table-sort]:focus-visible{outline:2px solid var(--ok-color-accent-focus-strong);outline-offset:-2px}.ok-table-sort-indicator{position:relative;display:inline-block;width:8px;height:13px;margin-left:6px;color:var(--ok-color-muted);vertical-align:-2px;opacity:.58}.ok-table-sort-indicator:before,.ok-table-sort-indicator:after{position:absolute;left:0;width:0;height:0;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.ok-table-sort-indicator:before{top:1px;border-bottom:5px solid currentColor}.ok-table-sort-indicator:after{bottom:1px;border-top:5px solid currentColor}.ok-table th[data-sort-direction=asc] .ok-table-sort-indicator:before,.ok-table th[data-sort-direction=desc] .ok-table-sort-indicator:after{color:var(--ok-color-accent);opacity:1}.ok-table th[data-sort-direction=asc] .ok-table-sort-indicator:after,.ok-table th[data-sort-direction=desc] .ok-table-sort-indicator:before{opacity:.2}.ok-table-tools{position:relative;z-index:2;display:flex;align-items:center;gap:8px;padding:7px 8px;border-bottom:1px solid var(--ok-color-border);border-radius:var(--ok-table-inner-radius) var(--ok-table-inner-radius) 0 0;background:var(--ok-color-surface)}.ok-table-tools input,.ok-table-tools select{height:30px;border:1px solid var(--ok-color-search-input-border);border-radius:6px;background:var(--ok-color-search-input-bg);color:var(--ok-color-text);font:12px/1 var(--ok-font-body)}.ok-table-tools input:focus,.ok-table-tools select:focus{border-color:var(--ok-color-accent-border-strong);box-shadow:0 0 0 2px var(--ok-color-accent-focus);outline:2px solid var(--ok-color-focus-ring);outline-offset:1px}.ok-table-search{flex:1 1 150px;min-width:0;padding:5px 8px}.ok-table-filter-menu{position:relative;flex:0 0 auto}.ok-table-filter-menu[open]{z-index:3}.ok-table-filter-trigger{display:inline-flex;height:30px;align-items:center;gap:8px;padding:0 9px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--ok-color-editor-trigger-text);cursor:pointer;font:700 12px/1 var(--ok-font-body);list-style:none;-webkit-user-select:none;user-select:none}.ok-table-filter-trigger::-webkit-details-marker{display:none}.ok-table-filter-trigger:after{width:6px;height:6px;margin-top:-3px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;content:"";transform:rotate(45deg)}.ok-table-filter-trigger:hover{border-color:var(--ok-color-editor-trigger-border);background:var(--ok-color-code-inline-bg);color:var(--ok-color-text)}.ok-table-filter-menu[open] .ok-table-filter-trigger{border-color:var(--ok-color-editor-trigger-focus-border);background:var(--ok-color-code-inline-bg);color:var(--ok-color-text)}.ok-table-filter-menu[open] .ok-table-filter-trigger:after{margin-top:3px;transform:rotate(225deg)}.ok-table-filter-trigger:focus-visible{border-color:var(--ok-color-editor-trigger-focus-border);box-shadow:0 0 0 2px var(--ok-color-accent-focus);outline:2px solid var(--ok-color-focus-ring);outline-offset:1px}.ok-table-filter-panel{position:absolute;top:calc(100% + 6px);right:0;display:grid;gap:8px;width:min(280px,calc(100vw - 48px));padding:8px;border:1px solid var(--ok-color-editor-menu-border);border-radius:8px;background:var(--ok-color-editor-menu-bg);box-shadow:0 16px 38px var(--ok-color-editor-menu-shadow)}.ok-table-filter-list{display:grid;gap:8px;min-width:0}.ok-table-filter-list select{width:100%;max-width:none;padding:5px 26px 5px 8px}.ok-table-clear{height:30px;padding:0 9px;border:1px solid var(--ok-color-editor-trigger-border);border-radius:6px;background:var(--ok-color-editor-trigger-bg);color:var(--ok-color-editor-trigger-text);cursor:pointer;font:700 12px/1 var(--ok-font-body);text-align:center}.ok-table-clear:hover,.ok-table-clear:focus-visible{border-color:var(--ok-color-editor-trigger-focus-border);background:var(--ok-color-code-inline-bg);color:var(--ok-color-text);outline:none}.ok-table-clear:disabled{cursor:default;opacity:.48}.ok-table-count{margin-left:auto;color:var(--ok-color-muted);font-size:12px;white-space:nowrap}.tok-keyword{color:var(--ok-color-syntax-keyword);font-weight:700}.tok-string{color:var(--ok-color-syntax-string)}.tok-number{color:var(--ok-color-syntax-number)}.tok-comment{color:var(--ok-color-syntax-comment);font-style:italic}.tok-command{color:var(--ok-color-syntax-keyword);font-weight:inherit}.tok-flag{color:var(--ok-color-syntax-number)}.tok-variable{color:var(--ok-color-syntax-string)}ul,ol{padding-left:22px}.empty{color:var(--ok-color-muted)}.note-error{color:var(--ok-color-danger)}.theme-custom-fields input:focus-visible,.viewer-setting-select select:focus-visible,.viewer-setting-toggle input:focus-visible+.viewer-setting-switch,.header-search .search-result:focus-visible,.workspace:focus-visible,.workspace-scroll-thumb:focus-visible,.powered-by-openknowledge:focus-visible,.knowledge-graph-canvas:focus-visible,.search-result:focus-visible,.note-resize-handle:focus-visible,.ok-table th[data-ok-table-sort]:focus-visible,.ok-table-clear:focus-visible{outline:2px solid var(--ok-color-focus-ring);outline-offset:2px}@keyframes note-enter{0%{opacity:.001;transform:translate(34px) scale(.985)}to{opacity:1;transform:translate(0) scale(1)}}@keyframes stack-view-old{0%{opacity:1;transform:translate(0) scale(1)}to{opacity:.72;transform:translate(-18px) scale(.992)}}@keyframes stack-view-new{0%{opacity:.001;transform:translate(22px) scale(.992)}to{opacity:1;transform:translate(0) scale(1)}}@supports (view-transition-name: none){.note-workspace{view-transition-name:note-workspace}::view-transition-old(root),::view-transition-new(root){animation:none}::view-transition-old(note-workspace),::view-transition-new(note-workspace){animation-duration:.24s;animation-timing-function:cubic-bezier(.22,.8,.2,1);mix-blend-mode:normal}::view-transition-old(note-workspace){animation-name:stack-view-old}::view-transition-new(note-workspace){animation-name:stack-view-new}}@media(prefers-reduced-motion:reduce){.note-workspace{scroll-behavior:auto}.note-panel.is-entering{animation:none}.note-body a{transition:none}}html[data-viewer-motion=reduced] *,html[data-viewer-motion=reduced] *:before,html[data-viewer-motion=reduced] *:after{scroll-behavior:auto!important}html[data-viewer-motion=reduced] *,html[data-viewer-motion=reduced] *:before,html[data-viewer-motion=reduced] *:after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}@media(prefers-reduced-motion:reduce){html[data-viewer-motion=system] *,html[data-viewer-motion=system] *:before,html[data-viewer-motion=system] *:after{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}}html[data-viewer-motion=full] .note-workspace{scroll-behavior:smooth}html[data-viewer-motion=full] .note-panel.is-entering{animation:note-enter .28s cubic-bezier(.22,.8,.2,1)}html[data-viewer-motion=full] .note-body a{transition:background-color .16s ease,color .16s ease}@media(hover:hover)and (pointer:fine){.note-workspace.is-multi-panel{cursor:grab}.note-workspace.is-multi-panel .note-panel{cursor:auto}.note-workspace.is-multi-panel.is-space-panning,.note-workspace.is-multi-panel.is-space-panning *{cursor:grab}.note-workspace.is-multi-panel.is-drag-scrolling,.note-workspace.is-multi-panel.is-drag-scrolling *{cursor:grabbing;-webkit-user-select:none;user-select:none}}@media(max-width:680px){header{display:block}body:not(.viewer-document) header span{display:block;margin-top:4px;overflow-wrap:anywhere}.row{grid-template-columns:1fr}body.viewer-document header{display:flex;height:var(--ok-mobile-header-height);justify-content:flex-end;padding:0 12px}.header-left{left:12px;max-width:42%}.brand{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebar-shortcut{display:none}.navigation-mode-toggle{right:52px}.viewer-settings{right:12px}.search.header-search{width:min(34vw,280px);min-width:0;margin-right:84px}.header-search .search-shortcut{display:none}.header-search .search-input{padding-right:10px}.header-search .search-results{left:auto;width:min(320px,calc(100vw - 24px))}.viewer-settings-menu{width:min(300px,calc(100vw - 24px))}.note-workspace{height:calc(var(--ok-viewport-height) - var(--ok-mobile-header-height))}.note-stack{gap:12px;padding:8px 12px 12px}.note-workspace.is-single-panel .note-stack{padding-left:12px;padding-right:12px}.note-workspace.is-single-panel .note-stack,.note-workspace.is-multi-panel .note-stack{padding-bottom:18px}.workspace-scroll-rail{right:12px;bottom:8px;left:12px}.powered-by-openknowledge{right:12px;bottom:28px;font-size:8px}body.viewer-document.is-sidebar-open>.workspace-scroll-rail,body.viewer-document.is-sidebar-open>.powered-by-openknowledge{display:none}.knowledge-empty-inner{grid-template-columns:1fr;gap:22px;padding:28px 14px 44px}.knowledge-graph-sidebar{position:relative;top:auto;padding:0 0 18px;border-right:0;border-bottom:1px solid var(--ok-color-border)}.knowledge-empty-graph{position:relative;top:auto;min-height:380px}.knowledge-graph-canvas{height:380px;min-height:380px}.note-panel.document{--ok-note-panel-default-width: calc(100vw - 24px) ;--ok-note-panel-min-width: min(360px, calc(100vw - 24px) );padding:0 22px 28px;border-radius:11px}.note-chrome{margin:0 -22px 24px;padding:0 10px 0 22px}.document h1{font-size:28px}.ok-frontmatter-row,.ok-frontmatter-value>.ok-frontmatter-map .ok-frontmatter-row,.ok-frontmatter-list-value>.ok-frontmatter-map .ok-frontmatter-row{grid-template-columns:1fr;gap:5px}.ok-frontmatter-value>.ok-frontmatter-map,.ok-frontmatter-list-value>.ok-frontmatter-map{padding-left:6px}.ok-table-tools{gap:6px;padding:6px}.ok-table-search{flex-basis:110px}.ok-table-filter-trigger{padding:0 8px}.ok-table-filter-panel{width:min(260px,calc(100vw - 36px))}.ok-mermaid-viewport-toolbar{gap:5px;min-height:48px;padding:7px 8px}.ok-mermaid-viewport-toolbar button{min-width:30px;padding:0 8px}.ok-mermaid-viewport-zoom{min-width:42px}}.note-body h1{font-size:calc(30px * var(--ok-document-scale, 1))}.note-body h2{font-size:calc(21px * var(--ok-document-scale, 1))}.note-body h3{font-size:calc(17px * var(--ok-document-scale, 1))}.note-body li{line-height:var(--ok-document-line-height, 1.62)}.note-body .ok-frontmatter-title{font-size:calc(13px * var(--ok-document-scale, 1))}.note-body .ok-frontmatter-count,.note-body .ok-frontmatter-notice,.note-body .ok-frontmatter-key code,.note-body .ok-frontmatter-multiline,.note-body .ok-frontmatter-number,.note-body .ok-frontmatter-null,.note-body .ok-frontmatter-empty{font-size:calc(12px * var(--ok-document-scale, 1))}.note-body .ok-frontmatter-chip{font-size:calc(11px * var(--ok-document-scale, 1))}.note-body .ok-table{font-size:calc(14px * var(--ok-document-scale, 1))}.note-body .ok-table th{font-size:calc(12px * var(--ok-document-scale, 1))}.note-body .ok-agent-footer{font-size:calc(14px * var(--ok-document-scale, 1))}@media(max-width:680px){.note-body h1{font-size:calc(28px * var(--ok-document-scale, 1))}}@media(max-width:680px),(hover:none)and (pointer:coarse){.workspace-scroll-rail,.powered-by-openknowledge{display:none}} diff --git a/packages/cli/cmd/openknowledge/viewer_assets/viewer.js b/packages/cli/cmd/openknowledge/viewer_assets/viewer.js index f95cdeb..c4e8bea 100644 --- a/packages/cli/cmd/openknowledge/viewer_assets/viewer.js +++ b/packages/cli/cmd/openknowledge/viewer_assets/viewer.js @@ -1,8 +1,8 @@ -var Z1t=Object.defineProperty;var Q1t=(Os,no,y0)=>no in Os?Z1t(Os,no,{enumerable:!0,configurable:!0,writable:!0,value:y0}):Os[no]=y0;var Hr=(Os,no,y0)=>Q1t(Os,typeof no!="symbol"?no+"":no,y0);(function(){"use strict";var gm,mm,ym,vm,bm,xm,Tm,wm,Cm,km,Em,Sm,Am,_m,r6,o0,Rm,Lm,Im,Dm,Mm,Nm,Ns,Om,$m,Pm,Bm,Fm,zm,Gm,qm,Vm,Wm,Um,Hm,Ym,Xm,Km,jm,Zm,Qm,Jm,e1,t1,r1,n1,i1,a1,s1,o1,l1,c1,u1,h1,d1,f1,p1,g1,m1,y1,v1,b1,x1,T1,w1,C1,k1,E1,S1,A1,_1,R1,L1,I1,D1,M1,l0,N1,O1,$1,P1,B1,F1,z1,G1,q1,V1,W1,U1,c0,H1,Y1,X1,K1,j1,Z1,Q1,J1,ey,ty,ry,Ph,ny,iy,ay,sy,oy,ly,cy,uy,hy,dy,fy,py,gy,my,yy,vy,by,xy,Ty,wy,Cy,ky,Ey,Sy,Ay,_y,Ry,Ly,Iy,Dy,My,Ny,Oy,$y,Py,By,Fy,zy,Gy,qy,Vy,Wy,Uy,Hy,Yy,Xy,Ky,jy,Zy,Qy,Jy,ev,tv,rv,nv,iv,av,sv,ov,lv,cv,uv,hv,dv,fv,pv,gv,mv,yv,vv,bv,xv,Tv,wv,Cv,kv,Ev,Sv,Av,_v,Rv,Lv,Iv,Dv,Mv,Nv,Ov,$v,Pv,Bv,Fv,zv,Gv,Bh,u0,qv,Vv,Wv,bu,Uv,Qve,Jve,Hv,Yv,Xv,Kv;function Os(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var no={exports:{}},y0=no.exports,jP;function Y2e(){return jP||(jP=1,(function(t,e){(function(r,n){t.exports=n()})(y0,(function(){var r=1e3,n=6e4,i=36e5,a="millisecond",s="second",o="minute",l="hour",u="day",h="week",d="month",f="quarter",p="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,T={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(S){var R=["th","st","nd","rd"],N=S%100;return"["+S+(R[(N-20)%10]||R[N]||R[0])+"]"}},b=function(S,R,N){var D=String(S);return!D||D.length>=R?S:""+Array(R+1-D.length).join(N)+S},w={s:b,z:function(S){var R=-S.utcOffset(),N=Math.abs(R),D=Math.floor(N/60),I=N%60;return(R<=0?"+":"-")+b(D,2,"0")+":"+b(I,2,"0")},m:function S(R,N){if(R.date()1)return S(B[0])}else{var P=R.name;A[P]=R,I=P}return!D&&I&&(k=I),I||!D&&k},O=function(S,R){if(_(S))return S.clone();var N=typeof R=="object"?R:{};return N.date=S,N.args=arguments,new z(N)},M=w;M.l=L,M.i=_,M.w=function(S,R){return O(S,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var z=(function(){function S(N){this.$L=L(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[C]=!0}var R=S.prototype;return R.parse=function(N){this.$d=(function(D){var I=D.date,$=D.utc;if(I===null)return new Date(NaN);if(M.u(I))return new Date;if(I instanceof Date)return new Date(I);if(typeof I=="string"&&!/Z$/i.test(I)){var B=I.match(y);if(B){var P=B[2]-1||0,G=(B[7]||"0").substring(0,3);return $?new Date(Date.UTC(B[1],P,B[3]||1,B[4]||0,B[5]||0,B[6]||0,G)):new Date(B[1],P,B[3]||1,B[4]||0,B[5]||0,B[6]||0,G)}}return new Date(I)})(N),this.init()},R.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},R.$utils=function(){return M},R.isValid=function(){return this.$d.toString()!==m},R.isSame=function(N,D){var I=O(N);return this.startOf(D)<=I&&I<=this.endOf(D)},R.isAfter=function(N,D){return O(N)ZP(t,"name",{value:e,configurable:!0}),bw=(t,e)=>{for(var r in e)ZP(t,r,{get:e[r],enumerable:!0})},cc={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},ae={trace:x((...t)=>{},"trace"),debug:x((...t)=>{},"debug"),info:x((...t)=>{},"info"),warn:x((...t)=>{},"warn"),error:x((...t)=>{},"error"),fatal:x((...t)=>{},"fatal")},p6=x(function(t="fatal"){let e=cc.fatal;typeof t=="string"?t.toLowerCase()in cc&&(e=cc[t]):typeof t=="number"&&(e=t),ae.trace=()=>{},ae.debug=()=>{},ae.info=()=>{},ae.warn=()=>{},ae.error=()=>{},ae.fatal=()=>{},e<=cc.fatal&&(ae.fatal=console.error?console.error.bind(console,io("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",io("FATAL"))),e<=cc.error&&(ae.error=console.error?console.error.bind(console,io("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",io("ERROR"))),e<=cc.warn&&(ae.warn=console.warn?console.warn.bind(console,io("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",io("WARN"))),e<=cc.info&&(ae.info=console.info?console.info.bind(console,io("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",io("INFO"))),e<=cc.debug&&(ae.debug=console.debug?console.debug.bind(console,io("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",io("DEBUG"))),e<=cc.trace&&(ae.trace=console.debug?console.debug.bind(console,io("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",io("TRACE")))},"setLogLevel"),io=x(t=>`%c${Yi().format("ss.SSS")} : ${t} : `,"format");const xw={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return xw.hue2rgb(a,i,t+1/3)*255;case"g":return xw.hue2rgb(a,i,t)*255;case"b":return xw.hue2rgb(a,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;const o=i-a,l=s>.5?o/(2-i-a):o/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/o+(ee>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},unit:{dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}}},Tu={};for(let t=0;t<=255;t++)Tu[t]=Er.unit.dec2hex(t);const ka={ALL:0,RGB:1,HSL:2};let K2e=class{constructor(){this.type=ka.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=ka.ALL}is(e){return this.type===e}};class j2e{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new K2e}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=ka.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=Er.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=Er.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Er.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=Er.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=Er.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Er.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(ka.HSL)&&r!==void 0?r:(this._ensureHSL(),Er.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(ka.HSL)&&r!==void 0?r:(this._ensureHSL(),Er.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(ka.HSL)&&r!==void 0?r:(this._ensureHSL(),Er.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(ka.RGB)&&r!==void 0?r:(this._ensureRGB(),Er.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(ka.RGB)&&r!==void 0?r:(this._ensureRGB(),Er.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(ka.RGB)&&r!==void 0?r:(this._ensureRGB(),Er.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(ka.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(ka.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(ka.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(ka.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(ka.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(ka.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const Tw=new j2e({r:0,g:0,b:0,a:0},"transparent"),v0={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(v0.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,o=s?1:17,l=s?8:4,u=a?0:-1,h=s?255:15;return Tw.set({r:(n>>l*(u+3)&h)*o,g:(n>>l*(u+2)&h)*o,b:(n>>l*(u+1)&h)*o,a:a?(n&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${Tu[Math.round(e)]}${Tu[Math.round(r)]}${Tu[Math.round(n)]}${Tu[Math.round(i*255)]}`:`#${Tu[Math.round(e)]}${Tu[Math.round(r)]}${Tu[Math.round(n)]}`}},Gh={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(Gh.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return Er.channel.clamp.h(parseFloat(r)*.9);case"rad":return Er.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Er.channel.clamp.h(parseFloat(r)*360)}}return Er.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(Gh.re);if(!r)return;const[,n,i,a,s,o]=r;return Tw.set({h:Gh._hue2deg(n),s:Er.channel.clamp.s(parseFloat(i)),l:Er.channel.clamp.l(parseFloat(a)),a:s?Er.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${Er.lang.round(e)}, ${Er.lang.round(r)}%, ${Er.lang.round(n)}%, ${i})`:`hsl(${Er.lang.round(e)}, ${Er.lang.round(r)}%, ${Er.lang.round(n)}%)`}},i2={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=i2.colors[t];if(e)return v0.parse(e)},stringify:t=>{const e=v0.stringify(t);for(const r in i2.colors)if(i2.colors[r]===e)return r}},a2={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(a2.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return Tw.set({r:Er.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Er.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:Er.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?Er.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${Er.lang.round(e)}, ${Er.lang.round(r)}, ${Er.lang.round(n)}, ${Er.lang.round(i)})`:`rgb(${Er.lang.round(e)}, ${Er.lang.round(r)}, ${Er.lang.round(n)})`}},So={format:{keyword:i2,hex:v0,rgb:a2,rgba:a2,hsl:Gh,hsla:Gh},parse:t=>{if(typeof t!="string")return t;const e=v0.parse(t)||a2.parse(t)||Gh.parse(t)||i2.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(ka.HSL)||t.data.r===void 0?Gh.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?a2.stringify(t):v0.stringify(t)},QP=(t,e)=>{const r=So.parse(t);for(const n in e)r[n]=Er.channel.clamp[n](e[n]);return So.stringify(r)},Ao=(t,e,r=0,n=1)=>{if(typeof t!="number")return QP(t,{a:e});const i=Tw.set({r:Er.channel.clamp.r(t),g:Er.channel.clamp.g(e),b:Er.channel.clamp.b(r),a:Er.channel.clamp.a(n)});return So.stringify(i)},g6=(t,e)=>Er.lang.round(So.parse(t)[e]),Z2e=t=>{const{r:e,g:r,b:n}=So.parse(t),i=.2126*Er.channel.toLinear(e)+.7152*Er.channel.toLinear(r)+.0722*Er.channel.toLinear(n);return Er.lang.round(i)},Q2e=t=>Z2e(t)>=.5,Ba=t=>!Q2e(t),m6=(t,e,r)=>{const n=So.parse(t),i=n[e],a=Er.channel.clamp[e](i+r);return i!==a&&(n[e]=a),So.stringify(n)},at=(t,e)=>m6(t,"l",e),st=(t,e)=>m6(t,"l",-e),JP=(t,e)=>m6(t,"a",-e),le=(t,e)=>{const r=So.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return QP(t,n)},J2e=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=So.parse(t),{r:o,g:l,b:u,a:h}=So.parse(e),d=r/100,f=d*2-1,p=s-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,y=1-m,v=n*m+o*y,T=i*m+l*y,b=a*m+u*y,w=s*d+h*(1-d);return Ao(v,T,b,w)},Ke=(t,e=100)=>{const r=So.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,J2e(r,t,e)};/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function eB(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r2?n-2:0),a=2;a1?r-1:0),i=1;i"u"?null:Ti(BigInt.prototype.toString),lB=typeof Symbol>"u"?null:Ti(Symbol.prototype.toString),Xi=Ti(Object.prototype.hasOwnProperty),l2=Ti(Object.prototype.toString),Ki=Ti(RegExp.prototype.test),qh=fbe(TypeError);function Ti(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:s2;if(rB&&rB(t,null),!wu(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(abe(e)||(e[n]=a),i=a)}t[i]=!0}return t}function pbe(t){for(let e=0;e/g),Tbe=la(/\${[\w\W]*/g),wbe=la(/^data-[\-\w.\u00B7-\uFFFF]+$/),Cbe=la(/^aria-[\-\w]+$/),fB=la(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kbe=la(/^(?:\w+script|data):/i),Ebe=la(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Sbe=la(/^html$/i),Abe=la(/^[a-z][.\w]*(-[.\w]+)+$/i),pB=la(/<[/\w!]/g),gB=la(/<[/\w]/g),_be=la(/<\/no(script|embed|frames)/i),Rbe=la(/\/>/i),$s={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Lbe=function(){return typeof window>"u"?null:window},Ibe=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},mB=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Cu=function(e,r,n,i){return Xi(e,r)&&wu(e[r])?Yr(i.base?Fa(i.base):{},e[r],i.transform):n};function yB(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Lbe();const e=Ot=>yB(Ot);if(e.version="3.4.12",e.removed=[],!t||!t.document||t.document.nodeType!==$s.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,i=n.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,s=t.Node,o=t.Element,l=t.NodeFilter,u=t.NamedNodeMap;u===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,d=t.trustedTypes,f=o.prototype,p=cl(f,"cloneNode"),g=cl(f,"remove"),m=cl(f,"nextSibling"),y=cl(f,"childNodes"),v=cl(f,"parentNode"),T=cl(f,"shadowRoot"),b=cl(f,"attributes"),w=s&&s.prototype?cl(s.prototype,"nodeType"):null,k=s&&s.prototype?cl(s.prototype,"nodeName"):null;if(typeof a=="function"){const Ot=r.createElement("template");Ot.content&&Ot.content.ownerDocument&&(r=Ot.content.ownerDocument)}let A,C="",_,L=!1,O=0;const M=function(){if(O>0)throw qh('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},z=function(Re){M(),O++;try{return A.createHTML(Re)}finally{O--}},F=function(Re){M(),O++;try{return A.createScriptURL(Re)}finally{O--}},S=function(){return L||(_=Ibe(d,i),L=!0),_},R=r,N=R.implementation,D=R.createNodeIterator,I=R.createDocumentFragment,$=R.getElementsByTagName,B=n.importNode;let P=mB();e.isSupported=typeof tB=="function"&&typeof v=="function"&&N&&N.createHTMLDocument!==void 0;const G=bbe,V=xbe,Y=Tbe,W=wbe,ie=Cbe,K=kbe,se=Ebe,J=Abe;let Z=fB,ee=null;const ne=Yr({},[...cB,...x6,...T6,...w6,...uB]);let ue=null;const fe=Yr({},[...hB,...C6,...dB,...ww]);let _e=Object.seal(b0(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ae=null,Ne=null;const me=Object.seal(b0(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ve=!0,Ge=!0,Te=!1,Ze=!0,ke=!1,Ve=!0,Qe=!1,nt=!1,tt=null,je=null,Ce=!1,Se=!1,H=!1,he=!1,j=!0,pe=!1;const re="user-content-";let Be=!0,xe=!1,Ue={},De=null;const qe=Yr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Le=null;const Xe=Yr({},["audio","video","img","source","image","track"]);let Ie=null;const it=Yr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),we="http://www.w3.org/1998/Math/MathML",lt="http://www.w3.org/2000/svg",be="http://www.w3.org/1999/xhtml";let Et=be,vt=!1,ot=null;const It=Yr({},[we,lt,be],b6),xt=oa(["mi","mo","mn","ms","mtext"]);let ht=Yr({},xt);const oe=oa(["annotation-xml"]);let At=Yr({},oe);const dt=Yr({},["title","style","font","a","script"]);let ut=null;const wt=["application/xhtml+xml","text/html"],Mr="text/html";let ye=null,et=null;const ct=r.createElement("form"),_t=function(Re){return Re instanceof RegExp||Re instanceof Function},Ft=function(){let Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(et&&et===Re)return;(!Re||typeof Re!="object")&&(Re={}),Re=Fa(Re),ut=wt.indexOf(Re.PARSER_MEDIA_TYPE)===-1?Mr:Re.PARSER_MEDIA_TYPE,ye=ut==="application/xhtml+xml"?b6:s2,ee=Cu(Re,"ALLOWED_TAGS",ne,{transform:ye}),ue=Cu(Re,"ALLOWED_ATTR",fe,{transform:ye}),ot=Cu(Re,"ALLOWED_NAMESPACES",It,{transform:b6}),Ie=Cu(Re,"ADD_URI_SAFE_ATTR",it,{transform:ye,base:it}),Le=Cu(Re,"ADD_DATA_URI_TAGS",Xe,{transform:ye,base:Xe}),De=Cu(Re,"FORBID_CONTENTS",qe,{transform:ye}),Ae=Cu(Re,"FORBID_TAGS",Fa({}),{transform:ye}),Ne=Cu(Re,"FORBID_ATTR",Fa({}),{transform:ye}),Ue=Xi(Re,"USE_PROFILES")?Re.USE_PROFILES&&typeof Re.USE_PROFILES=="object"?Fa(Re.USE_PROFILES):Re.USE_PROFILES:!1,ve=Re.ALLOW_ARIA_ATTR!==!1,Ge=Re.ALLOW_DATA_ATTR!==!1,Te=Re.ALLOW_UNKNOWN_PROTOCOLS||!1,Ze=Re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ke=Re.SAFE_FOR_TEMPLATES||!1,Ve=Re.SAFE_FOR_XML!==!1,Qe=Re.WHOLE_DOCUMENT||!1,Se=Re.RETURN_DOM||!1,H=Re.RETURN_DOM_FRAGMENT||!1,he=Re.RETURN_TRUSTED_TYPE||!1,Ce=Re.FORCE_BODY||!1,j=Re.SANITIZE_DOM!==!1,pe=Re.SANITIZE_NAMED_PROPS||!1,Be=Re.KEEP_CONTENT!==!1,xe=Re.IN_PLACE||!1,Z=mbe(Re.ALLOWED_URI_REGEXP)?Re.ALLOWED_URI_REGEXP:fB,Et=typeof Re.NAMESPACE=="string"?Re.NAMESPACE:be,ht=Xi(Re,"MATHML_TEXT_INTEGRATION_POINTS")&&Re.MATHML_TEXT_INTEGRATION_POINTS&&typeof Re.MATHML_TEXT_INTEGRATION_POINTS=="object"?Fa(Re.MATHML_TEXT_INTEGRATION_POINTS):Yr({},xt),At=Xi(Re,"HTML_INTEGRATION_POINTS")&&Re.HTML_INTEGRATION_POINTS&&typeof Re.HTML_INTEGRATION_POINTS=="object"?Fa(Re.HTML_INTEGRATION_POINTS):Yr({},oe);const Je=Xi(Re,"CUSTOM_ELEMENT_HANDLING")&&Re.CUSTOM_ELEMENT_HANDLING&&typeof Re.CUSTOM_ELEMENT_HANDLING=="object"?Fa(Re.CUSTOM_ELEMENT_HANDLING):b0(null);if(_e=b0(null),Xi(Je,"tagNameCheck")&&_t(Je.tagNameCheck)&&(_e.tagNameCheck=Je.tagNameCheck),Xi(Je,"attributeNameCheck")&&_t(Je.attributeNameCheck)&&(_e.attributeNameCheck=Je.attributeNameCheck),Xi(Je,"allowCustomizedBuiltInElements")&&typeof Je.allowCustomizedBuiltInElements=="boolean"&&(_e.allowCustomizedBuiltInElements=Je.allowCustomizedBuiltInElements),la(_e),ke&&(Ge=!1),H&&(Se=!0),Ue&&(ee=Yr({},uB),ue=b0(null),Ue.html===!0&&(Yr(ee,cB),Yr(ue,hB)),Ue.svg===!0&&(Yr(ee,x6),Yr(ue,C6),Yr(ue,ww)),Ue.svgFilters===!0&&(Yr(ee,T6),Yr(ue,C6),Yr(ue,ww)),Ue.mathMl===!0&&(Yr(ee,w6),Yr(ue,dB),Yr(ue,ww))),me.tagCheck=null,me.attributeCheck=null,Xi(Re,"ADD_TAGS")&&(typeof Re.ADD_TAGS=="function"?me.tagCheck=Re.ADD_TAGS:wu(Re.ADD_TAGS)&&(ee===ne&&(ee=Fa(ee)),Yr(ee,Re.ADD_TAGS,ye))),Xi(Re,"ADD_ATTR")&&(typeof Re.ADD_ATTR=="function"?me.attributeCheck=Re.ADD_ATTR:wu(Re.ADD_ATTR)&&(ue===fe&&(ue=Fa(ue)),Yr(ue,Re.ADD_ATTR,ye))),Xi(Re,"ADD_URI_SAFE_ATTR")&&wu(Re.ADD_URI_SAFE_ATTR)&&Yr(Ie,Re.ADD_URI_SAFE_ATTR,ye),Xi(Re,"FORBID_CONTENTS")&&wu(Re.FORBID_CONTENTS)&&(De===qe&&(De=Fa(De)),Yr(De,Re.FORBID_CONTENTS,ye)),Xi(Re,"ADD_FORBID_CONTENTS")&&wu(Re.ADD_FORBID_CONTENTS)&&(De===qe&&(De=Fa(De)),Yr(De,Re.ADD_FORBID_CONTENTS,ye)),Be&&(ee["#text"]=!0),Qe&&Yr(ee,["html","head","body"]),ee.table&&(Yr(ee,["tbody"]),delete Ae.tbody),Re.TRUSTED_TYPES_POLICY){if(typeof Re.TRUSTED_TYPES_POLICY.createHTML!="function")throw qh('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qh('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const bt=A;A=Re.TRUSTED_TYPES_POLICY;try{C=z("")}catch(Vt){throw A=bt,Vt}}else Re.TRUSTED_TYPES_POLICY===null?(A=void 0,C=""):(A===void 0&&(A=S()),A&&typeof C=="string"&&(C=z("")));oa&&oa(Re),et=Re},nr=Yr({},[...x6,...T6,...ybe]),ir=Yr({},[...w6,...vbe]),_r=function(Re,Je,bt){return Je.namespaceURI===be?Re==="svg":Je.namespaceURI===we?Re==="svg"&&(bt==="annotation-xml"||ht[bt]):!!nr[Re]},or=function(Re,Je,bt){return Je.namespaceURI===be?Re==="math":Je.namespaceURI===lt?Re==="math"&&At[bt]:!!ir[Re]},Rr=function(Re,Je,bt){return Je.namespaceURI===lt&&!At[bt]||Je.namespaceURI===we&&!ht[bt]?!1:!ir[Re]&&(dt[Re]||!nr[Re])},Jt=function(Re){let Je=v(Re);(!Je||!Je.tagName)&&(Je={namespaceURI:Et,tagName:"template"});const bt=s2(Re.tagName),Vt=s2(Je.tagName);return ot[Re.namespaceURI]?Re.namespaceURI===lt?_r(bt,Je,Vt):Re.namespaceURI===we?or(bt,Je,Vt):Re.namespaceURI===be?Rr(bt,Je,Vt):!!(ut==="application/xhtml+xml"&&ot[Re.namespaceURI]):!1},Nr=function(Re){T0(e.removed,{element:Re});try{v(Re).removeChild(Re)}catch{if(g(Re),!v(Re))throw qh("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},gn=function(Re){ps(Re);const Je=y(Re);if(Je){const Vt=[];x0(Je,dr=>{T0(Vt,dr)}),x0(Vt,dr=>{try{g(dr)}catch{}})}const bt=b(Re);if(bt)for(let Vt=bt.length-1;Vt>=0;--Vt){const dr=bt[Vt],fr=dr&&dr.name;if(typeof fr=="string")try{Re.removeAttribute(fr)}catch{}}},$r=function(Re,Je){try{T0(e.removed,{attribute:Je.getAttributeNode(Re),from:Je})}catch{T0(e.removed,{attribute:null,from:Je})}if(Je.removeAttribute(Re),Re==="is")if(Se||H)try{Nr(Je)}catch{}else try{Je.setAttribute(Re,"")}catch{}},Pa=function(Re){const Je=b(Re);if(Je)for(let bt=Je.length-1;bt>=0;--bt){const Vt=Je[bt],dr=Vt&&Vt.name;if(!(typeof dr!="string"||ue[ye(dr)]))try{Re.removeAttribute(dr)}catch{}}},ps=function(Re){const Je=[Re];for(;Je.length>0;){const bt=Je.pop();(w?w(bt):bt.nodeType)===$s.element&&Pa(bt);const dr=y(bt);if(dr)for(let fr=dr.length-1;fr>=0;--fr)Je.push(dr[fr])}},gs=function(Re){if(!Ve)return;const Je=[Re];for(;Je.length>0;){const bt=Je.pop(),Vt=w?w(bt):bt.nodeType;if(Vt===$s.processingInstruction||Vt===$s.comment&&Ki(gB,bt.data)){try{g(bt)}catch{}continue}if(Vt===$s.element){const fr=bt,mn=ye(k?k(bt):bt.nodeName);try{fr.hasAttribute&&fr.hasAttribute("patchsrc")&&fr.removeAttribute("patchsrc"),fr.hasAttribute&&fr.hasAttribute("for")&&mn!=="label"&&mn!=="output"&&fr.removeAttribute("for")}catch{}}const dr=y(bt);if(dr)for(let fr=dr.length-1;fr>=0;--fr)Je.push(dr[fr])}},li=function(Re){let Je=null,bt=null;if(Ce)Re=""+Re;else{const fr=aB(Re,/^[\r\n\t ]+/);bt=fr&&fr[0]}ut==="application/xhtml+xml"&&Et===be&&(Re=''+Re+"");const Vt=A?z(Re):Re;if(Et===be)try{Je=new h().parseFromString(Vt,ut)}catch{}if(!Je||!Je.documentElement){Je=N.createDocument(Et,"template",null);try{Je.documentElement.innerHTML=vt?C:Vt}catch{}}const dr=Je.body||Je.documentElement;return Re&&bt&&dr.insertBefore(r.createTextNode(bt),dr.childNodes[0]||null),Et===be?$.call(Je,Qe?"html":"body")[0]:Qe?Je.documentElement:dr},Bt=function(Re){return D.call(Re.ownerDocument||Re,Re,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},yt=function(Re){return Re=o2(Re,G," "),Re=o2(Re,V," "),Re=o2(Re,Y," "),Re},Pt=function(Re){var Je;Re.normalize();const bt=D.call(Re.ownerDocument||Re,Re,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let Vt=bt.nextNode();for(;Vt;)Vt.data=yt(Vt.data),Vt=bt.nextNode();const dr=(Je=Re.querySelectorAll)===null||Je===void 0?void 0:Je.call(Re,"template");dr&&x0(dr,fr=>{pr(fr.content)&&Pt(fr.content)})},Ct=function(Re){const Je=k?k(Re):null;return typeof Je!="string"||ye(Je)!=="form"?!1:typeof Re.nodeName!="string"||typeof Re.textContent!="string"||typeof Re.removeChild!="function"||Re.attributes!==b(Re)||typeof Re.removeAttribute!="function"||typeof Re.setAttribute!="function"||typeof Re.namespaceURI!="string"||typeof Re.insertBefore!="function"||typeof Re.hasChildNodes!="function"||Re.nodeType!==w(Re)||Re.childNodes!==y(Re)},pr=function(Re){if(!w||typeof Re!="object"||Re===null)return!1;try{return w(Re)===$s.documentFragment}catch{return!1}},Ee=function(Re){if(!w||typeof Re!="object"||Re===null)return!1;try{return typeof w(Re)=="number"}catch{return!1}};function Di(Ot,Re,Je){Ot.length!==0&&x0(Ot,bt=>{bt.call(e,Re,Je,et)})}const Oe=function(Re,Je){return!!(Ve&&Re.hasChildNodes()&&!Ee(Re.firstElementChild)&&Ki(pB,Re.textContent)&&Ki(pB,Re.innerHTML)||Ve&&Re.namespaceURI===be&&Je==="style"&&Ee(Re.firstElementChild)||Re.nodeType===$s.processingInstruction||Ve&&Re.nodeType===$s.comment&&Ki(gB,Re.data))},Ln=function(Re,Je){if(!Ae[Je]&&Qv(Je)&&(_e.tagNameCheck instanceof RegExp&&Ki(_e.tagNameCheck,Je)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(Je)))return!1;if(Be&&!De[Je]){const bt=v(Re),Vt=y(Re);if(Vt&&bt){const dr=Vt.length;for(let fr=dr-1;fr>=0;--fr){const mn=xe?Vt[fr]:p(Vt[fr],!0);bt.insertBefore(mn,m(Re))}}}return Nr(Re),!0},h0=function(Re,Je){if(Di(P.beforeSanitizeElements,Re,null),Re!==Je&&v(Re)===null)return!0;if(Ct(Re))return Nr(Re),!0;const bt=ye(k?k(Re):Re.nodeName);if(Di(P.uponSanitizeElement,Re,{tagName:bt,allowedTags:ee}),Re!==Je&&v(Re)===null)return!0;if(Oe(Re,bt))return Nr(Re),!0;if(Ae[bt]||!(me.tagCheck instanceof Function&&me.tagCheck(bt))&&!ee[bt]){const dr=Ln(Re,bt);return dr===!1&&Di(P.afterSanitizeElements,Re,null),dr}if((w?w(Re):Re.nodeType)===$s.element&&!Jt(Re)||(bt==="noscript"||bt==="noembed"||bt==="noframes")&&Ki(_be,Re.innerHTML))return Nr(Re),!0;if(ke&&Re.nodeType===$s.text){const dr=yt(Re.textContent);Re.textContent!==dr&&(T0(e.removed,{element:Re.cloneNode()}),Re.textContent=dr)}return Di(P.afterSanitizeElements,Re,null),!1},jv=function(Re,Je,bt){if(Ne[Je]||Ve&&Je==="patchsrc"||Ve&&Je==="for"&&Re!=="label"&&Re!=="output"||j&&(Je==="id"||Je==="name")&&(bt in r||bt in ct))return!1;const Vt=ue[Je]||me.attributeCheck instanceof Function&&me.attributeCheck(Je,Re);if(!(Ge&&Ki(W,Je))){if(!(ve&&Ki(ie,Je))){if(Vt){if(!Ie[Je]){if(!Ki(Z,o2(bt,se,""))){if(!((Je==="src"||Je==="xlink:href"||Je==="href")&&Re!=="script"&&sB(bt,"data:")===0&&Le[Re])){if(!(Te&&!Ki(K,o2(bt,se,"")))){if(bt)return!1}}}}}else if(!(Qv(Re)&&(_e.tagNameCheck instanceof RegExp&&Ki(_e.tagNameCheck,Re)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(Re))&&(_e.attributeNameCheck instanceof RegExp&&Ki(_e.attributeNameCheck,Je)||_e.attributeNameCheck instanceof Function&&_e.attributeNameCheck(Je,Re))||Je==="is"&&_e.allowCustomizedBuiltInElements&&(_e.tagNameCheck instanceof RegExp&&Ki(_e.tagNameCheck,bt)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(bt))))return!1}}return!0},Zv=Yr({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Qv=function(Re){return!Zv[s2(Re)]&&Ki(J,Re)},Jn=function(Re,Je,bt,Vt){if(A&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!bt)switch(d.getAttributeType(Re,Je)){case"TrustedHTML":return z(Vt);case"TrustedScriptURL":return F(Vt)}return Vt},il=function(Re,Je,bt,Vt){try{bt?Re.setAttributeNS(bt,Je,Vt):Re.setAttribute(Je,Vt),Ct(Re)?Nr(Re):iB(e.removed)}catch{$r(Je,Re)}},yi=function(Re){Di(P.beforeSanitizeAttributes,Re,null);const Je=Re.attributes;if(!Je||Ct(Re))return;const bt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ue,forceKeepAttr:void 0};let Vt=Je.length;const dr=ye(Re.nodeName);for(;Vt--;){const fr=Je[Vt],mn=fr.name,dn=fr.namespaceURI,vi=fr.value,ei=ye(mn),bi=vi;let Qr=mn==="value"?bi:ube(bi);if(bt.attrName=ei,bt.attrValue=Qr,bt.keepAttr=!0,bt.forceKeepAttr=void 0,Di(P.uponSanitizeAttribute,Re,bt),Qr=bt.attrValue,pe&&(ei==="id"||ei==="name")&&sB(Qr,re)!==0&&($r(mn,Re),Qr=re+Qr),Ve&&Ki(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Qr)){$r(mn,Re);continue}if(ei==="attributename"&&aB(Qr,"href")){$r(mn,Re);continue}if(!bt.forceKeepAttr){if(!bt.keepAttr){$r(mn,Re);continue}if(!Ze&&Ki(Rbe,Qr)){$r(mn,Re);continue}if(ke&&(Qr=yt(Qr)),!jv(dr,ei,Qr)){$r(mn,Re);continue}Qr=Jn(dr,ei,dn,Qr),Qr!==bi&&il(Re,mn,dn,Qr)}}Di(P.afterSanitizeAttributes,Re,null)},al=function(Re){let Je=null;const bt=Bt(Re);for(Di(P.beforeSanitizeShadowDOM,Re,null);Je=bt.nextNode();)if(Di(P.uponSanitizeShadowNode,Je,null),h0(Je,Re),yi(Je),pr(Je.content)&&al(Je.content),(w?w(Je):Je.nodeType)===$s.element){const dr=T(Je);pr(dr)&&(xu(dr),al(dr))}Di(P.afterSanitizeShadowDOM,Re,null)},xu=function(Re){const Je=[{node:Re,shadow:null}];for(;Je.length>0;){const bt=Je.pop();if(bt.shadow){al(bt.shadow);continue}const Vt=bt.node,fr=(w?w(Vt):Vt.nodeType)===$s.element,mn=y(Vt);if(mn)for(let dn=mn.length-1;dn>=0;--dn)Je.push({node:mn[dn],shadow:null});if(fr){const dn=k?k(Vt):null;if(typeof dn=="string"&&ye(dn)==="template"){const vi=Vt.content;pr(vi)&&Je.push({node:vi,shadow:null})}}if(fr){const dn=T(Vt);pr(dn)&&Je.push({node:null,shadow:dn},{node:dn,shadow:null})}}};return e.sanitize=function(Ot){let Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Je=null,bt=null,Vt=null,dr=null;if(vt=!Ot,vt&&(Ot=""),typeof Ot!="string"&&!Ee(Ot)&&(Ot=gbe(Ot),typeof Ot!="string"))throw qh("dirty is not a string, aborting");if(!e.isSupported)return Ot;nt?(ee=tt,ue=je):Ft(Re),(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&(ee=Fa(ee)),P.uponSanitizeAttribute.length>0&&(ue=Fa(ue)),e.removed=[];const fr=xe&&typeof Ot!="string"&&Ee(Ot);if(fr){gs(Ot);const ei=k?k(Ot):Ot.nodeName;if(typeof ei=="string"){const bi=ye(ei);if(!ee[bi]||Ae[bi])throw gn(Ot),qh("root node is forbidden and cannot be sanitized in-place")}if(Ct(Ot))throw gn(Ot),qh("root node is clobbered and cannot be sanitized in-place");try{xu(Ot)}catch(bi){throw gn(Ot),bi}}else if(Ee(Ot))Je=li(""),bt=Je.ownerDocument.importNode(Ot,!0),bt.nodeType===$s.element&&bt.nodeName==="BODY"||bt.nodeName==="HTML"?Je=bt:Je.appendChild(bt),xu(bt);else{if(!Se&&!ke&&!Qe&&Ot.indexOf("<")===-1)return A&&he?z(Ot):Ot;if(Je=li(Ot),!Je)return Se?null:he?C:""}Je&&Ce&&Nr(Je.firstChild);const mn=fr?Ot:Je,dn=Bt(mn);try{for(;Vt=dn.nextNode();)h0(Vt,mn),yi(Vt),pr(Vt.content)&&al(Vt.content)}catch(ei){throw fr&&(gn(Ot),x0(e.removed,bi=>{bi.element&&ps(bi.element)})),ei}if(fr)return x0(e.removed,ei=>{ei.element&&ps(ei.element)}),ke&&Pt(Ot),Ot;if(Se){if(ke&&Pt(Je),H)for(dr=I.call(Je.ownerDocument);Je.firstChild;)dr.appendChild(Je.firstChild);else dr=Je;return(ue.shadowroot||ue.shadowrootmode)&&(dr=B.call(n,dr,!0)),dr}let vi=Qe?Je.outerHTML:Je.innerHTML;return Qe&&ee["!doctype"]&&Je.ownerDocument&&Je.ownerDocument.doctype&&Je.ownerDocument.doctype.name&&Ki(Sbe,Je.ownerDocument.doctype.name)&&(vi=" -`+vi),ke&&(vi=yt(vi)),A&&he?z(vi):vi},e.setConfig=function(){let Ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ft(Ot),nt=!0,tt=ee,je=ue},e.clearConfig=function(){et=null,nt=!1,tt=null,je=null,A=_,C=""},e.isValidAttribute=function(Ot,Re,Je){et||Ft({});const bt=ye(Ot),Vt=ye(Re);return jv(bt,Vt,Je)},e.addHook=function(Ot,Re){typeof Re=="function"&&Xi(P,Ot)&&T0(P[Ot],Re)},e.removeHook=function(Ot,Re){if(Xi(P,Ot)){if(Re!==void 0){const Je=lbe(P[Ot],Re);return Je===-1?void 0:cbe(P[Ot],Je,1)[0]}return iB(P[Ot])}},e.removeHooks=function(Ot){Xi(P,Ot)&&(P[Ot]=[])},e.removeAllHooks=function(){P=mB()},e}var ku=yB(),vB=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,c2=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Dbe=/\s*%%.*\n/gm,bB=(gm=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},x(gm,"UnknownDiagramError"),gm),Vh={},k6=x(function(t,e){t=t.replace(vB,"").replace(c2,"").replace(Dbe,` -`);for(const[r,{detector:n}]of Object.entries(Vh))if(n(t,e))return r;throw new bB(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),E6=x((...t)=>{for(const{id:e,detector:r,loader:n}of t)xB(e,r,n)},"registerLazyLoadedDiagrams"),xB=x((t,e,r)=>{Vh[t]&&ae.warn(`Detector with key ${t} already exists. Overwriting.`),Vh[t]={detector:e,loader:r},ae.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),Mbe=x(t=>Vh[t].loader,"getDiagramLoader"),S6=x((t,e,{depth:r=2,clobber:n=!1}={})=>{const i={depth:r,clobber:n};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach(a=>S6(t,a,i)),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach(a=>{t.includes(a)||t.push(a)}),t):t===void 0||r<=0?t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e:(e!==void 0&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(a=>{typeof e[a]=="object"&&e[a]!==null&&(t[a]===void 0||typeof t[a]=="object")?(t[a]===void 0&&(t[a]=Array.isArray(e[a])?[]:{}),t[a]=S6(t[a],e[a],{depth:r-1,clobber:n})):(n||typeof t[a]!="object"&&typeof e[a]!="object")&&(t[a]=e[a])}),t)},"assignWithDepth"),ci=S6,ul="#ffffff",hl="#f2f2f2",Tr=x((t,e)=>e?le(t,{s:-40,l:10}):le(t,{s:-40,l:-10}),"mkBorder"),Nbe=(mm=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,k,A,C,_,L,O,M,z,F,S,R,N,D,I,$;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ke(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||at(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||st(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||st(this.mainBkg,10)):(this.rowOdd=this.rowOdd||at(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||at(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330}),this.darkMode)for(let B=0;B{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(mm,"Theme"),mm),Obe=x(t=>{const e=new Nbe;return e.calculate(t),e},"getThemeVariables"),$be=(ym=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Ke(this.background),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.lineColor=Ke(this.background),this.textColor=Ke(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(Ke("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Ao(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=st("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=st(this.sectionBkgColor,10),this.taskBorderColor=Ao(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Ao(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||at(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||st(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,k,A,C,_,L,O,M,z,F,S,R,N,D,I;this.secondBkg=at(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=at(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=at(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=Ke(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=le(this.primaryColor,{h:64}),this.fillType3=le(this.secondaryColor,{h:64}),this.fillType4=le(this.primaryColor,{h:-64}),this.fillType5=le(this.secondaryColor,{h:-64}),this.fillType6=le(this.primaryColor,{h:128}),this.fillType7=le(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330});for(let $=0;${this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(ym,"Theme"),ym),Pbe=x(t=>{const e=new $be;return e.calculate(t),e},"getThemeVariables"),Bbe=(vm=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=le(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.lineColor=Ke(this.background),this.textColor=Ke(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Ao(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,k,A,C,_,L,O,M,z,F,S,R,N,D,I;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||st(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||st(this.tertiaryColor,40);for(let $=0;${this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(vm,"Theme"),vm),w0=x(t=>{const e=new Bbe;return e.calculate(t),e},"getThemeVariables"),Fbe=(bm=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=at("#cde498",10),this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.primaryColor),this.lineColor=Ke(this.background),this.textColor=Ke(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,k,A,C,_,L,O,M,z,F,S,R,N,D,I;this.actorBorder=st(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||st(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||st(this.tertiaryColor,40);for(let $=0;${this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(bm,"Theme"),bm),zbe=x(t=>{const e=new Fbe;return e.calculate(t),e},"getThemeVariables"),Gbe=(xm=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=at(this.contrast,55),this.background="#ffffff",this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.lineColor=Ke(this.background),this.textColor=Ke(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||at(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,k,A,C,_,L,O,M,z,F,S,R,N,D,I;this.secondBkg=at(this.contrast,55),this.border2=this.contrast,this.actorBorder=at(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let $=0;${this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(xm,"Theme"),xm),qbe=x(t=>{const e=new Gbe;return e.calculate(t),e},"getThemeVariables"),Vbe=(Tm=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ke(this.lineColor);const e="#ECECFE",r="#E9E9F1",n=le(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||at(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||n,this.cScale3=this.cScale3||le(e,{h:30}),this.cScale4=this.cScale4||le(e,{h:60}),this.cScale5=this.cScale5||le(e,{h:90}),this.cScale6=this.cScale6||le(e,{h:120}),this.cScale7=this.cScale7||le(e,{h:150}),this.cScale8=this.cScale8||le(e,{h:210,l:150}),this.cScale9=this.cScale9||le(e,{h:270}),this.cScale10=this.cScale10||le(e,{h:300}),this.cScale11=this.cScale11||le(e,{h:330}),this.darkMode)for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Tm,"Theme"),Tm),Wbe=x(t=>{const e=new Vbe;return e.calculate(t),e},"getThemeVariables"),Ube=(wm=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Ke(this.background),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(Ke("#323D47"),10),this.border1="#ccc",this.border2=Ao(255,255,255,.25),this.arrowheadColor=Ke(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ke(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||at(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(wm,"Theme"),wm),Hbe=x(t=>{const e=new Ube;return e.calculate(t),e},"getThemeVariables"),Ybe=(Cm=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Tr("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ke(this.lineColor);const e="#ECECFE",r="#E9E9F1",n=le(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||at(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Cm,"Theme"),Cm),Xbe=x(t=>{const e=new Ybe;return e.calculate(t),e},"getThemeVariables"),Kbe=(km=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Ke(this.background),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(Ke("#323D47"),10),this.border1="#ccc",this.border2=Ao(255,255,255,.25),this.arrowheadColor=Ke(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ke(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||at(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(km,"Theme"),km),jbe=x(t=>{const e=new Kbe;return e.calculate(t),e},"getThemeVariables"),Zbe=(Em=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ke(this.lineColor);const e="#ECECFE",r="#E9E9F1",n=le(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||at(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Em,"Theme"),Em),Qbe=x(t=>{const e=new Zbe;return e.calculate(t),e},"getThemeVariables"),Jbe=(Sm=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Ke(this.background),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(Ke("#323D47"),10),this.border1="#ccc",this.border2=Ao(255,255,255,.25),this.arrowheadColor=Ke(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ke(this.lineColor),this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||at(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Sm,"Theme"),Sm),exe=x(t=>{const e=new Jbe;return e.calculate(t),e},"getThemeVariables"),uc={base:{getThemeVariables:Obe},dark:{getThemeVariables:Pbe},default:{getThemeVariables:w0},forest:{getThemeVariables:zbe},neutral:{getThemeVariables:qbe},neo:{getThemeVariables:Wbe},"neo-dark":{getThemeVariables:Hbe},redux:{getThemeVariables:Xbe},"redux-dark":{getThemeVariables:jbe},"redux-color":{getThemeVariables:Qbe},"redux-dark-color":{getThemeVariables:exe}},za={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},TB={...za,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:uc.default.getThemeVariables(),sequence:{...za.sequence,messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:x(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:x(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...za.gantt,tickInterval:void 0,useWidth:void 0},c4:{...za.c4,useWidth:void 0,personFont:x(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...za.flowchart,inheritDir:!1},external_personFont:x(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:x(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:x(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:x(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:x(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:x(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:x(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:x(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:x(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:x(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:x(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:x(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:x(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:x(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:x(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:x(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:x(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:x(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:x(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:x(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...za.pie,useWidth:984},xyChart:{...za.xyChart,useWidth:void 0},requirement:{...za.requirement,useWidth:void 0},packet:{...za.packet},eventmodeling:{...za.eventmodeling},treeView:{...za.treeView,useWidth:void 0},radar:{...za.radar},ishikawa:{...za.ishikawa},sankey:{...za.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...za.venn}},wB=x((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...wB(t[n],"")]:[...r,e+n],[]),"keyify"),txe=new Set(wB(TB,"")),Fr=TB,Cw=x(t=>{if(ae.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>Cw(e));return}for(const e of Object.keys(t)){if(ae.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!txe.has(e)||t[e]==null){ae.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){if(e==="nodeColors"){const n=/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i;for(const i of Object.keys(t[e]))(typeof t[e][i]!="string"||!n.test(t[e][i]))&&(ae.debug("sanitize deleting invalid color:",i,t[e][i]),delete t[e][i])}else ae.debug("sanitizing object",e),Cw(t[e]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(ae.debug("sanitizing css option",e),t[e]=CB(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}ae.debug("After sanitization",t)}},"sanitizeDirective"),CB=x(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),ms=ci({},C0),kw,Wh=[],u2=ci({},C0),Ew=x((t,e)=>{let r=ci({},t),n={};for(const i of e)SB(i),n=ci(n,i);if(r=ci(r,n),n.theme&&n.theme in uc){const i=ci({},kw),a=ci(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in uc&&(r.themeVariables=uc[r.theme].getThemeVariables(a))}return u2=r,RB(u2),u2},"updateCurrentConfig"),rxe=x(t=>(ms=ci({},C0),ms=ci(ms,t),t.theme&&uc[t.theme]&&(ms.themeVariables=uc[t.theme].getThemeVariables(t.themeVariables)),Ew(ms,Wh),ms),"setSiteConfig"),nxe=x(t=>{kw=ci({},t)},"saveConfigFromInitialize"),ixe=x(t=>(ms=ci(ms,t),Ew(ms,Wh),ms),"updateSiteConfig"),kB=x(()=>ci({},ms),"getSiteConfig"),EB=x(t=>(RB(t),ci(u2,t),lr()),"setConfig"),lr=x(()=>ci({},u2),"getConfig"),SB=x(t=>{t&&(["secure",...ms.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(ae.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&SB(t[e])}))},"sanitize"),axe=x(t=>{var e;Cw(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),Wh.push(t),Ew(ms,Wh)},"addDirective"),Sw=x((t=ms)=>{Wh=[],Ew(t,Wh)},"reset"),sxe={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},AB={},_B=x(t=>{AB[t]||(ae.warn(sxe[t]),AB[t]=!0)},"issueWarning"),RB=x(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&_B("LAZY_LOAD_DEPRECATED")},"checkConfig"),oxe=x(()=>{let t={};kw&&(t=ci(t,kw));for(const e of Wh)t=ci(t,e);return t},"getUserDefinedConfig"),on=x(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&_B("FLOWCHART_HTML_LABELS_DEPRECATED"),hc(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),k0=//gi,lxe=x(t=>t?MB(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),cxe=(()=>{let t=!1;return()=>{t||(LB(),t=!0)}})();function LB(){const t="data-temp-href-target";ku.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),ku.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}x(LB,"setupDompurifyHooks");var IB=x(t=>(cxe(),ku.sanitize(t)),"removeScript"),DB=x((t,e)=>{if(on(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=IB(t):r!=="loose"&&(t=MB(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=fxe(t))}return t},"sanitizeMore"),qr=x((t,e)=>t&&(e.dompurifyConfig?t=ku.sanitize(DB(t,e),e.dompurifyConfig).toString():t=ku.sanitize(DB(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),uxe=x((t,e)=>typeof t=="string"?qr(t,e):t.flat().map(r=>qr(r,e)),"sanitizeTextOrArray"),hxe=x(t=>k0.test(t),"hasBreaks"),dxe=x(t=>t.split(k0),"splitBreaks"),fxe=x(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),MB=x(t=>t.replace(k0,"#br#"),"breakToPlaceholder"),Aw=x(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),pxe=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),gxe=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),Eu=x(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),mxe=x((t,e)=>{const r=A6(t,"~"),n=A6(e,"~");return r===1&&n===1},"shouldCombineSets"),yxe=x(t=>{const e=A6(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),NB=x(()=>window.MathMLElement!==void 0,"isMathMLSupported"),_6=/\$\$(.*)\$\$/g,ui=x(t=>{var e;return(((e=t.match(_6))==null?void 0:e.length)??0)>0},"hasKatex"),h2=x(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await _w(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),vxe=x(async(t,e)=>{if(!ui(t))return t;if(!(NB()||e.legacyMathML||e.forceLegacyMathML))return t.replace(_6,"MathML is unsupported in this environment.");{const{default:r}=await Promise.resolve().then(()=>SLe),n=e.forceLegacyMathML||!NB()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(k0).map(i=>ui(i)?`
${i}
`:`
${i}
`).join("").replace(_6,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),_w=x(async(t,e)=>qr(await vxe(t,e),e),"renderKatexSanitized"),Lt={getRows:lxe,sanitizeText:qr,sanitizeTextOrArray:uxe,hasBreaks:hxe,splitBreaks:dxe,lineBreakRegex:k0,removeScript:IB,getUrl:Aw,evaluate:hc,getMax:pxe,getMin:gxe},bxe=x(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),xxe=x(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),wi=x(function(t,e,r,n){const i=xxe(e,r,n);bxe(t,i)},"configureSvgSize"),E0=x(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;ae.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;ae.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,ae.info(`Calculated bounds: ${o}x${l}`),wi(e,l,o,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),Rw={};function R6(t){return[...t.cssRules].map(e=>e.cssText).join(` -`)}x(R6,"cssStyleSheetToString");var Txe=x((t,e,r,n)=>{let i="";return t in Rw&&Rw[t]?i=Rw[t]({...r,svgId:n}):ae.warn(`No theme found for ${t}`),` & { +var hyt=Object.defineProperty;var dyt=(Os,no,yp)=>no in Os?hyt(Os,no,{enumerable:!0,configurable:!0,writable:!0,value:yp}):Os[no]=yp;var Hr=(Os,no,yp)=>dyt(Os,typeof no!="symbol"?no+"":no,yp);(function(){"use strict";var mm,ym,vm,bm,xm,Tm,wm,Cm,km,Em,Sm,Am,_m,Rm,a6,op,Lm,Im,Dm,Mm,Nm,Om,Ns,$m,Pm,Bm,Fm,zm,Gm,qm,Vm,Wm,Um,Hm,Ym,Xm,Km,jm,Zm,Qm,Jm,e1,t1,r1,n1,i1,a1,s1,o1,l1,c1,u1,h1,d1,f1,p1,g1,m1,y1,v1,b1,x1,T1,w1,C1,k1,E1,S1,A1,_1,R1,L1,I1,D1,M1,N1,lp,O1,$1,P1,B1,F1,z1,G1,q1,V1,W1,U1,H1,cp,Y1,X1,K1,j1,Z1,Q1,J1,ey,ty,ry,ny,Ph,iy,ay,sy,oy,ly,cy,uy,hy,dy,fy,py,gy,my,yy,vy,by,xy,Ty,wy,Cy,ky,Ey,Sy,Ay,_y,Ry,Ly,Iy,Dy,My,Ny,Oy,$y,Py,By,Fy,zy,Gy,qy,Vy,Wy,Uy,Hy,Yy,Xy,Ky,jy,Zy,Qy,Jy,ev,tv,rv,nv,iv,av,sv,ov,lv,cv,uv,hv,dv,fv,pv,gv,mv,yv,vv,bv,xv,Tv,wv,Cv,kv,Ev,Sv,Av,_v,Rv,Lv,Iv,Dv,Mv,Nv,Ov,$v,Pv,Bv,Fv,zv,Gv,qv,Bh,up,Vv,Wv,Uv,bu,Hv,i2e,a2e,Yv,Xv,Kv,jv;function Os(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var no={exports:{}},yp=no.exports,tB;function J2e(){return tB||(tB=1,(function(t,e){(function(r,n){t.exports=n()})(yp,(function(){var r=1e3,n=6e4,i=36e5,a="millisecond",s="second",o="minute",l="hour",u="day",h="week",d="month",f="quarter",p="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(A){var R=["th","st","nd","rd"],N=A%100;return"["+A+(R[(N-20)%10]||R[N]||R[0])+"]"}},b=function(A,R,N){var D=String(A);return!D||D.length>=R?A:""+Array(R+1-D.length).join(N)+A},w={s:b,z:function(A){var R=-A.utcOffset(),N=Math.abs(R),D=Math.floor(N/60),I=N%60;return(R<=0?"+":"-")+b(D,2,"0")+":"+b(I,2,"0")},m:function A(R,N){if(R.date()1)return A(B[0])}else{var P=R.name;S[P]=R,I=P}return!D&&I&&(k=I),I||!D&&k},O=function(A,R){if(_(A))return A.clone();var N=typeof R=="object"?R:{};return N.date=A,N.args=arguments,new z(N)},M=w;M.l=L,M.i=_,M.w=function(A,R){return O(A,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var z=(function(){function A(N){this.$L=L(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[C]=!0}var R=A.prototype;return R.parse=function(N){this.$d=(function(D){var I=D.date,$=D.utc;if(I===null)return new Date(NaN);if(M.u(I))return new Date;if(I instanceof Date)return new Date(I);if(typeof I=="string"&&!/Z$/i.test(I)){var B=I.match(y);if(B){var P=B[2]-1||0,G=(B[7]||"0").substring(0,3);return $?new Date(Date.UTC(B[1],P,B[3]||1,B[4]||0,B[5]||0,B[6]||0,G)):new Date(B[1],P,B[3]||1,B[4]||0,B[5]||0,B[6]||0,G)}}return new Date(I)})(N),this.init()},R.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},R.$utils=function(){return M},R.isValid=function(){return this.$d.toString()!==m},R.isSame=function(N,D){var I=O(N);return this.startOf(D)<=I&&I<=this.endOf(D)},R.isAfter=function(N,D){return O(N)rB(t,"name",{value:e,configurable:!0}),Tw=(t,e)=>{for(var r in e)rB(t,r,{get:e[r],enumerable:!0})},cc={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},ae={trace:T((...t)=>{},"trace"),debug:T((...t)=>{},"debug"),info:T((...t)=>{},"info"),warn:T((...t)=>{},"warn"),error:T((...t)=>{},"error"),fatal:T((...t)=>{},"fatal")},y6=T(function(t="fatal"){let e=cc.fatal;typeof t=="string"?t.toLowerCase()in cc&&(e=cc[t]):typeof t=="number"&&(e=t),ae.trace=()=>{},ae.debug=()=>{},ae.info=()=>{},ae.warn=()=>{},ae.error=()=>{},ae.fatal=()=>{},e<=cc.fatal&&(ae.fatal=console.error?console.error.bind(console,io("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",io("FATAL"))),e<=cc.error&&(ae.error=console.error?console.error.bind(console,io("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",io("ERROR"))),e<=cc.warn&&(ae.warn=console.warn?console.warn.bind(console,io("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",io("WARN"))),e<=cc.info&&(ae.info=console.info?console.info.bind(console,io("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",io("INFO"))),e<=cc.debug&&(ae.debug=console.debug?console.debug.bind(console,io("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",io("DEBUG"))),e<=cc.trace&&(ae.trace=console.debug?console.debug.bind(console,io("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",io("TRACE")))},"setLogLevel"),io=T(t=>`%c${Yi().format("ss.SSS")} : ${t} : `,"format");const ww={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return ww.hue2rgb(a,i,t+1/3)*255;case"g":return ww.hue2rgb(a,i,t)*255;case"b":return ww.hue2rgb(a,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;const o=i-a,l=s>.5?o/(2-i-a):o/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/o+(ee>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},unit:{dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}}},Tu={};for(let t=0;t<=255;t++)Tu[t]=Er.unit.dec2hex(t);const ka={ALL:0,RGB:1,HSL:2};let tbe=class{constructor(){this.type=ka.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=ka.ALL}is(e){return this.type===e}};class rbe{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new tbe}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=ka.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=Er.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=Er.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Er.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=Er.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=Er.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Er.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(ka.HSL)&&r!==void 0?r:(this._ensureHSL(),Er.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(ka.HSL)&&r!==void 0?r:(this._ensureHSL(),Er.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(ka.HSL)&&r!==void 0?r:(this._ensureHSL(),Er.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(ka.RGB)&&r!==void 0?r:(this._ensureRGB(),Er.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(ka.RGB)&&r!==void 0?r:(this._ensureRGB(),Er.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(ka.RGB)&&r!==void 0?r:(this._ensureRGB(),Er.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(ka.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(ka.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(ka.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(ka.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(ka.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(ka.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const Cw=new rbe({r:0,g:0,b:0,a:0},"transparent"),vp={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(vp.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,o=s?1:17,l=s?8:4,u=a?0:-1,h=s?255:15;return Cw.set({r:(n>>l*(u+3)&h)*o,g:(n>>l*(u+2)&h)*o,b:(n>>l*(u+1)&h)*o,a:a?(n&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${Tu[Math.round(e)]}${Tu[Math.round(r)]}${Tu[Math.round(n)]}${Tu[Math.round(i*255)]}`:`#${Tu[Math.round(e)]}${Tu[Math.round(r)]}${Tu[Math.round(n)]}`}},Gh={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(Gh.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return Er.channel.clamp.h(parseFloat(r)*.9);case"rad":return Er.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Er.channel.clamp.h(parseFloat(r)*360)}}return Er.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(Gh.re);if(!r)return;const[,n,i,a,s,o]=r;return Cw.set({h:Gh._hue2deg(n),s:Er.channel.clamp.s(parseFloat(i)),l:Er.channel.clamp.l(parseFloat(a)),a:s?Er.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${Er.lang.round(e)}, ${Er.lang.round(r)}%, ${Er.lang.round(n)}%, ${i})`:`hsl(${Er.lang.round(e)}, ${Er.lang.round(r)}%, ${Er.lang.round(n)}%)`}},a2={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=a2.colors[t];if(e)return vp.parse(e)},stringify:t=>{const e=vp.stringify(t);for(const r in a2.colors)if(a2.colors[r]===e)return r}},s2={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(s2.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return Cw.set({r:Er.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Er.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:Er.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?Er.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${Er.lang.round(e)}, ${Er.lang.round(r)}, ${Er.lang.round(n)}, ${Er.lang.round(i)})`:`rgb(${Er.lang.round(e)}, ${Er.lang.round(r)}, ${Er.lang.round(n)})`}},So={format:{keyword:a2,hex:vp,rgb:s2,rgba:s2,hsl:Gh,hsla:Gh},parse:t=>{if(typeof t!="string")return t;const e=vp.parse(t)||s2.parse(t)||Gh.parse(t)||a2.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(ka.HSL)||t.data.r===void 0?Gh.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?s2.stringify(t):vp.stringify(t)},nB=(t,e)=>{const r=So.parse(t);for(const n in e)r[n]=Er.channel.clamp[n](e[n]);return So.stringify(r)},Ao=(t,e,r=0,n=1)=>{if(typeof t!="number")return nB(t,{a:e});const i=Cw.set({r:Er.channel.clamp.r(t),g:Er.channel.clamp.g(e),b:Er.channel.clamp.b(r),a:Er.channel.clamp.a(n)});return So.stringify(i)},v6=(t,e)=>Er.lang.round(So.parse(t)[e]),nbe=t=>{const{r:e,g:r,b:n}=So.parse(t),i=.2126*Er.channel.toLinear(e)+.7152*Er.channel.toLinear(r)+.0722*Er.channel.toLinear(n);return Er.lang.round(i)},ibe=t=>nbe(t)>=.5,Ba=t=>!ibe(t),b6=(t,e,r)=>{const n=So.parse(t),i=n[e],a=Er.channel.clamp[e](i+r);return i!==a&&(n[e]=a),So.stringify(n)},at=(t,e)=>b6(t,"l",e),st=(t,e)=>b6(t,"l",-e),iB=(t,e)=>b6(t,"a",-e),le=(t,e)=>{const r=So.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return nB(t,n)},abe=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=So.parse(t),{r:o,g:l,b:u,a:h}=So.parse(e),d=r/100,f=d*2-1,p=s-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,y=1-m,v=n*m+o*y,x=i*m+l*y,b=a*m+u*y,w=s*d+h*(1-d);return Ao(v,x,b,w)},Ke=(t,e=100)=>{const r=So.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,abe(r,t,e)};/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function aB(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r2?n-2:0),a=2;a1?r-1:0),i=1;i"u"?null:Ti(BigInt.prototype.toString),fB=typeof Symbol>"u"?null:Ti(Symbol.prototype.toString),Xi=Ti(Object.prototype.hasOwnProperty),c2=Ti(Object.prototype.toString),Ki=Ti(RegExp.prototype.test),qh=bbe(TypeError);function Ti(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:o2;if(oB&&oB(t,null),!wu(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(hbe(e)||(e[n]=a),i=a)}t[i]=!0}return t}function xbe(t){for(let e=0;e/g),Abe=la(/\${[\w\W]*/g),_be=la(/^data-[\-\w.\u00B7-\uFFFF]+$/),Rbe=la(/^aria-[\-\w]+$/),vB=la(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Lbe=la(/^(?:\w+script|data):/i),Ibe=la(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Dbe=la(/^html$/i),Mbe=la(/^[a-z][.\w]*(-[.\w]+)+$/i),bB=la(/<[/\w!]/g),xB=la(/<[/\w]/g),Nbe=la(/<\/no(script|embed|frames)/i),Obe=la(/\/>/i),$s={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},$be=function(){return typeof window>"u"?null:window},Pbe=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},TB=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Cu=function(e,r,n,i){return Xi(e,r)&&wu(e[r])?Yr(i.base?Fa(i.base):{},e[r],i.transform):n};function wB(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$be();const e=Ot=>wB(Ot);if(e.version="3.4.12",e.removed=[],!t||!t.document||t.document.nodeType!==$s.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,i=n.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,s=t.Node,o=t.Element,l=t.NodeFilter,u=t.NamedNodeMap;u===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,d=t.trustedTypes,f=o.prototype,p=cl(f,"cloneNode"),g=cl(f,"remove"),m=cl(f,"nextSibling"),y=cl(f,"childNodes"),v=cl(f,"parentNode"),x=cl(f,"shadowRoot"),b=cl(f,"attributes"),w=s&&s.prototype?cl(s.prototype,"nodeType"):null,k=s&&s.prototype?cl(s.prototype,"nodeName"):null;if(typeof a=="function"){const Ot=r.createElement("template");Ot.content&&Ot.content.ownerDocument&&(r=Ot.content.ownerDocument)}let S,C="",_,L=!1,O=0;const M=function(){if(O>0)throw qh('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},z=function(Re){M(),O++;try{return S.createHTML(Re)}finally{O--}},F=function(Re){M(),O++;try{return S.createScriptURL(Re)}finally{O--}},A=function(){return L||(_=Pbe(d,i),L=!0),_},R=r,N=R.implementation,D=R.createNodeIterator,I=R.createDocumentFragment,$=R.getElementsByTagName,B=n.importNode;let P=TB();e.isSupported=typeof sB=="function"&&typeof v=="function"&&N&&N.createHTMLDocument!==void 0;const G=Ebe,V=Sbe,X=Abe,W=_be,ie=Rbe,K=Lbe,se=Ibe,J=Mbe;let Z=vB,ee=null;const ne=Yr({},[...pB,...C6,...k6,...E6,...gB]);let ue=null;const fe=Yr({},[...mB,...S6,...yB,...kw]);let _e=Object.seal(bp(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ae=null,Ne=null;const me=Object.seal(bp(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ve=!0,Ge=!0,Te=!1,Ze=!0,ke=!1,Ve=!0,Qe=!1,nt=!1,tt=null,je=null,Ce=!1,Se=!1,H=!1,he=!1,j=!0,pe=!1;const re="user-content-";let Fe=!0,xe=!1,Ue={},Me=null;const qe=Yr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Le=null;const Xe=Yr({},["audio","video","img","source","image","track"]);let De=null;const it=Yr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),we="http://www.w3.org/1998/Math/MathML",lt="http://www.w3.org/2000/svg",be="http://www.w3.org/1999/xhtml";let Et=be,vt=!1,ot=null;const It=Yr({},[we,lt,be],w6),xt=oa(["mi","mo","mn","ms","mtext"]);let ht=Yr({},xt);const oe=oa(["annotation-xml"]);let At=Yr({},oe);const dt=Yr({},["title","style","font","a","script"]);let ut=null;const wt=["application/xhtml+xml","text/html"],Mr="text/html";let ye=null,et=null;const ct=r.createElement("form"),_t=function(Re){return Re instanceof RegExp||Re instanceof Function},Ft=function(){let Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(et&&et===Re)return;(!Re||typeof Re!="object")&&(Re={}),Re=Fa(Re),ut=wt.indexOf(Re.PARSER_MEDIA_TYPE)===-1?Mr:Re.PARSER_MEDIA_TYPE,ye=ut==="application/xhtml+xml"?w6:o2,ee=Cu(Re,"ALLOWED_TAGS",ne,{transform:ye}),ue=Cu(Re,"ALLOWED_ATTR",fe,{transform:ye}),ot=Cu(Re,"ALLOWED_NAMESPACES",It,{transform:w6}),De=Cu(Re,"ADD_URI_SAFE_ATTR",it,{transform:ye,base:it}),Le=Cu(Re,"ADD_DATA_URI_TAGS",Xe,{transform:ye,base:Xe}),Me=Cu(Re,"FORBID_CONTENTS",qe,{transform:ye}),Ae=Cu(Re,"FORBID_TAGS",Fa({}),{transform:ye}),Ne=Cu(Re,"FORBID_ATTR",Fa({}),{transform:ye}),Ue=Xi(Re,"USE_PROFILES")?Re.USE_PROFILES&&typeof Re.USE_PROFILES=="object"?Fa(Re.USE_PROFILES):Re.USE_PROFILES:!1,ve=Re.ALLOW_ARIA_ATTR!==!1,Ge=Re.ALLOW_DATA_ATTR!==!1,Te=Re.ALLOW_UNKNOWN_PROTOCOLS||!1,Ze=Re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ke=Re.SAFE_FOR_TEMPLATES||!1,Ve=Re.SAFE_FOR_XML!==!1,Qe=Re.WHOLE_DOCUMENT||!1,Se=Re.RETURN_DOM||!1,H=Re.RETURN_DOM_FRAGMENT||!1,he=Re.RETURN_TRUSTED_TYPE||!1,Ce=Re.FORCE_BODY||!1,j=Re.SANITIZE_DOM!==!1,pe=Re.SANITIZE_NAMED_PROPS||!1,Fe=Re.KEEP_CONTENT!==!1,xe=Re.IN_PLACE||!1,Z=wbe(Re.ALLOWED_URI_REGEXP)?Re.ALLOWED_URI_REGEXP:vB,Et=typeof Re.NAMESPACE=="string"?Re.NAMESPACE:be,ht=Xi(Re,"MATHML_TEXT_INTEGRATION_POINTS")&&Re.MATHML_TEXT_INTEGRATION_POINTS&&typeof Re.MATHML_TEXT_INTEGRATION_POINTS=="object"?Fa(Re.MATHML_TEXT_INTEGRATION_POINTS):Yr({},xt),At=Xi(Re,"HTML_INTEGRATION_POINTS")&&Re.HTML_INTEGRATION_POINTS&&typeof Re.HTML_INTEGRATION_POINTS=="object"?Fa(Re.HTML_INTEGRATION_POINTS):Yr({},oe);const Je=Xi(Re,"CUSTOM_ELEMENT_HANDLING")&&Re.CUSTOM_ELEMENT_HANDLING&&typeof Re.CUSTOM_ELEMENT_HANDLING=="object"?Fa(Re.CUSTOM_ELEMENT_HANDLING):bp(null);if(_e=bp(null),Xi(Je,"tagNameCheck")&&_t(Je.tagNameCheck)&&(_e.tagNameCheck=Je.tagNameCheck),Xi(Je,"attributeNameCheck")&&_t(Je.attributeNameCheck)&&(_e.attributeNameCheck=Je.attributeNameCheck),Xi(Je,"allowCustomizedBuiltInElements")&&typeof Je.allowCustomizedBuiltInElements=="boolean"&&(_e.allowCustomizedBuiltInElements=Je.allowCustomizedBuiltInElements),la(_e),ke&&(Ge=!1),H&&(Se=!0),Ue&&(ee=Yr({},gB),ue=bp(null),Ue.html===!0&&(Yr(ee,pB),Yr(ue,mB)),Ue.svg===!0&&(Yr(ee,C6),Yr(ue,S6),Yr(ue,kw)),Ue.svgFilters===!0&&(Yr(ee,k6),Yr(ue,S6),Yr(ue,kw)),Ue.mathMl===!0&&(Yr(ee,E6),Yr(ue,yB),Yr(ue,kw))),me.tagCheck=null,me.attributeCheck=null,Xi(Re,"ADD_TAGS")&&(typeof Re.ADD_TAGS=="function"?me.tagCheck=Re.ADD_TAGS:wu(Re.ADD_TAGS)&&(ee===ne&&(ee=Fa(ee)),Yr(ee,Re.ADD_TAGS,ye))),Xi(Re,"ADD_ATTR")&&(typeof Re.ADD_ATTR=="function"?me.attributeCheck=Re.ADD_ATTR:wu(Re.ADD_ATTR)&&(ue===fe&&(ue=Fa(ue)),Yr(ue,Re.ADD_ATTR,ye))),Xi(Re,"ADD_URI_SAFE_ATTR")&&wu(Re.ADD_URI_SAFE_ATTR)&&Yr(De,Re.ADD_URI_SAFE_ATTR,ye),Xi(Re,"FORBID_CONTENTS")&&wu(Re.FORBID_CONTENTS)&&(Me===qe&&(Me=Fa(Me)),Yr(Me,Re.FORBID_CONTENTS,ye)),Xi(Re,"ADD_FORBID_CONTENTS")&&wu(Re.ADD_FORBID_CONTENTS)&&(Me===qe&&(Me=Fa(Me)),Yr(Me,Re.ADD_FORBID_CONTENTS,ye)),Fe&&(ee["#text"]=!0),Qe&&Yr(ee,["html","head","body"]),ee.table&&(Yr(ee,["tbody"]),delete Ae.tbody),Re.TRUSTED_TYPES_POLICY){if(typeof Re.TRUSTED_TYPES_POLICY.createHTML!="function")throw qh('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qh('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const bt=S;S=Re.TRUSTED_TYPES_POLICY;try{C=z("")}catch(Vt){throw S=bt,Vt}}else Re.TRUSTED_TYPES_POLICY===null?(S=void 0,C=""):(S===void 0&&(S=A()),S&&typeof C=="string"&&(C=z("")));oa&&oa(Re),et=Re},nr=Yr({},[...C6,...k6,...Cbe]),ir=Yr({},[...E6,...kbe]),_r=function(Re,Je,bt){return Je.namespaceURI===be?Re==="svg":Je.namespaceURI===we?Re==="svg"&&(bt==="annotation-xml"||ht[bt]):!!nr[Re]},or=function(Re,Je,bt){return Je.namespaceURI===be?Re==="math":Je.namespaceURI===lt?Re==="math"&&At[bt]:!!ir[Re]},Rr=function(Re,Je,bt){return Je.namespaceURI===lt&&!At[bt]||Je.namespaceURI===we&&!ht[bt]?!1:!ir[Re]&&(dt[Re]||!nr[Re])},Jt=function(Re){let Je=v(Re);(!Je||!Je.tagName)&&(Je={namespaceURI:Et,tagName:"template"});const bt=o2(Re.tagName),Vt=o2(Je.tagName);return ot[Re.namespaceURI]?Re.namespaceURI===lt?_r(bt,Je,Vt):Re.namespaceURI===we?or(bt,Je,Vt):Re.namespaceURI===be?Rr(bt,Je,Vt):!!(ut==="application/xhtml+xml"&&ot[Re.namespaceURI]):!1},Nr=function(Re){Tp(e.removed,{element:Re});try{v(Re).removeChild(Re)}catch{if(g(Re),!v(Re))throw qh("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},gn=function(Re){ps(Re);const Je=y(Re);if(Je){const Vt=[];xp(Je,dr=>{Tp(Vt,dr)}),xp(Vt,dr=>{try{g(dr)}catch{}})}const bt=b(Re);if(bt)for(let Vt=bt.length-1;Vt>=0;--Vt){const dr=bt[Vt],fr=dr&&dr.name;if(typeof fr=="string")try{Re.removeAttribute(fr)}catch{}}},$r=function(Re,Je){try{Tp(e.removed,{attribute:Je.getAttributeNode(Re),from:Je})}catch{Tp(e.removed,{attribute:null,from:Je})}if(Je.removeAttribute(Re),Re==="is")if(Se||H)try{Nr(Je)}catch{}else try{Je.setAttribute(Re,"")}catch{}},Pa=function(Re){const Je=b(Re);if(Je)for(let bt=Je.length-1;bt>=0;--bt){const Vt=Je[bt],dr=Vt&&Vt.name;if(!(typeof dr!="string"||ue[ye(dr)]))try{Re.removeAttribute(dr)}catch{}}},ps=function(Re){const Je=[Re];for(;Je.length>0;){const bt=Je.pop();(w?w(bt):bt.nodeType)===$s.element&&Pa(bt);const dr=y(bt);if(dr)for(let fr=dr.length-1;fr>=0;--fr)Je.push(dr[fr])}},gs=function(Re){if(!Ve)return;const Je=[Re];for(;Je.length>0;){const bt=Je.pop(),Vt=w?w(bt):bt.nodeType;if(Vt===$s.processingInstruction||Vt===$s.comment&&Ki(xB,bt.data)){try{g(bt)}catch{}continue}if(Vt===$s.element){const fr=bt,mn=ye(k?k(bt):bt.nodeName);try{fr.hasAttribute&&fr.hasAttribute("patchsrc")&&fr.removeAttribute("patchsrc"),fr.hasAttribute&&fr.hasAttribute("for")&&mn!=="label"&&mn!=="output"&&fr.removeAttribute("for")}catch{}}const dr=y(bt);if(dr)for(let fr=dr.length-1;fr>=0;--fr)Je.push(dr[fr])}},li=function(Re){let Je=null,bt=null;if(Ce)Re=""+Re;else{const fr=uB(Re,/^[\r\n\t ]+/);bt=fr&&fr[0]}ut==="application/xhtml+xml"&&Et===be&&(Re=''+Re+"");const Vt=S?z(Re):Re;if(Et===be)try{Je=new h().parseFromString(Vt,ut)}catch{}if(!Je||!Je.documentElement){Je=N.createDocument(Et,"template",null);try{Je.documentElement.innerHTML=vt?C:Vt}catch{}}const dr=Je.body||Je.documentElement;return Re&&bt&&dr.insertBefore(r.createTextNode(bt),dr.childNodes[0]||null),Et===be?$.call(Je,Qe?"html":"body")[0]:Qe?Je.documentElement:dr},Bt=function(Re){return D.call(Re.ownerDocument||Re,Re,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},yt=function(Re){return Re=l2(Re,G," "),Re=l2(Re,V," "),Re=l2(Re,X," "),Re},Pt=function(Re){var Je;Re.normalize();const bt=D.call(Re.ownerDocument||Re,Re,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let Vt=bt.nextNode();for(;Vt;)Vt.data=yt(Vt.data),Vt=bt.nextNode();const dr=(Je=Re.querySelectorAll)===null||Je===void 0?void 0:Je.call(Re,"template");dr&&xp(dr,fr=>{pr(fr.content)&&Pt(fr.content)})},Ct=function(Re){const Je=k?k(Re):null;return typeof Je!="string"||ye(Je)!=="form"?!1:typeof Re.nodeName!="string"||typeof Re.textContent!="string"||typeof Re.removeChild!="function"||Re.attributes!==b(Re)||typeof Re.removeAttribute!="function"||typeof Re.setAttribute!="function"||typeof Re.namespaceURI!="string"||typeof Re.insertBefore!="function"||typeof Re.hasChildNodes!="function"||Re.nodeType!==w(Re)||Re.childNodes!==y(Re)},pr=function(Re){if(!w||typeof Re!="object"||Re===null)return!1;try{return w(Re)===$s.documentFragment}catch{return!1}},Ee=function(Re){if(!w||typeof Re!="object"||Re===null)return!1;try{return typeof w(Re)=="number"}catch{return!1}};function Di(Ot,Re,Je){Ot.length!==0&&xp(Ot,bt=>{bt.call(e,Re,Je,et)})}const Oe=function(Re,Je){return!!(Ve&&Re.hasChildNodes()&&!Ee(Re.firstElementChild)&&Ki(bB,Re.textContent)&&Ki(bB,Re.innerHTML)||Ve&&Re.namespaceURI===be&&Je==="style"&&Ee(Re.firstElementChild)||Re.nodeType===$s.processingInstruction||Ve&&Re.nodeType===$s.comment&&Ki(xB,Re.data))},Ln=function(Re,Je){if(!Ae[Je]&&Jv(Je)&&(_e.tagNameCheck instanceof RegExp&&Ki(_e.tagNameCheck,Je)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(Je)))return!1;if(Fe&&!Me[Je]){const bt=v(Re),Vt=y(Re);if(Vt&&bt){const dr=Vt.length;for(let fr=dr-1;fr>=0;--fr){const mn=xe?Vt[fr]:p(Vt[fr],!0);bt.insertBefore(mn,m(Re))}}}return Nr(Re),!0},hp=function(Re,Je){if(Di(P.beforeSanitizeElements,Re,null),Re!==Je&&v(Re)===null)return!0;if(Ct(Re))return Nr(Re),!0;const bt=ye(k?k(Re):Re.nodeName);if(Di(P.uponSanitizeElement,Re,{tagName:bt,allowedTags:ee}),Re!==Je&&v(Re)===null)return!0;if(Oe(Re,bt))return Nr(Re),!0;if(Ae[bt]||!(me.tagCheck instanceof Function&&me.tagCheck(bt))&&!ee[bt]){const dr=Ln(Re,bt);return dr===!1&&Di(P.afterSanitizeElements,Re,null),dr}if((w?w(Re):Re.nodeType)===$s.element&&!Jt(Re)||(bt==="noscript"||bt==="noembed"||bt==="noframes")&&Ki(Nbe,Re.innerHTML))return Nr(Re),!0;if(ke&&Re.nodeType===$s.text){const dr=yt(Re.textContent);Re.textContent!==dr&&(Tp(e.removed,{element:Re.cloneNode()}),Re.textContent=dr)}return Di(P.afterSanitizeElements,Re,null),!1},Zv=function(Re,Je,bt){if(Ne[Je]||Ve&&Je==="patchsrc"||Ve&&Je==="for"&&Re!=="label"&&Re!=="output"||j&&(Je==="id"||Je==="name")&&(bt in r||bt in ct))return!1;const Vt=ue[Je]||me.attributeCheck instanceof Function&&me.attributeCheck(Je,Re);if(!(Ge&&Ki(W,Je))){if(!(ve&&Ki(ie,Je))){if(Vt){if(!De[Je]){if(!Ki(Z,l2(bt,se,""))){if(!((Je==="src"||Je==="xlink:href"||Je==="href")&&Re!=="script"&&hB(bt,"data:")===0&&Le[Re])){if(!(Te&&!Ki(K,l2(bt,se,"")))){if(bt)return!1}}}}}else if(!(Jv(Re)&&(_e.tagNameCheck instanceof RegExp&&Ki(_e.tagNameCheck,Re)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(Re))&&(_e.attributeNameCheck instanceof RegExp&&Ki(_e.attributeNameCheck,Je)||_e.attributeNameCheck instanceof Function&&_e.attributeNameCheck(Je,Re))||Je==="is"&&_e.allowCustomizedBuiltInElements&&(_e.tagNameCheck instanceof RegExp&&Ki(_e.tagNameCheck,bt)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(bt))))return!1}}return!0},Qv=Yr({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Jv=function(Re){return!Qv[o2(Re)]&&Ki(J,Re)},Jn=function(Re,Je,bt,Vt){if(S&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!bt)switch(d.getAttributeType(Re,Je)){case"TrustedHTML":return z(Vt);case"TrustedScriptURL":return F(Vt)}return Vt},il=function(Re,Je,bt,Vt){try{bt?Re.setAttributeNS(bt,Je,Vt):Re.setAttribute(Je,Vt),Ct(Re)?Nr(Re):cB(e.removed)}catch{$r(Je,Re)}},yi=function(Re){Di(P.beforeSanitizeAttributes,Re,null);const Je=Re.attributes;if(!Je||Ct(Re))return;const bt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ue,forceKeepAttr:void 0};let Vt=Je.length;const dr=ye(Re.nodeName);for(;Vt--;){const fr=Je[Vt],mn=fr.name,dn=fr.namespaceURI,vi=fr.value,ei=ye(mn),bi=vi;let Qr=mn==="value"?bi:mbe(bi);if(bt.attrName=ei,bt.attrValue=Qr,bt.keepAttr=!0,bt.forceKeepAttr=void 0,Di(P.uponSanitizeAttribute,Re,bt),Qr=bt.attrValue,pe&&(ei==="id"||ei==="name")&&hB(Qr,re)!==0&&($r(mn,Re),Qr=re+Qr),Ve&&Ki(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Qr)){$r(mn,Re);continue}if(ei==="attributename"&&uB(Qr,"href")){$r(mn,Re);continue}if(!bt.forceKeepAttr){if(!bt.keepAttr){$r(mn,Re);continue}if(!Ze&&Ki(Obe,Qr)){$r(mn,Re);continue}if(ke&&(Qr=yt(Qr)),!Zv(dr,ei,Qr)){$r(mn,Re);continue}Qr=Jn(dr,ei,dn,Qr),Qr!==bi&&il(Re,mn,dn,Qr)}}Di(P.afterSanitizeAttributes,Re,null)},al=function(Re){let Je=null;const bt=Bt(Re);for(Di(P.beforeSanitizeShadowDOM,Re,null);Je=bt.nextNode();)if(Di(P.uponSanitizeShadowNode,Je,null),hp(Je,Re),yi(Je),pr(Je.content)&&al(Je.content),(w?w(Je):Je.nodeType)===$s.element){const dr=x(Je);pr(dr)&&(xu(dr),al(dr))}Di(P.afterSanitizeShadowDOM,Re,null)},xu=function(Re){const Je=[{node:Re,shadow:null}];for(;Je.length>0;){const bt=Je.pop();if(bt.shadow){al(bt.shadow);continue}const Vt=bt.node,fr=(w?w(Vt):Vt.nodeType)===$s.element,mn=y(Vt);if(mn)for(let dn=mn.length-1;dn>=0;--dn)Je.push({node:mn[dn],shadow:null});if(fr){const dn=k?k(Vt):null;if(typeof dn=="string"&&ye(dn)==="template"){const vi=Vt.content;pr(vi)&&Je.push({node:vi,shadow:null})}}if(fr){const dn=x(Vt);pr(dn)&&Je.push({node:null,shadow:dn},{node:dn,shadow:null})}}};return e.sanitize=function(Ot){let Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Je=null,bt=null,Vt=null,dr=null;if(vt=!Ot,vt&&(Ot=""),typeof Ot!="string"&&!Ee(Ot)&&(Ot=Tbe(Ot),typeof Ot!="string"))throw qh("dirty is not a string, aborting");if(!e.isSupported)return Ot;nt?(ee=tt,ue=je):Ft(Re),(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&(ee=Fa(ee)),P.uponSanitizeAttribute.length>0&&(ue=Fa(ue)),e.removed=[];const fr=xe&&typeof Ot!="string"&&Ee(Ot);if(fr){gs(Ot);const ei=k?k(Ot):Ot.nodeName;if(typeof ei=="string"){const bi=ye(ei);if(!ee[bi]||Ae[bi])throw gn(Ot),qh("root node is forbidden and cannot be sanitized in-place")}if(Ct(Ot))throw gn(Ot),qh("root node is clobbered and cannot be sanitized in-place");try{xu(Ot)}catch(bi){throw gn(Ot),bi}}else if(Ee(Ot))Je=li(""),bt=Je.ownerDocument.importNode(Ot,!0),bt.nodeType===$s.element&&bt.nodeName==="BODY"||bt.nodeName==="HTML"?Je=bt:Je.appendChild(bt),xu(bt);else{if(!Se&&!ke&&!Qe&&Ot.indexOf("<")===-1)return S&&he?z(Ot):Ot;if(Je=li(Ot),!Je)return Se?null:he?C:""}Je&&Ce&&Nr(Je.firstChild);const mn=fr?Ot:Je,dn=Bt(mn);try{for(;Vt=dn.nextNode();)hp(Vt,mn),yi(Vt),pr(Vt.content)&&al(Vt.content)}catch(ei){throw fr&&(gn(Ot),xp(e.removed,bi=>{bi.element&&ps(bi.element)})),ei}if(fr)return xp(e.removed,ei=>{ei.element&&ps(ei.element)}),ke&&Pt(Ot),Ot;if(Se){if(ke&&Pt(Je),H)for(dr=I.call(Je.ownerDocument);Je.firstChild;)dr.appendChild(Je.firstChild);else dr=Je;return(ue.shadowroot||ue.shadowrootmode)&&(dr=B.call(n,dr,!0)),dr}let vi=Qe?Je.outerHTML:Je.innerHTML;return Qe&&ee["!doctype"]&&Je.ownerDocument&&Je.ownerDocument.doctype&&Je.ownerDocument.doctype.name&&Ki(Dbe,Je.ownerDocument.doctype.name)&&(vi=" +`+vi),ke&&(vi=yt(vi)),S&&he?z(vi):vi},e.setConfig=function(){let Ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ft(Ot),nt=!0,tt=ee,je=ue},e.clearConfig=function(){et=null,nt=!1,tt=null,je=null,S=_,C=""},e.isValidAttribute=function(Ot,Re,Je){et||Ft({});const bt=ye(Ot),Vt=ye(Re);return Zv(bt,Vt,Je)},e.addHook=function(Ot,Re){typeof Re=="function"&&Xi(P,Ot)&&Tp(P[Ot],Re)},e.removeHook=function(Ot,Re){if(Xi(P,Ot)){if(Re!==void 0){const Je=pbe(P[Ot],Re);return Je===-1?void 0:gbe(P[Ot],Je,1)[0]}return cB(P[Ot])}},e.removeHooks=function(Ot){Xi(P,Ot)&&(P[Ot]=[])},e.removeAllHooks=function(){P=TB()},e}var ku=wB(),CB=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,u2=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Bbe=/\s*%%.*\n/gm,kB=(mm=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},T(mm,"UnknownDiagramError"),mm),Vh={},A6=T(function(t,e){t=t.replace(CB,"").replace(u2,"").replace(Bbe,` +`);for(const[r,{detector:n}]of Object.entries(Vh))if(n(t,e))return r;throw new kB(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),_6=T((...t)=>{for(const{id:e,detector:r,loader:n}of t)EB(e,r,n)},"registerLazyLoadedDiagrams"),EB=T((t,e,r)=>{Vh[t]&&ae.warn(`Detector with key ${t} already exists. Overwriting.`),Vh[t]={detector:e,loader:r},ae.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),Fbe=T(t=>Vh[t].loader,"getDiagramLoader"),R6=T((t,e,{depth:r=2,clobber:n=!1}={})=>{const i={depth:r,clobber:n};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach(a=>R6(t,a,i)),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach(a=>{t.includes(a)||t.push(a)}),t):t===void 0||r<=0?t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e:(e!==void 0&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(a=>{typeof e[a]=="object"&&e[a]!==null&&(t[a]===void 0||typeof t[a]=="object")?(t[a]===void 0&&(t[a]=Array.isArray(e[a])?[]:{}),t[a]=R6(t[a],e[a],{depth:r-1,clobber:n})):(n||typeof t[a]!="object"&&typeof e[a]!="object")&&(t[a]=e[a])}),t)},"assignWithDepth"),ci=R6,ul="#ffffff",hl="#f2f2f2",Tr=T((t,e)=>e?le(t,{s:-40,l:10}):le(t,{s:-40,l:-10}),"mkBorder"),zbe=(ym=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,w,k,S,C,_,L,O,M,z,F,A,R,N,D,I,$;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ke(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||at(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||st(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||st(this.mainBkg,10)):(this.rowOdd=this.rowOdd||at(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||at(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330}),this.darkMode)for(let B=0;B{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(ym,"Theme"),ym),Gbe=T(t=>{const e=new zbe;return e.calculate(t),e},"getThemeVariables"),qbe=(vm=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Ke(this.background),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.lineColor=Ke(this.background),this.textColor=Ke(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(Ke("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Ao(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=st("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=st(this.sectionBkgColor,10),this.taskBorderColor=Ao(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Ao(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||at(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||st(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,w,k,S,C,_,L,O,M,z,F,A,R,N,D,I;this.secondBkg=at(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=at(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=at(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=Ke(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=le(this.primaryColor,{h:64}),this.fillType3=le(this.secondaryColor,{h:64}),this.fillType4=le(this.primaryColor,{h:-64}),this.fillType5=le(this.secondaryColor,{h:-64}),this.fillType6=le(this.primaryColor,{h:128}),this.fillType7=le(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330});for(let $=0;${this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(vm,"Theme"),vm),Vbe=T(t=>{const e=new qbe;return e.calculate(t),e},"getThemeVariables"),Wbe=(bm=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=le(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.lineColor=Ke(this.background),this.textColor=Ke(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Ao(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,w,k,S,C,_,L,O,M,z,F,A,R,N,D,I;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||st(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||st(this.tertiaryColor,40);for(let $=0;${this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(bm,"Theme"),bm),wp=T(t=>{const e=new Wbe;return e.calculate(t),e},"getThemeVariables"),Ube=(xm=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=at("#cde498",10),this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.primaryColor),this.lineColor=Ke(this.background),this.textColor=Ke(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,w,k,S,C,_,L,O,M,z,F,A,R,N,D,I;this.actorBorder=st(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||st(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||st(this.tertiaryColor,40);for(let $=0;${this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(xm,"Theme"),xm),Hbe=T(t=>{const e=new Ube;return e.calculate(t),e},"getThemeVariables"),Ybe=(Tm=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=at(this.contrast,55),this.background="#ffffff",this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.lineColor=Ke(this.background),this.textColor=Ke(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||at(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,w,k,S,C,_,L,O,M,z,F,A,R,N,D,I;this.secondBkg=at(this.contrast,55),this.border2=this.contrast,this.actorBorder=at(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let $=0;${this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(Tm,"Theme"),Tm),Xbe=T(t=>{const e=new Ybe;return e.calculate(t),e},"getThemeVariables"),Kbe=(wm=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ke(this.lineColor);const e="#ECECFE",r="#E9E9F1",n=le(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||at(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||n,this.cScale3=this.cScale3||le(e,{h:30}),this.cScale4=this.cScale4||le(e,{h:60}),this.cScale5=this.cScale5||le(e,{h:90}),this.cScale6=this.cScale6||le(e,{h:120}),this.cScale7=this.cScale7||le(e,{h:150}),this.cScale8=this.cScale8||le(e,{h:210,l:150}),this.cScale9=this.cScale9||le(e,{h:270}),this.cScale10=this.cScale10||le(e,{h:300}),this.cScale11=this.cScale11||le(e,{h:330}),this.darkMode)for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(wm,"Theme"),wm),jbe=T(t=>{const e=new Kbe;return e.calculate(t),e},"getThemeVariables"),Zbe=(Cm=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Ke(this.background),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(Ke("#323D47"),10),this.border1="#ccc",this.border2=Ao(255,255,255,.25),this.arrowheadColor=Ke(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ke(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||at(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(Cm,"Theme"),Cm),Qbe=T(t=>{const e=new Zbe;return e.calculate(t),e},"getThemeVariables"),Jbe=(km=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Tr("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ke(this.lineColor);const e="#ECECFE",r="#E9E9F1",n=le(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||at(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(km,"Theme"),km),exe=T(t=>{const e=new Jbe;return e.calculate(t),e},"getThemeVariables"),txe=(Em=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Ke(this.background),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(Ke("#323D47"),10),this.border1="#ccc",this.border2=Ao(255,255,255,.25),this.arrowheadColor=Ke(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ke(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||at(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(Em,"Theme"),Em),rxe=T(t=>{const e=new txe;return e.calculate(t),e},"getThemeVariables"),nxe=(Sm=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ke(this.lineColor);const e="#ECECFE",r="#E9E9F1",n=le(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||at(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(Sm,"Theme"),Sm),ixe=T(t=>{const e=new nxe;return e.calculate(t),e},"getThemeVariables"),axe=(Am=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Ke(this.background),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(Ke("#323D47"),10),this.border1="#ccc",this.border2=Ao(255,255,255,.25),this.arrowheadColor=Ke(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?st(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ke(this.lineColor),this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||at(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(Am,"Theme"),Am),sxe=T(t=>{const e=new axe;return e.calculate(t),e},"getThemeVariables"),uc={base:{getThemeVariables:Gbe},dark:{getThemeVariables:Vbe},default:{getThemeVariables:wp},forest:{getThemeVariables:Hbe},neutral:{getThemeVariables:Xbe},neo:{getThemeVariables:jbe},"neo-dark":{getThemeVariables:Qbe},redux:{getThemeVariables:exe},"redux-dark":{getThemeVariables:rxe},"redux-color":{getThemeVariables:ixe},"redux-dark-color":{getThemeVariables:sxe}},za={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},SB={...za,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:uc.default.getThemeVariables(),sequence:{...za.sequence,messageFont:T(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:T(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:T(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...za.gantt,tickInterval:void 0,useWidth:void 0},c4:{...za.c4,useWidth:void 0,personFont:T(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...za.flowchart,inheritDir:!1},external_personFont:T(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:T(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:T(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:T(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:T(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:T(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:T(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:T(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:T(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:T(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:T(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:T(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:T(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:T(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:T(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:T(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:T(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:T(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:T(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:T(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:T(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...za.pie,useWidth:984},xyChart:{...za.xyChart,useWidth:void 0},requirement:{...za.requirement,useWidth:void 0},packet:{...za.packet},eventmodeling:{...za.eventmodeling},treeView:{...za.treeView,useWidth:void 0},radar:{...za.radar},ishikawa:{...za.ishikawa},sankey:{...za.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...za.venn}},AB=T((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...AB(t[n],"")]:[...r,e+n],[]),"keyify"),oxe=new Set(AB(SB,"")),Fr=SB,Ew=T(t=>{if(ae.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>Ew(e));return}for(const e of Object.keys(t)){if(ae.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!oxe.has(e)||t[e]==null){ae.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){if(e==="nodeColors"){const n=/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i;for(const i of Object.keys(t[e]))(typeof t[e][i]!="string"||!n.test(t[e][i]))&&(ae.debug("sanitize deleting invalid color:",i,t[e][i]),delete t[e][i])}else ae.debug("sanitizing object",e),Ew(t[e]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(ae.debug("sanitizing css option",e),t[e]=_B(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}ae.debug("After sanitization",t)}},"sanitizeDirective"),_B=T(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),ms=ci({},Cp),Sw,Wh=[],h2=ci({},Cp),Aw=T((t,e)=>{let r=ci({},t),n={};for(const i of e)IB(i),n=ci(n,i);if(r=ci(r,n),n.theme&&n.theme in uc){const i=ci({},Sw),a=ci(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in uc&&(r.themeVariables=uc[r.theme].getThemeVariables(a))}return h2=r,NB(h2),h2},"updateCurrentConfig"),lxe=T(t=>(ms=ci({},Cp),ms=ci(ms,t),t.theme&&uc[t.theme]&&(ms.themeVariables=uc[t.theme].getThemeVariables(t.themeVariables)),Aw(ms,Wh),ms),"setSiteConfig"),cxe=T(t=>{Sw=ci({},t)},"saveConfigFromInitialize"),uxe=T(t=>(ms=ci(ms,t),Aw(ms,Wh),ms),"updateSiteConfig"),RB=T(()=>ci({},ms),"getSiteConfig"),LB=T(t=>(NB(t),ci(h2,t),lr()),"setConfig"),lr=T(()=>ci({},h2),"getConfig"),IB=T(t=>{t&&(["secure",...ms.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(ae.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&IB(t[e])}))},"sanitize"),hxe=T(t=>{var e;Ew(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),Wh.push(t),Aw(ms,Wh)},"addDirective"),_w=T((t=ms)=>{Wh=[],Aw(t,Wh)},"reset"),dxe={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},DB={},MB=T(t=>{DB[t]||(ae.warn(dxe[t]),DB[t]=!0)},"issueWarning"),NB=T(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&MB("LAZY_LOAD_DEPRECATED")},"checkConfig"),fxe=T(()=>{let t={};Sw&&(t=ci(t,Sw));for(const e of Wh)t=ci(t,e);return t},"getUserDefinedConfig"),on=T(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&MB("FLOWCHART_HTML_LABELS_DEPRECATED"),hc(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),kp=//gi,pxe=T(t=>t?BB(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),gxe=(()=>{let t=!1;return()=>{t||(OB(),t=!0)}})();function OB(){const t="data-temp-href-target";ku.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),ku.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}T(OB,"setupDompurifyHooks");var $B=T(t=>(gxe(),ku.sanitize(t)),"removeScript"),PB=T((t,e)=>{if(on(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=$B(t):r!=="loose"&&(t=BB(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=bxe(t))}return t},"sanitizeMore"),qr=T((t,e)=>t&&(e.dompurifyConfig?t=ku.sanitize(PB(t,e),e.dompurifyConfig).toString():t=ku.sanitize(PB(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),mxe=T((t,e)=>typeof t=="string"?qr(t,e):t.flat().map(r=>qr(r,e)),"sanitizeTextOrArray"),yxe=T(t=>kp.test(t),"hasBreaks"),vxe=T(t=>t.split(kp),"splitBreaks"),bxe=T(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),BB=T(t=>t.replace(kp,"#br#"),"breakToPlaceholder"),Rw=T(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),xxe=T(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),Txe=T(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),Eu=T(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),wxe=T((t,e)=>{const r=L6(t,"~"),n=L6(e,"~");return r===1&&n===1},"shouldCombineSets"),Cxe=T(t=>{const e=L6(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),FB=T(()=>window.MathMLElement!==void 0,"isMathMLSupported"),I6=/\$\$(.*)\$\$/g,ui=T(t=>{var e;return(((e=t.match(I6))==null?void 0:e.length)??0)>0},"hasKatex"),d2=T(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await Lw(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),kxe=T(async(t,e)=>{if(!ui(t))return t;if(!(FB()||e.legacyMathML||e.forceLegacyMathML))return t.replace(I6,"MathML is unsupported in this environment.");{const{default:r}=await Promise.resolve().then(()=>FLe),n=e.forceLegacyMathML||!FB()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(kp).map(i=>ui(i)?`
${i}
`:`
${i}
`).join("").replace(I6,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),Lw=T(async(t,e)=>qr(await kxe(t,e),e),"renderKatexSanitized"),Lt={getRows:pxe,sanitizeText:qr,sanitizeTextOrArray:mxe,hasBreaks:yxe,splitBreaks:vxe,lineBreakRegex:kp,removeScript:$B,getUrl:Rw,evaluate:hc,getMax:xxe,getMin:Txe},Exe=T(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),Sxe=T(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),wi=T(function(t,e,r,n){const i=Sxe(e,r,n);Exe(t,i)},"configureSvgSize"),Ep=T(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;ae.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;ae.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,ae.info(`Calculated bounds: ${o}x${l}`),wi(e,l,o,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),Iw={};function D6(t){return[...t.cssRules].map(e=>e.cssText).join(` +`)}T(D6,"cssStyleSheetToString");var Axe=T((t,e,r,n)=>{let i="";return t in Iw&&Iw[t]?i=Iw[t]({...r,svgId:n}):ae.warn(`No theme found for ${t}`),` & { font-family: ${r.fontFamily}; font-size: ${r.fontSize}; fill: ${r.textColor} @@ -120,49 +120,49 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho } ${e} -`},"getStyles"),wxe=x((t,e)=>{e!==void 0&&(Rw[t]=e)},"addStylesForDiagram"),Cxe=Txe,L6={};bw(L6,{clear:()=>In,getAccDescription:()=>Gn,getAccTitle:()=>Fn,getDiagramTitle:()=>Mn,setAccDescription:()=>zn,setAccTitle:()=>Dn,setDiagramTitle:()=>qn});var I6="",D6="",M6="",N6=x(t=>qr(t,lr()),"sanitizeText"),In=x(()=>{I6="",M6="",D6=""},"clear"),Dn=x(t=>{I6=N6(t).replace(/^\s+/g,"")},"setAccTitle"),Fn=x(()=>I6,"getAccTitle"),zn=x(t=>{M6=N6(t).replace(/\n\s+/g,` -`)},"setAccDescription"),Gn=x(()=>M6,"getAccDescription"),qn=x(t=>{D6=N6(t)},"setDiagramTitle"),Mn=x(()=>D6,"getDiagramTitle"),OB=ae,kxe=p6,Pe=lr,O6=EB,$B=C0,$6=x(t=>qr(t,Pe()),"sanitizeText"),P6=E0,Exe=x(()=>L6,"getCommonDb"),Lw={},Iw=x((t,e,r)=>{var n;Lw[t]&&OB.warn(`Diagram with id ${t} already registered. Overwriting.`),Lw[t]=e,r&&xB(t,r),wxe(t,e.styles),(n=e.injectUtils)==null||n.call(e,OB,kxe,Pe,$6,P6,Exe(),()=>{})},"registerDiagram"),B6=x(t=>{if(t in Lw)return Lw[t];throw new Sxe(t)},"getDiagram"),Sxe=(Am=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},x(Am,"DiagramNotFoundError"),Am);function Dw(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function Axe(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function F6(t){let e,r,n;t.length!==2?(e=Dw,r=(o,l)=>Dw(t(o),l),n=(o,l)=>t(o)-l):(e=t===Dw||t===Axe?t:_xe,r=t,n=t);function i(o,l,u=0,h=o.length){if(u>>1;r(o[d],l)<0?u=d+1:h=d}while(u>>1;r(o[d],l)<=0?u=d+1:h=d}while(uu&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:i,center:s,right:a}}function _xe(){return 0}function Rxe(t){return t===null?NaN:+t}const Lxe=F6(Dw).right;F6(Rxe).center;class PB extends Map{constructor(e,r=Mxe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(BB(this,e))}has(e){return super.has(BB(this,e))}set(e,r){return super.set(Ixe(this,e),r)}delete(e){return super.delete(Dxe(this,e))}}function BB({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function Ixe({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function Dxe({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function Mxe(t){return t!==null&&typeof t=="object"?t.valueOf():t}const Nxe=Math.sqrt(50),Oxe=Math.sqrt(10),$xe=Math.sqrt(2);function Mw(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=Nxe?10:a>=Oxe?5:a>=$xe?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(t*u),l=Math.round(e*u),o/ue&&--l,u=-u):(u=Math.pow(10,i)*s,o=Math.round(t/u),l=Math.round(e/u),o*ue&&--l),l0))return[];if(t===e)return[t];const n=e=i))return[];const o=a-i+1,l=new Array(o);if(n)if(s<0)for(let u=0;u=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function Fxe(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function zxe(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n+t(e)}function Uxe(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function Hxe(){return!this.__axis}function zB(t,e){var r=[],n=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===Nw||t===Ow?-1:1,h=t===Ow||t===q6?"x":"y",d=t===Nw||t===V6?qxe:Vxe;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):Gxe),y=Math.max(a,0)+o,v=e.range(),T=+v[0]+l,b=+v[v.length-1]+l,w=(e.bandwidth?Uxe:Wxe)(e.copy(),l),k=p.selection?p.selection():p,A=k.selectAll(".domain").data([null]),C=k.selectAll(".tick").data(g,e).order(),_=C.exit(),L=C.enter().append("g").attr("class","tick"),O=C.select("line"),M=C.select("text");A=A.merge(A.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),C=C.merge(L),O=O.merge(L.append("line").attr("stroke","currentColor").attr(h+"2",u*a)),M=M.merge(L.append("text").attr("fill","currentColor").attr(h,u*y).attr("dy",t===Nw?"0em":t===V6?"0.71em":"0.32em")),p!==k&&(A=A.transition(p),C=C.transition(p),O=O.transition(p),M=M.transition(p),_=_.transition(p).attr("opacity",FB).attr("transform",function(z){return isFinite(z=w(z))?d(z+l):this.getAttribute("transform")}),L.attr("opacity",FB).attr("transform",function(z){var F=this.parentNode.__axis;return d((F&&isFinite(F=F(z))?F:w(z))+l)})),_.remove(),A.attr("d",t===Ow||t===q6?s?"M"+u*s+","+T+"H"+l+"V"+b+"H"+u*s:"M"+l+","+T+"V"+b:s?"M"+T+","+u*s+"V"+l+"H"+b+"V"+u*s:"M"+T+","+l+"H"+b),C.attr("opacity",1).attr("transform",function(z){return d(w(z)+l)}),O.attr(h+"2",u*a),M.attr(h,u*y).text(m),k.filter(Hxe).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===q6?"start":t===Ow?"end":"middle"),k.each(function(){this.__axis=w})}return f.scale=function(p){return arguments.length?(e=p,f):e},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(a=s=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(s=+p,f):s},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function Yxe(t){return zB(Nw,t)}function Xxe(t){return zB(V6,t)}var Kxe={value:()=>{}};function GB(){for(var t=0,e=arguments.length,r={},n;t=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}$w.prototype=GB.prototype={constructor:$w,on:function(t,e){var r=this._,n=jxe(t+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a0)for(var r=new Array(i),n=0,i,a;n=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),VB.hasOwnProperty(e)?{space:VB[e],local:t}:t}function Qxe(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===W6&&e.documentElement.namespaceURI===W6?e.createElement(t):e.createElementNS(r,t)}}function Jxe(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function WB(t){var e=Pw(t);return(e.local?Jxe:Qxe)(e)}function eTe(){}function U6(t){return t==null?eTe:function(){return this.querySelector(t)}}function tTe(t){typeof t!="function"&&(t=U6(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=b&&(b=T+1);!(k=y[b])&&++b=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function STe(t){t||(t=ATe);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}function _Te(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function RTe(){return Array.from(this)}function LTe(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?GTe:typeof e=="function"?VTe:qTe)(t,e,r??"")):S0(this.node(),t)}function S0(t,e){return t.style.getPropertyValue(e)||KB(t).getComputedStyle(t,null).getPropertyValue(e)}function UTe(t){return function(){delete this[t]}}function HTe(t,e){return function(){this[t]=e}}function YTe(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function XTe(t,e){return arguments.length>1?this.each((e==null?UTe:typeof e=="function"?YTe:HTe)(t,e)):this.node()[t]}function jB(t){return t.trim().split(/^|\s+/)}function H6(t){return t.classList||new ZB(t)}function ZB(t){this._node=t,this._names=jB(t.getAttribute("class")||"")}ZB.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function QB(t,e){for(var r=H6(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function wwe(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Gw(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Gw(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Iwe.exec(t))?new Ea(e[1],e[2],e[3],1):(e=Dwe.exec(t))?new Ea(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Mwe.exec(t))?Gw(e[1],e[2],e[3],e[4]):(e=Nwe.exec(t))?Gw(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Owe.exec(t))?cF(e[1],e[2]/100,e[3]/100,1):(e=$we.exec(t))?cF(e[1],e[2]/100,e[3]/100,e[4]):rF.hasOwnProperty(t)?aF(rF[t]):t==="transparent"?new Ea(NaN,NaN,NaN,0):null}function aF(t){return new Ea(t>>16&255,t>>8&255,t&255,1)}function Gw(t,e,r,n){return n<=0&&(t=e=r=NaN),new Ea(t,e,r,n)}function sF(t){return t instanceof Uh||(t=Hh(t)),t?(t=t.rgb(),new Ea(t.r,t.g,t.b,t.opacity)):new Ea}function Y6(t,e,r,n){return arguments.length===1?sF(t):new Ea(t,e,r,n??1)}function Ea(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}f2(Ea,Y6,Fw(Uh,{brighter(t){return t=t==null?zw:Math.pow(zw,t),new Ea(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?p2:Math.pow(p2,t),new Ea(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ea(Yh(this.r),Yh(this.g),Yh(this.b),qw(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:oF,formatHex:oF,formatHex8:Fwe,formatRgb:lF,toString:lF}));function oF(){return`#${Xh(this.r)}${Xh(this.g)}${Xh(this.b)}`}function Fwe(){return`#${Xh(this.r)}${Xh(this.g)}${Xh(this.b)}${Xh((isNaN(this.opacity)?1:this.opacity)*255)}`}function lF(){const t=qw(this.opacity);return`${t===1?"rgb(":"rgba("}${Yh(this.r)}, ${Yh(this.g)}, ${Yh(this.b)}${t===1?")":`, ${t})`}`}function qw(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Yh(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Xh(t){return t=Yh(t),(t<16?"0":"")+t.toString(16)}function cF(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new _o(t,e,r,n)}function uF(t){if(t instanceof _o)return new _o(t.h,t.s,t.l,t.opacity);if(t instanceof Uh||(t=Hh(t)),!t)return new _o;if(t instanceof _o)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(e===a?s=(r-n)/o+(r0&&l<1?0:s,new _o(s,o,l,t.opacity)}function zwe(t,e,r,n){return arguments.length===1?uF(t):new _o(t,e,r,n??1)}function _o(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}f2(_o,zwe,Fw(Uh,{brighter(t){return t=t==null?zw:Math.pow(zw,t),new _o(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?p2:Math.pow(p2,t),new _o(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Ea(X6(t>=240?t-240:t+120,i,n),X6(t,i,n),X6(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new _o(hF(this.h),Vw(this.s),Vw(this.l),qw(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=qw(this.opacity);return`${t===1?"hsl(":"hsla("}${hF(this.h)}, ${Vw(this.s)*100}%, ${Vw(this.l)*100}%${t===1?")":`, ${t})`}`}}));function hF(t){return t=(t||0)%360,t<0?t+360:t}function Vw(t){return Math.max(0,Math.min(1,t||0))}function X6(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const Gwe=Math.PI/180,qwe=180/Math.PI,Ww=18,dF=.96422,fF=1,pF=.82521,gF=4/29,_0=6/29,mF=3*_0*_0,Vwe=_0*_0*_0;function yF(t){if(t instanceof fl)return new fl(t.l,t.a,t.b,t.opacity);if(t instanceof dc)return vF(t);t instanceof Ea||(t=sF(t));var e=Q6(t.r),r=Q6(t.g),n=Q6(t.b),i=K6((.2225045*e+.7168786*r+.0606169*n)/fF),a,s;return e===r&&r===n?a=s=i:(a=K6((.4360747*e+.3850649*r+.1430804*n)/dF),s=K6((.0139322*e+.0971045*r+.7141733*n)/pF)),new fl(116*i-16,500*(a-i),200*(i-s),t.opacity)}function Wwe(t,e,r,n){return arguments.length===1?yF(t):new fl(t,e,r,n??1)}function fl(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}f2(fl,Wwe,Fw(Uh,{brighter(t){return new fl(this.l+Ww*(t??1),this.a,this.b,this.opacity)},darker(t){return new fl(this.l-Ww*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=dF*j6(e),t=fF*j6(t),r=pF*j6(r),new Ea(Z6(3.1338561*e-1.6168667*t-.4906146*r),Z6(-.9787684*e+1.9161415*t+.033454*r),Z6(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function K6(t){return t>Vwe?Math.pow(t,1/3):t/mF+gF}function j6(t){return t>_0?t*t*t:mF*(t-gF)}function Z6(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Q6(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Uwe(t){if(t instanceof dc)return new dc(t.h,t.c,t.l,t.opacity);if(t instanceof fl||(t=yF(t)),t.a===0&&t.b===0)return new dc(NaN,0()=>t;function bF(t,e){return function(r){return t+r*e}}function Hwe(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function Ywe(t,e){var r=e-t;return r?bF(t,r>180||r<-180?r-360*Math.round(r/360):r):Uw(isNaN(t)?e:t)}function Xwe(t){return(t=+t)==1?m2:function(e,r){return r-e?Hwe(e,r,t):Uw(isNaN(e)?r:e)}}function m2(t,e){var r=e-t;return r?bF(t,r):Uw(isNaN(t)?e:t)}const Hw=(function t(e){var r=Xwe(e);function n(i,a){var s=r((i=Y6(i)).r,(a=Y6(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=m2(i.opacity,a.opacity);return function(h){return i.r=s(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n})(1);function Kwe(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;ir&&(a=e.slice(r,a),o[s]?o[s]+=a:o[++s]=a),(n=n[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:Ro(n,i)})),r=tA.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:Ro(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function o(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:Ro(u,h)}):h&&d.push(i(d)+"skewX("+h+n)}function l(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:Ro(u,d)},{i:m-2,x:Ro(h,f)})}else(d!==1||f!==1)&&p.push(i(p)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=t(u),h=t(h),a(u.translateX,u.translateY,h.translateX,h.translateY,d,f),s(u.rotate,h.rotate,d,f),o(u.skewX,h.skewX,d,f),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(p){for(var g=-1,m=f.length,y;++g=0&&t._call.call(void 0,e),t=t._next;--R0}function AF(){Kh=(Kw=x2.now())+jw,R0=y2=0;try{u4e()}finally{R0=0,d4e(),Kh=0}}function h4e(){var t=x2.now(),e=t-Kw;e>kF&&(jw-=e,Kw=t)}function d4e(){for(var t,e=Xw,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:Xw=r);b2=t,aA(n)}function aA(t){if(!R0){y2&&(y2=clearTimeout(y2));var e=t-Kh;e>24?(t<1/0&&(y2=setTimeout(AF,t-x2.now()-jw)),v2&&(v2=clearInterval(v2))):(v2||(Kw=x2.now(),v2=setInterval(h4e,kF)),R0=1,EF(AF))}}function _F(t,e,r){var n=new Zw;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var f4e=GB("start","end","cancel","interrupt"),p4e=[],RF=0,LF=1,sA=2,Qw=3,IF=4,oA=5,Jw=6;function e4(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;g4e(t,r,{name:e,index:n,group:i,on:f4e,tween:p4e,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:RF})}function lA(t,e){var r=Lo(t,e);if(r.state>RF)throw new Error("too late; already scheduled");return r}function pl(t,e){var r=Lo(t,e);if(r.state>Qw)throw new Error("too late; already running");return r}function Lo(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function g4e(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=SF(a,0,r.time);function a(u){r.state=LF,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var h,d,f,p;if(r.state!==LF)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===Qw)return _F(s);p.state===IF?(p.state=Jw,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hsA&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function H4e(t,e,r){var n,i,a=U4e(e)?lA:pl;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function Y4e(t,e){var r=this._id;return arguments.length<2?Lo(this.node(),r).on.on(t):this.each(H4e(r,t,e))}function X4e(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function K4e(){return this.on("end.remove",X4e(this._id))}function j4e(t){var e=this._name,r=this._id;typeof t!="function"&&(t=U6(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s=0))throw new Error(`invalid digits: ${t}`);if(e>15)return OF;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;ijh)if(!(Math.abs(d*l-u*h)>jh)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-s,g=i-o,m=l*l+u*u,y=p*p+g*g,v=Math.sqrt(m),T=Math.sqrt(f),b=a*Math.tan((uA-Math.acos((m+f-y)/(2*v*T)))/2),w=b/T,k=b/v;Math.abs(w-1)>jh&&this._append`L${e+w*h},${r+w*d}`,this._append`A${a},${a},0,0,${+(d*p>h*g)},${this._x1=e+k*l},${this._y1=r+k*u}`}}arc(e,r,n,i,a,s){if(e=+e,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),u=e+o,h=r+l,d=1^s,f=s?i-a:a-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>jh||Math.abs(this._y1-h)>jh)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%hA+hA),f>TCe?this._append`A${n},${n},0,1,${d},${e-o},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>jh&&this._append`A${n},${n},0,${+(f>=uA)},${d},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function kCe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function t4(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function L0(t){return t=t4(Math.abs(t)),t?t[1]:NaN}function ECe(t,e){return function(r,n){for(var i=r.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function SCe(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var ACe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function r4(t){if(!(e=ACe.exec(t)))throw new Error("invalid format: "+t);var e;return new dA({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}r4.prototype=dA.prototype;function dA(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}dA.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function _Ce(t){e:for(var e=t.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var n4;function RCe(t,e){var r=t4(t,e);if(!r)return n4=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(n4=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+t4(t,Math.max(0,e+a-1))[0]}function $F(t,e){var r=t4(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const PF={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:kCe,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>$F(t*100,e),r:$F,s:RCe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function BF(t){return t}var FF=Array.prototype.map,zF=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function LCe(t){var e=t.grouping===void 0||t.thousands===void 0?BF:ECe(FF.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?BF:SCe(FF.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d,f){d=r4(d);var p=d.fill,g=d.align,m=d.sign,y=d.symbol,v=d.zero,T=d.width,b=d.comma,w=d.precision,k=d.trim,A=d.type;A==="n"?(b=!0,A="g"):PF[A]||(w===void 0&&(w=12),k=!0,A="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var C=(f&&f.prefix!==void 0?f.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),_=(y==="$"?n:/[%p]/.test(A)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),L=PF[A],O=/[defgprs%]/.test(A);w=w===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function M(z){var F=C,S=_,R,N,D;if(A==="c")S=L(z)+S,z="";else{z=+z;var I=z<0||1/z<0;if(z=isNaN(z)?l:L(Math.abs(z),w),k&&(z=_Ce(z)),I&&+z==0&&m!=="+"&&(I=!1),F=(I?m==="("?m:o:m==="-"||m==="("?"":m)+F,S=(A==="s"&&!isNaN(z)&&n4!==void 0?zF[8+n4/3]:"")+S+(I&&m==="("?")":""),O){for(R=-1,N=z.length;++RD||D>57){S=(D===46?i+z.slice(R+1):z.slice(R))+S,z=z.slice(0,R);break}}}b&&!v&&(z=e(z,1/0));var $=F.length+z.length+S.length,B=$>1)+F+z+S+B.slice($);break;default:z=B+F+z+S;break}return a(z)}return M.toString=function(){return d+""},M}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(L0(f)/3)))*3,g=Math.pow(10,-p),m=u((d=r4(d),d.type="f",d),{suffix:zF[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var i4,Zh,GF;ICe({thousands:",",grouping:[3],currency:["$",""]});function ICe(t){return i4=LCe(t),Zh=i4.format,GF=i4.formatPrefix,i4}function DCe(t){return Math.max(0,-L0(Math.abs(t)))}function MCe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(L0(e)/3)))*3-L0(Math.abs(t)))}function NCe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,L0(e)-L0(t))+1}function OCe(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function $Ce(){return this.eachAfter(OCe)}function PCe(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function BCe(t,e){for(var r=this,n=[r],i,a,s=-1;r=n.pop();)if(t.call(e,r,++s,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function FCe(t,e){for(var r=this,n=[r],i=[],a,s,o,l=-1;r=n.pop();)if(i.push(r),a=r.children)for(s=0,o=a.length;s=0;)r+=n[i].value;e.value=r})}function qCe(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function VCe(t){for(var e=this,r=WCe(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n}function WCe(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}function UCe(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function HCe(){return Array.from(this)}function YCe(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function XCe(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*KCe(){var t=this,e,r=[t],n,i,a;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,a=n.length;i=0;--o)i.push(a=s[o]=new a4(s[o])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(e5e)}function jCe(){return fA(this).eachBefore(JCe)}function ZCe(t){return t.children}function QCe(t){return Array.isArray(t)?t[1]:null}function JCe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function e5e(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function a4(t){this.data=t,this.depth=this.height=0,this.parent=null}a4.prototype=fA.prototype={constructor:a4,count:$Ce,each:PCe,eachAfter:FCe,eachBefore:BCe,find:zCe,sum:GCe,sort:qCe,path:VCe,ancestors:UCe,descendants:HCe,leaves:YCe,links:XCe,copy:jCe,[Symbol.iterator]:KCe};function t5e(t){if(typeof t!="function")throw new Error;return t}function T2(){return 0}function w2(t){return function(){return t}}function r5e(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function n5e(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(n-e)/t.value;++oT&&(T=u),A=y*y*k,b=Math.max(T/A,A/v),b>w){y-=u;break}w=b}s.push(l={value:y,dice:p1?n:1)},r})(a5e);function l5e(){var t=o5e,e=!1,r=1,n=1,i=[0],a=T2,s=T2,o=T2,l=T2,u=T2;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(r5e),f}function d(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,y=f.x1-p,v=f.y1-p;ye&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function d5e(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?f5e:d5e,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(l||(l=o(t.map(n),e,r)))(n(s(f)))}return d.invert=function(f){return s(i((u||(u=o(e,t.map(n),Ro)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,u5e),h()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),h()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),r=r4e,h()},d.clamp=function(f){return arguments.length?(s=f?!0:I0,h()):s!==I0},d.interpolate=function(f){return arguments.length?(r=f,h()):r},d.unknown=function(f){return arguments.length?(a=f,d):a},function(f,p){return n=f,i=p,h()}}function UF(){return p5e()(I0,I0)}function g5e(t,e,r,n){var i=G6(t,e,r),a;switch(n=r4(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=MCe(i,s))&&(n.precision=a),GF(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=NCe(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=DCe(i))&&(n.precision=a-(n.type==="%")*2);break}}return Zh(n)}function m5e(t){var e=t.domain;return t.ticks=function(r){var n=e();return Pxe(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return g5e(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,s=n[i],o=n[a],l,u,h=10;for(o0;){if(u=z6(s,o,r),u===l)return n[i]=s,n[a]=o,e(n);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return t},t}function D0(){var t=UF();return t.copy=function(){return WF(t,D0())},s4.apply(t,arguments),m5e(t)}function y5e(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a0))return l;let u;do l.push(u=new Date(+a)),e(a,o),t(a);while(uNi(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!a(s););else for(;--o>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(mA.setTime(+a),yA.setTime(+s),t(mA),t(yA),Math.floor(r(mA,yA))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const M0=Ni(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);M0.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Ni(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):M0),M0.range;const gc=1e3,ao=gc*60,mc=ao*60,yc=mc*24,vA=yc*7,HF=yc*30,bA=yc*365,Su=Ni(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*gc)},(t,e)=>(e-t)/gc,t=>t.getUTCSeconds());Su.range;const C2=Ni(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*gc)},(t,e)=>{t.setTime(+t+e*ao)},(t,e)=>(e-t)/ao,t=>t.getMinutes());C2.range,Ni(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ao)},(t,e)=>(e-t)/ao,t=>t.getUTCMinutes()).range;const k2=Ni(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*gc-t.getMinutes()*ao)},(t,e)=>{t.setTime(+t+e*mc)},(t,e)=>(e-t)/mc,t=>t.getHours());k2.range,Ni(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*mc)},(t,e)=>(e-t)/mc,t=>t.getUTCHours()).range;const Jh=Ni(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ao)/yc,t=>t.getDate()-1);Jh.range;const xA=Ni(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yc,t=>t.getUTCDate()-1);xA.range,Ni(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yc,t=>Math.floor(t/yc)).range;function ed(t){return Ni(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*ao)/vA)}const E2=ed(0),S2=ed(1),YF=ed(2),XF=ed(3),td=ed(4),KF=ed(5),jF=ed(6);E2.range,S2.range,YF.range,XF.range,td.range,KF.range,jF.range;function rd(t){return Ni(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/vA)}const ZF=rd(0),o4=rd(1),v5e=rd(2),b5e=rd(3),N0=rd(4),x5e=rd(5),T5e=rd(6);ZF.range,o4.range,v5e.range,b5e.range,N0.range,x5e.range,T5e.range;const A2=Ni(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());A2.range,Ni(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()).range;const vc=Ni(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());vc.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ni(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)}),vc.range;const nd=Ni(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());nd.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ni(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)}),nd.range;function w5e(t,e,r,n,i,a){const s=[[Su,1,gc],[Su,5,5*gc],[Su,15,15*gc],[Su,30,30*gc],[a,1,ao],[a,5,5*ao],[a,15,15*ao],[a,30,30*ao],[i,1,mc],[i,3,3*mc],[i,6,6*mc],[i,12,12*mc],[n,1,yc],[n,2,2*yc],[r,1,vA],[e,1,HF],[e,3,3*HF],[t,1,bA]];function o(u,h,d){const f=hy).right(s,f);if(p===s.length)return t.every(G6(u/bA,h/bA,d));if(p===0)return M0.every(Math.max(G6(u,h,d),1));const[g,m]=s[f/s[p-1][2]53)return null;"w"in ne||(ne.w=1),"Z"in ne?(fe=wA(_2(ne.y,0,1)),_e=fe.getUTCDay(),fe=_e>4||_e===0?o4.ceil(fe):o4(fe),fe=xA.offset(fe,(ne.V-1)*7),ne.y=fe.getUTCFullYear(),ne.m=fe.getUTCMonth(),ne.d=fe.getUTCDate()+(ne.w+6)%7):(fe=TA(_2(ne.y,0,1)),_e=fe.getDay(),fe=_e>4||_e===0?S2.ceil(fe):S2(fe),fe=Jh.offset(fe,(ne.V-1)*7),ne.y=fe.getFullYear(),ne.m=fe.getMonth(),ne.d=fe.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),_e="Z"in ne?wA(_2(ne.y,0,1)).getUTCDay():TA(_2(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(_e+5)%7:ne.w+ne.U*7-(_e+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,wA(ne)):TA(ne)}}function _(J,Z,ee,ne){for(var ue=0,fe=Z.length,_e=ee.length,Ae,Ne;ue=_e)return-1;if(Ae=Z.charCodeAt(ue++),Ae===37){if(Ae=Z.charAt(ue++),Ne=k[Ae in QF?Z.charAt(ue++):Ae],!Ne||(ne=Ne(J,ee,ne))<0)return-1}else if(Ae!=ee.charCodeAt(ne++))return-1}return ne}function L(J,Z,ee){var ne=u.exec(Z.slice(ee));return ne?(J.p=h.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function O(J,Z,ee){var ne=p.exec(Z.slice(ee));return ne?(J.w=g.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function M(J,Z,ee){var ne=d.exec(Z.slice(ee));return ne?(J.w=f.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function z(J,Z,ee){var ne=v.exec(Z.slice(ee));return ne?(J.m=T.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function F(J,Z,ee){var ne=m.exec(Z.slice(ee));return ne?(J.m=y.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function S(J,Z,ee){return _(J,e,Z,ee)}function R(J,Z,ee){return _(J,r,Z,ee)}function N(J,Z,ee){return _(J,n,Z,ee)}function D(J){return s[J.getDay()]}function I(J){return a[J.getDay()]}function $(J){return l[J.getMonth()]}function B(J){return o[J.getMonth()]}function P(J){return i[+(J.getHours()>=12)]}function G(J){return 1+~~(J.getMonth()/3)}function V(J){return s[J.getUTCDay()]}function Y(J){return a[J.getUTCDay()]}function W(J){return l[J.getUTCMonth()]}function ie(J){return o[J.getUTCMonth()]}function K(J){return i[+(J.getUTCHours()>=12)]}function se(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var Z=A(J+="",b);return Z.toString=function(){return J},Z},parse:function(J){var Z=C(J+="",!1);return Z.toString=function(){return J},Z},utcFormat:function(J){var Z=A(J+="",w);return Z.toString=function(){return J},Z},utcParse:function(J){var Z=C(J+="",!0);return Z.toString=function(){return J},Z}}}var QF={"-":"",_:" ",0:"0"},ji=/^\s*\d+/,S5e=/^%/,A5e=/[\\^$*+?|[\]().{}]/g;function Jr(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function R5e(t,e,r){var n=ji.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function L5e(t,e,r){var n=ji.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function I5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function D5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function M5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function JF(t,e,r){var n=ji.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function ez(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function N5e(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function O5e(t,e,r){var n=ji.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function $5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function tz(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function P5e(t,e,r){var n=ji.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function rz(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function B5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function F5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function z5e(t,e,r){var n=ji.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function G5e(t,e,r){var n=ji.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function q5e(t,e,r){var n=S5e.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function V5e(t,e,r){var n=ji.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function W5e(t,e,r){var n=ji.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function nz(t,e){return Jr(t.getDate(),e,2)}function U5e(t,e){return Jr(t.getHours(),e,2)}function H5e(t,e){return Jr(t.getHours()%12||12,e,2)}function Y5e(t,e){return Jr(1+Jh.count(vc(t),t),e,3)}function iz(t,e){return Jr(t.getMilliseconds(),e,3)}function X5e(t,e){return iz(t,e)+"000"}function K5e(t,e){return Jr(t.getMonth()+1,e,2)}function j5e(t,e){return Jr(t.getMinutes(),e,2)}function Z5e(t,e){return Jr(t.getSeconds(),e,2)}function Q5e(t){var e=t.getDay();return e===0?7:e}function J5e(t,e){return Jr(E2.count(vc(t)-1,t),e,2)}function az(t){var e=t.getDay();return e>=4||e===0?td(t):td.ceil(t)}function e3e(t,e){return t=az(t),Jr(td.count(vc(t),t)+(vc(t).getDay()===4),e,2)}function t3e(t){return t.getDay()}function r3e(t,e){return Jr(S2.count(vc(t)-1,t),e,2)}function n3e(t,e){return Jr(t.getFullYear()%100,e,2)}function i3e(t,e){return t=az(t),Jr(t.getFullYear()%100,e,2)}function a3e(t,e){return Jr(t.getFullYear()%1e4,e,4)}function s3e(t,e){var r=t.getDay();return t=r>=4||r===0?td(t):td.ceil(t),Jr(t.getFullYear()%1e4,e,4)}function o3e(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Jr(e/60|0,"0",2)+Jr(e%60,"0",2)}function sz(t,e){return Jr(t.getUTCDate(),e,2)}function l3e(t,e){return Jr(t.getUTCHours(),e,2)}function c3e(t,e){return Jr(t.getUTCHours()%12||12,e,2)}function u3e(t,e){return Jr(1+xA.count(nd(t),t),e,3)}function oz(t,e){return Jr(t.getUTCMilliseconds(),e,3)}function h3e(t,e){return oz(t,e)+"000"}function d3e(t,e){return Jr(t.getUTCMonth()+1,e,2)}function f3e(t,e){return Jr(t.getUTCMinutes(),e,2)}function p3e(t,e){return Jr(t.getUTCSeconds(),e,2)}function g3e(t){var e=t.getUTCDay();return e===0?7:e}function m3e(t,e){return Jr(ZF.count(nd(t)-1,t),e,2)}function lz(t){var e=t.getUTCDay();return e>=4||e===0?N0(t):N0.ceil(t)}function y3e(t,e){return t=lz(t),Jr(N0.count(nd(t),t)+(nd(t).getUTCDay()===4),e,2)}function v3e(t){return t.getUTCDay()}function b3e(t,e){return Jr(o4.count(nd(t)-1,t),e,2)}function x3e(t,e){return Jr(t.getUTCFullYear()%100,e,2)}function T3e(t,e){return t=lz(t),Jr(t.getUTCFullYear()%100,e,2)}function w3e(t,e){return Jr(t.getUTCFullYear()%1e4,e,4)}function C3e(t,e){var r=t.getUTCDay();return t=r>=4||r===0?N0(t):N0.ceil(t),Jr(t.getUTCFullYear()%1e4,e,4)}function k3e(){return"+0000"}function cz(){return"%"}function uz(t){return+t}function hz(t){return Math.floor(+t/1e3)}var O0,l4;E3e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function E3e(t){return O0=E5e(t),l4=O0.format,O0.parse,O0.utcFormat,O0.utcParse,O0}function S3e(t){return new Date(t)}function A3e(t){return t instanceof Date?+t:+new Date(+t)}function dz(t,e,r,n,i,a,s,o,l,u){var h=UF(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),T=u("%b %d"),b=u("%B"),w=u("%Y");function k(A){return(l(A)1?0:t<-1?I2:Math.acos(t)}function pz(t){return t>=1?c4:t<=-1?-c4:Math.asin(t)}function gz(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new CCe(e)}function M3e(t){return t.innerRadius}function N3e(t){return t.outerRadius}function O3e(t){return t.startAngle}function $3e(t){return t.endAngle}function P3e(t){return t&&t.padAngle}function B3e(t,e,r,n,i,a,s,o){var l=r-t,u=n-e,h=s-i,d=o-a,f=d*l-h*u;if(!(f*fS*S+R*R&&(_=O,L=M),{cx:_,cy:L,x01:-h,y01:-d,x11:_*(i/k-1),y11:L*(i/k-1)}}function P0(){var t=M3e,e=N3e,r=hi(0),n=null,i=O3e,a=$3e,s=P3e,o=null,l=gz(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-c4,m=a.apply(this,arguments)-c4,y=fz(m-g),v=m>g;if(o||(o=h=l()),pAa))o.moveTo(0,0);else if(y>u4-Aa)o.moveTo(p*id(g),p*gl(g)),o.arc(0,0,p,g,m,!v),f>Aa&&(o.moveTo(f*id(m),f*gl(m)),o.arc(0,0,f,m,g,v));else{var T=g,b=m,w=g,k=m,A=y,C=y,_=s.apply(this,arguments)/2,L=_>Aa&&(n?+n.apply(this,arguments):$0(f*f+p*p)),O=CA(fz(p-f)/2,+r.apply(this,arguments)),M=O,z=O,F,S;if(L>Aa){var R=pz(L/f*gl(_)),N=pz(L/p*gl(_));(A-=R*2)>Aa?(R*=v?1:-1,w+=R,k-=R):(A=0,w=k=(g+m)/2),(C-=N*2)>Aa?(N*=v?1:-1,T+=N,b-=N):(C=0,T=b=(g+m)/2)}var D=p*id(T),I=p*gl(T),$=f*id(k),B=f*gl(k);if(O>Aa){var P=p*id(b),G=p*gl(b),V=f*id(w),Y=f*gl(w),W;if(yAa?z>Aa?(F=h4(V,Y,D,I,p,z,v),S=h4(P,G,$,B,p,z,v),o.moveTo(F.cx+F.x01,F.cy+F.y01),zAa)||!(A>Aa)?o.lineTo($,B):M>Aa?(F=h4($,B,P,G,f,-M,v),S=h4(D,I,V,Y,f,-M,v),o.lineTo(F.cx+F.x01,F.cy+F.y01),Mt?1:e>=t?0:NaN}function q3e(t){return t}function V3e(){var t=q3e,e=G3e,r=null,n=hi(0),i=hi(u4),a=hi(0);function s(o){var l,u=(o=mz(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(u4,Math.max(-u4,i.apply(this,arguments)-m)),v,T=Math.min(Math.abs(y)/u,a.apply(this,arguments)),b=T*(y<0?-1:1),w;for(l=0;l0&&(f+=w);for(e!=null?p.sort(function(k,A){return e(g[k],g[A])}):r!=null&&p.sort(function(k,A){return r(o[k],o[A])}),l=0,d=f?(y-u*b)/f:0;l0?w*d:0)+b,g[h]={data:o[h],index:l,value:w,startAngle:m,endAngle:v,padAngle:T};return g}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:hi(+o),s):t},s.sortValues=function(o){return arguments.length?(e=o,r=null,s):e},s.sort=function(o){return arguments.length?(r=o,e=null,s):r},s.startAngle=function(o){return arguments.length?(n=typeof o=="function"?o:hi(+o),s):n},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:hi(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:hi(+o),s):a},s}class vz{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function bz(t){return new vz(t,!0)}function xz(t){return new vz(t,!1)}function Au(){}function d4(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function f4(t){this._context=t}f4.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:d4(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:d4(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function N2(t){return new f4(t)}function Tz(t){this._context=t}Tz.prototype={areaStart:Au,areaEnd:Au,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:d4(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function W3e(t){return new Tz(t)}function wz(t){this._context=t}wz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:d4(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function U3e(t){return new wz(t)}function Cz(t,e){this._basis=new f4(t),this._beta=e}Cz.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],a=t[r]-n,s=e[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(n+l*a),this._beta*e[o]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const H3e=(function t(e){function r(n){return e===1?new f4(n):new Cz(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function p4(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function kA(t,e){this._context=t,this._k=(1-e)/6}kA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:p4(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:p4(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const kz=(function t(e){function r(n){return new kA(n,e)}return r.tension=function(n){return t(+n)},r})(0);function EA(t,e){this._context=t,this._k=(1-e)/6}EA.prototype={areaStart:Au,areaEnd:Au,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:p4(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Y3e=(function t(e){function r(n){return new EA(n,e)}return r.tension=function(n){return t(+n)},r})(0);function SA(t,e){this._context=t,this._k=(1-e)/6}SA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:p4(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const X3e=(function t(e){function r(n){return new SA(n,e)}return r.tension=function(n){return t(+n)},r})(0);function AA(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>Aa){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Aa){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/h,s=(s*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function Ez(t,e){this._context=t,this._alpha=e}Ez.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:AA(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Sz=(function t(e){function r(n){return e?new Ez(n,e):new kA(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function Az(t,e){this._context=t,this._alpha=e}Az.prototype={areaStart:Au,areaEnd:Au,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:AA(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const K3e=(function t(e){function r(n){return e?new Az(n,e):new EA(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function _z(t,e){this._context=t,this._alpha=e}_z.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:AA(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const j3e=(function t(e){function r(n){return e?new _z(n,e):new SA(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function Rz(t){this._context=t}Rz.prototype={areaStart:Au,areaEnd:Au,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Z3e(t){return new Rz(t)}function Lz(t){return t<0?-1:1}function Iz(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),o=(a*i+s*n)/(n+i);return(Lz(a)+Lz(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function Dz(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function _A(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-n)/3;t._context.bezierCurveTo(n+o,i+o*e,a-o,s-o*r,a,s)}function g4(t){this._context=t}g4.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:_A(this,this._t0,Dz(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,_A(this,Dz(this,r=Iz(this,t,e)),r);break;default:_A(this,this._t0,r=Iz(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function Mz(t){this._context=new Nz(t)}(Mz.prototype=Object.create(g4.prototype)).point=function(t,e){g4.prototype.point.call(this,e,t)};function Nz(t){this._context=t}Nz.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}};function Oz(t){return new g4(t)}function $z(t){return new Mz(t)}function Pz(t){this._context=t}Pz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=Bz(t),i=Bz(e),a=0,s=1;s=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function zz(t){return new m4(t,.5)}function Gz(t){return new m4(t,0)}function qz(t){return new m4(t,1)}function O2(t,e,r){this.k=t,this.x=e,this.y=r}O2.prototype={constructor:O2,scale:function(t){return t===1?this:new O2(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new O2(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},O2.prototype;var ys=x(t=>{var i;const{securityLevel:e}=Pe();let r=pt("body");if(e==="sandbox"){const s=((i=pt(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=pt(s.body)}return r.select(`#${t}`)},"selectSvgElement");function RA(t){return typeof t>"u"||t===null}x(RA,"isNothing");function Vz(t){return typeof t=="object"&&t!==null}x(Vz,"isObject");function Wz(t){return Array.isArray(t)?t:RA(t)?[]:[t]}x(Wz,"toArray");function Uz(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;r{e!==void 0&&(Iw[t]=e)},"addStylesForDiagram"),Rxe=Axe,M6={};Tw(M6,{clear:()=>In,getAccDescription:()=>Gn,getAccTitle:()=>Fn,getDiagramTitle:()=>Mn,setAccDescription:()=>zn,setAccTitle:()=>Dn,setDiagramTitle:()=>qn});var N6="",O6="",$6="",P6=T(t=>qr(t,lr()),"sanitizeText"),In=T(()=>{N6="",$6="",O6=""},"clear"),Dn=T(t=>{N6=P6(t).replace(/^\s+/g,"")},"setAccTitle"),Fn=T(()=>N6,"getAccTitle"),zn=T(t=>{$6=P6(t).replace(/\n\s+/g,` +`)},"setAccDescription"),Gn=T(()=>$6,"getAccDescription"),qn=T(t=>{O6=P6(t)},"setDiagramTitle"),Mn=T(()=>O6,"getDiagramTitle"),zB=ae,Lxe=y6,Pe=lr,B6=LB,GB=Cp,F6=T(t=>qr(t,Pe()),"sanitizeText"),z6=Ep,Ixe=T(()=>M6,"getCommonDb"),Dw={},Mw=T((t,e,r)=>{var n;Dw[t]&&zB.warn(`Diagram with id ${t} already registered. Overwriting.`),Dw[t]=e,r&&EB(t,r),_xe(t,e.styles),(n=e.injectUtils)==null||n.call(e,zB,Lxe,Pe,F6,z6,Ixe(),()=>{})},"registerDiagram"),G6=T(t=>{if(t in Dw)return Dw[t];throw new Dxe(t)},"getDiagram"),Dxe=(_m=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},T(_m,"DiagramNotFoundError"),_m);function Nw(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function Mxe(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function q6(t){let e,r,n;t.length!==2?(e=Nw,r=(o,l)=>Nw(t(o),l),n=(o,l)=>t(o)-l):(e=t===Nw||t===Mxe?t:Nxe,r=t,n=t);function i(o,l,u=0,h=o.length){if(u>>1;r(o[d],l)<0?u=d+1:h=d}while(u>>1;r(o[d],l)<=0?u=d+1:h=d}while(uu&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:i,center:s,right:a}}function Nxe(){return 0}function Oxe(t){return t===null?NaN:+t}const $xe=q6(Nw).right;q6(Oxe).center;class qB extends Map{constructor(e,r=Fxe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(VB(this,e))}has(e){return super.has(VB(this,e))}set(e,r){return super.set(Pxe(this,e),r)}delete(e){return super.delete(Bxe(this,e))}}function VB({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function Pxe({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function Bxe({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function Fxe(t){return t!==null&&typeof t=="object"?t.valueOf():t}const zxe=Math.sqrt(50),Gxe=Math.sqrt(10),qxe=Math.sqrt(2);function Ow(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=zxe?10:a>=Gxe?5:a>=qxe?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(t*u),l=Math.round(e*u),o/ue&&--l,u=-u):(u=Math.pow(10,i)*s,o=Math.round(t/u),l=Math.round(e/u),o*ue&&--l),l0))return[];if(t===e)return[t];const n=e=i))return[];const o=a-i+1,l=new Array(o);if(n)if(s<0)for(let u=0;u=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function Uxe(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function Hxe(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n+t(e)}function Zxe(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function Qxe(){return!this.__axis}function UB(t,e){var r=[],n=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===$w||t===Pw?-1:1,h=t===Pw||t===U6?"x":"y",d=t===$w||t===H6?Xxe:Kxe;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):Yxe),y=Math.max(a,0)+o,v=e.range(),x=+v[0]+l,b=+v[v.length-1]+l,w=(e.bandwidth?Zxe:jxe)(e.copy(),l),k=p.selection?p.selection():p,S=k.selectAll(".domain").data([null]),C=k.selectAll(".tick").data(g,e).order(),_=C.exit(),L=C.enter().append("g").attr("class","tick"),O=C.select("line"),M=C.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),C=C.merge(L),O=O.merge(L.append("line").attr("stroke","currentColor").attr(h+"2",u*a)),M=M.merge(L.append("text").attr("fill","currentColor").attr(h,u*y).attr("dy",t===$w?"0em":t===H6?"0.71em":"0.32em")),p!==k&&(S=S.transition(p),C=C.transition(p),O=O.transition(p),M=M.transition(p),_=_.transition(p).attr("opacity",WB).attr("transform",function(z){return isFinite(z=w(z))?d(z+l):this.getAttribute("transform")}),L.attr("opacity",WB).attr("transform",function(z){var F=this.parentNode.__axis;return d((F&&isFinite(F=F(z))?F:w(z))+l)})),_.remove(),S.attr("d",t===Pw||t===U6?s?"M"+u*s+","+x+"H"+l+"V"+b+"H"+u*s:"M"+l+","+x+"V"+b:s?"M"+x+","+u*s+"V"+l+"H"+b+"V"+u*s:"M"+x+","+l+"H"+b),C.attr("opacity",1).attr("transform",function(z){return d(w(z)+l)}),O.attr(h+"2",u*a),M.attr(h,u*y).text(m),k.filter(Qxe).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===U6?"start":t===Pw?"end":"middle"),k.each(function(){this.__axis=w})}return f.scale=function(p){return arguments.length?(e=p,f):e},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(a=s=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(s=+p,f):s},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function Jxe(t){return UB($w,t)}function eTe(t){return UB(H6,t)}var tTe={value:()=>{}};function HB(){for(var t=0,e=arguments.length,r={},n;t=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}Bw.prototype=HB.prototype={constructor:Bw,on:function(t,e){var r=this._,n=rTe(t+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a0)for(var r=new Array(i),n=0,i,a;n=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),XB.hasOwnProperty(e)?{space:XB[e],local:t}:t}function iTe(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Y6&&e.documentElement.namespaceURI===Y6?e.createElement(t):e.createElementNS(r,t)}}function aTe(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function KB(t){var e=Fw(t);return(e.local?aTe:iTe)(e)}function sTe(){}function X6(t){return t==null?sTe:function(){return this.querySelector(t)}}function oTe(t){typeof t!="function"&&(t=X6(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=b&&(b=x+1);!(k=y[b])&&++b=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function DTe(t){t||(t=MTe);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}function NTe(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function OTe(){return Array.from(this)}function $Te(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?YTe:typeof e=="function"?KTe:XTe)(t,e,r??"")):Sp(this.node(),t)}function Sp(t,e){return t.style.getPropertyValue(e)||eF(t).getComputedStyle(t,null).getPropertyValue(e)}function ZTe(t){return function(){delete this[t]}}function QTe(t,e){return function(){this[t]=e}}function JTe(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function ewe(t,e){return arguments.length>1?this.each((e==null?ZTe:typeof e=="function"?JTe:QTe)(t,e)):this.node()[t]}function tF(t){return t.trim().split(/^|\s+/)}function K6(t){return t.classList||new rF(t)}function rF(t){this._node=t,this._names=tF(t.getAttribute("class")||"")}rF.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function nF(t,e){for(var r=K6(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function _we(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Vw(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Vw(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Pwe.exec(t))?new Ea(e[1],e[2],e[3],1):(e=Bwe.exec(t))?new Ea(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Fwe.exec(t))?Vw(e[1],e[2],e[3],e[4]):(e=zwe.exec(t))?Vw(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Gwe.exec(t))?pF(e[1],e[2]/100,e[3]/100,1):(e=qwe.exec(t))?pF(e[1],e[2]/100,e[3]/100,e[4]):oF.hasOwnProperty(t)?uF(oF[t]):t==="transparent"?new Ea(NaN,NaN,NaN,0):null}function uF(t){return new Ea(t>>16&255,t>>8&255,t&255,1)}function Vw(t,e,r,n){return n<=0&&(t=e=r=NaN),new Ea(t,e,r,n)}function hF(t){return t instanceof Uh||(t=Hh(t)),t?(t=t.rgb(),new Ea(t.r,t.g,t.b,t.opacity)):new Ea}function j6(t,e,r,n){return arguments.length===1?hF(t):new Ea(t,e,r,n??1)}function Ea(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}p2(Ea,j6,Gw(Uh,{brighter(t){return t=t==null?qw:Math.pow(qw,t),new Ea(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?g2:Math.pow(g2,t),new Ea(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ea(Yh(this.r),Yh(this.g),Yh(this.b),Ww(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:dF,formatHex:dF,formatHex8:Uwe,formatRgb:fF,toString:fF}));function dF(){return`#${Xh(this.r)}${Xh(this.g)}${Xh(this.b)}`}function Uwe(){return`#${Xh(this.r)}${Xh(this.g)}${Xh(this.b)}${Xh((isNaN(this.opacity)?1:this.opacity)*255)}`}function fF(){const t=Ww(this.opacity);return`${t===1?"rgb(":"rgba("}${Yh(this.r)}, ${Yh(this.g)}, ${Yh(this.b)}${t===1?")":`, ${t})`}`}function Ww(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Yh(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Xh(t){return t=Yh(t),(t<16?"0":"")+t.toString(16)}function pF(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new _o(t,e,r,n)}function gF(t){if(t instanceof _o)return new _o(t.h,t.s,t.l,t.opacity);if(t instanceof Uh||(t=Hh(t)),!t)return new _o;if(t instanceof _o)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(e===a?s=(r-n)/o+(r0&&l<1?0:s,new _o(s,o,l,t.opacity)}function Hwe(t,e,r,n){return arguments.length===1?gF(t):new _o(t,e,r,n??1)}function _o(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}p2(_o,Hwe,Gw(Uh,{brighter(t){return t=t==null?qw:Math.pow(qw,t),new _o(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?g2:Math.pow(g2,t),new _o(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Ea(Z6(t>=240?t-240:t+120,i,n),Z6(t,i,n),Z6(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new _o(mF(this.h),Uw(this.s),Uw(this.l),Ww(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ww(this.opacity);return`${t===1?"hsl(":"hsla("}${mF(this.h)}, ${Uw(this.s)*100}%, ${Uw(this.l)*100}%${t===1?")":`, ${t})`}`}}));function mF(t){return t=(t||0)%360,t<0?t+360:t}function Uw(t){return Math.max(0,Math.min(1,t||0))}function Z6(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const Ywe=Math.PI/180,Xwe=180/Math.PI,Hw=18,yF=.96422,vF=1,bF=.82521,xF=4/29,_p=6/29,TF=3*_p*_p,Kwe=_p*_p*_p;function wF(t){if(t instanceof fl)return new fl(t.l,t.a,t.b,t.opacity);if(t instanceof dc)return CF(t);t instanceof Ea||(t=hF(t));var e=tA(t.r),r=tA(t.g),n=tA(t.b),i=Q6((.2225045*e+.7168786*r+.0606169*n)/vF),a,s;return e===r&&r===n?a=s=i:(a=Q6((.4360747*e+.3850649*r+.1430804*n)/yF),s=Q6((.0139322*e+.0971045*r+.7141733*n)/bF)),new fl(116*i-16,500*(a-i),200*(i-s),t.opacity)}function jwe(t,e,r,n){return arguments.length===1?wF(t):new fl(t,e,r,n??1)}function fl(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}p2(fl,jwe,Gw(Uh,{brighter(t){return new fl(this.l+Hw*(t??1),this.a,this.b,this.opacity)},darker(t){return new fl(this.l-Hw*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=yF*J6(e),t=vF*J6(t),r=bF*J6(r),new Ea(eA(3.1338561*e-1.6168667*t-.4906146*r),eA(-.9787684*e+1.9161415*t+.033454*r),eA(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function Q6(t){return t>Kwe?Math.pow(t,1/3):t/TF+xF}function J6(t){return t>_p?t*t*t:TF*(t-xF)}function eA(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function tA(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Zwe(t){if(t instanceof dc)return new dc(t.h,t.c,t.l,t.opacity);if(t instanceof fl||(t=wF(t)),t.a===0&&t.b===0)return new dc(NaN,0()=>t;function kF(t,e){return function(r){return t+r*e}}function Qwe(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function Jwe(t,e){var r=e-t;return r?kF(t,r>180||r<-180?r-360*Math.round(r/360):r):Yw(isNaN(t)?e:t)}function e4e(t){return(t=+t)==1?y2:function(e,r){return r-e?Qwe(e,r,t):Yw(isNaN(e)?r:e)}}function y2(t,e){var r=e-t;return r?kF(t,r):Yw(isNaN(t)?e:t)}const Xw=(function t(e){var r=e4e(e);function n(i,a){var s=r((i=j6(i)).r,(a=j6(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=y2(i.opacity,a.opacity);return function(h){return i.r=s(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n})(1);function t4e(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;ir&&(a=e.slice(r,a),o[s]?o[s]+=a:o[++s]=a),(n=n[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:Ro(n,i)})),r=iA.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:Ro(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function o(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:Ro(u,h)}):h&&d.push(i(d)+"skewX("+h+n)}function l(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:Ro(u,d)},{i:m-2,x:Ro(h,f)})}else(d!==1||f!==1)&&p.push(i(p)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=t(u),h=t(h),a(u.translateX,u.translateY,h.translateX,h.translateY,d,f),s(u.rotate,h.rotate,d,f),o(u.skewX,h.skewX,d,f),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(p){for(var g=-1,m=f.length,y;++g=0&&t._call.call(void 0,e),t=t._next;--Rp}function DF(){Kh=(Zw=T2.now())+Qw,Rp=v2=0;try{m4e()}finally{Rp=0,v4e(),Kh=0}}function y4e(){var t=T2.now(),e=t-Zw;e>RF&&(Qw-=e,Zw=t)}function v4e(){for(var t,e=jw,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:jw=r);x2=t,lA(n)}function lA(t){if(!Rp){v2&&(v2=clearTimeout(v2));var e=t-Kh;e>24?(t<1/0&&(v2=setTimeout(DF,t-T2.now()-Qw)),b2&&(b2=clearInterval(b2))):(b2||(Zw=T2.now(),b2=setInterval(y4e,RF)),Rp=1,LF(DF))}}function MF(t,e,r){var n=new Jw;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var b4e=HB("start","end","cancel","interrupt"),x4e=[],NF=0,OF=1,cA=2,e4=3,$F=4,uA=5,t4=6;function r4(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;T4e(t,r,{name:e,index:n,group:i,on:b4e,tween:x4e,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:NF})}function hA(t,e){var r=Lo(t,e);if(r.state>NF)throw new Error("too late; already scheduled");return r}function pl(t,e){var r=Lo(t,e);if(r.state>e4)throw new Error("too late; already running");return r}function Lo(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function T4e(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=IF(a,0,r.time);function a(u){r.state=OF,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var h,d,f,p;if(r.state!==OF)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===e4)return MF(s);p.state===$F?(p.state=t4,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hcA&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function Q4e(t,e,r){var n,i,a=Z4e(e)?hA:pl;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function J4e(t,e){var r=this._id;return arguments.length<2?Lo(this.node(),r).on.on(t):this.each(Q4e(r,t,e))}function eCe(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function tCe(){return this.on("end.remove",eCe(this._id))}function rCe(t){var e=this._name,r=this._id;typeof t!="function"&&(t=X6(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s=0))throw new Error(`invalid digits: ${t}`);if(e>15)return zF;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;ijh)if(!(Math.abs(d*l-u*h)>jh)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-s,g=i-o,m=l*l+u*u,y=p*p+g*g,v=Math.sqrt(m),x=Math.sqrt(f),b=a*Math.tan((fA-Math.acos((m+f-y)/(2*v*x)))/2),w=b/x,k=b/v;Math.abs(w-1)>jh&&this._append`L${e+w*h},${r+w*d}`,this._append`A${a},${a},0,0,${+(d*p>h*g)},${this._x1=e+k*l},${this._y1=r+k*u}`}}arc(e,r,n,i,a,s){if(e=+e,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),u=e+o,h=r+l,d=1^s,f=s?i-a:a-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>jh||Math.abs(this._y1-h)>jh)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%pA+pA),f>ACe?this._append`A${n},${n},0,1,${d},${e-o},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>jh&&this._append`A${n},${n},0,${+(f>=fA)},${d},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function LCe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function n4(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function Lp(t){return t=n4(Math.abs(t)),t?t[1]:NaN}function ICe(t,e){return function(r,n){for(var i=r.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function DCe(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var MCe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i4(t){if(!(e=MCe.exec(t)))throw new Error("invalid format: "+t);var e;return new gA({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}i4.prototype=gA.prototype;function gA(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}gA.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function NCe(t){e:for(var e=t.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var a4;function OCe(t,e){var r=n4(t,e);if(!r)return a4=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(a4=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+n4(t,Math.max(0,e+a-1))[0]}function GF(t,e){var r=n4(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const qF={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:LCe,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>GF(t*100,e),r:GF,s:OCe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function VF(t){return t}var WF=Array.prototype.map,UF=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function $Ce(t){var e=t.grouping===void 0||t.thousands===void 0?VF:ICe(WF.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?VF:DCe(WF.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d,f){d=i4(d);var p=d.fill,g=d.align,m=d.sign,y=d.symbol,v=d.zero,x=d.width,b=d.comma,w=d.precision,k=d.trim,S=d.type;S==="n"?(b=!0,S="g"):qF[S]||(w===void 0&&(w=12),k=!0,S="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var C=(f&&f.prefix!==void 0?f.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),_=(y==="$"?n:/[%p]/.test(S)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),L=qF[S],O=/[defgprs%]/.test(S);w=w===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function M(z){var F=C,A=_,R,N,D;if(S==="c")A=L(z)+A,z="";else{z=+z;var I=z<0||1/z<0;if(z=isNaN(z)?l:L(Math.abs(z),w),k&&(z=NCe(z)),I&&+z==0&&m!=="+"&&(I=!1),F=(I?m==="("?m:o:m==="-"||m==="("?"":m)+F,A=(S==="s"&&!isNaN(z)&&a4!==void 0?UF[8+a4/3]:"")+A+(I&&m==="("?")":""),O){for(R=-1,N=z.length;++RD||D>57){A=(D===46?i+z.slice(R+1):z.slice(R))+A,z=z.slice(0,R);break}}}b&&!v&&(z=e(z,1/0));var $=F.length+z.length+A.length,B=$>1)+F+z+A+B.slice($);break;default:z=B+F+z+A;break}return a(z)}return M.toString=function(){return d+""},M}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(Lp(f)/3)))*3,g=Math.pow(10,-p),m=u((d=i4(d),d.type="f",d),{suffix:UF[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var s4,Zh,HF;PCe({thousands:",",grouping:[3],currency:["$",""]});function PCe(t){return s4=$Ce(t),Zh=s4.format,HF=s4.formatPrefix,s4}function BCe(t){return Math.max(0,-Lp(Math.abs(t)))}function FCe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Lp(e)/3)))*3-Lp(Math.abs(t)))}function zCe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Lp(e)-Lp(t))+1}function GCe(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function qCe(){return this.eachAfter(GCe)}function VCe(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function WCe(t,e){for(var r=this,n=[r],i,a,s=-1;r=n.pop();)if(t.call(e,r,++s,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function UCe(t,e){for(var r=this,n=[r],i=[],a,s,o,l=-1;r=n.pop();)if(i.push(r),a=r.children)for(s=0,o=a.length;s=0;)r+=n[i].value;e.value=r})}function XCe(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function KCe(t){for(var e=this,r=jCe(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n}function jCe(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}function ZCe(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function QCe(){return Array.from(this)}function JCe(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function e5e(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*t5e(){var t=this,e,r=[t],n,i,a;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,a=n.length;i=0;--o)i.push(a=s[o]=new o4(s[o])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(s5e)}function r5e(){return mA(this).eachBefore(a5e)}function n5e(t){return t.children}function i5e(t){return Array.isArray(t)?t[1]:null}function a5e(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function s5e(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function o4(t){this.data=t,this.depth=this.height=0,this.parent=null}o4.prototype=mA.prototype={constructor:o4,count:qCe,each:VCe,eachAfter:UCe,eachBefore:WCe,find:HCe,sum:YCe,sort:XCe,path:KCe,ancestors:ZCe,descendants:QCe,leaves:JCe,links:e5e,copy:r5e,[Symbol.iterator]:t5e};function o5e(t){if(typeof t!="function")throw new Error;return t}function w2(){return 0}function C2(t){return function(){return t}}function l5e(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function c5e(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(n-e)/t.value;++ox&&(x=u),S=y*y*k,b=Math.max(x/S,S/v),b>w){y-=u;break}w=b}s.push(l={value:y,dice:p1?n:1)},r})(h5e);function p5e(){var t=f5e,e=!1,r=1,n=1,i=[0],a=w2,s=w2,o=w2,l=w2,u=w2;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(l5e),f}function d(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,y=f.x1-p,v=f.y1-p;ye&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function v5e(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?b5e:v5e,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(l||(l=o(t.map(n),e,r)))(n(s(f)))}return d.invert=function(f){return s(i((u||(u=o(e,t.map(n),Ro)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,m5e),h()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),h()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),r=l4e,h()},d.clamp=function(f){return arguments.length?(s=f?!0:Ip,h()):s!==Ip},d.interpolate=function(f){return arguments.length?(r=f,h()):r},d.unknown=function(f){return arguments.length?(a=f,d):a},function(f,p){return n=f,i=p,h()}}function jF(){return x5e()(Ip,Ip)}function T5e(t,e,r,n){var i=W6(t,e,r),a;switch(n=i4(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=FCe(i,s))&&(n.precision=a),HF(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=zCe(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=BCe(i))&&(n.precision=a-(n.type==="%")*2);break}}return Zh(n)}function w5e(t){var e=t.domain;return t.ticks=function(r){var n=e();return Vxe(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return T5e(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,s=n[i],o=n[a],l,u,h=10;for(o0;){if(u=V6(s,o,r),u===l)return n[i]=s,n[a]=o,e(n);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return t},t}function Dp(){var t=jF();return t.copy=function(){return KF(t,Dp())},l4.apply(t,arguments),w5e(t)}function C5e(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a0))return l;let u;do l.push(u=new Date(+a)),e(a,o),t(a);while(uNi(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!a(s););else for(;--o>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(bA.setTime(+a),xA.setTime(+s),t(bA),t(xA),Math.floor(r(bA,xA))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const Mp=Ni(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Mp.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Ni(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):Mp),Mp.range;const gc=1e3,ao=gc*60,mc=ao*60,yc=mc*24,TA=yc*7,ZF=yc*30,wA=yc*365,Su=Ni(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*gc)},(t,e)=>(e-t)/gc,t=>t.getUTCSeconds());Su.range;const k2=Ni(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*gc)},(t,e)=>{t.setTime(+t+e*ao)},(t,e)=>(e-t)/ao,t=>t.getMinutes());k2.range,Ni(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ao)},(t,e)=>(e-t)/ao,t=>t.getUTCMinutes()).range;const E2=Ni(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*gc-t.getMinutes()*ao)},(t,e)=>{t.setTime(+t+e*mc)},(t,e)=>(e-t)/mc,t=>t.getHours());E2.range,Ni(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*mc)},(t,e)=>(e-t)/mc,t=>t.getUTCHours()).range;const Jh=Ni(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ao)/yc,t=>t.getDate()-1);Jh.range;const CA=Ni(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yc,t=>t.getUTCDate()-1);CA.range,Ni(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yc,t=>Math.floor(t/yc)).range;function ed(t){return Ni(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*ao)/TA)}const S2=ed(0),A2=ed(1),QF=ed(2),JF=ed(3),td=ed(4),ez=ed(5),tz=ed(6);S2.range,A2.range,QF.range,JF.range,td.range,ez.range,tz.range;function rd(t){return Ni(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/TA)}const rz=rd(0),c4=rd(1),k5e=rd(2),E5e=rd(3),Np=rd(4),S5e=rd(5),A5e=rd(6);rz.range,c4.range,k5e.range,E5e.range,Np.range,S5e.range,A5e.range;const _2=Ni(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());_2.range,Ni(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()).range;const vc=Ni(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());vc.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ni(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)}),vc.range;const nd=Ni(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());nd.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ni(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)}),nd.range;function _5e(t,e,r,n,i,a){const s=[[Su,1,gc],[Su,5,5*gc],[Su,15,15*gc],[Su,30,30*gc],[a,1,ao],[a,5,5*ao],[a,15,15*ao],[a,30,30*ao],[i,1,mc],[i,3,3*mc],[i,6,6*mc],[i,12,12*mc],[n,1,yc],[n,2,2*yc],[r,1,TA],[e,1,ZF],[e,3,3*ZF],[t,1,wA]];function o(u,h,d){const f=hy).right(s,f);if(p===s.length)return t.every(W6(u/wA,h/wA,d));if(p===0)return Mp.every(Math.max(W6(u,h,d),1));const[g,m]=s[f/s[p-1][2]53)return null;"w"in ne||(ne.w=1),"Z"in ne?(fe=EA(R2(ne.y,0,1)),_e=fe.getUTCDay(),fe=_e>4||_e===0?c4.ceil(fe):c4(fe),fe=CA.offset(fe,(ne.V-1)*7),ne.y=fe.getUTCFullYear(),ne.m=fe.getUTCMonth(),ne.d=fe.getUTCDate()+(ne.w+6)%7):(fe=kA(R2(ne.y,0,1)),_e=fe.getDay(),fe=_e>4||_e===0?A2.ceil(fe):A2(fe),fe=Jh.offset(fe,(ne.V-1)*7),ne.y=fe.getFullYear(),ne.m=fe.getMonth(),ne.d=fe.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),_e="Z"in ne?EA(R2(ne.y,0,1)).getUTCDay():kA(R2(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(_e+5)%7:ne.w+ne.U*7-(_e+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,EA(ne)):kA(ne)}}function _(J,Z,ee,ne){for(var ue=0,fe=Z.length,_e=ee.length,Ae,Ne;ue=_e)return-1;if(Ae=Z.charCodeAt(ue++),Ae===37){if(Ae=Z.charAt(ue++),Ne=k[Ae in nz?Z.charAt(ue++):Ae],!Ne||(ne=Ne(J,ee,ne))<0)return-1}else if(Ae!=ee.charCodeAt(ne++))return-1}return ne}function L(J,Z,ee){var ne=u.exec(Z.slice(ee));return ne?(J.p=h.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function O(J,Z,ee){var ne=p.exec(Z.slice(ee));return ne?(J.w=g.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function M(J,Z,ee){var ne=d.exec(Z.slice(ee));return ne?(J.w=f.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function z(J,Z,ee){var ne=v.exec(Z.slice(ee));return ne?(J.m=x.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function F(J,Z,ee){var ne=m.exec(Z.slice(ee));return ne?(J.m=y.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function A(J,Z,ee){return _(J,e,Z,ee)}function R(J,Z,ee){return _(J,r,Z,ee)}function N(J,Z,ee){return _(J,n,Z,ee)}function D(J){return s[J.getDay()]}function I(J){return a[J.getDay()]}function $(J){return l[J.getMonth()]}function B(J){return o[J.getMonth()]}function P(J){return i[+(J.getHours()>=12)]}function G(J){return 1+~~(J.getMonth()/3)}function V(J){return s[J.getUTCDay()]}function X(J){return a[J.getUTCDay()]}function W(J){return l[J.getUTCMonth()]}function ie(J){return o[J.getUTCMonth()]}function K(J){return i[+(J.getUTCHours()>=12)]}function se(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var Z=S(J+="",b);return Z.toString=function(){return J},Z},parse:function(J){var Z=C(J+="",!1);return Z.toString=function(){return J},Z},utcFormat:function(J){var Z=S(J+="",w);return Z.toString=function(){return J},Z},utcParse:function(J){var Z=C(J+="",!0);return Z.toString=function(){return J},Z}}}var nz={"-":"",_:" ",0:"0"},ji=/^\s*\d+/,D5e=/^%/,M5e=/[\\^$*+?|[\]().{}]/g;function Jr(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function O5e(t,e,r){var n=ji.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function $5e(t,e,r){var n=ji.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function P5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function B5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function F5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function iz(t,e,r){var n=ji.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function az(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function z5e(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function G5e(t,e,r){var n=ji.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function q5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function sz(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function V5e(t,e,r){var n=ji.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function oz(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function W5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function U5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function H5e(t,e,r){var n=ji.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Y5e(t,e,r){var n=ji.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function X5e(t,e,r){var n=D5e.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function K5e(t,e,r){var n=ji.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function j5e(t,e,r){var n=ji.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function lz(t,e){return Jr(t.getDate(),e,2)}function Z5e(t,e){return Jr(t.getHours(),e,2)}function Q5e(t,e){return Jr(t.getHours()%12||12,e,2)}function J5e(t,e){return Jr(1+Jh.count(vc(t),t),e,3)}function cz(t,e){return Jr(t.getMilliseconds(),e,3)}function e3e(t,e){return cz(t,e)+"000"}function t3e(t,e){return Jr(t.getMonth()+1,e,2)}function r3e(t,e){return Jr(t.getMinutes(),e,2)}function n3e(t,e){return Jr(t.getSeconds(),e,2)}function i3e(t){var e=t.getDay();return e===0?7:e}function a3e(t,e){return Jr(S2.count(vc(t)-1,t),e,2)}function uz(t){var e=t.getDay();return e>=4||e===0?td(t):td.ceil(t)}function s3e(t,e){return t=uz(t),Jr(td.count(vc(t),t)+(vc(t).getDay()===4),e,2)}function o3e(t){return t.getDay()}function l3e(t,e){return Jr(A2.count(vc(t)-1,t),e,2)}function c3e(t,e){return Jr(t.getFullYear()%100,e,2)}function u3e(t,e){return t=uz(t),Jr(t.getFullYear()%100,e,2)}function h3e(t,e){return Jr(t.getFullYear()%1e4,e,4)}function d3e(t,e){var r=t.getDay();return t=r>=4||r===0?td(t):td.ceil(t),Jr(t.getFullYear()%1e4,e,4)}function f3e(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Jr(e/60|0,"0",2)+Jr(e%60,"0",2)}function hz(t,e){return Jr(t.getUTCDate(),e,2)}function p3e(t,e){return Jr(t.getUTCHours(),e,2)}function g3e(t,e){return Jr(t.getUTCHours()%12||12,e,2)}function m3e(t,e){return Jr(1+CA.count(nd(t),t),e,3)}function dz(t,e){return Jr(t.getUTCMilliseconds(),e,3)}function y3e(t,e){return dz(t,e)+"000"}function v3e(t,e){return Jr(t.getUTCMonth()+1,e,2)}function b3e(t,e){return Jr(t.getUTCMinutes(),e,2)}function x3e(t,e){return Jr(t.getUTCSeconds(),e,2)}function T3e(t){var e=t.getUTCDay();return e===0?7:e}function w3e(t,e){return Jr(rz.count(nd(t)-1,t),e,2)}function fz(t){var e=t.getUTCDay();return e>=4||e===0?Np(t):Np.ceil(t)}function C3e(t,e){return t=fz(t),Jr(Np.count(nd(t),t)+(nd(t).getUTCDay()===4),e,2)}function k3e(t){return t.getUTCDay()}function E3e(t,e){return Jr(c4.count(nd(t)-1,t),e,2)}function S3e(t,e){return Jr(t.getUTCFullYear()%100,e,2)}function A3e(t,e){return t=fz(t),Jr(t.getUTCFullYear()%100,e,2)}function _3e(t,e){return Jr(t.getUTCFullYear()%1e4,e,4)}function R3e(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Np(t):Np.ceil(t),Jr(t.getUTCFullYear()%1e4,e,4)}function L3e(){return"+0000"}function pz(){return"%"}function gz(t){return+t}function mz(t){return Math.floor(+t/1e3)}var Op,u4;I3e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function I3e(t){return Op=I5e(t),u4=Op.format,Op.parse,Op.utcFormat,Op.utcParse,Op}function D3e(t){return new Date(t)}function M3e(t){return t instanceof Date?+t:+new Date(+t)}function yz(t,e,r,n,i,a,s,o,l,u){var h=jF(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),x=u("%b %d"),b=u("%B"),w=u("%Y");function k(S){return(l(S)1?0:t<-1?D2:Math.acos(t)}function bz(t){return t>=1?h4:t<=-1?-h4:Math.asin(t)}function xz(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new RCe(e)}function F3e(t){return t.innerRadius}function z3e(t){return t.outerRadius}function G3e(t){return t.startAngle}function q3e(t){return t.endAngle}function V3e(t){return t&&t.padAngle}function W3e(t,e,r,n,i,a,s,o){var l=r-t,u=n-e,h=s-i,d=o-a,f=d*l-h*u;if(!(f*fA*A+R*R&&(_=O,L=M),{cx:_,cy:L,x01:-h,y01:-d,x11:_*(i/k-1),y11:L*(i/k-1)}}function Pp(){var t=F3e,e=z3e,r=hi(0),n=null,i=G3e,a=q3e,s=V3e,o=null,l=xz(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-h4,m=a.apply(this,arguments)-h4,y=vz(m-g),v=m>g;if(o||(o=h=l()),pAa))o.moveTo(0,0);else if(y>d4-Aa)o.moveTo(p*id(g),p*gl(g)),o.arc(0,0,p,g,m,!v),f>Aa&&(o.moveTo(f*id(m),f*gl(m)),o.arc(0,0,f,m,g,v));else{var x=g,b=m,w=g,k=m,S=y,C=y,_=s.apply(this,arguments)/2,L=_>Aa&&(n?+n.apply(this,arguments):$p(f*f+p*p)),O=SA(vz(p-f)/2,+r.apply(this,arguments)),M=O,z=O,F,A;if(L>Aa){var R=bz(L/f*gl(_)),N=bz(L/p*gl(_));(S-=R*2)>Aa?(R*=v?1:-1,w+=R,k-=R):(S=0,w=k=(g+m)/2),(C-=N*2)>Aa?(N*=v?1:-1,x+=N,b-=N):(C=0,x=b=(g+m)/2)}var D=p*id(x),I=p*gl(x),$=f*id(k),B=f*gl(k);if(O>Aa){var P=p*id(b),G=p*gl(b),V=f*id(w),X=f*gl(w),W;if(yAa?z>Aa?(F=f4(V,X,D,I,p,z,v),A=f4(P,G,$,B,p,z,v),o.moveTo(F.cx+F.x01,F.cy+F.y01),zAa)||!(S>Aa)?o.lineTo($,B):M>Aa?(F=f4($,B,P,G,f,-M,v),A=f4(D,I,V,X,f,-M,v),o.lineTo(F.cx+F.x01,F.cy+F.y01),Mt?1:e>=t?0:NaN}function X3e(t){return t}function K3e(){var t=X3e,e=Y3e,r=null,n=hi(0),i=hi(d4),a=hi(0);function s(o){var l,u=(o=Tz(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(d4,Math.max(-d4,i.apply(this,arguments)-m)),v,x=Math.min(Math.abs(y)/u,a.apply(this,arguments)),b=x*(y<0?-1:1),w;for(l=0;l0&&(f+=w);for(e!=null?p.sort(function(k,S){return e(g[k],g[S])}):r!=null&&p.sort(function(k,S){return r(o[k],o[S])}),l=0,d=f?(y-u*b)/f:0;l0?w*d:0)+b,g[h]={data:o[h],index:l,value:w,startAngle:m,endAngle:v,padAngle:x};return g}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:hi(+o),s):t},s.sortValues=function(o){return arguments.length?(e=o,r=null,s):e},s.sort=function(o){return arguments.length?(r=o,e=null,s):r},s.startAngle=function(o){return arguments.length?(n=typeof o=="function"?o:hi(+o),s):n},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:hi(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:hi(+o),s):a},s}class Cz{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function kz(t){return new Cz(t,!0)}function Ez(t){return new Cz(t,!1)}function Au(){}function p4(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function g4(t){this._context=t}g4.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:p4(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:p4(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function O2(t){return new g4(t)}function Sz(t){this._context=t}Sz.prototype={areaStart:Au,areaEnd:Au,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:p4(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function j3e(t){return new Sz(t)}function Az(t){this._context=t}Az.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:p4(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Z3e(t){return new Az(t)}function _z(t,e){this._basis=new g4(t),this._beta=e}_z.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],a=t[r]-n,s=e[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(n+l*a),this._beta*e[o]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Q3e=(function t(e){function r(n){return e===1?new g4(n):new _z(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function m4(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function AA(t,e){this._context=t,this._k=(1-e)/6}AA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:m4(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:m4(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Rz=(function t(e){function r(n){return new AA(n,e)}return r.tension=function(n){return t(+n)},r})(0);function _A(t,e){this._context=t,this._k=(1-e)/6}_A.prototype={areaStart:Au,areaEnd:Au,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:m4(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const J3e=(function t(e){function r(n){return new _A(n,e)}return r.tension=function(n){return t(+n)},r})(0);function RA(t,e){this._context=t,this._k=(1-e)/6}RA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:m4(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const eke=(function t(e){function r(n){return new RA(n,e)}return r.tension=function(n){return t(+n)},r})(0);function LA(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>Aa){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Aa){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/h,s=(s*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function Lz(t,e){this._context=t,this._alpha=e}Lz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:LA(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Iz=(function t(e){function r(n){return e?new Lz(n,e):new AA(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function Dz(t,e){this._context=t,this._alpha=e}Dz.prototype={areaStart:Au,areaEnd:Au,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:LA(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const tke=(function t(e){function r(n){return e?new Dz(n,e):new _A(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function Mz(t,e){this._context=t,this._alpha=e}Mz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:LA(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const rke=(function t(e){function r(n){return e?new Mz(n,e):new RA(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function Nz(t){this._context=t}Nz.prototype={areaStart:Au,areaEnd:Au,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function nke(t){return new Nz(t)}function Oz(t){return t<0?-1:1}function $z(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),o=(a*i+s*n)/(n+i);return(Oz(a)+Oz(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function Pz(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function IA(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-n)/3;t._context.bezierCurveTo(n+o,i+o*e,a-o,s-o*r,a,s)}function y4(t){this._context=t}y4.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:IA(this,this._t0,Pz(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,IA(this,Pz(this,r=$z(this,t,e)),r);break;default:IA(this,this._t0,r=$z(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function Bz(t){this._context=new Fz(t)}(Bz.prototype=Object.create(y4.prototype)).point=function(t,e){y4.prototype.point.call(this,e,t)};function Fz(t){this._context=t}Fz.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}};function zz(t){return new y4(t)}function Gz(t){return new Bz(t)}function qz(t){this._context=t}qz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=Vz(t),i=Vz(e),a=0,s=1;s=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function Uz(t){return new v4(t,.5)}function Hz(t){return new v4(t,0)}function Yz(t){return new v4(t,1)}function $2(t,e,r){this.k=t,this.x=e,this.y=r}$2.prototype={constructor:$2,scale:function(t){return t===1?this:new $2(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new $2(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},$2.prototype;var ys=T(t=>{var i;const{securityLevel:e}=Pe();let r=pt("body");if(e==="sandbox"){const s=((i=pt(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=pt(s.body)}return r.select(`#${t}`)},"selectSvgElement");function DA(t){return typeof t>"u"||t===null}T(DA,"isNothing");function Xz(t){return typeof t=="object"&&t!==null}T(Xz,"isObject");function Kz(t){return Array.isArray(t)?t:DA(t)?[]:[t]}T(Kz,"toArray");function jz(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;ro&&(a=" ... ",e=n-o+a.length),r-n>o&&(s=" ...",r=n+o-s.length),{str:a+t.slice(e,r).replace(/\t/g,"→")+s,pos:n-e+a.length}}x(y4,"getLine");function v4(t,e){return Oi.repeat(" ",e-t.length)+t}x(v4,"padStart");function Xz(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],a,s=-1;a=r.exec(t.buffer);)i.push(a.index),n.push(a.index+a[0].length),t.position<=a.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var o="",l,u,h=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+h+3);for(l=1;l<=e.linesBefore&&!(s-l<0);l++)u=y4(t.buffer,n[s-l],i[s-l],t.position-(n[s]-n[s-l]),d),o=Oi.repeat(" ",e.indent)+v4((t.line-l+1).toString(),h)+" | "+u.str+` -`+o;for(u=y4(t.buffer,n[s],i[s],t.position,d),o+=Oi.repeat(" ",e.indent)+v4((t.line+1).toString(),h)+" | "+u.str+` +`+t.mark.snippet),n+" "+r):n}T(MA,"formatError");function Bp(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=MA(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}T(Bp,"YAMLException$1"),Bp.prototype=Object.create(Error.prototype),Bp.prototype.constructor=Bp,Bp.prototype.toString=T(function(e){return this.name+": "+MA(this,e)},"toString");var vs=Bp;function b4(t,e,r,n,i){var a="",s="",o=Math.floor(i/2)-1;return n-e>o&&(a=" ... ",e=n-o+a.length),r-n>o&&(s=" ...",r=n+o-s.length),{str:a+t.slice(e,r).replace(/\t/g,"→")+s,pos:n-e+a.length}}T(b4,"getLine");function x4(t,e){return Oi.repeat(" ",e-t.length)+t}T(x4,"padStart");function Jz(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],a,s=-1;a=r.exec(t.buffer);)i.push(a.index),n.push(a.index+a[0].length),t.position<=a.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var o="",l,u,h=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+h+3);for(l=1;l<=e.linesBefore&&!(s-l<0);l++)u=b4(t.buffer,n[s-l],i[s-l],t.position-(n[s]-n[s-l]),d),o=Oi.repeat(" ",e.indent)+x4((t.line-l+1).toString(),h)+" | "+u.str+` +`+o;for(u=b4(t.buffer,n[s],i[s],t.position,d),o+=Oi.repeat(" ",e.indent)+x4((t.line+1).toString(),h)+" | "+u.str+` `,o+=Oi.repeat("-",e.indent+h+3+u.pos)+`^ -`,l=1;l<=e.linesAfter&&!(s+l>=i.length);l++)u=y4(t.buffer,n[s+l],i[s+l],t.position-(n[s]-n[s+l]),d),o+=Oi.repeat(" ",e.indent)+v4((t.line+l+1).toString(),h)+" | "+u.str+` -`;return o.replace(/\n$/,"")}x(Xz,"makeSnippet");var ike=Xz,ake=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ske=["scalar","sequence","mapping"];function Kz(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}x(Kz,"compileStyleAliases");function jz(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(ake.indexOf(r)===-1)throw new vs('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=Kz(e.styleAliases||null),ske.indexOf(this.kind)===-1)throw new vs('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}x(jz,"Type$1");var _a=jz;function IA(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(a,s){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=s)}),r[i]=n}),r}x(IA,"compileList");function Zz(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(x(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:x(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:x(function(t){return t.toString(10)},"decimal"),hexadecimal:x(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),gke=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function uG(t){return!(t===null||!gke.test(t)||t[t.length-1]==="_")}x(uG,"resolveYamlFloat");function hG(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}x(hG,"constructYamlFloat");var mke=/^[-+]?[0-9]+e/;function dG(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Oi.isNegativeZero(t))return"-0.0";return r=t.toString(10),mke.test(r)?r.replace("e",".e"):r}x(dG,"representYamlFloat");function fG(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Oi.isNegativeZero(t))}x(fG,"isFloat");var yke=new _a("tag:yaml.org,2002:float",{kind:"scalar",resolve:uG,construct:hG,predicate:fG,represent:dG,defaultStyle:"lowercase"}),pG=hke.extend({implicit:[dke,fke,pke,yke]}),vke=pG,gG=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),mG=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function yG(t){return t===null?!1:gG.exec(t)!==null||mG.exec(t)!==null}x(yG,"resolveYamlTimestamp");function vG(t){var e,r,n,i,a,s,o,l=0,u=null,h,d,f;if(e=gG.exec(t),e===null&&(e=mG.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=+e[10],d=+(e[11]||0),u=(h*60+d)*6e4,e[9]==="-"&&(u=-u)),f=new Date(Date.UTC(r,n,i,a,s,o,l)),u&&f.setTime(f.getTime()-u),f}x(vG,"constructYamlTimestamp");function bG(t){return t.toISOString()}x(bG,"representYamlTimestamp");var bke=new _a("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:yG,construct:vG,instanceOf:Date,represent:bG});function xG(t){return t==="<<"||t===null}x(xG,"resolveYamlMerge");var xke=new _a("tag:yaml.org,2002:merge",{kind:"scalar",resolve:xG}),DA=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function TG(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=DA;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}x(TG,"resolveYamlBinary");function wG(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=DA,s=0,o=[];for(e=0;e>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(e));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}x(wG,"constructYamlBinary");function CG(t){var e="",r=0,n,i,a=t.length,s=DA;for(n=0;n>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]),r=(r<<8)+t[n];return i=a%3,i===0?(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]):i===2?(e+=s[r>>10&63],e+=s[r>>4&63],e+=s[r<<2&63],e+=s[64]):i===1&&(e+=s[r>>2&63],e+=s[r<<4&63],e+=s[64],e+=s[64]),e}x(CG,"representYamlBinary");function kG(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}x(kG,"isBinary");var Tke=new _a("tag:yaml.org,2002:binary",{kind:"scalar",resolve:TG,construct:wG,predicate:kG,represent:CG}),wke=Object.prototype.hasOwnProperty,Cke=Object.prototype.toString;function EG(t){if(t===null)return!0;var e=[],r,n,i,a,s,o=t;for(r=0,n=o.length;r>10)+55296,(t-65536&1023)+56320)}x(zG,"charFromCodepoint");function $A(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}x($A,"setProperty");var GG=new Array(256),qG=new Array(256);for(sd=0;sd<256;sd++)GG[sd]=OA(sd)?1:0,qG[sd]=OA(sd);var sd;function VG(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||IG,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}x(VG,"State$1");function PA(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=ike(r),new vs(e,r)}x(PA,"generateError");function cr(t,e){throw PA(t,e)}x(cr,"throwError");function $2(t,e){t.onWarning&&t.onWarning.call(null,PA(t,e))}x($2,"throwWarning");var WG={YAML:x(function(e,r,n){var i,a,s;e.version!==null&&cr(e,"duplication of %YAML directive"),n.length!==1&&cr(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&cr(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&cr(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&$2(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:x(function(e,r,n){var i,a;n.length!==2&&cr(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],OG.test(i)||cr(e,"ill-formed tag handle (first argument) of the TAG directive"),_u.call(e.tagMap,i)&&cr(e,'there is a previously declared suffix for "'+i+'" tag handle'),$G.test(a)||cr(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{cr(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function bc(t,e,r,n){var i,a,s,o;if(e1&&(t.result+=Oi.repeat(` -`,e-1))}x(C4,"writeFoldedLines");function UG(t,e,r){var n,i,a,s,o,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),Ga(p)||ad(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=t.input.charCodeAt(t.position+1),Ga(i)||r&&ad(i)))return!1;for(t.kind="scalar",t.result="",a=s=t.position,o=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),Ga(i)||r&&ad(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),Ga(n))break}else{if(t.position===t.lineStart&&P2(t)||r&&ad(p))break;if(Io(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,di(t,!1,-1),t.lineIndent>=e){o=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=s,t.line=l,t.lineStart=u,t.lineIndent=h;break}}o&&(bc(t,a,s,!1),C4(t,t.line-l),a=s=t.position,o=!1),Ru(p)||(s=t.position+1),p=t.input.charCodeAt(++t.position)}return bc(t,a,s,!1),t.result?!0:(t.kind=d,t.result=f,!1)}x(UG,"readPlainScalar");function HG(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(bc(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else Io(r)?(bc(t,n,i,!0),C4(t,di(t,!1,e)),n=i=t.position):t.position===t.lineStart&&P2(t)?cr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);cr(t,"unexpected end of the stream within a single quoted scalar")}x(HG,"readSingleQuotedScalar");function YG(t,e){var r,n,i,a,s,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return bc(t,r,t.position,!0),t.position++,!0;if(o===92){if(bc(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),Io(o))di(t,!1,e);else if(o<256&&GG[o])t.result+=qG[o],t.position++;else if((s=BG(o))>0){for(i=s,a=0;i>0;i--)o=t.input.charCodeAt(++t.position),(s=PG(o))>=0?a=(a<<4)+s:cr(t,"expected hexadecimal character");t.result+=zG(a),t.position++}else cr(t,"unknown escape sequence");r=n=t.position}else Io(o)?(bc(t,r,n,!0),C4(t,di(t,!1,e)),r=n=t.position):t.position===t.lineStart&&P2(t)?cr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}cr(t,"unexpected end of the stream within a double quoted scalar")}x(YG,"readDoubleQuotedScalar");function XG(t,e){var r=!0,n,i,a,s=t.tag,o,l=t.anchor,u,h,d,f,p,g=Object.create(null),m,y,v,T;if(T=t.input.charCodeAt(t.position),T===91)h=93,p=!1,o=[];else if(T===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),T=t.input.charCodeAt(++t.position);T!==0;){if(di(t,!0,e),T=t.input.charCodeAt(t.position),T===h)return t.position++,t.tag=s,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?T===44&&cr(t,"expected the node content, but found ','"):cr(t,"missed comma between flow collection entries"),y=m=v=null,d=f=!1,T===63&&(u=t.input.charCodeAt(t.position+1),Ga(u)&&(d=f=!0,t.position++,di(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,ld(t,e,x4,!1,!0),y=t.tag,m=t.result,di(t,!0,e),T=t.input.charCodeAt(t.position),(f||t.line===n)&&T===58&&(d=!0,T=t.input.charCodeAt(++t.position),di(t,!0,e),ld(t,e,x4,!1,!0),v=t.result),p?od(t,o,g,y,m,v,n,i,a):d?o.push(od(t,null,g,y,m,v,n,i,a)):o.push(m),di(t,!0,e),T=t.input.charCodeAt(t.position),T===44?(r=!0,T=t.input.charCodeAt(++t.position)):r=!1}cr(t,"unexpected end of the stream within a flow collection")}x(XG,"readFlowCollection");function KG(t,e){var r,n,i=MA,a=!1,s=!1,o=e,l=0,u=!1,h,d;if(d=t.input.charCodeAt(t.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(t.kind="scalar",t.result="";d!==0;)if(d=t.input.charCodeAt(++t.position),d===43||d===45)MA===i?i=d===43?NG:Rke:cr(t,"repeat of a chomping mode identifier");else if((h=FG(d))>=0)h===0?cr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?cr(t,"repeat of an indentation width identifier"):(o=e+h-1,s=!0);else break;if(Ru(d)){do d=t.input.charCodeAt(++t.position);while(Ru(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!Io(d)&&d!==0)}for(;d!==0;){for(w4(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndento&&(o=t.lineIndent),Io(d)){l++;continue}if(t.lineIndent=i.length);l++)u=b4(t.buffer,n[s+l],i[s+l],t.position-(n[s]-n[s+l]),d),o+=Oi.repeat(" ",e.indent)+x4((t.line+l+1).toString(),h)+" | "+u.str+` +`;return o.replace(/\n$/,"")}T(Jz,"makeSnippet");var uke=Jz,hke=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],dke=["scalar","sequence","mapping"];function eG(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}T(eG,"compileStyleAliases");function tG(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(hke.indexOf(r)===-1)throw new vs('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=eG(e.styleAliases||null),dke.indexOf(this.kind)===-1)throw new vs('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}T(tG,"Type$1");var _a=tG;function NA(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(a,s){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=s)}),r[i]=n}),r}T(NA,"compileList");function rG(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(T(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:T(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:T(function(t){return t.toString(10)},"decimal"),hexadecimal:T(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Tke=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function gG(t){return!(t===null||!Tke.test(t)||t[t.length-1]==="_")}T(gG,"resolveYamlFloat");function mG(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}T(mG,"constructYamlFloat");var wke=/^[-+]?[0-9]+e/;function yG(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Oi.isNegativeZero(t))return"-0.0";return r=t.toString(10),wke.test(r)?r.replace("e",".e"):r}T(yG,"representYamlFloat");function vG(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Oi.isNegativeZero(t))}T(vG,"isFloat");var Cke=new _a("tag:yaml.org,2002:float",{kind:"scalar",resolve:gG,construct:mG,predicate:vG,represent:yG,defaultStyle:"lowercase"}),bG=yke.extend({implicit:[vke,bke,xke,Cke]}),kke=bG,xG=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),TG=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function wG(t){return t===null?!1:xG.exec(t)!==null||TG.exec(t)!==null}T(wG,"resolveYamlTimestamp");function CG(t){var e,r,n,i,a,s,o,l=0,u=null,h,d,f;if(e=xG.exec(t),e===null&&(e=TG.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=+e[10],d=+(e[11]||0),u=(h*60+d)*6e4,e[9]==="-"&&(u=-u)),f=new Date(Date.UTC(r,n,i,a,s,o,l)),u&&f.setTime(f.getTime()-u),f}T(CG,"constructYamlTimestamp");function kG(t){return t.toISOString()}T(kG,"representYamlTimestamp");var Eke=new _a("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:wG,construct:CG,instanceOf:Date,represent:kG});function EG(t){return t==="<<"||t===null}T(EG,"resolveYamlMerge");var Ske=new _a("tag:yaml.org,2002:merge",{kind:"scalar",resolve:EG}),OA=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function SG(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=OA;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}T(SG,"resolveYamlBinary");function AG(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=OA,s=0,o=[];for(e=0;e>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(e));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}T(AG,"constructYamlBinary");function _G(t){var e="",r=0,n,i,a=t.length,s=OA;for(n=0;n>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]),r=(r<<8)+t[n];return i=a%3,i===0?(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]):i===2?(e+=s[r>>10&63],e+=s[r>>4&63],e+=s[r<<2&63],e+=s[64]):i===1&&(e+=s[r>>2&63],e+=s[r<<4&63],e+=s[64],e+=s[64]),e}T(_G,"representYamlBinary");function RG(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}T(RG,"isBinary");var Ake=new _a("tag:yaml.org,2002:binary",{kind:"scalar",resolve:SG,construct:AG,predicate:RG,represent:_G}),_ke=Object.prototype.hasOwnProperty,Rke=Object.prototype.toString;function LG(t){if(t===null)return!0;var e=[],r,n,i,a,s,o=t;for(r=0,n=o.length;r>10)+55296,(t-65536&1023)+56320)}T(UG,"charFromCodepoint");function FA(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}T(FA,"setProperty");var HG=new Array(256),YG=new Array(256);for(sd=0;sd<256;sd++)HG[sd]=BA(sd)?1:0,YG[sd]=BA(sd);var sd;function XG(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||$G,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}T(XG,"State$1");function zA(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=uke(r),new vs(e,r)}T(zA,"generateError");function cr(t,e){throw zA(t,e)}T(cr,"throwError");function P2(t,e){t.onWarning&&t.onWarning.call(null,zA(t,e))}T(P2,"throwWarning");var KG={YAML:T(function(e,r,n){var i,a,s;e.version!==null&&cr(e,"duplication of %YAML directive"),n.length!==1&&cr(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&cr(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&cr(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&P2(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:T(function(e,r,n){var i,a;n.length!==2&&cr(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],zG.test(i)||cr(e,"ill-formed tag handle (first argument) of the TAG directive"),_u.call(e.tagMap,i)&&cr(e,'there is a previously declared suffix for "'+i+'" tag handle'),GG.test(a)||cr(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{cr(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function bc(t,e,r,n){var i,a,s,o;if(e1&&(t.result+=Oi.repeat(` +`,e-1))}T(E4,"writeFoldedLines");function jG(t,e,r){var n,i,a,s,o,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),Ga(p)||ad(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=t.input.charCodeAt(t.position+1),Ga(i)||r&&ad(i)))return!1;for(t.kind="scalar",t.result="",a=s=t.position,o=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),Ga(i)||r&&ad(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),Ga(n))break}else{if(t.position===t.lineStart&&B2(t)||r&&ad(p))break;if(Io(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,di(t,!1,-1),t.lineIndent>=e){o=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=s,t.line=l,t.lineStart=u,t.lineIndent=h;break}}o&&(bc(t,a,s,!1),E4(t,t.line-l),a=s=t.position,o=!1),Ru(p)||(s=t.position+1),p=t.input.charCodeAt(++t.position)}return bc(t,a,s,!1),t.result?!0:(t.kind=d,t.result=f,!1)}T(jG,"readPlainScalar");function ZG(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(bc(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else Io(r)?(bc(t,n,i,!0),E4(t,di(t,!1,e)),n=i=t.position):t.position===t.lineStart&&B2(t)?cr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);cr(t,"unexpected end of the stream within a single quoted scalar")}T(ZG,"readSingleQuotedScalar");function QG(t,e){var r,n,i,a,s,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return bc(t,r,t.position,!0),t.position++,!0;if(o===92){if(bc(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),Io(o))di(t,!1,e);else if(o<256&&HG[o])t.result+=YG[o],t.position++;else if((s=VG(o))>0){for(i=s,a=0;i>0;i--)o=t.input.charCodeAt(++t.position),(s=qG(o))>=0?a=(a<<4)+s:cr(t,"expected hexadecimal character");t.result+=UG(a),t.position++}else cr(t,"unknown escape sequence");r=n=t.position}else Io(o)?(bc(t,r,n,!0),E4(t,di(t,!1,e)),r=n=t.position):t.position===t.lineStart&&B2(t)?cr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}cr(t,"unexpected end of the stream within a double quoted scalar")}T(QG,"readDoubleQuotedScalar");function JG(t,e){var r=!0,n,i,a,s=t.tag,o,l=t.anchor,u,h,d,f,p,g=Object.create(null),m,y,v,x;if(x=t.input.charCodeAt(t.position),x===91)h=93,p=!1,o=[];else if(x===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),x=t.input.charCodeAt(++t.position);x!==0;){if(di(t,!0,e),x=t.input.charCodeAt(t.position),x===h)return t.position++,t.tag=s,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?x===44&&cr(t,"expected the node content, but found ','"):cr(t,"missed comma between flow collection entries"),y=m=v=null,d=f=!1,x===63&&(u=t.input.charCodeAt(t.position+1),Ga(u)&&(d=f=!0,t.position++,di(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,ld(t,e,w4,!1,!0),y=t.tag,m=t.result,di(t,!0,e),x=t.input.charCodeAt(t.position),(f||t.line===n)&&x===58&&(d=!0,x=t.input.charCodeAt(++t.position),di(t,!0,e),ld(t,e,w4,!1,!0),v=t.result),p?od(t,o,g,y,m,v,n,i,a):d?o.push(od(t,null,g,y,m,v,n,i,a)):o.push(m),di(t,!0,e),x=t.input.charCodeAt(t.position),x===44?(r=!0,x=t.input.charCodeAt(++t.position)):r=!1}cr(t,"unexpected end of the stream within a flow collection")}T(JG,"readFlowCollection");function eq(t,e){var r,n,i=$A,a=!1,s=!1,o=e,l=0,u=!1,h,d;if(d=t.input.charCodeAt(t.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(t.kind="scalar",t.result="";d!==0;)if(d=t.input.charCodeAt(++t.position),d===43||d===45)$A===i?i=d===43?FG:Oke:cr(t,"repeat of a chomping mode identifier");else if((h=WG(d))>=0)h===0?cr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?cr(t,"repeat of an indentation width identifier"):(o=e+h-1,s=!0);else break;if(Ru(d)){do d=t.input.charCodeAt(++t.position);while(Ru(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!Io(d)&&d!==0)}for(;d!==0;){for(k4(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndento&&(o=t.lineIndent),Io(d)){l++;continue}if(t.lineIndente)&&l!==0)cr(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(y&&(s=t.line,o=t.lineStart,l=t.position),ld(t,e,T4,!0,i)&&(y?g=t.result:m=t.result),y||(od(t,d,f,p,g,m,s,o,l),p=g=m=null),di(t,!0,-1),T=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&T!==0)cr(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),d=0,f=t.implicitTypes.length;d"),t.result!==null&&g.kind!==t.kind&&cr(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):cr(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||h}x(ld,"composeNode");function eq(t){var e=t.position,r,n,i,a=!1,s;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(s=t.input.charCodeAt(t.position))!==0&&(di(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||s!==37));){for(a=!0,s=t.input.charCodeAt(++t.position),r=t.position;s!==0&&!Ga(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&cr(t,"directive name must not be less than one character in length");s!==0;){for(;Ru(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!Io(s));break}if(Io(s))break;for(r=t.position;s!==0&&!Ga(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&w4(t),_u.call(WG,n)?WG[n](t,n,i):$2(t,'unknown document directive "'+n+'"')}if(di(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,di(t,!0,-1)):a&&cr(t,"directives end mark is expected"),ld(t,t.lineIndent-1,T4,!1,!0),di(t,!0,-1),t.checkLineBreaks&&Ike.test(t.input.slice(e,t.position))&&$2(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&P2(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,di(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=zA(t,r);if(typeof e!="function")return n;for(var i=0,a=n.length;ie)&&l!==0)cr(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(y&&(s=t.line,o=t.lineStart,l=t.position),ld(t,e,C4,!0,i)&&(y?g=t.result:m=t.result),y||(od(t,d,f,p,g,m,s,o,l),p=g=m=null),di(t,!0,-1),x=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&x!==0)cr(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),d=0,f=t.implicitTypes.length;d"),t.result!==null&&g.kind!==t.kind&&cr(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):cr(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||h}T(ld,"composeNode");function aq(t){var e=t.position,r,n,i,a=!1,s;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(s=t.input.charCodeAt(t.position))!==0&&(di(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||s!==37));){for(a=!0,s=t.input.charCodeAt(++t.position),r=t.position;s!==0&&!Ga(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&cr(t,"directive name must not be less than one character in length");s!==0;){for(;Ru(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!Io(s));break}if(Io(s))break;for(r=t.position;s!==0&&!Ga(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&k4(t),_u.call(KG,n)?KG[n](t,n,i):P2(t,'unknown document directive "'+n+'"')}if(di(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,di(t,!0,-1)):a&&cr(t,"directives end mark is expected"),ld(t,t.lineIndent-1,C4,!1,!0),di(t,!0,-1),t.checkLineBreaks&&Pke.test(t.input.slice(e,t.position))&&P2(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&B2(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,di(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=VA(t,r);if(typeof e!="function")return n;for(var i=0,a=n.length;i=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}x(z0,"codePointAt");function HA(t){var e=/^\n* /;return e.test(t)}x(HA,"needIndentIndicator");var gq=1,YA=2,mq=3,yq=4,G0=5;function vq(t,e,r,n,i,a,s,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=fq(z0(t,0))&&pq(z0(t,t.length-1));if(e||s)for(l=0;l=65536?l+=2:l++){if(u=z0(t,l),!F0(u))return G0;m=m&&UA(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=z0(t,l),u===B2)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!F0(u))return G0;m=m&&UA(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!s&&!i(t)?gq:a===F2?G0:YA:r>9&&HA(t)?G0:s?a===F2?G0:YA:f?yq:mq}x(vq,"chooseScalarStyle");function bq(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===F2?'""':"''";if(!t.noCompatMode&&(Qke.indexOf(e)!==-1||Jke.test(e)))return t.quotingType===F2?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),s=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),o=n||t.flowLevel>-1&&r>=t.flowLevel;function l(u){return dq(t,u)}switch(x(l,"testAmbiguity"),vq(e,o,t.indent,s,l,t.quotingType,t.forceQuotes&&!n,i)){case gq:return e;case YA:return"'"+e.replace(/'/g,"''")+"'";case mq:return"|"+XA(e,t.indent)+KA(VA(e,a));case yq:return">"+XA(e,t.indent)+KA(VA(xq(e,s),a));case G0:return'"'+Tq(e)+'"';default:throw new vs("impossible error: invalid scalar style")}})()}x(bq,"writeScalar");function XA(t,e){var r=HA(t)?String(e):"",n=t[t.length-1]===` +`&&(a+=r),a+=s;return a}T(HA,"indentString");function A4(t,e){return` +`+Oi.repeat(" ",t.indent*e)}T(A4,"generateNextLine");function yq(t,e){var r,n,i;for(r=0,n=t.implicitTypes.length;r=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}T(zp,"codePointAt");function KA(t){var e=/^\n* /;return e.test(t)}T(KA,"needIndentIndicator");var xq=1,jA=2,Tq=3,wq=4,Gp=5;function Cq(t,e,r,n,i,a,s,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=vq(zp(t,0))&&bq(zp(t,t.length-1));if(e||s)for(l=0;l=65536?l+=2:l++){if(u=zp(t,l),!Fp(u))return Gp;m=m&&XA(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=zp(t,l),u===F2)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!Fp(u))return Gp;m=m&&XA(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!s&&!i(t)?xq:a===z2?Gp:jA:r>9&&KA(t)?Gp:s?a===z2?Gp:jA:f?wq:Tq}T(Cq,"chooseScalarStyle");function kq(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===z2?'""':"''";if(!t.noCompatMode&&(iEe.indexOf(e)!==-1||aEe.test(e)))return t.quotingType===z2?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),s=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),o=n||t.flowLevel>-1&&r>=t.flowLevel;function l(u){return yq(t,u)}switch(T(l,"testAmbiguity"),Cq(e,o,t.indent,s,l,t.quotingType,t.forceQuotes&&!n,i)){case xq:return e;case jA:return"'"+e.replace(/'/g,"''")+"'";case Tq:return"|"+ZA(e,t.indent)+QA(HA(e,a));case wq:return">"+ZA(e,t.indent)+QA(HA(Eq(e,s),a));case Gp:return'"'+Sq(e)+'"';default:throw new vs("impossible error: invalid scalar style")}})()}T(kq,"writeScalar");function ZA(t,e){var r=KA(t)?String(e):"",n=t[t.length-1]===` `,i=n&&(t[t.length-2]===` `||t===` `),a=i?"+":n?"":"-";return r+a+` -`}x(XA,"blockHeader");function KA(t){return t[t.length-1]===` -`?t.slice(0,-1):t}x(KA,"dropEndingNewline");function xq(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=t.indexOf(` -`);return u=u!==-1?u:t.length,r.lastIndex=u,jA(t.slice(0,u),e)})(),i=t[0]===` +`}T(ZA,"blockHeader");function QA(t){return t[t.length-1]===` +`?t.slice(0,-1):t}T(QA,"dropEndingNewline");function Eq(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=t.indexOf(` +`);return u=u!==-1?u:t.length,r.lastIndex=u,JA(t.slice(0,u),e)})(),i=t[0]===` `||t[0]===" ",a,s;s=r.exec(t);){var o=s[1],l=s[2];a=l[0]===" ",n+=o+(!i&&!a&&l!==""?` -`:"")+jA(l,e),i=a}return n}x(xq,"foldString");function jA(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,a,s=0,o=0,l="";n=r.exec(t);)o=n.index,o-i>e&&(a=s>i?s:o,l+=` +`:"")+JA(l,e),i=a}return n}T(Eq,"foldString");function JA(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,a,s=0,o=0,l="";n=r.exec(t);)o=n.index,o-i>e&&(a=s>i?s:o,l+=` `+t.slice(i,a),i=a+1),s=o;return l+=` `,t.length-i>e&&s>i?l+=t.slice(i,s)+` -`+t.slice(s+1):l+=t.slice(i),l.slice(1)}x(jA,"foldLine");function Tq(t){for(var e="",r=0,n,i=0;i=65536?i+=2:i++)r=z0(t,i),n=Ra[r],!n&&F0(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||uq(r);return e}x(Tq,"escapeString");function wq(t,e,r){var n="",i=t.tag,a,s,o;for(a=0,s=r.length;a"u"&&ml(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}x(wq,"writeFlowSequence");function ZA(t,e,r,n){var i="",a=t.tag,s,o,l;for(s=0,o=r.length;s"u"&&ml(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=E4(t,e)),t.dump&&B2===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}x(ZA,"writeBlockSequence");function Cq(t,e,r){var n="",i=t.tag,a=Object.keys(r),s,o,l,u,h;for(s=0,o=a.length;s1024&&(h+="? "),h+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),ml(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}x(Cq,"writeFlowMapping");function kq(t,e,r,n){var i="",a=t.tag,s=Object.keys(r),o,l,u,h,d,f;if(t.sortKeys===!0)s.sort();else if(typeof t.sortKeys=="function")s.sort(t.sortKeys);else if(t.sortKeys)throw new vs("sortKeys must be a boolean or a function");for(o=0,l=s.length;o1024,d&&(t.dump&&B2===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=E4(t,e)),ml(t,e+1,h,!0,d)&&(t.dump&&B2===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}x(kq,"writeBlockMapping");function QA(t,e,r){var n,i,a,s,o,l;for(i=r?t.explicitTypes:t.implicitTypes,a=0,s=i.length;a tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}x(QA,"detectType");function ml(t,e,r,n,i,a,s){t.tag=null,t.dump=r,QA(t,r,!1)||QA(t,r,!0);var o=rq.call(t.dump),l=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var h=o==="[object Object]"||o==="[object Array]",d,f;if(h&&(d=t.duplicates.indexOf(r),f=d!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(h&&f&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),o==="[object Object]")n&&Object.keys(t.dump).length!==0?(kq(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(Cq(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!s&&e>0?ZA(t,e-1,t.dump,i):ZA(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(wq(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&bq(t,t.dump,e,a,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new vs("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}x(ml,"writeNode");function Eq(t,e){var r=[],n=[],i,a;for(S4(t,r,n),i=0,a=n.length;i=65536?i+=2:i++)r=zp(t,i),n=Ra[r],!n&&Fp(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||gq(r);return e}T(Sq,"escapeString");function Aq(t,e,r){var n="",i=t.tag,a,s,o;for(a=0,s=r.length;a"u"&&ml(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}T(Aq,"writeFlowSequence");function e_(t,e,r,n){var i="",a=t.tag,s,o,l;for(s=0,o=r.length;s"u"&&ml(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=A4(t,e)),t.dump&&F2===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}T(e_,"writeBlockSequence");function _q(t,e,r){var n="",i=t.tag,a=Object.keys(r),s,o,l,u,h;for(s=0,o=a.length;s1024&&(h+="? "),h+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),ml(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}T(_q,"writeFlowMapping");function Rq(t,e,r,n){var i="",a=t.tag,s=Object.keys(r),o,l,u,h,d,f;if(t.sortKeys===!0)s.sort();else if(typeof t.sortKeys=="function")s.sort(t.sortKeys);else if(t.sortKeys)throw new vs("sortKeys must be a boolean or a function");for(o=0,l=s.length;o1024,d&&(t.dump&&F2===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=A4(t,e)),ml(t,e+1,h,!0,d)&&(t.dump&&F2===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}T(Rq,"writeBlockMapping");function t_(t,e,r){var n,i,a,s,o,l;for(i=r?t.explicitTypes:t.implicitTypes,a=0,s=i.length;a tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}T(t_,"detectType");function ml(t,e,r,n,i,a,s){t.tag=null,t.dump=r,t_(t,r,!1)||t_(t,r,!0);var o=oq.call(t.dump),l=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var h=o==="[object Object]"||o==="[object Array]",d,f;if(h&&(d=t.duplicates.indexOf(r),f=d!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(h&&f&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),o==="[object Object]")n&&Object.keys(t.dump).length!==0?(Rq(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(_q(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!s&&e>0?e_(t,e-1,t.dump,i):e_(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(Aq(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&kq(t,t.dump,e,a,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new vs("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}T(ml,"writeNode");function Lq(t,e){var r=[],n=[],i,a;for(_4(t,r,n),i=0,a=n.length;i{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";const r=t.x??0,n=t.y??0;return"translate("+-(r+t.width/2)+", "+-(n+t.height/2)+")"},"computeLabelTransform"),La={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Sq={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function G2(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=Vn(t),e=Vn(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}x(G2,"calculateDeltaAndAngle");var Vn=x(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),Aq=x(t=>({x:x(function(e,r,n){let i=0;const a=Vn(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(La,t.arrowTypeEnd)){const{angle:p,deltaX:g}=G2(n[n.length-1],n[n.length-2]);i=La[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const s=Math.abs(Vn(e).x-Vn(n[n.length-1]).x),o=Math.abs(Vn(e).y-Vn(n[n.length-1]).y),l=Math.abs(Vn(e).x-Vn(n[0]).x),u=Math.abs(Vn(e).y-Vn(n[0]).y),h=La[t.arrowTypeStart],d=La[t.arrowTypeEnd],f=1;if(s0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(La,t.arrowTypeEnd)){const{angle:p,deltaY:g}=G2(n[n.length-1],n[n.length-2]);i=La[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const s=Math.abs(Vn(e).y-Vn(n[n.length-1]).y),o=Math.abs(Vn(e).x-Vn(n[n.length-1]).x),l=Math.abs(Vn(e).y-Vn(n[0]).y),u=Math.abs(Vn(e).x-Vn(n[0]).x),h=La[t.arrowTypeStart],d=La[t.arrowTypeEnd],f=1;if(s0&&o0&&u-1}function r(s){var o=s.replace(t.ctrlCharactersRegex,"");return o.replace(t.htmlEntitiesRegex,function(l,u){return String.fromCharCode(u)})}function n(s){return URL.canParse(s)}function i(s){try{return decodeURIComponent(s)}catch{return s}}function a(s){if(!s)return t.BLANK_URL;var o,l=i(s.trim());do l=r(l).replace(t.htmlCtrlEntityRegex,"").replace(t.ctrlCharactersRegex,"").replace(t.whitespaceEscapeCharsRegex,"").trim(),l=i(l),o=l.match(t.ctrlCharactersRegex)||l.match(t.htmlEntitiesRegex)||l.match(t.htmlCtrlEntityRegex)||l.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var u=l;if(!u)return t.BLANK_URL;if(e(u))return u;var h=u.trimStart(),d=h.match(t.urlSchemeRegex);if(!d)return u;var f=d[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(f))return t.BLANK_URL;var p=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return p;if(f==="http:"||f==="https:"){if(!n(p))return t.BLANK_URL;var g=new URL(p);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return p}return R4}var cd=iEe();function aEe(t){return Array.isArray(t)}function JA(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function sEe(){}function Lq(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function q2(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Iq="[object RegExp]",e_="[object String]",t_="[object Number]",r_="[object Boolean]",n_="[object Arguments]",Dq="[object Symbol]",Mq="[object Date]",Nq="[object Map]",Oq="[object Set]",$q="[object Array]",Pq="[object ArrayBuffer]",Bq="[object Object]",Fq="[object DataView]",zq="[object Uint8Array]",Gq="[object Uint8ClampedArray]",qq="[object Uint16Array]",Vq="[object Uint32Array]",Wq="[object Int8Array]",Uq="[object Int16Array]",Hq="[object Int32Array]",Yq="[object Float32Array]",Xq="[object Float64Array]",Kq=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function i_(t){return typeof Kq.Buffer<"u"&&Kq.Buffer.isBuffer(t)}function oEe(t){return Number.isSafeInteger(t)&&t>=0}function jq(t){return t!=null&&typeof t!="function"&&oEe(t.length)}function lEe(t){return t==="__proto__"}function L4(t){return t==null||typeof t!="object"&&typeof t!="function"}function a_(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function cEe(t,e){return q0(t,void 0,t,new Map,e)}function q0(t,e,r,n=new Map,i=void 0){const a=i==null?void 0:i(t,e,r,n);if(a!==void 0)return a;if(L4(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const s=new Array(t.length);n.set(t,s);for(let o=0;o{if(typeof t=="object"){if(q2(t)==="[object Object]"&&typeof t.constructor!="function"){const s={};return a.set(t,s),Do(s,t,i,a),s}switch(Object.prototype.toString.call(t)){case t_:case e_:case r_:{const s=new t.constructor(t==null?void 0:t.valueOf());return Do(s,t),s}case n_:{const s={};return Do(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}}})}function Zq(t){return hEe(t)}function s_(t){return t!==null&&typeof t=="object"&&q2(t)==="[object Arguments]"}function o_(t){return typeof t=="object"&&t!==null}function dEe(t){return o_(t)&&jq(t)}function V2(t){return a_(t)}function fEe(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function W2(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");const r=function(...n){const i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);const s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(W2.Cache||Map),r}W2.Cache=Map;function pEe(t){if(L4(t))return t;const e=q2(t);if(!gEe(t))return{};if(aEe(t)){const n=Array.from(t);return t.length>0&&typeof t[0]=="string"&&Object.hasOwn(t,"index")&&(n.index=t.index,n.input=t.input),n}if(V2(t)){const n=t,i=n.constructor;return new i(n.buffer,n.byteOffset,n.length)}if(e==="[object ArrayBuffer]")return new ArrayBuffer(t.byteLength);if(e==="[object DataView]"){const n=t,i=n.buffer,a=n.byteOffset,s=n.byteLength,o=new ArrayBuffer(s),l=new Uint8Array(i,a,s);return new Uint8Array(o).set(l),new DataView(o)}if(e==="[object Boolean]"||e==="[object Number]"||e==="[object String]"){const n=t.constructor,i=new n(t.valueOf());return e==="[object String]"?yEe(i,t):l_(i,t),i}if(e==="[object Date]")return new Date(Number(t));if(e==="[object RegExp]"){const n=t,i=new RegExp(n.source,n.flags);return i.lastIndex=n.lastIndex,i}if(e==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(t));if(e==="[object Map]"){const n=t,i=new Map;return n.forEach((a,s)=>{i.set(s,a)}),i}if(e==="[object Set]"){const n=t,i=new Set;return n.forEach(a=>{i.add(a)}),i}if(e==="[object Arguments]"){const n=t,i={};return l_(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return vEe(r,t),l_(r,t),mEe(r,t),r}function gEe(t){switch(q2(t)){case n_:case $q:case Pq:case Fq:case r_:case Mq:case Yq:case Xq:case Wq:case Uq:case Hq:case Nq:case t_:case Bq:case Iq:case Oq:case e_:case Dq:case zq:case Gq:case qq:case Vq:return!0;default:return!1}}function l_(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function mEe(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function vEe(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function bEe(t){if(L4(t))return t;if(Array.isArray(t)||a_(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t);if(e==null)return Object.assign(Object.create(e),t);const r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const n=new r(t);return n.lastIndex=t.lastIndex,n}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let n;return t instanceof AggregateError?n=new r(t.errors,t.message,{cause:t.cause}):n=new r(t.message,{cause:t.cause}),n.stack=t.stack,Object.assign(n,t),n}return typeof File<"u"&&t instanceof File?new r([t],t.name,{type:t.type,lastModified:t.lastModified}):typeof t=="object"?Object.assign(Object.create(e),t):t}function xEe(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let a=0;ar!=="constructor").length===0:e.length===0}return!0}var Jq="​",wEe={curveBasis:N2,curveBasisClosed:W3e,curveBasisOpen:U3e,curveBumpX:bz,curveBumpY:xz,curveBundle:H3e,curveCardinalClosed:Y3e,curveCardinalOpen:X3e,curveCardinal:kz,curveCatmullRomClosed:K3e,curveCatmullRomOpen:j3e,curveCatmullRom:Sz,curveLinear:D2,curveLinearClosed:Z3e,curveMonotoneX:Oz,curveMonotoneY:$z,curveNatural:Fz,curveStep:zz,curveStepAfter:qz,curveStepBefore:Gz},CEe=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,kEe=x(function(t,e){const r=eV(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);Cw(s),n=ci(n,[...s])}else n=r.args;if(!n)return;let i=k6(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),eV=x(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${CEe.source})(?=[}][%]{2}).* -`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),ae.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const s=[];for(;(a=c2.exec(t))!==null;)if(a.index===c2.lastIndex&&c2.lastIndex++,a&&!e||e&&((r=a[1])!=null&&r.match(e))||e&&((n=a[2])!=null&&n.match(e))){const o=a[1]?a[1]:a[2],l=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;s.push({type:o,args:l})}return s.length===0?{type:t,args:null}:s.length===1?s[0]:s}catch(i){return ae.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),EEe=x(function(t){return t.replace(c2,"")},"removeDirectives"),SEe=x(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function c_(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return wEe[r]??e}x(c_,"interpolateToCurve");function tV(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?cd.sanitizeUrl(r):r}x(tV,"formatUrl");var AEe=x((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s{r+=u_(i,e),e=i});const n=r/2;return h_(t,n)}x(rV,"traverseEdge");function nV(t){return t.length===1?t[0]:rV(t)}x(nV,"calcLabelPosition");var iV=x((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),h_=x((t,e)=>{let r,n=e;for(const i of t){if(r){const a=u_(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:iV((1-s)*r.x+s*i.x,5),y:iV((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),_Ee=x((t,e,r)=>{ae.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=h_(e,25),a=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(e[0].x+i.x)/2,o.y=-Math.cos(s)*a+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function aV(t,e,r){const n=structuredClone(r);ae.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=h_(n,i),s=10+t*.5,o=Math.atan2(n[0].y-a.y,n[0].x-a.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2-5):(l.x=Math.sin(o)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2),l}x(aV,"calcTerminalLabelPosition");function d_(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}x(d_,"getStylesFromArray");var sV=0,oV=x(()=>(sV++,"id-"+Math.random().toString(36).substr(2,12)+"-"+sV),"generateId");function lV(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;ilV(t.length),"random"),REe=x(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),LEe=x(function(t,e){const r=e.text.replace(Lt.lineBreakRegex," "),[,n]=xc(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),i},"drawSimpleText"),U2=W2((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),Lt.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=qa(`${s} `,r),u=qa(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=IEe(s,e,"-",r);i.push(a,...f),a=p}else u+l>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),IEe=W2((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let s="";return i.forEach((o,l)=>{const u=`${s}${o}`;if(qa(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;a.push(f?u:p),s=""}else s=u}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function D4(t,e){return M4(t,e).height}x(D4,"calculateTextHeight");function qa(t,e){return M4(t,e).width}x(qa,"calculateTextWidth");var M4=W2((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=xc(r),s=["sans-serif",n],o=t.split(Lt.lineBreakRegex),l=[],u=pt("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of s){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const y=REe();y.text=m||Jq;const v=LEe(h,y).style("font-size",a).style("font-weight",i).style("font-family",f),T=(v._groups||v)[0][0].getBBox();if(T.width===0&&T.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,T.width)),p=Math.round(T.height),g.height+=p,g.lineHeight=Math.round(Math.max(g.lineHeight,p))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),DEe=(_m=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},x(_m,"InitIDGenerator"),_m),N4,MEe=x(function(t){return N4=N4||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),N4.innerHTML=t,unescape(N4.textContent)},"entityDecode");function f_(t){return"str"in t}x(f_,"isDetailedError");var NEe=x((t,e,r,n)=>{var a;if(!n)return;const i=(a=t.node())==null?void 0:a.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),xc=x(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function ti(t,e){return TEe({},t,e)}x(ti,"cleanAndMerge");var Lr={assignWithDepth:ci,wrapLabel:U2,calculateTextHeight:D4,calculateTextWidth:qa,calculateTextDimensions:M4,cleanAndMerge:ti,detectInit:kEe,detectDirective:eV,isSubstringInArray:SEe,interpolateToCurve:c_,calcLabelPosition:nV,calcCardinalityPosition:_Ee,calcTerminalLabelPosition:aV,formatUrl:tV,getStylesFromArray:d_,generateId:oV,random:cV,runFunc:AEe,entityDecode:MEe,insertTitle:NEe,isLabelCoordinateInPath:uV,parseFontSize:xc,InitIDGenerator:DEe},OEe=x(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),Tc=x(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),V0=x((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function Zi(t){return t??null}x(Zi,"handleUndefinedAttr");function uV(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return i.includes(r.toString())||i.includes(n.toString())}x(uV,"isLabelCoordinateInPath");var H2=x(({flowchart:t})=>{var i,a;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((a=t==null?void 0:t.subGraphTitleMargin)==null?void 0:a.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins");async function p_(t,e){const r=t.getElementsByTagName("img");if(!r||r.length===0)return;const n=e.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(i=>new Promise(a=>{function s(){if(i.style.display="flex",i.style.flexDirection="column",n){const o=Pe().fontSize?Pe().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=Fr.fontSize]=xc(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";a(i)}x(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}x(p_,"configureLabelImages");var $Ee=x(t=>{const{handDrawnSeed:e}=Pe();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),W0=x(t=>{const e=PEe([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),PEe=x(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i==null?void 0:i.trim())}),e},"styles2Map"),g_=x(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),Xt=x(t=>{const{stylesArray:e}=W0(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{const o=s[0];g_(o)?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),o.includes("stroke")&&i.push(s.join(":")+" !important"),o==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),Qt=x((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=Pe(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=W0(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:((l=s.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:BEe(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),BEe=x(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray");const FEe=Object.freeze({left:0,top:0,width:16,height:16}),O4=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),hV=Object.freeze({...FEe,...O4}),zEe=Object.freeze({...hV,body:"",hidden:!1}),GEe=Object.freeze({width:null,height:null}),qEe=Object.freeze({...GEe,...O4}),VEe=(t,e,r,n="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:o};return m_(u)?u:null}const a=i[0],s=a.split("-");if(s.length>1){const o={provider:n,prefix:s.shift(),name:s.join("-")};return m_(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return m_(o,r)?o:null}return null},m_=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function WEe(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function dV(t,e){const r=WEe(t,e);for(const n in zEe)n in O4?n in t&&!(n in r)&&(r[n]=O4[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function UEe(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;const o=n[s]&&n[s].parent,l=o&&a(o);l&&(i[s]=[o].concat(l))}return i[s]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function fV(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(o){a=dV(n[o]||i[o],a)}return s(e),r.forEach(s),dV(t,a)}function HEe(t,e){if(t.icons[e])return fV(t,e,[]);const r=UEe(t,[e])[e];return r?fV(t,e,r):null}const YEe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,XEe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function pV(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(YEe);if(n===null||!n.length)return t;const i=[];let a=n.shift(),s=XEe.test(a);for(;;){if(s){const o=parseFloat(a);isNaN(o)?i.push(a):i.push(Math.ceil(o*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}function KEe(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("",a);if(s===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function jEe(t,e){return t?""+t+""+e:e}function ZEe(t,e,r){const n=KEe(t);return jEe(n.defs,e+n.content+r)}const QEe=t=>t==="unset"||t==="undefined"||t==="none";function JEe(t,e){const r={...hV,...t},n={...qEe,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach(m=>{const y=[],v=m.hFlip,T=m.vFlip;let b=m.rotate;v?T?b+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):T&&(y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0);let w;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:w=i.height/2+i.top,y.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:w=i.width/2+i.left,y.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}b%2===1&&(i.left!==i.top&&(w=i.left,i.left=i.top,i.top=w),i.width!==i.height&&(w=i.width,i.width=i.height,i.height=w)),y.length&&(a=ZEe(a,'',""))});const s=n.width,o=n.height,l=i.width,u=i.height;let h,d;s===null?(d=o===null?"1em":o==="auto"?u:o,h=pV(d,l/u)):(h=s==="auto"?l:s,d=o===null?pV(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{QEe(y)||(f[m]=y.toString())};p("width",h),p("height",d);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:a}}const eSe=/\sid="(\S+)"/g,gV=new Map;function tSe(t){t=t.replace(/[0-9]+$/,"")||"a";const e=gV.get(t)||0;return gV.set(t,e+1),e?`${t}${e}`:t}function rSe(t){const e=[];let r;for(;r=eSe.exec(t);)e.push(r[1]);if(!e.length)return t;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(i=>{const a=tSe(i),s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function nSe(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'"+t+""}function y_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ud=y_();function mV(t){ud=t}var Y2={exec:()=>null};function en(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(Va.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var iSe=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},aSe=/^(?:[ \t]*(?:\n|$))+/,sSe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,oSe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,X2=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,lSe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,v_=/(?:[*+-]|\d{1,9}[.)])/,yV=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,vV=en(yV).replace(/bull/g,v_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),cSe=en(yV).replace(/bull/g,v_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),b_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,uSe=/^[^\n]+/,x_=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,hSe=en(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",x_).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),dSe=en(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,v_).getRegex(),$4="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",T_=/|$))/,fSe=en("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",T_).replace("tag",$4).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),bV=en(b_).replace("hr",X2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$4).getRegex(),pSe=en(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",bV).getRegex(),w_={blockquote:pSe,code:sSe,def:hSe,fences:oSe,heading:lSe,hr:X2,html:fSe,lheading:vV,list:dSe,newline:aSe,paragraph:bV,table:Y2,text:uSe},xV=en("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",X2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$4).getRegex(),gSe={...w_,lheading:cSe,table:xV,paragraph:en(b_).replace("hr",X2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",xV).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$4).getRegex()},mSe={...w_,html:en(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",T_).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Y2,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:en(b_).replace("hr",X2).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",vV).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ySe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,vSe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,TV=/^( {2,}|\\)\n(?!\s*$)/,bSe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",iSe?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),kV=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,kSe=en(kV,"u").replace(/punct/g,P4).getRegex(),ESe=en(kV,"u").replace(/punct/g,CV).getRegex(),EV="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",SSe=en(EV,"gu").replace(/notPunctSpace/g,wV).replace(/punctSpace/g,C_).replace(/punct/g,P4).getRegex(),ASe=en(EV,"gu").replace(/notPunctSpace/g,wSe).replace(/punctSpace/g,TSe).replace(/punct/g,CV).getRegex(),_Se=en("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,wV).replace(/punctSpace/g,C_).replace(/punct/g,P4).getRegex(),RSe=en(/\\(punct)/,"gu").replace(/punct/g,P4).getRegex(),LSe=en(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ISe=en(T_).replace("(?:-->|$)","-->").getRegex(),DSe=en("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",ISe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),B4=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,MSe=en(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",B4).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),SV=en(/^!?\[(label)\]\[(ref)\]/).replace("label",B4).replace("ref",x_).getRegex(),AV=en(/^!?\[(ref)\](?:\[\])?/).replace("ref",x_).getRegex(),NSe=en("reflink|nolink(?!\\()","g").replace("reflink",SV).replace("nolink",AV).getRegex(),_V=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,k_={_backpedal:Y2,anyPunctuation:RSe,autolink:LSe,blockSkip:CSe,br:TV,code:vSe,del:Y2,emStrongLDelim:kSe,emStrongRDelimAst:SSe,emStrongRDelimUnd:_Se,escape:ySe,link:MSe,nolink:AV,punctuation:xSe,reflink:SV,reflinkSearch:NSe,tag:DSe,text:bSe,url:Y2},OSe={...k_,link:en(/^!?\[(label)\]\((.*?)\)/).replace("label",B4).getRegex(),reflink:en(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",B4).getRegex()},E_={...k_,emStrongRDelimAst:ASe,emStrongLDelim:ESe,url:en(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",_V).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:en(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},RV=t=>PSe[t];function vl(t,e){if(e){if(Va.escapeTest.test(t))return t.replace(Va.escapeReplace,RV)}else if(Va.escapeTestNoEncode.test(t))return t.replace(Va.escapeReplaceNoEncode,RV);return t}function LV(t){try{t=encodeURI(t).replace(Va.percentDecode,"%")}catch{return null}return t}function IV(t,e){var a;let r=t.replace(Va.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Va.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function DV(t,e,r,n,i){let a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function FSe(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` + */var yl=T((t,e)=>{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";const r=t.x??0,n=t.y??0;return"translate("+-(r+t.width/2)+", "+-(n+t.height/2)+")"},"computeLabelTransform"),La={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Iq={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function q2(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=Vn(t),e=Vn(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}T(q2,"calculateDeltaAndAngle");var Vn=T(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),Dq=T(t=>({x:T(function(e,r,n){let i=0;const a=Vn(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(La,t.arrowTypeEnd)){const{angle:p,deltaX:g}=q2(n[n.length-1],n[n.length-2]);i=La[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const s=Math.abs(Vn(e).x-Vn(n[n.length-1]).x),o=Math.abs(Vn(e).y-Vn(n[n.length-1]).y),l=Math.abs(Vn(e).x-Vn(n[0]).x),u=Math.abs(Vn(e).y-Vn(n[0]).y),h=La[t.arrowTypeStart],d=La[t.arrowTypeEnd],f=1;if(s0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(La,t.arrowTypeEnd)){const{angle:p,deltaY:g}=q2(n[n.length-1],n[n.length-2]);i=La[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const s=Math.abs(Vn(e).y-Vn(n[n.length-1]).y),o=Math.abs(Vn(e).x-Vn(n[n.length-1]).x),l=Math.abs(Vn(e).y-Vn(n[0]).y),u=Math.abs(Vn(e).x-Vn(n[0]).x),h=La[t.arrowTypeStart],d=La[t.arrowTypeEnd],f=1;if(s0&&o0&&u-1}function r(s){var o=s.replace(t.ctrlCharactersRegex,"");return o.replace(t.htmlEntitiesRegex,function(l,u){return String.fromCharCode(u)})}function n(s){return URL.canParse(s)}function i(s){try{return decodeURIComponent(s)}catch{return s}}function a(s){if(!s)return t.BLANK_URL;var o,l=i(s.trim());do l=r(l).replace(t.htmlCtrlEntityRegex,"").replace(t.ctrlCharactersRegex,"").replace(t.whitespaceEscapeCharsRegex,"").trim(),l=i(l),o=l.match(t.ctrlCharactersRegex)||l.match(t.htmlEntitiesRegex)||l.match(t.htmlCtrlEntityRegex)||l.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var u=l;if(!u)return t.BLANK_URL;if(e(u))return u;var h=u.trimStart(),d=h.match(t.urlSchemeRegex);if(!d)return u;var f=d[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(f))return t.BLANK_URL;var p=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return p;if(f==="http:"||f==="https:"){if(!n(p))return t.BLANK_URL;var g=new URL(p);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return p}return I4}var cd=uEe();function hEe(t){return Array.isArray(t)}function r_(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function dEe(){}function Oq(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function V2(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const $q="[object RegExp]",n_="[object String]",i_="[object Number]",a_="[object Boolean]",s_="[object Arguments]",Pq="[object Symbol]",Bq="[object Date]",Fq="[object Map]",zq="[object Set]",Gq="[object Array]",qq="[object ArrayBuffer]",Vq="[object Object]",Wq="[object DataView]",Uq="[object Uint8Array]",Hq="[object Uint8ClampedArray]",Yq="[object Uint16Array]",Xq="[object Uint32Array]",Kq="[object Int8Array]",jq="[object Int16Array]",Zq="[object Int32Array]",Qq="[object Float32Array]",Jq="[object Float64Array]",eV=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function o_(t){return typeof eV.Buffer<"u"&&eV.Buffer.isBuffer(t)}function fEe(t){return Number.isSafeInteger(t)&&t>=0}function tV(t){return t!=null&&typeof t!="function"&&fEe(t.length)}function pEe(t){return t==="__proto__"}function D4(t){return t==null||typeof t!="object"&&typeof t!="function"}function l_(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function gEe(t,e){return qp(t,void 0,t,new Map,e)}function qp(t,e,r,n=new Map,i=void 0){const a=i==null?void 0:i(t,e,r,n);if(a!==void 0)return a;if(D4(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const s=new Array(t.length);n.set(t,s);for(let o=0;o{if(typeof t=="object"){if(V2(t)==="[object Object]"&&typeof t.constructor!="function"){const s={};return a.set(t,s),Do(s,t,i,a),s}switch(Object.prototype.toString.call(t)){case i_:case n_:case a_:{const s=new t.constructor(t==null?void 0:t.valueOf());return Do(s,t),s}case s_:{const s={};return Do(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}}})}function rV(t){return yEe(t)}function c_(t){return t!==null&&typeof t=="object"&&V2(t)==="[object Arguments]"}function u_(t){return typeof t=="object"&&t!==null}function vEe(t){return u_(t)&&tV(t)}function W2(t){return l_(t)}function bEe(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function U2(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");const r=function(...n){const i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);const s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(U2.Cache||Map),r}U2.Cache=Map;function xEe(t){if(D4(t))return t;const e=V2(t);if(!TEe(t))return{};if(hEe(t)){const n=Array.from(t);return t.length>0&&typeof t[0]=="string"&&Object.hasOwn(t,"index")&&(n.index=t.index,n.input=t.input),n}if(W2(t)){const n=t,i=n.constructor;return new i(n.buffer,n.byteOffset,n.length)}if(e==="[object ArrayBuffer]")return new ArrayBuffer(t.byteLength);if(e==="[object DataView]"){const n=t,i=n.buffer,a=n.byteOffset,s=n.byteLength,o=new ArrayBuffer(s),l=new Uint8Array(i,a,s);return new Uint8Array(o).set(l),new DataView(o)}if(e==="[object Boolean]"||e==="[object Number]"||e==="[object String]"){const n=t.constructor,i=new n(t.valueOf());return e==="[object String]"?CEe(i,t):h_(i,t),i}if(e==="[object Date]")return new Date(Number(t));if(e==="[object RegExp]"){const n=t,i=new RegExp(n.source,n.flags);return i.lastIndex=n.lastIndex,i}if(e==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(t));if(e==="[object Map]"){const n=t,i=new Map;return n.forEach((a,s)=>{i.set(s,a)}),i}if(e==="[object Set]"){const n=t,i=new Set;return n.forEach(a=>{i.add(a)}),i}if(e==="[object Arguments]"){const n=t,i={};return h_(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return kEe(r,t),h_(r,t),wEe(r,t),r}function TEe(t){switch(V2(t)){case s_:case Gq:case qq:case Wq:case a_:case Bq:case Qq:case Jq:case Kq:case jq:case Zq:case Fq:case i_:case Vq:case $q:case zq:case n_:case Pq:case Uq:case Hq:case Yq:case Xq:return!0;default:return!1}}function h_(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function wEe(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function kEe(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function EEe(t){if(D4(t))return t;if(Array.isArray(t)||l_(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t);if(e==null)return Object.assign(Object.create(e),t);const r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const n=new r(t);return n.lastIndex=t.lastIndex,n}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let n;return t instanceof AggregateError?n=new r(t.errors,t.message,{cause:t.cause}):n=new r(t.message,{cause:t.cause}),n.stack=t.stack,Object.assign(n,t),n}return typeof File<"u"&&t instanceof File?new r([t],t.name,{type:t.type,lastModified:t.lastModified}):typeof t=="object"?Object.assign(Object.create(e),t):t}function SEe(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let a=0;ar!=="constructor").length===0:e.length===0}return!0}var iV="​",_Ee={curveBasis:O2,curveBasisClosed:j3e,curveBasisOpen:Z3e,curveBumpX:kz,curveBumpY:Ez,curveBundle:Q3e,curveCardinalClosed:J3e,curveCardinalOpen:eke,curveCardinal:Rz,curveCatmullRomClosed:tke,curveCatmullRomOpen:rke,curveCatmullRom:Iz,curveLinear:M2,curveLinearClosed:nke,curveMonotoneX:zz,curveMonotoneY:Gz,curveNatural:Wz,curveStep:Uz,curveStepAfter:Yz,curveStepBefore:Hz},REe=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,LEe=T(function(t,e){const r=aV(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);Ew(s),n=ci(n,[...s])}else n=r.args;if(!n)return;let i=A6(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),aV=T(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${REe.source})(?=[}][%]{2}).* +`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),ae.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const s=[];for(;(a=u2.exec(t))!==null;)if(a.index===u2.lastIndex&&u2.lastIndex++,a&&!e||e&&((r=a[1])!=null&&r.match(e))||e&&((n=a[2])!=null&&n.match(e))){const o=a[1]?a[1]:a[2],l=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;s.push({type:o,args:l})}return s.length===0?{type:t,args:null}:s.length===1?s[0]:s}catch(i){return ae.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),IEe=T(function(t){return t.replace(u2,"")},"removeDirectives"),DEe=T(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function d_(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return _Ee[r]??e}T(d_,"interpolateToCurve");function sV(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?cd.sanitizeUrl(r):r}T(sV,"formatUrl");var MEe=T((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s{r+=f_(i,e),e=i});const n=r/2;return p_(t,n)}T(oV,"traverseEdge");function lV(t){return t.length===1?t[0]:oV(t)}T(lV,"calcLabelPosition");var cV=T((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),p_=T((t,e)=>{let r,n=e;for(const i of t){if(r){const a=f_(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:cV((1-s)*r.x+s*i.x,5),y:cV((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),NEe=T((t,e,r)=>{ae.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=p_(e,25),a=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(e[0].x+i.x)/2,o.y=-Math.cos(s)*a+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function uV(t,e,r){const n=structuredClone(r);ae.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=p_(n,i),s=10+t*.5,o=Math.atan2(n[0].y-a.y,n[0].x-a.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2-5):(l.x=Math.sin(o)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2),l}T(uV,"calcTerminalLabelPosition");function g_(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}T(g_,"getStylesFromArray");var hV=0,dV=T(()=>(hV++,"id-"+Math.random().toString(36).substr(2,12)+"-"+hV),"generateId");function fV(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;ifV(t.length),"random"),OEe=T(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),$Ee=T(function(t,e){const r=e.text.replace(Lt.lineBreakRegex," "),[,n]=xc(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),i},"drawSimpleText"),H2=U2((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),Lt.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=qa(`${s} `,r),u=qa(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=PEe(s,e,"-",r);i.push(a,...f),a=p}else u+l>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),PEe=U2((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let s="";return i.forEach((o,l)=>{const u=`${s}${o}`;if(qa(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;a.push(f?u:p),s=""}else s=u}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function N4(t,e){return O4(t,e).height}T(N4,"calculateTextHeight");function qa(t,e){return O4(t,e).width}T(qa,"calculateTextWidth");var O4=U2((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=xc(r),s=["sans-serif",n],o=t.split(Lt.lineBreakRegex),l=[],u=pt("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of s){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const y=OEe();y.text=m||iV;const v=$Ee(h,y).style("font-size",a).style("font-weight",i).style("font-family",f),x=(v._groups||v)[0][0].getBBox();if(x.width===0&&x.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,x.width)),p=Math.round(x.height),g.height+=p,g.lineHeight=Math.round(Math.max(g.lineHeight,p))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),BEe=(Rm=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},T(Rm,"InitIDGenerator"),Rm),$4,FEe=T(function(t){return $4=$4||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),$4.innerHTML=t,unescape($4.textContent)},"entityDecode");function m_(t){return"str"in t}T(m_,"isDetailedError");var zEe=T((t,e,r,n)=>{var a;if(!n)return;const i=(a=t.node())==null?void 0:a.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),xc=T(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function ti(t,e){return AEe({},t,e)}T(ti,"cleanAndMerge");var Lr={assignWithDepth:ci,wrapLabel:H2,calculateTextHeight:N4,calculateTextWidth:qa,calculateTextDimensions:O4,cleanAndMerge:ti,detectInit:LEe,detectDirective:aV,isSubstringInArray:DEe,interpolateToCurve:d_,calcLabelPosition:lV,calcCardinalityPosition:NEe,calcTerminalLabelPosition:uV,formatUrl:sV,getStylesFromArray:g_,generateId:dV,random:pV,runFunc:MEe,entityDecode:FEe,insertTitle:zEe,isLabelCoordinateInPath:gV,parseFontSize:xc,InitIDGenerator:BEe},GEe=T(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),Tc=T(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),Vp=T((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function Zi(t){return t??null}T(Zi,"handleUndefinedAttr");function gV(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return i.includes(r.toString())||i.includes(n.toString())}T(gV,"isLabelCoordinateInPath");var Y2=T(({flowchart:t})=>{var i,a;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((a=t==null?void 0:t.subGraphTitleMargin)==null?void 0:a.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins");async function y_(t,e){const r=t.getElementsByTagName("img");if(!r||r.length===0)return;const n=e.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(i=>new Promise(a=>{function s(){if(i.style.display="flex",i.style.flexDirection="column",n){const o=Pe().fontSize?Pe().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=Fr.fontSize]=xc(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";a(i)}T(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}T(y_,"configureLabelImages");var qEe=T(t=>{const{handDrawnSeed:e}=Pe();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),Wp=T(t=>{const e=VEe([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),VEe=T(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i==null?void 0:i.trim())}),e},"styles2Map"),v_=T(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),Xt=T(t=>{const{stylesArray:e}=Wp(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{const o=s[0];v_(o)?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),o.includes("stroke")&&i.push(s.join(":")+" !important"),o==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),Qt=T((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=Pe(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=Wp(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:((l=s.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:WEe(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),WEe=T(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray");const UEe=Object.freeze({left:0,top:0,width:16,height:16}),P4=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),mV=Object.freeze({...UEe,...P4}),HEe=Object.freeze({...mV,body:"",hidden:!1}),YEe=Object.freeze({width:null,height:null}),XEe=Object.freeze({...YEe,...P4}),KEe=(t,e,r,n="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:o};return b_(u)?u:null}const a=i[0],s=a.split("-");if(s.length>1){const o={provider:n,prefix:s.shift(),name:s.join("-")};return b_(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return b_(o,r)?o:null}return null},b_=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function jEe(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function yV(t,e){const r=jEe(t,e);for(const n in HEe)n in P4?n in t&&!(n in r)&&(r[n]=P4[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function ZEe(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;const o=n[s]&&n[s].parent,l=o&&a(o);l&&(i[s]=[o].concat(l))}return i[s]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function vV(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(o){a=yV(n[o]||i[o],a)}return s(e),r.forEach(s),yV(t,a)}function QEe(t,e){if(t.icons[e])return vV(t,e,[]);const r=ZEe(t,[e])[e];return r?vV(t,e,r):null}const JEe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,eSe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function bV(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(JEe);if(n===null||!n.length)return t;const i=[];let a=n.shift(),s=eSe.test(a);for(;;){if(s){const o=parseFloat(a);isNaN(o)?i.push(a):i.push(Math.ceil(o*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}function tSe(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("",a);if(s===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function rSe(t,e){return t?""+t+""+e:e}function nSe(t,e,r){const n=tSe(t);return rSe(n.defs,e+n.content+r)}const iSe=t=>t==="unset"||t==="undefined"||t==="none";function aSe(t,e){const r={...mV,...t},n={...XEe,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach(m=>{const y=[],v=m.hFlip,x=m.vFlip;let b=m.rotate;v?x?b+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):x&&(y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0);let w;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:w=i.height/2+i.top,y.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:w=i.width/2+i.left,y.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}b%2===1&&(i.left!==i.top&&(w=i.left,i.left=i.top,i.top=w),i.width!==i.height&&(w=i.width,i.width=i.height,i.height=w)),y.length&&(a=nSe(a,'',""))});const s=n.width,o=n.height,l=i.width,u=i.height;let h,d;s===null?(d=o===null?"1em":o==="auto"?u:o,h=bV(d,l/u)):(h=s==="auto"?l:s,d=o===null?bV(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{iSe(y)||(f[m]=y.toString())};p("width",h),p("height",d);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:a}}const sSe=/\sid="(\S+)"/g,xV=new Map;function oSe(t){t=t.replace(/[0-9]+$/,"")||"a";const e=xV.get(t)||0;return xV.set(t,e+1),e?`${t}${e}`:t}function lSe(t){const e=[];let r;for(;r=sSe.exec(t);)e.push(r[1]);if(!e.length)return t;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(i=>{const a=oSe(i),s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function cSe(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'"+t+""}function x_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ud=x_();function TV(t){ud=t}var X2={exec:()=>null};function en(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(Va.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var uSe=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^
/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},hSe=/^(?:[ \t]*(?:\n|$))+/,dSe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,fSe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,K2=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,pSe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,T_=/(?:[*+-]|\d{1,9}[.)])/,wV=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,CV=en(wV).replace(/bull/g,T_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),gSe=en(wV).replace(/bull/g,T_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),w_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,mSe=/^[^\n]+/,C_=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ySe=en(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",C_).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),vSe=en(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,T_).getRegex(),B4="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",k_=/|$))/,bSe=en("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",k_).replace("tag",B4).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),kV=en(w_).replace("hr",K2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",B4).getRegex(),xSe=en(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",kV).getRegex(),E_={blockquote:xSe,code:dSe,def:ySe,fences:fSe,heading:pSe,hr:K2,html:bSe,lheading:CV,list:vSe,newline:hSe,paragraph:kV,table:X2,text:mSe},EV=en("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",B4).getRegex(),TSe={...E_,lheading:gSe,table:EV,paragraph:en(w_).replace("hr",K2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",EV).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",B4).getRegex()},wSe={...E_,html:en(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",k_).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:X2,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:en(w_).replace("hr",K2).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",CV).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},CSe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,kSe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,SV=/^( {2,}|\\)\n(?!\s*$)/,ESe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",uSe?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),RV=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,LSe=en(RV,"u").replace(/punct/g,F4).getRegex(),ISe=en(RV,"u").replace(/punct/g,_V).getRegex(),LV="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",DSe=en(LV,"gu").replace(/notPunctSpace/g,AV).replace(/punctSpace/g,S_).replace(/punct/g,F4).getRegex(),MSe=en(LV,"gu").replace(/notPunctSpace/g,_Se).replace(/punctSpace/g,ASe).replace(/punct/g,_V).getRegex(),NSe=en("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,AV).replace(/punctSpace/g,S_).replace(/punct/g,F4).getRegex(),OSe=en(/\\(punct)/,"gu").replace(/punct/g,F4).getRegex(),$Se=en(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),PSe=en(k_).replace("(?:-->|$)","-->").getRegex(),BSe=en("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",PSe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),z4=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,FSe=en(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",z4).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),IV=en(/^!?\[(label)\]\[(ref)\]/).replace("label",z4).replace("ref",C_).getRegex(),DV=en(/^!?\[(ref)\](?:\[\])?/).replace("ref",C_).getRegex(),zSe=en("reflink|nolink(?!\\()","g").replace("reflink",IV).replace("nolink",DV).getRegex(),MV=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,A_={_backpedal:X2,anyPunctuation:OSe,autolink:$Se,blockSkip:RSe,br:SV,code:kSe,del:X2,emStrongLDelim:LSe,emStrongRDelimAst:DSe,emStrongRDelimUnd:NSe,escape:CSe,link:FSe,nolink:DV,punctuation:SSe,reflink:IV,reflinkSearch:zSe,tag:BSe,text:ESe,url:X2},GSe={...A_,link:en(/^!?\[(label)\]\((.*?)\)/).replace("label",z4).getRegex(),reflink:en(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z4).getRegex()},__={...A_,emStrongRDelimAst:MSe,emStrongLDelim:ISe,url:en(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",MV).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:en(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},NV=t=>VSe[t];function vl(t,e){if(e){if(Va.escapeTest.test(t))return t.replace(Va.escapeReplace,NV)}else if(Va.escapeTestNoEncode.test(t))return t.replace(Va.escapeReplaceNoEncode,NV);return t}function OV(t){try{t=encodeURI(t).replace(Va.percentDecode,"%")}catch{return null}return t}function $V(t,e){var a;let r=t.replace(Va.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Va.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function PV(t,e,r,n,i){let a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function USe(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` `).map(a=>{let s=a.match(r.other.beginningSpace);if(s===null)return a;let[o]=s;return o.length>=i.length?a.slice(i.length):a}).join(` -`)}var z4=class{constructor(e){Hr(this,"options");Hr(this,"rules");Hr(this,"lexer");this.options=e||ud}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:j2(n,` -`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=FSe(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=j2(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:j2(r[0],` -`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=j2(r[0],` +`)}var q4=class{constructor(e){Hr(this,"options");Hr(this,"rules");Hr(this,"lexer");this.options=e||ud}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Z2(n,` +`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=USe(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=Z2(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:Z2(r[0],` +`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=Z2(r[0],` `).split(` `),i="",a="",s=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let u=!1,h="",d="";if(!(r=s.exec(e))||this.rules.block.hr.test(e))break;h=r[0],e=e.substring(h.length);let f=r[2].split(` -`,1)[0].replace(this.rules.other.listReplaceTabs,T=>" ".repeat(3*T.length)),p=e.split(` +`,1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),p=e.split(` `,1)[0],g=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(p)&&(h+=p+` -`,e=e.substring(p.length+1),u=!0),!u){let T=this.rules.other.nextBulletRegex(m),b=this.rules.other.hrRegex(m),w=this.rules.other.fencesBeginRegex(m),k=this.rules.other.headingBeginRegex(m),A=this.rules.other.htmlBeginRegex(m);for(;e;){let C=e.split(` -`,1)[0],_;if(p=C,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),_=p):_=p.replace(this.rules.other.tabCharGlobal," "),w.test(p)||k.test(p)||A.test(p)||T.test(p)||b.test(p))break;if(_.search(this.rules.other.nonSpaceChar)>=m||!p.trim())d+=` +`,e=e.substring(p.length+1),u=!0),!u){let x=this.rules.other.nextBulletRegex(m),b=this.rules.other.hrRegex(m),w=this.rules.other.fencesBeginRegex(m),k=this.rules.other.headingBeginRegex(m),S=this.rules.other.htmlBeginRegex(m);for(;e;){let C=e.split(` +`,1)[0],_;if(p=C,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),_=p):_=p.replace(this.rules.other.tabCharGlobal," "),w.test(p)||k.test(p)||S.test(p)||x.test(p)||b.test(p))break;if(_.search(this.rules.other.nonSpaceChar)>=m||!p.trim())d+=` `+_.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(f)||k.test(f)||b.test(f))break;d+=` `+p}!g&&!p.trim()&&(g=!0),h+=C+` -`,e=e.substring(C.length+1),f=_.slice(m)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let y=null,v;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(v=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!y,checked:v,loose:!1,text:d,tokens:[]}),a.raw+=h}let l=a.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let u=0;uf.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=d}if(a.loose)for(let u=0;u({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[h]})));return s}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===` -`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=j2(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=BSe(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),DV(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return DV(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+a);(i=h.exec(r))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+o);if(Math.min(a,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},Mo=class XP{constructor(e){Hr(this,"tokens");Hr(this,"options");Hr(this,"state");Hr(this,"tokenizer");Hr(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ud,this.options.tokenizer=this.options.tokenizer||new z4,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Va,block:F4.normal,inline:K2.normal};this.options.pedantic?(r.block=F4.pedantic,r.inline=K2.pedantic):this.options.gfm&&(r.block=F4.gfm,this.options.breaks?r.inline=K2.breaks:r.inline=K2.gfm),this.tokenizer.rules=r}static get rules(){return{block:F4,inline:K2}}static lex(e,r){return new XP(r).lex(e)}static lexInline(e,r){return new XP(r).inlineTokens(e)}lex(e){e=e.replace(Va.carriageReturn,` +`,e=e.substring(C.length+1),f=_.slice(m)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let y=null,v;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(v=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!y,checked:v,loose:!1,text:d,tokens:[]}),a.raw+=h}let l=a.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let u=0;uf.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=d}if(a.loose)for(let u=0;u({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[h]})));return s}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===` +`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Z2(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=WSe(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),PV(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return PV(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+a);(i=h.exec(r))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+o);if(Math.min(a,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},Mo=class JP{constructor(e){Hr(this,"tokens");Hr(this,"options");Hr(this,"state");Hr(this,"tokenizer");Hr(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ud,this.options.tokenizer=this.options.tokenizer||new q4,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Va,block:G4.normal,inline:j2.normal};this.options.pedantic?(r.block=G4.pedantic,r.inline=j2.pedantic):this.options.gfm&&(r.block=G4.gfm,this.options.breaks?r.inline=j2.breaks:r.inline=j2.gfm),this.tokenizer.rules=r}static get rules(){return{block:G4,inline:j2}}static lex(e,r){return new JP(r).lex(e)}static lexInline(e,r){return new JP(r).inlineTokens(e)}lex(e){e=e.replace(Va.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let r=0;r(o=u.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let u=r.at(-1);o.raw.length===1&&u!==void 0?u.raw+=` `:r.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` @@ -196,7 +196,7 @@ ${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o),n=l.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` -`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(T=>{v=T.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},G4=class{constructor(e){Hr(this,"options");Hr(this,"parser");this.options=e||ud}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(Va.notSpaceStart))==null?void 0:s[0],a=e.replace(Va.endingNewline,"")+` +`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(x=>{v=x.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},V4=class{constructor(e){Hr(this,"options");Hr(this,"parser");this.options=e||ud}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(Va.notSpaceStart))==null?void 0:s[0],a=e.replace(Va.endingNewline,"")+` `;return i?'
'+(n?a:vl(a,!0))+`
`:"
"+(n?a:vl(a,!0))+`
`}blockquote({tokens:e}){return`
@@ -214,28 +214,28 @@ ${this.parser.parse(e)}
`}tablerow({text:e}){return` ${e} `}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+` -`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${vl(e,!0)}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=LV(e);if(a===null)return i;e=a;let s='
",s}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=LV(e);if(a===null)return vl(n);e=a;let s=`${n}{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new G4(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new z4(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new Z2;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=a[o];Z2.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&Z2.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await l.call(a,h);return u.call(a,f)})();let d=l.call(a,h);return u.call(a,d)}:a[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(a,h);return f===!1&&(f=await u.apply(a,h)),f})();let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return Mo.lex(e,r??this.defaults)}parser(e,r){return No.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let o=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer():e?Mo.lex:Mo.lexInline)(o,a),u=a.hooks?await a.hooks.processAllTokens(l):l;a.walkTokens&&await Promise.all(this.walkTokens(u,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser():e?No.parse:No.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let o=(a.hooks?a.hooks.provideLexer():e?Mo.lex:Mo.lexInline)(r,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&this.walkTokens(o,a.walkTokens);let l=(a.hooks?a.hooks.provideParser():e?No.parse:No.parseInline)(o,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(e,r){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let i="

An error occurred:

"+vl(n.message+"",!0)+"
";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},hd=new zSe;function ln(t,e){return hd.parse(t,e)}ln.options=ln.setOptions=function(t){return hd.setOptions(t),ln.defaults=hd.defaults,mV(ln.defaults),ln},ln.getDefaults=y_,ln.defaults=ud,ln.use=function(...t){return hd.use(...t),ln.defaults=hd.defaults,mV(ln.defaults),ln},ln.walkTokens=function(t,e){return hd.walkTokens(t,e)},ln.parseInline=hd.parseInline,ln.Parser=No,ln.parser=No.parse,ln.Renderer=G4,ln.TextRenderer=S_,ln.Lexer=Mo,ln.lexer=Mo.lex,ln.Tokenizer=z4,ln.Hooks=Z2,ln.parse=ln,ln.options,ln.setOptions,ln.use,ln.walkTokens,ln.parseInline,No.parse,Mo.lex;function MV(t){for(var e=[],r=1;r${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${vl(e,!0)}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=OV(e);if(a===null)return i;e=a;let s='
",s}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=OV(e);if(a===null)return vl(n);e=a;let s=`${n}{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new V4(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new q4(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new Q2;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=a[o];Q2.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&Q2.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await l.call(a,h);return u.call(a,f)})();let d=l.call(a,h);return u.call(a,d)}:a[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(a,h);return f===!1&&(f=await u.apply(a,h)),f})();let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return Mo.lex(e,r??this.defaults)}parser(e,r){return No.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let o=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer():e?Mo.lex:Mo.lexInline)(o,a),u=a.hooks?await a.hooks.processAllTokens(l):l;a.walkTokens&&await Promise.all(this.walkTokens(u,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser():e?No.parse:No.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let o=(a.hooks?a.hooks.provideLexer():e?Mo.lex:Mo.lexInline)(r,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&this.walkTokens(o,a.walkTokens);let l=(a.hooks?a.hooks.provideParser():e?No.parse:No.parseInline)(o,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(e,r){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let i="

An error occurred:

"+vl(n.message+"",!0)+"
";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},hd=new HSe;function ln(t,e){return hd.parse(t,e)}ln.options=ln.setOptions=function(t){return hd.setOptions(t),ln.defaults=hd.defaults,TV(ln.defaults),ln},ln.getDefaults=x_,ln.defaults=ud,ln.use=function(...t){return hd.use(...t),ln.defaults=hd.defaults,TV(ln.defaults),ln},ln.walkTokens=function(t,e){return hd.walkTokens(t,e)},ln.parseInline=hd.parseInline,ln.Parser=No,ln.parser=No.parse,ln.Renderer=V4,ln.TextRenderer=R_,ln.Lexer=Mo,ln.lexer=Mo.lex,ln.Tokenizer=q4,ln.Hooks=Q2,ln.parse=ln,ln.options,ln.setOptions,ln.use,ln.walkTokens,ln.parseInline,No.parse,Mo.lex;function BV(t){for(var e=[],r=1;r?',height:80,width:80},A_=new Map,OV=new Map,$V=x(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(ae.debug("Registering icon pack:",e.name),"loader"in e)OV.set(e.name,e.loader);else if("icons"in e)A_.set(e.name,e.icons);else throw ae.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),PV=x(async(t,e)=>{const r=VEe(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=A_.get(n);if(!i){const s=OV.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},A_.set(n,i)}catch(o){throw ae.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=HEe(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),GSe=x(async t=>{try{return await PV(t),!0}catch{return!1}},"isIconAvailable"),Lu=x(async(t,e,r)=>{let n;try{n=await PV(t,e==null?void 0:e.fallbackPrefix)}catch(s){ae.error(s),n=NV}const i=JEe(n,e),a=nSe(rSe(i.body),{...i.attributes,...r});return qr(a,lr())},"getIconSVG");function BV(t,{markdownAutoWrap:e}){const n=t.replace(//g,` +`)),s+=d+n[l+1]}),s}var FV={body:'?',height:80,width:80},L_=new Map,zV=new Map,GV=T(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(ae.debug("Registering icon pack:",e.name),"loader"in e)zV.set(e.name,e.loader);else if("icons"in e)L_.set(e.name,e.icons);else throw ae.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),qV=T(async(t,e)=>{const r=KEe(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=L_.get(n);if(!i){const s=zV.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},L_.set(n,i)}catch(o){throw ae.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=QEe(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),YSe=T(async t=>{try{return await qV(t),!0}catch{return!1}},"isIconAvailable"),Lu=T(async(t,e,r)=>{let n;try{n=await qV(t,e==null?void 0:e.fallbackPrefix)}catch(s){ae.error(s),n=FV}const i=aSe(n,e),a=cSe(lSe(i.body),{...i.attributes,...r});return qr(a,lr())},"getIconSVG");function VV(t,{markdownAutoWrap:e}){const n=t.replace(//g,` `).replace(/\n{2,}/g,` -`);return MV(n)}x(BV,"preprocessMarkdown");function FV(t){return t.split(/\\n|\n|/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}x(FV,"nonMarkdownToLines");function zV(t,e={}){const r=BV(t,e),n=ln.lexer(r),i=[[]];let a=0;function s(o,l="normal"){o.type==="text"?o.text.split(` -`).forEach((h,d)=>{d!==0&&(a++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&i[a].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{s(u,o.type)}):o.type==="html"&&i[a].push({content:o.text,type:"normal"})}return x(s,"processNode"),n.forEach(o=>{var l;o.type==="paragraph"?(l=o.tokens)==null||l.forEach(u=>{s(u)}):o.type==="html"?i[a].push({content:o.text,type:"normal"}):i[a].push({content:o.raw,type:"normal"})}),i}x(zV,"markdownToLines");function GV(t){return t?`

${t.replace(/\\n|\n/g,"
")}

`:""}x(GV,"nonMarkdownToHTML");function qV(t,{markdownAutoWrap:e}={}){const r=ln.lexer(t);function n(i){var a,s,o;return i.type==="text"?e===!1?i.text.replace(/\n */g,"
").replace(/ /g," "):i.text.replace(/\n */g,"
"):i.type==="strong"?`${(a=i.tokens)==null?void 0:a.map(n).join("")}`:i.type==="em"?`${(s=i.tokens)==null?void 0:s.map(n).join("")}`:i.type==="paragraph"?`

${(o=i.tokens)==null?void 0:o.map(n).join("")}

`:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(ae.warn(`Unsupported markdown: ${i.type}`),i.raw)}return x(n,"output"),r.map(n).join("")}x(qV,"markdownToHTML");function VV(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}x(VV,"splitTextToChars");function WV(t,e){const r=VV(e.content);return __(t,[],r,e.type)}x(WV,"splitWordToFitWidth");function __(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,s=[...e,i];return t([{content:s.join(""),type:n}])?__(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}x(__,"splitWordToFitWidthRecursion");function UV(t,e){if(t.some(({content:r})=>r.includes(` -`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return q4(t,e)}x(UV,"splitLineToFitWidth");function q4(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},s=[...n];if(i!==""&&s.push({content:i,type:"normal"}),s.push(a),e(s))return q4(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[o,l]=WV(e,a);r.push([o]),l.content&&t.unshift(l)}return q4(t,e,r)}x(q4,"splitLineToFitWidthRecursion");function R_(t,e){e&&t.attr("style",e)}x(R_,"applyStyle");var HV=16384;async function YV(t,e,r,n,i=!1,a=lr()){const s=t.append("foreignObject");s.attr("width",`${Math.min(10*r,HV)}px`),s.attr("height",`${Math.min(10*r,HV)}px`);const o=s.append("xhtml:div"),l=ui(e.label)?await _w(e.label.replace(Lt.lineBreakRegex,` -`),a):qr(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),R_(h,e.labelStyle),h.attr("class",`${u} ${n}`),R_(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),s.node()}x(YV,"addHtmlSpan");function V4(t,e,r,n=!1){const i=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}x(V4,"createTspan");function XV(t,e,r){const n=t.append("text"),i=V4(n,1,e);W4(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}x(XV,"computeWidthOfText");function KV(t,e,r){var s;const n=t.append("text"),i=V4(n,1,e);W4(i,[{content:r,type:"normal"}]);const a=(s=i.node())==null?void 0:s.getBoundingClientRect();return a&&n.remove(),a}x(KV,"computeDimensionOfText");function jV(t,e,r,n=!1,i=!1){const s=e.append("g"),o=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=x(p=>XV(s,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:UV(h,d);for(const p of f){const g=V4(l,u,1.1,i);W4(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return o.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}x(jV,"createFormattedText");function L_(t){const e=/&(amp|lt|gt);/g;return t.replace(e,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}x(L_,"decodeHTMLEntities");function W4(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(L_(r.content)):i.text(" "+L_(r.content))})}x(W4,"updateTextContentAndStyles");async function ZV(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await GSe(o)?await Lu(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}x(ZV,"replaceIconSubstring");var Wa=x(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:s=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(ae.debug("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",u),a){const d=s?qV(e,h):GV(e),f=await ZV(Tc(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:ui(e)?p:f,labelStyle:r.replace("fill:","color:")};return await YV(t,g,l,i,u,h)}else{const d=Tc(e.replace(//g,"
")),f=s?zV(d.replace("
","
"),h):FV(d),p=jV(l,t,f,e?u:!1,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");pt(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");pt(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");pt(p).select("text").attr("style",m)}return n?pt(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):pt(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function I_(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,s=Math.cos(a),o=Math.sin(a);for(const l of t){const[u,h]=l;l[0]=(u-n)*s-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*s+i}}}function qSe(t,e){return t[0]===e[0]&&t[1]===e[1]}function VSe(t,e,r,n=1){const i=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of s)I_(u,o,i);const l=(function(u,h,d){const f=[];for(const T of u){const b=[...T];qSe(b[0],b[b.length-1])||b.push([b[0][0],b[0][1]]),b.length>2&&f.push(b)}const p=[];h=Math.max(h,.1);const g=[];for(const T of f)for(let b=0;bT.yminb.ymin?1:T.xb.x?1:T.ymax===b.ymax?0:(T.ymax-b.ymax)/Math.abs(T.ymax-b.ymax))),!g.length)return p;let m=[],y=g[0].ymin,v=0;for(;m.length||g.length;){if(g.length){let T=-1;for(let b=0;by);b++)T=b;g.splice(0,T+1).forEach((b=>{m.push({s:y,edge:b})}))}if(m=m.filter((T=>!(T.edge.ymax<=y))),m.sort(((T,b)=>T.edge.x===b.edge.x?0:(T.edge.x-b.edge.x)/Math.abs(T.edge.x-b.edge.x))),(d!==1||v%h==0)&&m.length>1)for(let T=0;T=m.length)break;const w=m[T].edge,k=m[b].edge;p.push([[Math.round(w.x),y],[Math.round(k.x),y]])}y+=d,m.forEach((T=>{T.edge.x=T.edge.x+d*T.edge.islope})),v++}return p})(s,a,n);if(i){for(const u of s)I_(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),I_(f,h,d)})(l,o,-i)}return l}function Q2(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),VSe(t,i,n,a||1)}class D_{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=Q2(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function U4(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class WSe extends D_{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=Q2(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],o=.5*n*Math.cos(a),l=.5*n*Math.sin(a);for(const[u,h]of i)U4([u,h])&&s.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class USe extends D_{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,i);return n.ops=n.ops.concat(a.ops),n}}let HSe=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=Q2(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=i/4;for(const o of e){const l=U4(o),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let g=0;g{const o=U4(s),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const s=U4(a),o=Math.round(s/(2*r));let l=a[0],u=a[1];l[0]>u[0]&&(l=a[1],u=a[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;dh%2?u+r:u+e));a.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":a.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function eW(t){const e=[];let r="",n=0,i=0,a=0,s=0,o=0,l=0;for(const{key:u,data:h}of t){switch(u){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=n+(n-o),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[d,f]=h;let p=0,g=0;r==="Q"||r==="T"?(p=n+(n-o),g=i+(i-l)):(p=n,g=i);const m=n+2*(p-n)/3,y=i+2*(g-i)/3,v=d+2*(p-d)/3,T=f+2*(g-f)/3;e.push({key:"C",data:[m,y,v,T,d,f]}),o=p,l=g,n=d,i=f;break}case"Q":{const[d,f,p,g]=h,m=n+2*(d-n)/3,y=i+2*(f-i)/3,v=p+2*(d-p)/3,T=g+2*(f-g)/3;e.push({key:"C",data:[m,y,v,T,p,g]}),o=d,l=f,n=p,i=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),p=h[2],g=h[3],m=h[4],y=h[5],v=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,y,v,y,v]}),n=y,i=v):(n!==y||i!==v)&&(tW(n,i,y,v,d,f,p,g,m).forEach((function(T){e.push({key:"C",data:T})})),n=y,i=v);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=u}return e}function J2(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function tW(t,e,r,n,i,a,s,o,l,u){const h=(d=s,Math.PI*d/180);var d;let f=[],p=0,g=0,m=0,y=0;if(u)[p,g,m,y]=u;else{[t,e]=J2(t,e,-h),[r,n]=J2(r,n,-h);const F=(t-r)/2,S=(e-n)/2;let R=F*F/(i*i)+S*S/(a*a);R>1&&(R=Math.sqrt(R),i*=R,a*=R);const N=i*i,D=a*a,I=N*D-N*S*S-D*F*F,$=N*S*S+D*F*F,B=(o===l?-1:1)*Math.sqrt(Math.abs(I/$));m=B*i*S/a+(t+r)/2,y=B*-a*F/i+(e+n)/2,p=Math.asin(parseFloat(((e-y)/a).toFixed(9))),g=Math.asin(parseFloat(((n-y)/a).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let v=g-p;if(Math.abs(v)>120*Math.PI/180){const F=g,S=r,R=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=tW(r=m+i*Math.cos(g),n=y+a*Math.sin(g),S,R,i,a,s,0,l,[g,F,m,y])}v=g-p;const T=Math.cos(p),b=Math.sin(p),w=Math.cos(g),k=Math.sin(g),A=Math.tan(v/4),C=4/3*i*A,_=4/3*a*A,L=[t,e],O=[t+C*b,e-_*T],M=[r+C*k,n-_*w],z=[r,n];if(O[0]=2*L[0]-O[0],O[1]=2*L[1]-O[1],u)return[O,M,z].concat(f);{f=[O,M,z].concat(f);const F=[];for(let S=0;S2){const i=[];for(let a=0;a2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-p)/2),v=uW(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const T=uW(y,u,h,d,f,p,g,1.5,l);v.push(...T)}return s&&(o?v.push(...Iu(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...Iu(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):v.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:v}}function sW(t,e){const r=eW(JV(O_(t))),n=[];let i=[0,0],a=[0,0];for(const{key:s,data:o}of r)switch(s){case"M":a=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...Iu(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...JSe(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...Iu(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function P_(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+wr(i,e),n[0][1]+wr(i,e)]});for(let s=1;s500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*lW(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=wr(p,i,u),g=wr(g,i,u);const m=[],y=()=>wr(d,i,u),v=()=>wr(h,i,u),T=i.preserveVertices;return s?m.push({op:"move",data:[t+(T?0:y()),e+(T?0:y())]}):m.push({op:"move",data:[t+(T?0:wr(h,i,u)),e+(T?0:wr(h,i,u))]}),s?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+y(),g+e+(n-e)*f+y(),p+t+2*(r-t)*f+y(),g+e+2*(n-e)*f+y(),r+(T?0:y()),n+(T?0:y())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*f+v(),g+e+(n-e)*f+v(),p+t+2*(r-t)*f+v(),g+e+2*(n-e)*f+v(),r+(T?0:v()),n+(T?0:v())]}),m}function K4(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+wr(e,r),t[0][1]+wr(e,r)]),n.push([t[0][0]+wr(e,r),t[0][1]+wr(e,r)]);for(let i=1;i3){const a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+21&&i.push(o)):i.push(o),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=dd(l,u,.5),p=dd(u,h,.5),g=dd(h,d,.5),m=dd(f,p,.5),y=dd(p,g,.5),v=dd(m,y,.5);F_([l,f,m,v],0,r,i),F_([v,y,g,d],0,r,i)}var a,s;return i}function t6e(t,e){return Q4(t,0,t.length,e)}function Q4(t,e,r,n,i){const a=i||[],s=t[e],o=t[r-1];let l=0,u=1;for(let h=e+1;hl&&(l=d,u=h)}return Math.sqrt(l)>n?(Q4(t,e,u+1,n,a),Q4(t,u,r,n,a)):(a.length||a.push(s),a.push(o)),a}function z_(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?Q4(n,0,n.length,r):n}const Bs="none";class J4{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,a){const s=this._o(a);return this._d("line",[rW(e,r,n,i,s)],s)}rectangle(e,r,n,i,a){const s=this._o(a),o=[],l=QSe(e,r,n,i,s);if(s.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];s.fillStyle==="solid"?o.push(P_([u],s)):o.push(U0([u],s))}return s.stroke!==Bs&&o.push(l),this._d("rectangle",o,s)}ellipse(e,r,n,i,a){const s=this._o(a),o=[],l=iW(n,i,s),u=$_(e,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=$_(e,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(U0([u.estimatedPoints],s));return s.stroke!==Bs&&o.push(u.opset),this._d("ellipse",o,s)}circle(e,r,n,i){const a=this.ellipse(e,r,n,n,i);return a.shape="circle",a}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[Y4(e,!1,n)],n)}arc(e,r,n,i,a,s,o=!1,l){const u=this._o(l),h=[],d=aW(e,r,n,i,a,s,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=aW(e,r,n,i,a,s,!0,!1,f);p.type="fillPath",h.push(p)}else h.push((function(f,p,g,m,y,v,T){const b=f,w=p;let k=Math.abs(g/2),A=Math.abs(m/2);k+=wr(.01*k,T),A+=wr(.01*A,T);let C=y,_=v;for(;C<0;)C+=2*Math.PI,_+=2*Math.PI;_-C>2*Math.PI&&(C=0,_=2*Math.PI);const L=(_-C)/T.curveStepCount,O=[];for(let M=C;M<=_;M+=L)O.push([b+k*Math.cos(M),w+A*Math.sin(M)]);return O.push([b+k*Math.cos(_),w+A*Math.sin(_)]),O.push([b,w]),U0([O],T)})(e,r,n,i,a,s,u));return u.stroke!==Bs&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=nW(e,n);if(n.fill&&n.fill!==Bs)if(n.fillStyle==="solid"){const s=nW(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?s.push(...u):u.length===3?s.push(...z_(hW([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):s.push(...z_(hW(u),10,(1+n.roughness)/2))}s.length&&i.push(U0([s],n))}return n.stroke!==Bs&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=Y4(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(P_([e],n)):i.push(U0([e],n))),n.stroke!==Bs&&i.push(a),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=n.fill&&n.fill!=="transparent"&&n.fill!==Bs,s=n.stroke!==Bs,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=eW(JV(O_(h))),g=[];let m=[],y=[0,0],v=[];const T=()=>{v.length>=4&&m.push(...z_(v,d)),v=[]},b=()=>{T(),m.length&&(g.push(m),m=[])};for(const{key:k,data:A}of p)switch(k){case"M":b(),y=[A[0],A[1]],m.push(y);break;case"L":T(),m.push([A[0],A[1]]);break;case"C":if(!v.length){const C=m.length?m[m.length-1]:y;v.push([C[0],C[1]])}v.push([A[0],A[1]]),v.push([A[2],A[3]]),v.push([A[4],A[5]]);break;case"Z":T(),m.push([y[0],y[1]])}if(b(),!f)return g;const w=[];for(const k of g){const A=t6e(k,f);A.length&&w.push(A)}return w})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=sW(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=sW(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(P_(l,n));else i.push(U0(l,n));return s&&(o?l.forEach((h=>{i.push(Y4(h,!1,n))})):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const a=typeof r=="number"&&r>=0?i.data.map((s=>+s.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Bs};break;case"fillPath":s={d:this.opsToPath(a),stroke:Bs,strokeWidth:0,fill:n.fill||Bs};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Bs,strokeWidth:n,fill:Bs}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}}class r6e{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new J4(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const a of r.ops){const s=typeof n=="number"&&n>=0?a.data.map((o=>+o.toFixed(n))):a.data;switch(a.op){case"move":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s),s}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s),s}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s),s}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a),a}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u),u}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}}const eC="http://www.w3.org/2000/svg";class n6e{constructor(e,r){this.svg=e,this.gen=new J4(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(eC,"g"),s=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(eC,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(eC,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&a.appendChild(l)}return a}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const a=e.createElementNS(eC,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s)}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s)}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s)}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}}var Kt={canvas:(t,e)=>new r6e(t,e),svg:(t,e)=>new n6e(t,e),generator:t=>new J4(t),newSeed:()=>J4.newSeed()},xr=x(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||hc((p=Pe())==null?void 0:p.htmlLabels);r?n=r:n="node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",Zi(e.labelStyle));let o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await Wa(s,qr(Tc(o),Pe()),{useHtmlLabels:i,width:e.width||((g=Pe().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},Pe());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],y=pt(h);await p_(m,o),d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height)}return i?s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):s.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:d,halfPadding:f,label:s}},"labelHelper"),G_=x(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??on(Pe()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Wa(i,qr(Tc(e),Pe()),{useHtmlLabels:n,width:r.width||((u=(l=Pe())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let s=a.getBBox();const o=r.padding/2;if(on(Pe())){const h=a.children[0],d=pt(a);s=h.getBoundingClientRect(),d.attr("width",s.width),d.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:s,halfPadding:o,label:i}},"insertLabel"),rr=x((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),gr=x((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Wr(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}x(Wr,"createPathFromPoints");function Du(t,e,r,n,i,a){const s=[],l=r-t,u=n-e,h=l/a,d=2*Math.PI/h,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,y=f+i*Math.sin(d*(m-t));s.push({x:m,y})}return s}x(Du,"generateFullSineWavePoints");function tb(t,e,r,n,i,a){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=e.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);const i=e.find(l=>l.getAttribute("fill")!=="none"),a=e.find(l=>l.getAttribute("stroke")!=="none"),s=x((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:s(i,"fill"),"fill-opacity":s(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(a){const l={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}x(q_,"mergePaths");var i6e=x((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),H0=i6e,a6e=x(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Pe(),o=on(s);return await Wa(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Mu=a6e,Nu=x((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),dW=x(async(t,e)=>{ae.info("Creating subgraph rect for ",e.id,e);const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Xt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=on(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await Wa(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await Mu(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(on(r)){const C=g.children[0],_=pt(g);m=C.getBoundingClientRect(),_.attr("width",m.width),_.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,T=e.x-y/2,b=e.y-v/2;ae.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const C=Kt.svg(d),_=Qt(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),L=C.path(Nu(T,b,y,v,0),_);w=d.insert(()=>(ae.debug("Rough node insert CXC",L),L),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",T).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:k}=H2(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+k})`),o){const C=p.select("span");C&&C.attr("style",o)}const A=w.node().getBBox();return e.offsetX=0,e.width=A.width,e.height=A.height,e.offsetY=m.height-e.padding/2,e.intersect=function(C){return H0(e,C)},{cluster:d,labelBBox:m}},"rect"),s6e=x((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(o){return H0(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),o6e=x(async(t,e)=>{const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=n,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),h=u.insert("g",":first-child"),d=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await Mu(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(on(r)){const L=p.children[0],O=pt(p);g=L.getBoundingClientRect(),O.attr("width",g.width),O.attr("height",g.height)}const m=0*e.padding,y=m/2,v=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const T=e.height+m,b=e.height+m-g.height-6,w=e.x-v/2,k=e.y-T/2;e.width=v;const A=e.y-e.height/2-y+g.height+2;let C;if(e.look==="handDrawn"){const L=e.cssClasses.includes("statediagram-cluster-alt"),O=Kt.svg(u),M=e.rx||e.ry?O.path(Nu(w,k,v,T,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):O.rectangle(w,k,v,T,{seed:i});C=u.insert(()=>M,":first-child");const z=O.rectangle(w,A,v,b,{fill:L?a:s,fillStyle:L?"hachure":"solid",stroke:l,seed:i});C=u.insert(()=>M,":first-child"),f=u.insert(()=>z)}else C=h.insert("rect",":first-child"),C.attr("class","outer").attr("x",w).attr("y",k).attr("width",v).attr("height",T).attr("data-look",e.look),f.attr("class","inner").attr("x",w).attr("y",A).attr("width",v).attr("height",b);d.attr("transform",`translate(${e.x-g.width/2}, ${k+1-(on(r)?0:3)})`);const _=C.node().getBBox();return e.height=_.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(L){return H0(e,L)},{cluster:u,labelBBox:g}},"roundedWithTitle"),l6e=x(async(t,e)=>{ae.info("Creating subgraph rect for ",e.id,e);const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Xt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=on(r),p=d.insert("g").attr("class","cluster-label "),g=await Wa(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(on(r)){const C=g.children[0],_=pt(g);m=C.getBoundingClientRect(),_.attr("width",m.width),_.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,T=e.x-y/2,b=e.y-v/2;ae.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const C=Kt.svg(d),_=Qt(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),L=C.path(Nu(T,b,y,v,e.rx),_);w=d.insert(()=>(ae.debug("Rough node insert CXC",L),L),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",T).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:k}=H2(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+k})`),o){const C=p.select("span");C&&C.attr("style",o)}const A=w.node().getBBox();return e.offsetX=0,e.width=A.width,e.height=A.height,e.offsetY=m.height-e.padding/2,e.intersect=function(C){return H0(e,C)},{cluster:d,labelBBox:m}},"kanbanSection"),c6e=x((t,e)=>{const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),o=s.insert("g",":first-child"),l=0*e.padding,u=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-u/2,f=e.y-h/2;e.width=u;let p;if(e.look==="handDrawn"){const y=Kt.svg(s).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert(()=>y,":first-child")}else{p=o.insert("rect",":first-child");let m="outer";e.look,m="divider",p.attr("class",m).attr("x",d).attr("y",f).attr("width",u).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return H0(e,m)},{cluster:s,labelBBox:{}}},"divider"),u6e=dW,h6e={rect:dW,squareRect:u6e,roundedWithTitle:o6e,noteGroup:s6e,divider:c6e,kanbanSection:l6e},fW=new Map,V_=x(async(t,e)=>{const r=e.shape||"rect",n=await h6e[r](t,e);return fW.set(e.id,n),n},"insertCluster"),d6e=x(()=>{fW=new Map},"clear");function pW(t,e){return t.intersect(e)}x(pW,"intersectNode");var f6e=pW;function gW(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}x(W_,"sameSign");var g6e=vW;function bW(t,e,r){let n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){s=Math.min(s,h.x),o=Math.min(o,h.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));let l=n-t.width/2-s,u=i-t.height/2-o;for(let h=0;h1&&a.sort(function(h,d){let f=h.x-r.x,p=h.y-r.y,g=Math.sqrt(f*f+p*p),m=d.x-r.x,y=d.y-r.y,v=Math.sqrt(m*m+y*y);return gh,":first-child");return d.attr("class","anchor").attr("style",Zi(o)),rr(e,d),e.intersect=function(f){return ae.info("Circle intersect",e,s,f),Ht.circle(e,s,f)},a}x(xW,"anchor");function U_(t,e,r,n,i,a,s){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/a,m=Math.sqrt(p**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),v=l+y*a*Math.sin(h)*(s?-1:1),T=u-y*i*Math.cos(h)*(s?-1:1),b=Math.atan2((e-T)/a,(t-v)/i);let k=Math.atan2((n-T)/a,(r-v)/i)-b;s&&k<0&&(k+=2*Math.PI),!s&&k>0&&(k-=2*Math.PI);const A=[];for(let C=0;C<20;C++){const _=C/19,L=b+_*k,O=v+i*Math.cos(L),M=T+a*Math.sin(L);A.push({x:O,y:M})}return A}x(U_,"generateArcPoints");function TW(t,e,r){const[n,i]=[e,r].sort((a,s)=>s-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}x(TW,"calculateArcSagitta");async function wW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=x(L=>L+s,"calcTotalHeight"),l=x(L=>{const O=L/2;return[O/(2.5+L/50),O]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await xr(t,e,gr(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=TW(d,f,p),y=(e!=null&&e.width?e==null?void 0:e.width:h.width)+a*2+g-g,v=d,{cssStyles:T}=e,b=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},...U_(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...U_(y/2,v/2,y/2,-v/2,f,p,!0)],w=Kt.svg(u),k=Qt(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const A=Wr(b),C=w.path(A,k),_=u.insert(()=>C,":first-child");return _.attr("class","basic label-container outer-path"),T&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",T),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(${f/2}, 0)`),rr(e,_),e.intersect=function(L){return Ht.polygon(e,b,L)},u}x(wW,"bowTieRect");function wc(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x(wc,"insertPolygonShape");var tC=12;async function CW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?28:i,s=e.look==="neo"?24:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+tC),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),d=0,f=u,p=-h,g=0,m=[{x:d+tC,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+tC},{x:d+tC,y:p}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const T=Kt.svg(o),b=Qt(e,{}),w=Wr(m),k=T.path(w,b);y=o.insert(()=>k,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),v&&y.attr("style",v)}else y=wc(o,u,h,m);return n&&y.attr("style",n),rr(e,y),e.intersect=function(T){return Ht.polygon(e,m,T)},o}x(CW,"card");function kW(t,e){const{nodeStyles:r}=Xt(e);e.label="";const n=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,a=Math.max(28,e.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],o=Kt.svg(n),l=Qt(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Wr(s),h=o.path(u,l),d=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return Ht.polygon(e,s,f)},n}x(kW,"choice");async function H_(t,e,r){const{labelStyles:n,nodeStyles:i}=Xt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await xr(t,e,gr(e)),l=16,u=(r==null?void 0:r.padding)??o,h=e.look==="neo"?s.width/2+l*2:s.width/2+u;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Kt.svg(a),g=Qt(e,{}),m=p.circle(0,0,h*2,g);d=a.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Zi(f))}else d=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0);return rr(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return Ht.circle(p,m,g)},e.intersect=function(p){return ae.info("Circle intersect",e,h,p),Ht.circle(e,h,p)},a}x(H_,"circle");function EW(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},a={x:-(n/2)*e,y:n/2*r},s={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${o.x},${o.y} - M ${i.x},${i.y} L ${s.x},${s.y}`}x(EW,"createLine");function SW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:s}=e,o=Kt.svg(i),l=Qt(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,a*2,l),h=EW(a),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),s&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),rr(e,f),e.intersect=function(p){return ae.info("crossedCircle intersect",e,{radius:a,point:p}),Ht.circle(e,a,p)},i}x(SW,"crossedCircle");function Cc(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dk,":first-child").attr("stroke-opacity",0),A.insert(()=>b,":first-child"),A.attr("class","text"),f&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",n),A.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-u/2+d-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),rr(e,A),e.intersect=function(C){return Ht.polygon(e,g,C)},i}x(AW,"curlyBraceLeft");function kc(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dk,":first-child").attr("stroke-opacity",0),A.insert(()=>b,":first-child"),A.attr("class","text"),f&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",n),A.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),rr(e,A),e.intersect=function(C){return Ht.polygon(e,g,C)},i}x(_W,"curlyBraceRight");function ca(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dL,":first-child").attr("stroke-opacity",0),O.insert(()=>w,":first-child"),O.insert(()=>C,":first-child"),O.attr("class","text"),f&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),O.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),rr(e,O),e.intersect=function(M){return Ht.polygon(e,m,M)},i}x(RW,"curlyBraces");async function LW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=20,l=5,{shapeSvg:u,bbox:h}=await xr(t,e,gr(e)),d=Math.max(o,(h.width+a*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+s*2,(e==null?void 0:e.height)??0),p=f/2,{cssStyles:g}=e,m=Kt.svg(u),y=Qt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=d,T=f,b=v-p,w=T/4,k=[{x:b,y:0},{x:w,y:0},{x:0,y:T/2},{x:w,y:T},{x:b,y:T},...tb(-b,-T/2,p,50,270,90)],A=Wr(k),C=m.path(A,y),_=u.insert(()=>C,":first-child");return _.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&_.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&_.selectChildren("path").attr("style",n),_.attr("transform",`translate(${-d/2}, ${-f/2})`),rr(e,_),e.intersect=function(L){return Ht.polygon(e,k,L)},u}x(LW,"curvedTrapezoid");var y6e=x((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),v6e=x((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),b6e=x((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),IW=8,DW=8;async function MW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?24:i,s=e.look==="neo"?24:i;if(e.width||e.height){const y=e.width??0;e.width=(e.width??0)-s,e.widthk,":first-child"),g=o.insert(()=>w,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=y6e(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Zi(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),rr(e,g),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(e.padding??0)/1.5-(l.y-(l.top??0))})`),e.intersect=function(y){const v=Ht.rect(e,y),T=v.x-(e.x??0);if(d!=0&&(Math.abs(T)<(e.width??0)/2||Math.abs(T)==(e.width??0)/2&&Math.abs(v.y-(e.y??0))>(e.height??0)/2-f)){let b=f*f*(1-T*T/(d*d));b>0&&(b=Math.sqrt(b)),b=f-b,y.y-(e.y??0)>0&&(b=-b),v.y+=b}return v},o}x(MW,"cylinder");async function Y0(t,e,r){const{labelStyles:n,nodeStyles:i}=Xt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await xr(t,e,gr(e)),o=Math.max(s.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(s.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-o/2,h=-l/2;let d,{rx:f,ry:p}=e;const{cssStyles:g}=e;if(r!=null&&r.rx&&r.ry&&(f=r.rx,p=r.ry),e.look==="handDrawn"){const m=Kt.svg(a),y=Qt(e,{}),v=f||p?m.path(Nu(u,h,o,l,f||0),y):m.rectangle(u,h,o,l,y);d=a.insert(()=>v,":first-child"),d.attr("class","basic label-container").attr("style",Zi(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",Zi(f)).attr("ry",Zi(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return rr(e,d),e.calcIntersect=function(m,y){return Ht.rect(m,y)},e.intersect=function(m){return Ht.rect(e,m)},a}x(Y0,"drawRect");async function NW(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:s,height:o}=e,l={rx:0,ry:0,labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},u=await Y0(t,e,l);if(e.look==="handDrawn"){const p=Kt.svg(u),g=Qt(e,{}),m=u.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return u;let v=null;if(y instanceof SVGGraphicsElement)v=y.getBBox();else return u;return u.insert(()=>p.line(v.x,v.y,v.x+v.width,v.y,g),".basic.label-container g.label"),u.insert(()=>p.line(v.x,v.y+v.height,v.x+v.width,v.y+v.height,g),".basic.label-container g.label"),m.remove(),u}const h=u.select(".basic.label-container"),d=(Number(h.attr("width"))||s)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}x(NW,"datastore");async function OW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?16:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await xr(t,e,gr(e)),u=o.width+i,h=o.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=Kt.svg(s),y=Qt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],T=m.polygon(v.map(w=>[w.x,w.y]),y),b=s.insert(()=>T,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),l.attr("transform",`translate(${f+(e.padding??0)/2-(o.x-(o.left??0))}, ${p+d+(e.padding??0)/2-(o.y-(o.top??0))})`),rr(e,b),e.intersect=function(w){return Ht.rect(e,w)},s}x(OW,"dividedRectangle");async function $W(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=Xt(e),i=e.look==="neo"?12:5;e.labelStyle=r;const a=e.padding??0,s=e.look==="neo"?16:a,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(s??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=Kt.svg(o),y=Qt(e,{roughness:.2,strokeWidth:2.5}),v=Qt(e,{roughness:.2,strokeWidth:1.5}),T=m.circle(0,0,u*2,y),b=m.circle(0,0,h*2,v);d=o.insert("g",":first-child"),d.attr("class",Zi(e.cssClasses)).attr("style",Zi(f)),(p=d.node())==null||p.appendChild(T),(g=d.node())==null||g.appendChild(b)}else{d=o.insert("g",":first-child");const m=d.insert("circle",":first-child"),y=d.insert("circle");d.attr("class","basic label-container").attr("style",n),m.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),y.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return rr(e,d),e.intersect=function(m){return ae.info("DoubleCircle intersect",e,u,m),Ht.circle(e,u,m)},o}x($W,"doublecircle");function PW(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Xt(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,l=Kt.svg(a),{nodeBorder:u}=r,h=Qt(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,s*2,h),f=a.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),rr(e,f),e.intersect=function(p){return ae.info("filledCircle intersect",e,{radius:s,point:p}),Ht.circle(e,s,p)},a}x(PW,"filledCircle");var BW=10,FW=10;async function zW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.height=(e==null?void 0:e.height)??0,e.heightv,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),e.width=u,e.height=h,rr(e,T),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-h/2+(e.padding??0)/2+(o.y-(o.top??0))})`),e.intersect=function(b){return ae.info("Triangle intersect",e,f,b),Ht.polygon(e,f,b)},s}x(zW,"flippedTriangle");function GW(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=Xt(e);e.label="";const s=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,(e==null?void 0:e.width)??0),u=Math.max(10,(e==null?void 0:e.height)??0);r==="LR"&&(l=Math.max(10,(e==null?void 0:e.width)??0),u=Math.max(70,(e==null?void 0:e.height)??0));const h=-1*l/2,d=-1*u/2,f=Kt.svg(s),p=Qt(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=f.rectangle(h,d,l,u,p),m=s.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),a&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",a),rr(e,m);const y=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=y/2||0,e.height+=y/2||0),e.intersect=function(v){return Ht.rect(e,v)},s}x(GW,"forkJoin");async function qW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=15,a=10,s=e.look==="neo"?16:e.padding??0,o=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0:e.height)??0)-o*2,e.heightT,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),rr(e,b),e.intersect=function(w){return ae.info("Pill intersect",e,{radius:f,point:w}),Ht.polygon(e,y,w)},l}x(qW,"halfRoundedRectangle");var x6e=x((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD");async function VW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const a=e.padding??0,s=70,o=32,l=e.look==="neo"?s:a,u=e.look==="neo"?o:a;if(e.width||e.height){const b=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*b-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await xr(t,e,gr(e)),f=(e!=null&&e.height?e==null?void 0:e.height:d.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:d.width)+2*p+u,m=[{x:p,y:0},{x:g-p,y:0},{x:g,y:-f/2},{x:g-p,y:-f},{x:p,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const T=Kt.svg(h),b=Qt(e,{}),w=x6e(0,0,g,f,p),k=T.path(w,b);y=h.insert(()=>k,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),v&&y.attr("style",v)}else y=wc(h,g,f,m);return n&&y.attr("style",n),e.width=g,e.height=f,rr(e,y),e.intersect=function(T){return Ht.polygon(e,m,T)},h}x(VW,"hexagon");async function WW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await xr(t,e,gr(e)),a=Math.max(30,(e==null?void 0:e.width)??0),s=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:o}=e,l=Kt.svg(i),u=Qt(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=Wr(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),o&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",o),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-s/2})`),rr(e,p),e.intersect=function(g){return ae.info("Pill intersect",e,{points:h}),Ht.polygon(e,h,g)},i}x(WW,"hourglass");async function UW(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Xt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await xr(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=W0(e),v=-g/2,T=-p/2,b=e.label?8:0,w=Kt.svg(u),k=Qt(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const A=w.rectangle(v,T,g,p,k),C=Math.max(g,h.width),_=p+h.height+b,L=w.rectangle(-C/2,-_/2,C,_,{...k,fill:"transparent",stroke:"none"}),O=u.insert(()=>A,":first-child"),M=u.insert(()=>L);if(e.icon){const z=u.append("g");z.html(`${await Lu(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const F=z.node().getBBox(),S=F.width,R=F.height,N=F.x,D=F.y;z.attr("transform",`translate(${-S/2-N},${f?h.height/2+b/2-R/2-D:-h.height/2-b/2-R/2-D})`),z.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-_/2:_/2-h.height})`),O.attr("transform",`translate(0,${f?h.height/2+b/2:-h.height/2-b/2})`),rr(e,M),e.intersect=function(z){if(ae.info("iconSquare intersect",e,z),!e.label)return Ht.rect(e,z);const F=e.x??0,S=e.y??0,R=e.height??0;let N=[];return f?N=[{x:F-h.width/2,y:S-R/2},{x:F+h.width/2,y:S-R/2},{x:F+h.width/2,y:S-R/2+h.height+b},{x:F+g/2,y:S-R/2+h.height+b},{x:F+g/2,y:S+R/2},{x:F-g/2,y:S+R/2},{x:F-g/2,y:S-R/2+h.height+b},{x:F-h.width/2,y:S-R/2+h.height+b}]:N=[{x:F-g/2,y:S-R/2},{x:F+g/2,y:S-R/2},{x:F+g/2,y:S-R/2+p},{x:F+h.width/2,y:S-R/2+p},{x:F+h.width/2/2,y:S+R/2},{x:F-h.width/2,y:S+R/2},{x:F-h.width/2,y:S-R/2+p},{x:F-g/2,y:S-R/2+p}],Ht.polygon(e,N,z)},u}x(UW,"icon");async function HW(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Xt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await xr(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:v}=W0(e),T=Kt.svg(u),b=Qt(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=v.get("fill");b.stroke=w??y;const k=u.append("g");e.icon&&k.html(`${await Lu(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const A=k.node().getBBox(),C=A.width,_=A.height,L=A.x,O=A.y,M=Math.max(C,_)*Math.SQRT2+f*2,z=T.circle(0,0,M,b),F=Math.max(M,h.width),S=M+h.height+p,R=T.rectangle(-F/2,-S/2,F,S,{...b,fill:"transparent",stroke:"none"}),N=u.insert(()=>z,":first-child"),D=u.insert(()=>R);return k.attr("transform",`translate(${-C/2-L},${g?h.height/2+p/2-_/2-O:-h.height/2-p/2-_/2-O})`),k.attr("style",`color: ${v.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-S/2:S/2-h.height})`),N.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),rr(e,D),e.intersect=function(I){return ae.info("iconSquare intersect",e,I),Ht.rect(e,I)},u}x(HW,"iconCircle");async function YW(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Xt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await xr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:T}=W0(e),b=-m/2,w=-g/2,k=e.label?8:0,A=Kt.svg(u),C=Qt(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const _=T.get("fill");C.stroke=_??v;const L=A.path(Nu(b,w,m,g,5),C),O=Math.max(m,h.width),M=g+h.height+k,z=A.rectangle(-O/2,-M/2,O,M,{...C,fill:"transparent",stroke:"none"}),F=u.insert(()=>L,":first-child").attr("class","icon-shape2"),S=u.insert(()=>z);if(e.icon){const R=u.append("g");R.html(`${await Lu(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=R.node().getBBox(),D=N.width,I=N.height,$=N.x,B=N.y;R.attr("transform",`translate(${-D/2-$},${p?h.height/2+k/2-I/2-B:-h.height/2-k/2-I/2-B})`),R.attr("style",`color: ${T.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-M/2:M/2-h.height})`),F.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),rr(e,S),e.intersect=function(R){if(ae.info("iconSquare intersect",e,R),!e.label)return Ht.rect(e,R);const N=e.x??0,D=e.y??0,I=e.height??0;let $=[];return p?$=[{x:N-h.width/2,y:D-I/2},{x:N+h.width/2,y:D-I/2},{x:N+h.width/2,y:D-I/2+h.height+k},{x:N+m/2,y:D-I/2+h.height+k},{x:N+m/2,y:D+I/2},{x:N-m/2,y:D+I/2},{x:N-m/2,y:D-I/2+h.height+k},{x:N-h.width/2,y:D-I/2+h.height+k}]:$=[{x:N-m/2,y:D-I/2},{x:N+m/2,y:D-I/2},{x:N+m/2,y:D-I/2+g},{x:N+h.width/2,y:D-I/2+g},{x:N+h.width/2/2,y:D+I/2},{x:N-h.width/2,y:D+I/2},{x:N-h.width/2,y:D-I/2+g},{x:N-m/2,y:D-I/2+g}],Ht.polygon(e,$,R)},u}x(YW,"iconRounded");async function XW(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Xt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await xr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:T}=W0(e),b=-m/2,w=-g/2,k=e.label?8:0,A=Kt.svg(u),C=Qt(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const _=T.get("fill");C.stroke=_??v;const L=A.path(Nu(b,w,m,g,.1),C),O=Math.max(m,h.width),M=g+h.height+k,z=A.rectangle(-O/2,-M/2,O,M,{...C,fill:"transparent",stroke:"none"}),F=u.insert(()=>L,":first-child"),S=u.insert(()=>z);if(e.icon){const R=u.append("g");R.html(`${await Lu(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=R.node().getBBox(),D=N.width,I=N.height,$=N.x,B=N.y;R.attr("transform",`translate(${-D/2-$},${p?h.height/2+k/2-I/2-B:-h.height/2-k/2-I/2-B})`),R.attr("style",`color: ${T.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-M/2:M/2-h.height})`),F.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),rr(e,S),e.intersect=function(R){if(ae.info("iconSquare intersect",e,R),!e.label)return Ht.rect(e,R);const N=e.x??0,D=e.y??0,I=e.height??0;let $=[];return p?$=[{x:N-h.width/2,y:D-I/2},{x:N+h.width/2,y:D-I/2},{x:N+h.width/2,y:D-I/2+h.height+k},{x:N+m/2,y:D-I/2+h.height+k},{x:N+m/2,y:D+I/2},{x:N-m/2,y:D+I/2},{x:N-m/2,y:D-I/2+h.height+k},{x:N-h.width/2,y:D-I/2+h.height+k}]:$=[{x:N-m/2,y:D-I/2},{x:N+m/2,y:D-I/2},{x:N+m/2,y:D-I/2+g},{x:N+h.width/2,y:D-I/2+g},{x:N+h.width/2/2,y:D+I/2},{x:N-h.width/2,y:D+I/2},{x:N-h.width/2,y:D-I/2+g},{x:N-m/2,y:D-I/2+g}],Ht.polygon(e,$,R)},u}x(XW,"iconSquare");async function KW(t,e,{config:{flowchart:r}}){const n=new Image;n.src=(e==null?void 0:e.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=Xt(e);e.labelStyle=s;const o=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?o??0:0,(e==null?void 0:e.assetWidth)??i),u=e.constraint==="on"&&e!=null&&e.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??a;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await xr(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,y=-h/2,v=e.label?8:0,T=Kt.svg(d),b=Qt(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=T.rectangle(m,y,u,h,b),k=Math.max(u,f.width),A=h+f.height+v,C=T.rectangle(-k/2,-A/2,k,A,{...b,fill:"none",stroke:"none"}),_=d.insert(()=>w,":first-child"),L=d.insert(()=>C);if(e.img){const O=d.append("image");O.attr("href",e.img),O.attr("width",u),O.attr("height",h),O.attr("preserveAspectRatio","none"),O.attr("transform",`translate(${-u/2},${g?A/2-h:-A/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-v/2:h/2-f.height/2+v/2})`),_.attr("transform",`translate(0,${g?f.height/2+v/2:-f.height/2-v/2})`),rr(e,L),e.intersect=function(O){if(ae.info("iconSquare intersect",e,O),!e.label)return Ht.rect(e,O);const M=e.x??0,z=e.y??0,F=e.height??0;let S=[];return g?S=[{x:M-f.width/2,y:z-F/2},{x:M+f.width/2,y:z-F/2},{x:M+f.width/2,y:z-F/2+f.height+v},{x:M+u/2,y:z-F/2+f.height+v},{x:M+u/2,y:z+F/2},{x:M-u/2,y:z+F/2},{x:M-u/2,y:z-F/2+f.height+v},{x:M-f.width/2,y:z-F/2+f.height+v}]:S=[{x:M-u/2,y:z-F/2},{x:M+u/2,y:z-F/2},{x:M+u/2,y:z-F/2+h},{x:M+f.width/2,y:z-F/2+h},{x:M+f.width/2/2,y:z+F/2},{x:M-f.width/2,y:z+F/2},{x:M-f.width/2,y:z-F/2+h},{x:M-u/2,y:z-F/2+h}],Ht.polygon(e,S,O)},d}x(KW,"imageSquare");async function jW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=Math.max(l.width+(s??0)*2,(e==null?void 0:e.width)??0),h=Math.max(l.height+(a??0)*2,(e==null?void 0:e.height)??0),d=[{x:0,y:0},{x:u,y:0},{x:u+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Kt.svg(o),m=Qt(e,{}),y=Wr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=wc(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,rr(e,f),e.intersect=function(g){return Ht.polygon(e,d,g)},o}x(jW,"inv_trapezoid");async function ZW(t,e){const{shapeSvg:r,bbox:n,label:i}=await xr(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),rr(e,a),e.intersect=function(l){return Ht.rect(e,l)},r}x(ZW,"labelRect");async function QW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:0,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:-(3*u)/6,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Kt.svg(o),m=Qt(e,{}),y=Wr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=wc(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,rr(e,f),e.intersect=function(g){return Ht.polygon(e,d,g)},o}x(QW,"lean_left");async function JW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h,y:0},{x:h+3*u/6,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Kt.svg(o),m=Qt(e,{}),y=Wr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=wc(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,rr(e,f),e.intersect=function(g){return Ht.polygon(e,d,g)},o}x(JW,"lean_right");function eU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,(e==null?void 0:e.width)??0),o=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:s,y:0},{x:0,y:o+l/2},{x:s-2*l,y:o+l/2},{x:0,y:2*o},{x:s,y:o-l/2},{x:2*l,y:o-l/2}],h=Kt.svg(i),d=Qt(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Wr(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return g.attr("class","outer-path"),a&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${s/2},${-o})`),rr(e,g),e.intersect=function(m){return ae.info("lightningBolt intersect",e,m),Ht.polygon(e,u,m)},i}x(eU,"lightningBolt");var T6e=x((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),w6e=x((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),C6e=x((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),tU=10,rU=10;async function nU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-a,e.widthA,":first-child").attr("class","line"),m=o.insert(()=>k,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=T6e(0,0,h,p,d,f,g);m=o.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",Zi(y)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),rr(e,m),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),e.intersect=function(v){const T=Ht.rect(e,v),b=T.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(T.y-(e.y??0))>(e.height??0)/2-f)){let w=f*f*(1-b*b/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,v.y-(e.y??0)>0&&(w=-w),T.y+=w}return T},o}x(nU,"linedCylinder");async function iU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;if(e.width||e.height){const w=e.width;e.width=(w??0)*10/11-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,gr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(a??0)*2,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(s??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=Kt.svg(o),y=Qt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...Du(-h/2-h/2*.1,p/2,h/2+h/2*.1,p/2,f,.8),{x:h/2+h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:-p/2},{x:-h/2,y:-p/2},{x:-h/2,y:p/2*1.1},{x:-h/2,y:-p/2}],T=m.polygon(v.map(w=>[w.x,w.y]),y),b=o.insert(()=>T,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(0,${-f/2})`),u.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(e.padding??0)-f/2-(l.y-(l.top??0))})`),rr(e,b),e.intersect=function(w){return Ht.polygon(e,v,w)},o}x(iU,"linedWaveEdgedRect");async function aU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-2*o,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-2*o,10));const{shapeSvg:l,bbox:u,label:h}=await xr(t,e,gr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+a*2+2*o,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+s*2+2*o,p=d-2*o,g=f-2*o,m=-p/2,y=-g/2,{cssStyles:v}=e,T=Kt.svg(l),b=Qt(e,{}),w=[{x:m-o,y:y+o},{x:m-o,y:y+g+o},{x:m+p-o,y:y+g+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y:y+g-o},{x:m+p+o,y:y+g-o},{x:m+p+o,y:y-o},{x:m+o,y:y-o},{x:m+o,y},{x:m,y},{x:m,y:y+o}],k=[{x:m,y:y+o},{x:m+p-o,y:y+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y},{x:m,y}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const A=Wr(w);let C=T.path(A,b);const _=Wr(k);let L=T.path(_,b);e.look!=="handDrawn"&&(C=q_(C),L=q_(L));const O=l.insert("g",":first-child");return O.insert(()=>C),O.insert(()=>L),O.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(u.width/2)-o-(u.x-(u.left??0))}, ${-(u.height/2)+o-(u.y-(u.top??0))})`),rr(e,O),e.intersect=function(M){return Ht.polygon(e,w,M)},l}x(aU,"multiRect");async function sU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await xr(t,e,gr(e)),o=e.padding??0,l=e.look==="neo"?16:o,u=e.look==="neo"?12:o;let h=!0;(e.width||e.height)&&(h=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const d=Math.max(a.width,(e==null?void 0:e.width)??0)+l*2,f=Math.max(a.height,(e==null?void 0:e.height)??0)+u*3,p=e.look==="neo"?f/4:f/8,g=f+(h?p/2:-p/2),m=-d/2,y=-g/2,v=10,{cssStyles:T}=e,b=Du(m-v,y+g+v,m+d-v,y+g+v,p,.8),w=b==null?void 0:b[b.length-1],k=[{x:m-v,y:y+v},{x:m-v,y:y+g+v},...b,{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y:w.y-2*v},{x:m+d+v,y:w.y-2*v},{x:m+d+v,y:y-v},{x:m+v,y:y-v},{x:m+v,y},{x:m,y},{x:m,y:y+v}],A=[{x:m,y:y+v},{x:m+d-v,y:y+v},{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y},{x:m,y}],C=Kt.svg(i),_=Qt(e,{});e.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const L=Wr(k),O=C.path(L,_),M=Wr(A),z=C.path(M,_),F=i.insert(()=>O,":first-child");return F.insert(()=>z),F.attr("class","basic label-container outer-path"),T&&e.look!=="handDrawn"&&F.selectAll("path").attr("style",T),n&&e.look!=="handDrawn"&&F.selectAll("path").attr("style",n),F.attr("transform",`translate(0,${-p/2})`),s.attr("transform",`translate(${-(a.width/2)-v-(a.x-(a.left??0))}, ${-(a.height/2)+v-p/2-(a.y-(a.top??0))})`),rr(e,F),e.intersect=function(S){return Ht.polygon(e,k,S)},i}x(sU,"multiWaveEdgedRectangle");async function oU(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Xt(e);e.labelStyle=n,e.useHtmlLabels||on(lr())||(e.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await xr(t,e,gr(e)),u=Math.max(o.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(o.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=Kt.svg(s),m=Qt(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,u,h,m),v=s.insert(()=>y,":first-child");return v.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),rr(e,v),e.intersect=function(T){return Ht.rect(e,T)},s}x(oU,"note");var k6e=x((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function lU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await xr(t,e,gr(e)),s=a.width+(e.padding??0),o=a.height+(e.padding??0),l=s+o,u=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Kt.svg(i),g=Qt(e,{}),m=k6e(0,0,l),y=p.path(m,g);d=i.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=wc(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),rr(e,d),e.calcIntersect=function(p,g){const m=p.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],v=Ht.polygon(p,y,g);return{x:v.x-.5,y:v.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}x(lU,"question");async function cU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?21:i??0,s=e.look==="neo"?12:i??0,{shapeSvg:o,bbox:l,label:u}=await xr(t,e,gr(e)),h=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),f=-h/2,p=-d/2,g=p/2,m=[{x:f+g,y:p},{x:f,y:0},{x:f+g,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:y}=e,v=Kt.svg(o),T=Qt(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const b=Wr(m),w=v.path(b,T),k=o.insert(()=>w,":first-child");return k.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.attr("transform",`translate(${-g/2},0)`),u.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),rr(e,k),e.intersect=function(A){return Ht.polygon(e,m,A)},o}x(cU,"rect_left_inv_arrow");async function uU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g"),o=a.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await Mu(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(on(Pe())){const _=h.children[0],L=pt(h);d=_.getBoundingClientRect(),L.attr("width",d.width),L.attr("height",d.height)}ae.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await Mu(o,Array.isArray(f)?f.join("
"):f,e.labelStyle,!0,!0),m=g.children[0],y=pt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const v=(e.padding||0)/2;pt(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+v+5)+")"),pt(h).attr("transform","translate( "+(d.width(ae.debug("Rough node insert CXC",O),M),":first-child"),A=a.insert(()=>(ae.debug("Rough node insert CXC",O),O),":first-child")}else A=s.insert("rect",":first-child"),C=s.insert("line"),A.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-v).attr("y",-d.height/2-v).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),C.attr("class","divider").attr("x1",-d.width/2-v).attr("x2",d.width/2+v).attr("y1",-d.height/2-v+p.height+v).attr("y2",-d.height/2-v+p.height+v);return rr(e,A),e.intersect=function(_){return Ht.rect(e,_)},a}x(uU,"rectWithTitle");async function hU(t,e,{config:{themeVariables:r}}){const n=(r==null?void 0:r.radius)??5,i={rx:n,ry:n,labelPaddingX:((e==null?void 0:e.padding)??0)*1,labelPaddingY:((e==null?void 0:e.padding)??0)*1};return Y0(t,e,i)}x(hU,"roundedRect");var fd=8;async function dU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?fd:fd*2),h=((e==null?void 0:e.height)??o.height)+a*2,d=u-fd,f=h,p=fd-u/2,g=-h/2,{cssStyles:m}=e,y=Kt.svg(s),v=Qt(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-fd,y:g+f},{x:p-fd,y:g},{x:p,y:g},{x:p,y:g+f}],b=y.polygon(T.map(k=>[k.x,k.y]),v),w=s.insert(()=>b,":first-child");return w.attr("class","basic label-container outer-path").attr("style",Zi(m)),n&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),l.attr("transform",`translate(${fd/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),rr(e,w),e.intersect=function(k){return Ht.rect(e,k)},s}x(dU,"shadedProcess");async function fU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2,10),e.height=Math.max(((e==null?void 0:e.height)??0)/1.5-s*2,10));const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,gr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,d=((e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:y}=e,v=Kt.svg(o),T=Qt(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const b=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],w=Wr(b),k=v.path(w,T),A=o.insert(()=>k,":first-child");return A.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&A.selectChildren("path").attr("style",y),n&&e.look!=="handDrawn"&&A.selectChildren("path").attr("style",n),A.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(e.padding??0)-(l.x-(l.left??0))}, ${-p/4+(e.padding??0)-(l.y-(l.top??0))})`),rr(e,A),e.intersect=function(C){return Ht.polygon(e,b,C)},o}x(fU,"slopedRect");async function pU(t,e){const r=e.padding??0,n=e.look==="neo"?16:r*2,i=e.look==="neo"?12:r,a={rx:0,ry:0,labelPaddingX:e.labelPaddingX??n,labelPaddingY:i};return Y0(t,e,a)}x(pU,"squareRect");async function gU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?20:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=l.height+(e.look==="neo"?s*2:s),h=l.width+u/4+(e.look==="neo"?a*2:a),d=u/2,{cssStyles:f}=e,p=Kt.svg(o),g=Qt(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-u/2},{x:h/2-d,y:-u/2},...tb(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...tb(h/2-d,0,d,50,270,450)],y=Wr(m),v=p.path(y,g),T=o.insert(()=>v,":first-child");return T.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),rr(e,T),e.intersect=function(b){return Ht.polygon(e,m,b)},o}x(gU,"stadium");async function mU(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return Y0(t,e,r)}x(mU,"state");function yU(t,e,{config:{themeVariables:r}}){var T,b;const{labelStyles:n,nodeStyles:i}=Xt(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l,nodeShadow:u}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const h=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),d=Kt.svg(h),f=Qt(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.circle(0,0,e.width,{...f,stroke:s,strokeWidth:2}),g=o??l,m=(e.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),v=h.insert(()=>p,":first-child");if(v.insert(()=>y),e.look!=="handDrawn"&&v.attr("class","outer-path"),a&&v.selectAll("path").attr("style",a),i&&v.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const w=((b=(T=t.node())==null?void 0:T.ownerSVGElement)==null?void 0:b.id)??"",k=w?`${w}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${k})`)}return rr(e,v),e.intersect=function(w){return Ht.circle(e,(e.width??0)/2,w)},h}x(yU,"stateEnd");function vU(t,e,{config:{themeVariables:r}}){var o,l;const{lineColor:n,nodeShadow:i}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s;if(e.look==="handDrawn"){const h=Kt.svg(a).circle(0,0,e.width,$Ee(n));s=a.insert(()=>h),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&i&&e.look!=="handDrawn"){const u=((l=(o=t.node())==null?void 0:o.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${h})`)}return rr(e,s),e.intersect=function(u){return Ht.circle(e,(e.width??7)/2,u)},a}x(vU,"stateStart");var X0=8;async function bU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=(e==null?void 0:e.padding)??8,a=e.look==="neo"?28:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.width)??l.width)+2*X0+a,h=((e==null?void 0:e.height)??l.height)+s,d=u-2*X0,f=h,p=-u/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(e.look==="handDrawn"){const y=Kt.svg(o),v=Qt(e,{}),T=y.rectangle(p,g,d+16,f,v),b=y.line(p+X0,g,p+X0,g+f,v),w=y.line(p+X0+d,g,p+X0+d,g+f,v);o.insert(()=>b,":first-child"),o.insert(()=>w,":first-child");const k=o.insert(()=>T,":first-child"),{cssStyles:A}=e;k.attr("class","basic label-container").attr("style",Zi(A)),rr(e,k)}else{const y=wc(o,d,f,m);n&&y.attr("style",n),rr(e,y)}return e.intersect=function(y){return Ht.polygon(e,m,y)},o}x(bU,"subroutine");var Y_=.2;async function xU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-s*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-Y_*(e.height+s*2),10));const{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2,h=Y_*u,d=Y_*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2+h-h,g=u,m=-p/2,y=-g/2,{cssStyles:v}=e,T=Kt.svg(o),b=Qt(e,{}),w=[{x:m-h/2,y},{x:m+p+h/2,y},{x:m+p+h/2,y:y+g},{x:m-h/2,y:y+g}],k=[{x:m+p-h/2,y:y+g},{x:m+p+h/2,y:y+g},{x:m+p+h/2,y:y+g-d}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const A=Wr(w),C=T.path(A,b),_=Wr(k),L=T.path(_,{...b,fillStyle:"solid"}),O=o.insert(()=>L,":first-child");return O.insert(()=>C,":first-child"),O.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),rr(e,O),e.intersect=function(M){return Ht.polygon(e,w,M)},o}x(xU,"taggedRect");async function TU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await xr(t,e,gr(e)),o=Math.max(a.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(a.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),u=l/8,h=.2*o,d=.2*l,f=l+u,{cssStyles:p}=e,g=Kt.svg(i),m=Qt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:f/2},...Du(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,u,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],v=-o/2+o/2*.1,T=-f/2-d*.4,b=[{x:v+o-h,y:(T+l)*1.3},{x:v+o,y:T+l-d},{x:v+o,y:(T+l)*.9},...Du(v+o,(T+l)*1.25,v+o-h,(T+l)*1.3,-l*.02,.5)],w=Wr(y),k=g.path(w,m),A=Wr(b),C=g.path(A,{...m,fillStyle:"solid"}),_=i.insert(()=>C,":first-child");return _.insert(()=>k,":first-child"),_.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u/2-(a.y-(a.top??0))})`),rr(e,_),e.intersect=function(L){return Ht.polygon(e,y,L)},i}x(TU,"taggedWaveEdgedRectangle");async function wU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await xr(t,e,gr(e)),s=Math.max(a.width+(e.padding??0),(e==null?void 0:e.width)||0),o=Math.max(a.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-s/2,u=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",s).attr("height",o),rr(e,h),e.intersect=function(d){return Ht.rect(e,d)},i}x(wU,"text");var E6e=x((t,e,r,n,i,a)=>`M${t},${e} +`);return BV(n)}T(VV,"preprocessMarkdown");function WV(t){return t.split(/\\n|\n|/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}T(WV,"nonMarkdownToLines");function UV(t,e={}){const r=VV(t,e),n=ln.lexer(r),i=[[]];let a=0;function s(o,l="normal"){o.type==="text"?o.text.split(` +`).forEach((h,d)=>{d!==0&&(a++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&i[a].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{s(u,o.type)}):o.type==="html"&&i[a].push({content:o.text,type:"normal"})}return T(s,"processNode"),n.forEach(o=>{var l;o.type==="paragraph"?(l=o.tokens)==null||l.forEach(u=>{s(u)}):o.type==="html"?i[a].push({content:o.text,type:"normal"}):i[a].push({content:o.raw,type:"normal"})}),i}T(UV,"markdownToLines");function HV(t){return t?`

${t.replace(/\\n|\n/g,"
")}

`:""}T(HV,"nonMarkdownToHTML");function YV(t,{markdownAutoWrap:e}={}){const r=ln.lexer(t);function n(i){var a,s,o;return i.type==="text"?e===!1?i.text.replace(/\n */g,"
").replace(/ /g," "):i.text.replace(/\n */g,"
"):i.type==="strong"?`${(a=i.tokens)==null?void 0:a.map(n).join("")}`:i.type==="em"?`${(s=i.tokens)==null?void 0:s.map(n).join("")}`:i.type==="paragraph"?`

${(o=i.tokens)==null?void 0:o.map(n).join("")}

`:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(ae.warn(`Unsupported markdown: ${i.type}`),i.raw)}return T(n,"output"),r.map(n).join("")}T(YV,"markdownToHTML");function XV(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}T(XV,"splitTextToChars");function KV(t,e){const r=XV(e.content);return I_(t,[],r,e.type)}T(KV,"splitWordToFitWidth");function I_(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,s=[...e,i];return t([{content:s.join(""),type:n}])?I_(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}T(I_,"splitWordToFitWidthRecursion");function jV(t,e){if(t.some(({content:r})=>r.includes(` +`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return W4(t,e)}T(jV,"splitLineToFitWidth");function W4(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},s=[...n];if(i!==""&&s.push({content:i,type:"normal"}),s.push(a),e(s))return W4(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[o,l]=KV(e,a);r.push([o]),l.content&&t.unshift(l)}return W4(t,e,r)}T(W4,"splitLineToFitWidthRecursion");function D_(t,e){e&&t.attr("style",e)}T(D_,"applyStyle");var ZV=16384;async function QV(t,e,r,n,i=!1,a=lr()){const s=t.append("foreignObject");s.attr("width",`${Math.min(10*r,ZV)}px`),s.attr("height",`${Math.min(10*r,ZV)}px`);const o=s.append("xhtml:div"),l=ui(e.label)?await Lw(e.label.replace(Lt.lineBreakRegex,` +`),a):qr(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),D_(h,e.labelStyle),h.attr("class",`${u} ${n}`),D_(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),s.node()}T(QV,"addHtmlSpan");function U4(t,e,r,n=!1){const i=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}T(U4,"createTspan");function JV(t,e,r){const n=t.append("text"),i=U4(n,1,e);H4(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}T(JV,"computeWidthOfText");function eW(t,e,r){var s;const n=t.append("text"),i=U4(n,1,e);H4(i,[{content:r,type:"normal"}]);const a=(s=i.node())==null?void 0:s.getBoundingClientRect();return a&&n.remove(),a}T(eW,"computeDimensionOfText");function tW(t,e,r,n=!1,i=!1){const s=e.append("g"),o=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=T(p=>JV(s,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:jV(h,d);for(const p of f){const g=U4(l,u,1.1,i);H4(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return o.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}T(tW,"createFormattedText");function M_(t){const e=/&(amp|lt|gt);/g;return t.replace(e,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}T(M_,"decodeHTMLEntities");function H4(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(M_(r.content)):i.text(" "+M_(r.content))})}T(H4,"updateTextContentAndStyles");async function rW(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await YSe(o)?await Lu(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}T(rW,"replaceIconSubstring");var Wa=T(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:s=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(ae.debug("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",u),a){const d=s?YV(e,h):HV(e),f=await rW(Tc(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:ui(e)?p:f,labelStyle:r.replace("fill:","color:")};return await QV(t,g,l,i,u,h)}else{const d=Tc(e.replace(//g,"
")),f=s?UV(d.replace("
","
"),h):WV(d),p=tW(l,t,f,e?u:!1,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");pt(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");pt(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");pt(p).select("text").attr("style",m)}return n?pt(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):pt(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function N_(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,s=Math.cos(a),o=Math.sin(a);for(const l of t){const[u,h]=l;l[0]=(u-n)*s-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*s+i}}}function XSe(t,e){return t[0]===e[0]&&t[1]===e[1]}function KSe(t,e,r,n=1){const i=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of s)N_(u,o,i);const l=(function(u,h,d){const f=[];for(const x of u){const b=[...x];XSe(b[0],b[b.length-1])||b.push([b[0][0],b[0][1]]),b.length>2&&f.push(b)}const p=[];h=Math.max(h,.1);const g=[];for(const x of f)for(let b=0;bx.yminb.ymin?1:x.xb.x?1:x.ymax===b.ymax?0:(x.ymax-b.ymax)/Math.abs(x.ymax-b.ymax))),!g.length)return p;let m=[],y=g[0].ymin,v=0;for(;m.length||g.length;){if(g.length){let x=-1;for(let b=0;by);b++)x=b;g.splice(0,x+1).forEach((b=>{m.push({s:y,edge:b})}))}if(m=m.filter((x=>!(x.edge.ymax<=y))),m.sort(((x,b)=>x.edge.x===b.edge.x?0:(x.edge.x-b.edge.x)/Math.abs(x.edge.x-b.edge.x))),(d!==1||v%h==0)&&m.length>1)for(let x=0;x=m.length)break;const w=m[x].edge,k=m[b].edge;p.push([[Math.round(w.x),y],[Math.round(k.x),y]])}y+=d,m.forEach((x=>{x.edge.x=x.edge.x+d*x.edge.islope})),v++}return p})(s,a,n);if(i){for(const u of s)N_(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),N_(f,h,d)})(l,o,-i)}return l}function J2(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),KSe(t,i,n,a||1)}class O_{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=J2(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function Y4(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class jSe extends O_{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=J2(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],o=.5*n*Math.cos(a),l=.5*n*Math.sin(a);for(const[u,h]of i)Y4([u,h])&&s.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class ZSe extends O_{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,i);return n.ops=n.ops.concat(a.ops),n}}let QSe=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=J2(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=i/4;for(const o of e){const l=Y4(o),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let g=0;g{const o=Y4(s),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const s=Y4(a),o=Math.round(s/(2*r));let l=a[0],u=a[1];l[0]>u[0]&&(l=a[1],u=a[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;dh%2?u+r:u+e));a.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":a.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function aW(t){const e=[];let r="",n=0,i=0,a=0,s=0,o=0,l=0;for(const{key:u,data:h}of t){switch(u){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=n+(n-o),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[d,f]=h;let p=0,g=0;r==="Q"||r==="T"?(p=n+(n-o),g=i+(i-l)):(p=n,g=i);const m=n+2*(p-n)/3,y=i+2*(g-i)/3,v=d+2*(p-d)/3,x=f+2*(g-f)/3;e.push({key:"C",data:[m,y,v,x,d,f]}),o=p,l=g,n=d,i=f;break}case"Q":{const[d,f,p,g]=h,m=n+2*(d-n)/3,y=i+2*(f-i)/3,v=p+2*(d-p)/3,x=g+2*(f-g)/3;e.push({key:"C",data:[m,y,v,x,p,g]}),o=d,l=f,n=p,i=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),p=h[2],g=h[3],m=h[4],y=h[5],v=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,y,v,y,v]}),n=y,i=v):(n!==y||i!==v)&&(sW(n,i,y,v,d,f,p,g,m).forEach((function(x){e.push({key:"C",data:x})})),n=y,i=v);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=u}return e}function eb(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function sW(t,e,r,n,i,a,s,o,l,u){const h=(d=s,Math.PI*d/180);var d;let f=[],p=0,g=0,m=0,y=0;if(u)[p,g,m,y]=u;else{[t,e]=eb(t,e,-h),[r,n]=eb(r,n,-h);const F=(t-r)/2,A=(e-n)/2;let R=F*F/(i*i)+A*A/(a*a);R>1&&(R=Math.sqrt(R),i*=R,a*=R);const N=i*i,D=a*a,I=N*D-N*A*A-D*F*F,$=N*A*A+D*F*F,B=(o===l?-1:1)*Math.sqrt(Math.abs(I/$));m=B*i*A/a+(t+r)/2,y=B*-a*F/i+(e+n)/2,p=Math.asin(parseFloat(((e-y)/a).toFixed(9))),g=Math.asin(parseFloat(((n-y)/a).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let v=g-p;if(Math.abs(v)>120*Math.PI/180){const F=g,A=r,R=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=sW(r=m+i*Math.cos(g),n=y+a*Math.sin(g),A,R,i,a,s,0,l,[g,F,m,y])}v=g-p;const x=Math.cos(p),b=Math.sin(p),w=Math.cos(g),k=Math.sin(g),S=Math.tan(v/4),C=4/3*i*S,_=4/3*a*S,L=[t,e],O=[t+C*b,e-_*x],M=[r+C*k,n-_*w],z=[r,n];if(O[0]=2*L[0]-O[0],O[1]=2*L[1]-O[1],u)return[O,M,z].concat(f);{f=[O,M,z].concat(f);const F=[];for(let A=0;A2){const i=[];for(let a=0;a2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-p)/2),v=gW(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const x=gW(y,u,h,d,f,p,g,1.5,l);v.push(...x)}return s&&(o?v.push(...Iu(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...Iu(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):v.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:v}}function hW(t,e){const r=aW(iW(B_(t))),n=[];let i=[0,0],a=[0,0];for(const{key:s,data:o}of r)switch(s){case"M":a=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...Iu(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...a6e(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...Iu(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function z_(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+wr(i,e),n[0][1]+wr(i,e)]});for(let s=1;s500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*fW(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=wr(p,i,u),g=wr(g,i,u);const m=[],y=()=>wr(d,i,u),v=()=>wr(h,i,u),x=i.preserveVertices;return s?m.push({op:"move",data:[t+(x?0:y()),e+(x?0:y())]}):m.push({op:"move",data:[t+(x?0:wr(h,i,u)),e+(x?0:wr(h,i,u))]}),s?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+y(),g+e+(n-e)*f+y(),p+t+2*(r-t)*f+y(),g+e+2*(n-e)*f+y(),r+(x?0:y()),n+(x?0:y())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*f+v(),g+e+(n-e)*f+v(),p+t+2*(r-t)*f+v(),g+e+2*(n-e)*f+v(),r+(x?0:v()),n+(x?0:v())]}),m}function Z4(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+wr(e,r),t[0][1]+wr(e,r)]),n.push([t[0][0]+wr(e,r),t[0][1]+wr(e,r)]);for(let i=1;i3){const a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+21&&i.push(o)):i.push(o),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=dd(l,u,.5),p=dd(u,h,.5),g=dd(h,d,.5),m=dd(f,p,.5),y=dd(p,g,.5),v=dd(m,y,.5);q_([l,f,m,v],0,r,i),q_([v,y,g,d],0,r,i)}var a,s;return i}function o6e(t,e){return eC(t,0,t.length,e)}function eC(t,e,r,n,i){const a=i||[],s=t[e],o=t[r-1];let l=0,u=1;for(let h=e+1;hl&&(l=d,u=h)}return Math.sqrt(l)>n?(eC(t,e,u+1,n,a),eC(t,u,r,n,a)):(a.length||a.push(s),a.push(o)),a}function V_(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?eC(n,0,n.length,r):n}const Bs="none";class tC{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,a){const s=this._o(a);return this._d("line",[oW(e,r,n,i,s)],s)}rectangle(e,r,n,i,a){const s=this._o(a),o=[],l=i6e(e,r,n,i,s);if(s.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];s.fillStyle==="solid"?o.push(z_([u],s)):o.push(Up([u],s))}return s.stroke!==Bs&&o.push(l),this._d("rectangle",o,s)}ellipse(e,r,n,i,a){const s=this._o(a),o=[],l=cW(n,i,s),u=F_(e,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=F_(e,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(Up([u.estimatedPoints],s));return s.stroke!==Bs&&o.push(u.opset),this._d("ellipse",o,s)}circle(e,r,n,i){const a=this.ellipse(e,r,n,n,i);return a.shape="circle",a}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[K4(e,!1,n)],n)}arc(e,r,n,i,a,s,o=!1,l){const u=this._o(l),h=[],d=uW(e,r,n,i,a,s,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=uW(e,r,n,i,a,s,!0,!1,f);p.type="fillPath",h.push(p)}else h.push((function(f,p,g,m,y,v,x){const b=f,w=p;let k=Math.abs(g/2),S=Math.abs(m/2);k+=wr(.01*k,x),S+=wr(.01*S,x);let C=y,_=v;for(;C<0;)C+=2*Math.PI,_+=2*Math.PI;_-C>2*Math.PI&&(C=0,_=2*Math.PI);const L=(_-C)/x.curveStepCount,O=[];for(let M=C;M<=_;M+=L)O.push([b+k*Math.cos(M),w+S*Math.sin(M)]);return O.push([b+k*Math.cos(_),w+S*Math.sin(_)]),O.push([b,w]),Up([O],x)})(e,r,n,i,a,s,u));return u.stroke!==Bs&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=lW(e,n);if(n.fill&&n.fill!==Bs)if(n.fillStyle==="solid"){const s=lW(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?s.push(...u):u.length===3?s.push(...V_(mW([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):s.push(...V_(mW(u),10,(1+n.roughness)/2))}s.length&&i.push(Up([s],n))}return n.stroke!==Bs&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=K4(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(z_([e],n)):i.push(Up([e],n))),n.stroke!==Bs&&i.push(a),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=n.fill&&n.fill!=="transparent"&&n.fill!==Bs,s=n.stroke!==Bs,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=aW(iW(B_(h))),g=[];let m=[],y=[0,0],v=[];const x=()=>{v.length>=4&&m.push(...V_(v,d)),v=[]},b=()=>{x(),m.length&&(g.push(m),m=[])};for(const{key:k,data:S}of p)switch(k){case"M":b(),y=[S[0],S[1]],m.push(y);break;case"L":x(),m.push([S[0],S[1]]);break;case"C":if(!v.length){const C=m.length?m[m.length-1]:y;v.push([C[0],C[1]])}v.push([S[0],S[1]]),v.push([S[2],S[3]]),v.push([S[4],S[5]]);break;case"Z":x(),m.push([y[0],y[1]])}if(b(),!f)return g;const w=[];for(const k of g){const S=o6e(k,f);S.length&&w.push(S)}return w})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=hW(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=hW(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(z_(l,n));else i.push(Up(l,n));return s&&(o?l.forEach((h=>{i.push(K4(h,!1,n))})):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const a=typeof r=="number"&&r>=0?i.data.map((s=>+s.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Bs};break;case"fillPath":s={d:this.opsToPath(a),stroke:Bs,strokeWidth:0,fill:n.fill||Bs};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Bs,strokeWidth:n,fill:Bs}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}}class l6e{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new tC(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const a of r.ops){const s=typeof n=="number"&&n>=0?a.data.map((o=>+o.toFixed(n))):a.data;switch(a.op){case"move":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s),s}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s),s}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s),s}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a),a}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u),u}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}}const rC="http://www.w3.org/2000/svg";class c6e{constructor(e,r){this.svg=e,this.gen=new tC(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(rC,"g"),s=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(rC,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(rC,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&a.appendChild(l)}return a}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const a=e.createElementNS(rC,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s)}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s)}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s)}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}}var Kt={canvas:(t,e)=>new l6e(t,e),svg:(t,e)=>new c6e(t,e),generator:t=>new tC(t),newSeed:()=>tC.newSeed()},xr=T(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||hc((p=Pe())==null?void 0:p.htmlLabels);r?n=r:n="node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",Zi(e.labelStyle));let o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await Wa(s,qr(Tc(o),Pe()),{useHtmlLabels:i,width:e.width||((g=Pe().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},Pe());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],y=pt(h);await y_(m,o),d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height)}return i?s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):s.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:d,halfPadding:f,label:s}},"labelHelper"),W_=T(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??on(Pe()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Wa(i,qr(Tc(e),Pe()),{useHtmlLabels:n,width:r.width||((u=(l=Pe())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let s=a.getBBox();const o=r.padding/2;if(on(Pe())){const h=a.children[0],d=pt(a);s=h.getBoundingClientRect(),d.attr("width",s.width),d.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:s,halfPadding:o,label:i}},"insertLabel"),rr=T((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),gr=T((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Wr(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}T(Wr,"createPathFromPoints");function Du(t,e,r,n,i,a){const s=[],l=r-t,u=n-e,h=l/a,d=2*Math.PI/h,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,y=f+i*Math.sin(d*(m-t));s.push({x:m,y})}return s}T(Du,"generateFullSineWavePoints");function rb(t,e,r,n,i,a){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=e.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);const i=e.find(l=>l.getAttribute("fill")!=="none"),a=e.find(l=>l.getAttribute("stroke")!=="none"),s=T((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:s(i,"fill"),"fill-opacity":s(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(a){const l={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}T(U_,"mergePaths");var u6e=T((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),Hp=u6e,h6e=T(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Pe(),o=on(s);return await Wa(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Mu=h6e,Nu=T((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),yW=T(async(t,e)=>{ae.info("Creating subgraph rect for ",e.id,e);const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Xt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=on(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await Wa(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await Mu(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(on(r)){const C=g.children[0],_=pt(g);m=C.getBoundingClientRect(),_.attr("width",m.width),_.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-y/2,b=e.y-v/2;ae.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const C=Kt.svg(d),_=Qt(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),L=C.path(Nu(x,b,y,v,0),_);w=d.insert(()=>(ae.debug("Rough node insert CXC",L),L),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:k}=Y2(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+k})`),o){const C=p.select("span");C&&C.attr("style",o)}const S=w.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(C){return Hp(e,C)},{cluster:d,labelBBox:m}},"rect"),d6e=T((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(o){return Hp(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),f6e=T(async(t,e)=>{const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=n,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),h=u.insert("g",":first-child"),d=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await Mu(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(on(r)){const L=p.children[0],O=pt(p);g=L.getBoundingClientRect(),O.attr("width",g.width),O.attr("height",g.height)}const m=0*e.padding,y=m/2,v=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const x=e.height+m,b=e.height+m-g.height-6,w=e.x-v/2,k=e.y-x/2;e.width=v;const S=e.y-e.height/2-y+g.height+2;let C;if(e.look==="handDrawn"){const L=e.cssClasses.includes("statediagram-cluster-alt"),O=Kt.svg(u),M=e.rx||e.ry?O.path(Nu(w,k,v,x,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):O.rectangle(w,k,v,x,{seed:i});C=u.insert(()=>M,":first-child");const z=O.rectangle(w,S,v,b,{fill:L?a:s,fillStyle:L?"hachure":"solid",stroke:l,seed:i});C=u.insert(()=>M,":first-child"),f=u.insert(()=>z)}else C=h.insert("rect",":first-child"),C.attr("class","outer").attr("x",w).attr("y",k).attr("width",v).attr("height",x).attr("data-look",e.look),f.attr("class","inner").attr("x",w).attr("y",S).attr("width",v).attr("height",b);d.attr("transform",`translate(${e.x-g.width/2}, ${k+1-(on(r)?0:3)})`);const _=C.node().getBBox();return e.height=_.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(L){return Hp(e,L)},{cluster:u,labelBBox:g}},"roundedWithTitle"),p6e=T(async(t,e)=>{ae.info("Creating subgraph rect for ",e.id,e);const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Xt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=on(r),p=d.insert("g").attr("class","cluster-label "),g=await Wa(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(on(r)){const C=g.children[0],_=pt(g);m=C.getBoundingClientRect(),_.attr("width",m.width),_.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-y/2,b=e.y-v/2;ae.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const C=Kt.svg(d),_=Qt(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),L=C.path(Nu(x,b,y,v,e.rx),_);w=d.insert(()=>(ae.debug("Rough node insert CXC",L),L),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:k}=Y2(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+k})`),o){const C=p.select("span");C&&C.attr("style",o)}const S=w.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(C){return Hp(e,C)},{cluster:d,labelBBox:m}},"kanbanSection"),g6e=T((t,e)=>{const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),o=s.insert("g",":first-child"),l=0*e.padding,u=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-u/2,f=e.y-h/2;e.width=u;let p;if(e.look==="handDrawn"){const y=Kt.svg(s).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert(()=>y,":first-child")}else{p=o.insert("rect",":first-child");let m="outer";e.look,m="divider",p.attr("class",m).attr("x",d).attr("y",f).attr("width",u).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return Hp(e,m)},{cluster:s,labelBBox:{}}},"divider"),m6e=yW,y6e={rect:yW,squareRect:m6e,roundedWithTitle:f6e,noteGroup:d6e,divider:g6e,kanbanSection:p6e},vW=new Map,H_=T(async(t,e)=>{const r=e.shape||"rect",n=await y6e[r](t,e);return vW.set(e.id,n),n},"insertCluster"),v6e=T(()=>{vW=new Map},"clear");function bW(t,e){return t.intersect(e)}T(bW,"intersectNode");var b6e=bW;function xW(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}T(Y_,"sameSign");var T6e=CW;function kW(t,e,r){let n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){s=Math.min(s,h.x),o=Math.min(o,h.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));let l=n-t.width/2-s,u=i-t.height/2-o;for(let h=0;h1&&a.sort(function(h,d){let f=h.x-r.x,p=h.y-r.y,g=Math.sqrt(f*f+p*p),m=d.x-r.x,y=d.y-r.y,v=Math.sqrt(m*m+y*y);return gh,":first-child");return d.attr("class","anchor").attr("style",Zi(o)),rr(e,d),e.intersect=function(f){return ae.info("Circle intersect",e,s,f),Ht.circle(e,s,f)},a}T(EW,"anchor");function X_(t,e,r,n,i,a,s){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/a,m=Math.sqrt(p**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),v=l+y*a*Math.sin(h)*(s?-1:1),x=u-y*i*Math.cos(h)*(s?-1:1),b=Math.atan2((e-x)/a,(t-v)/i);let k=Math.atan2((n-x)/a,(r-v)/i)-b;s&&k<0&&(k+=2*Math.PI),!s&&k>0&&(k-=2*Math.PI);const S=[];for(let C=0;C<20;C++){const _=C/19,L=b+_*k,O=v+i*Math.cos(L),M=x+a*Math.sin(L);S.push({x:O,y:M})}return S}T(X_,"generateArcPoints");function SW(t,e,r){const[n,i]=[e,r].sort((a,s)=>s-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}T(SW,"calculateArcSagitta");async function AW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=T(L=>L+s,"calcTotalHeight"),l=T(L=>{const O=L/2;return[O/(2.5+L/50),O]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await xr(t,e,gr(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=SW(d,f,p),y=(e!=null&&e.width?e==null?void 0:e.width:h.width)+a*2+g-g,v=d,{cssStyles:x}=e,b=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},...X_(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...X_(y/2,v/2,y/2,-v/2,f,p,!0)],w=Kt.svg(u),k=Qt(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=Wr(b),C=w.path(S,k),_=u.insert(()=>C,":first-child");return _.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",x),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(${f/2}, 0)`),rr(e,_),e.intersect=function(L){return Ht.polygon(e,b,L)},u}T(AW,"bowTieRect");function wc(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}T(wc,"insertPolygonShape");var nC=12;async function _W(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?28:i,s=e.look==="neo"?24:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+nC),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),d=0,f=u,p=-h,g=0,m=[{x:d+nC,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+nC},{x:d+nC,y:p}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const x=Kt.svg(o),b=Qt(e,{}),w=Wr(m),k=x.path(w,b);y=o.insert(()=>k,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),v&&y.attr("style",v)}else y=wc(o,u,h,m);return n&&y.attr("style",n),rr(e,y),e.intersect=function(x){return Ht.polygon(e,m,x)},o}T(_W,"card");function RW(t,e){const{nodeStyles:r}=Xt(e);e.label="";const n=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,a=Math.max(28,e.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],o=Kt.svg(n),l=Qt(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Wr(s),h=o.path(u,l),d=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return Ht.polygon(e,s,f)},n}T(RW,"choice");async function K_(t,e,r){const{labelStyles:n,nodeStyles:i}=Xt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await xr(t,e,gr(e)),l=16,u=(r==null?void 0:r.padding)??o,h=e.look==="neo"?s.width/2+l*2:s.width/2+u;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Kt.svg(a),g=Qt(e,{}),m=p.circle(0,0,h*2,g);d=a.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Zi(f))}else d=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0);return rr(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return Ht.circle(p,m,g)},e.intersect=function(p){return ae.info("Circle intersect",e,h,p),Ht.circle(e,h,p)},a}T(K_,"circle");function LW(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},a={x:-(n/2)*e,y:n/2*r},s={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${o.x},${o.y} + M ${i.x},${i.y} L ${s.x},${s.y}`}T(LW,"createLine");function IW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:s}=e,o=Kt.svg(i),l=Qt(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,a*2,l),h=LW(a),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),s&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),rr(e,f),e.intersect=function(p){return ae.info("crossedCircle intersect",e,{radius:a,point:p}),Ht.circle(e,a,p)},i}T(IW,"crossedCircle");function Cc(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dk,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-u/2+d-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),rr(e,S),e.intersect=function(C){return Ht.polygon(e,g,C)},i}T(DW,"curlyBraceLeft");function kc(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dk,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),rr(e,S),e.intersect=function(C){return Ht.polygon(e,g,C)},i}T(MW,"curlyBraceRight");function ca(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dL,":first-child").attr("stroke-opacity",0),O.insert(()=>w,":first-child"),O.insert(()=>C,":first-child"),O.attr("class","text"),f&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),O.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),rr(e,O),e.intersect=function(M){return Ht.polygon(e,m,M)},i}T(NW,"curlyBraces");async function OW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=20,l=5,{shapeSvg:u,bbox:h}=await xr(t,e,gr(e)),d=Math.max(o,(h.width+a*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+s*2,(e==null?void 0:e.height)??0),p=f/2,{cssStyles:g}=e,m=Kt.svg(u),y=Qt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=d,x=f,b=v-p,w=x/4,k=[{x:b,y:0},{x:w,y:0},{x:0,y:x/2},{x:w,y:x},{x:b,y:x},...rb(-b,-x/2,p,50,270,90)],S=Wr(k),C=m.path(S,y),_=u.insert(()=>C,":first-child");return _.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&_.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&_.selectChildren("path").attr("style",n),_.attr("transform",`translate(${-d/2}, ${-f/2})`),rr(e,_),e.intersect=function(L){return Ht.polygon(e,k,L)},u}T(OW,"curvedTrapezoid");var C6e=T((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),k6e=T((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),E6e=T((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),$W=8,PW=8;async function BW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?24:i,s=e.look==="neo"?24:i;if(e.width||e.height){const y=e.width??0;e.width=(e.width??0)-s,e.widthk,":first-child"),g=o.insert(()=>w,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=C6e(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Zi(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),rr(e,g),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(e.padding??0)/1.5-(l.y-(l.top??0))})`),e.intersect=function(y){const v=Ht.rect(e,y),x=v.x-(e.x??0);if(d!=0&&(Math.abs(x)<(e.width??0)/2||Math.abs(x)==(e.width??0)/2&&Math.abs(v.y-(e.y??0))>(e.height??0)/2-f)){let b=f*f*(1-x*x/(d*d));b>0&&(b=Math.sqrt(b)),b=f-b,y.y-(e.y??0)>0&&(b=-b),v.y+=b}return v},o}T(BW,"cylinder");async function Yp(t,e,r){const{labelStyles:n,nodeStyles:i}=Xt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await xr(t,e,gr(e)),o=Math.max(s.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(s.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-o/2,h=-l/2;let d,{rx:f,ry:p}=e;const{cssStyles:g}=e;if(r!=null&&r.rx&&r.ry&&(f=r.rx,p=r.ry),e.look==="handDrawn"){const m=Kt.svg(a),y=Qt(e,{}),v=f||p?m.path(Nu(u,h,o,l,f||0),y):m.rectangle(u,h,o,l,y);d=a.insert(()=>v,":first-child"),d.attr("class","basic label-container").attr("style",Zi(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",Zi(f)).attr("ry",Zi(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return rr(e,d),e.calcIntersect=function(m,y){return Ht.rect(m,y)},e.intersect=function(m){return Ht.rect(e,m)},a}T(Yp,"drawRect");async function FW(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:s,height:o}=e,l={rx:0,ry:0,labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},u=await Yp(t,e,l);if(e.look==="handDrawn"){const p=Kt.svg(u),g=Qt(e,{}),m=u.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return u;let v=null;if(y instanceof SVGGraphicsElement)v=y.getBBox();else return u;return u.insert(()=>p.line(v.x,v.y,v.x+v.width,v.y,g),".basic.label-container g.label"),u.insert(()=>p.line(v.x,v.y+v.height,v.x+v.width,v.y+v.height,g),".basic.label-container g.label"),m.remove(),u}const h=u.select(".basic.label-container"),d=(Number(h.attr("width"))||s)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}T(FW,"datastore");async function zW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?16:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await xr(t,e,gr(e)),u=o.width+i,h=o.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=Kt.svg(s),y=Qt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],x=m.polygon(v.map(w=>[w.x,w.y]),y),b=s.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),l.attr("transform",`translate(${f+(e.padding??0)/2-(o.x-(o.left??0))}, ${p+d+(e.padding??0)/2-(o.y-(o.top??0))})`),rr(e,b),e.intersect=function(w){return Ht.rect(e,w)},s}T(zW,"dividedRectangle");async function GW(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=Xt(e),i=e.look==="neo"?12:5;e.labelStyle=r;const a=e.padding??0,s=e.look==="neo"?16:a,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(s??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=Kt.svg(o),y=Qt(e,{roughness:.2,strokeWidth:2.5}),v=Qt(e,{roughness:.2,strokeWidth:1.5}),x=m.circle(0,0,u*2,y),b=m.circle(0,0,h*2,v);d=o.insert("g",":first-child"),d.attr("class",Zi(e.cssClasses)).attr("style",Zi(f)),(p=d.node())==null||p.appendChild(x),(g=d.node())==null||g.appendChild(b)}else{d=o.insert("g",":first-child");const m=d.insert("circle",":first-child"),y=d.insert("circle");d.attr("class","basic label-container").attr("style",n),m.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),y.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return rr(e,d),e.intersect=function(m){return ae.info("DoubleCircle intersect",e,u,m),Ht.circle(e,u,m)},o}T(GW,"doublecircle");function qW(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Xt(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,l=Kt.svg(a),{nodeBorder:u}=r,h=Qt(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,s*2,h),f=a.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),rr(e,f),e.intersect=function(p){return ae.info("filledCircle intersect",e,{radius:s,point:p}),Ht.circle(e,s,p)},a}T(qW,"filledCircle");var VW=10,WW=10;async function UW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.height=(e==null?void 0:e.height)??0,e.heightv,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),e.width=u,e.height=h,rr(e,x),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-h/2+(e.padding??0)/2+(o.y-(o.top??0))})`),e.intersect=function(b){return ae.info("Triangle intersect",e,f,b),Ht.polygon(e,f,b)},s}T(UW,"flippedTriangle");function HW(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=Xt(e);e.label="";const s=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,(e==null?void 0:e.width)??0),u=Math.max(10,(e==null?void 0:e.height)??0);r==="LR"&&(l=Math.max(10,(e==null?void 0:e.width)??0),u=Math.max(70,(e==null?void 0:e.height)??0));const h=-1*l/2,d=-1*u/2,f=Kt.svg(s),p=Qt(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=f.rectangle(h,d,l,u,p),m=s.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),a&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",a),rr(e,m);const y=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=y/2||0,e.height+=y/2||0),e.intersect=function(v){return Ht.rect(e,v)},s}T(HW,"forkJoin");async function YW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=15,a=10,s=e.look==="neo"?16:e.padding??0,o=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0:e.height)??0)-o*2,e.heightx,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),rr(e,b),e.intersect=function(w){return ae.info("Pill intersect",e,{radius:f,point:w}),Ht.polygon(e,y,w)},l}T(YW,"halfRoundedRectangle");var S6e=T((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD");async function XW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const a=e.padding??0,s=70,o=32,l=e.look==="neo"?s:a,u=e.look==="neo"?o:a;if(e.width||e.height){const b=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*b-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await xr(t,e,gr(e)),f=(e!=null&&e.height?e==null?void 0:e.height:d.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:d.width)+2*p+u,m=[{x:p,y:0},{x:g-p,y:0},{x:g,y:-f/2},{x:g-p,y:-f},{x:p,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const x=Kt.svg(h),b=Qt(e,{}),w=S6e(0,0,g,f,p),k=x.path(w,b);y=h.insert(()=>k,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),v&&y.attr("style",v)}else y=wc(h,g,f,m);return n&&y.attr("style",n),e.width=g,e.height=f,rr(e,y),e.intersect=function(x){return Ht.polygon(e,m,x)},h}T(XW,"hexagon");async function KW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await xr(t,e,gr(e)),a=Math.max(30,(e==null?void 0:e.width)??0),s=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:o}=e,l=Kt.svg(i),u=Qt(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=Wr(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),o&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",o),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-s/2})`),rr(e,p),e.intersect=function(g){return ae.info("Pill intersect",e,{points:h}),Ht.polygon(e,h,g)},i}T(KW,"hourglass");async function jW(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Xt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await xr(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=Wp(e),v=-g/2,x=-p/2,b=e.label?8:0,w=Kt.svg(u),k=Qt(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=w.rectangle(v,x,g,p,k),C=Math.max(g,h.width),_=p+h.height+b,L=w.rectangle(-C/2,-_/2,C,_,{...k,fill:"transparent",stroke:"none"}),O=u.insert(()=>S,":first-child"),M=u.insert(()=>L);if(e.icon){const z=u.append("g");z.html(`${await Lu(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const F=z.node().getBBox(),A=F.width,R=F.height,N=F.x,D=F.y;z.attr("transform",`translate(${-A/2-N},${f?h.height/2+b/2-R/2-D:-h.height/2-b/2-R/2-D})`),z.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-_/2:_/2-h.height})`),O.attr("transform",`translate(0,${f?h.height/2+b/2:-h.height/2-b/2})`),rr(e,M),e.intersect=function(z){if(ae.info("iconSquare intersect",e,z),!e.label)return Ht.rect(e,z);const F=e.x??0,A=e.y??0,R=e.height??0;let N=[];return f?N=[{x:F-h.width/2,y:A-R/2},{x:F+h.width/2,y:A-R/2},{x:F+h.width/2,y:A-R/2+h.height+b},{x:F+g/2,y:A-R/2+h.height+b},{x:F+g/2,y:A+R/2},{x:F-g/2,y:A+R/2},{x:F-g/2,y:A-R/2+h.height+b},{x:F-h.width/2,y:A-R/2+h.height+b}]:N=[{x:F-g/2,y:A-R/2},{x:F+g/2,y:A-R/2},{x:F+g/2,y:A-R/2+p},{x:F+h.width/2,y:A-R/2+p},{x:F+h.width/2/2,y:A+R/2},{x:F-h.width/2,y:A+R/2},{x:F-h.width/2,y:A-R/2+p},{x:F-g/2,y:A-R/2+p}],Ht.polygon(e,N,z)},u}T(jW,"icon");async function ZW(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Xt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await xr(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:v}=Wp(e),x=Kt.svg(u),b=Qt(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=v.get("fill");b.stroke=w??y;const k=u.append("g");e.icon&&k.html(`${await Lu(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const S=k.node().getBBox(),C=S.width,_=S.height,L=S.x,O=S.y,M=Math.max(C,_)*Math.SQRT2+f*2,z=x.circle(0,0,M,b),F=Math.max(M,h.width),A=M+h.height+p,R=x.rectangle(-F/2,-A/2,F,A,{...b,fill:"transparent",stroke:"none"}),N=u.insert(()=>z,":first-child"),D=u.insert(()=>R);return k.attr("transform",`translate(${-C/2-L},${g?h.height/2+p/2-_/2-O:-h.height/2-p/2-_/2-O})`),k.attr("style",`color: ${v.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-A/2:A/2-h.height})`),N.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),rr(e,D),e.intersect=function(I){return ae.info("iconSquare intersect",e,I),Ht.rect(e,I)},u}T(ZW,"iconCircle");async function QW(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Xt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await xr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=Wp(e),b=-m/2,w=-g/2,k=e.label?8:0,S=Kt.svg(u),C=Qt(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const _=x.get("fill");C.stroke=_??v;const L=S.path(Nu(b,w,m,g,5),C),O=Math.max(m,h.width),M=g+h.height+k,z=S.rectangle(-O/2,-M/2,O,M,{...C,fill:"transparent",stroke:"none"}),F=u.insert(()=>L,":first-child").attr("class","icon-shape2"),A=u.insert(()=>z);if(e.icon){const R=u.append("g");R.html(`${await Lu(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=R.node().getBBox(),D=N.width,I=N.height,$=N.x,B=N.y;R.attr("transform",`translate(${-D/2-$},${p?h.height/2+k/2-I/2-B:-h.height/2-k/2-I/2-B})`),R.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-M/2:M/2-h.height})`),F.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),rr(e,A),e.intersect=function(R){if(ae.info("iconSquare intersect",e,R),!e.label)return Ht.rect(e,R);const N=e.x??0,D=e.y??0,I=e.height??0;let $=[];return p?$=[{x:N-h.width/2,y:D-I/2},{x:N+h.width/2,y:D-I/2},{x:N+h.width/2,y:D-I/2+h.height+k},{x:N+m/2,y:D-I/2+h.height+k},{x:N+m/2,y:D+I/2},{x:N-m/2,y:D+I/2},{x:N-m/2,y:D-I/2+h.height+k},{x:N-h.width/2,y:D-I/2+h.height+k}]:$=[{x:N-m/2,y:D-I/2},{x:N+m/2,y:D-I/2},{x:N+m/2,y:D-I/2+g},{x:N+h.width/2,y:D-I/2+g},{x:N+h.width/2/2,y:D+I/2},{x:N-h.width/2,y:D+I/2},{x:N-h.width/2,y:D-I/2+g},{x:N-m/2,y:D-I/2+g}],Ht.polygon(e,$,R)},u}T(QW,"iconRounded");async function JW(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Xt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await xr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=Wp(e),b=-m/2,w=-g/2,k=e.label?8:0,S=Kt.svg(u),C=Qt(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const _=x.get("fill");C.stroke=_??v;const L=S.path(Nu(b,w,m,g,.1),C),O=Math.max(m,h.width),M=g+h.height+k,z=S.rectangle(-O/2,-M/2,O,M,{...C,fill:"transparent",stroke:"none"}),F=u.insert(()=>L,":first-child"),A=u.insert(()=>z);if(e.icon){const R=u.append("g");R.html(`${await Lu(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=R.node().getBBox(),D=N.width,I=N.height,$=N.x,B=N.y;R.attr("transform",`translate(${-D/2-$},${p?h.height/2+k/2-I/2-B:-h.height/2-k/2-I/2-B})`),R.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-M/2:M/2-h.height})`),F.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),rr(e,A),e.intersect=function(R){if(ae.info("iconSquare intersect",e,R),!e.label)return Ht.rect(e,R);const N=e.x??0,D=e.y??0,I=e.height??0;let $=[];return p?$=[{x:N-h.width/2,y:D-I/2},{x:N+h.width/2,y:D-I/2},{x:N+h.width/2,y:D-I/2+h.height+k},{x:N+m/2,y:D-I/2+h.height+k},{x:N+m/2,y:D+I/2},{x:N-m/2,y:D+I/2},{x:N-m/2,y:D-I/2+h.height+k},{x:N-h.width/2,y:D-I/2+h.height+k}]:$=[{x:N-m/2,y:D-I/2},{x:N+m/2,y:D-I/2},{x:N+m/2,y:D-I/2+g},{x:N+h.width/2,y:D-I/2+g},{x:N+h.width/2/2,y:D+I/2},{x:N-h.width/2,y:D+I/2},{x:N-h.width/2,y:D-I/2+g},{x:N-m/2,y:D-I/2+g}],Ht.polygon(e,$,R)},u}T(JW,"iconSquare");async function eU(t,e,{config:{flowchart:r}}){const n=new Image;n.src=(e==null?void 0:e.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=Xt(e);e.labelStyle=s;const o=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?o??0:0,(e==null?void 0:e.assetWidth)??i),u=e.constraint==="on"&&e!=null&&e.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??a;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await xr(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,y=-h/2,v=e.label?8:0,x=Kt.svg(d),b=Qt(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=x.rectangle(m,y,u,h,b),k=Math.max(u,f.width),S=h+f.height+v,C=x.rectangle(-k/2,-S/2,k,S,{...b,fill:"none",stroke:"none"}),_=d.insert(()=>w,":first-child"),L=d.insert(()=>C);if(e.img){const O=d.append("image");O.attr("href",e.img),O.attr("width",u),O.attr("height",h),O.attr("preserveAspectRatio","none"),O.attr("transform",`translate(${-u/2},${g?S/2-h:-S/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-v/2:h/2-f.height/2+v/2})`),_.attr("transform",`translate(0,${g?f.height/2+v/2:-f.height/2-v/2})`),rr(e,L),e.intersect=function(O){if(ae.info("iconSquare intersect",e,O),!e.label)return Ht.rect(e,O);const M=e.x??0,z=e.y??0,F=e.height??0;let A=[];return g?A=[{x:M-f.width/2,y:z-F/2},{x:M+f.width/2,y:z-F/2},{x:M+f.width/2,y:z-F/2+f.height+v},{x:M+u/2,y:z-F/2+f.height+v},{x:M+u/2,y:z+F/2},{x:M-u/2,y:z+F/2},{x:M-u/2,y:z-F/2+f.height+v},{x:M-f.width/2,y:z-F/2+f.height+v}]:A=[{x:M-u/2,y:z-F/2},{x:M+u/2,y:z-F/2},{x:M+u/2,y:z-F/2+h},{x:M+f.width/2,y:z-F/2+h},{x:M+f.width/2/2,y:z+F/2},{x:M-f.width/2,y:z+F/2},{x:M-f.width/2,y:z-F/2+h},{x:M-u/2,y:z-F/2+h}],Ht.polygon(e,A,O)},d}T(eU,"imageSquare");async function tU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=Math.max(l.width+(s??0)*2,(e==null?void 0:e.width)??0),h=Math.max(l.height+(a??0)*2,(e==null?void 0:e.height)??0),d=[{x:0,y:0},{x:u,y:0},{x:u+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Kt.svg(o),m=Qt(e,{}),y=Wr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=wc(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,rr(e,f),e.intersect=function(g){return Ht.polygon(e,d,g)},o}T(tU,"inv_trapezoid");async function rU(t,e){const{shapeSvg:r,bbox:n,label:i}=await xr(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),rr(e,a),e.intersect=function(l){return Ht.rect(e,l)},r}T(rU,"labelRect");async function nU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:0,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:-(3*u)/6,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Kt.svg(o),m=Qt(e,{}),y=Wr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=wc(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,rr(e,f),e.intersect=function(g){return Ht.polygon(e,d,g)},o}T(nU,"lean_left");async function iU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h,y:0},{x:h+3*u/6,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Kt.svg(o),m=Qt(e,{}),y=Wr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=wc(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,rr(e,f),e.intersect=function(g){return Ht.polygon(e,d,g)},o}T(iU,"lean_right");function aU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,(e==null?void 0:e.width)??0),o=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:s,y:0},{x:0,y:o+l/2},{x:s-2*l,y:o+l/2},{x:0,y:2*o},{x:s,y:o-l/2},{x:2*l,y:o-l/2}],h=Kt.svg(i),d=Qt(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Wr(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return g.attr("class","outer-path"),a&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${s/2},${-o})`),rr(e,g),e.intersect=function(m){return ae.info("lightningBolt intersect",e,m),Ht.polygon(e,u,m)},i}T(aU,"lightningBolt");var A6e=T((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),_6e=T((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),R6e=T((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),sU=10,oU=10;async function lU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-a,e.widthS,":first-child").attr("class","line"),m=o.insert(()=>k,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=A6e(0,0,h,p,d,f,g);m=o.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",Zi(y)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),rr(e,m),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),e.intersect=function(v){const x=Ht.rect(e,v),b=x.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(x.y-(e.y??0))>(e.height??0)/2-f)){let w=f*f*(1-b*b/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,v.y-(e.y??0)>0&&(w=-w),x.y+=w}return x},o}T(lU,"linedCylinder");async function cU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;if(e.width||e.height){const w=e.width;e.width=(w??0)*10/11-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,gr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(a??0)*2,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(s??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=Kt.svg(o),y=Qt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...Du(-h/2-h/2*.1,p/2,h/2+h/2*.1,p/2,f,.8),{x:h/2+h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:-p/2},{x:-h/2,y:-p/2},{x:-h/2,y:p/2*1.1},{x:-h/2,y:-p/2}],x=m.polygon(v.map(w=>[w.x,w.y]),y),b=o.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(0,${-f/2})`),u.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(e.padding??0)-f/2-(l.y-(l.top??0))})`),rr(e,b),e.intersect=function(w){return Ht.polygon(e,v,w)},o}T(cU,"linedWaveEdgedRect");async function uU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-2*o,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-2*o,10));const{shapeSvg:l,bbox:u,label:h}=await xr(t,e,gr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+a*2+2*o,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+s*2+2*o,p=d-2*o,g=f-2*o,m=-p/2,y=-g/2,{cssStyles:v}=e,x=Kt.svg(l),b=Qt(e,{}),w=[{x:m-o,y:y+o},{x:m-o,y:y+g+o},{x:m+p-o,y:y+g+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y:y+g-o},{x:m+p+o,y:y+g-o},{x:m+p+o,y:y-o},{x:m+o,y:y-o},{x:m+o,y},{x:m,y},{x:m,y:y+o}],k=[{x:m,y:y+o},{x:m+p-o,y:y+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y},{x:m,y}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Wr(w);let C=x.path(S,b);const _=Wr(k);let L=x.path(_,b);e.look!=="handDrawn"&&(C=U_(C),L=U_(L));const O=l.insert("g",":first-child");return O.insert(()=>C),O.insert(()=>L),O.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(u.width/2)-o-(u.x-(u.left??0))}, ${-(u.height/2)+o-(u.y-(u.top??0))})`),rr(e,O),e.intersect=function(M){return Ht.polygon(e,w,M)},l}T(uU,"multiRect");async function hU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await xr(t,e,gr(e)),o=e.padding??0,l=e.look==="neo"?16:o,u=e.look==="neo"?12:o;let h=!0;(e.width||e.height)&&(h=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const d=Math.max(a.width,(e==null?void 0:e.width)??0)+l*2,f=Math.max(a.height,(e==null?void 0:e.height)??0)+u*3,p=e.look==="neo"?f/4:f/8,g=f+(h?p/2:-p/2),m=-d/2,y=-g/2,v=10,{cssStyles:x}=e,b=Du(m-v,y+g+v,m+d-v,y+g+v,p,.8),w=b==null?void 0:b[b.length-1],k=[{x:m-v,y:y+v},{x:m-v,y:y+g+v},...b,{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y:w.y-2*v},{x:m+d+v,y:w.y-2*v},{x:m+d+v,y:y-v},{x:m+v,y:y-v},{x:m+v,y},{x:m,y},{x:m,y:y+v}],S=[{x:m,y:y+v},{x:m+d-v,y:y+v},{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y},{x:m,y}],C=Kt.svg(i),_=Qt(e,{});e.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const L=Wr(k),O=C.path(L,_),M=Wr(S),z=C.path(M,_),F=i.insert(()=>O,":first-child");return F.insert(()=>z),F.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&F.selectAll("path").attr("style",x),n&&e.look!=="handDrawn"&&F.selectAll("path").attr("style",n),F.attr("transform",`translate(0,${-p/2})`),s.attr("transform",`translate(${-(a.width/2)-v-(a.x-(a.left??0))}, ${-(a.height/2)+v-p/2-(a.y-(a.top??0))})`),rr(e,F),e.intersect=function(A){return Ht.polygon(e,k,A)},i}T(hU,"multiWaveEdgedRectangle");async function dU(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Xt(e);e.labelStyle=n,e.useHtmlLabels||on(lr())||(e.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await xr(t,e,gr(e)),u=Math.max(o.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(o.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=Kt.svg(s),m=Qt(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,u,h,m),v=s.insert(()=>y,":first-child");return v.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),rr(e,v),e.intersect=function(x){return Ht.rect(e,x)},s}T(dU,"note");var L6e=T((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function fU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await xr(t,e,gr(e)),s=a.width+(e.padding??0),o=a.height+(e.padding??0),l=s+o,u=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Kt.svg(i),g=Qt(e,{}),m=L6e(0,0,l),y=p.path(m,g);d=i.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=wc(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),rr(e,d),e.calcIntersect=function(p,g){const m=p.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],v=Ht.polygon(p,y,g);return{x:v.x-.5,y:v.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}T(fU,"question");async function pU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?21:i??0,s=e.look==="neo"?12:i??0,{shapeSvg:o,bbox:l,label:u}=await xr(t,e,gr(e)),h=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),f=-h/2,p=-d/2,g=p/2,m=[{x:f+g,y:p},{x:f,y:0},{x:f+g,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:y}=e,v=Kt.svg(o),x=Qt(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=Wr(m),w=v.path(b,x),k=o.insert(()=>w,":first-child");return k.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.attr("transform",`translate(${-g/2},0)`),u.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),rr(e,k),e.intersect=function(S){return Ht.polygon(e,m,S)},o}T(pU,"rect_left_inv_arrow");async function gU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g"),o=a.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await Mu(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(on(Pe())){const _=h.children[0],L=pt(h);d=_.getBoundingClientRect(),L.attr("width",d.width),L.attr("height",d.height)}ae.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await Mu(o,Array.isArray(f)?f.join("
"):f,e.labelStyle,!0,!0),m=g.children[0],y=pt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const v=(e.padding||0)/2;pt(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+v+5)+")"),pt(h).attr("transform","translate( "+(d.width(ae.debug("Rough node insert CXC",O),M),":first-child"),S=a.insert(()=>(ae.debug("Rough node insert CXC",O),O),":first-child")}else S=s.insert("rect",":first-child"),C=s.insert("line"),S.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-v).attr("y",-d.height/2-v).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),C.attr("class","divider").attr("x1",-d.width/2-v).attr("x2",d.width/2+v).attr("y1",-d.height/2-v+p.height+v).attr("y2",-d.height/2-v+p.height+v);return rr(e,S),e.intersect=function(_){return Ht.rect(e,_)},a}T(gU,"rectWithTitle");async function mU(t,e,{config:{themeVariables:r}}){const n=(r==null?void 0:r.radius)??5,i={rx:n,ry:n,labelPaddingX:((e==null?void 0:e.padding)??0)*1,labelPaddingY:((e==null?void 0:e.padding)??0)*1};return Yp(t,e,i)}T(mU,"roundedRect");var fd=8;async function yU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?fd:fd*2),h=((e==null?void 0:e.height)??o.height)+a*2,d=u-fd,f=h,p=fd-u/2,g=-h/2,{cssStyles:m}=e,y=Kt.svg(s),v=Qt(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const x=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-fd,y:g+f},{x:p-fd,y:g},{x:p,y:g},{x:p,y:g+f}],b=y.polygon(x.map(k=>[k.x,k.y]),v),w=s.insert(()=>b,":first-child");return w.attr("class","basic label-container outer-path").attr("style",Zi(m)),n&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),l.attr("transform",`translate(${fd/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),rr(e,w),e.intersect=function(k){return Ht.rect(e,k)},s}T(yU,"shadedProcess");async function vU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2,10),e.height=Math.max(((e==null?void 0:e.height)??0)/1.5-s*2,10));const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,gr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,d=((e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:y}=e,v=Kt.svg(o),x=Qt(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],w=Wr(b),k=v.path(w,x),S=o.insert(()=>k,":first-child");return S.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",y),n&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(e.padding??0)-(l.x-(l.left??0))}, ${-p/4+(e.padding??0)-(l.y-(l.top??0))})`),rr(e,S),e.intersect=function(C){return Ht.polygon(e,b,C)},o}T(vU,"slopedRect");async function bU(t,e){const r=e.padding??0,n=e.look==="neo"?16:r*2,i=e.look==="neo"?12:r,a={rx:0,ry:0,labelPaddingX:e.labelPaddingX??n,labelPaddingY:i};return Yp(t,e,a)}T(bU,"squareRect");async function xU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?20:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=l.height+(e.look==="neo"?s*2:s),h=l.width+u/4+(e.look==="neo"?a*2:a),d=u/2,{cssStyles:f}=e,p=Kt.svg(o),g=Qt(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-u/2},{x:h/2-d,y:-u/2},...rb(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...rb(h/2-d,0,d,50,270,450)],y=Wr(m),v=p.path(y,g),x=o.insert(()=>v,":first-child");return x.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),rr(e,x),e.intersect=function(b){return Ht.polygon(e,m,b)},o}T(xU,"stadium");async function TU(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return Yp(t,e,r)}T(TU,"state");function wU(t,e,{config:{themeVariables:r}}){var x,b;const{labelStyles:n,nodeStyles:i}=Xt(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l,nodeShadow:u}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const h=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),d=Kt.svg(h),f=Qt(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.circle(0,0,e.width,{...f,stroke:s,strokeWidth:2}),g=o??l,m=(e.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),v=h.insert(()=>p,":first-child");if(v.insert(()=>y),e.look!=="handDrawn"&&v.attr("class","outer-path"),a&&v.selectAll("path").attr("style",a),i&&v.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const w=((b=(x=t.node())==null?void 0:x.ownerSVGElement)==null?void 0:b.id)??"",k=w?`${w}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${k})`)}return rr(e,v),e.intersect=function(w){return Ht.circle(e,(e.width??0)/2,w)},h}T(wU,"stateEnd");function CU(t,e,{config:{themeVariables:r}}){var o,l;const{lineColor:n,nodeShadow:i}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s;if(e.look==="handDrawn"){const h=Kt.svg(a).circle(0,0,e.width,qEe(n));s=a.insert(()=>h),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&i&&e.look!=="handDrawn"){const u=((l=(o=t.node())==null?void 0:o.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${h})`)}return rr(e,s),e.intersect=function(u){return Ht.circle(e,(e.width??7)/2,u)},a}T(CU,"stateStart");var Xp=8;async function kU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=(e==null?void 0:e.padding)??8,a=e.look==="neo"?28:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.width)??l.width)+2*Xp+a,h=((e==null?void 0:e.height)??l.height)+s,d=u-2*Xp,f=h,p=-u/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(e.look==="handDrawn"){const y=Kt.svg(o),v=Qt(e,{}),x=y.rectangle(p,g,d+16,f,v),b=y.line(p+Xp,g,p+Xp,g+f,v),w=y.line(p+Xp+d,g,p+Xp+d,g+f,v);o.insert(()=>b,":first-child"),o.insert(()=>w,":first-child");const k=o.insert(()=>x,":first-child"),{cssStyles:S}=e;k.attr("class","basic label-container").attr("style",Zi(S)),rr(e,k)}else{const y=wc(o,d,f,m);n&&y.attr("style",n),rr(e,y)}return e.intersect=function(y){return Ht.polygon(e,m,y)},o}T(kU,"subroutine");var j_=.2;async function EU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-s*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-j_*(e.height+s*2),10));const{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2,h=j_*u,d=j_*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2+h-h,g=u,m=-p/2,y=-g/2,{cssStyles:v}=e,x=Kt.svg(o),b=Qt(e,{}),w=[{x:m-h/2,y},{x:m+p+h/2,y},{x:m+p+h/2,y:y+g},{x:m-h/2,y:y+g}],k=[{x:m+p-h/2,y:y+g},{x:m+p+h/2,y:y+g},{x:m+p+h/2,y:y+g-d}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Wr(w),C=x.path(S,b),_=Wr(k),L=x.path(_,{...b,fillStyle:"solid"}),O=o.insert(()=>L,":first-child");return O.insert(()=>C,":first-child"),O.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),rr(e,O),e.intersect=function(M){return Ht.polygon(e,w,M)},o}T(EU,"taggedRect");async function SU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await xr(t,e,gr(e)),o=Math.max(a.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(a.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),u=l/8,h=.2*o,d=.2*l,f=l+u,{cssStyles:p}=e,g=Kt.svg(i),m=Qt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:f/2},...Du(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,u,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],v=-o/2+o/2*.1,x=-f/2-d*.4,b=[{x:v+o-h,y:(x+l)*1.3},{x:v+o,y:x+l-d},{x:v+o,y:(x+l)*.9},...Du(v+o,(x+l)*1.25,v+o-h,(x+l)*1.3,-l*.02,.5)],w=Wr(y),k=g.path(w,m),S=Wr(b),C=g.path(S,{...m,fillStyle:"solid"}),_=i.insert(()=>C,":first-child");return _.insert(()=>k,":first-child"),_.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u/2-(a.y-(a.top??0))})`),rr(e,_),e.intersect=function(L){return Ht.polygon(e,y,L)},i}T(SU,"taggedWaveEdgedRectangle");async function AU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await xr(t,e,gr(e)),s=Math.max(a.width+(e.padding??0),(e==null?void 0:e.width)||0),o=Math.max(a.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-s/2,u=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",s).attr("height",o),rr(e,h),e.intersect=function(d){return Ht.rect(e,d)},i}T(AU,"text");var I6e=T((t,e,r,n,i,a)=>`M${t},${e} a${i},${a} 0,0,1 0,${-n} l${r},0 a${i},${a} 0,0,1 0,${n} M${r},${-n} a${i},${a} 0,0,0 0,${n} - l${-r},0`,"createCylinderPathD"),S6e=x((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),A6e=x((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),CU=5,kU=10;async function EU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?12:i/2;if(e.width||e.height){const m=e.height??0;e.height=(e.height??0)-a,e.heightb,":first-child"),g=s.insert(()=>T,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=E6e(0,0,f,u,d,h);g=s.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Zi(p)).attr("style",n),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${u/2} )`),l.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),rr(e,g),e.intersect=function(m){const y=Ht.rect(e,m),v=y.y-(e.y??0);if(h!=0&&(Math.abs(v)<(e.height??0)/2||Math.abs(v)==(e.height??0)/2&&Math.abs(y.x-(e.x??0))>(e.width??0)/2-d)){let T=d*d*(1-v*v/(h*h));T!=0&&(T=Math.sqrt(Math.abs(T))),T=d-T,m.x-(e.x??0)>0&&(T=-T),y.x+=T}return y},s}x(EU,"tiltedCylinder");async function SU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=(e.look==="neo",i),s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Kt.svg(o),m=Qt(e,{}),y=Wr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=wc(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,rr(e,f),e.intersect=function(g){return Ht.polygon(e,d,g)},o}x(SU,"trapezoid");async function AU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-s*2,e.heightT,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),rr(e,b),e.intersect=function(w){return Ht.polygon(e,y,w)},u}x(AU,"trapezoidalPentagon");var _U=10,RU=10;async function LU(t,e){var w;const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-a)/2,e.widthT,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=h,e.height=d,rr(e,b),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(k){return ae.info("Triangle intersect",e,p,k),Ht.polygon(e,p,k)},s}x(LU,"triangle");async function IU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await xr(t,e,gr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(a??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(s??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,v=14-d,T=v>0?v/2:0,b=Kt.svg(l),w=Qt(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const k=[{x:-d/2-T,y:g/2},...Du(-d/2-T,g/2,d/2+T,g/2,p,.8),{x:d/2+T,y:-g/2},{x:-d/2-T,y:-g/2}],A=Wr(k),C=b.path(A,w),_=l.insert(()=>C,":first-child");return _.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),rr(e,_),e.intersect=function(L){return Ht.polygon(e,k,L)},l}x(IU,"waveEdgedRectangle");async function DU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const w=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-s-w*(20/9)),e.width=e.width-a*2}const{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s,d=h/8,f=h+d*2,{cssStyles:p}=e,g=Kt.svg(o),m=Qt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...Du(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...Du(u/2,-f/2,-u/2,-f/2,d,-1)],v=Wr(y),T=g.path(v,m),b=o.insert(()=>T,":first-child");return b.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),rr(e,b),e.intersect=function(w){return Ht.polygon(e,y,w)},o}x(DU,"waveRectangle");var ri=10;async function MU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-ri,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-ri,10));const{shapeSvg:s,bbox:o,label:l}=await xr(t,e,gr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+ri,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+a*2+ri,d=u-ri,f=h-ri,p=-d/2,g=-f/2,{cssStyles:m}=e,y=Kt.svg(s),v=Qt(e,{}),T=[{x:p-ri,y:g-ri},{x:p-ri,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-ri}],b=`M${p-ri},${g-ri} L${p+d},${g-ri} L${p+d},${g+f} L${p-ri},${g+f} L${p-ri},${g-ri} + l${-r},0`,"createCylinderPathD"),D6e=T((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),M6e=T((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),_U=5,RU=10;async function LU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?12:i/2;if(e.width||e.height){const m=e.height??0;e.height=(e.height??0)-a,e.height<_U&&(e.height=_U);const v=m/2/(2.5+m/50);e.width=(e.width??0)-a-v*3,e.widthb,":first-child"),g=s.insert(()=>x,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=I6e(0,0,f,u,d,h);g=s.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Zi(p)).attr("style",n),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${u/2} )`),l.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),rr(e,g),e.intersect=function(m){const y=Ht.rect(e,m),v=y.y-(e.y??0);if(h!=0&&(Math.abs(v)<(e.height??0)/2||Math.abs(v)==(e.height??0)/2&&Math.abs(y.x-(e.x??0))>(e.width??0)/2-d)){let x=d*d*(1-v*v/(h*h));x!=0&&(x=Math.sqrt(Math.abs(x))),x=d-x,m.x-(e.x??0)>0&&(x=-x),y.x+=x}return y},s}T(LU,"tiltedCylinder");async function IU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=(e.look==="neo",i),s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Kt.svg(o),m=Qt(e,{}),y=Wr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=wc(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,rr(e,f),e.intersect=function(g){return Ht.polygon(e,d,g)},o}T(IU,"trapezoid");async function DU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-s*2,e.heightx,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),rr(e,b),e.intersect=function(w){return Ht.polygon(e,y,w)},u}T(DU,"trapezoidalPentagon");var MU=10,NU=10;async function OU(t,e){var w;const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-a)/2,e.widthx,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=h,e.height=d,rr(e,b),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(k){return ae.info("Triangle intersect",e,p,k),Ht.polygon(e,p,k)},s}T(OU,"triangle");async function $U(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await xr(t,e,gr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(a??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(s??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,v=14-d,x=v>0?v/2:0,b=Kt.svg(l),w=Qt(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const k=[{x:-d/2-x,y:g/2},...Du(-d/2-x,g/2,d/2+x,g/2,p,.8),{x:d/2+x,y:-g/2},{x:-d/2-x,y:-g/2}],S=Wr(k),C=b.path(S,w),_=l.insert(()=>C,":first-child");return _.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),rr(e,_),e.intersect=function(L){return Ht.polygon(e,k,L)},l}T($U,"waveEdgedRectangle");async function PU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const w=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-s-w*(20/9)),e.width=e.width-a*2}const{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s,d=h/8,f=h+d*2,{cssStyles:p}=e,g=Kt.svg(o),m=Qt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...Du(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...Du(u/2,-f/2,-u/2,-f/2,d,-1)],v=Wr(y),x=g.path(v,m),b=o.insert(()=>x,":first-child");return b.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),rr(e,b),e.intersect=function(w){return Ht.polygon(e,y,w)},o}T(PU,"waveRectangle");var ri=10;async function BU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-ri,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-ri,10));const{shapeSvg:s,bbox:o,label:l}=await xr(t,e,gr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+ri,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+a*2+ri,d=u-ri,f=h-ri,p=-d/2,g=-f/2,{cssStyles:m}=e,y=Kt.svg(s),v=Qt(e,{}),x=[{x:p-ri,y:g-ri},{x:p-ri,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-ri}],b=`M${p-ri},${g-ri} L${p+d},${g-ri} L${p+d},${g+f} L${p-ri},${g+f} L${p-ri},${g-ri} M${p-ri},${g} L${p+d},${g} - M${p},${g-ri} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const w=y.path(b,v),k=s.insert(()=>w,":first-child");return k.attr("transform",`translate(${ri/2}, ${ri/2})`),k.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+ri/2-(o.x-(o.left??0))}, ${-(o.height/2)+ri/2-(o.y-(o.top??0))})`),rr(e,k),e.intersect=function(A){return Ht.polygon(e,T,A)},s}x(MU,"windowPane");var NU=new Set(["redux-color","redux-dark-color"]),_6e=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function X_(t,e){var ie,K,se,J;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=lr(),{rowEven:a,rowOdd:s,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Z}=lr(),{background:ee}=Z,ne={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ee}`]};await X_(t,ne)}const u=lr();e.useHtmlLabels=u.htmlLabels;let h=((ie=u.er)==null?void 0:ie.diagramPadding)??10,d=((K=u.er)==null?void 0:K.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=Xt(e);if(r.attributes.length===0&&e.label){const Z={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};qa(e.label,u)+Z.labelPaddingX*20){const Z=v.width+h*2-(k+A+C+_);k+=Z/M,A+=Z/M,C>0&&(C+=Z/M),_>0&&(_+=Z/M)}const F=k+A+C+_,S=Kt.svg(y),R=Qt(e,{});e.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");let N=0;w.length>0&&(N=w.reduce((Z,ee)=>Z+((ee==null?void 0:ee.rowHeight)??0),0));const D=Math.max(z.width+h*2,(e==null?void 0:e.width)||0,F),I=Math.max((N??0)+v.height,(e==null?void 0:e.height)||0),$=-D/2,B=-I/2;if(y.selectAll("g:not(:first-child)").each((Z,ee,ne)=>{const ue=pt(ne[ee]),fe=ue.attr("transform");let _e=0,Ae=0;if(fe){const me=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(fe);me&&(_e=parseFloat(me[1]),Ae=parseFloat(me[2]),ue.attr("class").includes("attribute-name")?_e+=k:ue.attr("class").includes("attribute-keys")?_e+=k+A:ue.attr("class").includes("attribute-comment")&&(_e+=k+A+C))}ue.attr("transform",`translate(${$+h/2+_e}, ${Ae+B+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(B+d/2)+")"),n!=null&&NU.has(n)){const Z=r.colorIndex??0;y.attr("data-color-id",`color-${Z%l.length}`)}const P=S.rectangle($,B,D,I,R),G=y.insert(()=>P,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[Z,ee]of w.entries()){const ue=(Z+1)%2===0&&ee.yOffset!==0,fe=S.rectangle($,v.height+B+(ee==null?void 0:ee.yOffset),D,ee==null?void 0:ee.rowHeight,{...R,fill:ue?a:s,stroke:o});y.insert(()=>fe,"g.label").attr("style",f.join("")).attr("class",`row-rect-${ue?"even":"odd"}`)}const V=1e-4;let Y=j0($,v.height+B,D+$,v.height+B,V),W=S.polygon(Y.map(Z=>[Z.x,Z.y]),R);if(y.insert(()=>W).attr("class","divider"),Y=j0(k+$,v.height+B,k+$,I+B,V),W=S.polygon(Y.map(Z=>[Z.x,Z.y]),R),y.insert(()=>W).attr("class","divider"),L){const Z=k+A+$;Y=j0(Z,v.height+B,Z,I+B,V),W=S.polygon(Y.map(ee=>[ee.x,ee.y]),R),y.insert(()=>W).attr("class","divider")}if(O){const Z=k+A+C+$;Y=j0(Z,v.height+B,Z,I+B,V),W=S.polygon(Y.map(ee=>[ee.x,ee.y]),R),y.insert(()=>W).attr("class","divider")}for(const Z of b){const ee=v.height+B+Z;Y=j0($,ee,D+$,ee,V),W=S.polygon(Y.map(ne=>[ne.x,ne.y]),R),y.insert(()=>W).attr("class","divider")}if(rr(e,G),g&&e.look!=="handDrawn")if(n!=null&&_6e.has(n))y.selectAll("path").attr("style",g);else{const Z=g.split(";"),ee=(J=Z==null?void 0:Z.filter(ne=>ne.includes("stroke")))==null?void 0:J.map(ne=>`${ne}`).join("; ");y.selectAll("path").attr("style",ee??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Z){return Ht.rect(e,Z)},y}x(X_,"erBox");async function K0(t,e,r,n=0,i=0,a=[],s=""){const o=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);e!==Eu(e)&&(e=Eu(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Wa(o,e,{width:qa(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(hc(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=pt(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}x(K0,"addText");function j0(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}x(j0,"lineToPolygon");async function OU(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",gr(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const T=e.annotations[0];await rb(o,{text:`«${T}»`},0),d=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await rb(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=s.insert("g").attr("class","members-group text");let m=0;for(const T of e.members){const b=await rb(u,T,m,[T.parseClassifier()]);m+=b+a}p=u.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let y=0;for(const T of e.methods){const b=await rb(h,T,y,[T.parseClassifier()]);y+=b+a}let v=s.node().getBBox();if(o!==null){const T=o.node().getBBox();o.attr("transform",`translate(${-T.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=s.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=s.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=s.node().getBBox(),{shapeSvg:s,bbox:v}}x(OU,"textHelper");async function rb(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=lr();let s="useHtmlLabels"in e?e.useHtmlLabels:hc(a.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),ui(o)&&(s=!0);const l=await Wa(i,$6(Tc(o)),{width:qa(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let u,h=1;if(s){const d=l.children[0],f=pt(l);h=d.innerHTML.split("
").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(y=>{function v(){var T;if(m.style.display="flex",m.style.flexDirection="column",g){const b=((T=a.fontSize)==null?void 0:T.toString())??window.getComputedStyle(document.body).fontSize,k=parseInt(b,10)*5+"px";m.style.minWidth=k,m.style.maxWidth=k}else m.style.width="100%";y(m)}x(v,"setupImage"),setTimeout(()=>{m.complete&&v()}),m.addEventListener("error",v),m.addEventListener("load",v)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&pt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}x(rb,"addText");async function $U(t,e){var S,R;const r=Pe(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,s=a,o=e.useHtmlLabels??hc(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await OU(t,e,r,o,s),{labelStyles:d,nodeStyles:f}=Xt(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((S=l.styles)==null?void 0:S.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((R=r.class)!=null&&R.hideEmptyMembersBox),m=Kt.svg(u),y=Qt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let T=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?T+=s:l.members.length>0&&l.methods.length===0&&(T+=s*2);const w=-v/2,k=-T/2;let A=g?a*2:l.members.length===0&&l.methods.length===0?-a:0;b&&(A=a*2);const C=m.rectangle(w-a,k-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0),v+2*a,T+2*a+A,y),_=u.insert(()=>C,":first-child");_.attr("class","basic label-container outer-path");const L=_.node().getBBox(),O=u.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,M=u.select(".label-group").node().getBBox().height-(g?a/2:0)||0,z=u.select(".members-group").node().getBBox().height-(g?a/2:0)||0,F=(O+M+k+a-(k-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(".text").each((N,D,I)=>{var Y,W;const $=pt(I[D]),B=$.attr("transform");let P=0;if(B){const K=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(B);K&&(P=parseFloat(K[2]))}let G=P+k+a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0);if($.attr("class").includes("methods-group")){const ie=Math.max(z,s/2);b?G=Math.max(F,O+M+ie+k+s*2+a)+s*2:G=O+M+ie+k+s*4+a}l.members.length===0&&l.methods.length===0&&((Y=r.class)!=null&&Y.hideEmptyMembersBox)&&(l.annotations.length>0?G=P-s:G=P),o||(G-=4);let V=w;($.attr("class").includes("label-group")||$.attr("class").includes("annotation-group"))&&(V=-((W=$.node())==null?void 0:W.getBBox().width)/2||0,u.selectAll("text").each(function(ie,K,se){window.getComputedStyle(se[K]).textAnchor==="middle"&&(V=0)})),$.attr("transform",`translate(${V}, ${G})`)}),l.members.length>0||l.methods.length>0||g){const N=O+M+k+a,D=m.line(L.x,N,L.x+L.width,N+.001,y);u.insert(()=>D).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const N=O+M+z+k+s*2+a,D=m.line(L.x,b?Math.max(F,N):N,L.x+L.width,(b?Math.max(F,N):N)+.001,y);u.insert(()=>D).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),_.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const N=RegExp(/color\s*:\s*([^;]*)/),D=N.exec(p);if(D){const I=D[0].replace("color","fill");u.selectAll("tspan").attr("style",I)}else if(d){const I=N.exec(d);if(I){const $=I[0].replace("color","fill");u.selectAll("tspan").attr("style",$)}}}return rr(e,_),e.intersect=function(N){return Ht.rect(e,N)},u}x($U,"classBox");async function PU(t,e){var L,O;const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e,a=e,s=20,o=20,l="verifyMethod"in e,u=gr(e),{themeVariables:h}=Pe(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await bl(p,`<<${i.type}>>`,0,e.labelStyle):g=await bl(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await bl(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const M=await bl(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=M;const z=await bl(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=z;const F=await bl(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=F,await bl(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const M=await bl(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=M,await bl(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const v=(((L=p.node())==null?void 0:L.getBBox().width)??200)+s,T=(((O=p.node())==null?void 0:O.getBBox().height)??200)+s,b=-v/2,w=-T/2,k=Kt.svg(p),A=Qt(e,{});e.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const C=k.rectangle(b,w,v,T,A),_=p.insert(()=>C,":first-child");if(_.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const M=e.colorIndex??0;p.attr("data-color-id",`color-${M%d.length}`)}if(p.selectAll(".label").each((M,z,F)=>{const S=pt(F[z]),R=S.attr("transform");let N=0,D=0;if(R){const P=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(R);P&&(N=parseFloat(P[1]),D=parseFloat(P[2]))}const I=D-T/2;let $=b+s/2;(z===0||z===1)&&($=N),S.attr("transform",`translate(${$}, ${I+s})`)}),m>g+y+o){const M=w+g+y+o;let z;if(e.look==="neo"){const R=[[b,M],[b+v,M],[b+v,M+.001],[b,M+.001]];z=k.polygon(R,A)}else z=k.line(b,M,b+v,M,A);p.insert(()=>z).attr("class","divider")}return rr(e,_),e.intersect=function(M){return Ht.rect(e,M)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}x(PU,"requirementBox");async function bl(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=Pe(),s=a.htmlLabels??!0,o=await Wa(i,$6(Tc(e)),{width:qa(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const u=o.children[0],h=pt(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}x(bl,"addText");var R6e=x(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function BU(t,e,{config:r}){var z,F;const{labelStyles:n,nodeStyles:i}=Xt(e);e.labelStyle=n||"";const a=10,s=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,gr(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((z=r==null?void 0:r.kanban)!=null&&z.ticketBaseUrl)&&(d=(F=r==null?void 0:r.kanban)==null?void 0:F.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await G_(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await G_(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await G_(o,"assigned"in e&&e.assigned||"",p);e.width=s;const T=10,b=(e==null?void 0:e.width)||0,w=Math.max(m.height,v.height)/2,k=Math.max(l.height+T*2,(e==null?void 0:e.height)||0)+w,A=-b/2,C=-k/2;u.attr("transform","translate("+(h-b/2)+", "+(-w-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-w+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*a)+", "+(-w+l.height/2)+")");let _;const{rx:L,ry:O}=e,{cssStyles:M}=e;if(e.look==="handDrawn"){const S=Kt.svg(o),R=Qt(e,{}),N=L||O?S.path(Nu(A,C,b,k,L||0),R):S.rectangle(A,C,b,k,R);_=o.insert(()=>N,":first-child"),_.attr("class","basic label-container").attr("style",M||null)}else{_=o.insert("rect",":first-child"),_.attr("class","basic label-container __APA__").attr("style",i).attr("rx",L??5).attr("ry",O??5).attr("x",A).attr("y",C).attr("width",b).attr("height",k);const S="priority"in e&&e.priority;if(S){const R=o.append("line"),N=A+2,D=C+Math.floor((L??0)/2),I=C+k-Math.floor((L??0)/2);R.attr("x1",N).attr("y1",D).attr("x2",N).attr("y2",I).attr("stroke-width","4").attr("stroke",R6e(S))}}return rr(e,_),e.height=k,e.intersect=function(S){return Ht.rect(e,S)},o}x(BU,"kanbanItem");async function FU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,gr(e)),l=a.width+10*s,u=a.height+8*s,h=.15*l,{cssStyles:d}=e,f=a.width+20,p=a.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let y;const v=`M0 0 + M${p},${g-ri} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const w=y.path(b,v),k=s.insert(()=>w,":first-child");return k.attr("transform",`translate(${ri/2}, ${ri/2})`),k.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+ri/2-(o.x-(o.left??0))}, ${-(o.height/2)+ri/2-(o.y-(o.top??0))})`),rr(e,k),e.intersect=function(S){return Ht.polygon(e,x,S)},s}T(BU,"windowPane");var FU=new Set(["redux-color","redux-dark-color"]),N6e=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Z_(t,e){var ie,K,se,J;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=lr(),{rowEven:a,rowOdd:s,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Z}=lr(),{background:ee}=Z,ne={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ee}`]};await Z_(t,ne)}const u=lr();e.useHtmlLabels=u.htmlLabels;let h=((ie=u.er)==null?void 0:ie.diagramPadding)??10,d=((K=u.er)==null?void 0:K.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=Xt(e);if(r.attributes.length===0&&e.label){const Z={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};qa(e.label,u)+Z.labelPaddingX*20){const Z=v.width+h*2-(k+S+C+_);k+=Z/M,S+=Z/M,C>0&&(C+=Z/M),_>0&&(_+=Z/M)}const F=k+S+C+_,A=Kt.svg(y),R=Qt(e,{});e.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");let N=0;w.length>0&&(N=w.reduce((Z,ee)=>Z+((ee==null?void 0:ee.rowHeight)??0),0));const D=Math.max(z.width+h*2,(e==null?void 0:e.width)||0,F),I=Math.max((N??0)+v.height,(e==null?void 0:e.height)||0),$=-D/2,B=-I/2;if(y.selectAll("g:not(:first-child)").each((Z,ee,ne)=>{const ue=pt(ne[ee]),fe=ue.attr("transform");let _e=0,Ae=0;if(fe){const me=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(fe);me&&(_e=parseFloat(me[1]),Ae=parseFloat(me[2]),ue.attr("class").includes("attribute-name")?_e+=k:ue.attr("class").includes("attribute-keys")?_e+=k+S:ue.attr("class").includes("attribute-comment")&&(_e+=k+S+C))}ue.attr("transform",`translate(${$+h/2+_e}, ${Ae+B+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(B+d/2)+")"),n!=null&&FU.has(n)){const Z=r.colorIndex??0;y.attr("data-color-id",`color-${Z%l.length}`)}const P=A.rectangle($,B,D,I,R),G=y.insert(()=>P,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[Z,ee]of w.entries()){const ue=(Z+1)%2===0&&ee.yOffset!==0,fe=A.rectangle($,v.height+B+(ee==null?void 0:ee.yOffset),D,ee==null?void 0:ee.rowHeight,{...R,fill:ue?a:s,stroke:o});y.insert(()=>fe,"g.label").attr("style",f.join("")).attr("class",`row-rect-${ue?"even":"odd"}`)}const V=1e-4;let X=jp($,v.height+B,D+$,v.height+B,V),W=A.polygon(X.map(Z=>[Z.x,Z.y]),R);if(y.insert(()=>W).attr("class","divider"),X=jp(k+$,v.height+B,k+$,I+B,V),W=A.polygon(X.map(Z=>[Z.x,Z.y]),R),y.insert(()=>W).attr("class","divider"),L){const Z=k+S+$;X=jp(Z,v.height+B,Z,I+B,V),W=A.polygon(X.map(ee=>[ee.x,ee.y]),R),y.insert(()=>W).attr("class","divider")}if(O){const Z=k+S+C+$;X=jp(Z,v.height+B,Z,I+B,V),W=A.polygon(X.map(ee=>[ee.x,ee.y]),R),y.insert(()=>W).attr("class","divider")}for(const Z of b){const ee=v.height+B+Z;X=jp($,ee,D+$,ee,V),W=A.polygon(X.map(ne=>[ne.x,ne.y]),R),y.insert(()=>W).attr("class","divider")}if(rr(e,G),g&&e.look!=="handDrawn")if(n!=null&&N6e.has(n))y.selectAll("path").attr("style",g);else{const Z=g.split(";"),ee=(J=Z==null?void 0:Z.filter(ne=>ne.includes("stroke")))==null?void 0:J.map(ne=>`${ne}`).join("; ");y.selectAll("path").attr("style",ee??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Z){return Ht.rect(e,Z)},y}T(Z_,"erBox");async function Kp(t,e,r,n=0,i=0,a=[],s=""){const o=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);e!==Eu(e)&&(e=Eu(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Wa(o,e,{width:qa(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(hc(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=pt(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}T(Kp,"addText");function jp(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}T(jp,"lineToPolygon");async function zU(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",gr(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const x=e.annotations[0];await nb(o,{text:`«${x}»`},0),d=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await nb(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=s.insert("g").attr("class","members-group text");let m=0;for(const x of e.members){const b=await nb(u,x,m,[x.parseClassifier()]);m+=b+a}p=u.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let y=0;for(const x of e.methods){const b=await nb(h,x,y,[x.parseClassifier()]);y+=b+a}let v=s.node().getBBox();if(o!==null){const x=o.node().getBBox();o.attr("transform",`translate(${-x.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=s.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=s.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=s.node().getBBox(),{shapeSvg:s,bbox:v}}T(zU,"textHelper");async function nb(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=lr();let s="useHtmlLabels"in e?e.useHtmlLabels:hc(a.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),ui(o)&&(s=!0);const l=await Wa(i,F6(Tc(o)),{width:qa(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let u,h=1;if(s){const d=l.children[0],f=pt(l);h=d.innerHTML.split("
").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(y=>{function v(){var x;if(m.style.display="flex",m.style.flexDirection="column",g){const b=((x=a.fontSize)==null?void 0:x.toString())??window.getComputedStyle(document.body).fontSize,k=parseInt(b,10)*5+"px";m.style.minWidth=k,m.style.maxWidth=k}else m.style.width="100%";y(m)}T(v,"setupImage"),setTimeout(()=>{m.complete&&v()}),m.addEventListener("error",v),m.addEventListener("load",v)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&pt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}T(nb,"addText");async function GU(t,e){var A,R;const r=Pe(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,s=a,o=e.useHtmlLabels??hc(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await zU(t,e,r,o,s),{labelStyles:d,nodeStyles:f}=Xt(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((A=l.styles)==null?void 0:A.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((R=r.class)!=null&&R.hideEmptyMembersBox),m=Kt.svg(u),y=Qt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let x=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?x+=s:l.members.length>0&&l.methods.length===0&&(x+=s*2);const w=-v/2,k=-x/2;let S=g?a*2:l.members.length===0&&l.methods.length===0?-a:0;b&&(S=a*2);const C=m.rectangle(w-a,k-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0),v+2*a,x+2*a+S,y),_=u.insert(()=>C,":first-child");_.attr("class","basic label-container outer-path");const L=_.node().getBBox(),O=u.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,M=u.select(".label-group").node().getBBox().height-(g?a/2:0)||0,z=u.select(".members-group").node().getBBox().height-(g?a/2:0)||0,F=(O+M+k+a-(k-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(".text").each((N,D,I)=>{var X,W;const $=pt(I[D]),B=$.attr("transform");let P=0;if(B){const K=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(B);K&&(P=parseFloat(K[2]))}let G=P+k+a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0);if($.attr("class").includes("methods-group")){const ie=Math.max(z,s/2);b?G=Math.max(F,O+M+ie+k+s*2+a)+s*2:G=O+M+ie+k+s*4+a}l.members.length===0&&l.methods.length===0&&((X=r.class)!=null&&X.hideEmptyMembersBox)&&(l.annotations.length>0?G=P-s:G=P),o||(G-=4);let V=w;($.attr("class").includes("label-group")||$.attr("class").includes("annotation-group"))&&(V=-((W=$.node())==null?void 0:W.getBBox().width)/2||0,u.selectAll("text").each(function(ie,K,se){window.getComputedStyle(se[K]).textAnchor==="middle"&&(V=0)})),$.attr("transform",`translate(${V}, ${G})`)}),l.members.length>0||l.methods.length>0||g){const N=O+M+k+a,D=m.line(L.x,N,L.x+L.width,N+.001,y);u.insert(()=>D).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const N=O+M+z+k+s*2+a,D=m.line(L.x,b?Math.max(F,N):N,L.x+L.width,(b?Math.max(F,N):N)+.001,y);u.insert(()=>D).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),_.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const N=RegExp(/color\s*:\s*([^;]*)/),D=N.exec(p);if(D){const I=D[0].replace("color","fill");u.selectAll("tspan").attr("style",I)}else if(d){const I=N.exec(d);if(I){const $=I[0].replace("color","fill");u.selectAll("tspan").attr("style",$)}}}return rr(e,_),e.intersect=function(N){return Ht.rect(e,N)},u}T(GU,"classBox");async function qU(t,e){var L,O;const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e,a=e,s=20,o=20,l="verifyMethod"in e,u=gr(e),{themeVariables:h}=Pe(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await bl(p,`<<${i.type}>>`,0,e.labelStyle):g=await bl(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await bl(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const M=await bl(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=M;const z=await bl(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=z;const F=await bl(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=F,await bl(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const M=await bl(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=M,await bl(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const v=(((L=p.node())==null?void 0:L.getBBox().width)??200)+s,x=(((O=p.node())==null?void 0:O.getBBox().height)??200)+s,b=-v/2,w=-x/2,k=Kt.svg(p),S=Qt(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const C=k.rectangle(b,w,v,x,S),_=p.insert(()=>C,":first-child");if(_.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const M=e.colorIndex??0;p.attr("data-color-id",`color-${M%d.length}`)}if(p.selectAll(".label").each((M,z,F)=>{const A=pt(F[z]),R=A.attr("transform");let N=0,D=0;if(R){const P=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(R);P&&(N=parseFloat(P[1]),D=parseFloat(P[2]))}const I=D-x/2;let $=b+s/2;(z===0||z===1)&&($=N),A.attr("transform",`translate(${$}, ${I+s})`)}),m>g+y+o){const M=w+g+y+o;let z;if(e.look==="neo"){const R=[[b,M],[b+v,M],[b+v,M+.001],[b,M+.001]];z=k.polygon(R,S)}else z=k.line(b,M,b+v,M,S);p.insert(()=>z).attr("class","divider")}return rr(e,_),e.intersect=function(M){return Ht.rect(e,M)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}T(qU,"requirementBox");async function bl(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=Pe(),s=a.htmlLabels??!0,o=await Wa(i,F6(Tc(e)),{width:qa(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const u=o.children[0],h=pt(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}T(bl,"addText");var O6e=T(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function VU(t,e,{config:r}){var z,F;const{labelStyles:n,nodeStyles:i}=Xt(e);e.labelStyle=n||"";const a=10,s=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,gr(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((z=r==null?void 0:r.kanban)!=null&&z.ticketBaseUrl)&&(d=(F=r==null?void 0:r.kanban)==null?void 0:F.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await W_(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await W_(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await W_(o,"assigned"in e&&e.assigned||"",p);e.width=s;const x=10,b=(e==null?void 0:e.width)||0,w=Math.max(m.height,v.height)/2,k=Math.max(l.height+x*2,(e==null?void 0:e.height)||0)+w,S=-b/2,C=-k/2;u.attr("transform","translate("+(h-b/2)+", "+(-w-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-w+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*a)+", "+(-w+l.height/2)+")");let _;const{rx:L,ry:O}=e,{cssStyles:M}=e;if(e.look==="handDrawn"){const A=Kt.svg(o),R=Qt(e,{}),N=L||O?A.path(Nu(S,C,b,k,L||0),R):A.rectangle(S,C,b,k,R);_=o.insert(()=>N,":first-child"),_.attr("class","basic label-container").attr("style",M||null)}else{_=o.insert("rect",":first-child"),_.attr("class","basic label-container __APA__").attr("style",i).attr("rx",L??5).attr("ry",O??5).attr("x",S).attr("y",C).attr("width",b).attr("height",k);const A="priority"in e&&e.priority;if(A){const R=o.append("line"),N=S+2,D=C+Math.floor((L??0)/2),I=C+k-Math.floor((L??0)/2);R.attr("x1",N).attr("y1",D).attr("x2",N).attr("y2",I).attr("stroke-width","4").attr("stroke",O6e(A))}}return rr(e,_),e.height=k,e.intersect=function(A){return Ht.rect(e,A)},o}T(VU,"kanbanItem");async function WU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,gr(e)),l=a.width+10*s,u=a.height+8*s,h=.15*l,{cssStyles:d}=e,f=a.width+20,p=a.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let y;const v=`M0 0 a${h},${h} 1 0,0 ${g*.25},${-1*m*.1} a${h},${h} 1 0,0 ${g*.25},0 a${h},${h} 1 0,0 ${g*.25},0 @@ -253,7 +253,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33} a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34} a${h},${h} 1 0,0 ${g*.1},${-1*m*.33} - H0 V0 Z`;if(e.look==="handDrawn"){const T=Kt.svg(i),b=Qt(e,{}),w=T.path(v,b);y=i.insert(()=>w,":first-child"),y.attr("class","basic label-container").attr("style",Zi(d))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),rr(e,y),e.calcIntersect=function(T,b){return Ht.rect(T,b)},e.intersect=function(T){return ae.info("Bang intersect",e,T),Ht.rect(e,T)},i}x(FU,"bang");async function zU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,gr(e)),l=a.width+2*s,u=a.height+2*s,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const y=`M0 0 + H0 V0 Z`;if(e.look==="handDrawn"){const x=Kt.svg(i),b=Qt(e,{}),w=x.path(v,b);y=i.insert(()=>w,":first-child"),y.attr("class","basic label-container").attr("style",Zi(d))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),rr(e,y),e.calcIntersect=function(x,b){return Ht.rect(x,b)},e.intersect=function(x){return ae.info("Bang intersect",e,x),Ht.rect(e,x)},i}T(WU,"bang");async function UU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,gr(e)),l=a.width+2*s,u=a.height+2*s,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const y=`M0 0 a${h},${h} 0 0,1 ${l*.25},${-1*l*.1} a${f},${f} 1 0,1 ${l*.4},${-1*l*.1} a${d},${d} 1 0,1 ${l*.35},${l*.2} @@ -267,7 +267,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error a${h},${h} 1 0,1 ${-1*l*.1},${-1*u*.35} a${p},${p} 1 0,1 ${l*.1},${-1*u*.65} - H0 V0 Z`;if(e.look==="handDrawn"){const v=Kt.svg(i),T=Qt(e,{}),b=v.path(y,T);m=i.insert(()=>b,":first-child"),m.attr("class","basic label-container").attr("style",Zi(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),rr(e,m),e.calcIntersect=function(v,T){return Ht.rect(v,T)},e.intersect=function(v){return ae.info("Cloud intersect",e,v),Ht.rect(e,v)},i}x(zU,"cloud");async function GU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,gr(e)),l=a.width+8*s,u=a.height+2*s,h=5,d=e.look==="neo"?` + H0 V0 Z`;if(e.look==="handDrawn"){const v=Kt.svg(i),x=Qt(e,{}),b=v.path(y,x);m=i.insert(()=>b,":first-child"),m.attr("class","basic label-container").attr("style",Zi(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),rr(e,m),e.calcIntersect=function(v,x){return Ht.rect(v,x)},e.intersect=function(v){return ae.info("Cloud intersect",e,v),Ht.rect(e,v)},i}T(UU,"cloud");async function HU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,gr(e)),l=a.width+8*s,u=a.height+2*s,h=5,d=e.look==="neo"?` M${-l/2} ${u/2-h} v${-u+2*h} q0,-${h} ${h},-${h} @@ -287,25 +287,25 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error h${-(l-2*h)} q${-h},0 ${-h},${-h} Z - `;if(!e.domId)throw new Error(`defaultMindmapNode: node "${e.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=i.append("path").attr("id",e.domId).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",d);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2),o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>o.node()),rr(e,f),e.calcIntersect=function(p,g){return Ht.rect(p,g)},e.intersect=function(p){return Ht.rect(e,p)},i}x(GU,"defaultMindmapNode");async function qU(t,e){const r={padding:e.padding??0};return H_(t,e,r)}x(qU,"mindmapCircle");var L6e=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:pU},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:hU},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:gU},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:bU},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:MW},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:NW},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:H_},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:FU},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:zU},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:lU},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:VW},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:JW},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:QW},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:SU},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:jW},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:$W},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:wU},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:CW},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:dU},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:vU},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:yU},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:GW},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:WW},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:AW},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:_W},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:RW},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:eU},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:IU},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:qW},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:EU},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:nU},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:LW},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:OW},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:LU},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:MU},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:PW},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:AU},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:zW},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:fU},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:sU},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:aU},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:wW},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:SW},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:TU},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:xU},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:DU},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:cU},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:iU}],I6e=x(()=>{const e=[...Object.entries({state:mU,choice:kW,note:oU,rectWithTitle:uU,labelRect:ZW,iconSquare:XW,iconCircle:HW,icon:UW,iconRounded:YW,imageSquare:KW,anchor:xW,kanbanItem:BU,mindmapCircle:qU,defaultMindmapNode:GU,classBox:$U,erBox:X_,requirementBox:PU}),...L6e.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),VU=I6e();function WU(t){return t in VU}x(WU,"isValidShape");var rC=new Map;async function nC(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?VU[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;r.config.securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return n.attr("data-look",Zi(e.look)),e.tooltip&&i.attr("title",e.tooltip),rC.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}x(nC,"insertNode");var D6e=x((t,e)=>{rC.set(e.id,t)},"setNodeElem"),M6e=x(()=>{rC.clear()},"clear"),K_=x(t=>{const e=rC.get(t.id);ae.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode"),N6e=x((t,e,r,n,i,a=!1,s)=>{e.arrowTypeStart&&UU(t,"start",e.arrowTypeStart,r,n,i,a,s),e.arrowTypeEnd&&UU(t,"end",e.arrowTypeEnd,r,n,i,a,s)},"addEdgeMarkers"),O6e={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},$6e=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],UU=x((t,e,r,n,i,a,s=!1,o)=>{var g;const l=O6e[r],u=l&&$6e.includes(l.type);if(!l){ae.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${a}-${h}${e==="start"?"Start":"End"}${s&&u?"-margin":""}`;if(o&&o.trim()!==""){const m=o.replace(/[^\dA-Za-z]/g,"_"),y=`${p}_${m}`;if(!document.getElementById(y)){const v=document.getElementById(p);if(v){const T=v.cloneNode(!0);T.id=y,T.querySelectorAll("path, circle, line").forEach(w=>{w.setAttribute("stroke",o),l.fill&&w.setAttribute("fill",o)}),(g=v.parentNode)==null||g.appendChild(T)}}t.attr(`marker-${e}`,`url(${n}#${y})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),P6e=x(t=>{var e,r;return typeof t=="string"?t:(r=(e=Pe())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),iC=new Map,ua=new Map,B6e=x(()=>{iC.clear(),ua.clear()},"clear"),nb=x(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),HU=x(async(t,e)=>{const r=Pe();let n=on(r);const{labelStyles:i}=Xt(e);e.labelStyle=i;const a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",e.id),o=e.labelType==="markdown",u=await Wa(t,e.label,{style:nb(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);s.node().appendChild(u),ae.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=pt(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=pt(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}s.attr("transform",yl(d,n)),iC.set(e.id,a),e.width=h.width,e.height=h.height;let f;if(e.startLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Mu(g,e.startLabelLeft,nb(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=pt(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",yl(y,n)),ua.get(e.id)||ua.set(e.id,{}),ua.get(e.id).startLeft=p,ib(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Mu(g,e.startLabelRight,nb(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=pt(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",yl(y,n)),ua.get(e.id)||ua.set(e.id,{}),ua.get(e.id).startRight=p,ib(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Mu(p,e.endLabelLeft,nb(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=pt(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",yl(y,n)),ua.get(e.id)||ua.set(e.id,{}),ua.get(e.id).endLeft=p,ib(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Mu(p,e.endLabelRight,nb(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=pt(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",yl(y,n)),ua.get(e.id)||ua.set(e.id,{}),ua.get(e.id).endRight=p,ib(f,e.endLabelRight)}return u},"insertEdgeLabel");function ib(t,e){on(Pe())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}x(ib,"setTerminalWidth");var YU=x((t,e)=>{ae.debug("Moving label abc88 ",t.id,t.label,iC.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Pe(),{subGraphTitleTotalMargin:i}=H2(n);if(t.label){const a=iC.get(t.id);let s=t.x,o=t.y;if(r){const l=Lr.calcLabelPosition(r);ae.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=ua.get(t.id).startLeft;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=ua.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=ua.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=ua.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),F6e=x((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),z6e=x((t,e,r)=>{ae.debug(`intersection calc abc89: + `;if(!e.domId)throw new Error(`defaultMindmapNode: node "${e.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=i.append("path").attr("id",e.domId).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",d);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2),o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>o.node()),rr(e,f),e.calcIntersect=function(p,g){return Ht.rect(p,g)},e.intersect=function(p){return Ht.rect(e,p)},i}T(HU,"defaultMindmapNode");async function YU(t,e){const r={padding:e.padding??0};return K_(t,e,r)}T(YU,"mindmapCircle");var $6e=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:bU},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:mU},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:xU},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:kU},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:BW},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:FW},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:K_},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:WU},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:UU},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:fU},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:XW},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:iU},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:nU},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:IU},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:tU},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:GW},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:AU},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:_W},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:yU},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:CU},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:wU},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:HW},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:KW},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:DW},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:MW},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:NW},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:aU},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:$U},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:YW},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:LU},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:lU},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:OW},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:zW},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:OU},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:BU},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:qW},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:DU},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:UW},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:vU},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:hU},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:uU},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:AW},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:IW},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:SU},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:EU},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:PU},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:pU},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:cU}],P6e=T(()=>{const e=[...Object.entries({state:TU,choice:RW,note:dU,rectWithTitle:gU,labelRect:rU,iconSquare:JW,iconCircle:ZW,icon:jW,iconRounded:QW,imageSquare:eU,anchor:EW,kanbanItem:VU,mindmapCircle:YU,defaultMindmapNode:HU,classBox:GU,erBox:Z_,requirementBox:qU}),...$6e.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),XU=P6e();function KU(t){return t in XU}T(KU,"isValidShape");var iC=new Map;async function aC(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?XU[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;r.config.securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return n.attr("data-look",Zi(e.look)),e.tooltip&&i.attr("title",e.tooltip),iC.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}T(aC,"insertNode");var B6e=T((t,e)=>{iC.set(e.id,t)},"setNodeElem"),F6e=T(()=>{iC.clear()},"clear"),Q_=T(t=>{const e=iC.get(t.id);ae.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode"),z6e=T((t,e,r,n,i,a=!1,s)=>{e.arrowTypeStart&&jU(t,"start",e.arrowTypeStart,r,n,i,a,s),e.arrowTypeEnd&&jU(t,"end",e.arrowTypeEnd,r,n,i,a,s)},"addEdgeMarkers"),G6e={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},q6e=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],jU=T((t,e,r,n,i,a,s=!1,o)=>{var g;const l=G6e[r],u=l&&q6e.includes(l.type);if(!l){ae.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${a}-${h}${e==="start"?"Start":"End"}${s&&u?"-margin":""}`;if(o&&o.trim()!==""){const m=o.replace(/[^\dA-Za-z]/g,"_"),y=`${p}_${m}`;if(!document.getElementById(y)){const v=document.getElementById(p);if(v){const x=v.cloneNode(!0);x.id=y,x.querySelectorAll("path, circle, line").forEach(w=>{w.setAttribute("stroke",o),l.fill&&w.setAttribute("fill",o)}),(g=v.parentNode)==null||g.appendChild(x)}}t.attr(`marker-${e}`,`url(${n}#${y})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),V6e=T(t=>{var e,r;return typeof t=="string"?t:(r=(e=Pe())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),sC=new Map,ua=new Map,W6e=T(()=>{sC.clear(),ua.clear()},"clear"),ib=T(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),ZU=T(async(t,e)=>{const r=Pe();let n=on(r);const{labelStyles:i}=Xt(e);e.labelStyle=i;const a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",e.id),o=e.labelType==="markdown",u=await Wa(t,e.label,{style:ib(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);s.node().appendChild(u),ae.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=pt(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=pt(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}s.attr("transform",yl(d,n)),sC.set(e.id,a),e.width=h.width,e.height=h.height;let f;if(e.startLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Mu(g,e.startLabelLeft,ib(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=pt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",yl(y,n)),ua.get(e.id)||ua.set(e.id,{}),ua.get(e.id).startLeft=p,ab(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Mu(g,e.startLabelRight,ib(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=pt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",yl(y,n)),ua.get(e.id)||ua.set(e.id,{}),ua.get(e.id).startRight=p,ab(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Mu(p,e.endLabelLeft,ib(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=pt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",yl(y,n)),ua.get(e.id)||ua.set(e.id,{}),ua.get(e.id).endLeft=p,ab(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Mu(p,e.endLabelRight,ib(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=pt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",yl(y,n)),ua.get(e.id)||ua.set(e.id,{}),ua.get(e.id).endRight=p,ab(f,e.endLabelRight)}return u},"insertEdgeLabel");function ab(t,e){on(Pe())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}T(ab,"setTerminalWidth");var QU=T((t,e)=>{ae.debug("Moving label abc88 ",t.id,t.label,sC.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Pe(),{subGraphTitleTotalMargin:i}=Y2(n);if(t.label){const a=sC.get(t.id);let s=t.x,o=t.y;if(r){const l=Lr.calcLabelPosition(r);ae.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=ua.get(t.id).startLeft;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=ua.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=ua.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=ua.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),U6e=T((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),H6e=T((t,e,r)=>{ae.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(e)} insidePoint : ${JSON.stringify(r)} - node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{ae.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(ae.info("abc88 checking point",a,e),!F6e(e,a)&&!i){const s=z6e(e,n,a);ae.debug("abc88 inside",a,n,s),ae.debug("abc88 intersection",s,e);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?ae.warn("abc88 no intersect",s,r):r.push(s),i=!0}else ae.warn("abc88 outside",a,n),n=a,i||r.push(a)}),ae.debug("returning points",r),r},"cutPathAtIntersect");function KU(t){const e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}x(KU,"extractCornerPoints");var jU=x(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),G6e=x(function(t){const{cornerPointPositions:e}=KU(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){ae.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const p=5;s.x===o.x?f={x:u<0?o.x-p+d:o.x+p-d,y:h<0?o.y-d:o.y+d}:f={x:u<0?o.x-d:o.x+d,y:h<0?o.y-p+d:o.y+p-d}}else ae.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),q6e=x((t,e,r)=>{const n=t-e-r,i=2,a=2,s=i+a,o=Math.floor(n/s),l=Array(o).fill(`${i} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),ZU=x(function(t,e,r,n,i,a,s,o=!1){var D;if(!s)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l}=Pe();let u=e.points,h=!1;const d=i;var f=a;const p=[];for(const I in e.cssCompiledStyles)g_(I)||p.push(e.cssCompiledStyles[I]);ae.debug("UIO intersect check",e.points,f.x,d.x),f.intersect&&d.intersect&&!o&&(u=u.slice(1,e.points.length-1),u.unshift(d.intersect(u[0])),ae.debug("Last point UIO",e.start,"-->",e.end,u[u.length-1],f,f.intersect(u[u.length-1])),u.push(f.intersect(u[u.length-1])));const g=btoa(JSON.stringify(u));e.toCluster&&(ae.info("to cluster abc88",r.get(e.toCluster)),u=XU(e.points,r.get(e.toCluster).node),h=!0),e.fromCluster&&(ae.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(u,null,2)),u=XU(u.reverse(),r.get(e.fromCluster).node).reverse(),h=!0);let m=u.filter(I=>!Number.isNaN(I.y));const y=P6e(e.curve);y!=="rounded"&&(m=G6e(m));let v=D2;switch(y){case"linear":v=D2;break;case"basis":v=N2;break;case"cardinal":v=kz;break;case"bumpX":v=bz;break;case"bumpY":v=xz;break;case"catmullRom":v=Sz;break;case"monotoneX":v=Oz;break;case"monotoneY":v=$z;break;case"natural":v=Fz;break;case"step":v=zz;break;case"stepAfter":v=qz;break;case"stepBefore":v=Gz;break;case"rounded":v=D2;break;default:v=N2}const{x:T,y:b}=Aq(e),w=M2().x(T).y(b).curve(v);let k;switch(e.thickness){case"normal":k="edge-thickness-normal";break;case"thick":k="edge-thickness-thick";break;case"invisible":k="edge-thickness-invisible";break;default:k="edge-thickness-normal"}switch(e.pattern){case"solid":k+=" edge-pattern-solid";break;case"dotted":k+=" edge-pattern-dotted";break;case"dashed":k+=" edge-pattern-dashed";break;default:k+=" edge-pattern-solid"}let A,C=y==="rounded"?QU(JU(m,e),5):w(m);const _=Array.isArray(e.style)?e.style:[e.style];let L=_.find(I=>I==null?void 0:I.startsWith("stroke:")),O="";e.animate&&(O="edge-animation-fast"),e.animation&&(O="edge-animation-"+e.animation);let M=!1;if(e.look==="handDrawn"){const I=Kt.svg(t);Object.assign([],m);const $=I.path(C,{roughness:.3,seed:l});k+=" transition",A=pt($).select("path").attr("id",`${s}-${e.id}`).attr("class"," "+k+(e.classes?" "+e.classes:"")+(O?" "+O:"")).attr("style",_?_.reduce((P,G)=>P+";"+G,""):"");let B=A.attr("d");A.attr("d",B),t.node().appendChild(A.node())}else{const I=p.join(";"),$=_?_.reduce((W,ie)=>W+ie+";",""):"",B=(I?I+";"+$+";":$)+";"+(_?_.reduce((W,ie)=>W+";"+ie,""):"");A=t.append("path").attr("d",C).attr("id",`${s}-${e.id}`).attr("class"," "+k+(e.classes?" "+e.classes:"")+(O?" "+O:"")).attr("style",B),L=(D=B.match(/stroke:([^;]+)/))==null?void 0:D[1],M=e.animate===!0||!!e.animation||I.includes("animation");const P=A.node(),G=typeof P.getTotalLength=="function"?P.getTotalLength():0,V=Sq[e.arrowTypeStart]||0,Y=Sq[e.arrowTypeEnd]||0;if(e.look==="neo"&&!M){const ie=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?q6e(G,V,Y):`0 ${V} ${G-V-Y} ${Y}`}; stroke-dashoffset: 0;`;A.attr("style",ie+A.attr("style"))}}A.attr("data-edge",!0),A.attr("data-et","edge"),A.attr("data-id",e.id),A.attr("data-points",g),A.attr("data-look",Zi(e.look)),e.showPoints&&m.forEach(I=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",I.x).attr("cy",I.y)});let z="";(Pe().flowchart.arrowMarkerAbsolute||Pe().state.arrowMarkerAbsolute)&&(z=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,z=z.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),ae.info("arrowTypeStart",e.arrowTypeStart),ae.info("arrowTypeEnd",e.arrowTypeEnd);const F=!M&&(e==null?void 0:e.look)==="neo";N6e(A,e,z,s,n,F,L);const S=Math.floor(u.length/2),R=u[S];Lr.isLabelCoordinateInPath(R,A.attr("d"))||(h=!0);let N={};return h&&(N.updatedPath=u),N.originalPath=e.points,N},"insertEdge");function QU(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let a=0;a({...i}));if(t.length>=2&&La[e.arrowTypeStart]){const i=La[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=j_(a,s),l=i*Math.cos(o),u=i*Math.sin(o);r[0].x=a.x+l,r[0].y=a.y+u}const n=t.length;if(n>=2&&La[e.arrowTypeEnd]){const i=La[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=j_(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}x(JU,"applyMarkerOffsetsToPoints");var V6e=x((t,e,r,n)=>{e.forEach(i=>{dAe[i](t,r,n)})},"insertMarkers"),W6e=x((t,e,r)=>{ae.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),t.append("marker").attr("id",r+"_"+e+"-extensionStart-margin").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd-margin").attr("class","marker extension "+e).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),U6e=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart-margin").attr("class","marker composition "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd-margin").attr("class","marker composition "+e).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),H6e=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart-margin").attr("class","marker aggregation "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd-margin").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Y6e=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart-margin").attr("class","marker dependency "+e).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd-margin").attr("class","marker dependency "+e).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),X6e=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart-margin").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd-margin").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),K6e=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),j6e=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),Z6e=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossEnd-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),t.append("marker").attr("id",r+"_"+e+"-crossStart-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),Q6e=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),J6e=x((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{transitionColor:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),eAe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),tAe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),rAe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),nAe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),iAe=x((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),aAe=x((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");o.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),o.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),sAe=x((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),oAe=x((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");o.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),o.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),lAe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 + node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{ae.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(ae.info("abc88 checking point",a,e),!U6e(e,a)&&!i){const s=H6e(e,n,a);ae.debug("abc88 inside",a,n,s),ae.debug("abc88 intersection",s,e);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?ae.warn("abc88 no intersect",s,r):r.push(s),i=!0}else ae.warn("abc88 outside",a,n),n=a,i||r.push(a)}),ae.debug("returning points",r),r},"cutPathAtIntersect");function eH(t){const e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}T(eH,"extractCornerPoints");var tH=T(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),Y6e=T(function(t){const{cornerPointPositions:e}=eH(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){ae.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const p=5;s.x===o.x?f={x:u<0?o.x-p+d:o.x+p-d,y:h<0?o.y-d:o.y+d}:f={x:u<0?o.x-d:o.x+d,y:h<0?o.y-p+d:o.y+p-d}}else ae.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),X6e=T((t,e,r)=>{const n=t-e-r,i=2,a=2,s=i+a,o=Math.floor(n/s),l=Array(o).fill(`${i} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),rH=T(function(t,e,r,n,i,a,s,o=!1){var D;if(!s)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l}=Pe();let u=e.points,h=!1;const d=i;var f=a;const p=[];for(const I in e.cssCompiledStyles)v_(I)||p.push(e.cssCompiledStyles[I]);ae.debug("UIO intersect check",e.points,f.x,d.x),f.intersect&&d.intersect&&!o&&(u=u.slice(1,e.points.length-1),u.unshift(d.intersect(u[0])),ae.debug("Last point UIO",e.start,"-->",e.end,u[u.length-1],f,f.intersect(u[u.length-1])),u.push(f.intersect(u[u.length-1])));const g=btoa(JSON.stringify(u));e.toCluster&&(ae.info("to cluster abc88",r.get(e.toCluster)),u=JU(e.points,r.get(e.toCluster).node),h=!0),e.fromCluster&&(ae.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(u,null,2)),u=JU(u.reverse(),r.get(e.fromCluster).node).reverse(),h=!0);let m=u.filter(I=>!Number.isNaN(I.y));const y=V6e(e.curve);y!=="rounded"&&(m=Y6e(m));let v=M2;switch(y){case"linear":v=M2;break;case"basis":v=O2;break;case"cardinal":v=Rz;break;case"bumpX":v=kz;break;case"bumpY":v=Ez;break;case"catmullRom":v=Iz;break;case"monotoneX":v=zz;break;case"monotoneY":v=Gz;break;case"natural":v=Wz;break;case"step":v=Uz;break;case"stepAfter":v=Yz;break;case"stepBefore":v=Hz;break;case"rounded":v=M2;break;default:v=O2}const{x,y:b}=Dq(e),w=N2().x(x).y(b).curve(v);let k;switch(e.thickness){case"normal":k="edge-thickness-normal";break;case"thick":k="edge-thickness-thick";break;case"invisible":k="edge-thickness-invisible";break;default:k="edge-thickness-normal"}switch(e.pattern){case"solid":k+=" edge-pattern-solid";break;case"dotted":k+=" edge-pattern-dotted";break;case"dashed":k+=" edge-pattern-dashed";break;default:k+=" edge-pattern-solid"}let S,C=y==="rounded"?nH(iH(m,e),5):w(m);const _=Array.isArray(e.style)?e.style:[e.style];let L=_.find(I=>I==null?void 0:I.startsWith("stroke:")),O="";e.animate&&(O="edge-animation-fast"),e.animation&&(O="edge-animation-"+e.animation);let M=!1;if(e.look==="handDrawn"){const I=Kt.svg(t);Object.assign([],m);const $=I.path(C,{roughness:.3,seed:l});k+=" transition",S=pt($).select("path").attr("id",`${s}-${e.id}`).attr("class"," "+k+(e.classes?" "+e.classes:"")+(O?" "+O:"")).attr("style",_?_.reduce((P,G)=>P+";"+G,""):"");let B=S.attr("d");S.attr("d",B),t.node().appendChild(S.node())}else{const I=p.join(";"),$=_?_.reduce((W,ie)=>W+ie+";",""):"",B=(I?I+";"+$+";":$)+";"+(_?_.reduce((W,ie)=>W+";"+ie,""):"");S=t.append("path").attr("d",C).attr("id",`${s}-${e.id}`).attr("class"," "+k+(e.classes?" "+e.classes:"")+(O?" "+O:"")).attr("style",B),L=(D=B.match(/stroke:([^;]+)/))==null?void 0:D[1],M=e.animate===!0||!!e.animation||I.includes("animation");const P=S.node(),G=typeof P.getTotalLength=="function"?P.getTotalLength():0,V=Iq[e.arrowTypeStart]||0,X=Iq[e.arrowTypeEnd]||0;if(e.look==="neo"&&!M){const ie=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?X6e(G,V,X):`0 ${V} ${G-V-X} ${X}`}; stroke-dashoffset: 0;`;S.attr("style",ie+S.attr("style"))}}S.attr("data-edge",!0),S.attr("data-et","edge"),S.attr("data-id",e.id),S.attr("data-points",g),S.attr("data-look",Zi(e.look)),e.showPoints&&m.forEach(I=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",I.x).attr("cy",I.y)});let z="";(Pe().flowchart.arrowMarkerAbsolute||Pe().state.arrowMarkerAbsolute)&&(z=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,z=z.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),ae.info("arrowTypeStart",e.arrowTypeStart),ae.info("arrowTypeEnd",e.arrowTypeEnd);const F=!M&&(e==null?void 0:e.look)==="neo";z6e(S,e,z,s,n,F,L);const A=Math.floor(u.length/2),R=u[A];Lr.isLabelCoordinateInPath(R,S.attr("d"))||(h=!0);let N={};return h&&(N.updatedPath=u),N.originalPath=e.points,N},"insertEdge");function nH(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let a=0;a({...i}));if(t.length>=2&&La[e.arrowTypeStart]){const i=La[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=J_(a,s),l=i*Math.cos(o),u=i*Math.sin(o);r[0].x=a.x+l,r[0].y=a.y+u}const n=t.length;if(n>=2&&La[e.arrowTypeEnd]){const i=La[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=J_(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}T(iH,"applyMarkerOffsetsToPoints");var K6e=T((t,e,r,n)=>{e.forEach(i=>{vAe[i](t,r,n)})},"insertMarkers"),j6e=T((t,e,r)=>{ae.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),t.append("marker").attr("id",r+"_"+e+"-extensionStart-margin").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd-margin").attr("class","marker extension "+e).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),Z6e=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart-margin").attr("class","marker composition "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd-margin").attr("class","marker composition "+e).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Q6e=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart-margin").attr("class","marker aggregation "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd-margin").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),J6e=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart-margin").attr("class","marker dependency "+e).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd-margin").attr("class","marker dependency "+e).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),eAe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart-margin").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd-margin").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),tAe=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),rAe=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),nAe=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossEnd-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),t.append("marker").attr("id",r+"_"+e+"-crossStart-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),iAe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),aAe=T((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{transitionColor:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),sAe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),oAe=T((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),lAe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),cAe=T((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),uAe=T((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),hAe=T((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");o.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),o.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),dAe=T((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),fAe=T((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");o.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),o.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),pAe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 L20,10 M20,10 - L0,20`)},"requirement_arrow"),cAe=x((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 + L0,20`)},"requirement_arrow"),gAe=T((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 L20,10 M20,10 - L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),uAe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),hAe=x((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a}=i,s=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),dAe={extension:W6e,composition:U6e,aggregation:H6e,dependency:Y6e,lollipop:X6e,point:K6e,circle:j6e,cross:Z6e,barb:Q6e,barbNeo:J6e,only_one:eAe,zero_or_one:tAe,one_or_more:rAe,zero_or_more:nAe,only_one_neo:iAe,zero_or_one_neo:aAe,one_or_more_neo:sAe,zero_or_more_neo:oAe,requirement_arrow:lAe,requirement_contains:uAe,requirement_arrow_neo:cAe,requirement_contains_neo:hAe},eH=V6e,fAe={common:Lt,getConfig:lr,insertCluster:V_,insertEdge:ZU,insertEdgeLabel:HU,insertMarkers:eH,insertNode:nC,interpolateToCurve:c_,labelHelper:xr,log:ae,positionEdgeLabel:YU},ab={},tH=x(t=>{for(const e of t)ab[e.name]=e},"registerLayoutLoaders"),pAe=x(()=>{tH([{name:"dagre",loader:x(async()=>await Promise.resolve().then(()=>sPe),"loader")},{name:"cose-bilkent",loader:x(async()=>await Promise.resolve().then(()=>jVe),"loader")}])},"registerDefaultLayoutLoaders");pAe();var Z0=x(async(t,e)=>{if(!(t.layoutAlgorithm in ab))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const h of t.nodes){const d=h.domId||h.id;h.domId=`${t.diagramId}-${d}`}const r=ab[t.layoutAlgorithm],n=await r.loader(),{theme:i,themeVariables:a}=t.config,{useGradient:s,gradientStart:o,gradientStop:l}=a,u=e.attr("id");if(e.append("defs").append("filter").attr("id",`${u}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i!=null&&i.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${u}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i!=null&&i.includes("dark")?"#FFFFFF":"#000000"}`),s){const h=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",o).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",l).attr("stop-opacity",1)}return n.render(t,e,fAe,{algorithm:r.algorithm})},"render"),sb=x((t="",{fallback:e="dagre"}={})=>{if(t in ab)return t;if(e in ab)return ae.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),Z_="comm",rH="rule",nH="decl",gAe="@media",mAe="@import",yAe="@supports",vAe="@namespace",Q_="@keyframes",iH="@layer",bAe="@scope",xAe=Math.abs,ob=String.fromCharCode;function aH(t){return t.trim()}function J_(t,e,r){return t.replace(e,r)}function Q0(t,e){return t.charCodeAt(e)|0}function J0(t,e,r){return t.slice(e,r)}function xl(t){return t.length}function sH(t){return t.length}function aC(t,e){return e.push(t),t}var sC=1,ep=1,oH=0,so=0,Ci=0,tp="";function e7(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:sC,column:ep,length:s,return:"",siblings:o}}function TAe(){return Ci}function wAe(){return Ci=so>0?Q0(tp,--so):0,ep--,Ci===10&&(ep=1,sC--),Ci}function Oo(){return Ci=so2||lb(Ci)>3?"":" "}function SAe(t,e){for(;--e&&Oo()&&!(Ci<48||Ci>102||Ci>57&&Ci<65||Ci>70&&Ci<97););return lC(t,oC()+(e<6&&Ou()==32&&Oo()==32))}function r7(t){for(;Oo();)switch(Ci){case t:return so;case 34:case 39:t!==34&&t!==39&&r7(Ci);break;case 40:t===41&&r7(t);break;case 92:Oo();break}return so}function AAe(t,e){for(;Oo()&&t+Ci!==57;)if(t+Ci===84&&Ou()===47)break;return"/*"+lC(e,so-1)+"*"+ob(t===47?t:Oo())}function _Ae(t){for(;!lb(Ou());)Oo();return lC(t,so)}function RAe(t){return kAe(cC("",null,null,null,[""],t=CAe(t),0,[0],t))}function cC(t,e,r,n,i,a,s,o,l){for(var u=0,h=0,d=s,f=0,p=0,g=0,m=1,y=1,v=1,T=0,b=0,w="",k=i,A=a,C=n,_=w;y;)switch(g=b,b=Oo()){case 40:g!=108&&Q0(_,d-1)==58?(T++,_+="("):_+=t7(b);break;case 41:T--,_+=")";break;case 34:case 39:case 91:_+=t7(b);break;case 9:case 10:case 13:case 32:if(T>0){_+=ob(b);break}_+=EAe(g);break;case 92:_+=SAe(oC()-1,7);continue;case 47:switch(Ou()){case 42:case 47:aC(LAe(AAe(Oo(),oC()),e,r,l),l),(lb(g||1)==5||lb(Ou()||1)==5)&&xl(_)&&J0(_,-1,void 0)!==" "&&(_+=" ");break;default:_+="/"}break;case 123*m:o[u++]=xl(_)*v;case 125*m:case 59:case 0:if(T>0&&b){_+=ob(b);break}switch(b){case 0:case 125:y=0;case 59+h:v==-1&&(_=J_(_,/\f/g,"")),p>0&&(xl(_)-d||m===0)&&aC(p>32?cH(_+";",n,r,d-1,l):cH(J_(_," ","")+";",n,r,d-2,l),l);break;case 59:_+=";";default:if(aC(C=lH(_,e,r,u,h,i,o,w,k=[],A=[],d,a),a),b===123)if(h===0)cC(_,e,C,C,k,a,d,o,A);else{switch(f){case 99:if(Q0(_,3)===110)break;case 108:if(Q0(_,2)===97)break;default:h=0;case 100:case 109:case 115:}h?cC(t,C,C,n&&aC(lH(t,C,C,0,0,i,o,w,i,k=[],d,A),A),i,A,d,o,n?k:A):cC(_,C,C,C,[""],A,0,o,A)}}u=h=p=0,m=v=1,w=_="",d=s;break;case 58:d=1+xl(_),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&wAe()==125)continue}switch(_+=ob(b),b*m){case 38:v=h>0?1:(_+="\f",-1);break;case 44:if(T>0)break;o[u++]=(xl(_)-1)*v,v=1;break;case 64:Ou()===45&&(_+=t7(Oo())),f=Ou(),h=d=xl(w=_+=_Ae(oC())),b++;break;case 45:g===45&&xl(_)==2&&(m=0)}}return a}function lH(t,e,r,n,i,a,s,o,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=sH(p),m=0,y=0,v=0;m0?p[T]+" "+b:J_(b,/&\f/g,p[T])))&&(l[v++]=w);return e7(t,e,r,i===0?rH:o,l,u,h,d)}function LAe(t,e,r,n){return e7(t,e,r,Z_,ob(TAe()),J0(t,2,-2),0,n)}function cH(t,e,r,n,i){return e7(t,e,r,nH,J0(t,0,n),J0(t,n+1,-1),n,i)}function n7(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),NAe=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>UWe);return{id:uH,diagram:t}},"loader"),OAe={id:uH,detector:MAe,loader:NAe},$Ae=OAe,hH="flowchart",PAe=x((t,e)=>{var r,n;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),BAe=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>xI);return{id:hH,diagram:t}},"loader"),FAe={id:hH,detector:PAe,loader:BAe},zAe=FAe,dH="flowchart-v2",GAe=x((t,e)=>{var r,n,i;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),qAe=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>xI);return{id:dH,diagram:t}},"loader"),VAe={id:dH,detector:GAe,loader:qAe},WAe=VAe,fH="er",UAe=x(t=>/^\s*erDiagram/.test(t),"detector"),HAe=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>hUe);return{id:fH,diagram:t}},"loader"),YAe={id:fH,detector:UAe,loader:HAe},XAe=YAe,pH="gitGraph",KAe=x(t=>/^\s*gitGraph/.test(t),"detector"),jAe=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>yst);return{id:pH,diagram:t}},"loader"),ZAe={id:pH,detector:KAe,loader:jAe},QAe=ZAe,gH="gantt",JAe=x(t=>/^\s*gantt/.test(t),"detector"),e_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Eot);return{id:gH,diagram:t}},"loader"),t_e={id:gH,detector:JAe,loader:e_e},r_e=t_e,mH="info",n_e=x(t=>/^\s*info/.test(t),"detector"),i_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Mot);return{id:mH,diagram:t}},"loader"),a_e={id:mH,detector:n_e,loader:i_e},yH="pie",s_e=x(t=>/^\s*pie/.test(t),"detector"),o_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>jot);return{id:yH,diagram:t}},"loader"),l_e={id:yH,detector:s_e,loader:o_e},vH="quadrantChart",c_e=x(t=>/^\s*quadrantChart/.test(t),"detector"),u_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>alt);return{id:vH,diagram:t}},"loader"),h_e={id:vH,detector:c_e,loader:u_e},d_e=h_e,bH="xychart",f_e=x(t=>/^\s*xychart(-beta)?/.test(t),"detector"),p_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>xlt);return{id:bH,diagram:t}},"loader"),g_e={id:bH,detector:f_e,loader:p_e},m_e=g_e,xH="requirement",y_e=x(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),v_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>_lt);return{id:xH,diagram:t}},"loader"),b_e={id:xH,detector:y_e,loader:v_e},x_e=b_e,TH="sequence",T_e=x(t=>/^\s*sequenceDiagram/.test(t),"detector"),w_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Cct);return{id:TH,diagram:t}},"loader"),C_e={id:TH,detector:T_e,loader:w_e},k_e=C_e,wH="class",E_e=x((t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),S_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Rct);return{id:wH,diagram:t}},"loader"),A_e={id:wH,detector:E_e,loader:S_e},__e=A_e,CH="classDiagram",R_e=x((t,e)=>{var r;return/^\s*classDiagram/.test(t)&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),L_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Ict);return{id:CH,diagram:t}},"loader"),I_e={id:CH,detector:R_e,loader:L_e},D_e=I_e,kH="state",M_e=x((t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),N_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>xut);return{id:kH,diagram:t}},"loader"),O_e={id:kH,detector:M_e,loader:N_e},$_e=O_e,EH="stateDiagram",P_e=x((t,e)=>{var r;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),B_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>wut);return{id:EH,diagram:t}},"loader"),F_e={id:EH,detector:P_e,loader:B_e},z_e=F_e,SH="journey",G_e=x(t=>/^\s*journey/.test(t),"detector"),q_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Wut);return{id:SH,diagram:t}},"loader"),V_e={id:SH,detector:G_e,loader:q_e},W_e=V_e,U_e=x((t,e,r)=>{ae.debug(`rendering svg for syntax error -`);const n=ys(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),wi(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),AH={draw:U_e},H_e=AH,Y_e={db:{},renderer:AH,parser:{parse:x(()=>{},"parse")}},X_e=Y_e,_H="flowchart-elk",K_e=x((t,e={})=>{var r;return/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),j_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>xI);return{id:_H,diagram:t}},"loader"),Z_e={id:_H,detector:K_e,loader:j_e},Q_e=Z_e,RH="timeline",J_e=x(t=>/^\s*timeline/.test(t),"detector"),e7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>bht);return{id:RH,diagram:t}},"loader"),t7e={id:RH,detector:J_e,loader:e7e},r7e=t7e,LH="mindmap",n7e=x(t=>/^\s*mindmap/.test(t),"detector"),i7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Oht);return{id:LH,diagram:t}},"loader"),a7e={id:LH,detector:n7e,loader:i7e},s7e=a7e,IH="kanban",o7e=x(t=>/^\s*kanban/.test(t),"detector"),l7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>tdt);return{id:IH,diagram:t}},"loader"),c7e={id:IH,detector:o7e,loader:l7e},u7e=c7e,DH="sankey",h7e=x(t=>/^\s*sankey(-beta)?/.test(t),"detector"),d7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>zdt);return{id:DH,diagram:t}},"loader"),f7e={id:DH,detector:h7e,loader:d7e},p7e=f7e,MH="packet",g7e=x(t=>/^\s*packet(-beta)?/.test(t),"detector"),m7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Zdt);return{id:MH,diagram:t}},"loader"),y7e={id:MH,detector:g7e,loader:m7e},NH="radar",v7e=x(t=>/^\s*radar-beta/.test(t),"detector"),b7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>vft);return{id:NH,diagram:t}},"loader"),x7e={id:NH,detector:v7e,loader:b7e},OH="block",T7e=x(t=>/^\s*block(-beta)?/.test(t),"detector"),w7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>H0t);return{id:OH,diagram:t}},"loader"),C7e={id:OH,detector:T7e,loader:w7e},k7e=C7e,$H="treeView",E7e=x(t=>/^\s*treeView-beta/.test(t),"detector"),S7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>hpt);return{id:$H,diagram:t}},"loader"),A7e={id:$H,detector:E7e,loader:S7e},_7e=A7e,PH="architecture",R7e=x(t=>/^\s*architecture/.test(t),"detector"),L7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Fpt);return{id:PH,diagram:t}},"loader"),I7e={id:PH,detector:R7e,loader:L7e},D7e=I7e,BH="eventmodeling",M7e=x(t=>/^\s*eventmodeling/.test(t),"detector"),N7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>tgt);return{id:BH,diagram:t}},"loader"),O7e={id:BH,detector:M7e,loader:N7e},$7e=O7e,FH="ishikawa",P7e=x(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),B7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>vgt);return{id:FH,diagram:t}},"loader"),F7e={id:FH,detector:P7e,loader:B7e},zH="venn",z7e=x(t=>/^\s*venn-beta/.test(t),"detector"),G7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>nmt);return{id:zH,diagram:t}},"loader"),q7e={id:zH,detector:z7e,loader:G7e},V7e=q7e,GH="treemap",W7e=x(t=>/^\s*treemap/.test(t),"detector"),U7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>pmt);return{id:GH,diagram:t}},"loader"),H7e={id:GH,detector:W7e,loader:U7e},qH="wardley-beta",Y7e=x(t=>/^\s*wardley-beta/i.test(t),"detector"),X7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Smt);return{id:qH,diagram:t}},"loader"),K7e={id:qH,detector:Y7e,loader:X7e},j7e=K7e,VH=!1,uC=x(()=>{VH||(VH=!0,Iw("error",X_e,t=>t.toLowerCase().trim()==="error"),Iw("---",{db:{clear:x(()=>{},"clear")},styles:{},renderer:{draw:x(()=>{},"draw")},parser:{parse:x(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:x(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),E6(Q_e,s7e,D7e),E6($Ae,u7e,D_e,__e,XAe,r_e,a_e,l_e,x_e,k_e,WAe,zAe,r7e,QAe,z_e,$_e,W_e,d_e,p7e,y7e,m_e,k7e,$7e,_7e,x7e,F7e,H7e,V7e,j7e))},"addDiagrams"),Z7e=x(async()=>{ae.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(Vh).map(async([r,{detector:n,loader:i}])=>{if(i)try{B6(r)}catch{try{const{diagram:a,id:s}=await i();Iw(s,a,n)}catch(a){throw ae.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Vh[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){ae.error(`Failed to load ${e.length} external diagrams`);for(const r of e)ae.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),Q7e="graphics-document document";function WH(t,e){t.attr("role",Q7e),e!==""&&t.attr("aria-roledescription",e)}x(WH,"setA11yDiagramInfo");function UH(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}x(UH,"addSVGa11yTitleDescription");var i7=(o0=class{constructor(e,r,n,i,a){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=a}static async fromText(e,r={}){var u,h;const n=lr(),i=k6(e,n);e=OEe(e)+` -`;try{B6(i)}catch{const d=Mbe(i);if(!d)throw new bB(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();Iw(f,p)}const{db:a,parser:s,renderer:o,init:l}=B6(i);return s.parser&&(s.parser.yy=a),(u=a.clear)==null||u.call(a),l==null||l(n),r.title&&((h=a.setDiagramTitle)==null||h.call(a,r.title)),await s.parse(e),new o0(i,e,a,s,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},x(o0,"Diagram"),o0),HH=[],J7e=x(()=>{HH.forEach(t=>{t()}),HH=[]},"attachFunctions"),e8e=x(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function YH(t){const e=t.match(vB);if(!e)return{text:t,metadata:{}};let r=_4(e[1],{schema:A4})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:t.slice(e[0].length),metadata:n}}x(YH,"extractFrontMatter");var t8e=x(t=>t.replace(/\r\n?/g,` -`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),r8e=x(t=>{const{text:e,metadata:r}=YH(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}},"processFrontmatter"),n8e=x(t=>{const e=Lr.detectInit(t)??{},r=Lr.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(e.wrap=!0),{text:EEe(t),directive:e}},"processDirectives");function a7(t){const e=t8e(t),r=r8e(e),n=n8e(r.text),i=ti(r.config,n.directive);return t=e8e(n.text),{code:t,title:r.title,config:i}}x(a7,"preprocessDiagram");function XH(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}x(XH,"toBase64");var i8e=5e4,a8e="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",s8e="sandbox",o8e="loose",l8e="http://www.w3.org/2000/svg",c8e="http://www.w3.org/1999/xlink",u8e="http://www.w3.org/1999/xhtml",h8e="100%",d8e="100%",f8e="border:0;margin:0;",p8e="margin:0",g8e="allow-top-navigation-by-user-activation allow-popups",m8e='The "iframe" tag is not supported by your browser.',y8e=["foreignobject"],v8e=["dominant-baseline"];function s7(t){const e=a7(t);return Sw(),axe(e.config??{}),e}x(s7,"processAndSetConfigs");async function KH(t,e){uC();try{const{code:r,config:n}=s7(t);return{diagramType:(await JH(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}x(KH,"parse");var jH=x((t,e,r=[])=>{const n=CB(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),b8e=x((t,e=new Map)=>{const r=new CSSStyleSheet;if(t.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),t.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){const o=on(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{Qq(l.styles)||o.forEach(u=>{r.insertRule(jH(l.id,u,l.styles),r.cssRules.length)}),Qq(l.textStyles)||r.insertRule(jH(l.id,"tspan",((l==null?void 0:l.textStyles)||[]).map(u=>u.replace("color","fill"))),r.cssRules.length)})}let n="";if(t.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const i=new CSSStyleSheet;i.replaceSync(t.themeCSS),n=R6(i)+` + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),mAe=T((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),yAe=T((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a}=i,s=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),vAe={extension:j6e,composition:Z6e,aggregation:Q6e,dependency:J6e,lollipop:eAe,point:tAe,circle:rAe,cross:nAe,barb:iAe,barbNeo:aAe,only_one:sAe,zero_or_one:oAe,one_or_more:lAe,zero_or_more:cAe,only_one_neo:uAe,zero_or_one_neo:hAe,one_or_more_neo:dAe,zero_or_more_neo:fAe,requirement_arrow:pAe,requirement_contains:mAe,requirement_arrow_neo:gAe,requirement_contains_neo:yAe},aH=K6e,bAe={common:Lt,getConfig:lr,insertCluster:H_,insertEdge:rH,insertEdgeLabel:ZU,insertMarkers:aH,insertNode:aC,interpolateToCurve:d_,labelHelper:xr,log:ae,positionEdgeLabel:QU},sb={},sH=T(t=>{for(const e of t)sb[e.name]=e},"registerLayoutLoaders"),xAe=T(()=>{sH([{name:"dagre",loader:T(async()=>await Promise.resolve().then(()=>bPe),"loader")},{name:"cose-bilkent",loader:T(async()=>await Promise.resolve().then(()=>cWe),"loader")}])},"registerDefaultLayoutLoaders");xAe();var Zp=T(async(t,e)=>{if(!(t.layoutAlgorithm in sb))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const h of t.nodes){const d=h.domId||h.id;h.domId=`${t.diagramId}-${d}`}const r=sb[t.layoutAlgorithm],n=await r.loader(),{theme:i,themeVariables:a}=t.config,{useGradient:s,gradientStart:o,gradientStop:l}=a,u=e.attr("id");if(e.append("defs").append("filter").attr("id",`${u}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i!=null&&i.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${u}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i!=null&&i.includes("dark")?"#FFFFFF":"#000000"}`),s){const h=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",o).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",l).attr("stop-opacity",1)}return n.render(t,e,bAe,{algorithm:r.algorithm})},"render"),ob=T((t="",{fallback:e="dagre"}={})=>{if(t in sb)return t;if(e in sb)return ae.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),e7="comm",oH="rule",lH="decl",TAe="@media",wAe="@import",CAe="@supports",kAe="@namespace",t7="@keyframes",cH="@layer",EAe="@scope",SAe=Math.abs,lb=String.fromCharCode;function uH(t){return t.trim()}function r7(t,e,r){return t.replace(e,r)}function Qp(t,e){return t.charCodeAt(e)|0}function Jp(t,e,r){return t.slice(e,r)}function xl(t){return t.length}function hH(t){return t.length}function oC(t,e){return e.push(t),t}var lC=1,e0=1,dH=0,so=0,Ci=0,t0="";function n7(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:lC,column:e0,length:s,return:"",siblings:o}}function AAe(){return Ci}function _Ae(){return Ci=so>0?Qp(t0,--so):0,e0--,Ci===10&&(e0=1,lC--),Ci}function Oo(){return Ci=so2||cb(Ci)>3?"":" "}function DAe(t,e){for(;--e&&Oo()&&!(Ci<48||Ci>102||Ci>57&&Ci<65||Ci>70&&Ci<97););return uC(t,cC()+(e<6&&Ou()==32&&Oo()==32))}function a7(t){for(;Oo();)switch(Ci){case t:return so;case 34:case 39:t!==34&&t!==39&&a7(Ci);break;case 40:t===41&&a7(t);break;case 92:Oo();break}return so}function MAe(t,e){for(;Oo()&&t+Ci!==57;)if(t+Ci===84&&Ou()===47)break;return"/*"+uC(e,so-1)+"*"+lb(t===47?t:Oo())}function NAe(t){for(;!cb(Ou());)Oo();return uC(t,so)}function OAe(t){return LAe(hC("",null,null,null,[""],t=RAe(t),0,[0],t))}function hC(t,e,r,n,i,a,s,o,l){for(var u=0,h=0,d=s,f=0,p=0,g=0,m=1,y=1,v=1,x=0,b=0,w="",k=i,S=a,C=n,_=w;y;)switch(g=b,b=Oo()){case 40:g!=108&&Qp(_,d-1)==58?(x++,_+="("):_+=i7(b);break;case 41:x--,_+=")";break;case 34:case 39:case 91:_+=i7(b);break;case 9:case 10:case 13:case 32:if(x>0){_+=lb(b);break}_+=IAe(g);break;case 92:_+=DAe(cC()-1,7);continue;case 47:switch(Ou()){case 42:case 47:oC($Ae(MAe(Oo(),cC()),e,r,l),l),(cb(g||1)==5||cb(Ou()||1)==5)&&xl(_)&&Jp(_,-1,void 0)!==" "&&(_+=" ");break;default:_+="/"}break;case 123*m:o[u++]=xl(_)*v;case 125*m:case 59:case 0:if(x>0&&b){_+=lb(b);break}switch(b){case 0:case 125:y=0;case 59+h:v==-1&&(_=r7(_,/\f/g,"")),p>0&&(xl(_)-d||m===0)&&oC(p>32?pH(_+";",n,r,d-1,l):pH(r7(_," ","")+";",n,r,d-2,l),l);break;case 59:_+=";";default:if(oC(C=fH(_,e,r,u,h,i,o,w,k=[],S=[],d,a),a),b===123)if(h===0)hC(_,e,C,C,k,a,d,o,S);else{switch(f){case 99:if(Qp(_,3)===110)break;case 108:if(Qp(_,2)===97)break;default:h=0;case 100:case 109:case 115:}h?hC(t,C,C,n&&oC(fH(t,C,C,0,0,i,o,w,i,k=[],d,S),S),i,S,d,o,n?k:S):hC(_,C,C,C,[""],S,0,o,S)}}u=h=p=0,m=v=1,w=_="",d=s;break;case 58:d=1+xl(_),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&_Ae()==125)continue}switch(_+=lb(b),b*m){case 38:v=h>0?1:(_+="\f",-1);break;case 44:if(x>0)break;o[u++]=(xl(_)-1)*v,v=1;break;case 64:Ou()===45&&(_+=i7(Oo())),f=Ou(),h=d=xl(w=_+=NAe(cC())),b++;break;case 45:g===45&&xl(_)==2&&(m=0)}}return a}function fH(t,e,r,n,i,a,s,o,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=hH(p),m=0,y=0,v=0;m0?p[x]+" "+b:r7(b,/&\f/g,p[x])))&&(l[v++]=w);return n7(t,e,r,i===0?oH:o,l,u,h,d)}function $Ae(t,e,r,n){return n7(t,e,r,e7,lb(AAe()),Jp(t,2,-2),0,n)}function pH(t,e,r,n,i){return n7(t,e,r,lH,Jp(t,0,n),Jp(t,n+1,-1),n,i)}function s7(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),zAe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>iUe);return{id:gH,diagram:t}},"loader"),GAe={id:gH,detector:FAe,loader:zAe},qAe=GAe,mH="flowchart",VAe=T((t,e)=>{var r,n;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),WAe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>EI);return{id:mH,diagram:t}},"loader"),UAe={id:mH,detector:VAe,loader:WAe},HAe=UAe,yH="flowchart-v2",YAe=T((t,e)=>{var r,n,i;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),XAe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>EI);return{id:yH,diagram:t}},"loader"),KAe={id:yH,detector:YAe,loader:XAe},jAe=KAe,vH="er",ZAe=T(t=>/^\s*erDiagram/.test(t),"detector"),QAe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>kUe);return{id:vH,diagram:t}},"loader"),JAe={id:vH,detector:ZAe,loader:QAe},e_e=JAe,bH="gitGraph",t_e=T(t=>/^\s*gitGraph/.test(t),"detector"),r_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Lst);return{id:bH,diagram:t}},"loader"),n_e={id:bH,detector:t_e,loader:r_e},i_e=n_e,xH="gantt",a_e=T(t=>/^\s*gantt/.test(t),"detector"),s_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Bot);return{id:xH,diagram:t}},"loader"),o_e={id:xH,detector:a_e,loader:s_e},l_e=o_e,TH="info",c_e=T(t=>/^\s*info/.test(t),"detector"),u_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Hot);return{id:TH,diagram:t}},"loader"),h_e={id:TH,detector:c_e,loader:u_e},wH="pie",d_e=T(t=>/^\s*pie/.test(t),"detector"),f_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>clt);return{id:wH,diagram:t}},"loader"),p_e={id:wH,detector:d_e,loader:f_e},CH="quadrantChart",g_e=T(t=>/^\s*quadrantChart/.test(t),"detector"),m_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>vlt);return{id:CH,diagram:t}},"loader"),y_e={id:CH,detector:g_e,loader:m_e},v_e=y_e,kH="xychart",b_e=T(t=>/^\s*xychart(-beta)?/.test(t),"detector"),x_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Mlt);return{id:kH,diagram:t}},"loader"),T_e={id:kH,detector:b_e,loader:x_e},w_e=T_e,EH="requirement",C_e=T(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),k_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Glt);return{id:EH,diagram:t}},"loader"),E_e={id:EH,detector:C_e,loader:k_e},S_e=E_e,SH="sequence",A_e=T(t=>/^\s*sequenceDiagram/.test(t),"detector"),__e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>$ct);return{id:SH,diagram:t}},"loader"),R_e={id:SH,detector:A_e,loader:__e},L_e=R_e,AH="class",I_e=T((t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),D_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>qct);return{id:AH,diagram:t}},"loader"),M_e={id:AH,detector:I_e,loader:D_e},N_e=M_e,_H="classDiagram",O_e=T((t,e)=>{var r;return/^\s*classDiagram/.test(t)&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),$_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Wct);return{id:_H,diagram:t}},"loader"),P_e={id:_H,detector:O_e,loader:$_e},B_e=P_e,RH="state",F_e=T((t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),z_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Mut);return{id:RH,diagram:t}},"loader"),G_e={id:RH,detector:F_e,loader:z_e},q_e=G_e,LH="stateDiagram",V_e=T((t,e)=>{var r;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),W_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Out);return{id:LH,diagram:t}},"loader"),U_e={id:LH,detector:V_e,loader:W_e},H_e=U_e,IH="journey",Y_e=T(t=>/^\s*journey/.test(t),"detector"),X_e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>nht);return{id:IH,diagram:t}},"loader"),K_e={id:IH,detector:Y_e,loader:X_e},j_e=K_e,Z_e=T((t,e,r)=>{ae.debug(`rendering svg for syntax error +`);const n=ys(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),wi(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),DH={draw:Z_e},Q_e=DH,J_e={db:{},renderer:DH,parser:{parse:T(()=>{},"parse")}},e7e=J_e,MH="flowchart-elk",t7e=T((t,e={})=>{var r;return/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),r7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>EI);return{id:MH,diagram:t}},"loader"),n7e={id:MH,detector:t7e,loader:r7e},i7e=n7e,NH="timeline",a7e=T(t=>/^\s*timeline/.test(t),"detector"),s7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Dht);return{id:NH,diagram:t}},"loader"),o7e={id:NH,detector:a7e,loader:s7e},l7e=o7e,OH="mindmap",c7e=T(t=>/^\s*mindmap/.test(t),"detector"),u7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Xht);return{id:OH,diagram:t}},"loader"),h7e={id:OH,detector:c7e,loader:u7e},d7e=h7e,$H="kanban",f7e=T(t=>/^\s*kanban/.test(t),"detector"),p7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>pdt);return{id:$H,diagram:t}},"loader"),g7e={id:$H,detector:f7e,loader:p7e},m7e=g7e,PH="sankey",y7e=T(t=>/^\s*sankey(-beta)?/.test(t),"detector"),v7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Jdt);return{id:PH,diagram:t}},"loader"),b7e={id:PH,detector:y7e,loader:v7e},x7e=b7e,BH="packet",T7e=T(t=>/^\s*packet(-beta)?/.test(t),"detector"),w7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>uft);return{id:BH,diagram:t}},"loader"),C7e={id:BH,detector:T7e,loader:w7e},FH="radar",k7e=T(t=>/^\s*radar-beta/.test(t),"detector"),E7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Ift);return{id:FH,diagram:t}},"loader"),S7e={id:FH,detector:k7e,loader:E7e},zH="block",A7e=T(t=>/^\s*block(-beta)?/.test(t),"detector"),_7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>a0t);return{id:zH,diagram:t}},"loader"),R7e={id:zH,detector:A7e,loader:_7e},L7e=R7e,GH="treeView",I7e=T(t=>/^\s*treeView-beta/.test(t),"detector"),D7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>k0t);return{id:GH,diagram:t}},"loader"),M7e={id:GH,detector:I7e,loader:D7e},N7e=M7e,qH="architecture",O7e=T(t=>/^\s*architecture/.test(t),"detector"),$7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Q0t);return{id:qH,diagram:t}},"loader"),P7e={id:qH,detector:O7e,loader:$7e},B7e=P7e,VH="eventmodeling",F7e=T(t=>/^\s*eventmodeling/.test(t),"detector"),z7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>pgt);return{id:VH,diagram:t}},"loader"),G7e={id:VH,detector:F7e,loader:z7e},q7e=G7e,WH="ishikawa",V7e=T(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),W7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Igt);return{id:WH,diagram:t}},"loader"),U7e={id:WH,detector:V7e,loader:W7e},UH="venn",H7e=T(t=>/^\s*venn-beta/.test(t),"detector"),Y7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>mmt);return{id:UH,diagram:t}},"loader"),X7e={id:UH,detector:H7e,loader:Y7e},K7e=X7e,HH="treemap",j7e=T(t=>/^\s*treemap/.test(t),"detector"),Z7e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Amt);return{id:HH,diagram:t}},"loader"),Q7e={id:HH,detector:j7e,loader:Z7e},YH="wardley-beta",J7e=T(t=>/^\s*wardley-beta/i.test(t),"detector"),e8e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Fmt);return{id:YH,diagram:t}},"loader"),t8e={id:YH,detector:J7e,loader:e8e},r8e=t8e,XH=!1,dC=T(()=>{XH||(XH=!0,Mw("error",e7e,t=>t.toLowerCase().trim()==="error"),Mw("---",{db:{clear:T(()=>{},"clear")},styles:{},renderer:{draw:T(()=>{},"draw")},parser:{parse:T(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:T(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),_6(i7e,d7e,B7e),_6(qAe,m7e,B_e,N_e,e_e,l_e,h_e,p_e,S_e,L_e,jAe,HAe,l7e,i_e,H_e,q_e,j_e,v_e,x7e,C7e,w_e,L7e,q7e,N7e,S7e,U7e,Q7e,K7e,r8e))},"addDiagrams"),n8e=T(async()=>{ae.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(Vh).map(async([r,{detector:n,loader:i}])=>{if(i)try{G6(r)}catch{try{const{diagram:a,id:s}=await i();Mw(s,a,n)}catch(a){throw ae.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Vh[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){ae.error(`Failed to load ${e.length} external diagrams`);for(const r of e)ae.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),i8e="graphics-document document";function KH(t,e){t.attr("role",i8e),e!==""&&t.attr("aria-roledescription",e)}T(KH,"setA11yDiagramInfo");function jH(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}T(jH,"addSVGa11yTitleDescription");var o7=(op=class{constructor(e,r,n,i,a){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=a}static async fromText(e,r={}){var u,h;const n=lr(),i=A6(e,n);e=GEe(e)+` +`;try{G6(i)}catch{const d=Fbe(i);if(!d)throw new kB(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();Mw(f,p)}const{db:a,parser:s,renderer:o,init:l}=G6(i);return s.parser&&(s.parser.yy=a),(u=a.clear)==null||u.call(a),l==null||l(n),r.title&&((h=a.setDiagramTitle)==null||h.call(a,r.title)),await s.parse(e),new op(i,e,a,s,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},T(op,"Diagram"),op),ZH=[],a8e=T(()=>{ZH.forEach(t=>{t()}),ZH=[]},"attachFunctions"),s8e=T(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function QH(t){const e=t.match(CB);if(!e)return{text:t,metadata:{}};let r=L4(e[1],{schema:R4})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:t.slice(e[0].length),metadata:n}}T(QH,"extractFrontMatter");var o8e=T(t=>t.replace(/\r\n?/g,` +`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),l8e=T(t=>{const{text:e,metadata:r}=QH(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}},"processFrontmatter"),c8e=T(t=>{const e=Lr.detectInit(t)??{},r=Lr.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(e.wrap=!0),{text:IEe(t),directive:e}},"processDirectives");function l7(t){const e=o8e(t),r=l8e(e),n=c8e(r.text),i=ti(r.config,n.directive);return t=s8e(n.text),{code:t,title:r.title,config:i}}T(l7,"preprocessDiagram");function JH(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}T(JH,"toBase64");var u8e=5e4,h8e="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",d8e="sandbox",f8e="loose",p8e="http://www.w3.org/2000/svg",g8e="http://www.w3.org/1999/xlink",m8e="http://www.w3.org/1999/xhtml",y8e="100%",v8e="100%",b8e="border:0;margin:0;",x8e="margin:0",T8e="allow-top-navigation-by-user-activation allow-popups",w8e='The "iframe" tag is not supported by your browser.',C8e=["foreignobject"],k8e=["dominant-baseline"];function c7(t){const e=l7(t);return _w(),hxe(e.config??{}),e}T(c7,"processAndSetConfigs");async function eY(t,e){dC();try{const{code:r,config:n}=c7(t);return{diagramType:(await iY(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}T(eY,"parse");var tY=T((t,e,r=[])=>{const n=_B(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),E8e=T((t,e=new Map)=>{const r=new CSSStyleSheet;if(t.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),t.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){const o=on(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{nV(l.styles)||o.forEach(u=>{r.insertRule(tY(l.id,u,l.styles),r.cssRules.length)}),nV(l.textStyles)||r.insertRule(tY(l.id,"tspan",((l==null?void 0:l.textStyles)||[]).map(u=>u.replace("color","fill"))),r.cssRules.length)})}let n="";if(t.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const i=new CSSStyleSheet;i.replaceSync(t.themeCSS),n=D6(i)+` `}else n+=`${t.themeCSS} -`;return n+R6(r)},"createCssStyles"),x8e=x((t,e)=>n7(RAe(`${t}{${e}}`),DAe([x(function(n,i,a,s){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===Q_)return;n.props=n.props.map(o=>o.startsWith(t)?o:`${t} ${o}`)}else n.type.startsWith("@")&&([...[gAe,yAe,iH,bAe,"@container","@starting-style"],Q_].includes(n.type)||(ae.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=Z_))},"addNamespace"),IAe])),"compileCSS"),T8e=x((t,e,r,n)=>{const i=b8e(t,r),a=Cxe(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return x8e(n,a)},"createUserStyles"),w8e=x((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=Tc(n),n=n.replace(/
/g,"
"),n},"cleanUpSvgCode"),C8e=x((t="",e)=>{var i,a;const r=(a=(i=e==null?void 0:e.viewBox)==null?void 0:i.baseVal)!=null&&a.height?e.viewBox.baseVal.height+"px":d8e,n=XH(`${t}`);return``},"putIntoIFrame"),ZH=x((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",l8e);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function o7(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}x(o7,"sandboxedIframe");var k8e=x((t,e,r,n)=>{var i,a,s;(i=t.getElementById(e))==null||i.remove(),(a=t.getElementById(r))==null||a.remove(),(s=t.getElementById(n))==null||s.remove()},"removeExistingElements"),E8e=x(async function(t,e,r){var z,F,S,R,N,D;uC();const n=s7(e);e=n.code;const i=lr();ae.debug(i),e.length>((i==null?void 0:i.maxTextSize)??i8e)&&(e=a8e);const a=`#${t}`,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=x(()=>{const $=pt(f?o:u).node();$&&"remove"in $&&$.remove()},"removeTempElements");let d=pt(document.body);const f=i.securityLevel===s8e,p=i.securityLevel===o8e,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const I=o7(pt(r),s);d=pt(I.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=pt(r);ZH(d,t,l,`font-family: ${g}`,c8e)}else{if(k8e(document,t,l,s),f){const I=o7(pt(document.body),s);d=pt(I.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=pt("body");ZH(d,t,l)}let m,y;try{m=await i7.fromText(e,{title:n.title})}catch(I){if(i.suppressErrorRendering)throw h(),I;m=await i7.fromText("error"),y=I}const v=d.select(u).node(),T=m.type,b=v.firstChild,w=b.firstChild,k=(F=(z=m.renderer).getClasses)==null?void 0:F.call(z,e,m),A=T8e(i,T,k,a),C=document.createElement("style");C.innerHTML=A,b.insertBefore(C,w);try{await m.renderer.draw(e,t,"11.15.0",m)}catch(I){throw i.suppressErrorRendering?h():H_e.draw(e,t,"11.15.0"),I}const _=d.select(`${u} svg`),L=(R=(S=m.db).getAccTitle)==null?void 0:R.call(S),O=(D=(N=m.db).getAccDescription)==null?void 0:D.call(N);eY(T,_,L,O),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",u8e);let M=d.select(u).node().innerHTML;if(ae.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),M=w8e(M,f,hc(i.arrowMarkerAbsolute)),f){const I=d.select(u+" svg").node();M=C8e(M,I)}else p||(M=ku.sanitize(M,{ADD_TAGS:y8e,ADD_ATTR:v8e,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(J7e(),y)throw y;return h(),{diagramType:T,svg:M,bindFunctions:m.db.bindFunctions}},"render");function QH(t={}){var n;const e=ci({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),nxe(e),e!=null&&e.theme&&e.theme in uc?e.themeVariables=uc[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=uc.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?rxe(e):kB();p6(r.logLevel),uC()}x(QH,"initialize");var JH=x((t,e={})=>{const{code:r}=a7(t);return i7.fromText(r,e)},"getDiagramFromText");function eY(t,e,r,n){WH(e,t),UH(e,r,n,e.attr("id"))}x(eY,"addA11yInfo");var pd=Object.freeze({render:E8e,parse:KH,getDiagramFromText:JH,initialize:QH,getConfig:lr,setConfig:EB,getSiteConfig:kB,updateSiteConfig:ixe,reset:x(()=>{Sw()},"reset"),globalReset:x(()=>{Sw(C0)},"globalReset"),defaultConfig:C0});p6(lr().logLevel),Sw(lr());var S8e=x((t,e,r)=>{ae.warn(t),f_(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),tY=x(async function(t={querySelector:".mermaid"}){try{await A8e(t)}catch(e){if(f_(e)&&ae.error(e.str),Fs.parseError&&Fs.parseError(e),!t.suppressErrors)throw ae.error("Use the suppressErrors option to suppress these errors"),e}},"run"),A8e=x(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=pd.getConfig();ae.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");ae.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(ae.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),pd.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new Lr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(ae.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=MV(Lr.entityDecode(s)).trim().replace(//gi,"
");const h=Lr.detectInit(s);h&&ae.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await aY(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){S8e(d,o,Fs.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),rY=x(function(t){pd.initialize(t)},"initialize"),_8e=x(async function(t,e,r){ae.warn("mermaid.init is deprecated. Please use run instead."),t&&rY(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await tY(n)},"init"),R8e=x(async(t,{lazyLoad:e=!0}={})=>{uC(),E6(...t),e===!1&&await Z7e()},"registerExternalDiagrams"),nY=x(function(){if(Fs.startOnLoad){const{startOnLoad:t}=pd.getConfig();t&&Fs.run().catch(e=>ae.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",nY,!1);var L8e=x(function(t){Fs.parseError=t},"setParseErrorHandler"),hC=[],l7=!1,iY=x(async()=>{if(!l7){for(l7=!0;hC.length>0;){const t=hC.shift();if(t)try{await t()}catch(e){ae.error("Error executing queue",e)}}l7=!1}},"executeQueue"),I8e=x(async(t,e)=>new Promise((r,n)=>{const i=x(()=>new Promise((a,s)=>{pd.parse(t,e).then(o=>{a(o),r(o)},o=>{var l;ae.error("Error parsing",o),(l=Fs.parseError)==null||l.call(Fs,o),s(o),n(o)})}),"performCall");hC.push(i),iY().catch(n)}),"parse"),aY=x((t,e,r)=>new Promise((n,i)=>{const a=x(()=>new Promise((s,o)=>{pd.render(t,e,r).then(l=>{s(l),n(l)},l=>{var u;ae.error("Error parsing",l),(u=Fs.parseError)==null||u.call(Fs,l),o(l),i(l)})}),"performCall");hC.push(a),iY().catch(i)}),"render"),D8e=x(()=>Object.keys(Vh).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Fs={startOnLoad:!0,mermaidAPI:pd,parse:I8e,render:aY,init:_8e,run:tY,registerExternalDiagrams:R8e,registerLayoutLoaders:tH,initialize:rY,parseError:void 0,contentLoaded:nY,setParseErrorHandler:L8e,detectType:k6,registerIconPacks:$V,getRegisteredDiagramsMetadata:D8e},M8e=Fs;/*! Check if previously processed *//*! +`;return n+D6(r)},"createCssStyles"),S8e=T((t,e)=>s7(OAe(`${t}{${e}}`),BAe([T(function(n,i,a,s){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===t7)return;n.props=n.props.map(o=>o.startsWith(t)?o:`${t} ${o}`)}else n.type.startsWith("@")&&([...[TAe,CAe,cH,EAe,"@container","@starting-style"],t7].includes(n.type)||(ae.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=e7))},"addNamespace"),PAe])),"compileCSS"),A8e=T((t,e,r,n)=>{const i=E8e(t,r),a=Rxe(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return S8e(n,a)},"createUserStyles"),_8e=T((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=Tc(n),n=n.replace(/
/g,"
"),n},"cleanUpSvgCode"),R8e=T((t="",e)=>{var i,a;const r=(a=(i=e==null?void 0:e.viewBox)==null?void 0:i.baseVal)!=null&&a.height?e.viewBox.baseVal.height+"px":v8e,n=JH(`${t}`);return``},"putIntoIFrame"),rY=T((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",p8e);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function u7(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}T(u7,"sandboxedIframe");var L8e=T((t,e,r,n)=>{var i,a,s;(i=t.getElementById(e))==null||i.remove(),(a=t.getElementById(r))==null||a.remove(),(s=t.getElementById(n))==null||s.remove()},"removeExistingElements"),I8e=T(async function(t,e,r){var z,F,A,R,N,D;dC();const n=c7(e);e=n.code;const i=lr();ae.debug(i),e.length>((i==null?void 0:i.maxTextSize)??u8e)&&(e=h8e);const a=`#${t}`,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=T(()=>{const $=pt(f?o:u).node();$&&"remove"in $&&$.remove()},"removeTempElements");let d=pt(document.body);const f=i.securityLevel===d8e,p=i.securityLevel===f8e,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const I=u7(pt(r),s);d=pt(I.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=pt(r);rY(d,t,l,`font-family: ${g}`,g8e)}else{if(L8e(document,t,l,s),f){const I=u7(pt(document.body),s);d=pt(I.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=pt("body");rY(d,t,l)}let m,y;try{m=await o7.fromText(e,{title:n.title})}catch(I){if(i.suppressErrorRendering)throw h(),I;m=await o7.fromText("error"),y=I}const v=d.select(u).node(),x=m.type,b=v.firstChild,w=b.firstChild,k=(F=(z=m.renderer).getClasses)==null?void 0:F.call(z,e,m),S=A8e(i,x,k,a),C=document.createElement("style");C.innerHTML=S,b.insertBefore(C,w);try{await m.renderer.draw(e,t,"11.15.0",m)}catch(I){throw i.suppressErrorRendering?h():Q_e.draw(e,t,"11.15.0"),I}const _=d.select(`${u} svg`),L=(R=(A=m.db).getAccTitle)==null?void 0:R.call(A),O=(D=(N=m.db).getAccDescription)==null?void 0:D.call(N);aY(x,_,L,O),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",m8e);let M=d.select(u).node().innerHTML;if(ae.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),M=_8e(M,f,hc(i.arrowMarkerAbsolute)),f){const I=d.select(u+" svg").node();M=R8e(M,I)}else p||(M=ku.sanitize(M,{ADD_TAGS:C8e,ADD_ATTR:k8e,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(a8e(),y)throw y;return h(),{diagramType:x,svg:M,bindFunctions:m.db.bindFunctions}},"render");function nY(t={}){var n;const e=ci({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),cxe(e),e!=null&&e.theme&&e.theme in uc?e.themeVariables=uc[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=uc.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?lxe(e):RB();y6(r.logLevel),dC()}T(nY,"initialize");var iY=T((t,e={})=>{const{code:r}=l7(t);return o7.fromText(r,e)},"getDiagramFromText");function aY(t,e,r,n){KH(e,t),jH(e,r,n,e.attr("id"))}T(aY,"addA11yInfo");var pd=Object.freeze({render:I8e,parse:eY,getDiagramFromText:iY,initialize:nY,getConfig:lr,setConfig:LB,getSiteConfig:RB,updateSiteConfig:uxe,reset:T(()=>{_w()},"reset"),globalReset:T(()=>{_w(Cp)},"globalReset"),defaultConfig:Cp});y6(lr().logLevel),_w(lr());var D8e=T((t,e,r)=>{ae.warn(t),m_(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),sY=T(async function(t={querySelector:".mermaid"}){try{await M8e(t)}catch(e){if(m_(e)&&ae.error(e.str),Fs.parseError&&Fs.parseError(e),!t.suppressErrors)throw ae.error("Use the suppressErrors option to suppress these errors"),e}},"run"),M8e=T(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=pd.getConfig();ae.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");ae.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(ae.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),pd.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new Lr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(ae.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=BV(Lr.entityDecode(s)).trim().replace(//gi,"
");const h=Lr.detectInit(s);h&&ae.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await uY(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){D8e(d,o,Fs.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),oY=T(function(t){pd.initialize(t)},"initialize"),N8e=T(async function(t,e,r){ae.warn("mermaid.init is deprecated. Please use run instead."),t&&oY(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await sY(n)},"init"),O8e=T(async(t,{lazyLoad:e=!0}={})=>{dC(),_6(...t),e===!1&&await n8e()},"registerExternalDiagrams"),lY=T(function(){if(Fs.startOnLoad){const{startOnLoad:t}=pd.getConfig();t&&Fs.run().catch(e=>ae.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",lY,!1);var $8e=T(function(t){Fs.parseError=t},"setParseErrorHandler"),fC=[],h7=!1,cY=T(async()=>{if(!h7){for(h7=!0;fC.length>0;){const t=fC.shift();if(t)try{await t()}catch(e){ae.error("Error executing queue",e)}}h7=!1}},"executeQueue"),P8e=T(async(t,e)=>new Promise((r,n)=>{const i=T(()=>new Promise((a,s)=>{pd.parse(t,e).then(o=>{a(o),r(o)},o=>{var l;ae.error("Error parsing",o),(l=Fs.parseError)==null||l.call(Fs,o),s(o),n(o)})}),"performCall");fC.push(i),cY().catch(n)}),"parse"),uY=T((t,e,r)=>new Promise((n,i)=>{const a=T(()=>new Promise((s,o)=>{pd.render(t,e,r).then(l=>{s(l),n(l)},l=>{var u;ae.error("Error parsing",l),(u=Fs.parseError)==null||u.call(Fs,l),o(l),i(l)})}),"performCall");fC.push(a),cY().catch(i)}),"render"),B8e=T(()=>Object.keys(Vh).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Fs={startOnLoad:!0,mermaidAPI:pd,parse:P8e,render:uY,init:N8e,run:sY,registerExternalDiagrams:O8e,registerLayoutLoaders:sH,initialize:oY,parseError:void 0,contentLoaded:lY,setParseErrorHandler:$8e,detectType:A6,registerIconPacks:GV,getRegisteredDiagramsMetadata:B8e},F8e=Fs;/*! Check if previously processed *//*! * Wait for document loaded before starting the execution - */window.mermaid=M8e,(function(){var f;if(window.OpenKnowledgeShortcuts)return;const t=[],e=window.navigator&&(window.navigator.platform||((f=window.navigator.userAgentData)==null?void 0:f.platform))||"",r=/\b(Mac|iPhone|iPad|iPod)\b/.test(e);function n(p){return!p||!p.id||typeof p.run!="function"?function(){}:(i(p.id),t.push(Object.assign({preventDefault:!0,allowEditable:!1},p)),function(){i(p.id)})}function i(p){const g=t.findIndex(function(m){return m.id===p});g>=0&&t.splice(g,1)}function a(p){return!!(p&&p.closest&&p.closest("input, textarea, select, [contenteditable='true']"))}function s(p,g){if(g.defaultPrevented||!p.allowEditable&&a(g.target))return!1;if(p.code){if(g.code!==p.code)return!1}else if(String(g.key||"").toLowerCase()!==String(p.key||"").toLowerCase())return!1;return!o(p,g)||g.altKey!==!!p.altKey||g.shiftKey!==!!p.shiftKey?!1:typeof p.when!="function"||p.when(g)}function o(p,g){return p.primaryKey?r?g.metaKey&&!g.ctrlKey:g.ctrlKey&&!g.metaKey:p.metaOrCtrlKey?g.metaKey||g.ctrlKey:g.metaKey===!!p.metaKey&&g.ctrlKey===!!p.ctrlKey}function l(p){for(let g=t.length-1;g>=0;g--){const m=t[g];if(s(m,p)){m.preventDefault!==!1&&p.preventDefault(),m.run(p);return}}}function u(p){const g=p.key||p.code||"",m=String(g).replace(/^Key/,"").replace(/^Digit/,"");return m===" "?"Space":m.length===1?m.toUpperCase():m}function h(p){if(p.label)return p.label;const g=[];return p.primaryKey||p.metaOrCtrlKey?g.push(r?"⌘":"Ctrl"):(p.metaKey&&g.push(r?"⌘":"Meta"),p.ctrlKey&&g.push("Ctrl")),p.altKey&&g.push(r?"⌥":"Alt"),p.shiftKey&&g.push(r?"⇧":"Shift"),g.push(u(p)),r?g.join(""):g.join("+")}function d(p){if(p.ariaKeyShortcut)return p.ariaKeyShortcut;const g=[];return p.primaryKey||p.metaOrCtrlKey?g.push(r?"Meta":"Control"):(p.metaKey&&g.push("Meta"),p.ctrlKey&&g.push("Control")),p.altKey&&g.push("Alt"),p.shiftKey&&g.push("Shift"),g.push(u(p)),g.join("+")}window.OpenKnowledgeShortcuts={register:n,unregister:i,format:h,ariaKeyShortcut:d,isEditableTarget:a,isMacPlatform:r},document.addEventListener("keydown",l)})(),(function(){var V2e;const t=document.querySelector("[data-note-workspace]"),e=document.querySelector("[data-note-stack]"),r=document.querySelector("[data-empty-state]"),n=document.querySelector("[data-file-sidebar]"),i=document.querySelector("[data-sidebar-toggle]"),a=document.querySelector("[data-sidebar-close]"),s=document.querySelector("[data-viewer-settings]"),o=document.querySelector("[data-viewer-settings-trigger]"),l=document.querySelector("[data-viewer-settings-menu]"),u=document.querySelector("[data-navigation-mode-toggle]"),h=document.querySelector("[data-theme-custom-fields]"),d=document.querySelector("[data-frontmatter-visibility]"),f=document.querySelector("[data-accessibility-font]"),p=document.querySelector("[data-accessibility-size]"),g=document.querySelector("[data-accessibility-spacing]"),m=document.querySelector("[data-accessibility-motion]"),y=document.querySelector("[data-readable-line-length]"),v=document.querySelector("[data-high-contrast]"),T=document.querySelector("[data-underline-links]"),b=document.querySelector("[data-workspace-rail]"),w=document.querySelector("[data-workspace-scroll-track]"),k=document.querySelector("[data-workspace-scroll-thumb]");if(!t||!e)return;const A=window.matchMedia("(prefers-reduced-motion: reduce)"),C=window.matchMedia("(max-width: 680px)"),_="openknowledge.viewer.editorOrder",L="openknowledge.viewer.theme",O="openknowledge.viewer.frontmatter",M="openknowledge.viewer.accessibility",z="openknowledge.viewer.navigationMode",F="beside";let S=F;const R=gn(t.dataset.linkPrefix||""),N="openknowledge.viewer.panelWidths."+Qr(t.dataset.noteRoot||R||window.location.pathname).toString(36),D=t1t(),I=Ge(),$=$r(),B=Umt($,"path"),P=Hmt($),G=Pa(),V=Oe(),Y=["default","night","paper","ocean","rose","custom"],W="night",ie={system:'Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", sans-serif',readable:"Verdana, Tahoma, Arial, sans-serif",serif:'Iowan Old Style, Baskerville, "Times New Roman", serif',mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},K={small:{value:"14px",scale:"0.9"},default:{value:"15.5px",scale:"1"},large:{value:"18px",scale:"1.16"},"extra-large":{value:"21px",scale:"1.35"}},se={default:{value:"1.62",letterSpacing:"normal"},relaxed:{value:"1.82",letterSpacing:".02em"},spacious:{value:"2.05",letterSpacing:".04em"}},J={font:"system",size:"default",spacing:"default",motion:"system",readableLineLength:!0,highContrast:!1,underlineLinks:!1},Z={page:"#f4f5f4",surface:"#ffffff",text:"#202322",muted:"#707773",accent:"#0b7a53",border:"#e3e6e4"},ee={page:["--ok-color-page","--ok-color-header-bg","--ok-color-viewer-canvas","--ok-color-viewer-header-bg","--ok-color-sidebar","--ok-color-sidebar-header"],surface:["--ok-color-surface","--ok-color-note-chrome-bg","--ok-color-search-input-bg","--ok-color-search-popover-bg","--ok-color-editor-trigger-bg","--ok-color-editor-menu-bg","--ok-color-card-bg","--ok-color-editor-mark-bg"],text:["--ok-color-text","--ok-color-document-text","--ok-color-control-hover-text","--ok-color-editor-mark-text","--ok-color-code-block-bg"],muted:["--ok-color-muted","--ok-color-control-text","--ok-color-close-text","--ok-color-sidebar-text","--ok-color-search-shortcut-text","--ok-color-tree-text","--ok-color-tree-badge-text","--ok-color-note-close-text","--ok-color-editor-trigger-text"],accent:["--ok-color-accent","--ok-color-accent-strong","--ok-color-focus-ring","--ok-color-graph-node-active-border"],border:["--ok-color-border","--ok-color-control-hover-border","--ok-color-close-hover-border","--ok-color-sidebar-border","--ok-color-search-input-border","--ok-color-search-shortcut-border","--ok-color-search-popover-border","--ok-color-card-border","--ok-color-tree-badge-border","--ok-color-note-close-hover-border","--ok-color-editor-trigger-border","--ok-color-editor-trigger-separator","--ok-color-editor-menu-border","--ok-color-editor-menu-separator"]};let ne=Promise.resolve(),ue=0,fe=0,_e=0;const Ae={id:"viewer.panel.close",code:"KeyW",metaOrCtrlKey:!0,altKey:!0,label:"⌘⌥W",ariaKeyShortcut:"Meta+Alt+W",when:function(){return!!f2e()},run:function(){const q=f2e();q&&u6(q)}};function Ne(){return Array.prototype.slice.call(e.querySelectorAll("[data-note-path]"))}function me(q,X){return q?q.closest?q.closest(X):q.parentElement?q.parentElement.closest(X):null:null}function ve(q,X,te){return Math.min(Math.max(q,X),te)}function Ge(){const q=Ze(N);return q&&typeof q=="object"&&!Array.isArray(q)?q:{}}function Te(){const q=JSON.stringify(I);try{window.localStorage.setItem(N,q)}catch{}Qe(N,q)}function Ze(q){const X=[ke(q),Ve(q)];for(const te of X)if(te)try{return JSON.parse(te)}catch{}return null}function ke(q){try{return window.localStorage.getItem(q)}catch{return null}}function Ve(q){const X=encodeURIComponent(q)+"=",te=document.cookie?document.cookie.split("; "):[];for(const de of te)if(de.startsWith(X))try{return decodeURIComponent(de.slice(X.length))}catch{return null}return null}function Qe(q,X){try{document.cookie=encodeURIComponent(q)+"="+encodeURIComponent(X)+"; Max-Age=31536000; Path=/; SameSite=Lax"}catch{}}function nt(q){return q==="beside"||q==="replace"?q:F}function tt(){return nt(Ze(z))}function je(q){const X=JSON.stringify(nt(q));try{window.localStorage.setItem(z,X)}catch{}Qe(z,X)}function Ce(){return S==="beside"?"Links open beside. Hold Shift to replace the current panel.":"Links open in the current panel. Hold Shift to open beside."}function Se(q){S=nt(q),document.documentElement.dataset.viewerNavigationMode=S,u&&(u.dataset.mode=S,u.setAttribute("aria-pressed",S==="beside"?"true":"false"),u.setAttribute("aria-label","Link behavior: "+(S==="beside"?"Open beside":"Open in current panel")),u.title=Ce()),E2e()}function H(q){const X=S==="beside";return q?!X:X}function he(){Se(tt()),!(!u||u.dataset.modeBound==="true")&&(u.dataset.modeBound="true",u.addEventListener("click",function(){const q=S==="beside"?"replace":"beside";je(q),Se(q)}))}function j(){const q=Ze(L);return q&&typeof q=="object"&&!Array.isArray(q)?pe(q):pe({preset:W,custom:Z})}function pe(q){const X=Y.includes(q.preset)?q.preset:W,te=Object.assign({},Z);return Object.keys(Z).forEach(function(de){we(q.custom&&q.custom[de])&&(te[de]=q.custom[de].toLowerCase())}),{preset:X,custom:te}}function re(q){const X=pe(q),te=JSON.stringify(X);try{window.localStorage.setItem(L,te)}catch{}Qe(L,te)}function Be(){const q=Ze(O);return q&&typeof q=="object"&&!Array.isArray(q)&&typeof q.visible=="boolean"?q.visible:!0}function xe(q){const X=JSON.stringify({visible:!!q});try{window.localStorage.setItem(O,X)}catch{}Qe(O,X)}function Ue(){const q=Ze(M);return q&&typeof q=="object"&&!Array.isArray(q)?De(q):De(J)}function De(q){const X=q&&typeof q=="object"?q:{};return{font:Object.prototype.hasOwnProperty.call(ie,X.font)?X.font:J.font,size:Object.prototype.hasOwnProperty.call(K,X.size)?X.size:J.size,spacing:Object.prototype.hasOwnProperty.call(se,X.spacing)?X.spacing:J.spacing,motion:["system","reduced","full"].includes(X.motion)?X.motion:J.motion,readableLineLength:typeof X.readableLineLength=="boolean"?X.readableLineLength:J.readableLineLength,highContrast:typeof X.highContrast=="boolean"?X.highContrast:J.highContrast,underlineLinks:typeof X.underlineLinks=="boolean"?X.underlineLinks:J.underlineLinks}}function qe(q){const X=De(q),te=JSON.stringify(X);try{window.localStorage.setItem(M,te)}catch{}Qe(M,te)}function Le(q){const X=De(q),te=K[X.size],de=se[X.spacing];document.documentElement.dataset.viewerFont=X.font,document.documentElement.dataset.viewerFontSize=X.size,document.documentElement.dataset.viewerMotion=X.motion,document.documentElement.dataset.viewerContrast=X.highContrast?"high":"normal",document.documentElement.dataset.viewerUnderlines=X.underlineLinks?"on":"off",document.documentElement.style.setProperty("--ok-font-body",ie[X.font]),document.documentElement.style.setProperty("--ok-document-font-size",te.value),document.documentElement.style.setProperty("--ok-document-scale",te.scale),document.documentElement.style.setProperty("--ok-document-line-height",de.value),document.documentElement.style.setProperty("--ok-document-letter-spacing",de.letterSpacing),document.documentElement.style.setProperty("--ok-note-body-max-width",X.readableLineLength?"70ch":"none"),document.body.classList.toggle("is-high-contrast",X.highContrast),document.body.classList.toggle("is-links-underlined",X.underlineLinks),Xe(X)}function Xe(q){f&&(f.value=q.font),p&&(p.value=q.size),g&&(g.value=q.spacing),m&&(m.value=q.motion),y&&(y.checked=q.readableLineLength),v&&(v.checked=q.highContrast),T&&(T.checked=q.underlineLinks)}function Ie(){const q=document.documentElement.dataset.viewerMotion||"system";return q==="reduced"||q==="system"&&A.matches}function it(q){document.body.classList.toggle("is-frontmatter-hidden",!q),d&&(d.checked=q)}function we(q){return/^#[0-9a-f]{6}$/i.test(String(q||""))}function lt(q){const X=we(q)?q.slice(1):Z.accent.slice(1);return[parseInt(X.slice(0,2),16),parseInt(X.slice(2,4),16),parseInt(X.slice(4,6),16)]}function be(q,X,te){const de=lt(q),Me=lt(X);return"#"+de.map(function(We,ft){return Math.round(We+(Me[ft]-We)*te)}).map(function(We){return We.toString(16).padStart(2,"0")}).join("")}function Et(q){return vt(q)>.48?"#121715":"#f3f7f4"}function vt(q){const X=lt(q);return(.2126*X[0]+.7152*X[1]+.0722*X[2])/255}function ot(q){const X=pe(q);document.documentElement.dataset.viewerTheme=X.preset;const te=X.preset==="custom"&&vt(X.custom.surface)<=.48;document.documentElement.style.colorScheme=X.preset==="night"||te?"dark":"light",It(),X.preset==="custom"&&xt(X.custom),ht(X),f1t()}function It(){Object.keys(ee).forEach(function(q){ee[q].forEach(function(X){document.documentElement.style.removeProperty(X)})}),["--ok-color-accent-rgb","--ok-color-accent-soft","--ok-color-accent-softer","--ok-color-accent-selected","--ok-color-accent-focus","--ok-color-accent-focus-strong","--ok-color-accent-border","--ok-color-accent-border-strong","--ok-color-shadow","--ok-color-code-inline-bg","--ok-color-code-block-text","--ok-color-control-hover-bg","--ok-color-sidebar-row","--ok-color-sidebar-tree-hover-bg","--ok-color-search-result-hover-bg","--ok-color-editor-menu-item-hover-bg","--ok-color-graph-edge-active"].forEach(function(q){document.documentElement.style.removeProperty(q)})}function xt(q){Object.keys(ee).forEach(function(te){ee[te].forEach(function(de){document.documentElement.style.setProperty(de,q[te])})});const X=lt(q.accent).join(", ");document.documentElement.style.setProperty("--ok-color-accent-rgb",X),document.documentElement.style.setProperty("--ok-color-accent-soft","rgba("+X+", .11)"),document.documentElement.style.setProperty("--ok-color-accent-softer","rgba("+X+", .065)"),document.documentElement.style.setProperty("--ok-color-accent-selected","rgba("+X+", .09)"),document.documentElement.style.setProperty("--ok-color-accent-focus","rgba("+X+", .12)"),document.documentElement.style.setProperty("--ok-color-accent-focus-strong","rgba("+X+", .18)"),document.documentElement.style.setProperty("--ok-color-accent-border","rgba("+X+", .35)"),document.documentElement.style.setProperty("--ok-color-accent-border-strong","rgba("+X+", .5)"),document.documentElement.style.setProperty("--ok-color-shadow","rgba("+lt(q.text).join(", ")+", .1)"),document.documentElement.style.setProperty("--ok-color-code-inline-bg",be(q.surface,q.accent,.1)),document.documentElement.style.setProperty("--ok-color-code-block-text",Et(q.text)),document.documentElement.style.setProperty("--ok-color-control-hover-bg",be(q.page,q.text,.08)),document.documentElement.style.setProperty("--ok-color-sidebar-row",be(q.page,q.text,.11)),document.documentElement.style.setProperty("--ok-color-sidebar-tree-hover-bg",be(q.page,q.accent,.13)),document.documentElement.style.setProperty("--ok-color-search-result-hover-bg",be(q.surface,q.accent,.08)),document.documentElement.style.setProperty("--ok-color-editor-menu-item-hover-bg",be(q.surface,q.accent,.08)),document.documentElement.style.setProperty("--ok-color-graph-edge-active","rgba("+X+", .78)")}function ht(q){document.querySelectorAll("[data-theme-option]").forEach(function(X){const te=X.dataset.themeOption===q.preset;X.classList.toggle("is-selected",te),X.setAttribute("aria-checked",te?"true":"false")}),h&&(h.hidden=q.preset!=="custom",h.querySelectorAll("[data-theme-custom-value]").forEach(function(X){const te=X.dataset.themeCustomValue;q.custom[te]&&(X.value=q.custom[te])}))}function oe(){return Math.min(360,Math.max(260,window.innerWidth-24))}function At(){return window.innerWidth<=680?12:Math.max(22,(window.innerWidth-1180)/2)}function dt(q){const X=Ne();return!!(q&&X.length===1&&X[0]===q)}function ut(q){return dt(q)?Math.max(oe(),window.innerWidth-At()*2):Math.max(wt(),1180)}function wt(){return Math.max(oe(),Mr("var(--ok-note-panel-default-width)",650))}function Mr(q,X){const te=document.createElement("div");te.style.position="absolute",te.style.left="-10000px",te.style.top="-10000px",te.style.visibility="hidden",te.style.pointerEvents="none",te.style.width=q,document.body.append(te);const de=te.getBoundingClientRect().width;return te.remove(),Number.isFinite(de)&&de>0?de:X}function ye(q,X){const te=Number(q);return Number.isFinite(te)?Math.round(ve(te,oe(),ut(X))):null}function et(q){return ye(I[q.dataset.notePath],q)}function ct(q){const X=et(q);if(!X){q.style.removeProperty("--note-panel-width"),delete q.dataset.panelWidth;return}q.style.setProperty("--note-panel-width",X+"px"),q.dataset.panelWidth=String(X)}function _t(q){var X;document.body.classList.toggle("is-sidebar-open",q),n&&n.setAttribute("aria-hidden",q?"false":"true"),i&&i.setAttribute("aria-expanded",q?"true":"false"),q&&Pt(((X=Eo())==null?void 0:X.dataset.notePath)||sl()[0]||"",!0)}function Ft(){_t(!document.body.classList.contains("is-sidebar-open"))}function nr(q,X){if(i6())return Kmt(q,X);let te;try{te=new URL(q,window.location.href)}catch{return null}const de=Jt();if(te.origin!==window.location.origin||!te.pathname.startsWith(de))return null;const Me=te.pathname.slice(de.length)||"index.md";if(!_r(Me))return null;try{return decodeURIComponent(Me)}catch{return Me}}function ir(q,X){return q+X.split("/").map(encodeURIComponent).join("/")}function _r(q){return/\.(md|markdown)$/i.test(String(q).split("?")[0].split("#")[0])}function or(q){return i6()?Ymt(q):ir(Jt(),q)}function Rr(q){return ir(Nr(),q)}function Jt(){return R+"/file/"}function Nr(){return R+"/api/file/"}function gn(q){const X=String(q||"").replace(/\/+$/,"");return X?X.startsWith("/")?X:"/"+X:""}function $r(){var te;const q=(te=window.OpenKnowledgeStaticData)==null?void 0:te.notes;if(Array.isArray(q))return q;const X=document.querySelector("[data-static-notes]");if(!X)return[];try{const de=JSON.parse(X.textContent||"[]");return Array.isArray(de)?de:[]}catch{return[]}}function Pa(){const q=new Set;return $.forEach(function(X){X.path&&q.add(X.path)}),document.querySelectorAll("[data-tree-path]").forEach(function(X){X.dataset.treePath&&q.add(X.dataset.treePath)}),q}function ps(){document.querySelectorAll(".knowledge-tree").forEach(function(q){if(q.dataset.treePrepared==="true")return;q.dataset.treePrepared="true";const X=[];Array.from(q.querySelectorAll(".tree-row")).forEach(function(te){var ft;const de=gs(te);for(;X.length&&X[X.length-1].indent>=de;)X.pop();if(te.dataset.treeParentPath=((ft=X[X.length-1])==null?void 0:ft.path)||"",!te.classList.contains("tree-directory"))return;const Me=String(te.textContent||"").trim(),Fe=X.concat([{name:Me}]).map(function(mt){return mt.name}).join("/");te.dataset.treeDirectoryPath=Fe,te.setAttribute("aria-expanded","false"),te.tabIndex=0,te.title="Expand "+Fe;const We=s6("chevron-down","tree-directory-icon");We.setAttribute("aria-hidden","true"),te.prepend(We),te.addEventListener("click",function(){li(te,te.getAttribute("aria-expanded")!=="true")}),te.addEventListener("keydown",function(mt){if(mt.key==="ArrowRight"){mt.preventDefault(),li(te,!0);return}if(mt.key==="ArrowLeft"){mt.preventDefault(),li(te,!1);return}(mt.key==="Enter"||mt.key===" ")&&(mt.preventDefault(),li(te,te.getAttribute("aria-expanded")!=="true"))}),X.push({indent:de,name:Me,path:Fe})}),Bt(q)}),Ct()}function gs(q){const X=q.style.getPropertyValue("--indent"),te=parseFloat(X);return Number.isFinite(te)?te:0}function li(q,X){q.setAttribute("aria-expanded",X?"true":"false"),q.title=(X?"Collapse ":"Expand ")+q.dataset.treeDirectoryPath;const te=q.closest(".knowledge-tree");te&&Bt(te)}function Bt(q){const X=Object.create(null);q.querySelectorAll("[data-tree-directory-path]").forEach(function(te){X[te.dataset.treeDirectoryPath]=te}),q.querySelectorAll(".tree-row").forEach(function(te){const Me=(te.dataset.treeParentPath||"").split("/").filter(Boolean);let Fe="",We=!1;Me.forEach(function(ft){Fe=Fe?Fe+"/"+ft:ft;const mt=X[Fe];mt&&mt.getAttribute("aria-expanded")!=="true"&&(We=!0)}),te.hidden=We})}function yt(){document.querySelectorAll("[data-tree-directory-path]").forEach(function(q){q.setAttribute("aria-expanded","false"),q.title="Expand "+q.dataset.treeDirectoryPath}),document.querySelectorAll(".knowledge-tree").forEach(Bt)}function Pt(q,X){const te=String(q||""),de=te.split("/").slice(0,-1),Me=new Set;if(de.forEach(function(Fe,We){Me.add(de.slice(0,We+1).join("/"))}),document.querySelectorAll(".knowledge-tree").forEach(function(Fe){Fe.querySelectorAll("[data-tree-directory-path]").forEach(function(We){Me.has(We.dataset.treeDirectoryPath)&&(We.setAttribute("aria-expanded","true"),We.title="Collapse "+We.dataset.treeDirectoryPath)}),Fe.querySelectorAll("[data-tree-path]").forEach(function(We){const ft=We.dataset.treePath===te;We.classList.toggle("is-current-file",ft),ft?(We.setAttribute("aria-current","page"),We.title=We.dataset.treePath):(We.removeAttribute("aria-current"),We.title=Ce())}),Bt(Fe)}),X&&n){const Fe=Array.from(n.querySelectorAll("[data-tree-path]")).find(function(We){return We.dataset.treePath===te});Fe&&window.requestAnimationFrame(function(){Fe.scrollIntoView({block:"center",behavior:Ie()?"auto":"smooth"})})}}function Ct(){const q=n==null?void 0:n.querySelector(".file-sidebar-head"),X=q==null?void 0:q.querySelector("[data-sidebar-close]");if(!q||!X||q.querySelector("[data-sidebar-collapse]"))return;const te=document.createElement("div");te.className="file-sidebar-actions";const de=document.createElement("button");de.type="button",de.className="file-sidebar-collapse",de.dataset.sidebarCollapse="",de.textContent="Collapse all",de.addEventListener("click",yt),X.before(te),te.append(de,X)}function pr(q){const X=q.join("/");return[X+"/index.md",X+"/index.markdown"].find(function(te){return G.has(te)})||""}function Ee(q){const X=String(q||"index.md"),te=X.split("/").filter(Boolean),de=te[te.length-1]||"index.md",Me=/^index\.(md|markdown)$/i.test(de)&&te.length>1,Fe=Me?te.slice(0,-1):te,We=document.createElement("nav");return We.className="note-path note-breadcrumbs",We.dataset.noteBreadcrumbs="",We.dataset.breadcrumbsReady="true",We.dataset.notePathValue=X,We.setAttribute("aria-label","Note path"),We.title=X,Fe.forEach(function(ft,mt){if(mt>0){const er=document.createElement("span");er.className="note-breadcrumb-separator",er.setAttribute("aria-hidden","true"),er.textContent="/",We.append(er)}const St=mt===Fe.length-1,Zt=pr(Fe.slice(0,mt+1)),sr=St?X:Zt,zt=St&&!Me?ft.replace(/\.(md|markdown)$/i,""):ft;if(sr){const er=document.createElement("a");er.className="note-breadcrumb-link"+(St?" note-breadcrumb-current":""),er.href=or(sr),er.dataset.directLink="true",er.textContent=zt,St&&er.setAttribute("aria-current","page"),We.append(er);return}const Ut=document.createElement("span");Ut.className="note-breadcrumb-label",Ut.textContent=zt,We.append(Ut)}),We}function Di(q){const X=q.querySelector("[data-note-breadcrumbs], .note-path");!X||X.dataset.breadcrumbsReady==="true"||X.replaceWith(Ee(q.dataset.notePath))}function Oe(){var te;const q=(te=window.OpenKnowledgeStaticData)==null?void 0:te.graph;if(q)return{nodes:Array.isArray(q.nodes)?q.nodes:[],edges:Array.isArray(q.edges)?q.edges:[]};const X=document.querySelector("[data-knowledge-graph]");if(!X)return{nodes:[],edges:[]};try{const de=JSON.parse(X.textContent||"{}");return{nodes:Array.isArray(de.nodes)?de.nodes:[],edges:Array.isArray(de.edges)?de.edges:[]}}catch{return{nodes:[],edges:[]}}}function Ln(){const q=document.querySelector("[data-knowledge-graph-view]"),X=document.querySelector("[data-knowledge-graph-sidebar]");if(!q)return;q.replaceChildren(),X==null||X.replaceChildren();const te=document.createElement("div");te.className="knowledge-graph-info";const de=document.createElement("h2");de.textContent="Knowledge graph";const Me=document.createElement("p");Me.textContent="Select a node to inspect its connections. Use arrow keys to move and Enter to open.";const Fe=document.createElement("p");if(Fe.className="knowledge-graph-status",Fe.dataset.knowledgeGraphStatus="",Fe.setAttribute("aria-live","polite"),Fe.textContent=V.nodes.length?V.nodes.length+(V.nodes.length===1?" note":" notes"):"No notes",te.append(de,Me,Fe),(X||q).append(te),!V.nodes.length){const Zt=document.createElement("p");Zt.className="empty",Zt.textContent="No Markdown files found.",q.append(Zt);return}const We=900,ft=640,mt=qmt(V.nodes),Nt=Je(V,We,ft,mt),St=document.createElement("canvas");St.className="knowledge-graph-canvas",St.dataset.knowledgeGraphCanvas="true",St.width=We,St.height=ft,St.tabIndex=0,St.setAttribute("role","img"),St.setAttribute("aria-label","Interactive graph of Markdown files. Use arrow keys to select a note and Enter to open it."),q.append(St),h0(St,V,Nt,mt,We,ft,Fe).start()}function h0(q,X,te,de,Me,Fe,We){const ft=q.getContext("2d"),mt=Object.create(null);X.nodes.forEach(function(tr){tr&&typeof tr.path=="string"&&(mt[tr.path]=!0)});const Nt=X.edges.filter(function(tr){return tr&&mt[tr.source]&&mt[tr.target]&&te[tr.source]&&te[tr.target]}),St=X.nodes.filter(function(tr){return tr&&typeof tr.path=="string"&&te[tr.path]}).map(function(tr){const fn=te[tr.path],lc=t2e(tr,de);return{node:tr,path:tr.path,label:lc,fullLabel:r2e(tr,de),radius:tr.path==="index.md"?16:10,labelOffset:tr.path==="index.md"?31:25,baseX:fn.x,baseY:fn.y,x:fn.x,y:fn.y,z:0,vx:0,vy:0}}),Zt=Object.create(null);St.forEach(function(tr){Zt[tr.path]=tr});let sr="",zt=St.findIndex(function(tr){return tr.path==="index.md"});zt<0&&(zt=0);let Ut=null,er=0;const Ar=function(tr){const fn=tr&&Zt[tr]?tr:"";if(fn!==sr)if(sr=fn,q.dataset.activeGraphPath=sr,q.style.cursor=sr?"pointer":"default",sr){const lc=St.findIndex(function(f6){return f6.path===sr});lc>=0&&(zt=lc);const vw=Zt[sr],W2e=Nt.filter(function(f6){return f6.source===sr||f6.target===sr}).length,U2e=W2e+(W2e===1?" connection":" connections");We&&(We.textContent=vw.fullLabel+" · "+U2e+" · Enter to open"),q.setAttribute("aria-label","Selected "+vw.fullLabel+" with "+U2e+". Use arrow keys to move and Enter to open.")}else We&&(We.textContent=X.nodes.length+(X.nodes.length===1?" note":" notes")),q.setAttribute("aria-label","Interactive graph of Markdown files. Use arrow keys to select a note and Enter to open it.")},yn=function(){const tr=Math.max(1,Math.min(window.devicePixelRatio||1,2));q.width=Math.round(Me*tr),q.height=Math.round(Fe*tr),ft.setTransform(tr,0,0,tr,0,0)},xn=function(tr){const fn=q.getBoundingClientRect();return!fn.width||!fn.height?{x:0,y:0}:{x:(tr.clientX-fn.left)*(Me/fn.width),y:(tr.clientY-fn.top)*(Fe/fn.height)}},xi=function(tr){Ut=tr;const fn=al(St,tr);Ar(fn?fn.path:"")};q.addEventListener("pointermove",function(tr){xi(xn(tr))}),q.addEventListener("pointerleave",function(){Ut=null,document.activeElement!==q&&Ar("")}),q.addEventListener("click",function(tr){const fn=al(St,xn(tr));fn&&m0(fn.path,!0,H(!1))}),q.addEventListener("focus",function(){St[zt]&&Ar(St[zt].path)}),q.addEventListener("blur",function(){Ar(Ut?sr:"")}),q.addEventListener("keydown",function(tr){if(!St.length)return;if(tr.key==="Enter"||tr.key===" "){sr&&(tr.preventDefault(),m0(sr,!0,H(!1)));return}if(tr.key!=="ArrowRight"&&tr.key!=="ArrowDown"&&tr.key!=="ArrowLeft"&&tr.key!=="ArrowUp")return;tr.preventDefault();const fn=tr.key==="ArrowRight"||tr.key==="ArrowDown"?1:-1;zt=(zt+fn+St.length)%St.length,Ar(St[zt].path)});const ll=function(){q.isConnected&&(er=window.requestAnimationFrame(ll),jv(St,Nt,Zt,sr,Me,Fe),Jn(ft,St,Nt,Zt,sr,Me,Fe))};return{start:function(){ft&&(yn(),Jn(ft,St,Nt,Zt,sr,Me,Fe),er=window.requestAnimationFrame(ll))},stop:function(){er&&window.cancelAnimationFrame(er)}}}function jv(q,X,te,de,Me,Fe){const We=de?te[de]:null;q.forEach(function(mt){const Nt=mt===We?1:0,St=mt===We?.052:.034;mt.vx+=(mt.baseX-mt.x)*St,mt.vy+=(mt.baseY-mt.y)*St,mt.z+=(Nt-mt.z)*.095});const ft=We?Zv(We.z):0;X.forEach(function(mt){const Nt=te[mt.source],St=te[mt.target];if(!Nt||!St)return;const Zt=St.x-Nt.x||.01,sr=St.y-Nt.y||.01,zt=Math.max(1,Math.sqrt(Zt*Zt+sr*sr)),Ut=We&&(mt.source===We.path||mt.target===We.path),er=104+(Ut?28*ft:0),Ar=(zt-er)*(Ut?.0015:.0011),yn=Zt/zt,xn=sr/zt;Nt.vx+=yn*Ar,Nt.vy+=xn*Ar,St.vx-=yn*Ar,St.vy-=xn*Ar});for(let mt=0;mt.02){const mt=xu(We,We.fullLabel);q.forEach(function(Nt){if(Nt===We)return;const St=ei(mt,xu(Nt,Nt.label));if(!St)return;const Zt=Nt.x-We.x||.01,sr=Nt.y-We.y||.01,zt=Math.max(1,Math.sqrt(Zt*Zt+sr*sr)),Ut=Math.min(3.2,(Math.max(St.x,St.y)*.026+.8)*ft);Nt.vx+=Zt/zt*Ut,Nt.vy+=sr/zt*Ut})}q.forEach(function(mt){mt.x+=mt.vx,mt.y+=mt.vy,bi(mt,Me,Fe),Qv(mt,We?5.5:4.2);const Nt=We?.58:.66;mt.vx*=Nt,mt.vy*=Nt,Math.abs(mt.vx)<.018&&(mt.vx=0),Math.abs(mt.vy)<.018&&(mt.vy=0)})}function Zv(q){const X=ve(q,0,1);return X*X*(3-2*X)}function Qv(q,X){const te=Math.sqrt(q.vx*q.vx+q.vy*q.vy);if(te<=X||te<=0)return;const de=X/te;q.vx*=de,q.vy*=de}function Jn(q,X,te,de,Me,Fe,We){const ft=Me?de[Me]:null,mt=il();q.clearRect(0,0,Fe,We),q.lineCap="round",q.lineJoin="round",te.forEach(function(Nt){const St=de[Nt.source],Zt=de[Nt.target];if(!St||!Zt)return;const sr=ft&&(Nt.source===ft.path||Nt.target===ft.path);q.beginPath(),q.moveTo(St.x,St.y),q.lineTo(Zt.x,Zt.y),q.strokeStyle=sr?mt.edgeActive:ft?mt.edgeMuted:mt.edge,q.lineWidth=sr?2.35:1.05,q.stroke()}),X.slice().sort(function(Nt,St){return Nt.z-St.z}).forEach(function(Nt){const St=Nt===ft,Zt=1+Nt.z*.22,sr=Nt.radius*Zt,zt=St?Nt.fullLabel:Nt.label;q.save(),q.globalAlpha=1,q.beginPath(),q.arc(Nt.x,Nt.y-Nt.z*6,sr,0,Math.PI*2),q.fillStyle=mt.nodeBg,q.fill(),q.strokeStyle=St?mt.nodeActiveBorder:mt.nodeBorder,q.lineWidth=St?3:Nt.path==="index.md"?2:1.55,q.stroke(),q.font=(St?"600 13px":"400 12px")+" "+mt.fontBody,q.textBaseline="middle",q.textAlign=Re(Nt.x,vi(zt),Fe);const Ut=q.textAlign==="start"?Math.max(16,Nt.x-vi(zt)/2):q.textAlign==="end"?Math.min(Fe-16,Nt.x+vi(zt)/2):Nt.x,er=Nt.y+Nt.labelOffset+Nt.z*4;q.fillStyle=St?mt.labelActive:mt.label,q.fillText(zt,Ut,er),q.restore()})}function il(){const q=document.documentElement.dataset.viewerContrast==="high";return{fontBody:yi("--ok-font-body","Inter, ui-sans-serif, system-ui, sans-serif"),edge:q?yi("--ok-color-text","#202322"):yi("--ok-color-graph-edge","rgba(128, 138, 133, .25)"),edgeMuted:q?yi("--ok-color-muted","#707773"):yi("--ok-color-graph-edge-muted","rgba(128, 138, 133, .11)"),edgeActive:yi("--ok-color-graph-edge-active","rgba(15, 122, 77, .78)"),nodeBg:yi("--ok-color-graph-node-bg","#f8f8f8"),nodeBorder:q?yi("--ok-color-text","#202322"):yi("--ok-color-graph-node-border","#aeb8b2"),nodeActiveBorder:yi("--ok-color-graph-node-active-border","#0f7a4d"),label:q?yi("--ok-color-text","#202322"):yi("--ok-color-graph-label","#5f6b66"),labelActive:q?yi("--ok-color-text","#202322"):yi("--ok-color-graph-label-active","#26302c")}}function yi(q,X){return getComputedStyle(document.documentElement).getPropertyValue(q).trim()||X}function al(q,X){for(let te=q.length-1;te>=0;te-=1){const de=q[te],Me=X.x-de.x,Fe=X.y-de.y,We=de.radius*(1+de.z*.22)+6;if(Me*Me+Fe*Fe<=We*We||Ot(X,xu(de,de.z>.6?de.fullLabel:de.label)))return de}return null}function xu(q,X){const te=vi(X),de=q.y+q.labelOffset-10,Me=Math.max(q.radius+8,te/2+9);return{left:q.x-Me,right:q.x+Me,top:Math.min(q.y-q.radius-8,de),bottom:Math.max(q.y+q.radius+8,de+22)}}function Ot(q,X){return q.x>=X.left&&q.x<=X.right&&q.y>=X.top&&q.y<=X.bottom}function Re(q,X,te){return q-X/2<16?"start":q+X/2>te-16?"end":"center"}function Je(q,X,te,de){const Me=q.nodes.filter(function(zt){return zt&&typeof zt.path=="string"&&zt.path.length>0}),Fe=Object.create(null);if(Me.length===0)return Fe;if(Me.length===1)return Fe[Me[0].path]={x:X/2,y:te/2},Fe;const We={x:X/2,y:te/2},ft=Object.create(null),mt=Object.create(null);Me.forEach(function(zt){ft[zt.path]=!0,mt[zt.path]=0});const Nt=[];q.edges.forEach(function(zt){!zt||!ft[zt.source]||!ft[zt.target]||(Nt.push(zt),mt[zt.source]+=1,mt[zt.target]+=1)});const St=bt(Me,X,te),Zt=Me.map(function(zt){const Ut=Vt(zt.path),er=St[Ut]||We,Ar=Qr(zt.path),yn=Ar%360/360*Math.PI*2,xn=26+Ar%74;return{node:zt,group:Ut,label:t2e(zt,de),radius:zt.path==="index.md"?16:10,x:er.x+Math.cos(yn)*xn,y:er.y+Math.sin(yn)*xn,vx:0,vy:0}}),sr=Object.create(null);Zt.forEach(function(zt){sr[zt.node.path]=zt});for(let zt=0;zt<220;zt+=1){for(let Ut=0;Ut0?.006:.018;Ut.vx+=(We.x-Ut.x)*yn,Ut.vy+=(We.y-Ut.y)*yn,Ut.vx+=(er.x-Ut.x)*xn,Ut.vy+=(er.y-Ut.y)*xn,Ut.x+=Ut.vx,Ut.y+=Ut.vy,bi(Ut,X,te),Ut.vx*=.62,Ut.vy*=.62})}return dr(Zt,X,te),mn(Zt,X,te),Zt.forEach(function(zt){Fe[zt.node.path]={x:zt.x,y:zt.y}}),Fe}function bt(q,X,te){const de=Object.create(null);q.forEach(function(St){const Zt=Vt(St.path);de[Zt]=(de[Zt]||0)+1});const Me=Object.keys(de).sort(function(St,Zt){return de[Zt]===de[St]?St.localeCompare(Zt):de[Zt]-de[St]}),Fe=Object.create(null);if(Me.length===0)return Fe;const We=Math.max(1,Math.ceil(Math.sqrt(Me.length*(X/te)))),ft=Math.max(1,Math.ceil(Me.length/We)),mt=X/We,Nt=te/ft;return Me.forEach(function(St,Zt){const sr=Zt%We,zt=Math.floor(Zt/We),Ut=Qr(St),er=(Ut%31-15)*.9,Ar=((Ut>>5)%31-15)*.9;Fe[St]={x:mt*(sr+.5)+er,y:Nt*(zt+.5)+Ar}}),Fe}function Vt(q){const X=n6(q);return X.length<=1?".":X.length>=3?X.slice(0,2).join("/"):X[0]}function dr(q,X,te){let de=1/0,Me=-1/0,Fe=1/0,We=-1/0;q.forEach(function(Ar){de=Math.min(de,Ar.x),Me=Math.max(Me,Ar.x),Fe=Math.min(Fe,Ar.y),We=Math.max(We,Ar.y)});const ft=74,mt=58,Nt=Math.max(1,Me-de),St=Math.max(1,We-Fe),Zt=Math.min((X-ft*2)/Nt,(te-mt*2)/St,1.28),sr=(de+Me)/2,zt=(Fe+We)/2,Ut=X/2,er=te/2;q.forEach(function(Ar){Ar.x=ve(Ut+(Ar.x-sr)*Zt,ft,X-ft),Ar.y=ve(er+(Ar.y-zt)*Zt,mt,te-mt),bi(Ar,X,te)})}function fr(q,X){const te=q.map(dn);for(let de=0;deX-14&&(q.x-=de.right-(X-14)),de.top<18&&(q.y+=18-de.top),de.bottom>te-18&&(q.y-=de.bottom-(te-18))}function Qr(q){let X=2166136261;const te=String(q||"");for(let de=0;de>>0}function qmt(q){const X=Object.create(null);q.forEach(function(de){if(!de||typeof de.path!="string")return;const Me=e2e(de);X[Me]||(X[Me]=[]),X[Me].push(de)});const te=Object.create(null);return Object.keys(X).forEach(function(de){const Me=X[de];if(Me.length===1){te[Me[0].path]=de;return}const Fe=Me.map(function(We){return We.path});Me.forEach(function(We){te[We.path]=Wmt(We.path,Fe)})}),te}function e2e(q){const X=String(q.title||"").trim();return X&&X.toLowerCase()!=="index"?X:Vmt(q.path)}function Vmt(q){const X=n6(q);if(X.length===0)return String(q||"");const te=X[X.length-1];return te.toLowerCase()==="index"&&X.length>1?X.slice(-2).join("/"):te}function Wmt(q,X){const te=n6(q);for(let de=1;de<=te.length;de+=1){const Me=te.slice(-de).join("/");if(X.every(function(We){return We===q||n6(We).slice(-de).join("/")!==Me}))return Me}return te.join("/")||String(q||"")}function n6(q){return String(q||"").replace(/\.md$/i,"").split("/").filter(Boolean)}function t2e(q,X){const te=r2e(q,X);return te.length>22?te.slice(0,21)+"...":te}function r2e(q,X){return X[q.path]||e2e(q)}function Umt(q,X){const te=Object.create(null);return q.forEach(function(de){de&&typeof de[X]=="string"&&(te[de[X]]=de)}),te}function Hmt(q){const X=Object.create(null);return q.forEach(function(te){te&&typeof te.htmlPath=="string"&&typeof te.path=="string"&&n2e(te.htmlPath).forEach(function(de){X[de]===void 0&&(X[de]=te.path)})}),X}function i6(){return $.length>0}function a6(q){const X=String(q).lastIndexOf(".");return X<0?Fh(q+"/index.html"):Fh(q.slice(0,X)+".html")}function n2e(q){const X=Fh(q),te=[];if(lw(te,X),/\.html$/i.test(X)){const de=X.slice(0,-5);lw(te,de),/\/index\.html$/i.test(X)?lw(te,X.slice(0,X.length-10)):/^index\.html$/i.test(X)&&lw(te,"")}return te.slice().forEach(function(de){lw(te,de.toLowerCase())}),te}function lw(q,X){const te=Fh(X);q.includes(te)||q.push(te)}function Ymt(q){var Fe;const X=sl()[0]||((Fe=document.querySelector("[data-note-path]"))==null?void 0:Fe.dataset.notePath)||"index.md",te=a6(X),de=a6(q),Me=te.includes("/")?te.slice(0,te.lastIndexOf("/")+1):"";return Xmt(Me,de)}function Xmt(q,X){const te=Fh(q).split("/").filter(Boolean),de=Fh(X).split("/").filter(Boolean);for(;te.length&&de.length&&te[0]===de[0];)te.shift(),de.shift();return te.map(function(){return".."}).concat(de).join("/")||"."}function Fh(q){const X=String(q||"").replace(/\\/g,"/").split("/"),te=[];return X.forEach(function(de){if(!(!de||de===".")){if(de===".."){te.pop();return}te.push(de)}}),te.join("/")}function Kmt(q,X){const te=String(q||"").trim();if(!te||te.startsWith("#"))return null;const de=te.split("#")[0].split("?")[0];if(!de)return X||null;if(!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(de)&&!de.startsWith("/")){const Fe=a6(X||sl()[0]||"index.md"),We=Fe.includes("/")?Fe.slice(0,Fe.lastIndexOf("/")+1):"";return i2e(We+de)}let Me;try{Me=new URL(de,window.location.href)}catch{return null}return Me.origin!==window.location.origin?null:i2e(jmt(Me))}function i2e(q){const X=Fh(q);return P[X]||P[X.toLowerCase()]||null}function jmt(q){var Fe;const X=((Fe=document.querySelector("[data-note-path]"))==null?void 0:Fe.dataset.notePath)||sl()[0]||"index.md";let te=a2e(window.location.pathname),de=a2e(q.pathname);const Me=Zmt(te,X);return Me&&de.toLowerCase().startsWith(Me.toLowerCase())&&(de=de.slice(Me.length)),Fh(de)}function Zmt(q,X){const te=String(q||"").toLowerCase(),de=n2e(a6(X)).filter(Boolean).sort(function(Me,Fe){return Fe.length-Me.length});for(const Me of de){const Fe=["/"+Me,"/"+Me+"/"];for(const We of Fe)if(te.endsWith(We.toLowerCase()))return q.slice(0,q.length-We.length+1)}return q.slice(0,q.lastIndexOf("/")+1)}function a2e(q){try{return decodeURIComponent(q||"")}catch{return q||""}}function Qmt(q){const X=t.dataset.noteRoot||"",te=X.includes("\\")?"\\":"/",de=X.replace(/[\\/]+$/,""),Me=String(q||"").split("/").join(te);return de?de+te+Me:Me}function s2e(q){const X=String(q||"").replace(/\\/g,"/");return(X.startsWith("/")?"/":"")+X.split("/").filter(Boolean).map(encodeURIComponent).join("/")}function Jmt(q){const X=s2e(q);return"file://"+(X.startsWith("/")?"":"/")+X}function e1t(q,X){const te=Qmt(X),de=s2e(te),Me=de.startsWith("/")?de:"/"+de,Fe=Jmt(te);switch(q.id){case"code":return"vscode://file"+Me;case"cursor":return"cursor://file"+Me;case"windsurf":return"windsurf://file"+Me;case"zed":return"zed://file"+Me;case"obsidian":return"obsidian://open?path="+encodeURIComponent(te);case"sublime":return"sublime://open?url="+encodeURIComponent(Fe);case"bbedit":return"bbedit://open?url="+encodeURIComponent(Fe);case"nova":return"nova://open?path="+encodeURIComponent(te);case"intellij":return"idea://open?file="+encodeURIComponent(te);case"webstorm":return"webstorm://open?file="+encodeURIComponent(te);default:return Fe}}function t1t(){var de;const q=[{id:"code",name:"Visual Studio Code",short:"VS",available:!1},{id:"cursor",name:"Cursor",short:"Cu",available:!1},{id:"windsurf",name:"Windsurf",short:"Ws",available:!1},{id:"zed",name:"Zed",short:"Zd",available:!1}],X=(de=window.OpenKnowledgeStaticData)==null?void 0:de.editors;if(Array.isArray(X)&&X.length)return X;const te=document.querySelector("[data-editor-options]");if(!te)return q;try{const Me=JSON.parse(te.textContent||"[]");return Array.isArray(Me)&&Me.length?Me:q}catch{return q}}function r1t(q){return D.find(function(X){return X.id===q})||D[0]}function o2e(q){return q.short||q.name.slice(0,2)}function l2e(q,X){if(q.replaceChildren(),q.dataset.hasIcon=X.icon?"true":"false",!X.icon){q.textContent=o2e(X);return}const te=document.createElement("img");te.className="editor-icon",te.src=X.icon,te.alt="",te.decoding="async",te.draggable=!1,te.addEventListener("error",function(){q.dataset.hasIcon="false",q.replaceChildren(),q.textContent=o2e(X)},{once:!0}),q.append(te)}function s6(q,X){const te=document.createElementNS("http://www.w3.org/2000/svg","svg");if(te.setAttribute("class",X+" control-icon"),te.setAttribute("data-icon",q),te.setAttribute("viewBox","0 0 24 24"),te.setAttribute("aria-hidden","true"),q==="chevron-down"){const Fe=document.createElementNS("http://www.w3.org/2000/svg","path");return Fe.setAttribute("d","m6 9 6 6 6-6"),te.append(Fe),te}if(q==="github"){const Fe=document.createElementNS("http://www.w3.org/2000/svg","path");return Fe.setAttribute("d","M12 .5a12 12 0 0 0-3.79 23.39c.6.11.82-.26.82-.58v-2.17c-3.34.73-4.04-1.42-4.04-1.42-.55-1.39-1.34-1.76-1.34-1.76-1.09-.75.08-.73.08-.73 1.2.08 1.84 1.24 1.84 1.24 1.07 1.83 2.8 1.3 3.49.99.11-.78.42-1.3.76-1.6-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.13-.3-.54-1.52.11-3.18 0 0 1.01-.32 3.3 1.23a11.4 11.4 0 0 1 6 0c2.29-1.55 3.3-1.23 3.3-1.23.65 1.66.24 2.88.12 3.18.77.84 1.23 1.91 1.23 3.22 0 4.61-2.81 5.63-5.48 5.92.43.37.81 1.1.81 2.22v3.29c0 .32.22.69.83.58A12 12 0 0 0 12 .5Z"),te.append(Fe),te}const de=document.createElementNS("http://www.w3.org/2000/svg","path");de.setAttribute("d","M18 6 6 18");const Me=document.createElementNS("http://www.w3.org/2000/svg","path");return Me.setAttribute("d","m6 6 12 12"),te.append(de,Me),te}function c2e(){let q=[];try{q=JSON.parse(window.localStorage.getItem(_)||"[]")}catch{q=[]}Array.isArray(q)||(q=[]);const X=new Set(D.map(function(de){return de.id})),te=q.filter(function(de,Me){return typeof de=="string"&&X.has(de)&&q.indexOf(de)===Me});return D.forEach(function(de){te.includes(de.id)||te.push(de.id)}),te}function n1t(){return c2e().map(r1t).filter(Boolean)}function u2e(q){const X=[q].concat(c2e().filter(function(te){return te!==q}));try{window.localStorage.setItem(_,JSON.stringify(X))}catch{return}}function i1t(){const q=document.createElement("div");q.className="editor-picker",q.dataset.editorPicker="";const X=document.createElement("div");X.className="editor-trigger",X.dataset.editorTrigger="",X.setAttribute("role","group");const te=document.createElement("a");te.className="editor-open",te.href="#",te.dataset.editorOpen="",te.dataset.directLink="true",te.title="Open in editor";const de=document.createElement("span");de.className="editor-mark",de.dataset.editorMark="",de.setAttribute("aria-hidden","true"),de.textContent="--",te.append(de);const Me=document.createElement("button");Me.className="editor-menu-trigger",Me.type="button",Me.dataset.editorMenuTrigger="",Me.setAttribute("aria-haspopup","menu"),Me.setAttribute("aria-expanded","false"),Me.setAttribute("aria-label","Choose editor"),Me.title="Choose editor",Me.append(s6("chevron-down","editor-caret")),X.append(te,Me);const Fe=document.createElement("div");return Fe.className="editor-menu",Fe.dataset.editorMenu="",Fe.hidden=!0,Fe.setAttribute("role","menu"),q.append(X,Fe),q}function a1t(q,X){if(!X)return null;const te=document.createElement("a");return te.className="source-open",te.href=X,te.dataset.sourceOpen="",te.dataset.directLink="true",te.target="_blank",te.rel="noreferrer",te.title="Open on GitHub",te.setAttribute("aria-label","Open "+q+" on GitHub"),te.append(s6("github","source-icon")),te}function GP(q){const X=q.querySelector("[data-editor-trigger]"),te=q.querySelector("[data-editor-open]"),de=q.querySelector("[data-editor-menu-trigger]"),Me=q.querySelector("[data-editor-mark]"),Fe=q.querySelector("[data-editor-menu]"),We=n1t(),ft=We[0],mt=q.closest("[data-note-path]"),Nt=(mt==null?void 0:mt.dataset.notePath)||"";if(!(!X||!te||!de||!Me||!Fe||!ft||!Nt)){if(l2e(Me,ft),X.setAttribute("aria-label","Editor: "+ft.name),te.href=e1t(ft,Nt),te.title="Open "+Nt+" in "+ft.name,te.setAttribute("aria-label","Open "+Nt+" in "+ft.name),de.title="Choose editor",de.setAttribute("aria-label","Choose editor for "+Nt),q.dataset.primaryEditor=ft.id,Fe.replaceChildren(),h2e(Fe,ft,!0),We.length>1){const St=document.createElement("div");St.className="editor-menu-separator",St.setAttribute("role","separator"),Fe.append(St)}We.slice(1).forEach(function(St){h2e(Fe,St,!1)})}}function h2e(q,X,te){const de=document.createElement("button");de.className="editor-menu-item"+(te?" is-selected":""),de.type="button",de.dataset.editorOption=X.id,de.setAttribute("role","menuitemradio"),de.setAttribute("aria-checked",te?"true":"false");const Me=document.createElement("span");Me.className="editor-option-mark",l2e(Me,X);const Fe=document.createElement("span");Fe.className="editor-option-label",Fe.textContent=X.name,de.append(Me,Fe),q.append(de)}function d2e(){document.querySelectorAll("[data-editor-picker]").forEach(GP)}function cw(q,X){const te=q.querySelector("[data-editor-menu-trigger]"),de=q.querySelector("[data-editor-menu]");!te||!de||(X&&(uw(q),GP(q)),de.hidden=!X,te.setAttribute("aria-expanded",X?"true":"false"))}function uw(q){document.querySelectorAll("[data-editor-picker]").forEach(function(X){X!==q&&cw(X,!1)})}function hw(q){!o||!l||(l.hidden=!q,o.setAttribute("aria-expanded",q?"true":"false"))}function s1t(){if(!l)return null;const q=l.querySelector("[data-settings-reset]");if(q)return q;const X=document.createElement("div");X.className="viewer-settings-footer";const te=document.createElement("button");return te.type="button",te.className="viewer-settings-reset",te.dataset.settingsReset="",te.textContent="Reset to defaults",X.append(te),l.append(X),te}function o1t(){if(!s||!o||!l||s.dataset.settingsBound==="true")return;s.dataset.settingsBound="true";let q=j(),X=Be(),te=Ue();ot(q),it(X),Le(te);const de=s1t();de&&de.addEventListener("click",function(){q=pe({preset:W,custom:Z}),X=!0,te=De(J),S=F,re(q),xe(X),qe(te),je(S),ot(q),it(X),Le(te),Se(S)}),o.addEventListener("click",function(Fe){Fe.preventDefault(),Fe.stopPropagation(),hw(l.hidden)}),o.addEventListener("keydown",function(Fe){if(Fe.key!=="ArrowDown"&&Fe.key!=="Enter"&&Fe.key!==" ")return;Fe.preventDefault(),hw(!0);const We=l.querySelector("[data-theme-option].is-selected")||l.querySelector("[data-theme-option]");We&&We.focus()}),l.addEventListener("click",function(Fe){const We=me(Fe.target,"[data-theme-option]");We&&(Fe.preventDefault(),q=pe({preset:We.dataset.themeOption,custom:q.custom}),re(q),ot(q))}),l.addEventListener("keydown",function(Fe){if(Fe.key==="Escape"){Fe.preventDefault(),hw(!1),o.focus();return}if(Fe.key!=="Enter"&&Fe.key!==" ")return;const We=me(Fe.target,"[data-theme-option]");We&&(Fe.preventDefault(),q=pe({preset:We.dataset.themeOption,custom:q.custom}),re(q),ot(q))}),l.querySelectorAll("[data-theme-custom-value]").forEach(function(Fe){Fe.addEventListener("input",function(){const We=Fe.dataset.themeCustomValue;if(!Z[We]||!we(Fe.value))return;const ft=Object.assign({},q.custom);ft[We]=Fe.value.toLowerCase(),q=pe({preset:"custom",custom:ft}),re(q),ot(q)})}),d&&d.addEventListener("change",function(){X=d.checked,xe(X),it(X)});function Me(Fe,We){te=De(Object.assign({},te,{[Fe]:We})),qe(te),Le(te)}f&&f.addEventListener("change",function(){Me("font",f.value)}),p&&p.addEventListener("change",function(){Me("size",p.value)}),g&&g.addEventListener("change",function(){Me("spacing",g.value)}),m&&m.addEventListener("change",function(){Me("motion",m.value)}),y&&y.addEventListener("change",function(){Me("readableLineLength",y.checked)}),v&&v.addEventListener("change",function(){Me("highContrast",v.checked)}),T&&T.addEventListener("change",function(){Me("underlineLinks",T.checked)})}function Eo(){return e.querySelector(".note-panel.is-active-panel")}function l1t(){return me(document.activeElement,"[data-note-path]")}function f2e(){return l1t()||Eo()}function zh(q){!q||!e.contains(q)||(Ne().forEach(function(X){const te=X===q;X.classList.toggle("is-active-panel",te),X.dataset.activePanel=te?"true":"false",te||X.querySelectorAll("[data-editor-picker]").forEach(function(de){cw(de,!1)})}),d0(),Pt(q.dataset.notePath,!1))}function qP(){const q=Ne();q.length&&(Eo()||zh(q[q.length-1]))}function c1t(q){!q||q.dataset.resizeHandlesBound==="true"||(q.dataset.resizeHandlesBound="true",["left","right"].forEach(function(X){const te=document.createElement("button");te.type="button",te.className="note-resize-handle note-resize-handle-"+X,te.dataset.panelResizeHandle=X,te.setAttribute("aria-label","Resize note panel from the "+X),te.title="Resize panel",te.addEventListener("pointerdown",W1t),te.addEventListener("keydown",function(de){V1t(q,X,de)}),q.append(te)}),p2e(q),q.addEventListener("scroll",function(){p2e(q)},{passive:!0}))}function p2e(q){q&&q.style.setProperty("--note-panel-scroll-top",Math.max(0,q.scrollTop||0)+"px")}function u1t(q){if(!q||q.dataset.editorBound==="true")return;q.dataset.editorBound="true",GP(q);const X=q.querySelector("[data-editor-menu-trigger]"),te=q.querySelector("[data-editor-menu]");!X||!te||(X.addEventListener("click",function(de){de.preventDefault(),de.stopPropagation(),cw(q,te.hidden)}),X.addEventListener("keydown",function(de){if(de.key!=="ArrowDown"&&de.key!=="Enter"&&de.key!==" ")return;de.preventDefault(),cw(q,!0);const Me=te.querySelector("[data-editor-option]");Me&&Me.focus()}),te.addEventListener("click",function(de){const Me=me(de.target,"[data-editor-option]");Me&&(de.preventDefault(),de.stopPropagation(),u2e(Me.dataset.editorOption),d2e(),uw())}),te.addEventListener("keydown",function(de){if(de.key==="Escape"){de.preventDefault(),cw(q,!1),X.focus();return}if(de.key!=="Enter"&&de.key!==" ")return;const Me=me(de.target,"[data-editor-option]");Me&&(de.preventDefault(),u2e(Me.dataset.editorOption),d2e(),uw(),X.focus())}))}function sl(){return Ne().map(function(q){return q.dataset.notePath})}function g2e(){const q=new URLSearchParams(window.location.search);return q.get("empty")==="1"?[]:[nr(window.location.href)||sl()[0]||"index.md"].concat(q.getAll("stack").filter(Boolean))}function m2e(){return y2e(window.location.href)}function y2e(q){let X;try{X=new URL(q,window.location.href)}catch{return""}return(X.searchParams.get("ok-highlight")||"").trim()}function v2e(q,X){if(!q.length){const de=new URL(or("index.md"),window.location.href);return de.searchParams.set("empty","1"),de}const te=new URL(or(q[0]||"index.md"),window.location.href);return q.slice(1).forEach(function(de){te.searchParams.append("stack",de)}),X&&te.searchParams.set("ok-highlight",X),te}function Jv(){const q=Ne().length,X=q===0;t.classList.toggle("is-empty",X),t.classList.toggle("is-single-panel",q===1),t.classList.toggle("is-multi-panel",q>1),r&&(r.hidden=!X),Ne().forEach(ct),qP(),h1t(),h6(),o6()}function h1t(){const q=sl();Ne().forEach(function(X,te){const de=X.querySelector("[data-close-panel]");if(!de)return;const Me=q.filter(function(Fe,We){return We!==te});de.href=v2e(Me).href})}function dw(){return Math.max(0,t.scrollWidth-t.clientWidth)}function fw(){return!!(b&&w&&k&&Ne().length>1&&dw()>1&&!t.classList.contains("is-empty"))}function o6(){window.requestAnimationFrame(d1t)}function d1t(){if(!b||!w||!k)return;if(!fw()){b.hidden=!0,b.setAttribute("aria-hidden","true"),k.style.width="",k.style.setProperty("--thumb-x","0px"),k.setAttribute("aria-valuemax","0"),k.setAttribute("aria-valuenow","0");return}b.hidden=!1,b.setAttribute("aria-hidden","false");const q=w.getBoundingClientRect().width;if(q<=0)return;const X=dw(),te=ve(q*(t.clientWidth/t.scrollWidth),44,q),de=Math.max(0,q-te),Me=X>0?t.scrollLeft/X*de:0;k.style.width=te+"px",k.style.setProperty("--thumb-x",ve(Me,0,de)+"px"),k.setAttribute("aria-valuemax",String(Math.round(X))),k.setAttribute("aria-valuenow",String(Math.round(t.scrollLeft)))}function VP(q,X){if(!fw())return;const te=w.getBoundingClientRect(),de=k.getBoundingClientRect(),Me=Math.max(0,te.width-de.width),Fe=dw(),We=ve(q-te.left-X,0,Me);t.scrollLeft=Me>0?We/Me*Fe:0}function d0(){const q=Ne(),X=Eo()||q[q.length-1];if(!X){document.title="Knowledge base - Open Knowledge";return}const te=(X==null?void 0:X.dataset.noteTitle)||(X==null?void 0:X.dataset.notePath)||"Open Knowledge";document.title=te+" - Open Knowledge"}function pw(q,X,te){const de=v2e(q,te),Me={stack:q};window.history.pushState(Me,"",de)}function f1t(){window.clearTimeout(_e),_e=window.setTimeout(function(){b2e(e,!0)},60)}function f0(q,X,te){return q.getPropertyValue(X).trim()||te}function p1t(){const q=window.getComputedStyle(document.documentElement),X=f0(q,"--ok-color-page","#ffffff"),te=f0(q,"--ok-color-surface",X),de=f0(q,"--ok-color-text","#202322"),Me=f0(q,"--ok-color-muted","#707773"),Fe=f0(q,"--ok-color-accent","#0b7a53"),We=f0(q,"--ok-color-border","#e3e6e4");return{startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,logLevel:"fatal",theme:"base",themeVariables:{background:X,primaryColor:te,primaryTextColor:de,primaryBorderColor:We,lineColor:Me,secondaryColor:X,secondaryTextColor:de,secondaryBorderColor:We,tertiaryColor:te,tertiaryTextColor:de,tertiaryBorderColor:We,mainBkg:te,nodeBorder:Fe,clusterBkg:X,clusterBorder:We,titleColor:de,edgeLabelBackground:te,textColor:de,fontFamily:f0(q,"--ok-font-body","sans-serif")},flowchart:{htmlLabels:!1}}}function g1t(q){var te,de;const X=[];return(te=q==null?void 0:q.matches)!=null&&te.call(q,"[data-mermaid-source]")&&X.push(q),(de=q==null?void 0:q.querySelectorAll)==null||de.call(q,"[data-mermaid-source]").forEach(function(Me){X.push(Me)}),X}function m1t(q){var Fe;const X=me(q,"[data-mermaid-diagram]");if(X)return X;const te=document.createElement("figure");te.className="ok-mermaid",te.dataset.mermaidDiagram="";const de=document.createElement("div");de.className="ok-mermaid-output",de.dataset.mermaidOutput="",de.setAttribute("role","img"),de.setAttribute("aria-label","Mermaid diagram"),de.hidden=!0;const Me=document.createElement("p");return Me.className="ok-mermaid-error",Me.dataset.mermaidError="",Me.setAttribute("role","status"),Me.textContent="This Mermaid diagram could not be rendered. Its source is shown below.",Me.hidden=!0,q.parentNode.insertBefore(te,q),te.append(de,Me,q),te._openKnowledgeMermaidSource=String(((Fe=q.querySelector("code"))==null?void 0:Fe.textContent)||q.textContent||""),te}function b2e(q,X){if(!window.mermaid||typeof window.mermaid.render!="function")return;const te=g1t(q).map(m1t).filter(function(Me){const Fe=Me.dataset.mermaidState||"";return X||Fe!=="queued"&&Fe!=="rendering"&&Fe!=="rendered"});if(!te.length)return;const de=++fe;te.forEach(function(Me){Me.dataset.mermaidState="queued",Me._openKnowledgeMermaidRequest=de}),ne=ne.catch(function(){}).then(function(){return y1t(te,de)})}async function y1t(q,X){try{window.mermaid.initialize(p1t())}catch{q.forEach(function(te){const de=te.querySelector("[data-mermaid-source]"),Me=te.querySelector("[data-mermaid-output]"),Fe=te.querySelector("[data-mermaid-error]");te._openKnowledgeMermaidRequest!==X||!de||!Me||!Fe||(Me.hidden=!0,de.hidden=!1,Fe.hidden=!1,te.dataset.mermaidState="error")});return}for(const te of q){if(te._openKnowledgeMermaidRequest!==X)continue;const de=te.querySelector("[data-mermaid-source]"),Me=te.querySelector("[data-mermaid-output]"),Fe=te.querySelector("[data-mermaid-error]");if(!(!de||!Me||!Fe)){te.dataset.mermaidState="rendering",Me.setAttribute("aria-busy","true");try{const We=await window.mermaid.render("ok-mermaid-"+ ++ue,te._openKnowledgeMermaidSource);if(te._openKnowledgeMermaidRequest!==X)continue;Me.innerHTML=We.svg,typeof We.bindFunctions=="function"&&We.bindFunctions(Me),Me.hidden=!1,de.hidden=!0,Fe.hidden=!0,te.dataset.mermaidState="rendered"}catch{if(te._openKnowledgeMermaidRequest!==X)continue;te.dataset.mermaidRendered!=="true"&&(Me.hidden=!0,de.hidden=!1,Fe.hidden=!1),te.dataset.mermaidState="error"}finally{Me.removeAttribute("aria-busy")}te.dataset.mermaidState==="rendered"&&(te.dataset.mermaidRendered="true")}}}function v1t(q){q.querySelectorAll("table").forEach(function(X){var Zt,sr,zt;if(X.dataset.okTableEnhanced==="true")return;const te=(sr=(Zt=X.tHead)==null?void 0:Zt.rows)==null?void 0:sr[0],de=(zt=X.tBodies)==null?void 0:zt[0];if(!te||!de)return;const Me=Array.prototype.slice.call(te.cells),Fe=Array.prototype.slice.call(de.rows);if(!Me.length||!Fe.length)return;X.classList.add("ok-table"),X.dataset.okTable="",X.dataset.okTableEnhanced="true",Fe.forEach(function(Ut,er){Ut.dataset.okTableOriginalIndex=String(er)});const We=b1t(X),ft={query:"",filters:Me.map(function(){return""}),sortColumn:-1,sortDirection:"asc"},mt=document.createElement("span");mt.className="ok-table-count",mt.dataset.okTableCount="";function Nt(){let Ut=0;Fe.forEach(function(er){const Ar=!ft.query||g0(er.textContent).includes(ft.query),yn=ft.filters.every(function(xi,ll){return!xi||g0(p0(er.cells[ll]))===xi}),xn=Ar&&yn;er.hidden=!xn,xn&&(Ut+=1)}),mt.textContent=Ut===Fe.length?w2e(Fe.length):Ut+" / "+w2e(Fe.length)}Me.forEach(function(Ut,er){T1t(Ut,de,Me,Fe,ft,er)});const St=x1t(Me,Fe,ft,mt,Nt);We.insertBefore(St,We.firstChild),Nt()})}function b1t(q){let X=me(q,"[data-ok-table-wrap]");if(!X){X=document.createElement("div"),X.className="ok-table-wrap",X.dataset.okTableWrap="";const te=document.createElement("div");return te.className="ok-table-scroller",q.parentNode.insertBefore(X,q),X.append(te),te.append(q),X}if(!me(q,".ok-table-scroller")){const te=document.createElement("div");te.className="ok-table-scroller",q.parentNode.insertBefore(te,q),te.append(q)}return X}function x1t(q,X,te,de,Me){const Fe=document.createElement("div");Fe.className="ok-table-tools",Fe.dataset.okTableControls="";const We=document.createElement("input");We.className="ok-table-search",We.type="search",We.placeholder="Filter table",We.setAttribute("aria-label","Filter table rows"),We.addEventListener("input",function(){te.query=g0(We.value),Me()}),Fe.append(We);const ft=document.createElement("div");ft.className="ok-table-filter-list";const mt=[];let Nt,St;function Zt(){const sr=te.filters.filter(Boolean).length;Nt&&(Nt.textContent=sr?"Filters ("+sr+")":"Filters"),St&&(St.disabled=sr===0)}if(q.forEach(function(sr,zt){const Ut=C1t(X,zt);if(Ut.length<2||Ut.length>30)return;const er=document.createElement("select"),Ar=p0(sr)||"Column "+(zt+1);er.setAttribute("aria-label","Filter by "+Ar);const yn=document.createElement("option");yn.value="",yn.textContent=Ar+": All",er.append(yn),Ut.forEach(function(xn){const xi=document.createElement("option");xi.value=g0(xn),xi.textContent=xn,er.append(xi)}),er.addEventListener("change",function(){te.filters[zt]=er.value,Zt(),Me()}),mt.push(er),ft.append(er)}),ft.children.length){const sr=document.createElement("details");sr.className="ok-table-filter-menu";const zt=document.createElement("summary");zt.className="ok-table-filter-trigger",zt.setAttribute("role","button"),zt.setAttribute("aria-label","Table filters"),Nt=document.createElement("span"),Nt.textContent="Filters",zt.append(Nt);const Ut=document.createElement("div");Ut.className="ok-table-filter-panel",St=document.createElement("button"),St.className="ok-table-clear",St.type="button",St.textContent="Clear filters",St.addEventListener("click",function(){te.filters=te.filters.map(function(){return""}),mt.forEach(function(er){er.value=""}),Zt(),Me(),mt[0]&&mt[0].focus()}),Ut.append(ft,St),sr.append(zt,Ut),sr.addEventListener("keydown",function(er){er.key==="Escape"&&(sr.open=!1,zt.focus())}),Fe.append(sr),Zt()}return Fe.append(de),Fe}function T1t(q,X,te,de,Me,Fe){if(q.dataset.okTableSort="",q.tabIndex=0,q.setAttribute("aria-label","Sort by "+(p0(q)||"column "+(Fe+1))),!q.querySelector(".ok-table-sort-indicator")){const ft=document.createElement("span");ft.className="ok-table-sort-indicator",ft.setAttribute("aria-hidden","true"),q.append(ft)}function We(ft){ft&&me(ft.target,"a[href], button, input, textarea, select, [contenteditable='true']")||w1t(X,te,de,Me,Fe)}q.addEventListener("click",We),q.addEventListener("keydown",function(ft){ft.key!=="Enter"&&ft.key!==" "||(ft.preventDefault(),We(ft))})}function w1t(q,X,te,de,Me){const Fe=de.sortColumn===Me&&de.sortDirection==="asc"?"desc":"asc";de.sortColumn=Me,de.sortDirection=Fe,X.forEach(function(ft){ft.removeAttribute("aria-sort"),ft.removeAttribute("data-sort-direction")}),X[Me].setAttribute("aria-sort",Fe==="asc"?"ascending":"descending"),X[Me].dataset.sortDirection=Fe;const We=Fe==="asc"?1:-1;te.sort(function(ft,mt){const Nt=x2e(p0(ft.cells[Me]),p0(mt.cells[Me]));return Nt!==0?Nt*We:Number(ft.dataset.okTableOriginalIndex||0)-Number(mt.dataset.okTableOriginalIndex||0)}),te.forEach(function(ft){q.append(ft)})}function C1t(q,X){const te=new Set,de=[];return q.forEach(function(Me){const Fe=p0(Me.cells[X]),We=g0(Fe);!We||te.has(We)||Fe.length>80||(te.add(We),de.push(Fe))}),de.sort(function(Me,Fe){return x2e(Me,Fe)})}function x2e(q,X){const te=g0(q),de=g0(X);if(!te&&de)return 1;if(te&&!de)return-1;const Me=T2e(te),Fe=T2e(de);return Me!==null&&Fe!==null&&Me!==Fe?Me-Fe:te.localeCompare(de,void 0,{numeric:!0,sensitivity:"base"})}function T2e(q){const X=String(q||"").replace(/,/g,"");return/^[+-]?\d+(?:\.\d+)?%?$/.test(X)?Number(X.replace(/%$/,"")):null}function p0(q){return String((q==null?void 0:q.textContent)||"").replace(/\s+/g," ").trim()}function g0(q){return p0({textContent:String(q||"")}).toLocaleLowerCase()}function w2e(q){return q+(q===1?" row":" rows")}function e2(){var X;const q=Ne();q.forEach(function(te){te.querySelectorAll(".note-body a.is-active-note").forEach(function(de){de.classList.remove("is-active-note"),de.removeAttribute("aria-current")})}),q.forEach(function(te,de){var Fe;const Me=(Fe=q[de+1])==null?void 0:Fe.dataset.notePath;Me&&te.querySelectorAll(".note-body a[href]").forEach(function(We){nr(We.getAttribute("href")||We.href,te.dataset.notePath)===Me&&(We.classList.add("is-active-note"),We.setAttribute("aria-current","true"))})}),Pt(((X=Eo()||q[q.length-1])==null?void 0:X.dataset.notePath)||"",!1)}function l6(q){zh(q),window.requestAnimationFrame(function(){q.scrollIntoView({block:"nearest",inline:"end",behavior:Ie()?"auto":"smooth"}),q.focus({preventScroll:!0})})}function WP(q){(q||document).querySelectorAll("mark.ok-search-highlight").forEach(function(te){const de=te.parentNode;de&&(te.replaceWith.apply(te,Array.prototype.slice.call(te.childNodes)),de.normalize())})}function t2(q,X){WP(e);const te=String(X||"").trim(),de=q==null?void 0:q.querySelector(".note-body");!de||!te||window.requestAnimationFrame(function(){const Me=k1t(de,te);if(!Me)return;const Fe=document.createElement("mark");Fe.className="ok-search-highlight",Fe.dataset.searchHighlight="",Fe.append(Me.extractContents()),Me.insertNode(Fe),Fe.scrollIntoView({block:"center",inline:"nearest",behavior:Ie()?"auto":"smooth"}),q.focus({preventScroll:!0})})}function k1t(q,X){const te=S1t(X);if(!te)return null;const de=E1t(q),Me=de.text.indexOf(te);if(Me<0)return null;let Fe=Me,We=Me+te.length;for(;FeFe&&de.text[We-1]===" ";)We--;const ft=de.positions[Fe],mt=de.positions[We-1];if(!ft||!mt)return null;const Nt=document.createRange();return Nt.setStart(ft.node,ft.start),Nt.setEnd(mt.node,mt.end),Nt}function E1t(q){const X=document.createTreeWalker(q,NodeFilter.SHOW_TEXT),te=[],de=[];let Me=!0,Fe;for(;Fe=X.nextNode();){if(me(Fe.parentElement,"[hidden], [aria-hidden='true']"))continue;const We=Fe.nodeValue||"";for(let ft=0;ft1&&!t.classList.contains("is-empty")}function HP(){return mw&&I2e()}function h6(){t.classList.toggle("is-space-panning",HP())}function B1t(q){!L2e(q)||q.defaultPrevented||q.metaKey||q.ctrlKey||q.shiftKey||q.altKey||P1t(q.target)||I2e()&&(mw=!0,h6(),q.preventDefault())}function F1t(q){!L2e(q)||!mw||(mw=!1,h6(),q.preventDefault())}function z1t(){mw=!1,h6()}function D2e(){r2=Date.now()+350,window.setTimeout(function(){Date.now()>=r2&&(r2=0)},360)}function G1t(q){return!r2||Date.now()>r2?!1:(r2=0,q.preventDefault(),q.stopPropagation(),!0)}function M2e(q){return q.getBoundingClientRect().width||et(q)||wt()}function N2e(q,X){const te=ye(X,q);return!te||!q?null:(q.style.setProperty("--note-panel-width",te+"px"),q.dataset.panelWidth=String(te),q.dataset.notePath&&(I[q.dataset.notePath]=te),o6(),te)}function q1t(q,X,te){return(q==="left"?-X:X)*(te?2:1)}function V1t(q,X,te){const de=(te.key||"").toLowerCase(),Me=M2e(q),Fe=te.shiftKey?64:24;let We=Me;if(de==="arrowleft")We+=X==="left"?Fe:-Fe;else if(de==="arrowright")We+=X==="right"?Fe:-Fe;else if(de==="home")We=oe();else if(de==="end")We=ut(q);else return;te.preventDefault(),te.stopPropagation();const ft=N2e(q,We);ft&&(X==="left"&&!dt(q)&&(t.scrollLeft+=ft-Me),Te())}function W1t(q){const X=me(q.target,"[data-panel-resize-handle]"),te=X==null?void 0:X.closest("[data-note-path]");if(!(!X||!te||q.button!==0)){Mi={pointerId:q.pointerId,panel:te,handle:X,edge:X.dataset.panelResizeHandle==="left"?"left":"right",centered:dt(te),startX:q.clientX,startWidth:M2e(te),startScrollLeft:t.scrollLeft,moved:!1},zh(te),te.classList.add("is-panel-resizing"),document.body.classList.add("is-panel-resizing"),window.addEventListener("pointermove",O2e),window.addEventListener("pointerup",d6),window.addEventListener("pointercancel",d6),window.addEventListener("blur",P2e),q.preventDefault(),q.stopPropagation();try{X.setPointerCapture(q.pointerId)}catch{}}}function O2e(q){if(!Mi||q.pointerId!==Mi.pointerId)return;const X=q.clientX-Mi.startX;Math.abs(X)>2&&(Mi.moved=!0);const te=Mi.startWidth+q1t(Mi.edge,X,Mi.centered),de=N2e(Mi.panel,te);de&&(Mi.edge==="left"&&!Mi.centered&&(t.scrollLeft=Mi.startScrollLeft+(de-Mi.startWidth)),q.preventDefault())}function $2e(q){if(!Mi)return;const X=Mi.moved;Mi.panel.classList.remove("is-panel-resizing");try{q!==void 0&&Mi.handle.releasePointerCapture(q)}catch{}Mi=null,document.body.classList.remove("is-panel-resizing"),window.removeEventListener("pointermove",O2e),window.removeEventListener("pointerup",d6),window.removeEventListener("pointercancel",d6),window.removeEventListener("blur",P2e),X&&(Te(),D2e())}function d6(q){!Mi||q.pointerId!==Mi.pointerId||$2e(q.pointerId)}function P2e(){$2e()}function U1t(q){return(q.pointerType||"mouse")!=="mouse"||!R2e.matches||q.button!==0||Ne().length<2||q.defaultPrevented||q.metaKey||q.ctrlKey||q.shiftKey||q.altKey?!1:HP()?!$1t(q.target):!me(q.target,"[data-note-path], a, button, input, textarea, select, [contenteditable='true'], [role='button']")}function H1t(q){if(!U1t(q))return;const X=HP();ol={pointerId:q.pointerId,startX:q.clientX,startScrollLeft:t.scrollLeft,moved:!1,fromSpacePan:X},t.classList.add("is-drag-scrolling"),X&&q.preventDefault();try{t.setPointerCapture(q.pointerId)}catch{}}function Y1t(q){if(!ol||q.pointerId!==ol.pointerId)return;const X=q.clientX-ol.startX;Math.abs(X)<3&&!ol.moved||(ol.moved=!0,t.scrollLeft=ol.startScrollLeft-X,q.preventDefault())}function B2e(q){if(!ol||q.pointerId!==ol.pointerId)return;const X=ol;try{t.releasePointerCapture(q.pointerId)}catch{}(X.moved||X.fromSpacePan)&&D2e(),ol=null,t.classList.remove("is-drag-scrolling")}function X1t(q){if(!fw()||q.button!==0)return;const X=k.getBoundingClientRect();oc={pointerId:q.pointerId,thumbOffset:ve(q.clientX-X.left,0,X.width)},b.classList.add("is-rail-dragging"),window.addEventListener("pointermove",YP),window.addEventListener("pointerup",n2),window.addEventListener("pointercancel",n2),window.addEventListener("blur",z2e),VP(q.clientX,oc.thumbOffset),q.preventDefault();try{k.setPointerCapture(q.pointerId)}catch{}}function K1t(q){if(!fw()||q.button!==0||me(q.target,"[data-workspace-scroll-thumb]"))return;const X=k.getBoundingClientRect();VP(q.clientX,X.width/2),q.preventDefault()}function YP(q){!oc||q.pointerId!==oc.pointerId||(VP(q.clientX,oc.thumbOffset),q.preventDefault())}function F2e(q){const X=q??oc.pointerId;try{k.releasePointerCapture(X)}catch{}oc=null,b.classList.remove("is-rail-dragging"),window.removeEventListener("pointermove",YP),window.removeEventListener("pointerup",n2),window.removeEventListener("pointercancel",n2),window.removeEventListener("blur",z2e)}function n2(q){!oc||q.pointerId!==oc.pointerId||F2e(q.pointerId)}function z2e(){oc&&F2e()}function j1t(q){if(!fw())return;const X=Math.max(48,t.clientWidth*.12),te=Math.max(120,t.clientWidth*.72);let de=t.scrollLeft;const Me=(q.key||"").toLowerCase();if(Me==="arrowleft")de-=X;else if(Me==="arrowright")de+=X;else if(Me==="pageup")de-=te;else if(Me==="pagedown")de+=te;else if(Me==="home")de=0;else if(Me==="end")de=dw();else return;q.preventDefault(),t.scrollLeft=ve(de,0,dw())}if(t.addEventListener("pointerdown",H1t),t.addEventListener("pointermove",Y1t),t.addEventListener("pointerup",B2e),t.addEventListener("pointercancel",B2e),t.addEventListener("scroll",o6),window.addEventListener("keydown",B1t,!0),window.addEventListener("keyup",F1t,!0),window.addEventListener("blur",z1t),window.addEventListener("resize",o6),w&&k&&(w.addEventListener("pointerdown",K1t),k.addEventListener("pointerdown",X1t),k.addEventListener("pointermove",YP),k.addEventListener("pointerup",n2),k.addEventListener("pointercancel",n2),k.addEventListener("keydown",j1t)),t.addEventListener("click",function(q){if(G1t(q))return;const X=me(q.target,"[data-note-path]");X&&zh(X);const te=me(q.target,"[data-close-panel]");if(te){const mt=te.closest("[data-note-path]");if(!mt)return;q.preventDefault(),u6(mt);return}const de=me(q.target,"[data-tree-path]"),Me=me(q.target,"[data-graph-path]");if(de||Me){if(q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;q.preventDefault(),m0((de==null?void 0:de.dataset.treePath)||Me.dataset.graphPath,!0,H(q.shiftKey),"",Eo());return}const Fe=me(q.target,"a[href]");if(!Fe||Fe.dataset.directLink==="true"||q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;const We=Fe.closest("[data-note-path]");if(!We)return;const ft=nr(Fe.getAttribute("href")||Fe.href,We.dataset.notePath);ft&&(q.preventDefault(),m0(ft,!0,H(q.shiftKey),"",We))}),t.addEventListener("keydown",function(q){if(q.key!=="Enter"||!q.shiftKey||q.metaKey||q.ctrlKey||q.altKey)return;const X=me(q.target,".note-body a[href]"),te=X==null?void 0:X.closest("[data-note-path]");if(!X||!te)return;const de=nr(X.getAttribute("href")||X.href,te.dataset.notePath);de&&(q.preventDefault(),m0(de,!0,H(!0),"",te))}),t.addEventListener("focusin",function(q){const X=me(q.target,"[data-note-path]");X&&zh(X)}),window.OpenKnowledgeShortcuts&&window.OpenKnowledgeShortcuts.register(Ae),i){const q={id:"viewer.sidebar.toggle",code:"KeyS",metaOrCtrlKey:!0,altKey:!0,label:"⌘⌥S",ariaKeyShortcut:"Meta+Alt+S",run:Ft},X=window.OpenKnowledgeShortcuts;if(i.addEventListener("click",Ft),X){X.register(q);const te=X.format(q);i.title="File explorer ("+te+")",i.setAttribute("aria-keyshortcuts",X.ariaKeyShortcut(q)),document.querySelectorAll("[data-sidebar-shortcut]").forEach(function(de){de.textContent=te})}}a&&a.addEventListener("click",function(){_t(!1),i==null||i.focus()}),n&&n.addEventListener("click",function(q){const X=me(q.target,"[data-tree-path]"),te=X||me(q.target,"a[href]");if(!te||q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;const de=(X==null?void 0:X.dataset.treePath)||nr(te.getAttribute("href")||te.href);de&&(q.preventDefault(),G2e(te),m0(de,!0,H(q.shiftKey),"",Eo()),C.matches&&_t(!1))});function G2e(q){const X=me(q,".search");if(!X)return;const te=X.querySelector(".search-input"),de=X.querySelector(".search-results"),Me=X.querySelector(".search-status");te&&(te.value=""),Me&&(Me.textContent=""),de&&(de.hidden=!0,de.replaceChildren())}window.addEventListener("popstate",function(){const q=g2e();_2e(q,m2e())}),document.addEventListener("click",function(q){const X=me(q.target,".search-result[href]");if(X){if(q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;const te=nr(X.getAttribute("href")||X.href);if(te){q.preventDefault();const de=q.shiftKey||X.dataset.openBeside==="true",Me=H(de);delete X.dataset.openBeside,G2e(X),m0(te,!0,Me,y2e(X.getAttribute("href")||X.href),Eo());return}}me(q.target,"[data-editor-picker]")||uw(),me(q.target,"[data-viewer-settings]")||hw(!1)}),document.addEventListener("keydown",function(q){q.key==="Escape"&&(uw(),hw(!1),_t(!1))});const yw=g2e(),q2e=m2e();he(),o1t(),ps(),Ln(),Ne().forEach(S2e),qP(),yw.length!==1||yw[0]!==((V2e=Ne()[0])==null?void 0:V2e.dataset.notePath)?(window.history.replaceState({stack:yw},"",window.location.href),_2e(yw,q2e)):(window.history.replaceState({stack:yw},"",window.location.href),Jv(),e2(),d0(),t2(Eo(),q2e))})(),(()=>{const t=Array.from(document.querySelectorAll(".search"));if(t.length===0)return;const e=w(),r=document.querySelector("[data-primary-search]")||t[0],n=r==null?void 0:r.querySelector(".search-input"),i=window.OpenKnowledgeShortcuts,a={id:"viewer.search.focus",key:"k",metaOrCtrlKey:!0,label:"⌘K",allowEditable:!0,run:()=>{n==null||n.focus(),n==null||n.select()}};t.forEach(s),i?(i.register(a),document.querySelectorAll("[data-search-shortcut]").forEach(S=>{S.textContent=i.format(a)})):document.addEventListener("keydown",S=>{(S.metaKey||S.ctrlKey)&&!S.altKey&&S.key.toLowerCase()==="k"&&(S.preventDefault(),n==null||n.focus(),n==null||n.select())});function s(S){const R=S.querySelector(".search-input"),N=S.querySelector(".search-results"),D=S.querySelector(".search-status");if(!R||!N||!D)return;const I=S.dataset.searchUrl||"/api/search";let $=0,B=null,P=-1,G=0,V="";m(R,N),K(!1),S===r&&(V=o(),V&&(R.value=V,window.requestAnimationFrame(()=>{R.focus(),R.select(),W(V)}))),R.addEventListener("input",()=>{if(V="",l(),window.clearTimeout($),J(-1,!1),!R.value.trim()){ie(!0);return}$=window.setTimeout(Y,140)}),R.addEventListener("focus",()=>{if(!R.value.trim()){ie(!0);return}y(N).length>0?se(!0):Y()}),R.addEventListener("keydown",Z=>{const ee=y(N);if(Z.key==="ArrowDown"||Z.key==="ArrowUp"){if(!ee.length)return;Z.preventDefault();const ne=Z.key==="ArrowDown"?1:-1,ue=P<0?ne>0?0:ee.length-1:(P+ne+ee.length)%ee.length;J(ue,!0),se(!0);return}if(Z.key==="Enter"){const ne=v(N,P);if(!ne)return;Z.preventDefault(),ne.dataset.openBeside=Z.shiftKey?"true":"false",ne.click(),K(!0);return}Z.key==="Escape"&&(!N.hidden||R.value)&&(Z.preventDefault(),K(!0))}),N.addEventListener("mousemove",Z=>{const ee=T(Z.target);if(!ee)return;const ne=y(N).indexOf(ee);ne>=0&&J(ne,!1)}),N.addEventListener("focusin",Z=>{const ee=T(Z.target);if(!ee)return;const ne=y(N).indexOf(ee);ne>=0&&J(ne,!1)}),N.addEventListener("click",Z=>{!T(Z.target)||b(Z)||K(!0)}),document.addEventListener("pointerdown",Z=>{!N.hidden&&!S.contains(Z.target)&&K(!0)}),document.addEventListener("focusin",Z=>{!N.hidden&&!S.contains(Z.target)&&K(!0)});async function Y(){const Z=R.value.trim();if(!Z){ie(document.activeElement===R);return}const ee=++G;if(J(-1,!1),e.length>0){u(N,D,k(Z),Z,se,J);return}B&&B.abort(),B=new AbortController,D.textContent="Searching...";try{const ne=await fetch(I+"?q="+encodeURIComponent(Z)+"&limit=12",{signal:B.signal});if(!ne.ok)throw new Error("search request failed");const ue=await ne.json();if(ee!==G||R.value.trim()!==Z)return;u(N,D,ue.results||[],Z,se,J)}catch(ne){if(ne.name==="AbortError")return;D.textContent="Search failed.",J(-1,!1),se(!1)}}async function W(Z){var _e;const ee=String(Z||"").trim();if(!ee)return;const ne=++G,ue=((_e=document.querySelector("[data-note-path]"))==null?void 0:_e.dataset.notePath)||"";if(J(-1,!1),e.length>0){const Ae=A(ee,ue);u(N,D,Ae,ee,se,J,{emptyStatus:'No other notes tagged "'+ee+'".',keepOpenWhenEmpty:!0,statusText:Ae.length+" note"+(Ae.length===1?"":"s")+' tagged "'+ee+'"'});return}B&&B.abort(),B=new AbortController,D.textContent="Finding tagged notes...";const fe=new URLSearchParams({tag:ee,limit:"30"});ue&&fe.set("exclude",ue);try{const Ae=await fetch(I+"?"+fe.toString(),{signal:B.signal});if(!Ae.ok)throw new Error("tag search request failed");const Ne=await Ae.json();if(ne!==G||V!==ee)return;const me=Ne.results||[];u(N,D,me,ee,se,J,{emptyStatus:'No other notes tagged "'+ee+'".',keepOpenWhenEmpty:!0,statusText:me.length+" note"+(me.length===1?"":"s")+' tagged "'+ee+'"'})}catch(Ae){if(Ae.name==="AbortError")return;D.textContent="Tag lookup failed.",J(-1,!1),se(!1)}}function ie(Z){G+=1,window.clearTimeout($),B&&(B.abort(),B=null);const ee=p();D.textContent=ee.length?"Top files":"",u(N,D,ee,"",se,J,{emptyStatus:"",keepOpenWhenEmpty:Z,statusText:ee.length?"Top files":""}),se(Z&&ee.length>0)}function K(Z){G+=1,window.clearTimeout($),B&&(B.abort(),B=null),Z&&(R.value="",V="",l()),D.textContent="",N.replaceChildren(),J(-1,!1),se(!1)}function se(Z){N.hidden=!Z,R.setAttribute("aria-expanded",Z?"true":"false"),Z||R.removeAttribute("aria-activedescendant")}function J(Z,ee){const ne=y(N);P=ne.length?(Z+ne.length)%ne.length:-1,ne.forEach((ue,fe)=>{const _e=fe===P;ue.classList.toggle("is-active",_e),ue.setAttribute("aria-selected",_e?"true":"false"),_e&&(R.setAttribute("aria-activedescendant",ue.id),ee&&ue.scrollIntoView({block:"nearest"}))}),P<0&&R.removeAttribute("aria-activedescendant")}}function o(){try{return(new URL(window.location.href).searchParams.get("ok-tag")||"").trim()}catch{return""}}function l(){let S;try{S=new URL(window.location.href)}catch{return}S.searchParams.has("ok-tag")&&(S.searchParams.delete("ok-tag"),window.history.replaceState(window.history.state,"",S))}function u(S,R,N,D,I,$,B){const P=B||{},G=h(N);if(S.replaceChildren(),G.length===0){const V=P.emptyStatus??'No results for "'+D+'".';if(R.textContent=V,V){const Y=document.createElement("div");Y.className="search-empty",Y.textContent=V,S.append(Y)}$(-1,!1),I(!!P.keepOpenWhenEmpty);return}R.textContent=P.statusText||G.length+" document"+(G.length===1?"":"s"),I(!0),G.forEach((V,Y)=>{const W=document.createElement("a");W.className="search-result",W.href=V.highlightURL||V.url||O(V.path),W.id=S.id+"-option-"+Y,W.setAttribute("role","option"),W.setAttribute("aria-selected","false"),W.title=d();const ie=document.createElement("span");ie.className="search-result-title-row";const K=document.createElement("span");if(K.className="search-result-title",f(K,V.title||V.path,D),ie.append(K),V.matchCount>1){const J=document.createElement("span");J.className="search-result-count",J.textContent=V.matchCount+" matches",ie.append(J)}W.append(ie);const se=document.createElement("span");if(se.className="search-result-meta",se.textContent=[V.path,V.type,V.matchCount===1?V.heading:""].filter(Boolean).join(" - "),W.append(se),V.snippet){const J=document.createElement("span");J.className="search-result-snippet",f(J,V.snippet,D),W.append(J)}if(V.headings.length>1){const J=document.createElement("span");J.className="search-result-headings",J.textContent=V.headings.slice(0,3).join(" · "),W.append(J)}S.append(W)}),$(0,!1)}function h(S){const R=[],N=new Map;return S.forEach((D,I)=>{const $=D.path||"__result-"+I;let B=N.get($);B||(B=Object.assign({},D,{matchCount:0,headings:[]}),N.set($,B),R.push(B)),B.matchCount+=1,D.heading&&!B.headings.includes(D.heading)&&B.headings.push(D.heading),!B.snippet&&D.snippet&&(B.snippet=D.snippet)}),R}function d(){return document.documentElement.dataset.viewerNavigationMode==="beside"?"Links open beside. Hold Shift to replace the current panel.":"Links open in the current panel. Hold Shift to open beside."}function f(S,R,N){const D=String(R||""),I=String(N||"").trim();if(!I){S.textContent=D;return}const $=D.toLocaleLowerCase(),B=I.toLocaleLowerCase();let P=0,G=$.indexOf(B);for(;G>=0;){G>P&&S.append(document.createTextNode(D.slice(P,G)));const V=document.createElement("mark");V.className="search-result-highlight",V.textContent=D.slice(G,G+I.length),S.append(V),P=G+I.length,G=$.indexOf(B,P)}P=12)break}return R.sort(function($,B){return g($.path)!==g(B.path)?g($.path)?1:-1:0})}function g(S){return String(S||"").split("/").pop().toLowerCase()==="index.md"}function m(S,R){R.id||(R.id=(S.id||"viewer-search")+"-results-"+Math.random().toString(36).slice(2)),R.setAttribute("role","listbox"),S.setAttribute("role","combobox"),S.setAttribute("aria-autocomplete","list"),S.setAttribute("aria-controls",R.id),S.setAttribute("aria-expanded","false")}function y(S){return Array.from(S.querySelectorAll(".search-result[href]"))}function v(S,R){const N=y(S);return N.length?N[R>=0?R:0]||N[0]:null}function T(S){return S?S.closest?S.closest(".search-result[href]"):S.parentElement?S.parentElement.closest(".search-result[href]"):null:null}function b(S){return S.button!==0||S.metaKey||S.ctrlKey||S.shiftKey||S.altKey}function w(){var N;const S=(N=window.OpenKnowledgeStaticData)==null?void 0:N.notes;if(Array.isArray(S))return S;const R=document.querySelector("[data-static-notes]");if(!R)return[];try{const D=JSON.parse(R.textContent||"[]");return Array.isArray(D)?D:[]}catch{return[]}}function k(S){const R=C(S);return e.map(function(N){const D=_(N.body||""),I=_(N.frontmatter||""),$=N.title||N.path||"",B=N.path||"",P=[I,D].filter(Boolean).join(" "),G=C([$,B,P].join(" ")),V=C($).includes(R),Y=C(B).includes(R);if(!G.includes(R))return null;const ie=(V?3:0)+(Y?2:0)+1;return{path:B,title:$,snippet:L(P,S),score:g(B)?ie*.55:ie}}).filter(Boolean).sort(function(N,D){return D.score!==N.score?D.score-N.score:g(N.path)!==g(D.path)?g(N.path)?1:-1:N.path.localeCompare(D.path)}).slice(0,12)}function A(S,R){const N=C(S).trim();return e.filter(function(D){return D.path!==R&&Array.isArray(D.tags)&&D.tags.some(function(I){return C(I).trim()===N})}).map(function(D){return{path:D.path,title:D.title||D.path,url:O(D.path),type:"tagged note"}}).sort(function(D,I){return D.path.localeCompare(I.path)})}function C(S){return String(S||"").toLowerCase()}function _(S){const R=document.createElement("div");return R.innerHTML=S,R.textContent||""}function L(S,R){const N=String(S||"").replace(/\s+/g," ").trim();if(!N)return"";const D=N.toLowerCase().indexOf(String(R||"").toLowerCase()),I=Math.max(0,D<0?0:D-48),$=Math.min(N.length,I+140);return(I>0?"...":"")+N.slice(I,$)+($15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;a+15t.replace(N8e,"-$1").toLowerCase(),$8e={"&":"&",">":">","<":"<",'"':""","'":"'"},P8e=/[&><"']/g,Ia=t=>String(t).replace(P8e,e=>$8e[e]),dC=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?dC(t.body[0]):t:t.type==="font"?dC(t.body):t,B8e=new Set(["mathord","textord","atom"]),Ec=t=>B8e.has(dC(t).type),F8e=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},fC={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function z8e(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function G8e(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return z8e(e)}function q8e(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:G8e(n)}class c7{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r of Object.keys(fC)){var n=fC[r];n&&q8e(this,r,e,n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Dt("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var r=F8e(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class $u{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return Tl[V8e[this.id]]}sub(){return Tl[W8e[this.id]]}fracNum(){return Tl[U8e[this.id]]}fracDen(){return Tl[H8e[this.id]]}cramp(){return Tl[Y8e[this.id]]}text(){return Tl[X8e[this.id]]}isTight(){return this.size>=2}}var u7=0,pC=1,rp=2,Sc=3,cb=4,oo=5,np=6,Ua=7,Tl=[new $u(u7,0,!1),new $u(pC,0,!0),new $u(rp,1,!1),new $u(Sc,1,!0),new $u(cb,2,!1),new $u(oo,2,!0),new $u(np,3,!1),new $u(Ua,3,!0)],V8e=[cb,oo,cb,oo,np,Ua,np,Ua],W8e=[oo,oo,oo,oo,Ua,Ua,Ua,Ua],U8e=[rp,Sc,cb,oo,np,Ua,np,Ua],H8e=[Sc,Sc,oo,oo,Ua,Ua,Ua,Ua],Y8e=[pC,pC,Sc,Sc,oo,oo,Ua,Ua],X8e=[u7,pC,rp,Sc,rp,Sc,rp,Sc],Ir={DISPLAY:Tl[u7],TEXT:Tl[rp],SCRIPT:Tl[cb],SCRIPTSCRIPT:Tl[np]},h7=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function K8e(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var gC=[];h7.forEach(t=>t.blocks.forEach(e=>gC.push(...e)));function sY(t){for(var e=0;e=gC[e]&&t<=gC[e+1])return!0;return!1}var Pi=t=>t+" "+t,ip=80,j8e=function(e,r){return"M95,"+(622+e+r)+` + */window.mermaid=F8e,(function(){var f;if(window.OpenKnowledgeShortcuts)return;const t=[],e=window.navigator&&(window.navigator.platform||((f=window.navigator.userAgentData)==null?void 0:f.platform))||"",r=/\b(Mac|iPhone|iPad|iPod)\b/.test(e);function n(p){return!p||!p.id||typeof p.run!="function"?function(){}:(i(p.id),t.push(Object.assign({preventDefault:!0,allowEditable:!1},p)),function(){i(p.id)})}function i(p){const g=t.findIndex(function(m){return m.id===p});g>=0&&t.splice(g,1)}function a(p){return!!(p&&p.closest&&p.closest("input, textarea, select, [contenteditable='true']"))}function s(p,g){if(g.defaultPrevented||!p.allowEditable&&a(g.target))return!1;if(p.code){if(g.code!==p.code)return!1}else if(String(g.key||"").toLowerCase()!==String(p.key||"").toLowerCase())return!1;return!o(p,g)||g.altKey!==!!p.altKey||g.shiftKey!==!!p.shiftKey?!1:typeof p.when!="function"||p.when(g)}function o(p,g){return p.primaryKey?r?g.metaKey&&!g.ctrlKey:g.ctrlKey&&!g.metaKey:p.metaOrCtrlKey?g.metaKey||g.ctrlKey:g.metaKey===!!p.metaKey&&g.ctrlKey===!!p.ctrlKey}function l(p){for(let g=t.length-1;g>=0;g--){const m=t[g];if(s(m,p)){m.preventDefault!==!1&&p.preventDefault(),m.run(p);return}}}function u(p){const g=p.key||p.code||"",m=String(g).replace(/^Key/,"").replace(/^Digit/,"");return m===" "?"Space":m.length===1?m.toUpperCase():m}function h(p){if(p.label)return p.label;const g=[];return p.primaryKey||p.metaOrCtrlKey?g.push(r?"⌘":"Ctrl"):(p.metaKey&&g.push(r?"⌘":"Meta"),p.ctrlKey&&g.push("Ctrl")),p.altKey&&g.push(r?"⌥":"Alt"),p.shiftKey&&g.push(r?"⇧":"Shift"),g.push(u(p)),r?g.join(""):g.join("+")}function d(p){if(p.ariaKeyShortcut)return p.ariaKeyShortcut;const g=[];return p.primaryKey||p.metaOrCtrlKey?g.push(r?"Meta":"Control"):(p.metaKey&&g.push("Meta"),p.ctrlKey&&g.push("Control")),p.altKey&&g.push("Alt"),p.shiftKey&&g.push("Shift"),g.push(u(p)),g.join("+")}window.OpenKnowledgeShortcuts={register:n,unregister:i,format:h,ariaKeyShortcut:d,isEditableTarget:a,isMacPlatform:r},document.addEventListener("keydown",l)})();function ub(t,e,r){const n=document.createElement("button");return n.type="button",n.textContent=t,n.dataset.okMermaidAction=r,n.setAttribute("aria-label",e),n.setAttribute("title",e),n}function z8e(){const t=document.createElement("dialog");t.className="ok-mermaid-viewport";const e=document.createElement("div");e.className="ok-mermaid-viewport-toolbar",e.setAttribute("role","toolbar"),e.setAttribute("aria-label","Diagram zoom controls");const r=ub("−","Zoom out","zoom-out"),n=ub("+","Zoom in","zoom-in"),i=ub("100%","Show diagram at 100%","actual"),a=ub("Fit","Fit diagram to viewport","fit"),s=ub("Close","Close diagram viewer","close"),o=document.createElement("output");o.className="ok-mermaid-viewport-zoom",o.dataset.okMermaidZoom="",o.setAttribute("aria-label","Diagram zoom"),o.setAttribute("aria-live","polite"),e.append(r,n,i,a,o,s);const l=document.createElement("div");l.className="ok-mermaid-viewport-canvas",l.dataset.okMermaidCanvas="",l.tabIndex=0,l.setAttribute("aria-label","Diagram canvas. Drag to pan.");const u=document.createElement("div");return u.className="ok-mermaid-viewport-stage",l.append(u),t.append(e,l),document.body.append(t),{actual:i,canvas:l,closeButton:s,dialog:t,fitButton:a,stage:u,zoom:o,zoomIn:n,zoomOut:r}}const G8e=.01,q8e=8;let pC;function V8e(t,e){if("okMermaidViewportBound"in t.dataset)return;t.dataset.okMermaidViewportBound="",t.tabIndex=0,t.setAttribute("role","button"),t.setAttribute("aria-label",e),t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-keyshortcuts","Enter Space"),t.setAttribute("title","Open diagram viewer");const r=()=>(pC||(pC=U8e())).open(t,e);t.addEventListener("click",n=>{var i,a;(a=(i=n.target)==null?void 0:i.closest)!=null&&a.call(i,"a")||r()}),t.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" "||n.code==="Space")&&(n.preventDefault(),r())})}function W8e(){pC==null||pC.close()}function U8e(){const{actual:t,canvas:e,closeButton:r,dialog:n,fitButton:i,stage:a,zoom:s,zoomIn:o,zoomOut:l}=z8e(),u={fit:!0,height:1,original:null,pinch:null,pointers:new Map,scale:1,trigger:null,width:1,x:0,y:0};function h(){a.style.width=u.width+"px",a.style.height=u.height+"px",a.style.transform="translate3d("+d7(u.x)+"px, "+d7(u.y)+"px, 0) scale("+d7(u.scale)+")",s.textContent=Math.round(u.scale*100)+"%"}function d(){const x=e.getBoundingClientRect(),b=Math.max(1,x.width-48),w=Math.max(1,x.height-48);u.scale=hY(Math.min(b/u.width,w/u.height)),u.x=(x.width-u.width*u.scale)/2,u.y=(x.height-u.height*u.scale)/2,u.fit=!0,h()}function f(){const x=e.getBoundingClientRect();u.scale=1,u.x=(x.width-u.width)/2,u.y=(x.height-u.height)/2,u.fit=!1,h()}function p(x,b,w){const k=hY(u.scale*x),S=e.getBoundingClientRect(),C=b===void 0?S.width/2:b-S.left,_=w===void 0?S.height/2:w-S.top,L=k/u.scale;u.x=C-(C-u.x)*L,u.y=_-(_-u.y)*L,u.scale=k,u.fit=!1,h()}function g(){if(!u.original)return;u.original.parent.insertBefore(u.original.svg,u.original.next),u.original=null,u.pinch=null,u.pointers.clear(),delete e.dataset.okMermaidPanning;const x=u.trigger;u.trigger=null,x&&x.isConnected!==!1&&x.focus()}function m(){n.open&&n.close()}function y(x,b){const w=x.querySelector("svg");if(!w)return;m();const k=H8e(w);u.width=k.width,u.height=k.height,u.trigger=x,u.original={svg:w,parent:w.parentNode,next:w.nextSibling},n.setAttribute("aria-label",b),a.append(w),n.showModal(),d(),e.focus()}l.addEventListener("click",()=>p(.8)),o.addEventListener("click",()=>p(1.25)),t.addEventListener("click",f),i.addEventListener("click",d),r.addEventListener("click",m),n.addEventListener("close",g),n.addEventListener("cancel",x=>{x.preventDefault(),m()}),n.addEventListener("keydown",x=>{const b=x.key.toLowerCase();if(b==="+"||b==="=")p(1.25);else if(b==="-")p(.8);else if(b==="0")f();else if(b==="f")d();else if(b==="escape")m();else if(b.startsWith("arrow"))u.x+=b==="arrowleft"?-40:b==="arrowright"?40:0,u.y+=b==="arrowup"?-40:b==="arrowdown"?40:0,u.fit=!1,h();else return;x.preventDefault()}),e.addEventListener("wheel",x=>{x.preventDefault(),p(x.deltaY<0?1.1:1/1.1,x.clientX,x.clientY)},{passive:!1}),e.addEventListener("pointerdown",x=>{x.button===0&&(u.pointers.set(x.pointerId,{x:x.clientX,y:x.clientY}),u.pinch=f7(u.pointers),u.fit=!1,e.dataset.okMermaidPanning="",e.setPointerCapture(x.pointerId))}),e.addEventListener("pointermove",x=>{const b=u.pointers.get(x.pointerId);if(b){if(u.pointers.set(x.pointerId,{x:x.clientX,y:x.clientY}),u.pointers.size>1){const w=f7(u.pointers);u.pinch&&w&&u.pinch.distance>0&&(p(w.distance/u.pinch.distance,u.pinch.x,u.pinch.y),u.x+=w.x-u.pinch.x,u.y+=w.y-u.pinch.y),u.pinch=w}else u.x+=x.clientX-b.x,u.y+=x.clientY-b.y;h()}});function v(x){u.pointers.has(x.pointerId)&&(u.pointers.delete(x.pointerId),u.pinch=f7(u.pointers),u.pointers.size||delete e.dataset.okMermaidPanning,(!e.hasPointerCapture||e.hasPointerCapture(x.pointerId))&&e.releasePointerCapture(x.pointerId))}return e.addEventListener("pointerup",v),e.addEventListener("pointercancel",v),window.addEventListener("resize",()=>{n.open&&u.fit&&d()}),{close:m,dialog:n,open:y}}function H8e(t){var n,i,a,s,o;const e=(n=t.viewBox)==null?void 0:n.baseVal,r=t.getBoundingClientRect();return{width:r0(e==null?void 0:e.width)||r0((a=(i=t.width)==null?void 0:i.baseVal)==null?void 0:a.value)||r0(r.width)||1,height:r0(e==null?void 0:e.height)||r0((o=(s=t.height)==null?void 0:s.baseVal)==null?void 0:o.value)||r0(r.height)||1}}function r0(t){const e=Number(t);return Number.isFinite(e)&&e>0?e:0}function hY(t){return Math.min(q8e,Math.max(G8e,t))}function d7(t){return Math.round(t*1e3)/1e3}function f7(t){if(t.size<2)return null;const[e,r]=Array.from(t.values());return{distance:Math.hypot(r.x-e.x,r.y-e.y),x:(e.x+r.x)/2,y:(e.y+r.y)/2}}(function(){var K2e;const t=document.querySelector("[data-note-workspace]"),e=document.querySelector("[data-note-stack]"),r=document.querySelector("[data-empty-state]"),n=document.querySelector("[data-file-sidebar]"),i=document.querySelector("[data-sidebar-toggle]"),a=document.querySelector("[data-sidebar-close]"),s=document.querySelector("[data-viewer-settings]"),o=document.querySelector("[data-viewer-settings-trigger]"),l=document.querySelector("[data-viewer-settings-menu]"),u=document.querySelector("[data-navigation-mode-toggle]"),h=document.querySelector("[data-theme-custom-fields]"),d=document.querySelector("[data-frontmatter-visibility]"),f=document.querySelector("[data-accessibility-font]"),p=document.querySelector("[data-accessibility-size]"),g=document.querySelector("[data-accessibility-spacing]"),m=document.querySelector("[data-accessibility-motion]"),y=document.querySelector("[data-readable-line-length]"),v=document.querySelector("[data-high-contrast]"),x=document.querySelector("[data-underline-links]"),b=document.querySelector("[data-workspace-rail]"),w=document.querySelector("[data-workspace-scroll-track]"),k=document.querySelector("[data-workspace-scroll-thumb]");if(!t||!e)return;const S=window.matchMedia("(prefers-reduced-motion: reduce)"),C=window.matchMedia("(max-width: 680px)"),_="openknowledge.viewer.editorOrder",L="openknowledge.viewer.theme",O="openknowledge.viewer.frontmatter",M="openknowledge.viewer.accessibility",z="openknowledge.viewer.navigationMode",F="beside";let A=F;const R=gn(t.dataset.linkPrefix||""),N="openknowledge.viewer.panelWidths."+Qr(t.dataset.noteRoot||R||window.location.pathname).toString(36),D=p1t(),I=Ge(),$=$r(),B=i1t($,"path"),P=a1t($),G=Pa(),V=Oe(),X=["default","night","paper","ocean","rose","custom"],W="night",ie={system:'Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", sans-serif',readable:"Verdana, Tahoma, Arial, sans-serif",serif:'Iowan Old Style, Baskerville, "Times New Roman", serif',mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},K={small:{value:"14px",scale:"0.9"},default:{value:"15.5px",scale:"1"},large:{value:"18px",scale:"1.16"},"extra-large":{value:"21px",scale:"1.35"}},se={default:{value:"1.62",letterSpacing:"normal"},relaxed:{value:"1.82",letterSpacing:".02em"},spacious:{value:"2.05",letterSpacing:".04em"}},J={font:"system",size:"default",spacing:"default",motion:"system",readableLineLength:!0,highContrast:!1,underlineLinks:!1},Z={page:"#f4f5f4",surface:"#ffffff",text:"#202322",muted:"#707773",accent:"#0b7a53",border:"#e3e6e4"},ee={page:["--ok-color-page","--ok-color-header-bg","--ok-color-viewer-canvas","--ok-color-viewer-header-bg","--ok-color-sidebar","--ok-color-sidebar-header"],surface:["--ok-color-surface","--ok-color-note-chrome-bg","--ok-color-search-input-bg","--ok-color-search-popover-bg","--ok-color-editor-trigger-bg","--ok-color-editor-menu-bg","--ok-color-card-bg","--ok-color-editor-mark-bg"],text:["--ok-color-text","--ok-color-document-text","--ok-color-control-hover-text","--ok-color-editor-mark-text","--ok-color-code-block-bg"],muted:["--ok-color-muted","--ok-color-control-text","--ok-color-close-text","--ok-color-sidebar-text","--ok-color-search-shortcut-text","--ok-color-tree-text","--ok-color-tree-badge-text","--ok-color-note-close-text","--ok-color-editor-trigger-text"],accent:["--ok-color-accent","--ok-color-accent-strong","--ok-color-focus-ring","--ok-color-graph-node-active-border"],border:["--ok-color-border","--ok-color-control-hover-border","--ok-color-close-hover-border","--ok-color-sidebar-border","--ok-color-search-input-border","--ok-color-search-shortcut-border","--ok-color-search-popover-border","--ok-color-card-border","--ok-color-tree-badge-border","--ok-color-note-close-hover-border","--ok-color-editor-trigger-border","--ok-color-editor-trigger-separator","--ok-color-editor-menu-border","--ok-color-editor-menu-separator"]};let ne=Promise.resolve(),ue=0,fe=0,_e=0;const Ae={id:"viewer.panel.close",code:"KeyW",metaOrCtrlKey:!0,altKey:!0,label:"⌘⌥W",ariaKeyShortcut:"Meta+Alt+W",when:function(){return!!b2e()},run:function(){const q=b2e();q&&f6(q)}};function Ne(){return Array.prototype.slice.call(e.querySelectorAll("[data-note-path]"))}function me(q,Y){return q?q.closest?q.closest(Y):q.parentElement?q.parentElement.closest(Y):null:null}function ve(q,Y,te){return Math.min(Math.max(q,Y),te)}function Ge(){const q=Ze(N);return q&&typeof q=="object"&&!Array.isArray(q)?q:{}}function Te(){const q=JSON.stringify(I);try{window.localStorage.setItem(N,q)}catch{}Qe(N,q)}function Ze(q){const Y=[ke(q),Ve(q)];for(const te of Y)if(te)try{return JSON.parse(te)}catch{}return null}function ke(q){try{return window.localStorage.getItem(q)}catch{return null}}function Ve(q){const Y=encodeURIComponent(q)+"=",te=document.cookie?document.cookie.split("; "):[];for(const de of te)if(de.startsWith(Y))try{return decodeURIComponent(de.slice(Y.length))}catch{return null}return null}function Qe(q,Y){try{document.cookie=encodeURIComponent(q)+"="+encodeURIComponent(Y)+"; Max-Age=31536000; Path=/; SameSite=Lax"}catch{}}function nt(q){return q==="beside"||q==="replace"?q:F}function tt(){return nt(Ze(z))}function je(q){const Y=JSON.stringify(nt(q));try{window.localStorage.setItem(z,Y)}catch{}Qe(z,Y)}function Ce(){return A==="beside"?"Links open beside. Hold Shift to replace the current panel.":"Links open in the current panel. Hold Shift to open beside."}function Se(q){A=nt(q),document.documentElement.dataset.viewerNavigationMode=A,u&&(u.dataset.mode=A,u.setAttribute("aria-pressed",A==="beside"?"true":"false"),u.setAttribute("aria-label","Link behavior: "+(A==="beside"?"Open beside":"Open in current panel")),u.title=Ce()),I2e()}function H(q){const Y=A==="beside";return q?!Y:Y}function he(){Se(tt()),!(!u||u.dataset.modeBound==="true")&&(u.dataset.modeBound="true",u.addEventListener("click",function(){const q=A==="beside"?"replace":"beside";je(q),Se(q)}))}function j(){const q=Ze(L);return q&&typeof q=="object"&&!Array.isArray(q)?pe(q):pe({preset:W,custom:Z})}function pe(q){const Y=X.includes(q.preset)?q.preset:W,te=Object.assign({},Z);return Object.keys(Z).forEach(function(de){we(q.custom&&q.custom[de])&&(te[de]=q.custom[de].toLowerCase())}),{preset:Y,custom:te}}function re(q){const Y=pe(q),te=JSON.stringify(Y);try{window.localStorage.setItem(L,te)}catch{}Qe(L,te)}function Fe(){const q=Ze(O);return q&&typeof q=="object"&&!Array.isArray(q)&&typeof q.visible=="boolean"?q.visible:!0}function xe(q){const Y=JSON.stringify({visible:!!q});try{window.localStorage.setItem(O,Y)}catch{}Qe(O,Y)}function Ue(){const q=Ze(M);return q&&typeof q=="object"&&!Array.isArray(q)?Me(q):Me(J)}function Me(q){const Y=q&&typeof q=="object"?q:{};return{font:Object.prototype.hasOwnProperty.call(ie,Y.font)?Y.font:J.font,size:Object.prototype.hasOwnProperty.call(K,Y.size)?Y.size:J.size,spacing:Object.prototype.hasOwnProperty.call(se,Y.spacing)?Y.spacing:J.spacing,motion:["system","reduced","full"].includes(Y.motion)?Y.motion:J.motion,readableLineLength:typeof Y.readableLineLength=="boolean"?Y.readableLineLength:J.readableLineLength,highContrast:typeof Y.highContrast=="boolean"?Y.highContrast:J.highContrast,underlineLinks:typeof Y.underlineLinks=="boolean"?Y.underlineLinks:J.underlineLinks}}function qe(q){const Y=Me(q),te=JSON.stringify(Y);try{window.localStorage.setItem(M,te)}catch{}Qe(M,te)}function Le(q){const Y=Me(q),te=K[Y.size],de=se[Y.spacing];document.documentElement.dataset.viewerFont=Y.font,document.documentElement.dataset.viewerFontSize=Y.size,document.documentElement.dataset.viewerMotion=Y.motion,document.documentElement.dataset.viewerContrast=Y.highContrast?"high":"normal",document.documentElement.dataset.viewerUnderlines=Y.underlineLinks?"on":"off",document.documentElement.style.setProperty("--ok-font-body",ie[Y.font]),document.documentElement.style.setProperty("--ok-document-font-size",te.value),document.documentElement.style.setProperty("--ok-document-scale",te.scale),document.documentElement.style.setProperty("--ok-document-line-height",de.value),document.documentElement.style.setProperty("--ok-document-letter-spacing",de.letterSpacing),document.documentElement.style.setProperty("--ok-note-body-max-width",Y.readableLineLength?"70ch":"none"),document.body.classList.toggle("is-high-contrast",Y.highContrast),document.body.classList.toggle("is-links-underlined",Y.underlineLinks),Xe(Y)}function Xe(q){f&&(f.value=q.font),p&&(p.value=q.size),g&&(g.value=q.spacing),m&&(m.value=q.motion),y&&(y.checked=q.readableLineLength),v&&(v.checked=q.highContrast),x&&(x.checked=q.underlineLinks)}function De(){const q=document.documentElement.dataset.viewerMotion||"system";return q==="reduced"||q==="system"&&S.matches}function it(q){document.body.classList.toggle("is-frontmatter-hidden",!q),d&&(d.checked=q)}function we(q){return/^#[0-9a-f]{6}$/i.test(String(q||""))}function lt(q){const Y=we(q)?q.slice(1):Z.accent.slice(1);return[parseInt(Y.slice(0,2),16),parseInt(Y.slice(2,4),16),parseInt(Y.slice(4,6),16)]}function be(q,Y,te){const de=lt(q),Ie=lt(Y);return"#"+de.map(function(We,ft){return Math.round(We+(Ie[ft]-We)*te)}).map(function(We){return We.toString(16).padStart(2,"0")}).join("")}function Et(q){return vt(q)>.48?"#121715":"#f3f7f4"}function vt(q){const Y=lt(q);return(.2126*Y[0]+.7152*Y[1]+.0722*Y[2])/255}function ot(q){const Y=pe(q);document.documentElement.dataset.viewerTheme=Y.preset;const te=Y.preset==="custom"&&vt(Y.custom.surface)<=.48;document.documentElement.style.colorScheme=Y.preset==="night"||te?"dark":"light",It(),Y.preset==="custom"&&xt(Y.custom),ht(Y),S1t()}function It(){Object.keys(ee).forEach(function(q){ee[q].forEach(function(Y){document.documentElement.style.removeProperty(Y)})}),["--ok-color-accent-rgb","--ok-color-accent-soft","--ok-color-accent-softer","--ok-color-accent-selected","--ok-color-accent-focus","--ok-color-accent-focus-strong","--ok-color-accent-border","--ok-color-accent-border-strong","--ok-color-shadow","--ok-color-code-inline-bg","--ok-color-code-block-text","--ok-color-control-hover-bg","--ok-color-sidebar-row","--ok-color-sidebar-tree-hover-bg","--ok-color-search-result-hover-bg","--ok-color-editor-menu-item-hover-bg","--ok-color-graph-edge-active"].forEach(function(q){document.documentElement.style.removeProperty(q)})}function xt(q){Object.keys(ee).forEach(function(te){ee[te].forEach(function(de){document.documentElement.style.setProperty(de,q[te])})});const Y=lt(q.accent).join(", ");document.documentElement.style.setProperty("--ok-color-accent-rgb",Y),document.documentElement.style.setProperty("--ok-color-accent-soft","rgba("+Y+", .11)"),document.documentElement.style.setProperty("--ok-color-accent-softer","rgba("+Y+", .065)"),document.documentElement.style.setProperty("--ok-color-accent-selected","rgba("+Y+", .09)"),document.documentElement.style.setProperty("--ok-color-accent-focus","rgba("+Y+", .12)"),document.documentElement.style.setProperty("--ok-color-accent-focus-strong","rgba("+Y+", .18)"),document.documentElement.style.setProperty("--ok-color-accent-border","rgba("+Y+", .35)"),document.documentElement.style.setProperty("--ok-color-accent-border-strong","rgba("+Y+", .5)"),document.documentElement.style.setProperty("--ok-color-shadow","rgba("+lt(q.text).join(", ")+", .1)"),document.documentElement.style.setProperty("--ok-color-code-inline-bg",be(q.surface,q.accent,.1)),document.documentElement.style.setProperty("--ok-color-code-block-text",Et(q.text)),document.documentElement.style.setProperty("--ok-color-control-hover-bg",be(q.page,q.text,.08)),document.documentElement.style.setProperty("--ok-color-sidebar-row",be(q.page,q.text,.11)),document.documentElement.style.setProperty("--ok-color-sidebar-tree-hover-bg",be(q.page,q.accent,.13)),document.documentElement.style.setProperty("--ok-color-search-result-hover-bg",be(q.surface,q.accent,.08)),document.documentElement.style.setProperty("--ok-color-editor-menu-item-hover-bg",be(q.surface,q.accent,.08)),document.documentElement.style.setProperty("--ok-color-graph-edge-active","rgba("+Y+", .78)")}function ht(q){document.querySelectorAll("[data-theme-option]").forEach(function(Y){const te=Y.dataset.themeOption===q.preset;Y.classList.toggle("is-selected",te),Y.setAttribute("aria-checked",te?"true":"false")}),h&&(h.hidden=q.preset!=="custom",h.querySelectorAll("[data-theme-custom-value]").forEach(function(Y){const te=Y.dataset.themeCustomValue;q.custom[te]&&(Y.value=q.custom[te])}))}function oe(){return Math.min(360,Math.max(260,window.innerWidth-24))}function At(){return window.innerWidth<=680?12:Math.max(22,(window.innerWidth-1180)/2)}function dt(q){const Y=Ne();return!!(q&&Y.length===1&&Y[0]===q)}function ut(q){return dt(q)?Math.max(oe(),window.innerWidth-At()*2):Math.max(wt(),1180)}function wt(){return Math.max(oe(),Mr("var(--ok-note-panel-default-width)",650))}function Mr(q,Y){const te=document.createElement("div");te.style.position="absolute",te.style.left="-10000px",te.style.top="-10000px",te.style.visibility="hidden",te.style.pointerEvents="none",te.style.width=q,document.body.append(te);const de=te.getBoundingClientRect().width;return te.remove(),Number.isFinite(de)&&de>0?de:Y}function ye(q,Y){const te=Number(q);return Number.isFinite(te)?Math.round(ve(te,oe(),ut(Y))):null}function et(q){return ye(I[q.dataset.notePath],q)}function ct(q){const Y=et(q);if(!Y){q.style.removeProperty("--note-panel-width"),delete q.dataset.panelWidth;return}q.style.setProperty("--note-panel-width",Y+"px"),q.dataset.panelWidth=String(Y)}function _t(q){var Y;document.body.classList.toggle("is-sidebar-open",q),n&&n.setAttribute("aria-hidden",q?"false":"true"),i&&i.setAttribute("aria-expanded",q?"true":"false"),q&&Pt(((Y=Eo())==null?void 0:Y.dataset.notePath)||sl()[0]||"",!0)}function Ft(){_t(!document.body.classList.contains("is-sidebar-open"))}function nr(q,Y){if(o6())return l1t(q,Y);let te;try{te=new URL(q,window.location.href)}catch{return null}const de=Jt();if(te.origin!==window.location.origin||!te.pathname.startsWith(de))return null;const Ie=te.pathname.slice(de.length)||"index.md";if(!_r(Ie))return null;try{return decodeURIComponent(Ie)}catch{return Ie}}function ir(q,Y){return q+Y.split("/").map(encodeURIComponent).join("/")}function _r(q){return/\.(md|markdown)$/i.test(String(q).split("?")[0].split("#")[0])}function or(q){return o6()?s1t(q):ir(Jt(),q)}function Rr(q){return ir(Nr(),q)}function Jt(){return R+"/file/"}function Nr(){return R+"/api/file/"}function gn(q){const Y=String(q||"").replace(/\/+$/,"");return Y?Y.startsWith("/")?Y:"/"+Y:""}function $r(){var te;const q=(te=window.OpenKnowledgeStaticData)==null?void 0:te.notes;if(Array.isArray(q))return q;const Y=document.querySelector("[data-static-notes]");if(!Y)return[];try{const de=JSON.parse(Y.textContent||"[]");return Array.isArray(de)?de:[]}catch{return[]}}function Pa(){const q=new Set;return $.forEach(function(Y){Y.path&&q.add(Y.path)}),document.querySelectorAll("[data-tree-path]").forEach(function(Y){Y.dataset.treePath&&q.add(Y.dataset.treePath)}),q}function ps(){document.querySelectorAll(".knowledge-tree").forEach(function(q){if(q.dataset.treePrepared==="true")return;q.dataset.treePrepared="true";const Y=[];Array.from(q.querySelectorAll(".tree-row")).forEach(function(te){var ft;const de=gs(te);for(;Y.length&&Y[Y.length-1].indent>=de;)Y.pop();if(te.dataset.treeParentPath=((ft=Y[Y.length-1])==null?void 0:ft.path)||"",!te.classList.contains("tree-directory"))return;const Ie=String(te.textContent||"").trim(),Be=Y.concat([{name:Ie}]).map(function(mt){return mt.name}).join("/");te.dataset.treeDirectoryPath=Be,te.setAttribute("aria-expanded","false"),te.tabIndex=0,te.title="Expand "+Be;const We=c6("chevron-down","tree-directory-icon");We.setAttribute("aria-hidden","true"),te.prepend(We),te.addEventListener("click",function(){li(te,te.getAttribute("aria-expanded")!=="true")}),te.addEventListener("keydown",function(mt){if(mt.key==="ArrowRight"){mt.preventDefault(),li(te,!0);return}if(mt.key==="ArrowLeft"){mt.preventDefault(),li(te,!1);return}(mt.key==="Enter"||mt.key===" ")&&(mt.preventDefault(),li(te,te.getAttribute("aria-expanded")!=="true"))}),Y.push({indent:de,name:Ie,path:Be})}),Bt(q)}),Ct()}function gs(q){const Y=q.style.getPropertyValue("--indent"),te=parseFloat(Y);return Number.isFinite(te)?te:0}function li(q,Y){q.setAttribute("aria-expanded",Y?"true":"false"),q.title=(Y?"Collapse ":"Expand ")+q.dataset.treeDirectoryPath;const te=q.closest(".knowledge-tree");te&&Bt(te)}function Bt(q){const Y=Object.create(null);q.querySelectorAll("[data-tree-directory-path]").forEach(function(te){Y[te.dataset.treeDirectoryPath]=te}),q.querySelectorAll(".tree-row").forEach(function(te){const Ie=(te.dataset.treeParentPath||"").split("/").filter(Boolean);let Be="",We=!1;Ie.forEach(function(ft){Be=Be?Be+"/"+ft:ft;const mt=Y[Be];mt&&mt.getAttribute("aria-expanded")!=="true"&&(We=!0)}),te.hidden=We})}function yt(){document.querySelectorAll("[data-tree-directory-path]").forEach(function(q){q.setAttribute("aria-expanded","false"),q.title="Expand "+q.dataset.treeDirectoryPath}),document.querySelectorAll(".knowledge-tree").forEach(Bt)}function Pt(q,Y){const te=String(q||""),de=te.split("/").slice(0,-1),Ie=new Set;if(de.forEach(function(Be,We){Ie.add(de.slice(0,We+1).join("/"))}),document.querySelectorAll(".knowledge-tree").forEach(function(Be){Be.querySelectorAll("[data-tree-directory-path]").forEach(function(We){Ie.has(We.dataset.treeDirectoryPath)&&(We.setAttribute("aria-expanded","true"),We.title="Collapse "+We.dataset.treeDirectoryPath)}),Be.querySelectorAll("[data-tree-path]").forEach(function(We){const ft=We.dataset.treePath===te;We.classList.toggle("is-current-file",ft),ft?(We.setAttribute("aria-current","page"),We.title=We.dataset.treePath):(We.removeAttribute("aria-current"),We.title=Ce())}),Bt(Be)}),Y&&n){const Be=Array.from(n.querySelectorAll("[data-tree-path]")).find(function(We){return We.dataset.treePath===te});Be&&window.requestAnimationFrame(function(){Be.scrollIntoView({block:"center",behavior:De()?"auto":"smooth"})})}}function Ct(){const q=n==null?void 0:n.querySelector(".file-sidebar-head"),Y=q==null?void 0:q.querySelector("[data-sidebar-close]");if(!q||!Y||q.querySelector("[data-sidebar-collapse]"))return;const te=document.createElement("div");te.className="file-sidebar-actions";const de=document.createElement("button");de.type="button",de.className="file-sidebar-collapse",de.dataset.sidebarCollapse="",de.textContent="Collapse all",de.addEventListener("click",yt),Y.before(te),te.append(de,Y)}function pr(q){const Y=q.join("/");return[Y+"/index.md",Y+"/index.markdown"].find(function(te){return G.has(te)})||""}function Ee(q){const Y=String(q||"index.md"),te=Y.split("/").filter(Boolean),de=te[te.length-1]||"index.md",Ie=/^index\.(md|markdown)$/i.test(de)&&te.length>1,Be=Ie?te.slice(0,-1):te,We=document.createElement("nav");return We.className="note-path note-breadcrumbs",We.dataset.noteBreadcrumbs="",We.dataset.breadcrumbsReady="true",We.dataset.notePathValue=Y,We.setAttribute("aria-label","Note path"),We.title=Y,Be.forEach(function(ft,mt){if(mt>0){const er=document.createElement("span");er.className="note-breadcrumb-separator",er.setAttribute("aria-hidden","true"),er.textContent="/",We.append(er)}const St=mt===Be.length-1,Zt=pr(Be.slice(0,mt+1)),sr=St?Y:Zt,zt=St&&!Ie?ft.replace(/\.(md|markdown)$/i,""):ft;if(sr){const er=document.createElement("a");er.className="note-breadcrumb-link"+(St?" note-breadcrumb-current":""),er.href=or(sr),er.dataset.directLink="true",er.textContent=zt,St&&er.setAttribute("aria-current","page"),We.append(er);return}const Ut=document.createElement("span");Ut.className="note-breadcrumb-label",Ut.textContent=zt,We.append(Ut)}),We}function Di(q){const Y=q.querySelector("[data-note-breadcrumbs], .note-path");!Y||Y.dataset.breadcrumbsReady==="true"||Y.replaceWith(Ee(q.dataset.notePath))}function Oe(){var te;const q=(te=window.OpenKnowledgeStaticData)==null?void 0:te.graph;if(q)return{nodes:Array.isArray(q.nodes)?q.nodes:[],edges:Array.isArray(q.edges)?q.edges:[]};const Y=document.querySelector("[data-knowledge-graph]");if(!Y)return{nodes:[],edges:[]};try{const de=JSON.parse(Y.textContent||"{}");return{nodes:Array.isArray(de.nodes)?de.nodes:[],edges:Array.isArray(de.edges)?de.edges:[]}}catch{return{nodes:[],edges:[]}}}function Ln(){const q=document.querySelector("[data-knowledge-graph-view]"),Y=document.querySelector("[data-knowledge-graph-sidebar]");if(!q)return;q.replaceChildren(),Y==null||Y.replaceChildren();const te=document.createElement("div");te.className="knowledge-graph-info";const de=document.createElement("h2");de.textContent="Knowledge graph";const Ie=document.createElement("p");Ie.textContent="Select a node to inspect its connections. Use arrow keys to move and Enter to open.";const Be=document.createElement("p");if(Be.className="knowledge-graph-status",Be.dataset.knowledgeGraphStatus="",Be.setAttribute("aria-live","polite"),Be.textContent=V.nodes.length?V.nodes.length+(V.nodes.length===1?" note":" notes"):"No notes",te.append(de,Ie,Be),(Y||q).append(te),!V.nodes.length){const Zt=document.createElement("p");Zt.className="empty",Zt.textContent="No Markdown files found.",q.append(Zt);return}const We=900,ft=640,mt=t1t(V.nodes),Nt=Je(V,We,ft,mt),St=document.createElement("canvas");St.className="knowledge-graph-canvas",St.dataset.knowledgeGraphCanvas="true",St.width=We,St.height=ft,St.tabIndex=0,St.setAttribute("role","img"),St.setAttribute("aria-label","Interactive graph of Markdown files. Use arrow keys to select a note and Enter to open it."),q.append(St),hp(St,V,Nt,mt,We,ft,Be).start()}function hp(q,Y,te,de,Ie,Be,We){const ft=q.getContext("2d"),mt=Object.create(null);Y.nodes.forEach(function(tr){tr&&typeof tr.path=="string"&&(mt[tr.path]=!0)});const Nt=Y.edges.filter(function(tr){return tr&&mt[tr.source]&&mt[tr.target]&&te[tr.source]&&te[tr.target]}),St=Y.nodes.filter(function(tr){return tr&&typeof tr.path=="string"&&te[tr.path]}).map(function(tr){const fn=te[tr.path],lc=o2e(tr,de);return{node:tr,path:tr.path,label:lc,fullLabel:l2e(tr,de),radius:tr.path==="index.md"?16:10,labelOffset:tr.path==="index.md"?31:25,baseX:fn.x,baseY:fn.y,x:fn.x,y:fn.y,z:0,vx:0,vy:0}}),Zt=Object.create(null);St.forEach(function(tr){Zt[tr.path]=tr});let sr="",zt=St.findIndex(function(tr){return tr.path==="index.md"});zt<0&&(zt=0);let Ut=null,er=0;const Ar=function(tr){const fn=tr&&Zt[tr]?tr:"";if(fn!==sr)if(sr=fn,q.dataset.activeGraphPath=sr,q.style.cursor=sr?"pointer":"default",sr){const lc=St.findIndex(function(m6){return m6.path===sr});lc>=0&&(zt=lc);const xw=Zt[sr],j2e=Nt.filter(function(m6){return m6.source===sr||m6.target===sr}).length,Z2e=j2e+(j2e===1?" connection":" connections");We&&(We.textContent=xw.fullLabel+" · "+Z2e+" · Enter to open"),q.setAttribute("aria-label","Selected "+xw.fullLabel+" with "+Z2e+". Use arrow keys to move and Enter to open.")}else We&&(We.textContent=Y.nodes.length+(Y.nodes.length===1?" note":" notes")),q.setAttribute("aria-label","Interactive graph of Markdown files. Use arrow keys to select a note and Enter to open it.")},yn=function(){const tr=Math.max(1,Math.min(window.devicePixelRatio||1,2));q.width=Math.round(Ie*tr),q.height=Math.round(Be*tr),ft.setTransform(tr,0,0,tr,0,0)},xn=function(tr){const fn=q.getBoundingClientRect();return!fn.width||!fn.height?{x:0,y:0}:{x:(tr.clientX-fn.left)*(Ie/fn.width),y:(tr.clientY-fn.top)*(Be/fn.height)}},xi=function(tr){Ut=tr;const fn=al(St,tr);Ar(fn?fn.path:"")};q.addEventListener("pointermove",function(tr){xi(xn(tr))}),q.addEventListener("pointerleave",function(){Ut=null,document.activeElement!==q&&Ar("")}),q.addEventListener("click",function(tr){const fn=al(St,xn(tr));fn&&mp(fn.path,!0,H(!1))}),q.addEventListener("focus",function(){St[zt]&&Ar(St[zt].path)}),q.addEventListener("blur",function(){Ar(Ut?sr:"")}),q.addEventListener("keydown",function(tr){if(!St.length)return;if(tr.key==="Enter"||tr.key===" "){sr&&(tr.preventDefault(),mp(sr,!0,H(!1)));return}if(tr.key!=="ArrowRight"&&tr.key!=="ArrowDown"&&tr.key!=="ArrowLeft"&&tr.key!=="ArrowUp")return;tr.preventDefault();const fn=tr.key==="ArrowRight"||tr.key==="ArrowDown"?1:-1;zt=(zt+fn+St.length)%St.length,Ar(St[zt].path)});const ll=function(){q.isConnected&&(er=window.requestAnimationFrame(ll),Zv(St,Nt,Zt,sr,Ie,Be),Jn(ft,St,Nt,Zt,sr,Ie,Be))};return{start:function(){ft&&(yn(),Jn(ft,St,Nt,Zt,sr,Ie,Be),er=window.requestAnimationFrame(ll))},stop:function(){er&&window.cancelAnimationFrame(er)}}}function Zv(q,Y,te,de,Ie,Be){const We=de?te[de]:null;q.forEach(function(mt){const Nt=mt===We?1:0,St=mt===We?.052:.034;mt.vx+=(mt.baseX-mt.x)*St,mt.vy+=(mt.baseY-mt.y)*St,mt.z+=(Nt-mt.z)*.095});const ft=We?Qv(We.z):0;Y.forEach(function(mt){const Nt=te[mt.source],St=te[mt.target];if(!Nt||!St)return;const Zt=St.x-Nt.x||.01,sr=St.y-Nt.y||.01,zt=Math.max(1,Math.sqrt(Zt*Zt+sr*sr)),Ut=We&&(mt.source===We.path||mt.target===We.path),er=104+(Ut?28*ft:0),Ar=(zt-er)*(Ut?.0015:.0011),yn=Zt/zt,xn=sr/zt;Nt.vx+=yn*Ar,Nt.vy+=xn*Ar,St.vx-=yn*Ar,St.vy-=xn*Ar});for(let mt=0;mt.02){const mt=xu(We,We.fullLabel);q.forEach(function(Nt){if(Nt===We)return;const St=ei(mt,xu(Nt,Nt.label));if(!St)return;const Zt=Nt.x-We.x||.01,sr=Nt.y-We.y||.01,zt=Math.max(1,Math.sqrt(Zt*Zt+sr*sr)),Ut=Math.min(3.2,(Math.max(St.x,St.y)*.026+.8)*ft);Nt.vx+=Zt/zt*Ut,Nt.vy+=sr/zt*Ut})}q.forEach(function(mt){mt.x+=mt.vx,mt.y+=mt.vy,bi(mt,Ie,Be),Jv(mt,We?5.5:4.2);const Nt=We?.58:.66;mt.vx*=Nt,mt.vy*=Nt,Math.abs(mt.vx)<.018&&(mt.vx=0),Math.abs(mt.vy)<.018&&(mt.vy=0)})}function Qv(q){const Y=ve(q,0,1);return Y*Y*(3-2*Y)}function Jv(q,Y){const te=Math.sqrt(q.vx*q.vx+q.vy*q.vy);if(te<=Y||te<=0)return;const de=Y/te;q.vx*=de,q.vy*=de}function Jn(q,Y,te,de,Ie,Be,We){const ft=Ie?de[Ie]:null,mt=il();q.clearRect(0,0,Be,We),q.lineCap="round",q.lineJoin="round",te.forEach(function(Nt){const St=de[Nt.source],Zt=de[Nt.target];if(!St||!Zt)return;const sr=ft&&(Nt.source===ft.path||Nt.target===ft.path);q.beginPath(),q.moveTo(St.x,St.y),q.lineTo(Zt.x,Zt.y),q.strokeStyle=sr?mt.edgeActive:ft?mt.edgeMuted:mt.edge,q.lineWidth=sr?2.35:1.05,q.stroke()}),Y.slice().sort(function(Nt,St){return Nt.z-St.z}).forEach(function(Nt){const St=Nt===ft,Zt=1+Nt.z*.22,sr=Nt.radius*Zt,zt=St?Nt.fullLabel:Nt.label;q.save(),q.globalAlpha=1,q.beginPath(),q.arc(Nt.x,Nt.y-Nt.z*6,sr,0,Math.PI*2),q.fillStyle=mt.nodeBg,q.fill(),q.strokeStyle=St?mt.nodeActiveBorder:mt.nodeBorder,q.lineWidth=St?3:Nt.path==="index.md"?2:1.55,q.stroke(),q.font=(St?"600 13px":"400 12px")+" "+mt.fontBody,q.textBaseline="middle",q.textAlign=Re(Nt.x,vi(zt),Be);const Ut=q.textAlign==="start"?Math.max(16,Nt.x-vi(zt)/2):q.textAlign==="end"?Math.min(Be-16,Nt.x+vi(zt)/2):Nt.x,er=Nt.y+Nt.labelOffset+Nt.z*4;q.fillStyle=St?mt.labelActive:mt.label,q.fillText(zt,Ut,er),q.restore()})}function il(){const q=document.documentElement.dataset.viewerContrast==="high";return{fontBody:yi("--ok-font-body","Inter, ui-sans-serif, system-ui, sans-serif"),edge:q?yi("--ok-color-text","#202322"):yi("--ok-color-graph-edge","rgba(128, 138, 133, .25)"),edgeMuted:q?yi("--ok-color-muted","#707773"):yi("--ok-color-graph-edge-muted","rgba(128, 138, 133, .11)"),edgeActive:yi("--ok-color-graph-edge-active","rgba(15, 122, 77, .78)"),nodeBg:yi("--ok-color-graph-node-bg","#f8f8f8"),nodeBorder:q?yi("--ok-color-text","#202322"):yi("--ok-color-graph-node-border","#aeb8b2"),nodeActiveBorder:yi("--ok-color-graph-node-active-border","#0f7a4d"),label:q?yi("--ok-color-text","#202322"):yi("--ok-color-graph-label","#5f6b66"),labelActive:q?yi("--ok-color-text","#202322"):yi("--ok-color-graph-label-active","#26302c")}}function yi(q,Y){return getComputedStyle(document.documentElement).getPropertyValue(q).trim()||Y}function al(q,Y){for(let te=q.length-1;te>=0;te-=1){const de=q[te],Ie=Y.x-de.x,Be=Y.y-de.y,We=de.radius*(1+de.z*.22)+6;if(Ie*Ie+Be*Be<=We*We||Ot(Y,xu(de,de.z>.6?de.fullLabel:de.label)))return de}return null}function xu(q,Y){const te=vi(Y),de=q.y+q.labelOffset-10,Ie=Math.max(q.radius+8,te/2+9);return{left:q.x-Ie,right:q.x+Ie,top:Math.min(q.y-q.radius-8,de),bottom:Math.max(q.y+q.radius+8,de+22)}}function Ot(q,Y){return q.x>=Y.left&&q.x<=Y.right&&q.y>=Y.top&&q.y<=Y.bottom}function Re(q,Y,te){return q-Y/2<16?"start":q+Y/2>te-16?"end":"center"}function Je(q,Y,te,de){const Ie=q.nodes.filter(function(zt){return zt&&typeof zt.path=="string"&&zt.path.length>0}),Be=Object.create(null);if(Ie.length===0)return Be;if(Ie.length===1)return Be[Ie[0].path]={x:Y/2,y:te/2},Be;const We={x:Y/2,y:te/2},ft=Object.create(null),mt=Object.create(null);Ie.forEach(function(zt){ft[zt.path]=!0,mt[zt.path]=0});const Nt=[];q.edges.forEach(function(zt){!zt||!ft[zt.source]||!ft[zt.target]||(Nt.push(zt),mt[zt.source]+=1,mt[zt.target]+=1)});const St=bt(Ie,Y,te),Zt=Ie.map(function(zt){const Ut=Vt(zt.path),er=St[Ut]||We,Ar=Qr(zt.path),yn=Ar%360/360*Math.PI*2,xn=26+Ar%74;return{node:zt,group:Ut,label:o2e(zt,de),radius:zt.path==="index.md"?16:10,x:er.x+Math.cos(yn)*xn,y:er.y+Math.sin(yn)*xn,vx:0,vy:0}}),sr=Object.create(null);Zt.forEach(function(zt){sr[zt.node.path]=zt});for(let zt=0;zt<220;zt+=1){for(let Ut=0;Ut0?.006:.018;Ut.vx+=(We.x-Ut.x)*yn,Ut.vy+=(We.y-Ut.y)*yn,Ut.vx+=(er.x-Ut.x)*xn,Ut.vy+=(er.y-Ut.y)*xn,Ut.x+=Ut.vx,Ut.y+=Ut.vy,bi(Ut,Y,te),Ut.vx*=.62,Ut.vy*=.62})}return dr(Zt,Y,te),mn(Zt,Y,te),Zt.forEach(function(zt){Be[zt.node.path]={x:zt.x,y:zt.y}}),Be}function bt(q,Y,te){const de=Object.create(null);q.forEach(function(St){const Zt=Vt(St.path);de[Zt]=(de[Zt]||0)+1});const Ie=Object.keys(de).sort(function(St,Zt){return de[Zt]===de[St]?St.localeCompare(Zt):de[Zt]-de[St]}),Be=Object.create(null);if(Ie.length===0)return Be;const We=Math.max(1,Math.ceil(Math.sqrt(Ie.length*(Y/te)))),ft=Math.max(1,Math.ceil(Ie.length/We)),mt=Y/We,Nt=te/ft;return Ie.forEach(function(St,Zt){const sr=Zt%We,zt=Math.floor(Zt/We),Ut=Qr(St),er=(Ut%31-15)*.9,Ar=((Ut>>5)%31-15)*.9;Be[St]={x:mt*(sr+.5)+er,y:Nt*(zt+.5)+Ar}}),Be}function Vt(q){const Y=s6(q);return Y.length<=1?".":Y.length>=3?Y.slice(0,2).join("/"):Y[0]}function dr(q,Y,te){let de=1/0,Ie=-1/0,Be=1/0,We=-1/0;q.forEach(function(Ar){de=Math.min(de,Ar.x),Ie=Math.max(Ie,Ar.x),Be=Math.min(Be,Ar.y),We=Math.max(We,Ar.y)});const ft=74,mt=58,Nt=Math.max(1,Ie-de),St=Math.max(1,We-Be),Zt=Math.min((Y-ft*2)/Nt,(te-mt*2)/St,1.28),sr=(de+Ie)/2,zt=(Be+We)/2,Ut=Y/2,er=te/2;q.forEach(function(Ar){Ar.x=ve(Ut+(Ar.x-sr)*Zt,ft,Y-ft),Ar.y=ve(er+(Ar.y-zt)*Zt,mt,te-mt),bi(Ar,Y,te)})}function fr(q,Y){const te=q.map(dn);for(let de=0;deY-14&&(q.x-=de.right-(Y-14)),de.top<18&&(q.y+=18-de.top),de.bottom>te-18&&(q.y-=de.bottom-(te-18))}function Qr(q){let Y=2166136261;const te=String(q||"");for(let de=0;de>>0}function t1t(q){const Y=Object.create(null);q.forEach(function(de){if(!de||typeof de.path!="string")return;const Ie=s2e(de);Y[Ie]||(Y[Ie]=[]),Y[Ie].push(de)});const te=Object.create(null);return Object.keys(Y).forEach(function(de){const Ie=Y[de];if(Ie.length===1){te[Ie[0].path]=de;return}const Be=Ie.map(function(We){return We.path});Ie.forEach(function(We){te[We.path]=n1t(We.path,Be)})}),te}function s2e(q){const Y=String(q.title||"").trim();return Y&&Y.toLowerCase()!=="index"?Y:r1t(q.path)}function r1t(q){const Y=s6(q);if(Y.length===0)return String(q||"");const te=Y[Y.length-1];return te.toLowerCase()==="index"&&Y.length>1?Y.slice(-2).join("/"):te}function n1t(q,Y){const te=s6(q);for(let de=1;de<=te.length;de+=1){const Ie=te.slice(-de).join("/");if(Y.every(function(We){return We===q||s6(We).slice(-de).join("/")!==Ie}))return Ie}return te.join("/")||String(q||"")}function s6(q){return String(q||"").replace(/\.md$/i,"").split("/").filter(Boolean)}function o2e(q,Y){const te=l2e(q,Y);return te.length>22?te.slice(0,21)+"...":te}function l2e(q,Y){return Y[q.path]||s2e(q)}function i1t(q,Y){const te=Object.create(null);return q.forEach(function(de){de&&typeof de[Y]=="string"&&(te[de[Y]]=de)}),te}function a1t(q){const Y=Object.create(null);return q.forEach(function(te){te&&typeof te.htmlPath=="string"&&typeof te.path=="string"&&c2e(te.htmlPath).forEach(function(de){Y[de]===void 0&&(Y[de]=te.path)})}),Y}function o6(){return $.length>0}function l6(q){const Y=String(q).lastIndexOf(".");return Y<0?Fh(q+"/index.html"):Fh(q.slice(0,Y)+".html")}function c2e(q){const Y=Fh(q),te=[];if(uw(te,Y),/\.html$/i.test(Y)){const de=Y.slice(0,-5);uw(te,de),/\/index\.html$/i.test(Y)?uw(te,Y.slice(0,Y.length-10)):/^index\.html$/i.test(Y)&&uw(te,"")}return te.slice().forEach(function(de){uw(te,de.toLowerCase())}),te}function uw(q,Y){const te=Fh(Y);q.includes(te)||q.push(te)}function s1t(q){var Be;const Y=sl()[0]||((Be=document.querySelector("[data-note-path]"))==null?void 0:Be.dataset.notePath)||"index.md",te=l6(Y),de=l6(q),Ie=te.includes("/")?te.slice(0,te.lastIndexOf("/")+1):"";return o1t(Ie,de)}function o1t(q,Y){const te=Fh(q).split("/").filter(Boolean),de=Fh(Y).split("/").filter(Boolean);for(;te.length&&de.length&&te[0]===de[0];)te.shift(),de.shift();return te.map(function(){return".."}).concat(de).join("/")||"."}function Fh(q){const Y=String(q||"").replace(/\\/g,"/").split("/"),te=[];return Y.forEach(function(de){if(!(!de||de===".")){if(de===".."){te.pop();return}te.push(de)}}),te.join("/")}function l1t(q,Y){const te=String(q||"").trim();if(!te||te.startsWith("#"))return null;const de=te.split("#")[0].split("?")[0];if(!de)return Y||null;if(!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(de)&&!de.startsWith("/")){const Be=l6(Y||sl()[0]||"index.md"),We=Be.includes("/")?Be.slice(0,Be.lastIndexOf("/")+1):"";return u2e(We+de)}let Ie;try{Ie=new URL(de,window.location.href)}catch{return null}return Ie.origin!==window.location.origin?null:u2e(c1t(Ie))}function u2e(q){const Y=Fh(q);return P[Y]||P[Y.toLowerCase()]||null}function c1t(q){var Be;const Y=((Be=document.querySelector("[data-note-path]"))==null?void 0:Be.dataset.notePath)||sl()[0]||"index.md";let te=h2e(window.location.pathname),de=h2e(q.pathname);const Ie=u1t(te,Y);return Ie&&de.toLowerCase().startsWith(Ie.toLowerCase())&&(de=de.slice(Ie.length)),Fh(de)}function u1t(q,Y){const te=String(q||"").toLowerCase(),de=c2e(l6(Y)).filter(Boolean).sort(function(Ie,Be){return Be.length-Ie.length});for(const Ie of de){const Be=["/"+Ie,"/"+Ie+"/"];for(const We of Be)if(te.endsWith(We.toLowerCase()))return q.slice(0,q.length-We.length+1)}return q.slice(0,q.lastIndexOf("/")+1)}function h2e(q){try{return decodeURIComponent(q||"")}catch{return q||""}}function h1t(q){const Y=t.dataset.noteRoot||"",te=Y.includes("\\")?"\\":"/",de=Y.replace(/[\\/]+$/,""),Ie=String(q||"").split("/").join(te);return de?de+te+Ie:Ie}function d2e(q){const Y=String(q||"").replace(/\\/g,"/");return(Y.startsWith("/")?"/":"")+Y.split("/").filter(Boolean).map(encodeURIComponent).join("/")}function d1t(q){const Y=d2e(q);return"file://"+(Y.startsWith("/")?"":"/")+Y}function f1t(q,Y){const te=h1t(Y),de=d2e(te),Ie=de.startsWith("/")?de:"/"+de,Be=d1t(te);switch(q.id){case"code":return"vscode://file"+Ie;case"cursor":return"cursor://file"+Ie;case"windsurf":return"windsurf://file"+Ie;case"zed":return"zed://file"+Ie;case"obsidian":return"obsidian://open?path="+encodeURIComponent(te);case"sublime":return"sublime://open?url="+encodeURIComponent(Be);case"bbedit":return"bbedit://open?url="+encodeURIComponent(Be);case"nova":return"nova://open?path="+encodeURIComponent(te);case"intellij":return"idea://open?file="+encodeURIComponent(te);case"webstorm":return"webstorm://open?file="+encodeURIComponent(te);default:return Be}}function p1t(){var de;const q=[{id:"code",name:"Visual Studio Code",short:"VS",available:!1},{id:"cursor",name:"Cursor",short:"Cu",available:!1},{id:"windsurf",name:"Windsurf",short:"Ws",available:!1},{id:"zed",name:"Zed",short:"Zd",available:!1}],Y=(de=window.OpenKnowledgeStaticData)==null?void 0:de.editors;if(Array.isArray(Y)&&Y.length)return Y;const te=document.querySelector("[data-editor-options]");if(!te)return q;try{const Ie=JSON.parse(te.textContent||"[]");return Array.isArray(Ie)&&Ie.length?Ie:q}catch{return q}}function g1t(q){return D.find(function(Y){return Y.id===q})||D[0]}function f2e(q){return q.short||q.name.slice(0,2)}function p2e(q,Y){if(q.replaceChildren(),q.dataset.hasIcon=Y.icon?"true":"false",!Y.icon){q.textContent=f2e(Y);return}const te=document.createElement("img");te.className="editor-icon",te.src=Y.icon,te.alt="",te.decoding="async",te.draggable=!1,te.addEventListener("error",function(){q.dataset.hasIcon="false",q.replaceChildren(),q.textContent=f2e(Y)},{once:!0}),q.append(te)}function c6(q,Y){const te=document.createElementNS("http://www.w3.org/2000/svg","svg");if(te.setAttribute("class",Y+" control-icon"),te.setAttribute("data-icon",q),te.setAttribute("viewBox","0 0 24 24"),te.setAttribute("aria-hidden","true"),q==="chevron-down"){const Be=document.createElementNS("http://www.w3.org/2000/svg","path");return Be.setAttribute("d","m6 9 6 6 6-6"),te.append(Be),te}if(q==="github"){const Be=document.createElementNS("http://www.w3.org/2000/svg","path");return Be.setAttribute("d","M12 .5a12 12 0 0 0-3.79 23.39c.6.11.82-.26.82-.58v-2.17c-3.34.73-4.04-1.42-4.04-1.42-.55-1.39-1.34-1.76-1.34-1.76-1.09-.75.08-.73.08-.73 1.2.08 1.84 1.24 1.84 1.24 1.07 1.83 2.8 1.3 3.49.99.11-.78.42-1.3.76-1.6-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.13-.3-.54-1.52.11-3.18 0 0 1.01-.32 3.3 1.23a11.4 11.4 0 0 1 6 0c2.29-1.55 3.3-1.23 3.3-1.23.65 1.66.24 2.88.12 3.18.77.84 1.23 1.91 1.23 3.22 0 4.61-2.81 5.63-5.48 5.92.43.37.81 1.1.81 2.22v3.29c0 .32.22.69.83.58A12 12 0 0 0 12 .5Z"),te.append(Be),te}const de=document.createElementNS("http://www.w3.org/2000/svg","path");de.setAttribute("d","M18 6 6 18");const Ie=document.createElementNS("http://www.w3.org/2000/svg","path");return Ie.setAttribute("d","m6 6 12 12"),te.append(de,Ie),te}function g2e(){let q=[];try{q=JSON.parse(window.localStorage.getItem(_)||"[]")}catch{q=[]}Array.isArray(q)||(q=[]);const Y=new Set(D.map(function(de){return de.id})),te=q.filter(function(de,Ie){return typeof de=="string"&&Y.has(de)&&q.indexOf(de)===Ie});return D.forEach(function(de){te.includes(de.id)||te.push(de.id)}),te}function m1t(){return g2e().map(g1t).filter(Boolean)}function m2e(q){const Y=[q].concat(g2e().filter(function(te){return te!==q}));try{window.localStorage.setItem(_,JSON.stringify(Y))}catch{return}}function y1t(){const q=document.createElement("div");q.className="editor-picker",q.dataset.editorPicker="";const Y=document.createElement("div");Y.className="editor-trigger",Y.dataset.editorTrigger="",Y.setAttribute("role","group");const te=document.createElement("a");te.className="editor-open",te.href="#",te.dataset.editorOpen="",te.dataset.directLink="true",te.title="Open in editor";const de=document.createElement("span");de.className="editor-mark",de.dataset.editorMark="",de.setAttribute("aria-hidden","true"),de.textContent="--",te.append(de);const Ie=document.createElement("button");Ie.className="editor-menu-trigger",Ie.type="button",Ie.dataset.editorMenuTrigger="",Ie.setAttribute("aria-haspopup","menu"),Ie.setAttribute("aria-expanded","false"),Ie.setAttribute("aria-label","Choose editor"),Ie.title="Choose editor",Ie.append(c6("chevron-down","editor-caret")),Y.append(te,Ie);const Be=document.createElement("div");return Be.className="editor-menu",Be.dataset.editorMenu="",Be.hidden=!0,Be.setAttribute("role","menu"),q.append(Y,Be),q}function v1t(q,Y){if(!Y)return null;const te=document.createElement("a");return te.className="source-open",te.href=Y,te.dataset.sourceOpen="",te.dataset.directLink="true",te.target="_blank",te.rel="noreferrer",te.title="Open on GitHub",te.setAttribute("aria-label","Open "+q+" on GitHub"),te.append(c6("github","source-icon")),te}function HP(q){const Y=q.querySelector("[data-editor-trigger]"),te=q.querySelector("[data-editor-open]"),de=q.querySelector("[data-editor-menu-trigger]"),Ie=q.querySelector("[data-editor-mark]"),Be=q.querySelector("[data-editor-menu]"),We=m1t(),ft=We[0],mt=q.closest("[data-note-path]"),Nt=(mt==null?void 0:mt.dataset.notePath)||"";if(!(!Y||!te||!de||!Ie||!Be||!ft||!Nt)){if(p2e(Ie,ft),Y.setAttribute("aria-label","Editor: "+ft.name),te.href=f1t(ft,Nt),te.title="Open "+Nt+" in "+ft.name,te.setAttribute("aria-label","Open "+Nt+" in "+ft.name),de.title="Choose editor",de.setAttribute("aria-label","Choose editor for "+Nt),q.dataset.primaryEditor=ft.id,Be.replaceChildren(),y2e(Be,ft,!0),We.length>1){const St=document.createElement("div");St.className="editor-menu-separator",St.setAttribute("role","separator"),Be.append(St)}We.slice(1).forEach(function(St){y2e(Be,St,!1)})}}function y2e(q,Y,te){const de=document.createElement("button");de.className="editor-menu-item"+(te?" is-selected":""),de.type="button",de.dataset.editorOption=Y.id,de.setAttribute("role","menuitemradio"),de.setAttribute("aria-checked",te?"true":"false");const Ie=document.createElement("span");Ie.className="editor-option-mark",p2e(Ie,Y);const Be=document.createElement("span");Be.className="editor-option-label",Be.textContent=Y.name,de.append(Ie,Be),q.append(de)}function v2e(){document.querySelectorAll("[data-editor-picker]").forEach(HP)}function hw(q,Y){const te=q.querySelector("[data-editor-menu-trigger]"),de=q.querySelector("[data-editor-menu]");!te||!de||(Y&&(dw(q),HP(q)),de.hidden=!Y,te.setAttribute("aria-expanded",Y?"true":"false"))}function dw(q){document.querySelectorAll("[data-editor-picker]").forEach(function(Y){Y!==q&&hw(Y,!1)})}function fw(q){!o||!l||(l.hidden=!q,o.setAttribute("aria-expanded",q?"true":"false"))}function b1t(){if(!l)return null;const q=l.querySelector("[data-settings-reset]");if(q)return q;const Y=document.createElement("div");Y.className="viewer-settings-footer";const te=document.createElement("button");return te.type="button",te.className="viewer-settings-reset",te.dataset.settingsReset="",te.textContent="Reset to defaults",Y.append(te),l.append(Y),te}function x1t(){if(!s||!o||!l||s.dataset.settingsBound==="true")return;s.dataset.settingsBound="true";let q=j(),Y=Fe(),te=Ue();ot(q),it(Y),Le(te);const de=b1t();de&&de.addEventListener("click",function(){q=pe({preset:W,custom:Z}),Y=!0,te=Me(J),A=F,re(q),xe(Y),qe(te),je(A),ot(q),it(Y),Le(te),Se(A)}),o.addEventListener("click",function(Be){Be.preventDefault(),Be.stopPropagation(),fw(l.hidden)}),o.addEventListener("keydown",function(Be){if(Be.key!=="ArrowDown"&&Be.key!=="Enter"&&Be.key!==" ")return;Be.preventDefault(),fw(!0);const We=l.querySelector("[data-theme-option].is-selected")||l.querySelector("[data-theme-option]");We&&We.focus()}),l.addEventListener("click",function(Be){const We=me(Be.target,"[data-theme-option]");We&&(Be.preventDefault(),q=pe({preset:We.dataset.themeOption,custom:q.custom}),re(q),ot(q))}),l.addEventListener("keydown",function(Be){if(Be.key==="Escape"){Be.preventDefault(),fw(!1),o.focus();return}if(Be.key!=="Enter"&&Be.key!==" ")return;const We=me(Be.target,"[data-theme-option]");We&&(Be.preventDefault(),q=pe({preset:We.dataset.themeOption,custom:q.custom}),re(q),ot(q))}),l.querySelectorAll("[data-theme-custom-value]").forEach(function(Be){Be.addEventListener("input",function(){const We=Be.dataset.themeCustomValue;if(!Z[We]||!we(Be.value))return;const ft=Object.assign({},q.custom);ft[We]=Be.value.toLowerCase(),q=pe({preset:"custom",custom:ft}),re(q),ot(q)})}),d&&d.addEventListener("change",function(){Y=d.checked,xe(Y),it(Y)});function Ie(Be,We){te=Me(Object.assign({},te,{[Be]:We})),qe(te),Le(te)}f&&f.addEventListener("change",function(){Ie("font",f.value)}),p&&p.addEventListener("change",function(){Ie("size",p.value)}),g&&g.addEventListener("change",function(){Ie("spacing",g.value)}),m&&m.addEventListener("change",function(){Ie("motion",m.value)}),y&&y.addEventListener("change",function(){Ie("readableLineLength",y.checked)}),v&&v.addEventListener("change",function(){Ie("highContrast",v.checked)}),x&&x.addEventListener("change",function(){Ie("underlineLinks",x.checked)})}function Eo(){return e.querySelector(".note-panel.is-active-panel")}function T1t(){return me(document.activeElement,"[data-note-path]")}function b2e(){return T1t()||Eo()}function zh(q){!q||!e.contains(q)||(Ne().forEach(function(Y){const te=Y===q;Y.classList.toggle("is-active-panel",te),Y.dataset.activePanel=te?"true":"false",te||Y.querySelectorAll("[data-editor-picker]").forEach(function(de){hw(de,!1)})}),dp(),Pt(q.dataset.notePath,!1))}function YP(){const q=Ne();q.length&&(Eo()||zh(q[q.length-1]))}function w1t(q){!q||q.dataset.resizeHandlesBound==="true"||(q.dataset.resizeHandlesBound="true",["left","right"].forEach(function(Y){const te=document.createElement("button");te.type="button",te.className="note-resize-handle note-resize-handle-"+Y,te.dataset.panelResizeHandle=Y,te.setAttribute("aria-label","Resize note panel from the "+Y),te.title="Resize panel",te.addEventListener("pointerdown",iyt),te.addEventListener("keydown",function(de){nyt(q,Y,de)}),q.append(te)}),x2e(q),q.addEventListener("scroll",function(){x2e(q)},{passive:!0}))}function x2e(q){q&&q.style.setProperty("--note-panel-scroll-top",Math.max(0,q.scrollTop||0)+"px")}function C1t(q){if(!q||q.dataset.editorBound==="true")return;q.dataset.editorBound="true",HP(q);const Y=q.querySelector("[data-editor-menu-trigger]"),te=q.querySelector("[data-editor-menu]");!Y||!te||(Y.addEventListener("click",function(de){de.preventDefault(),de.stopPropagation(),hw(q,te.hidden)}),Y.addEventListener("keydown",function(de){if(de.key!=="ArrowDown"&&de.key!=="Enter"&&de.key!==" ")return;de.preventDefault(),hw(q,!0);const Ie=te.querySelector("[data-editor-option]");Ie&&Ie.focus()}),te.addEventListener("click",function(de){const Ie=me(de.target,"[data-editor-option]");Ie&&(de.preventDefault(),de.stopPropagation(),m2e(Ie.dataset.editorOption),v2e(),dw())}),te.addEventListener("keydown",function(de){if(de.key==="Escape"){de.preventDefault(),hw(q,!1),Y.focus();return}if(de.key!=="Enter"&&de.key!==" ")return;const Ie=me(de.target,"[data-editor-option]");Ie&&(de.preventDefault(),m2e(Ie.dataset.editorOption),v2e(),dw(),Y.focus())}))}function sl(){return Ne().map(function(q){return q.dataset.notePath})}function T2e(){const q=new URLSearchParams(window.location.search);return q.get("empty")==="1"?[]:[nr(window.location.href)||sl()[0]||"index.md"].concat(q.getAll("stack").filter(Boolean))}function w2e(){return C2e(window.location.href)}function C2e(q){let Y;try{Y=new URL(q,window.location.href)}catch{return""}return(Y.searchParams.get("ok-highlight")||"").trim()}function k2e(q,Y){if(!q.length){const de=new URL(or("index.md"),window.location.href);return de.searchParams.set("empty","1"),de}const te=new URL(or(q[0]||"index.md"),window.location.href);return q.slice(1).forEach(function(de){te.searchParams.append("stack",de)}),Y&&te.searchParams.set("ok-highlight",Y),te}function e2(){const q=Ne().length,Y=q===0;t.classList.toggle("is-empty",Y),t.classList.toggle("is-single-panel",q===1),t.classList.toggle("is-multi-panel",q>1),r&&(r.hidden=!Y),Ne().forEach(ct),YP(),k1t(),p6(),u6()}function k1t(){const q=sl();Ne().forEach(function(Y,te){const de=Y.querySelector("[data-close-panel]");if(!de)return;const Ie=q.filter(function(Be,We){return We!==te});de.href=k2e(Ie).href})}function pw(){return Math.max(0,t.scrollWidth-t.clientWidth)}function gw(){return!!(b&&w&&k&&Ne().length>1&&pw()>1&&!t.classList.contains("is-empty"))}function u6(){window.requestAnimationFrame(E1t)}function E1t(){if(!b||!w||!k)return;if(!gw()){b.hidden=!0,b.setAttribute("aria-hidden","true"),k.style.width="",k.style.setProperty("--thumb-x","0px"),k.setAttribute("aria-valuemax","0"),k.setAttribute("aria-valuenow","0");return}b.hidden=!1,b.setAttribute("aria-hidden","false");const q=w.getBoundingClientRect().width;if(q<=0)return;const Y=pw(),te=ve(q*(t.clientWidth/t.scrollWidth),44,q),de=Math.max(0,q-te),Ie=Y>0?t.scrollLeft/Y*de:0;k.style.width=te+"px",k.style.setProperty("--thumb-x",ve(Ie,0,de)+"px"),k.setAttribute("aria-valuemax",String(Math.round(Y))),k.setAttribute("aria-valuenow",String(Math.round(t.scrollLeft)))}function XP(q,Y){if(!gw())return;const te=w.getBoundingClientRect(),de=k.getBoundingClientRect(),Ie=Math.max(0,te.width-de.width),Be=pw(),We=ve(q-te.left-Y,0,Ie);t.scrollLeft=Ie>0?We/Ie*Be:0}function dp(){const q=Ne(),Y=Eo()||q[q.length-1];if(!Y){document.title="Knowledge base - Open Knowledge";return}const te=(Y==null?void 0:Y.dataset.noteTitle)||(Y==null?void 0:Y.dataset.notePath)||"Open Knowledge";document.title=te+" - Open Knowledge"}function mw(q,Y,te){const de=k2e(q,te),Ie={stack:q};window.history.pushState(Ie,"",de)}function S1t(){W8e(),window.clearTimeout(_e),_e=window.setTimeout(function(){E2e(e,!0)},60)}function fp(q,Y,te){return q.getPropertyValue(Y).trim()||te}function A1t(){const q=window.getComputedStyle(document.documentElement),Y=fp(q,"--ok-color-page","#ffffff"),te=fp(q,"--ok-color-surface",Y),de=fp(q,"--ok-color-text","#202322"),Ie=fp(q,"--ok-color-muted","#707773"),Be=fp(q,"--ok-color-accent","#0b7a53"),We=fp(q,"--ok-color-border","#e3e6e4");return{startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,logLevel:"fatal",theme:"base",themeVariables:{background:Y,primaryColor:te,primaryTextColor:de,primaryBorderColor:We,lineColor:Ie,secondaryColor:Y,secondaryTextColor:de,secondaryBorderColor:We,tertiaryColor:te,tertiaryTextColor:de,tertiaryBorderColor:We,mainBkg:te,nodeBorder:Be,clusterBkg:Y,clusterBorder:We,titleColor:de,edgeLabelBackground:te,textColor:de,fontFamily:fp(q,"--ok-font-body","sans-serif")},flowchart:{htmlLabels:!1}}}function _1t(q){var te,de;const Y=[];return(te=q==null?void 0:q.matches)!=null&&te.call(q,"[data-mermaid-source]")&&Y.push(q),(de=q==null?void 0:q.querySelectorAll)==null||de.call(q,"[data-mermaid-source]").forEach(function(Ie){Y.push(Ie)}),Y}function R1t(q){var Be;const Y=me(q,"[data-mermaid-diagram]");if(Y)return Y;const te=document.createElement("figure");te.className="ok-mermaid",te.dataset.mermaidDiagram="";const de=document.createElement("div");de.className="ok-mermaid-output",de.dataset.mermaidOutput="",de.setAttribute("role","img"),de.setAttribute("aria-label","Mermaid diagram"),de.hidden=!0;const Ie=document.createElement("p");return Ie.className="ok-mermaid-error",Ie.dataset.mermaidError="",Ie.setAttribute("role","status"),Ie.textContent="This Mermaid diagram could not be rendered. Its source is shown below.",Ie.hidden=!0,q.parentNode.insertBefore(te,q),te.append(de,Ie,q),te._openKnowledgeMermaidSource=String(((Be=q.querySelector("code"))==null?void 0:Be.textContent)||q.textContent||""),te}function L1t(q){var Ie,Be;const Y=me(q,"[data-note-path]"),te=((Be=(Ie=Y==null?void 0:Y.querySelector(".note-body h1"))==null?void 0:Ie.textContent)==null?void 0:Be.trim())||(Y==null?void 0:Y.dataset.noteTitle)||"document",de=Array.from((Y==null?void 0:Y.querySelectorAll("[data-mermaid-diagram]"))||[q]);return"Mermaid diagram "+(Math.max(0,de.indexOf(q))+1)+" in "+te}function E2e(q,Y){if(!window.mermaid||typeof window.mermaid.render!="function")return;const te=_1t(q).map(R1t).filter(function(Ie){const Be=Ie.dataset.mermaidState||"";return Y||Be!=="queued"&&Be!=="rendering"&&Be!=="rendered"});if(!te.length)return;const de=++fe;te.forEach(function(Ie){Ie.dataset.mermaidState="queued",Ie._openKnowledgeMermaidRequest=de}),ne=ne.catch(function(){}).then(function(){return I1t(te,de)})}async function I1t(q,Y){try{window.mermaid.initialize(A1t())}catch{q.forEach(function(te){const de=te.querySelector("[data-mermaid-source]"),Ie=te.querySelector("[data-mermaid-output]"),Be=te.querySelector("[data-mermaid-error]");te._openKnowledgeMermaidRequest!==Y||!de||!Ie||!Be||(Ie.hidden=!0,de.hidden=!1,Be.hidden=!1,te.dataset.mermaidState="error")});return}for(const te of q){if(te._openKnowledgeMermaidRequest!==Y)continue;const de=te.querySelector("[data-mermaid-source]"),Ie=te.querySelector("[data-mermaid-output]"),Be=te.querySelector("[data-mermaid-error]");if(!(!de||!Ie||!Be)){te.dataset.mermaidState="rendering",Ie.setAttribute("aria-busy","true");try{const We=await window.mermaid.render("ok-mermaid-"+ ++ue,te._openKnowledgeMermaidSource);if(te._openKnowledgeMermaidRequest!==Y)continue;Ie.innerHTML=We.svg,typeof We.bindFunctions=="function"&&We.bindFunctions(Ie),Ie.hidden=!1,de.hidden=!0,Be.hidden=!0,V8e(Ie,L1t(te)),te.dataset.mermaidState="rendered"}catch{if(te._openKnowledgeMermaidRequest!==Y)continue;te.dataset.mermaidRendered!=="true"&&(Ie.hidden=!0,de.hidden=!1,Be.hidden=!1),te.dataset.mermaidState="error"}finally{Ie.removeAttribute("aria-busy")}te.dataset.mermaidState==="rendered"&&(te.dataset.mermaidRendered="true")}}}function D1t(q){q.querySelectorAll("table").forEach(function(Y){var Zt,sr,zt;if(Y.dataset.okTableEnhanced==="true")return;const te=(sr=(Zt=Y.tHead)==null?void 0:Zt.rows)==null?void 0:sr[0],de=(zt=Y.tBodies)==null?void 0:zt[0];if(!te||!de)return;const Ie=Array.prototype.slice.call(te.cells),Be=Array.prototype.slice.call(de.rows);if(!Ie.length||!Be.length)return;Y.classList.add("ok-table"),Y.dataset.okTable="",Y.dataset.okTableEnhanced="true",Be.forEach(function(Ut,er){Ut.dataset.okTableOriginalIndex=String(er)});const We=M1t(Y),ft={query:"",filters:Ie.map(function(){return""}),sortColumn:-1,sortDirection:"asc"},mt=document.createElement("span");mt.className="ok-table-count",mt.dataset.okTableCount="";function Nt(){let Ut=0;Be.forEach(function(er){const Ar=!ft.query||gp(er.textContent).includes(ft.query),yn=ft.filters.every(function(xi,ll){return!xi||gp(pp(er.cells[ll]))===xi}),xn=Ar&&yn;er.hidden=!xn,xn&&(Ut+=1)}),mt.textContent=Ut===Be.length?_2e(Be.length):Ut+" / "+_2e(Be.length)}Ie.forEach(function(Ut,er){O1t(Ut,de,Ie,Be,ft,er)});const St=N1t(Ie,Be,ft,mt,Nt);We.insertBefore(St,We.firstChild),Nt()})}function M1t(q){let Y=me(q,"[data-ok-table-wrap]");if(!Y){Y=document.createElement("div"),Y.className="ok-table-wrap",Y.dataset.okTableWrap="";const te=document.createElement("div");return te.className="ok-table-scroller",q.parentNode.insertBefore(Y,q),Y.append(te),te.append(q),Y}if(!me(q,".ok-table-scroller")){const te=document.createElement("div");te.className="ok-table-scroller",q.parentNode.insertBefore(te,q),te.append(q)}return Y}function N1t(q,Y,te,de,Ie){const Be=document.createElement("div");Be.className="ok-table-tools",Be.dataset.okTableControls="";const We=document.createElement("input");We.className="ok-table-search",We.type="search",We.placeholder="Filter table",We.setAttribute("aria-label","Filter table rows"),We.addEventListener("input",function(){te.query=gp(We.value),Ie()}),Be.append(We);const ft=document.createElement("div");ft.className="ok-table-filter-list";const mt=[];let Nt,St;function Zt(){const sr=te.filters.filter(Boolean).length;Nt&&(Nt.textContent=sr?"Filters ("+sr+")":"Filters"),St&&(St.disabled=sr===0)}if(q.forEach(function(sr,zt){const Ut=P1t(Y,zt);if(Ut.length<2||Ut.length>30)return;const er=document.createElement("select"),Ar=pp(sr)||"Column "+(zt+1);er.setAttribute("aria-label","Filter by "+Ar);const yn=document.createElement("option");yn.value="",yn.textContent=Ar+": All",er.append(yn),Ut.forEach(function(xn){const xi=document.createElement("option");xi.value=gp(xn),xi.textContent=xn,er.append(xi)}),er.addEventListener("change",function(){te.filters[zt]=er.value,Zt(),Ie()}),mt.push(er),ft.append(er)}),ft.children.length){const sr=document.createElement("details");sr.className="ok-table-filter-menu";const zt=document.createElement("summary");zt.className="ok-table-filter-trigger",zt.setAttribute("role","button"),zt.setAttribute("aria-label","Table filters"),Nt=document.createElement("span"),Nt.textContent="Filters",zt.append(Nt);const Ut=document.createElement("div");Ut.className="ok-table-filter-panel",St=document.createElement("button"),St.className="ok-table-clear",St.type="button",St.textContent="Clear filters",St.addEventListener("click",function(){te.filters=te.filters.map(function(){return""}),mt.forEach(function(er){er.value=""}),Zt(),Ie(),mt[0]&&mt[0].focus()}),Ut.append(ft,St),sr.append(zt,Ut),sr.addEventListener("keydown",function(er){er.key==="Escape"&&(sr.open=!1,zt.focus())}),Be.append(sr),Zt()}return Be.append(de),Be}function O1t(q,Y,te,de,Ie,Be){if(q.dataset.okTableSort="",q.tabIndex=0,q.setAttribute("aria-label","Sort by "+(pp(q)||"column "+(Be+1))),!q.querySelector(".ok-table-sort-indicator")){const ft=document.createElement("span");ft.className="ok-table-sort-indicator",ft.setAttribute("aria-hidden","true"),q.append(ft)}function We(ft){ft&&me(ft.target,"a[href], button, input, textarea, select, [contenteditable='true']")||$1t(Y,te,de,Ie,Be)}q.addEventListener("click",We),q.addEventListener("keydown",function(ft){ft.key!=="Enter"&&ft.key!==" "||(ft.preventDefault(),We(ft))})}function $1t(q,Y,te,de,Ie){const Be=de.sortColumn===Ie&&de.sortDirection==="asc"?"desc":"asc";de.sortColumn=Ie,de.sortDirection=Be,Y.forEach(function(ft){ft.removeAttribute("aria-sort"),ft.removeAttribute("data-sort-direction")}),Y[Ie].setAttribute("aria-sort",Be==="asc"?"ascending":"descending"),Y[Ie].dataset.sortDirection=Be;const We=Be==="asc"?1:-1;te.sort(function(ft,mt){const Nt=S2e(pp(ft.cells[Ie]),pp(mt.cells[Ie]));return Nt!==0?Nt*We:Number(ft.dataset.okTableOriginalIndex||0)-Number(mt.dataset.okTableOriginalIndex||0)}),te.forEach(function(ft){q.append(ft)})}function P1t(q,Y){const te=new Set,de=[];return q.forEach(function(Ie){const Be=pp(Ie.cells[Y]),We=gp(Be);!We||te.has(We)||Be.length>80||(te.add(We),de.push(Be))}),de.sort(function(Ie,Be){return S2e(Ie,Be)})}function S2e(q,Y){const te=gp(q),de=gp(Y);if(!te&&de)return 1;if(te&&!de)return-1;const Ie=A2e(te),Be=A2e(de);return Ie!==null&&Be!==null&&Ie!==Be?Ie-Be:te.localeCompare(de,void 0,{numeric:!0,sensitivity:"base"})}function A2e(q){const Y=String(q||"").replace(/,/g,"");return/^[+-]?\d+(?:\.\d+)?%?$/.test(Y)?Number(Y.replace(/%$/,"")):null}function pp(q){return String((q==null?void 0:q.textContent)||"").replace(/\s+/g," ").trim()}function gp(q){return pp({textContent:String(q||"")}).toLocaleLowerCase()}function _2e(q){return q+(q===1?" row":" rows")}function t2(){var Y;const q=Ne();q.forEach(function(te){te.querySelectorAll(".note-body a.is-active-note").forEach(function(de){de.classList.remove("is-active-note"),de.removeAttribute("aria-current")})}),q.forEach(function(te,de){var Be;const Ie=(Be=q[de+1])==null?void 0:Be.dataset.notePath;Ie&&te.querySelectorAll(".note-body a[href]").forEach(function(We){nr(We.getAttribute("href")||We.href,te.dataset.notePath)===Ie&&(We.classList.add("is-active-note"),We.setAttribute("aria-current","true"))})}),Pt(((Y=Eo()||q[q.length-1])==null?void 0:Y.dataset.notePath)||"",!1)}function h6(q){zh(q),window.requestAnimationFrame(function(){q.scrollIntoView({block:"nearest",inline:"end",behavior:De()?"auto":"smooth"}),q.focus({preventScroll:!0})})}function KP(q){(q||document).querySelectorAll("mark.ok-search-highlight").forEach(function(te){const de=te.parentNode;de&&(te.replaceWith.apply(te,Array.prototype.slice.call(te.childNodes)),de.normalize())})}function r2(q,Y){KP(e);const te=String(Y||"").trim(),de=q==null?void 0:q.querySelector(".note-body");!de||!te||window.requestAnimationFrame(function(){const Ie=B1t(de,te);if(!Ie)return;const Be=document.createElement("mark");Be.className="ok-search-highlight",Be.dataset.searchHighlight="",Be.append(Ie.extractContents()),Ie.insertNode(Be),Be.scrollIntoView({block:"center",inline:"nearest",behavior:De()?"auto":"smooth"}),q.focus({preventScroll:!0})})}function B1t(q,Y){const te=z1t(Y);if(!te)return null;const de=F1t(q),Ie=de.text.indexOf(te);if(Ie<0)return null;let Be=Ie,We=Ie+te.length;for(;BeBe&&de.text[We-1]===" ";)We--;const ft=de.positions[Be],mt=de.positions[We-1];if(!ft||!mt)return null;const Nt=document.createRange();return Nt.setStart(ft.node,ft.start),Nt.setEnd(mt.node,mt.end),Nt}function F1t(q){const Y=document.createTreeWalker(q,NodeFilter.SHOW_TEXT),te=[],de=[];let Ie=!0,Be;for(;Be=Y.nextNode();){if(me(Be.parentElement,"[hidden], [aria-hidden='true']"))continue;const We=Be.nodeValue||"";for(let ft=0;ft1&&!t.classList.contains("is-empty")}function ZP(){return vw&&P2e()}function p6(){t.classList.toggle("is-space-panning",ZP())}function Q1t(q){!$2e(q)||q.defaultPrevented||q.metaKey||q.ctrlKey||q.shiftKey||q.altKey||Z1t(q.target)||P2e()&&(vw=!0,p6(),q.preventDefault())}function J1t(q){!$2e(q)||!vw||(vw=!1,p6(),q.preventDefault())}function eyt(){vw=!1,p6()}function B2e(){n2=Date.now()+350,window.setTimeout(function(){Date.now()>=n2&&(n2=0)},360)}function tyt(q){return!n2||Date.now()>n2?!1:(n2=0,q.preventDefault(),q.stopPropagation(),!0)}function F2e(q){return q.getBoundingClientRect().width||et(q)||wt()}function z2e(q,Y){const te=ye(Y,q);return!te||!q?null:(q.style.setProperty("--note-panel-width",te+"px"),q.dataset.panelWidth=String(te),q.dataset.notePath&&(I[q.dataset.notePath]=te),u6(),te)}function ryt(q,Y,te){return(q==="left"?-Y:Y)*(te?2:1)}function nyt(q,Y,te){const de=(te.key||"").toLowerCase(),Ie=F2e(q),Be=te.shiftKey?64:24;let We=Ie;if(de==="arrowleft")We+=Y==="left"?Be:-Be;else if(de==="arrowright")We+=Y==="right"?Be:-Be;else if(de==="home")We=oe();else if(de==="end")We=ut(q);else return;te.preventDefault(),te.stopPropagation();const ft=z2e(q,We);ft&&(Y==="left"&&!dt(q)&&(t.scrollLeft+=ft-Ie),Te())}function iyt(q){const Y=me(q.target,"[data-panel-resize-handle]"),te=Y==null?void 0:Y.closest("[data-note-path]");if(!(!Y||!te||q.button!==0)){Mi={pointerId:q.pointerId,panel:te,handle:Y,edge:Y.dataset.panelResizeHandle==="left"?"left":"right",centered:dt(te),startX:q.clientX,startWidth:F2e(te),startScrollLeft:t.scrollLeft,moved:!1},zh(te),te.classList.add("is-panel-resizing"),document.body.classList.add("is-panel-resizing"),window.addEventListener("pointermove",G2e),window.addEventListener("pointerup",g6),window.addEventListener("pointercancel",g6),window.addEventListener("blur",V2e),q.preventDefault(),q.stopPropagation();try{Y.setPointerCapture(q.pointerId)}catch{}}}function G2e(q){if(!Mi||q.pointerId!==Mi.pointerId)return;const Y=q.clientX-Mi.startX;Math.abs(Y)>2&&(Mi.moved=!0);const te=Mi.startWidth+ryt(Mi.edge,Y,Mi.centered),de=z2e(Mi.panel,te);de&&(Mi.edge==="left"&&!Mi.centered&&(t.scrollLeft=Mi.startScrollLeft+(de-Mi.startWidth)),q.preventDefault())}function q2e(q){if(!Mi)return;const Y=Mi.moved;Mi.panel.classList.remove("is-panel-resizing");try{q!==void 0&&Mi.handle.releasePointerCapture(q)}catch{}Mi=null,document.body.classList.remove("is-panel-resizing"),window.removeEventListener("pointermove",G2e),window.removeEventListener("pointerup",g6),window.removeEventListener("pointercancel",g6),window.removeEventListener("blur",V2e),Y&&(Te(),B2e())}function g6(q){!Mi||q.pointerId!==Mi.pointerId||q2e(q.pointerId)}function V2e(){q2e()}function ayt(q){return(q.pointerType||"mouse")!=="mouse"||!O2e.matches||q.button!==0||Ne().length<2||q.defaultPrevented||q.metaKey||q.ctrlKey||q.shiftKey||q.altKey?!1:ZP()?!j1t(q.target):!me(q.target,"[data-note-path], a, button, input, textarea, select, [contenteditable='true'], [role='button']")}function syt(q){if(!ayt(q))return;const Y=ZP();ol={pointerId:q.pointerId,startX:q.clientX,startScrollLeft:t.scrollLeft,moved:!1,fromSpacePan:Y},t.classList.add("is-drag-scrolling"),Y&&q.preventDefault();try{t.setPointerCapture(q.pointerId)}catch{}}function oyt(q){if(!ol||q.pointerId!==ol.pointerId)return;const Y=q.clientX-ol.startX;Math.abs(Y)<3&&!ol.moved||(ol.moved=!0,t.scrollLeft=ol.startScrollLeft-Y,q.preventDefault())}function W2e(q){if(!ol||q.pointerId!==ol.pointerId)return;const Y=ol;try{t.releasePointerCapture(q.pointerId)}catch{}(Y.moved||Y.fromSpacePan)&&B2e(),ol=null,t.classList.remove("is-drag-scrolling")}function lyt(q){if(!gw()||q.button!==0)return;const Y=k.getBoundingClientRect();oc={pointerId:q.pointerId,thumbOffset:ve(q.clientX-Y.left,0,Y.width)},b.classList.add("is-rail-dragging"),window.addEventListener("pointermove",QP),window.addEventListener("pointerup",i2),window.addEventListener("pointercancel",i2),window.addEventListener("blur",H2e),XP(q.clientX,oc.thumbOffset),q.preventDefault();try{k.setPointerCapture(q.pointerId)}catch{}}function cyt(q){if(!gw()||q.button!==0||me(q.target,"[data-workspace-scroll-thumb]"))return;const Y=k.getBoundingClientRect();XP(q.clientX,Y.width/2),q.preventDefault()}function QP(q){!oc||q.pointerId!==oc.pointerId||(XP(q.clientX,oc.thumbOffset),q.preventDefault())}function U2e(q){const Y=q??oc.pointerId;try{k.releasePointerCapture(Y)}catch{}oc=null,b.classList.remove("is-rail-dragging"),window.removeEventListener("pointermove",QP),window.removeEventListener("pointerup",i2),window.removeEventListener("pointercancel",i2),window.removeEventListener("blur",H2e)}function i2(q){!oc||q.pointerId!==oc.pointerId||U2e(q.pointerId)}function H2e(){oc&&U2e()}function uyt(q){if(!gw())return;const Y=Math.max(48,t.clientWidth*.12),te=Math.max(120,t.clientWidth*.72);let de=t.scrollLeft;const Ie=(q.key||"").toLowerCase();if(Ie==="arrowleft")de-=Y;else if(Ie==="arrowright")de+=Y;else if(Ie==="pageup")de-=te;else if(Ie==="pagedown")de+=te;else if(Ie==="home")de=0;else if(Ie==="end")de=pw();else return;q.preventDefault(),t.scrollLeft=ve(de,0,pw())}if(t.addEventListener("pointerdown",syt),t.addEventListener("pointermove",oyt),t.addEventListener("pointerup",W2e),t.addEventListener("pointercancel",W2e),t.addEventListener("scroll",u6),window.addEventListener("keydown",Q1t,!0),window.addEventListener("keyup",J1t,!0),window.addEventListener("blur",eyt),window.addEventListener("resize",u6),w&&k&&(w.addEventListener("pointerdown",cyt),k.addEventListener("pointerdown",lyt),k.addEventListener("pointermove",QP),k.addEventListener("pointerup",i2),k.addEventListener("pointercancel",i2),k.addEventListener("keydown",uyt)),t.addEventListener("click",function(q){if(tyt(q))return;const Y=me(q.target,"[data-note-path]");Y&&zh(Y);const te=me(q.target,"[data-close-panel]");if(te){const mt=te.closest("[data-note-path]");if(!mt)return;q.preventDefault(),f6(mt);return}const de=me(q.target,"[data-tree-path]"),Ie=me(q.target,"[data-graph-path]");if(de||Ie){if(q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;q.preventDefault(),mp((de==null?void 0:de.dataset.treePath)||Ie.dataset.graphPath,!0,H(q.shiftKey),"",Eo());return}const Be=me(q.target,"a[href]");if(!Be||Be.dataset.directLink==="true"||q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;const We=Be.closest("[data-note-path]");if(!We)return;const ft=nr(Be.getAttribute("href")||Be.href,We.dataset.notePath);ft&&(q.preventDefault(),mp(ft,!0,H(q.shiftKey),"",We))}),t.addEventListener("keydown",function(q){if(q.key!=="Enter"||!q.shiftKey||q.metaKey||q.ctrlKey||q.altKey)return;const Y=me(q.target,".note-body a[href]"),te=Y==null?void 0:Y.closest("[data-note-path]");if(!Y||!te)return;const de=nr(Y.getAttribute("href")||Y.href,te.dataset.notePath);de&&(q.preventDefault(),mp(de,!0,H(!0),"",te))}),t.addEventListener("focusin",function(q){const Y=me(q.target,"[data-note-path]");Y&&zh(Y)}),window.OpenKnowledgeShortcuts&&window.OpenKnowledgeShortcuts.register(Ae),i){const q={id:"viewer.sidebar.toggle",code:"KeyS",metaOrCtrlKey:!0,altKey:!0,label:"⌘⌥S",ariaKeyShortcut:"Meta+Alt+S",run:Ft},Y=window.OpenKnowledgeShortcuts;if(i.addEventListener("click",Ft),Y){Y.register(q);const te=Y.format(q);i.title="File explorer ("+te+")",i.setAttribute("aria-keyshortcuts",Y.ariaKeyShortcut(q)),document.querySelectorAll("[data-sidebar-shortcut]").forEach(function(de){de.textContent=te})}}a&&a.addEventListener("click",function(){_t(!1),i==null||i.focus()}),n&&n.addEventListener("click",function(q){const Y=me(q.target,"[data-tree-path]"),te=Y||me(q.target,"a[href]");if(!te||q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;const de=(Y==null?void 0:Y.dataset.treePath)||nr(te.getAttribute("href")||te.href);de&&(q.preventDefault(),Y2e(te),mp(de,!0,H(q.shiftKey),"",Eo()),C.matches&&_t(!1))});function Y2e(q){const Y=me(q,".search");if(!Y)return;const te=Y.querySelector(".search-input"),de=Y.querySelector(".search-results"),Ie=Y.querySelector(".search-status");te&&(te.value=""),Ie&&(Ie.textContent=""),de&&(de.hidden=!0,de.replaceChildren())}window.addEventListener("popstate",function(){const q=T2e();N2e(q,w2e())}),document.addEventListener("click",function(q){const Y=me(q.target,".search-result[href]");if(Y){if(q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;const te=nr(Y.getAttribute("href")||Y.href);if(te){q.preventDefault();const de=q.shiftKey||Y.dataset.openBeside==="true",Ie=H(de);delete Y.dataset.openBeside,Y2e(Y),mp(te,!0,Ie,C2e(Y.getAttribute("href")||Y.href),Eo());return}}me(q.target,"[data-editor-picker]")||dw(),me(q.target,"[data-viewer-settings]")||fw(!1)}),document.addEventListener("keydown",function(q){q.key==="Escape"&&(dw(),fw(!1),_t(!1))});const bw=T2e(),X2e=w2e();he(),x1t(),ps(),Ln(),Ne().forEach(D2e),YP(),bw.length!==1||bw[0]!==((K2e=Ne()[0])==null?void 0:K2e.dataset.notePath)?(window.history.replaceState({stack:bw},"",window.location.href),N2e(bw,X2e)):(window.history.replaceState({stack:bw},"",window.location.href),e2(),t2(),dp(),r2(Eo(),X2e))})(),(()=>{const t=Array.from(document.querySelectorAll(".search"));if(t.length===0)return;const e=w(),r=document.querySelector("[data-primary-search]")||t[0],n=r==null?void 0:r.querySelector(".search-input"),i=window.OpenKnowledgeShortcuts,a={id:"viewer.search.focus",key:"k",metaOrCtrlKey:!0,label:"⌘K",allowEditable:!0,run:()=>{n==null||n.focus(),n==null||n.select()}};t.forEach(s),i?(i.register(a),document.querySelectorAll("[data-search-shortcut]").forEach(A=>{A.textContent=i.format(a)})):document.addEventListener("keydown",A=>{(A.metaKey||A.ctrlKey)&&!A.altKey&&A.key.toLowerCase()==="k"&&(A.preventDefault(),n==null||n.focus(),n==null||n.select())});function s(A){const R=A.querySelector(".search-input"),N=A.querySelector(".search-results"),D=A.querySelector(".search-status");if(!R||!N||!D)return;const I=A.dataset.searchUrl||"/api/search";let $=0,B=null,P=-1,G=0,V="";m(R,N),K(!1),A===r&&(V=o(),V&&(R.value=V,window.requestAnimationFrame(()=>{R.focus(),R.select(),W(V)}))),R.addEventListener("input",()=>{if(V="",l(),window.clearTimeout($),J(-1,!1),!R.value.trim()){ie(!0);return}$=window.setTimeout(X,140)}),R.addEventListener("focus",()=>{if(!R.value.trim()){ie(!0);return}y(N).length>0?se(!0):X()}),R.addEventListener("keydown",Z=>{const ee=y(N);if(Z.key==="ArrowDown"||Z.key==="ArrowUp"){if(!ee.length)return;Z.preventDefault();const ne=Z.key==="ArrowDown"?1:-1,ue=P<0?ne>0?0:ee.length-1:(P+ne+ee.length)%ee.length;J(ue,!0),se(!0);return}if(Z.key==="Enter"){const ne=v(N,P);if(!ne)return;Z.preventDefault(),ne.dataset.openBeside=Z.shiftKey?"true":"false",ne.click(),K(!0);return}Z.key==="Escape"&&(!N.hidden||R.value)&&(Z.preventDefault(),K(!0))}),N.addEventListener("mousemove",Z=>{const ee=x(Z.target);if(!ee)return;const ne=y(N).indexOf(ee);ne>=0&&J(ne,!1)}),N.addEventListener("focusin",Z=>{const ee=x(Z.target);if(!ee)return;const ne=y(N).indexOf(ee);ne>=0&&J(ne,!1)}),N.addEventListener("click",Z=>{!x(Z.target)||b(Z)||K(!0)}),document.addEventListener("pointerdown",Z=>{!N.hidden&&!A.contains(Z.target)&&K(!0)}),document.addEventListener("focusin",Z=>{!N.hidden&&!A.contains(Z.target)&&K(!0)});async function X(){const Z=R.value.trim();if(!Z){ie(document.activeElement===R);return}const ee=++G;if(J(-1,!1),e.length>0){u(N,D,k(Z),Z,se,J);return}B&&B.abort(),B=new AbortController,D.textContent="Searching...";try{const ne=await fetch(I+"?q="+encodeURIComponent(Z)+"&limit=12",{signal:B.signal});if(!ne.ok)throw new Error("search request failed");const ue=await ne.json();if(ee!==G||R.value.trim()!==Z)return;u(N,D,ue.results||[],Z,se,J)}catch(ne){if(ne.name==="AbortError")return;D.textContent="Search failed.",J(-1,!1),se(!1)}}async function W(Z){var _e;const ee=String(Z||"").trim();if(!ee)return;const ne=++G,ue=((_e=document.querySelector("[data-note-path]"))==null?void 0:_e.dataset.notePath)||"";if(J(-1,!1),e.length>0){const Ae=S(ee,ue);u(N,D,Ae,ee,se,J,{emptyStatus:'No other notes tagged "'+ee+'".',keepOpenWhenEmpty:!0,statusText:Ae.length+" note"+(Ae.length===1?"":"s")+' tagged "'+ee+'"'});return}B&&B.abort(),B=new AbortController,D.textContent="Finding tagged notes...";const fe=new URLSearchParams({tag:ee,limit:"30"});ue&&fe.set("exclude",ue);try{const Ae=await fetch(I+"?"+fe.toString(),{signal:B.signal});if(!Ae.ok)throw new Error("tag search request failed");const Ne=await Ae.json();if(ne!==G||V!==ee)return;const me=Ne.results||[];u(N,D,me,ee,se,J,{emptyStatus:'No other notes tagged "'+ee+'".',keepOpenWhenEmpty:!0,statusText:me.length+" note"+(me.length===1?"":"s")+' tagged "'+ee+'"'})}catch(Ae){if(Ae.name==="AbortError")return;D.textContent="Tag lookup failed.",J(-1,!1),se(!1)}}function ie(Z){G+=1,window.clearTimeout($),B&&(B.abort(),B=null);const ee=p();D.textContent=ee.length?"Top files":"",u(N,D,ee,"",se,J,{emptyStatus:"",keepOpenWhenEmpty:Z,statusText:ee.length?"Top files":""}),se(Z&&ee.length>0)}function K(Z){G+=1,window.clearTimeout($),B&&(B.abort(),B=null),Z&&(R.value="",V="",l()),D.textContent="",N.replaceChildren(),J(-1,!1),se(!1)}function se(Z){N.hidden=!Z,R.setAttribute("aria-expanded",Z?"true":"false"),Z||R.removeAttribute("aria-activedescendant")}function J(Z,ee){const ne=y(N);P=ne.length?(Z+ne.length)%ne.length:-1,ne.forEach((ue,fe)=>{const _e=fe===P;ue.classList.toggle("is-active",_e),ue.setAttribute("aria-selected",_e?"true":"false"),_e&&(R.setAttribute("aria-activedescendant",ue.id),ee&&ue.scrollIntoView({block:"nearest"}))}),P<0&&R.removeAttribute("aria-activedescendant")}}function o(){try{return(new URL(window.location.href).searchParams.get("ok-tag")||"").trim()}catch{return""}}function l(){let A;try{A=new URL(window.location.href)}catch{return}A.searchParams.has("ok-tag")&&(A.searchParams.delete("ok-tag"),window.history.replaceState(window.history.state,"",A))}function u(A,R,N,D,I,$,B){const P=B||{},G=h(N);if(A.replaceChildren(),G.length===0){const V=P.emptyStatus??'No results for "'+D+'".';if(R.textContent=V,V){const X=document.createElement("div");X.className="search-empty",X.textContent=V,A.append(X)}$(-1,!1),I(!!P.keepOpenWhenEmpty);return}R.textContent=P.statusText||G.length+" document"+(G.length===1?"":"s"),I(!0),G.forEach((V,X)=>{const W=document.createElement("a");W.className="search-result",W.href=V.highlightURL||V.url||O(V.path),W.id=A.id+"-option-"+X,W.setAttribute("role","option"),W.setAttribute("aria-selected","false"),W.title=d();const ie=document.createElement("span");ie.className="search-result-title-row";const K=document.createElement("span");if(K.className="search-result-title",f(K,V.title||V.path,D),ie.append(K),V.matchCount>1){const J=document.createElement("span");J.className="search-result-count",J.textContent=V.matchCount+" matches",ie.append(J)}W.append(ie);const se=document.createElement("span");if(se.className="search-result-meta",se.textContent=[V.path,V.type,V.matchCount===1?V.heading:""].filter(Boolean).join(" - "),W.append(se),V.snippet){const J=document.createElement("span");J.className="search-result-snippet",f(J,V.snippet,D),W.append(J)}if(V.headings.length>1){const J=document.createElement("span");J.className="search-result-headings",J.textContent=V.headings.slice(0,3).join(" · "),W.append(J)}A.append(W)}),$(0,!1)}function h(A){const R=[],N=new Map;return A.forEach((D,I)=>{const $=D.path||"__result-"+I;let B=N.get($);B||(B=Object.assign({},D,{matchCount:0,headings:[]}),N.set($,B),R.push(B)),B.matchCount+=1,D.heading&&!B.headings.includes(D.heading)&&B.headings.push(D.heading),!B.snippet&&D.snippet&&(B.snippet=D.snippet)}),R}function d(){return document.documentElement.dataset.viewerNavigationMode==="beside"?"Links open beside. Hold Shift to replace the current panel.":"Links open in the current panel. Hold Shift to open beside."}function f(A,R,N){const D=String(R||""),I=String(N||"").trim();if(!I){A.textContent=D;return}const $=D.toLocaleLowerCase(),B=I.toLocaleLowerCase();let P=0,G=$.indexOf(B);for(;G>=0;){G>P&&A.append(document.createTextNode(D.slice(P,G)));const V=document.createElement("mark");V.className="search-result-highlight",V.textContent=D.slice(G,G+I.length),A.append(V),P=G+I.length,G=$.indexOf(B,P)}P=12)break}return R.sort(function($,B){return g($.path)!==g(B.path)?g($.path)?1:-1:0})}function g(A){return String(A||"").split("/").pop().toLowerCase()==="index.md"}function m(A,R){R.id||(R.id=(A.id||"viewer-search")+"-results-"+Math.random().toString(36).slice(2)),R.setAttribute("role","listbox"),A.setAttribute("role","combobox"),A.setAttribute("aria-autocomplete","list"),A.setAttribute("aria-controls",R.id),A.setAttribute("aria-expanded","false")}function y(A){return Array.from(A.querySelectorAll(".search-result[href]"))}function v(A,R){const N=y(A);return N.length?N[R>=0?R:0]||N[0]:null}function x(A){return A?A.closest?A.closest(".search-result[href]"):A.parentElement?A.parentElement.closest(".search-result[href]"):null:null}function b(A){return A.button!==0||A.metaKey||A.ctrlKey||A.shiftKey||A.altKey}function w(){var N;const A=(N=window.OpenKnowledgeStaticData)==null?void 0:N.notes;if(Array.isArray(A))return A;const R=document.querySelector("[data-static-notes]");if(!R)return[];try{const D=JSON.parse(R.textContent||"[]");return Array.isArray(D)?D:[]}catch{return[]}}function k(A){const R=C(A);return e.map(function(N){const D=_(N.body||""),I=_(N.frontmatter||""),$=N.title||N.path||"",B=N.path||"",P=[I,D].filter(Boolean).join(" "),G=C([$,B,P].join(" ")),V=C($).includes(R),X=C(B).includes(R);if(!G.includes(R))return null;const ie=(V?3:0)+(X?2:0)+1;return{path:B,title:$,snippet:L(P,A),score:g(B)?ie*.55:ie}}).filter(Boolean).sort(function(N,D){return D.score!==N.score?D.score-N.score:g(N.path)!==g(D.path)?g(N.path)?1:-1:N.path.localeCompare(D.path)}).slice(0,12)}function S(A,R){const N=C(A).trim();return e.filter(function(D){return D.path!==R&&Array.isArray(D.tags)&&D.tags.some(function(I){return C(I).trim()===N})}).map(function(D){return{path:D.path,title:D.title||D.path,url:O(D.path),type:"tagged note"}}).sort(function(D,I){return D.path.localeCompare(I.path)})}function C(A){return String(A||"").toLowerCase()}function _(A){const R=document.createElement("div");return R.innerHTML=A,R.textContent||""}function L(A,R){const N=String(A||"").replace(/\s+/g," ").trim();if(!N)return"";const D=N.toLowerCase().indexOf(String(R||"").toLowerCase()),I=Math.max(0,D<0?0:D-48),$=Math.min(N.length,I+140);return(I>0?"...":"")+N.slice(I,$)+($15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;a+15t.replace(Y8e,"-$1").toLowerCase(),K8e={"&":"&",">":">","<":"<",'"':""","'":"'"},j8e=/[&><"']/g,Ia=t=>String(t).replace(j8e,e=>K8e[e]),gC=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?gC(t.body[0]):t:t.type==="font"?gC(t.body):t,Z8e=new Set(["mathord","textord","atom"]),Ec=t=>Z8e.has(gC(t).type),Q8e=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},mC={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function J8e(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function eRe(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return J8e(e)}function tRe(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:eRe(n)}class p7{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r of Object.keys(mC)){var n=mC[r];n&&tRe(this,r,e,n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Dt("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var r=Q8e(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class $u{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return Tl[rRe[this.id]]}sub(){return Tl[nRe[this.id]]}fracNum(){return Tl[iRe[this.id]]}fracDen(){return Tl[aRe[this.id]]}cramp(){return Tl[sRe[this.id]]}text(){return Tl[oRe[this.id]]}isTight(){return this.size>=2}}var g7=0,yC=1,n0=2,Sc=3,hb=4,oo=5,i0=6,Ua=7,Tl=[new $u(g7,0,!1),new $u(yC,0,!0),new $u(n0,1,!1),new $u(Sc,1,!0),new $u(hb,2,!1),new $u(oo,2,!0),new $u(i0,3,!1),new $u(Ua,3,!0)],rRe=[hb,oo,hb,oo,i0,Ua,i0,Ua],nRe=[oo,oo,oo,oo,Ua,Ua,Ua,Ua],iRe=[n0,Sc,hb,oo,i0,Ua,i0,Ua],aRe=[Sc,Sc,oo,oo,Ua,Ua,Ua,Ua],sRe=[yC,yC,Sc,Sc,oo,oo,Ua,Ua],oRe=[g7,yC,n0,Sc,n0,Sc,n0,Sc],Ir={DISPLAY:Tl[g7],TEXT:Tl[n0],SCRIPT:Tl[hb],SCRIPTSCRIPT:Tl[i0]},m7=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function lRe(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var vC=[];m7.forEach(t=>t.blocks.forEach(e=>vC.push(...e)));function dY(t){for(var e=0;e=vC[e]&&t<=vC[e+1])return!0;return!1}var Pi=t=>t+" "+t,a0=80,cRe=function(e,r){return"M95,"+(622+e+r)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 @@ -316,7 +316,7 @@ c5.3,-9.3,12,-14,20,-14 H400000v`+(40+e)+`H845.2724 s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},Z8e=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119 +M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},uRe=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119 c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 c340,-704.7,510.7,-1060.3,512,-1067 l`+e/2.084+" -"+e+` @@ -326,7 +326,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5, c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},Q8e=function(e,r){return"M983 "+(10+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},hRe=function(e,r){return"M983 "+(10+e+r)+` l`+e/3.13+" -"+e+` c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 @@ -335,7 +335,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},J8e=function(e,r){return"M424,"+(2398+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},dRe=function(e,r){return"M424,"+(2398+e+r)+` c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 @@ -345,18 +345,18 @@ v`+(40+e)+`H1014.6 s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+r+` -h400000v`+(40+e)+"h-400000z"},eRe=function(e,r){return"M473,"+(2713+e+r)+` +h400000v`+(40+e)+"h-400000z"},fRe=function(e,r){return"M473,"+(2713+e+r)+` c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+` c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},tRe=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},rRe=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+` +606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},pRe=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},gRe=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+` H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},nRe=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=j8e(r,ip);break;case"sqrtSize1":i=Z8e(r,ip);break;case"sqrtSize2":i=Q8e(r,ip);break;case"sqrtSize3":i=J8e(r,ip);break;case"sqrtSize4":i=eRe(r,ip);break;case"sqrtTall":i=rRe(r,ip,n)}return i},iRe=function(e,r){switch(e){case"⎜":return Pi("M291 0 H417 V"+r+" H291z");case"∣":return Pi("M145 0 H188 V"+r+" H145z");case"∥":return Pi("M145 0 H188 V"+r+" H145z")+Pi("M367 0 H410 V"+r+" H367z");case"⎟":return Pi("M457 0 H583 V"+r+" H457z");case"⎢":return Pi("M319 0 H403 V"+r+" H319z");case"⎥":return Pi("M263 0 H347 V"+r+" H263z");case"⎪":return Pi("M384 0 H504 V"+r+" H384z");case"⏐":return Pi("M312 0 H355 V"+r+" H312z");case"‖":return Pi("M257 0 H300 V"+r+" H257z")+Pi("M478 0 H521 V"+r+" H478z");default:return""}},oY={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},mRe=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=cRe(r,a0);break;case"sqrtSize1":i=uRe(r,a0);break;case"sqrtSize2":i=hRe(r,a0);break;case"sqrtSize3":i=dRe(r,a0);break;case"sqrtSize4":i=fRe(r,a0);break;case"sqrtTall":i=gRe(r,a0,n)}return i},yRe=function(e,r){switch(e){case"⎜":return Pi("M291 0 H417 V"+r+" H291z");case"∣":return Pi("M145 0 H188 V"+r+" H145z");case"∥":return Pi("M145 0 H188 V"+r+" H145z")+Pi("M367 0 H410 V"+r+" H367z");case"⎟":return Pi("M457 0 H583 V"+r+" H457z");case"⎢":return Pi("M319 0 H403 V"+r+" H319z");case"⎥":return Pi("M263 0 H347 V"+r+" H263z");case"⎪":return Pi("M384 0 H504 V"+r+" H384z");case"⏐":return Pi("M312 0 H355 V"+r+" H312z");case"‖":return Pi("M257 0 H300 V"+r+" H257z")+Pi("M478 0 H521 V"+r+" H478z");default:return""}},fY={doubleleftarrow:`M262 157 l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 @@ -527,7 +527,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z` c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},aRe=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 v84 h347 v-84 +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},vRe=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 v84 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+r+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15 @@ -555,48 +555,48 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function sRe(t){return"toText"in t}class ap{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r{if(sRe(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var d7={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},oRe={ex:!0,em:!0,mu:!0},lY=function(e){return typeof e!="string"&&(e=e.unit),e in d7||e in oRe||e==="ex"},Xn=function(e,r){var n;if(e.unit in d7)n=d7[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new Dt("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},$t=function(e){return+e.toFixed(4)+"em"},Pu=function(e){return e.filter(r=>r).join(" ")},f7=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=O8e(n)+":"+i+";")}return r},cY=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},uY=function(e){var r=document.createElement(e);r.className=Pu(this.classes),Object.assign(r.style,this.style);for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i/=\x00-\x1f]/,hY=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Ia(Pu(this.classes))+'"');var n=f7(this.style);n&&(r+=' style="'+Ia(n)+'"');for(var i of Object.keys(this.attributes)){if(lRe.test(i))throw new Dt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+Ia(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class sp{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,cY.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return uY.call(this,"span")}toMarkup(){return hY.call(this,"span")}}let mC=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,cY.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return uY.call(this,"a")}toMarkup(){return hY.call(this,"a")}};class cRe{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e=''+Ia(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=$t(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Pu(this.classes)),Object.keys(this.style).length>0&&(r=r||document.createElement("span"),Object.assign(r.style,this.style)),r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+$t(this.italic)+";"),n+=f7(this.style),n&&(e=!0,r+=' style="'+Ia(n)+'"');var i=Ia(this.text);return e?(r+=">",r+=i,r+="",r):i}}class Ac{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}}class p7{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var fRe=t=>t instanceof sp||t instanceof mC||t instanceof ap,wl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},yC={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},dY={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function fY(t,e){wl[t]=e}function g7(t,e,r){if(!wl[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=wl[e][n];if(!i&&t[0]in dY&&(n=dY[t[0]].charCodeAt(0),i=wl[e][n]),!i&&r==="text"&&sY(n)&&(i=wl[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var m7={};function pRe(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!m7[e]){var r=m7[e]={cssEmPerMu:yC.quad[e]/18};for(var n in yC)yC.hasOwnProperty(n)&&(r[n]=yC[n][e])}return m7[e]}var Wn={math:{},text:{}};function U(t,e,r,n,i,a){Wn[t][i]={font:e,group:r,replace:n},a&&n&&(Wn[t][n]=Wn[t][i])}var Q="math",kt="text",ce="main",$e="ams",Un="accent-token",Yt="bin",Ha="close",op="inner",mr="mathord",ki="op-token",Gs="open",ub="punct",ze="rel",_c="spacing",He="textord";U(Q,ce,ze,"≡","\\equiv",!0),U(Q,ce,ze,"≺","\\prec",!0),U(Q,ce,ze,"≻","\\succ",!0),U(Q,ce,ze,"∼","\\sim",!0),U(Q,ce,ze,"⊥","\\perp"),U(Q,ce,ze,"⪯","\\preceq",!0),U(Q,ce,ze,"⪰","\\succeq",!0),U(Q,ce,ze,"≃","\\simeq",!0),U(Q,ce,ze,"∣","\\mid",!0),U(Q,ce,ze,"≪","\\ll",!0),U(Q,ce,ze,"≫","\\gg",!0),U(Q,ce,ze,"≍","\\asymp",!0),U(Q,ce,ze,"∥","\\parallel"),U(Q,ce,ze,"⋈","\\bowtie",!0),U(Q,ce,ze,"⌣","\\smile",!0),U(Q,ce,ze,"⊑","\\sqsubseteq",!0),U(Q,ce,ze,"⊒","\\sqsupseteq",!0),U(Q,ce,ze,"≐","\\doteq",!0),U(Q,ce,ze,"⌢","\\frown",!0),U(Q,ce,ze,"∋","\\ni",!0),U(Q,ce,ze,"∝","\\propto",!0),U(Q,ce,ze,"⊢","\\vdash",!0),U(Q,ce,ze,"⊣","\\dashv",!0),U(Q,ce,ze,"∋","\\owns"),U(Q,ce,ub,".","\\ldotp"),U(Q,ce,ub,"⋅","\\cdotp"),U(Q,ce,ub,"⋅","·"),U(kt,ce,He,"⋅","·"),U(Q,ce,He,"#","\\#"),U(kt,ce,He,"#","\\#"),U(Q,ce,He,"&","\\&"),U(kt,ce,He,"&","\\&"),U(Q,ce,He,"ℵ","\\aleph",!0),U(Q,ce,He,"∀","\\forall",!0),U(Q,ce,He,"ℏ","\\hbar",!0),U(Q,ce,He,"∃","\\exists",!0),U(Q,ce,He,"∇","\\nabla",!0),U(Q,ce,He,"♭","\\flat",!0),U(Q,ce,He,"ℓ","\\ell",!0),U(Q,ce,He,"♮","\\natural",!0),U(Q,ce,He,"♣","\\clubsuit",!0),U(Q,ce,He,"℘","\\wp",!0),U(Q,ce,He,"♯","\\sharp",!0),U(Q,ce,He,"♢","\\diamondsuit",!0),U(Q,ce,He,"ℜ","\\Re",!0),U(Q,ce,He,"♡","\\heartsuit",!0),U(Q,ce,He,"ℑ","\\Im",!0),U(Q,ce,He,"♠","\\spadesuit",!0),U(Q,ce,He,"§","\\S",!0),U(kt,ce,He,"§","\\S"),U(Q,ce,He,"¶","\\P",!0),U(kt,ce,He,"¶","\\P"),U(Q,ce,He,"†","\\dag"),U(kt,ce,He,"†","\\dag"),U(kt,ce,He,"†","\\textdagger"),U(Q,ce,He,"‡","\\ddag"),U(kt,ce,He,"‡","\\ddag"),U(kt,ce,He,"‡","\\textdaggerdbl"),U(Q,ce,Ha,"⎱","\\rmoustache",!0),U(Q,ce,Gs,"⎰","\\lmoustache",!0),U(Q,ce,Ha,"⟯","\\rgroup",!0),U(Q,ce,Gs,"⟮","\\lgroup",!0),U(Q,ce,Yt,"∓","\\mp",!0),U(Q,ce,Yt,"⊖","\\ominus",!0),U(Q,ce,Yt,"⊎","\\uplus",!0),U(Q,ce,Yt,"⊓","\\sqcap",!0),U(Q,ce,Yt,"∗","\\ast"),U(Q,ce,Yt,"⊔","\\sqcup",!0),U(Q,ce,Yt,"◯","\\bigcirc",!0),U(Q,ce,Yt,"∙","\\bullet",!0),U(Q,ce,Yt,"‡","\\ddagger"),U(Q,ce,Yt,"≀","\\wr",!0),U(Q,ce,Yt,"⨿","\\amalg"),U(Q,ce,Yt,"&","\\And"),U(Q,ce,ze,"⟵","\\longleftarrow",!0),U(Q,ce,ze,"⇐","\\Leftarrow",!0),U(Q,ce,ze,"⟸","\\Longleftarrow",!0),U(Q,ce,ze,"⟶","\\longrightarrow",!0),U(Q,ce,ze,"⇒","\\Rightarrow",!0),U(Q,ce,ze,"⟹","\\Longrightarrow",!0),U(Q,ce,ze,"↔","\\leftrightarrow",!0),U(Q,ce,ze,"⟷","\\longleftrightarrow",!0),U(Q,ce,ze,"⇔","\\Leftrightarrow",!0),U(Q,ce,ze,"⟺","\\Longleftrightarrow",!0),U(Q,ce,ze,"↦","\\mapsto",!0),U(Q,ce,ze,"⟼","\\longmapsto",!0),U(Q,ce,ze,"↗","\\nearrow",!0),U(Q,ce,ze,"↩","\\hookleftarrow",!0),U(Q,ce,ze,"↪","\\hookrightarrow",!0),U(Q,ce,ze,"↘","\\searrow",!0),U(Q,ce,ze,"↼","\\leftharpoonup",!0),U(Q,ce,ze,"⇀","\\rightharpoonup",!0),U(Q,ce,ze,"↙","\\swarrow",!0),U(Q,ce,ze,"↽","\\leftharpoondown",!0),U(Q,ce,ze,"⇁","\\rightharpoondown",!0),U(Q,ce,ze,"↖","\\nwarrow",!0),U(Q,ce,ze,"⇌","\\rightleftharpoons",!0),U(Q,$e,ze,"≮","\\nless",!0),U(Q,$e,ze,"","\\@nleqslant"),U(Q,$e,ze,"","\\@nleqq"),U(Q,$e,ze,"⪇","\\lneq",!0),U(Q,$e,ze,"≨","\\lneqq",!0),U(Q,$e,ze,"","\\@lvertneqq"),U(Q,$e,ze,"⋦","\\lnsim",!0),U(Q,$e,ze,"⪉","\\lnapprox",!0),U(Q,$e,ze,"⊀","\\nprec",!0),U(Q,$e,ze,"⋠","\\npreceq",!0),U(Q,$e,ze,"⋨","\\precnsim",!0),U(Q,$e,ze,"⪹","\\precnapprox",!0),U(Q,$e,ze,"≁","\\nsim",!0),U(Q,$e,ze,"","\\@nshortmid"),U(Q,$e,ze,"∤","\\nmid",!0),U(Q,$e,ze,"⊬","\\nvdash",!0),U(Q,$e,ze,"⊭","\\nvDash",!0),U(Q,$e,ze,"⋪","\\ntriangleleft"),U(Q,$e,ze,"⋬","\\ntrianglelefteq",!0),U(Q,$e,ze,"⊊","\\subsetneq",!0),U(Q,$e,ze,"","\\@varsubsetneq"),U(Q,$e,ze,"⫋","\\subsetneqq",!0),U(Q,$e,ze,"","\\@varsubsetneqq"),U(Q,$e,ze,"≯","\\ngtr",!0),U(Q,$e,ze,"","\\@ngeqslant"),U(Q,$e,ze,"","\\@ngeqq"),U(Q,$e,ze,"⪈","\\gneq",!0),U(Q,$e,ze,"≩","\\gneqq",!0),U(Q,$e,ze,"","\\@gvertneqq"),U(Q,$e,ze,"⋧","\\gnsim",!0),U(Q,$e,ze,"⪊","\\gnapprox",!0),U(Q,$e,ze,"⊁","\\nsucc",!0),U(Q,$e,ze,"⋡","\\nsucceq",!0),U(Q,$e,ze,"⋩","\\succnsim",!0),U(Q,$e,ze,"⪺","\\succnapprox",!0),U(Q,$e,ze,"≆","\\ncong",!0),U(Q,$e,ze,"","\\@nshortparallel"),U(Q,$e,ze,"∦","\\nparallel",!0),U(Q,$e,ze,"⊯","\\nVDash",!0),U(Q,$e,ze,"⋫","\\ntriangleright"),U(Q,$e,ze,"⋭","\\ntrianglerighteq",!0),U(Q,$e,ze,"","\\@nsupseteqq"),U(Q,$e,ze,"⊋","\\supsetneq",!0),U(Q,$e,ze,"","\\@varsupsetneq"),U(Q,$e,ze,"⫌","\\supsetneqq",!0),U(Q,$e,ze,"","\\@varsupsetneqq"),U(Q,$e,ze,"⊮","\\nVdash",!0),U(Q,$e,ze,"⪵","\\precneqq",!0),U(Q,$e,ze,"⪶","\\succneqq",!0),U(Q,$e,ze,"","\\@nsubseteqq"),U(Q,$e,Yt,"⊴","\\unlhd"),U(Q,$e,Yt,"⊵","\\unrhd"),U(Q,$e,ze,"↚","\\nleftarrow",!0),U(Q,$e,ze,"↛","\\nrightarrow",!0),U(Q,$e,ze,"⇍","\\nLeftarrow",!0),U(Q,$e,ze,"⇏","\\nRightarrow",!0),U(Q,$e,ze,"↮","\\nleftrightarrow",!0),U(Q,$e,ze,"⇎","\\nLeftrightarrow",!0),U(Q,$e,ze,"△","\\vartriangle"),U(Q,$e,He,"ℏ","\\hslash"),U(Q,$e,He,"▽","\\triangledown"),U(Q,$e,He,"◊","\\lozenge"),U(Q,$e,He,"Ⓢ","\\circledS"),U(Q,$e,He,"®","\\circledR"),U(kt,$e,He,"®","\\circledR"),U(Q,$e,He,"∡","\\measuredangle",!0),U(Q,$e,He,"∄","\\nexists"),U(Q,$e,He,"℧","\\mho"),U(Q,$e,He,"Ⅎ","\\Finv",!0),U(Q,$e,He,"⅁","\\Game",!0),U(Q,$e,He,"‵","\\backprime"),U(Q,$e,He,"▲","\\blacktriangle"),U(Q,$e,He,"▼","\\blacktriangledown"),U(Q,$e,He,"■","\\blacksquare"),U(Q,$e,He,"⧫","\\blacklozenge"),U(Q,$e,He,"★","\\bigstar"),U(Q,$e,He,"∢","\\sphericalangle",!0),U(Q,$e,He,"∁","\\complement",!0),U(Q,$e,He,"ð","\\eth",!0),U(kt,ce,He,"ð","ð"),U(Q,$e,He,"╱","\\diagup"),U(Q,$e,He,"╲","\\diagdown"),U(Q,$e,He,"□","\\square"),U(Q,$e,He,"□","\\Box"),U(Q,$e,He,"◊","\\Diamond"),U(Q,$e,He,"¥","\\yen",!0),U(kt,$e,He,"¥","\\yen",!0),U(Q,$e,He,"✓","\\checkmark",!0),U(kt,$e,He,"✓","\\checkmark"),U(Q,$e,He,"ℶ","\\beth",!0),U(Q,$e,He,"ℸ","\\daleth",!0),U(Q,$e,He,"ℷ","\\gimel",!0),U(Q,$e,He,"ϝ","\\digamma",!0),U(Q,$e,He,"ϰ","\\varkappa"),U(Q,$e,Gs,"┌","\\@ulcorner",!0),U(Q,$e,Ha,"┐","\\@urcorner",!0),U(Q,$e,Gs,"└","\\@llcorner",!0),U(Q,$e,Ha,"┘","\\@lrcorner",!0),U(Q,$e,ze,"≦","\\leqq",!0),U(Q,$e,ze,"⩽","\\leqslant",!0),U(Q,$e,ze,"⪕","\\eqslantless",!0),U(Q,$e,ze,"≲","\\lesssim",!0),U(Q,$e,ze,"⪅","\\lessapprox",!0),U(Q,$e,ze,"≊","\\approxeq",!0),U(Q,$e,Yt,"⋖","\\lessdot"),U(Q,$e,ze,"⋘","\\lll",!0),U(Q,$e,ze,"≶","\\lessgtr",!0),U(Q,$e,ze,"⋚","\\lesseqgtr",!0),U(Q,$e,ze,"⪋","\\lesseqqgtr",!0),U(Q,$e,ze,"≑","\\doteqdot"),U(Q,$e,ze,"≓","\\risingdotseq",!0),U(Q,$e,ze,"≒","\\fallingdotseq",!0),U(Q,$e,ze,"∽","\\backsim",!0),U(Q,$e,ze,"⋍","\\backsimeq",!0),U(Q,$e,ze,"⫅","\\subseteqq",!0),U(Q,$e,ze,"⋐","\\Subset",!0),U(Q,$e,ze,"⊏","\\sqsubset",!0),U(Q,$e,ze,"≼","\\preccurlyeq",!0),U(Q,$e,ze,"⋞","\\curlyeqprec",!0),U(Q,$e,ze,"≾","\\precsim",!0),U(Q,$e,ze,"⪷","\\precapprox",!0),U(Q,$e,ze,"⊲","\\vartriangleleft"),U(Q,$e,ze,"⊴","\\trianglelefteq"),U(Q,$e,ze,"⊨","\\vDash",!0),U(Q,$e,ze,"⊪","\\Vvdash",!0),U(Q,$e,ze,"⌣","\\smallsmile"),U(Q,$e,ze,"⌢","\\smallfrown"),U(Q,$e,ze,"≏","\\bumpeq",!0),U(Q,$e,ze,"≎","\\Bumpeq",!0),U(Q,$e,ze,"≧","\\geqq",!0),U(Q,$e,ze,"⩾","\\geqslant",!0),U(Q,$e,ze,"⪖","\\eqslantgtr",!0),U(Q,$e,ze,"≳","\\gtrsim",!0),U(Q,$e,ze,"⪆","\\gtrapprox",!0),U(Q,$e,Yt,"⋗","\\gtrdot"),U(Q,$e,ze,"⋙","\\ggg",!0),U(Q,$e,ze,"≷","\\gtrless",!0),U(Q,$e,ze,"⋛","\\gtreqless",!0),U(Q,$e,ze,"⪌","\\gtreqqless",!0),U(Q,$e,ze,"≖","\\eqcirc",!0),U(Q,$e,ze,"≗","\\circeq",!0),U(Q,$e,ze,"≜","\\triangleq",!0),U(Q,$e,ze,"∼","\\thicksim"),U(Q,$e,ze,"≈","\\thickapprox"),U(Q,$e,ze,"⫆","\\supseteqq",!0),U(Q,$e,ze,"⋑","\\Supset",!0),U(Q,$e,ze,"⊐","\\sqsupset",!0),U(Q,$e,ze,"≽","\\succcurlyeq",!0),U(Q,$e,ze,"⋟","\\curlyeqsucc",!0),U(Q,$e,ze,"≿","\\succsim",!0),U(Q,$e,ze,"⪸","\\succapprox",!0),U(Q,$e,ze,"⊳","\\vartriangleright"),U(Q,$e,ze,"⊵","\\trianglerighteq"),U(Q,$e,ze,"⊩","\\Vdash",!0),U(Q,$e,ze,"∣","\\shortmid"),U(Q,$e,ze,"∥","\\shortparallel"),U(Q,$e,ze,"≬","\\between",!0),U(Q,$e,ze,"⋔","\\pitchfork",!0),U(Q,$e,ze,"∝","\\varpropto"),U(Q,$e,ze,"◀","\\blacktriangleleft"),U(Q,$e,ze,"∴","\\therefore",!0),U(Q,$e,ze,"∍","\\backepsilon"),U(Q,$e,ze,"▶","\\blacktriangleright"),U(Q,$e,ze,"∵","\\because",!0),U(Q,$e,ze,"⋘","\\llless"),U(Q,$e,ze,"⋙","\\gggtr"),U(Q,$e,Yt,"⊲","\\lhd"),U(Q,$e,Yt,"⊳","\\rhd"),U(Q,$e,ze,"≂","\\eqsim",!0),U(Q,ce,ze,"⋈","\\Join"),U(Q,$e,ze,"≑","\\Doteq",!0),U(Q,$e,Yt,"∔","\\dotplus",!0),U(Q,$e,Yt,"∖","\\smallsetminus"),U(Q,$e,Yt,"⋒","\\Cap",!0),U(Q,$e,Yt,"⋓","\\Cup",!0),U(Q,$e,Yt,"⩞","\\doublebarwedge",!0),U(Q,$e,Yt,"⊟","\\boxminus",!0),U(Q,$e,Yt,"⊞","\\boxplus",!0),U(Q,$e,Yt,"⋇","\\divideontimes",!0),U(Q,$e,Yt,"⋉","\\ltimes",!0),U(Q,$e,Yt,"⋊","\\rtimes",!0),U(Q,$e,Yt,"⋋","\\leftthreetimes",!0),U(Q,$e,Yt,"⋌","\\rightthreetimes",!0),U(Q,$e,Yt,"⋏","\\curlywedge",!0),U(Q,$e,Yt,"⋎","\\curlyvee",!0),U(Q,$e,Yt,"⊝","\\circleddash",!0),U(Q,$e,Yt,"⊛","\\circledast",!0),U(Q,$e,Yt,"⋅","\\centerdot"),U(Q,$e,Yt,"⊺","\\intercal",!0),U(Q,$e,Yt,"⋒","\\doublecap"),U(Q,$e,Yt,"⋓","\\doublecup"),U(Q,$e,Yt,"⊠","\\boxtimes",!0),U(Q,$e,ze,"⇢","\\dashrightarrow",!0),U(Q,$e,ze,"⇠","\\dashleftarrow",!0),U(Q,$e,ze,"⇇","\\leftleftarrows",!0),U(Q,$e,ze,"⇆","\\leftrightarrows",!0),U(Q,$e,ze,"⇚","\\Lleftarrow",!0),U(Q,$e,ze,"↞","\\twoheadleftarrow",!0),U(Q,$e,ze,"↢","\\leftarrowtail",!0),U(Q,$e,ze,"↫","\\looparrowleft",!0),U(Q,$e,ze,"⇋","\\leftrightharpoons",!0),U(Q,$e,ze,"↶","\\curvearrowleft",!0),U(Q,$e,ze,"↺","\\circlearrowleft",!0),U(Q,$e,ze,"↰","\\Lsh",!0),U(Q,$e,ze,"⇈","\\upuparrows",!0),U(Q,$e,ze,"↿","\\upharpoonleft",!0),U(Q,$e,ze,"⇃","\\downharpoonleft",!0),U(Q,ce,ze,"⊶","\\origof",!0),U(Q,ce,ze,"⊷","\\imageof",!0),U(Q,$e,ze,"⊸","\\multimap",!0),U(Q,$e,ze,"↭","\\leftrightsquigarrow",!0),U(Q,$e,ze,"⇉","\\rightrightarrows",!0),U(Q,$e,ze,"⇄","\\rightleftarrows",!0),U(Q,$e,ze,"↠","\\twoheadrightarrow",!0),U(Q,$e,ze,"↣","\\rightarrowtail",!0),U(Q,$e,ze,"↬","\\looparrowright",!0),U(Q,$e,ze,"↷","\\curvearrowright",!0),U(Q,$e,ze,"↻","\\circlearrowright",!0),U(Q,$e,ze,"↱","\\Rsh",!0),U(Q,$e,ze,"⇊","\\downdownarrows",!0),U(Q,$e,ze,"↾","\\upharpoonright",!0),U(Q,$e,ze,"⇂","\\downharpoonright",!0),U(Q,$e,ze,"⇝","\\rightsquigarrow",!0),U(Q,$e,ze,"⇝","\\leadsto"),U(Q,$e,ze,"⇛","\\Rrightarrow",!0),U(Q,$e,ze,"↾","\\restriction"),U(Q,ce,He,"‘","`"),U(Q,ce,He,"$","\\$"),U(kt,ce,He,"$","\\$"),U(kt,ce,He,"$","\\textdollar"),U(Q,ce,He,"%","\\%"),U(kt,ce,He,"%","\\%"),U(Q,ce,He,"_","\\_"),U(kt,ce,He,"_","\\_"),U(kt,ce,He,"_","\\textunderscore"),U(Q,ce,He,"∠","\\angle",!0),U(Q,ce,He,"∞","\\infty",!0),U(Q,ce,He,"′","\\prime"),U(Q,ce,He,"△","\\triangle"),U(Q,ce,He,"Γ","\\Gamma",!0),U(Q,ce,He,"Δ","\\Delta",!0),U(Q,ce,He,"Θ","\\Theta",!0),U(Q,ce,He,"Λ","\\Lambda",!0),U(Q,ce,He,"Ξ","\\Xi",!0),U(Q,ce,He,"Π","\\Pi",!0),U(Q,ce,He,"Σ","\\Sigma",!0),U(Q,ce,He,"Υ","\\Upsilon",!0),U(Q,ce,He,"Φ","\\Phi",!0),U(Q,ce,He,"Ψ","\\Psi",!0),U(Q,ce,He,"Ω","\\Omega",!0),U(Q,ce,He,"A","Α"),U(Q,ce,He,"B","Β"),U(Q,ce,He,"E","Ε"),U(Q,ce,He,"Z","Ζ"),U(Q,ce,He,"H","Η"),U(Q,ce,He,"I","Ι"),U(Q,ce,He,"K","Κ"),U(Q,ce,He,"M","Μ"),U(Q,ce,He,"N","Ν"),U(Q,ce,He,"O","Ο"),U(Q,ce,He,"P","Ρ"),U(Q,ce,He,"T","Τ"),U(Q,ce,He,"X","Χ"),U(Q,ce,He,"¬","\\neg",!0),U(Q,ce,He,"¬","\\lnot"),U(Q,ce,He,"⊤","\\top"),U(Q,ce,He,"⊥","\\bot"),U(Q,ce,He,"∅","\\emptyset"),U(Q,$e,He,"∅","\\varnothing"),U(Q,ce,mr,"α","\\alpha",!0),U(Q,ce,mr,"β","\\beta",!0),U(Q,ce,mr,"γ","\\gamma",!0),U(Q,ce,mr,"δ","\\delta",!0),U(Q,ce,mr,"ϵ","\\epsilon",!0),U(Q,ce,mr,"ζ","\\zeta",!0),U(Q,ce,mr,"η","\\eta",!0),U(Q,ce,mr,"θ","\\theta",!0),U(Q,ce,mr,"ι","\\iota",!0),U(Q,ce,mr,"κ","\\kappa",!0),U(Q,ce,mr,"λ","\\lambda",!0),U(Q,ce,mr,"μ","\\mu",!0),U(Q,ce,mr,"ν","\\nu",!0),U(Q,ce,mr,"ξ","\\xi",!0),U(Q,ce,mr,"ο","\\omicron",!0),U(Q,ce,mr,"π","\\pi",!0),U(Q,ce,mr,"ρ","\\rho",!0),U(Q,ce,mr,"σ","\\sigma",!0),U(Q,ce,mr,"τ","\\tau",!0),U(Q,ce,mr,"υ","\\upsilon",!0),U(Q,ce,mr,"ϕ","\\phi",!0),U(Q,ce,mr,"χ","\\chi",!0),U(Q,ce,mr,"ψ","\\psi",!0),U(Q,ce,mr,"ω","\\omega",!0),U(Q,ce,mr,"ε","\\varepsilon",!0),U(Q,ce,mr,"ϑ","\\vartheta",!0),U(Q,ce,mr,"ϖ","\\varpi",!0),U(Q,ce,mr,"ϱ","\\varrho",!0),U(Q,ce,mr,"ς","\\varsigma",!0),U(Q,ce,mr,"φ","\\varphi",!0),U(Q,ce,Yt,"∗","*",!0),U(Q,ce,Yt,"+","+"),U(Q,ce,Yt,"−","-",!0),U(Q,ce,Yt,"⋅","\\cdot",!0),U(Q,ce,Yt,"∘","\\circ",!0),U(Q,ce,Yt,"÷","\\div",!0),U(Q,ce,Yt,"±","\\pm",!0),U(Q,ce,Yt,"×","\\times",!0),U(Q,ce,Yt,"∩","\\cap",!0),U(Q,ce,Yt,"∪","\\cup",!0),U(Q,ce,Yt,"∖","\\setminus",!0),U(Q,ce,Yt,"∧","\\land"),U(Q,ce,Yt,"∨","\\lor"),U(Q,ce,Yt,"∧","\\wedge",!0),U(Q,ce,Yt,"∨","\\vee",!0),U(Q,ce,He,"√","\\surd"),U(Q,ce,Gs,"⟨","\\langle",!0),U(Q,ce,Gs,"∣","\\lvert"),U(Q,ce,Gs,"∥","\\lVert"),U(Q,ce,Ha,"?","?"),U(Q,ce,Ha,"!","!"),U(Q,ce,Ha,"⟩","\\rangle",!0),U(Q,ce,Ha,"∣","\\rvert"),U(Q,ce,Ha,"∥","\\rVert"),U(Q,ce,ze,"=","="),U(Q,ce,ze,":",":"),U(Q,ce,ze,"≈","\\approx",!0),U(Q,ce,ze,"≅","\\cong",!0),U(Q,ce,ze,"≥","\\ge"),U(Q,ce,ze,"≥","\\geq",!0),U(Q,ce,ze,"←","\\gets"),U(Q,ce,ze,">","\\gt",!0),U(Q,ce,ze,"∈","\\in",!0),U(Q,ce,ze,"","\\@not"),U(Q,ce,ze,"⊂","\\subset",!0),U(Q,ce,ze,"⊃","\\supset",!0),U(Q,ce,ze,"⊆","\\subseteq",!0),U(Q,ce,ze,"⊇","\\supseteq",!0),U(Q,$e,ze,"⊈","\\nsubseteq",!0),U(Q,$e,ze,"⊉","\\nsupseteq",!0),U(Q,ce,ze,"⊨","\\models"),U(Q,ce,ze,"←","\\leftarrow",!0),U(Q,ce,ze,"≤","\\le"),U(Q,ce,ze,"≤","\\leq",!0),U(Q,ce,ze,"<","\\lt",!0),U(Q,ce,ze,"→","\\rightarrow",!0),U(Q,ce,ze,"→","\\to"),U(Q,$e,ze,"≱","\\ngeq",!0),U(Q,$e,ze,"≰","\\nleq",!0),U(Q,ce,_c," ","\\ "),U(Q,ce,_c," ","\\space"),U(Q,ce,_c," ","\\nobreakspace"),U(kt,ce,_c," ","\\ "),U(kt,ce,_c," "," "),U(kt,ce,_c," ","\\space"),U(kt,ce,_c," ","\\nobreakspace"),U(Q,ce,_c,"","\\nobreak"),U(Q,ce,_c,"","\\allowbreak"),U(Q,ce,ub,",",","),U(Q,ce,ub,";",";"),U(Q,$e,Yt,"⊼","\\barwedge",!0),U(Q,$e,Yt,"⊻","\\veebar",!0),U(Q,ce,Yt,"⊙","\\odot",!0),U(Q,ce,Yt,"⊕","\\oplus",!0),U(Q,ce,Yt,"⊗","\\otimes",!0),U(Q,ce,He,"∂","\\partial",!0),U(Q,ce,Yt,"⊘","\\oslash",!0),U(Q,$e,Yt,"⊚","\\circledcirc",!0),U(Q,$e,Yt,"⊡","\\boxdot",!0),U(Q,ce,Yt,"△","\\bigtriangleup"),U(Q,ce,Yt,"▽","\\bigtriangledown"),U(Q,ce,Yt,"†","\\dagger"),U(Q,ce,Yt,"⋄","\\diamond"),U(Q,ce,Yt,"⋆","\\star"),U(Q,ce,Yt,"◃","\\triangleleft"),U(Q,ce,Yt,"▹","\\triangleright"),U(Q,ce,Gs,"{","\\{"),U(kt,ce,He,"{","\\{"),U(kt,ce,He,"{","\\textbraceleft"),U(Q,ce,Ha,"}","\\}"),U(kt,ce,He,"}","\\}"),U(kt,ce,He,"}","\\textbraceright"),U(Q,ce,Gs,"{","\\lbrace"),U(Q,ce,Ha,"}","\\rbrace"),U(Q,ce,Gs,"[","\\lbrack",!0),U(kt,ce,He,"[","\\lbrack",!0),U(Q,ce,Ha,"]","\\rbrack",!0),U(kt,ce,He,"]","\\rbrack",!0),U(Q,ce,Gs,"(","\\lparen",!0),U(Q,ce,Ha,")","\\rparen",!0),U(kt,ce,He,"<","\\textless",!0),U(kt,ce,He,">","\\textgreater",!0),U(Q,ce,Gs,"⌊","\\lfloor",!0),U(Q,ce,Ha,"⌋","\\rfloor",!0),U(Q,ce,Gs,"⌈","\\lceil",!0),U(Q,ce,Ha,"⌉","\\rceil",!0),U(Q,ce,He,"\\","\\backslash"),U(Q,ce,He,"∣","|"),U(Q,ce,He,"∣","\\vert"),U(kt,ce,He,"|","\\textbar",!0),U(Q,ce,He,"∥","\\|"),U(Q,ce,He,"∥","\\Vert"),U(kt,ce,He,"∥","\\textbardbl"),U(kt,ce,He,"~","\\textasciitilde"),U(kt,ce,He,"\\","\\textbackslash"),U(kt,ce,He,"^","\\textasciicircum"),U(Q,ce,ze,"↑","\\uparrow",!0),U(Q,ce,ze,"⇑","\\Uparrow",!0),U(Q,ce,ze,"↓","\\downarrow",!0),U(Q,ce,ze,"⇓","\\Downarrow",!0),U(Q,ce,ze,"↕","\\updownarrow",!0),U(Q,ce,ze,"⇕","\\Updownarrow",!0),U(Q,ce,ki,"∐","\\coprod"),U(Q,ce,ki,"⋁","\\bigvee"),U(Q,ce,ki,"⋀","\\bigwedge"),U(Q,ce,ki,"⨄","\\biguplus"),U(Q,ce,ki,"⋂","\\bigcap"),U(Q,ce,ki,"⋃","\\bigcup"),U(Q,ce,ki,"∫","\\int"),U(Q,ce,ki,"∫","\\intop"),U(Q,ce,ki,"∬","\\iint"),U(Q,ce,ki,"∭","\\iiint"),U(Q,ce,ki,"∏","\\prod"),U(Q,ce,ki,"∑","\\sum"),U(Q,ce,ki,"⨂","\\bigotimes"),U(Q,ce,ki,"⨁","\\bigoplus"),U(Q,ce,ki,"⨀","\\bigodot"),U(Q,ce,ki,"∮","\\oint"),U(Q,ce,ki,"∯","\\oiint"),U(Q,ce,ki,"∰","\\oiiint"),U(Q,ce,ki,"⨆","\\bigsqcup"),U(Q,ce,ki,"∫","\\smallint"),U(kt,ce,op,"…","\\textellipsis"),U(Q,ce,op,"…","\\mathellipsis"),U(kt,ce,op,"…","\\ldots",!0),U(Q,ce,op,"…","\\ldots",!0),U(Q,ce,op,"⋯","\\@cdots",!0),U(Q,ce,op,"⋱","\\ddots",!0),U(Q,ce,He,"⋮","\\varvdots"),U(kt,ce,He,"⋮","\\varvdots"),U(Q,ce,Un,"ˊ","\\acute"),U(Q,ce,Un,"ˋ","\\grave"),U(Q,ce,Un,"¨","\\ddot"),U(Q,ce,Un,"~","\\tilde"),U(Q,ce,Un,"ˉ","\\bar"),U(Q,ce,Un,"˘","\\breve"),U(Q,ce,Un,"ˇ","\\check"),U(Q,ce,Un,"^","\\hat"),U(Q,ce,Un,"⃗","\\vec"),U(Q,ce,Un,"˙","\\dot"),U(Q,ce,Un,"˚","\\mathring"),U(Q,ce,mr,"","\\@imath"),U(Q,ce,mr,"","\\@jmath"),U(Q,ce,He,"ı","ı"),U(Q,ce,He,"ȷ","ȷ"),U(kt,ce,He,"ı","\\i",!0),U(kt,ce,He,"ȷ","\\j",!0),U(kt,ce,He,"ß","\\ss",!0),U(kt,ce,He,"æ","\\ae",!0),U(kt,ce,He,"œ","\\oe",!0),U(kt,ce,He,"ø","\\o",!0),U(kt,ce,He,"Æ","\\AE",!0),U(kt,ce,He,"Œ","\\OE",!0),U(kt,ce,He,"Ø","\\O",!0),U(kt,ce,Un,"ˊ","\\'"),U(kt,ce,Un,"ˋ","\\`"),U(kt,ce,Un,"ˆ","\\^"),U(kt,ce,Un,"˜","\\~"),U(kt,ce,Un,"ˉ","\\="),U(kt,ce,Un,"˘","\\u"),U(kt,ce,Un,"˙","\\."),U(kt,ce,Un,"¸","\\c"),U(kt,ce,Un,"˚","\\r"),U(kt,ce,Un,"ˇ","\\v"),U(kt,ce,Un,"¨",'\\"'),U(kt,ce,Un,"˝","\\H"),U(kt,ce,Un,"◯","\\textcircled");var pY={"--":!0,"---":!0,"``":!0,"''":!0};U(kt,ce,He,"–","--",!0),U(kt,ce,He,"–","\\textendash"),U(kt,ce,He,"—","---",!0),U(kt,ce,He,"—","\\textemdash"),U(kt,ce,He,"‘","`",!0),U(kt,ce,He,"‘","\\textquoteleft"),U(kt,ce,He,"’","'",!0),U(kt,ce,He,"’","\\textquoteright"),U(kt,ce,He,"“","``",!0),U(kt,ce,He,"“","\\textquotedblleft"),U(kt,ce,He,"”","''",!0),U(kt,ce,He,"”","\\textquotedblright"),U(Q,ce,He,"°","\\degree",!0),U(kt,ce,He,"°","\\degree"),U(kt,ce,He,"°","\\textdegree",!0),U(Q,ce,He,"£","\\pounds"),U(Q,ce,He,"£","\\mathsterling",!0),U(kt,ce,He,"£","\\pounds"),U(kt,ce,He,"£","\\textsterling",!0),U(Q,$e,He,"✠","\\maltese"),U(kt,$e,He,"✠","\\maltese");for(var gY='0123456789/@."',y7=0;y7{var e=t.charCodeAt(0),r=t.charCodeAt(1),n=(e-55296)*1024+(r-56320)+65536;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return EY[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return mRe[a]}else{if(n===120485||n===120486)return EY[0];if(120486{if(Pu(t.classes)!==Pu(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize||t.italic!==0&&t.hasClass("mathnormal"))return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n of Object.keys(t.style))if(t.style[n]!==e.style[n])return!1;for(var i of Object.keys(e.style))if(t.style[i]!==e.style[i])return!1;return!0},SY=t=>{for(var e=0;er&&(r=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},Rt=function(e,r,n,i){var a=new sp(e,r,n,i);return A7(a),a},zu=(t,e,r,n)=>new sp(t,e,r,n),lp=function(e,r,n){var i=Rt([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=$t(i.height),i.maxFontSize=1,i},xRe=function(e,r,n,i){var a=new mC(e,r,n,i);return A7(a),a},Rc=function(e){var r=new ap(e);return A7(r),r},cp=function(e,r){return e instanceof ap?Rt([],[e],r):e},TRe=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,s=1;s{var r=Rt(["mspace"],[],e),n=Xn(t,e);return r.style.marginRight=$t(n),r},CC=(t,e,r)=>{var n,i;switch(t){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=t}return e==="textbf"&&r==="textit"?i="BoldItalic":e==="textbf"?i="Bold":r==="textit"?i="Italic":i="Regular",n+"-"+i},_7={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},_Y={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},RY=function(e,r){var[n,i,a]=_Y[e],s=new Bu(n),o=new Ac([s],{width:$t(i),height:$t(a),style:"width:"+$t(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=zu(["overlay"],[o],r);return l.height=a,l.style.height=$t(a),l.style.width=$t(i),l},Kn={number:3,unit:"mu"},yd={number:4,unit:"mu"},Lc={number:5,unit:"mu"},wRe={mord:{mop:Kn,mbin:yd,mrel:Lc,minner:Kn},mop:{mord:Kn,mop:Kn,mrel:Lc,minner:Kn},mbin:{mord:yd,mop:yd,mopen:yd,minner:yd},mrel:{mord:Lc,mop:Lc,mopen:Lc,minner:Lc},mopen:{},mclose:{mop:Kn,mbin:yd,mrel:Lc,minner:Kn},mpunct:{mord:Kn,mop:Kn,mrel:Lc,mopen:Kn,mclose:Kn,mpunct:Kn,minner:Kn},minner:{mord:Kn,mop:Kn,mbin:yd,mrel:Lc,mopen:Kn,mpunct:Kn,minner:Kn}},CRe={mord:{mop:Kn},mop:{mord:Kn,mop:Kn},mbin:{},mrel:{},mopen:{},mclose:{mop:Kn},mpunct:{},minner:{mop:Kn}},LY={},kC={},EC={};function Wt(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l{var y=m.classes[0],v=g.classes[0];y==="mbin"&&ERe.has(v)?m.classes[0]="mord":v==="mbin"&&kRe.has(y)&&(g.classes[0]="mord")},{node:d},f,p),R7(a,(g,m)=>{var y,v,T=I7(m),b=I7(g),w=T&&b?g.hasClass("mtight")?(y=CRe[T])==null?void 0:y[b]:(v=wRe[T])==null?void 0:v[b]:null;if(w)return AY(w,u)},{node:d},f,p),a},R7=function(e,r,n,i,a){i&&e.push(i);for(var s=0;sf=>{e.splice(d+1,0,f),s++})(s)}i&&e.pop()},IY=function(e){return e instanceof ap||e instanceof mC||e instanceof sp&&e.hasClass("enclosing")?e:null},L7=function(e,r){var n=IY(e);if(n){var i=n.children;if(i.length){if(r==="right")return L7(i[i.length-1],"right");if(r==="left")return L7(i[0],"left")}}return e},I7=function(e,r){if(!e)return null;r&&(e=L7(e,r));var n=e.classes[0];return ARe[n]||null},hb=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Rt(r.concat(n))},an=function(e,r,n){if(!e)return Rt();if(kC[e.type]){var i=kC[e.type](e,r);if(n&&r.size!==n.size){i=Rt(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Dt("Got group of unknown type: '"+e.type+"'")};function AC(t,e){var r=Rt(["base"],t,e),n=Rt(["strut"]);return n.style.height=$t(r.height+r.depth),r.depth&&(n.style.verticalAlign=$t(-r.depth)),r.children.unshift(n),r}function D7(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=Bi(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push(AC(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push(AC(s,e));var u;r?(u=AC(Bi(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=Rt(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=$t(h.height+h.depth),h.depth&&(d.style.verticalAlign=$t(-h.depth))}return h}function DY(t){return new ap(t)}class Mt{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=Pu(this.classes));for(var n=0;n0&&(e+=' class ="'+Ia(Pu(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Si{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ia(this.toText())}toText(){return this.text}}class MY{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",$t(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var _Re=new Set(["\\imath","\\jmath"]),RRe=new Set(["mrow","mtable"]),lo=function(e,r,n){return Wn[r][e]&&Wn[r][e].replace&&e.charCodeAt(0)!==55349&&!(pY.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=Wn[r][e].replace),new Si(e)},M7=function(e){return e.length===1?e[0]:new Mt("mrow",e)},LRe={mathit:"italic",boldsymbol:t=>t.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},N7=(t,e)=>{if(t.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var r=e.font;if(!r||r==="mathnormal")return null;var n=t.mode,i=LRe[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(_Re.has(a))return null;if(Wn[n][a]){var s=Wn[n][a].replace;s&&(a=s)}var o=_7[r].fontName;return g7(a,o,n)?_7[r].variant:null};function O7(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Si&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof Si&&r.text===","}else return!1}var qs=function(e,r,n){if(e.length===1){var i=Tn(e[0],r);return n&&i instanceof Mt&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o=1&&(s.type==="mn"||O7(s))){var u=l.children[0];u instanceof Mt&&u.type==="mn"&&(u.children=[...s.children,...u.children],a.pop())}else if(s.type==="mi"&&s.children.length===1){var h=s.children[0];if(h instanceof Si&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Si&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},Gu=function(e,r,n){return M7(qs(e,r,n))},Tn=function(e,r){if(!e)return new Mt("mrow");if(EC[e.type])return EC[e.type](e,r);throw new Dt("Got group of unknown type: '"+e.type+"'")};function NY(t,e,r,n,i){var a=qs(t,r),s;a.length===1&&a[0]instanceof Mt&&RRe.has(a[0].type)?s=a[0]:s=new Mt("mrow",a);var o=new Mt("annotation",[new Si(e)]);o.setAttribute("encoding","application/x-tex");var l=new Mt("semantics",[s,o]),u=new Mt("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return Rt([h],[u])}var IRe=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],OY=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],$Y=function(e,r){return r.size<2?e:IRe[e-1][r.size-1]};class Ic{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Ic.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=OY[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(r,e),new Ic(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:$Y(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:OY[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=$Y(Ic.BASESIZE,e);return this.size===r&&this.textSize===Ic.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Ic.BASESIZE?["sizing","reset-size"+this.size,"size"+Ic.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=pRe(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Ic.BASESIZE=6;var PY=function(e){return new Ic({style:e.displayMode?Ir.DISPLAY:Ir.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},BY=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Rt(n,[e])}return e},DRe=function(e,r,n){var i=PY(n),a;if(n.output==="mathml")return NY(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=D7(e,i);a=Rt(["katex"],[s])}else{var o=NY(e,r,i,n.displayMode,!1),l=D7(e,i);a=Rt(["katex"],[o,l])}return BY(a,n)},MRe=function(e,r,n){var i=PY(n),a=D7(e,i),s=Rt(["katex"],[a]);return BY(s,n)},NRe={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},_C=function(e){var r=new Mt("mo",[new Si(NRe[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},ORe={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},$Re=new Set(["widehat","widecheck","widetilde","utilde"]),RC=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if($Re.has(l)&&"base"in e){var u=e.base.type==="ordgroup"?e.base.body.length:1,h,d,f;if(u>5)l==="widehat"||l==="widecheck"?(h=420,o=2364,f=.42,d=l+"4"):(h=312,o=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][p],h=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(o=[0,600,1033,2339,2340][p],h=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],d="tilde"+p)}var g=new Bu(d),m=new Ac([g],{width:"100%",height:$t(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:zu([],[m],r),minWidth:0,height:f}}else{var y=[],v=ORe[l];if(!v)throw new Error('No SVG data for "'+l+'".');var[T,b,w]=v,k=w/1e3,A=T.length,C,_;if(A===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');C=["hide-tail"],_=[v[3]]}else if(A===2)C=["halfarrow-left","halfarrow-right"],_=["xMinYMin","xMaxYMin"];else if(A===3)C=["brace-left","brace-center","brace-right"],_=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+A+" children.");for(var L=0;L0&&(i.style.minWidth=$t(a)),i},PRe=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=Rt(["stretchy",r],[],a),r==="fbox"){var l=a.color&&a.getColor();l&&(s.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new p7({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new p7({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new Ac(u,{width:"100%",height:$t(o)});s=zu([],[h],a)}return s.height=o,s.style.height=$t(o),s},BRe={bin:1,close:1,inner:1,open:1,punct:1,rel:1},FRe={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function zRe(t){return t in BRe}function Or(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function LC(t){var e=IC(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function IC(t){return t&&(t.type==="atom"||FRe.hasOwnProperty(t.type))?t:null}var FY=t=>{if(t instanceof zs)return t;if(fRe(t)&&t.children.length===1)return FY(t.children[0])},$7=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=Or(t.base,"accent"),r=n.base,t.base=r,i=dRe(an(t,e)),t.base=n):(n=Or(t,"accent"),r=n.base);var a=an(r,e.havingCrampedStyle()),s=n.isShifty&&Ec(r),o=0;if(s){var l,u;o=(l=(u=FY(a))==null?void 0:u.skew)!=null?l:0}var h=n.label==="\\c",d=h?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=RC(n,e),f=nn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+$t(2*o)+")",marginLeft:$t(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=RY("vec",e),g=_Y.vec[1]):(p=wC({mode:n.mode,text:n.label},e,"textord"),p=hRe(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=Rt(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=a.height);var y=o;m||(y-=g/2),f.style.left=$t(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=nn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var v=Rt(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},zY=(t,e)=>{var r=t.isStretchy?_C(t.label):new Mt("mo",[lo(t.label,t.mode)]),n=new Mt("mover",[Tn(t.base,e),r]);return n.setAttribute("accent","true"),n},GRe=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));Wt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=SC(e[0]),n=!GRe.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:$7,mathmlBuilder:zY}),Wt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:$7,mathmlBuilder:zY}),Wt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=an(t.base,e),n=RC(t,e),i=t.label==="\\utilde"?.12:0,a=nn({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return Rt(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=_C(t.label),n=new Mt("munder",[Tn(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var DC=t=>{var e=new Mt("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Wt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=cp(an(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;t.below&&(n=e.havingStyle(r.sub()),s=cp(an(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=RC(t,e),l=-e.fontMetrics().axisHeight+.5*o.height,u=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*o.height+.111;h=nn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:s,shift:d}]})}else h=nn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Rt(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=_C(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=DC(Tn(t.body,e));if(t.below){var a=DC(Tn(t.below,e));n=new Mt("munderover",[r,a,i])}else n=new Mt("mover",[r,i])}else if(t.below){var s=DC(Tn(t.below,e));n=new Mt("munder",[r,s])}else n=DC(),n=new Mt("mover",[r,n]);return n}});function GY(t,e){var r=Bi(t.body,e,!0);return Rt([t.mclass],r,e)}function qY(t,e){var r,n=qs(t.body,e);return t.mclass==="minner"?r=new Mt("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new Mt("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new Mt("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}Wt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:Ei(i),isCharacterBox:Ec(i)}},htmlBuilder:GY,mathmlBuilder:qY});var MC=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Wt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:MC(e[0]),body:Ei(e[1]),isCharacterBox:Ec(e[1])}}}),Wt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],s;n!=="\\stackrel"?s=MC(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Ei(i)},l={type:"supsub",mode:a.mode,base:o,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:s,body:[l],isCharacterBox:Ec(l)}},htmlBuilder:GY,mathmlBuilder:qY}),Wt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:MC(e[0]),body:Ei(e[0])}},htmlBuilder(t,e){var r=Bi(t.body,e,!0),n=Rt([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=qs(t.body,e),n=new Mt("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var qRe={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},VY=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),WY=t=>t.type==="textord"&&t.text==="@",VRe=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function WRe(t,e,r){var n=qRe[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=r.callFunction("\\Big",[a],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,o]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function URe(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new Dt("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;aAV".includes(u))for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',s[l]);var g=WRe(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=VY()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Wt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=cp(an(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=$t(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new Mt("mrow",[Tn(t.label,e)]);return r=new Mt("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new Mt("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),Wt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=cp(an(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new Mt("mrow",[Tn(t.fragment,e)])}}),Wt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=Or(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new Dt("\\@char with invalid code point "+a);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var UY=(t,e)=>{var r=Bi(t.body,e.withColor(t.color),!1);return Rc(r)},HY=(t,e)=>{var r=qs(t.body,e.withColor(t.color)),n=new Mt("mstyle",r);return n.setAttribute("mathcolor",t.color),n};Wt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=Or(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Ei(i)}},htmlBuilder:UY,mathmlBuilder:HY}),Wt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=Or(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:UY,mathmlBuilder:HY}),Wt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&Or(i,"size").value}},htmlBuilder(t,e){var r=Rt(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=$t(Xn(t.size,e)))),r},mathmlBuilder(t,e){var r=new Mt("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",$t(Xn(t.size,e)))),r}});var P7={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},YY=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Dt("Expected a control sequence",t);return e},HRe=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},XY=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};Wt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(P7[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=P7[n.text]),Or(e.parseFunction(),"internal");throw new Dt("Invalid token after macro prefix",n)}}),Wt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Dt("Expected a control sequence",n);for(var a=0,s,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),o[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Dt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new Dt('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new Dt("Expected a macro definition");o[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return s&&l.unshift(s),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:o},r===P7[r]),{type:"internal",mode:e.mode}}}),Wt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=YY(e.gullet.popToken());e.gullet.consumeSpaces();var i=HRe(e);return XY(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}}),Wt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=YY(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return XY(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var db=function(e,r,n){var i=Wn.math[e]&&Wn.math[e].replace,a=g7(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},B7=function(e,r,n,i){var a=n.havingBaseStyle(r),s=Rt(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},KY=function(e,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=$t(a),e.height-=a,e.depth+=a},YRe=function(e,r,n,i,a,s){var o=Xa(e,"Main-Regular",a,i),l=B7(o,r,i,s);return KY(l,i,r),l},XRe=function(e,r,n,i){return Xa(e,"Size"+r+"-Regular",n,i)},jY=function(e,r,n,i,a,s){var o=XRe(e,r,a,i),l=B7(Rt(["delimsizing","size"+r],[o],i),Ir.TEXT,i,s);return n&&KY(l,i,Ir.TEXT),l},F7=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Rt(["delimsizinginner",i],[Rt([],[Xa(e,r,n)])]);return{type:"elem",elem:a}},z7=function(e,r,n){var i=wl["Size4-Regular"][e.charCodeAt(0)]?wl["Size4-Regular"][e.charCodeAt(0)][4]:wl["Size1-Regular"][e.charCodeAt(0)][4],a=new Bu("inner",iRe(e,Math.round(1e3*r))),s=new Ac([a],{width:$t(i),height:$t(r),style:"width:"+$t(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=zu([],[s],n);return o.height=r,o.style.height=$t(r),o.style.width=$t(i),{type:"elem",elem:o}},G7=.008,NC={type:"kern",size:-1*G7},KRe=new Set(["|","\\lvert","\\rvert","\\vert"]),jRe=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),ZY=function(e,r,n,i,a,s){var o,l,u,h,d="",f=0;o=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?o=u="⏐":e==="\\Downarrow"?o=u="‖":e==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):KRe.has(e)?(u="∣",d="vert",f=333):jRe.has(e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(o="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(o="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=o="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(o="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=o="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(o="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(o="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(o="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=db(o,p,a),m=g.height+g.depth,y=db(u,p,a),v=y.height+y.depth,T=db(h,p,a),b=T.height+T.depth,w=0,k=1;if(l!==null){var A=db(l,p,a);w=A.height+A.depth,k=2}var C=m+b+w,_=Math.max(0,Math.ceil((r-C)/(k*v))),L=C+_*k*v,O=i.fontMetrics().axisHeight;n&&(O*=i.sizeMultiplier);var M=L/2-O,z=[];if(d.length>0){var F=L-m-b,S=Math.round(L*1e3),R=aRe(d,Math.round(F*1e3)),N=new Bu(d,R),D=$t(f/1e3),I=$t(S/1e3),$=new Ac([N],{width:D,height:I,viewBox:"0 0 "+f+" "+S}),B=zu([],[$],i);B.height=S/1e3,B.style.width=D,B.style.height=I,z.push({type:"elem",elem:B})}else{if(z.push(F7(h,p,a)),z.push(NC),l===null){var P=L-m-b+2*G7;z.push(z7(u,P,i))}else{var G=(L-m-b-w)/2+2*G7;z.push(z7(u,G,i)),z.push(NC),z.push(F7(l,p,a)),z.push(NC),z.push(z7(u,G,i))}z.push(NC),z.push(F7(o,p,a))}var V=i.havingBaseStyle(Ir.TEXT),Y=nn({positionType:"bottom",positionData:M,children:z});return B7(Rt(["delimsizing","mult"],[Y],V),Ir.TEXT,i,s)},q7=80,V7=.08,W7=function(e,r,n,i,a){var s=nRe(e,i,n),o=new Bu(e,s),l=new Ac([o],{width:"400em",height:$t(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return zu(["hide-tail"],[l],a)},ZRe=function(e,r){var n=r.havingBaseSizing(),i=rX("\\surd",e*n.sizeMultiplier,tX,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l,u,h,d;return i.type==="small"?(h=1e3+1e3*s+q7,e<1?a=1:e<1.4&&(a=.7),l=(1+s+V7)/a,u=(1+s)/a,o=W7("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+q7)*fb[i.size],u=(fb[i.size]+s)/a,l=(fb[i.size]+s+V7)/a,o=W7("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+V7,u=e+s,h=Math.floor(1e3*e+s)+q7,o=W7("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=$t(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},QY=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),QRe=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),JY=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),fb=[0,1.2,1.8,2.4,3],eX=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),QY.has(e)||JY.has(e))return jY(e,r,!1,n,i,a);if(QRe.has(e))return ZY(e,fb[r],!1,n,i,a);throw new Dt("Illegal delimiter: '"+e+"'")},JRe=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],eLe=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"stack"}],tX=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],tLe=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var r=e.type;throw new Error("Add support for delim type '"+r+"' here.")},rX=function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;sr)return o}return n[n.length-1]},U7=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;JY.has(e)?o=JRe:QY.has(e)?o=tX:o=eLe;var l=rX(e,r,o,i);return l.type==="small"?YRe(e,l.style,n,i,a,s):l.type==="large"?jY(e,l.size,n,i,a,s):ZY(e,r,n,i,a,s)},H7=function(e,r,n,i,a,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-o,n+o),d=Math.max(h/500*l,2*h-u);return U7(e,d,!0,i,a,s)},nX={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},rLe=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function iX(t){return"isMiddle"in t}function OC(t,e){var r=IC(t);if(r&&rLe.has(r.text))return r;throw r?new Dt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Dt("Invalid delimiter type '"+t.type+"'",t)}Wt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=OC(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:nX[t.funcName].size,mclass:nX[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Rt([t.mclass]):eX(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(lo(t.delim,t.mode));var r=new Mt("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=$t(fb[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function aX(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Wt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new Dt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:OC(e[0],t).text,color:r}}}),Wt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=OC(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=Or(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{aX(t);for(var r=Bi(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{aX(t);var r=qs(t.body,e);if(t.left!=="."){var n=new Mt("mo",[lo(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new Mt("mo",[lo(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return M7(r)}}),Wt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=OC(e[0],t);if(!t.parser.leftrightDepth)throw new Dt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=hb(e,[]):(r=eX(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?lo("|","text"):lo(t.delim,t.mode),n=new Mt("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var $C=(t,e)=>{var r=cp(an(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s,o=Ec(t.body);if(n==="sout")a=Rt(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=Xn({number:.6,unit:"pt"},e),u=Xn({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=$t(d/2+l);var f=Math.floor(1e3*d*i),p=tRe(f),g=new Ac([new Bu("phase",p)],{width:"400em",height:$t(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=zu(["hide-tail"],[g],e),a.style.height=$t(d),s=r.depth+l+u}else{/cancel/.test(n)?o||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m,y,v=0;/box/.test(n)?(v=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:v),y=m):n==="angl"?(v=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*v,y=Math.max(0,.25-r.depth)):(m=o?.2:0,y=m),a=PRe(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=$t(v)):n==="angl"&&v!==.049&&(a.style.borderTopWidth=$t(v),a.style.borderRightWidth=$t(v)),s=r.depth+y,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var T;if(t.backgroundColor)T=nn({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]});else{var b=/cancel|phase/.test(n)?["svg-align"]:[];T=nn({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:b}]})}return/cancel/.test(n)&&(T.height=r.height,T.depth=r.depth),/cancel/.test(n)&&!o?Rt(["mord","cancel-lap"],[T],e):Rt(["mord"],[T],e)},PC=(t,e)=>{var r,n=new Mt(t.label.includes("colorbox")?"mpadded":"menclose",[Tn(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+$t(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};Wt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Or(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:$C,mathmlBuilder:PC}),Wt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Or(e[0],"color-token").color,s=Or(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:$C,mathmlBuilder:PC}),Wt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}}),Wt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:$C,mathmlBuilder:PC}),Wt({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t;r.mode==="math"&&r.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:$C,mathmlBuilder:PC}),Wt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var sX={};function Cl(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var e=t.parser.settings;if(!e.displayMode)throw new Dt("{"+t.envName+"} can be used only in display mode.")},nLe=new Set(["gather","gather*"]);function Y7(t){if(!t.includes("ed"))return!t.includes("*")}function qu(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!s){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)s=1;else if(s=parseFloat(p),!s||s<0)throw new Dt("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],T=l!=null?[]:void 0;function b(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function w(){T&&(t.gullet.macros.get("\\df@tag")?(T.push(t.subparse([new Vs("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):T.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(b(),v.push(lX(t));;){var k=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var A={type:"ordgroup",mode:t.mode,body:k};r&&(A={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[A]}),g.push(A);var C=t.fetch().text;if(C==="&"){if(d&&g.length===d){if(u||o)throw new Dt("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(C==="\\end"){w(),g.length===1&&A.type==="styling"&&A.body.length===1&&A.body[0].type==="ordgroup"&&A.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),v.length0&&(b+=.25),u.push({pos:b,isDashed:je[Ce]})}for(w(s[0]),n=0;n0&&(M+=T,Cje))for(n=0;n=o)){var J=void 0;if(i>0||e.hskipBeforeAndAfter){var Z,ee;J=(Z=(ee=V)==null?void 0:ee.pregap)!=null?Z:f,J!==0&&(R=Rt(["arraycolsep"],[]),R.style.width=$t(J),S.push(R))}var ne=[];for(n=0;n0){for(var Te=lp("hline",r,h),Ze=lp("hdashline",r,h),ke=[{type:"elem",elem:Ge,shift:0}];u.length>0;){var Ve=u.pop(),Qe=Ve.pos-z;Ve.isDashed?ke.push({type:"elem",elem:Ze,shift:Qe}):ke.push({type:"elem",elem:Te,shift:Qe})}Ge=nn({positionType:"individualShift",children:ke})}if(D.length===0)return Rt(["mord"],[Ge],r);var nt=nn({positionType:"individualShift",children:D}),tt=Rt(["tag"],[nt],r);return Rc([Ge,tt])},iLe={c:"center ",l:"left ",r:"right "},El=function(e,r){for(var n=[],i=new Mt("mtd",[],["mtr-glue"]),a=new Mt("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,m="",y=!1,v=0,T=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",T-=1);for(var b=v;b0?"left ":"",f+=L[L.length-1].length>0?"right ":"";for(var O=1;O0&&p&&(y=1),n[g]={type:"align",align:m,pregap:y,postgap:0}}return s.colSeparationType=p?"align":"alignat",s};Cl({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=IC(e[0]),n=r?[e[0]]:Or(e[0],"ordgroup").body,i=n.map(function(s){var o=LC(s),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Dt("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return qu(t.parser,a,X7(t.envName))},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,!"lcr".includes(r))throw new Dt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=qu(t.parser,n,X7(t.envName)),s=Math.max(0,...a.body.map(o=>o.length));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=qu(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=IC(e[0]),n=r?[e[0]]:Or(e[0],"ordgroup").body,i=n.map(function(o){var l=LC(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Dt("Unknown column alignment: "+u,o)});if(i.length>1)throw new Dt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=qu(t.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new Dt("{subarray} can contain only one column");return s},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=qu(t.parser,e,X7(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:cX,htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){nLe.has(t.envName)&&BC(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Y7(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return qu(t.parser,e,"display")},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:cX,htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){BC(t);var e={autoTag:Y7(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return qu(t.parser,e,"display")},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["CD"],props:{numArgs:0},handler(t){return BC(t),URe(t.parser)},htmlBuilder:kl,mathmlBuilder:El}),ge("\\nonumber","\\gdef\\@eqnsw{0}"),ge("\\notag","\\nonumber"),Wt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Dt(t.funcName+" valid only within array environment")}});var uX=sX;Wt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new Dt("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return an(t.body,n)},dX=(t,e)=>{var r=t.font,n=e.withFont(r);return Tn(t.body,n)},fX={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Wt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=SC(e[0]),a=n;return a in fX&&(a=fX[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:hX,mathmlBuilder:dX}),Wt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"mclass",mode:r.mode,mclass:MC(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:Ec(n)}}}),Wt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:s}}},htmlBuilder:hX,mathmlBuilder:dX});var aLe=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=an(t.numer,a,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height0?g=3*f:g=7*f,m=e.fontMetrics().denom1):(d>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var y;if(h){var T=e.fontMetrics().axisHeight;p-s.depth-(T+.5*d){var r=new Mt("mfrac",[Tn(t.numer,e),Tn(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=Xn(t.barSize,e);r.setAttribute("linethickness",$t(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var a=new Mt("mo",[new Si(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var s=new Mt("mo",[new Si(t.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return M7(i)}return r},pX=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};Wt({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1],s,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=n==="\\cfrac",h=null;return u||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),pX({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:aLe,mathmlBuilder:sLe}),Wt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var gX=["display","text","script","scriptscript"],mX=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};Wt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],a=SC(e[0]),s=a.type==="atom"&&a.family==="open"?mX(a.text):null,o=SC(e[1]),l=o.type==="atom"&&o.family==="close"?mX(o.text):null,u=Or(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f=null,p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=Or(p.body[0],"textord");f=gX[Number(g.text)]}}else p=Or(p,"textord"),f=gX[Number(p.text)];return pX({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},f)}}),Wt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Or(e[0],"size").value,token:i}}}),Wt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=Or(e[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var s=e[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null}}});var yX=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?an(t.sup,e.havingStyle(r.sup()),e):an(t.sub,e.havingStyle(r.sub()),e),i=Or(t.base,"horizBrace")):i=Or(t,"horizBrace");var a=an(i.base,e.havingBaseStyle(Ir.DISPLAY)),s=RC(i,e),o;if(i.isOver?o=nn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=nn({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=Rt(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=nn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=nn({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Rt(["minner",i.isOver?"mover":"munder"],[o],e)},oLe=(t,e)=>{var r=_C(t.label);return new Mt(t.isOver?"mover":"munder",[Tn(t.base,e),r])};Wt({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:yX,mathmlBuilder:oLe}),Wt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=Or(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Ei(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=Bi(t.body,e,!1);return xRe(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=Gu(t.body,e);return r instanceof Mt||(r=new Mt("mrow",[r])),r.setAttribute("href",t.href),r}}),Wt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=Or(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:r,funcName:n,token:i}=t,a=Or(e[0],"raw").string,s=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=a,o={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,o={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,o={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),h=0;h{var r=Bi(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Rt(n,r,e);for(var a in t.attributes)a!=="class"&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i},mathmlBuilder:(t,e)=>Gu(t.body,e)}),Wt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:Ei(e[0]),mathml:Ei(e[1])}},htmlBuilder:(t,e)=>{var r=Bi(t.html,e,!1);return Rc(r)},mathmlBuilder:(t,e)=>Gu(t.mathml,e)});var K7=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new Dt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!lY(n))throw new Dt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Wt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(r[0])for(var l=Or(r[0],"raw").string,u=l.split(","),h=0;h{var r=Xn(t.height,e),n=0;t.totalheight.number>0&&(n=Xn(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=Xn(t.width,e));var a={height:$t(r+n)};i>0&&(a.width=$t(i)),n>0&&(a.verticalAlign=$t(-n));var s=new cRe(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new Mt("mglyph",[]);r.setAttribute("alt",t.alt);var n=Xn(t.height,e),i=0;if(t.totalheight.number>0&&(i=Xn(t.totalheight,e)-n,r.setAttribute("valign",$t(-i))),r.setAttribute("height",$t(n+i)),t.width.number>0){var a=Xn(t.width,e);r.setAttribute("width",$t(a))}return r.setAttribute("src",t.src),r}}),Wt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=Or(e[0],"size");if(r.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return AY(t.dimension,e)},mathmlBuilder(t,e){var r=Xn(t.dimension,e);return new MY(r)}}),Wt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=Rt([],[an(t.body,e)]),r=Rt(["inner"],[r],e)):r=Rt(["inner"],[an(t.body,e)]);var n=Rt(["fix"],[]),i=Rt([t.alignment],[r,n],e),a=Rt(["strut"]);return a.style.height=$t(i.height+i.depth),i.depth&&(a.style.verticalAlign=$t(-i.depth)),i.children.unshift(a),i=Rt(["thinbox"],[i],e),Rt(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new Mt("mpadded",[Tn(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}}),Wt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:s}}}),Wt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Dt("Mismatched "+t.funcName)}});var vX=(t,e)=>{switch(e.style.size){case Ir.DISPLAY.size:return t.display;case Ir.TEXT.size:return t.text;case Ir.SCRIPT.size:return t.script;case Ir.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};Wt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:Ei(e[0]),text:Ei(e[1]),script:Ei(e[2]),scriptscript:Ei(e[3])}},htmlBuilder:(t,e)=>{var r=vX(t,e),n=Bi(r,e,!1);return Rc(n)},mathmlBuilder:(t,e)=>{var r=vX(t,e);return Gu(r,e)}});var bX=(t,e,r,n,i,a,s)=>{t=Rt([],[t]);var o=r&&Ec(r),l,u;if(e){var h=an(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=an(r,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+s;f=nn({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:$t(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:$t(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-s;f=nn({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:$t(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+s;f=nn({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:$t(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var y=[f];if(l&&a!==0&&!o){var v=Rt(["mspace"],[],n);v.style.marginRight=$t(a),y.unshift(v)}return Rt(["mop","op-limits"],y,n)},xX=new Set(["\\smallint"]),up=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Or(t.base,"op"),i=!0):a=Or(t,"op");var s=e.style,o=!1;s.size===Ir.DISPLAY.size&&a.symbol&&!xX.has(a.name)&&(o=!0);var l,u;if(a.symbol){var h=o?"Size2-Regular":"Size1-Regular",d="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(d=a.name.slice(1),a.name=d==="oiint"?"\\iint":"\\iiint"),l=Xa(a.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=RY(d+"Size"+(o?"2":"1"),e);l=nn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]}),a.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var p=Bi(a.body,e,!0);p.length===1&&p[0]instanceof zs?(l=p[0],l.classes[0]="mop"):l=Rt(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new Mt("mo",[lo(t.name,t.mode)]),xX.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new Mt("mo",qs(t.body,e));else{r=new Mt("mi",[new Si(t.name.slice(1))]);var n=new Mt("mo",[lo("⁡","text")]);t.parentIsSupSub?r=new Mt("mrow",[r,n]):r=DY([r,n])}return r},lLe={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Wt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=lLe[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:up,mathmlBuilder:pb}),Wt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Ei(n)}},htmlBuilder:up,mathmlBuilder:pb});var cLe={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Wt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:up,mathmlBuilder:pb}),Wt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:up,mathmlBuilder:pb}),Wt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=cLe[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:up,mathmlBuilder:pb});var TX=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Or(t.base,"operatorname"),i=!0):a=Or(t,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(d=>{var f="text"in d?d.text:void 0;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=Bi(o,e.withFont("mathrm"),!0),u=0;u{for(var r=qs(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new Si(o)]}var l=new Mt("mi",r);l.setAttribute("mathvariant","normal");var u=new Mt("mo",[lo("⁡","text")]);return t.parentIsSupSub?new Mt("mrow",[l,u]):DY([l,u])};Wt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:Ei(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:TX,mathmlBuilder:uLe}),ge("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),vd({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Rc(Bi(t.body,e,!1)):Rt(["mord"],Bi(t.body,e,!0),e)},mathmlBuilder(t,e){return Gu(t.body,e,!0)}}),Wt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=an(t.body,e.havingCrampedStyle()),n=lp("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=nn({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Rt(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new Mt("mo",[new Si("‾")]);r.setAttribute("stretchy","true");var n=new Mt("mover",[Tn(t.body,e),r]);return n.setAttribute("accent","true"),n}}),Wt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:Ei(n)}},htmlBuilder:(t,e)=>{var r=Bi(t.body,e.withPhantom(),!1);return Rc(r)},mathmlBuilder:(t,e)=>{var r=qs(t.body,e);return new Mt("mphantom",r)}}),ge("\\hphantom","\\smash{\\phantom{#1}}"),Wt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=Rt(["inner"],[an(t.body,e.withPhantom())]),n=Rt(["fix"],[]);return Rt(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=qs(Ei(t.body),e),n=new Mt("mphantom",r),i=new Mt("mpadded",[n]);return i.setAttribute("width","0px"),i}}),Wt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=Or(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=an(t.body,e),n=Xn(t.dy,e);return nn({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Mt("mpadded",[Tn(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}}),Wt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}}),Wt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=Or(e[0],"size"),s=Or(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&Or(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=Rt(["mord","rule"],[],e),n=Xn(t.width,e),i=Xn(t.height,e),a=t.shift?Xn(t.shift,e):0;return r.style.borderRightWidth=$t(n),r.style.borderTopWidth=$t(i),r.style.bottom=$t(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=Xn(t.width,e),n=Xn(t.height,e),i=t.shift?Xn(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new Mt("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",$t(r)),s.setAttribute("height",$t(n));var o=new Mt("mpadded",[s]);return i>=0?o.setAttribute("height",$t(i)):(o.setAttribute("height",$t(i)),o.setAttribute("depth",$t(-i))),o.setAttribute("voffset",$t(i)),o}});function wX(t,e,r){for(var n=Bi(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return wX(t.body,r,e)};Wt({type:"sizing",names:CX,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:CX.indexOf(n)+1,body:a}},htmlBuilder:hLe,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=qs(t.body,r),i=new Mt("mstyle",n);return i.setAttribute("mathsize",$t(r.sizeMultiplier)),i}}),Wt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&Or(r[0],"ordgroup");if(s)for(var o,l=0;l{var r=Rt([],[an(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0),t.smashDepth&&(r.depth=0),t.smashHeight&&t.smashDepth)return Rt(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new Mt("mpadded",[Tn(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}}),Wt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=an(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=cp(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+s&&(s=(s+d-r.height-r.depth)/2);var f=l.height-r.height-s-u;r.style.paddingLeft=$t(h);var p=nn({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]});if(t.index){var g=e.havingStyle(Ir.SCRIPTSCRIPT),m=an(t.index,g,e),y=.6*(p.height-p.depth),v=nn({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]}),T=Rt(["root"],[v]);return Rt(["mord","sqrt"],[T,p],e)}else return Rt(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new Mt("mroot",[Tn(r,e),Tn(n,e)]):new Mt("msqrt",[Tn(r,e)])}});var j7={display:Ir.DISPLAY,text:Ir.TEXT,script:Ir.SCRIPT,scriptscript:Ir.SCRIPTSCRIPT};function dLe(t){return t in j7}Wt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);if(!dLe(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=j7[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),wX(t.body,n,e)},mathmlBuilder(t,e){var r=j7[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=qs(t.body,n),a=new Mt("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[t.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});var fLe=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Ir.DISPLAY.size||n.alwaysHandleSupSub);return i?up:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Ir.DISPLAY.size||n.limits);return a?TX:null}else{if(n.type==="accent")return Ec(n.base)?$7:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?yX:null}else return null}else return null};vd({type:"supsub",htmlBuilder(t,e){var r=fLe(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=an(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&Ec(n);if(i){var p=e.havingStyle(e.style.sup());o=an(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=an(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===Ir.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=$t(.5/u.ptPerEm/y),T=null;if(l){var b=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(s instanceof zs||b){var w;T=$t(-((w=s.italic)!=null?w:0))}}var k;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var A=u.defaultRuleThickness,C=4*A;if(h-o.depth-(l.height-d)0&&(h+=_,d-=_)}var L=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:T},{type:"elem",elem:o,shift:-h,marginRight:v}];k=nn({positionType:"individualShift",children:L})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var O=[{type:"elem",elem:l,marginLeft:T,marginRight:v}];k=nn({positionType:"shift",positionData:d,children:O})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),k=nn({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var M=I7(s,"right")||"mord";return Rt([M],[s,Rt(["msupsub"],[k])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var a=[Tn(t.base,e)];t.sub&&a.push(Tn(t.sub,e)),t.sup&&a.push(Tn(t.sup,e));var s;if(r)s=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===Ir.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Ir.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Ir.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Ir.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===Ir.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===Ir.DISPLAY)?s="mover":s="msup"}return new Mt(s,a)}}),vd({type:"atom",htmlBuilder(t,e){return S7(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new Mt("mo",[lo(t.text,t.mode)]);if(t.family==="bin"){var n=N7(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var kX={mi:"italic",mn:"normal",mtext:"normal"};vd({type:"mathord",htmlBuilder(t,e){return wC(t,e,"mathord")},mathmlBuilder(t,e){var r=new Mt("mi",[lo(t.text,t.mode,e)]),n=N7(t,e)||"italic";return n!==kX[r.type]&&r.setAttribute("mathvariant",n),r}}),vd({type:"textord",htmlBuilder(t,e){return wC(t,e,"textord")},mathmlBuilder(t,e){var r=lo(t.text,t.mode,e),n=N7(t,e)||"normal",i;return t.mode==="text"?i=new Mt("mtext",[r]):/[0-9]/.test(t.text)?i=new Mt("mn",[r]):t.text==="\\prime"?i=new Mt("mo",[r]):i=new Mt("mi",[r]),n!==kX[i.type]&&i.setAttribute("mathvariant",n),i}});var Z7={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Q7={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};vd({type:"spacing",htmlBuilder(t,e){if(Q7.hasOwnProperty(t.text)){var r=Q7[t.text].className||"";if(t.mode==="text"){var n=wC(t,e,"textord");return n.classes.push(r),n}else return Rt(["mspace",r],[S7(t.text,t.mode,e)],e)}else{if(Z7.hasOwnProperty(t.text))return Rt(["mspace",Z7[t.text]],[],e);throw new Dt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(Q7.hasOwnProperty(t.text))r=new Mt("mtext",[new Si(" ")]);else{if(Z7.hasOwnProperty(t.text))return new Mt("mspace");throw new Dt('Unknown type of space "'+t.text+'"')}return r}});var EX=()=>{var t=new Mt("mtd",[]);return t.setAttribute("width","50%"),t};vd({type:"tag",mathmlBuilder(t,e){var r=new Mt("mtable",[new Mt("mtr",[EX(),new Mt("mtd",[Gu(t.body,e)]),EX(),new Mt("mtd",[Gu(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var SX={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},AX={"\\textbf":"textbf","\\textmd":"textmd"},pLe={"\\textit":"textit","\\textup":"textup"},_X=(t,e)=>{var r=t.font;if(r){if(SX[r])return e.withTextFontFamily(SX[r]);if(AX[r])return e.withTextFontWeight(AX[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(pLe[r])};Wt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:Ei(i),font:n}},htmlBuilder(t,e){var r=_X(t,e),n=Bi(t.body,r,!0);return Rt(["mord","text"],n,r)},mathmlBuilder(t,e){var r=_X(t,e);return Gu(t.body,r)}}),Wt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=an(t.body,e),n=lp("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=nn({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return Rt(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new Mt("mo",[new Si("‾")]);r.setAttribute("stretchy","true");var n=new Mt("munder",[Tn(t.body,e),r]);return n.setAttribute("accentunder","true"),n}}),Wt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=an(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return nn({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Mt("mpadded",[Tn(t.body,e)],["vcenter"]);return new Mt("mrow",[r])}}),Wt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new Dt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=RX(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),Vu=LY,LX=`[ \r - ]`,gLe="\\\\[a-zA-Z@]+",mLe="\\\\[^\uD800-\uDFFF]",yLe="("+gLe+")"+LX+"*",vLe=`\\\\( +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function bRe(t){return"toText"in t}class s0{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r{if(bRe(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var y7={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},xRe={ex:!0,em:!0,mu:!0},pY=function(e){return typeof e!="string"&&(e=e.unit),e in y7||e in xRe||e==="ex"},Xn=function(e,r){var n;if(e.unit in y7)n=y7[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new Dt("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},$t=function(e){return+e.toFixed(4)+"em"},Pu=function(e){return e.filter(r=>r).join(" ")},v7=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=X8e(n)+":"+i+";")}return r},gY=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},mY=function(e){var r=document.createElement(e);r.className=Pu(this.classes),Object.assign(r.style,this.style);for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i/=\x00-\x1f]/,yY=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Ia(Pu(this.classes))+'"');var n=v7(this.style);n&&(r+=' style="'+Ia(n)+'"');for(var i of Object.keys(this.attributes)){if(TRe.test(i))throw new Dt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+Ia(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class o0{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,gY.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return mY.call(this,"span")}toMarkup(){return yY.call(this,"span")}}let bC=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,gY.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return mY.call(this,"a")}toMarkup(){return yY.call(this,"a")}};class wRe{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e=''+Ia(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=$t(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Pu(this.classes)),Object.keys(this.style).length>0&&(r=r||document.createElement("span"),Object.assign(r.style,this.style)),r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+$t(this.italic)+";"),n+=v7(this.style),n&&(e=!0,r+=' style="'+Ia(n)+'"');var i=Ia(this.text);return e?(r+=">",r+=i,r+="",r):i}}class Ac{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}}class b7{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var SRe=t=>t instanceof o0||t instanceof bC||t instanceof s0,wl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},xC={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},vY={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function bY(t,e){wl[t]=e}function x7(t,e,r){if(!wl[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=wl[e][n];if(!i&&t[0]in vY&&(n=vY[t[0]].charCodeAt(0),i=wl[e][n]),!i&&r==="text"&&dY(n)&&(i=wl[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var T7={};function ARe(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!T7[e]){var r=T7[e]={cssEmPerMu:xC.quad[e]/18};for(var n in xC)xC.hasOwnProperty(n)&&(r[n]=xC[n][e])}return T7[e]}var Wn={math:{},text:{}};function U(t,e,r,n,i,a){Wn[t][i]={font:e,group:r,replace:n},a&&n&&(Wn[t][n]=Wn[t][i])}var Q="math",kt="text",ce="main",$e="ams",Un="accent-token",Yt="bin",Ha="close",l0="inner",mr="mathord",ki="op-token",Gs="open",db="punct",ze="rel",_c="spacing",He="textord";U(Q,ce,ze,"≡","\\equiv",!0),U(Q,ce,ze,"≺","\\prec",!0),U(Q,ce,ze,"≻","\\succ",!0),U(Q,ce,ze,"∼","\\sim",!0),U(Q,ce,ze,"⊥","\\perp"),U(Q,ce,ze,"⪯","\\preceq",!0),U(Q,ce,ze,"⪰","\\succeq",!0),U(Q,ce,ze,"≃","\\simeq",!0),U(Q,ce,ze,"∣","\\mid",!0),U(Q,ce,ze,"≪","\\ll",!0),U(Q,ce,ze,"≫","\\gg",!0),U(Q,ce,ze,"≍","\\asymp",!0),U(Q,ce,ze,"∥","\\parallel"),U(Q,ce,ze,"⋈","\\bowtie",!0),U(Q,ce,ze,"⌣","\\smile",!0),U(Q,ce,ze,"⊑","\\sqsubseteq",!0),U(Q,ce,ze,"⊒","\\sqsupseteq",!0),U(Q,ce,ze,"≐","\\doteq",!0),U(Q,ce,ze,"⌢","\\frown",!0),U(Q,ce,ze,"∋","\\ni",!0),U(Q,ce,ze,"∝","\\propto",!0),U(Q,ce,ze,"⊢","\\vdash",!0),U(Q,ce,ze,"⊣","\\dashv",!0),U(Q,ce,ze,"∋","\\owns"),U(Q,ce,db,".","\\ldotp"),U(Q,ce,db,"⋅","\\cdotp"),U(Q,ce,db,"⋅","·"),U(kt,ce,He,"⋅","·"),U(Q,ce,He,"#","\\#"),U(kt,ce,He,"#","\\#"),U(Q,ce,He,"&","\\&"),U(kt,ce,He,"&","\\&"),U(Q,ce,He,"ℵ","\\aleph",!0),U(Q,ce,He,"∀","\\forall",!0),U(Q,ce,He,"ℏ","\\hbar",!0),U(Q,ce,He,"∃","\\exists",!0),U(Q,ce,He,"∇","\\nabla",!0),U(Q,ce,He,"♭","\\flat",!0),U(Q,ce,He,"ℓ","\\ell",!0),U(Q,ce,He,"♮","\\natural",!0),U(Q,ce,He,"♣","\\clubsuit",!0),U(Q,ce,He,"℘","\\wp",!0),U(Q,ce,He,"♯","\\sharp",!0),U(Q,ce,He,"♢","\\diamondsuit",!0),U(Q,ce,He,"ℜ","\\Re",!0),U(Q,ce,He,"♡","\\heartsuit",!0),U(Q,ce,He,"ℑ","\\Im",!0),U(Q,ce,He,"♠","\\spadesuit",!0),U(Q,ce,He,"§","\\S",!0),U(kt,ce,He,"§","\\S"),U(Q,ce,He,"¶","\\P",!0),U(kt,ce,He,"¶","\\P"),U(Q,ce,He,"†","\\dag"),U(kt,ce,He,"†","\\dag"),U(kt,ce,He,"†","\\textdagger"),U(Q,ce,He,"‡","\\ddag"),U(kt,ce,He,"‡","\\ddag"),U(kt,ce,He,"‡","\\textdaggerdbl"),U(Q,ce,Ha,"⎱","\\rmoustache",!0),U(Q,ce,Gs,"⎰","\\lmoustache",!0),U(Q,ce,Ha,"⟯","\\rgroup",!0),U(Q,ce,Gs,"⟮","\\lgroup",!0),U(Q,ce,Yt,"∓","\\mp",!0),U(Q,ce,Yt,"⊖","\\ominus",!0),U(Q,ce,Yt,"⊎","\\uplus",!0),U(Q,ce,Yt,"⊓","\\sqcap",!0),U(Q,ce,Yt,"∗","\\ast"),U(Q,ce,Yt,"⊔","\\sqcup",!0),U(Q,ce,Yt,"◯","\\bigcirc",!0),U(Q,ce,Yt,"∙","\\bullet",!0),U(Q,ce,Yt,"‡","\\ddagger"),U(Q,ce,Yt,"≀","\\wr",!0),U(Q,ce,Yt,"⨿","\\amalg"),U(Q,ce,Yt,"&","\\And"),U(Q,ce,ze,"⟵","\\longleftarrow",!0),U(Q,ce,ze,"⇐","\\Leftarrow",!0),U(Q,ce,ze,"⟸","\\Longleftarrow",!0),U(Q,ce,ze,"⟶","\\longrightarrow",!0),U(Q,ce,ze,"⇒","\\Rightarrow",!0),U(Q,ce,ze,"⟹","\\Longrightarrow",!0),U(Q,ce,ze,"↔","\\leftrightarrow",!0),U(Q,ce,ze,"⟷","\\longleftrightarrow",!0),U(Q,ce,ze,"⇔","\\Leftrightarrow",!0),U(Q,ce,ze,"⟺","\\Longleftrightarrow",!0),U(Q,ce,ze,"↦","\\mapsto",!0),U(Q,ce,ze,"⟼","\\longmapsto",!0),U(Q,ce,ze,"↗","\\nearrow",!0),U(Q,ce,ze,"↩","\\hookleftarrow",!0),U(Q,ce,ze,"↪","\\hookrightarrow",!0),U(Q,ce,ze,"↘","\\searrow",!0),U(Q,ce,ze,"↼","\\leftharpoonup",!0),U(Q,ce,ze,"⇀","\\rightharpoonup",!0),U(Q,ce,ze,"↙","\\swarrow",!0),U(Q,ce,ze,"↽","\\leftharpoondown",!0),U(Q,ce,ze,"⇁","\\rightharpoondown",!0),U(Q,ce,ze,"↖","\\nwarrow",!0),U(Q,ce,ze,"⇌","\\rightleftharpoons",!0),U(Q,$e,ze,"≮","\\nless",!0),U(Q,$e,ze,"","\\@nleqslant"),U(Q,$e,ze,"","\\@nleqq"),U(Q,$e,ze,"⪇","\\lneq",!0),U(Q,$e,ze,"≨","\\lneqq",!0),U(Q,$e,ze,"","\\@lvertneqq"),U(Q,$e,ze,"⋦","\\lnsim",!0),U(Q,$e,ze,"⪉","\\lnapprox",!0),U(Q,$e,ze,"⊀","\\nprec",!0),U(Q,$e,ze,"⋠","\\npreceq",!0),U(Q,$e,ze,"⋨","\\precnsim",!0),U(Q,$e,ze,"⪹","\\precnapprox",!0),U(Q,$e,ze,"≁","\\nsim",!0),U(Q,$e,ze,"","\\@nshortmid"),U(Q,$e,ze,"∤","\\nmid",!0),U(Q,$e,ze,"⊬","\\nvdash",!0),U(Q,$e,ze,"⊭","\\nvDash",!0),U(Q,$e,ze,"⋪","\\ntriangleleft"),U(Q,$e,ze,"⋬","\\ntrianglelefteq",!0),U(Q,$e,ze,"⊊","\\subsetneq",!0),U(Q,$e,ze,"","\\@varsubsetneq"),U(Q,$e,ze,"⫋","\\subsetneqq",!0),U(Q,$e,ze,"","\\@varsubsetneqq"),U(Q,$e,ze,"≯","\\ngtr",!0),U(Q,$e,ze,"","\\@ngeqslant"),U(Q,$e,ze,"","\\@ngeqq"),U(Q,$e,ze,"⪈","\\gneq",!0),U(Q,$e,ze,"≩","\\gneqq",!0),U(Q,$e,ze,"","\\@gvertneqq"),U(Q,$e,ze,"⋧","\\gnsim",!0),U(Q,$e,ze,"⪊","\\gnapprox",!0),U(Q,$e,ze,"⊁","\\nsucc",!0),U(Q,$e,ze,"⋡","\\nsucceq",!0),U(Q,$e,ze,"⋩","\\succnsim",!0),U(Q,$e,ze,"⪺","\\succnapprox",!0),U(Q,$e,ze,"≆","\\ncong",!0),U(Q,$e,ze,"","\\@nshortparallel"),U(Q,$e,ze,"∦","\\nparallel",!0),U(Q,$e,ze,"⊯","\\nVDash",!0),U(Q,$e,ze,"⋫","\\ntriangleright"),U(Q,$e,ze,"⋭","\\ntrianglerighteq",!0),U(Q,$e,ze,"","\\@nsupseteqq"),U(Q,$e,ze,"⊋","\\supsetneq",!0),U(Q,$e,ze,"","\\@varsupsetneq"),U(Q,$e,ze,"⫌","\\supsetneqq",!0),U(Q,$e,ze,"","\\@varsupsetneqq"),U(Q,$e,ze,"⊮","\\nVdash",!0),U(Q,$e,ze,"⪵","\\precneqq",!0),U(Q,$e,ze,"⪶","\\succneqq",!0),U(Q,$e,ze,"","\\@nsubseteqq"),U(Q,$e,Yt,"⊴","\\unlhd"),U(Q,$e,Yt,"⊵","\\unrhd"),U(Q,$e,ze,"↚","\\nleftarrow",!0),U(Q,$e,ze,"↛","\\nrightarrow",!0),U(Q,$e,ze,"⇍","\\nLeftarrow",!0),U(Q,$e,ze,"⇏","\\nRightarrow",!0),U(Q,$e,ze,"↮","\\nleftrightarrow",!0),U(Q,$e,ze,"⇎","\\nLeftrightarrow",!0),U(Q,$e,ze,"△","\\vartriangle"),U(Q,$e,He,"ℏ","\\hslash"),U(Q,$e,He,"▽","\\triangledown"),U(Q,$e,He,"◊","\\lozenge"),U(Q,$e,He,"Ⓢ","\\circledS"),U(Q,$e,He,"®","\\circledR"),U(kt,$e,He,"®","\\circledR"),U(Q,$e,He,"∡","\\measuredangle",!0),U(Q,$e,He,"∄","\\nexists"),U(Q,$e,He,"℧","\\mho"),U(Q,$e,He,"Ⅎ","\\Finv",!0),U(Q,$e,He,"⅁","\\Game",!0),U(Q,$e,He,"‵","\\backprime"),U(Q,$e,He,"▲","\\blacktriangle"),U(Q,$e,He,"▼","\\blacktriangledown"),U(Q,$e,He,"■","\\blacksquare"),U(Q,$e,He,"⧫","\\blacklozenge"),U(Q,$e,He,"★","\\bigstar"),U(Q,$e,He,"∢","\\sphericalangle",!0),U(Q,$e,He,"∁","\\complement",!0),U(Q,$e,He,"ð","\\eth",!0),U(kt,ce,He,"ð","ð"),U(Q,$e,He,"╱","\\diagup"),U(Q,$e,He,"╲","\\diagdown"),U(Q,$e,He,"□","\\square"),U(Q,$e,He,"□","\\Box"),U(Q,$e,He,"◊","\\Diamond"),U(Q,$e,He,"¥","\\yen",!0),U(kt,$e,He,"¥","\\yen",!0),U(Q,$e,He,"✓","\\checkmark",!0),U(kt,$e,He,"✓","\\checkmark"),U(Q,$e,He,"ℶ","\\beth",!0),U(Q,$e,He,"ℸ","\\daleth",!0),U(Q,$e,He,"ℷ","\\gimel",!0),U(Q,$e,He,"ϝ","\\digamma",!0),U(Q,$e,He,"ϰ","\\varkappa"),U(Q,$e,Gs,"┌","\\@ulcorner",!0),U(Q,$e,Ha,"┐","\\@urcorner",!0),U(Q,$e,Gs,"└","\\@llcorner",!0),U(Q,$e,Ha,"┘","\\@lrcorner",!0),U(Q,$e,ze,"≦","\\leqq",!0),U(Q,$e,ze,"⩽","\\leqslant",!0),U(Q,$e,ze,"⪕","\\eqslantless",!0),U(Q,$e,ze,"≲","\\lesssim",!0),U(Q,$e,ze,"⪅","\\lessapprox",!0),U(Q,$e,ze,"≊","\\approxeq",!0),U(Q,$e,Yt,"⋖","\\lessdot"),U(Q,$e,ze,"⋘","\\lll",!0),U(Q,$e,ze,"≶","\\lessgtr",!0),U(Q,$e,ze,"⋚","\\lesseqgtr",!0),U(Q,$e,ze,"⪋","\\lesseqqgtr",!0),U(Q,$e,ze,"≑","\\doteqdot"),U(Q,$e,ze,"≓","\\risingdotseq",!0),U(Q,$e,ze,"≒","\\fallingdotseq",!0),U(Q,$e,ze,"∽","\\backsim",!0),U(Q,$e,ze,"⋍","\\backsimeq",!0),U(Q,$e,ze,"⫅","\\subseteqq",!0),U(Q,$e,ze,"⋐","\\Subset",!0),U(Q,$e,ze,"⊏","\\sqsubset",!0),U(Q,$e,ze,"≼","\\preccurlyeq",!0),U(Q,$e,ze,"⋞","\\curlyeqprec",!0),U(Q,$e,ze,"≾","\\precsim",!0),U(Q,$e,ze,"⪷","\\precapprox",!0),U(Q,$e,ze,"⊲","\\vartriangleleft"),U(Q,$e,ze,"⊴","\\trianglelefteq"),U(Q,$e,ze,"⊨","\\vDash",!0),U(Q,$e,ze,"⊪","\\Vvdash",!0),U(Q,$e,ze,"⌣","\\smallsmile"),U(Q,$e,ze,"⌢","\\smallfrown"),U(Q,$e,ze,"≏","\\bumpeq",!0),U(Q,$e,ze,"≎","\\Bumpeq",!0),U(Q,$e,ze,"≧","\\geqq",!0),U(Q,$e,ze,"⩾","\\geqslant",!0),U(Q,$e,ze,"⪖","\\eqslantgtr",!0),U(Q,$e,ze,"≳","\\gtrsim",!0),U(Q,$e,ze,"⪆","\\gtrapprox",!0),U(Q,$e,Yt,"⋗","\\gtrdot"),U(Q,$e,ze,"⋙","\\ggg",!0),U(Q,$e,ze,"≷","\\gtrless",!0),U(Q,$e,ze,"⋛","\\gtreqless",!0),U(Q,$e,ze,"⪌","\\gtreqqless",!0),U(Q,$e,ze,"≖","\\eqcirc",!0),U(Q,$e,ze,"≗","\\circeq",!0),U(Q,$e,ze,"≜","\\triangleq",!0),U(Q,$e,ze,"∼","\\thicksim"),U(Q,$e,ze,"≈","\\thickapprox"),U(Q,$e,ze,"⫆","\\supseteqq",!0),U(Q,$e,ze,"⋑","\\Supset",!0),U(Q,$e,ze,"⊐","\\sqsupset",!0),U(Q,$e,ze,"≽","\\succcurlyeq",!0),U(Q,$e,ze,"⋟","\\curlyeqsucc",!0),U(Q,$e,ze,"≿","\\succsim",!0),U(Q,$e,ze,"⪸","\\succapprox",!0),U(Q,$e,ze,"⊳","\\vartriangleright"),U(Q,$e,ze,"⊵","\\trianglerighteq"),U(Q,$e,ze,"⊩","\\Vdash",!0),U(Q,$e,ze,"∣","\\shortmid"),U(Q,$e,ze,"∥","\\shortparallel"),U(Q,$e,ze,"≬","\\between",!0),U(Q,$e,ze,"⋔","\\pitchfork",!0),U(Q,$e,ze,"∝","\\varpropto"),U(Q,$e,ze,"◀","\\blacktriangleleft"),U(Q,$e,ze,"∴","\\therefore",!0),U(Q,$e,ze,"∍","\\backepsilon"),U(Q,$e,ze,"▶","\\blacktriangleright"),U(Q,$e,ze,"∵","\\because",!0),U(Q,$e,ze,"⋘","\\llless"),U(Q,$e,ze,"⋙","\\gggtr"),U(Q,$e,Yt,"⊲","\\lhd"),U(Q,$e,Yt,"⊳","\\rhd"),U(Q,$e,ze,"≂","\\eqsim",!0),U(Q,ce,ze,"⋈","\\Join"),U(Q,$e,ze,"≑","\\Doteq",!0),U(Q,$e,Yt,"∔","\\dotplus",!0),U(Q,$e,Yt,"∖","\\smallsetminus"),U(Q,$e,Yt,"⋒","\\Cap",!0),U(Q,$e,Yt,"⋓","\\Cup",!0),U(Q,$e,Yt,"⩞","\\doublebarwedge",!0),U(Q,$e,Yt,"⊟","\\boxminus",!0),U(Q,$e,Yt,"⊞","\\boxplus",!0),U(Q,$e,Yt,"⋇","\\divideontimes",!0),U(Q,$e,Yt,"⋉","\\ltimes",!0),U(Q,$e,Yt,"⋊","\\rtimes",!0),U(Q,$e,Yt,"⋋","\\leftthreetimes",!0),U(Q,$e,Yt,"⋌","\\rightthreetimes",!0),U(Q,$e,Yt,"⋏","\\curlywedge",!0),U(Q,$e,Yt,"⋎","\\curlyvee",!0),U(Q,$e,Yt,"⊝","\\circleddash",!0),U(Q,$e,Yt,"⊛","\\circledast",!0),U(Q,$e,Yt,"⋅","\\centerdot"),U(Q,$e,Yt,"⊺","\\intercal",!0),U(Q,$e,Yt,"⋒","\\doublecap"),U(Q,$e,Yt,"⋓","\\doublecup"),U(Q,$e,Yt,"⊠","\\boxtimes",!0),U(Q,$e,ze,"⇢","\\dashrightarrow",!0),U(Q,$e,ze,"⇠","\\dashleftarrow",!0),U(Q,$e,ze,"⇇","\\leftleftarrows",!0),U(Q,$e,ze,"⇆","\\leftrightarrows",!0),U(Q,$e,ze,"⇚","\\Lleftarrow",!0),U(Q,$e,ze,"↞","\\twoheadleftarrow",!0),U(Q,$e,ze,"↢","\\leftarrowtail",!0),U(Q,$e,ze,"↫","\\looparrowleft",!0),U(Q,$e,ze,"⇋","\\leftrightharpoons",!0),U(Q,$e,ze,"↶","\\curvearrowleft",!0),U(Q,$e,ze,"↺","\\circlearrowleft",!0),U(Q,$e,ze,"↰","\\Lsh",!0),U(Q,$e,ze,"⇈","\\upuparrows",!0),U(Q,$e,ze,"↿","\\upharpoonleft",!0),U(Q,$e,ze,"⇃","\\downharpoonleft",!0),U(Q,ce,ze,"⊶","\\origof",!0),U(Q,ce,ze,"⊷","\\imageof",!0),U(Q,$e,ze,"⊸","\\multimap",!0),U(Q,$e,ze,"↭","\\leftrightsquigarrow",!0),U(Q,$e,ze,"⇉","\\rightrightarrows",!0),U(Q,$e,ze,"⇄","\\rightleftarrows",!0),U(Q,$e,ze,"↠","\\twoheadrightarrow",!0),U(Q,$e,ze,"↣","\\rightarrowtail",!0),U(Q,$e,ze,"↬","\\looparrowright",!0),U(Q,$e,ze,"↷","\\curvearrowright",!0),U(Q,$e,ze,"↻","\\circlearrowright",!0),U(Q,$e,ze,"↱","\\Rsh",!0),U(Q,$e,ze,"⇊","\\downdownarrows",!0),U(Q,$e,ze,"↾","\\upharpoonright",!0),U(Q,$e,ze,"⇂","\\downharpoonright",!0),U(Q,$e,ze,"⇝","\\rightsquigarrow",!0),U(Q,$e,ze,"⇝","\\leadsto"),U(Q,$e,ze,"⇛","\\Rrightarrow",!0),U(Q,$e,ze,"↾","\\restriction"),U(Q,ce,He,"‘","`"),U(Q,ce,He,"$","\\$"),U(kt,ce,He,"$","\\$"),U(kt,ce,He,"$","\\textdollar"),U(Q,ce,He,"%","\\%"),U(kt,ce,He,"%","\\%"),U(Q,ce,He,"_","\\_"),U(kt,ce,He,"_","\\_"),U(kt,ce,He,"_","\\textunderscore"),U(Q,ce,He,"∠","\\angle",!0),U(Q,ce,He,"∞","\\infty",!0),U(Q,ce,He,"′","\\prime"),U(Q,ce,He,"△","\\triangle"),U(Q,ce,He,"Γ","\\Gamma",!0),U(Q,ce,He,"Δ","\\Delta",!0),U(Q,ce,He,"Θ","\\Theta",!0),U(Q,ce,He,"Λ","\\Lambda",!0),U(Q,ce,He,"Ξ","\\Xi",!0),U(Q,ce,He,"Π","\\Pi",!0),U(Q,ce,He,"Σ","\\Sigma",!0),U(Q,ce,He,"Υ","\\Upsilon",!0),U(Q,ce,He,"Φ","\\Phi",!0),U(Q,ce,He,"Ψ","\\Psi",!0),U(Q,ce,He,"Ω","\\Omega",!0),U(Q,ce,He,"A","Α"),U(Q,ce,He,"B","Β"),U(Q,ce,He,"E","Ε"),U(Q,ce,He,"Z","Ζ"),U(Q,ce,He,"H","Η"),U(Q,ce,He,"I","Ι"),U(Q,ce,He,"K","Κ"),U(Q,ce,He,"M","Μ"),U(Q,ce,He,"N","Ν"),U(Q,ce,He,"O","Ο"),U(Q,ce,He,"P","Ρ"),U(Q,ce,He,"T","Τ"),U(Q,ce,He,"X","Χ"),U(Q,ce,He,"¬","\\neg",!0),U(Q,ce,He,"¬","\\lnot"),U(Q,ce,He,"⊤","\\top"),U(Q,ce,He,"⊥","\\bot"),U(Q,ce,He,"∅","\\emptyset"),U(Q,$e,He,"∅","\\varnothing"),U(Q,ce,mr,"α","\\alpha",!0),U(Q,ce,mr,"β","\\beta",!0),U(Q,ce,mr,"γ","\\gamma",!0),U(Q,ce,mr,"δ","\\delta",!0),U(Q,ce,mr,"ϵ","\\epsilon",!0),U(Q,ce,mr,"ζ","\\zeta",!0),U(Q,ce,mr,"η","\\eta",!0),U(Q,ce,mr,"θ","\\theta",!0),U(Q,ce,mr,"ι","\\iota",!0),U(Q,ce,mr,"κ","\\kappa",!0),U(Q,ce,mr,"λ","\\lambda",!0),U(Q,ce,mr,"μ","\\mu",!0),U(Q,ce,mr,"ν","\\nu",!0),U(Q,ce,mr,"ξ","\\xi",!0),U(Q,ce,mr,"ο","\\omicron",!0),U(Q,ce,mr,"π","\\pi",!0),U(Q,ce,mr,"ρ","\\rho",!0),U(Q,ce,mr,"σ","\\sigma",!0),U(Q,ce,mr,"τ","\\tau",!0),U(Q,ce,mr,"υ","\\upsilon",!0),U(Q,ce,mr,"ϕ","\\phi",!0),U(Q,ce,mr,"χ","\\chi",!0),U(Q,ce,mr,"ψ","\\psi",!0),U(Q,ce,mr,"ω","\\omega",!0),U(Q,ce,mr,"ε","\\varepsilon",!0),U(Q,ce,mr,"ϑ","\\vartheta",!0),U(Q,ce,mr,"ϖ","\\varpi",!0),U(Q,ce,mr,"ϱ","\\varrho",!0),U(Q,ce,mr,"ς","\\varsigma",!0),U(Q,ce,mr,"φ","\\varphi",!0),U(Q,ce,Yt,"∗","*",!0),U(Q,ce,Yt,"+","+"),U(Q,ce,Yt,"−","-",!0),U(Q,ce,Yt,"⋅","\\cdot",!0),U(Q,ce,Yt,"∘","\\circ",!0),U(Q,ce,Yt,"÷","\\div",!0),U(Q,ce,Yt,"±","\\pm",!0),U(Q,ce,Yt,"×","\\times",!0),U(Q,ce,Yt,"∩","\\cap",!0),U(Q,ce,Yt,"∪","\\cup",!0),U(Q,ce,Yt,"∖","\\setminus",!0),U(Q,ce,Yt,"∧","\\land"),U(Q,ce,Yt,"∨","\\lor"),U(Q,ce,Yt,"∧","\\wedge",!0),U(Q,ce,Yt,"∨","\\vee",!0),U(Q,ce,He,"√","\\surd"),U(Q,ce,Gs,"⟨","\\langle",!0),U(Q,ce,Gs,"∣","\\lvert"),U(Q,ce,Gs,"∥","\\lVert"),U(Q,ce,Ha,"?","?"),U(Q,ce,Ha,"!","!"),U(Q,ce,Ha,"⟩","\\rangle",!0),U(Q,ce,Ha,"∣","\\rvert"),U(Q,ce,Ha,"∥","\\rVert"),U(Q,ce,ze,"=","="),U(Q,ce,ze,":",":"),U(Q,ce,ze,"≈","\\approx",!0),U(Q,ce,ze,"≅","\\cong",!0),U(Q,ce,ze,"≥","\\ge"),U(Q,ce,ze,"≥","\\geq",!0),U(Q,ce,ze,"←","\\gets"),U(Q,ce,ze,">","\\gt",!0),U(Q,ce,ze,"∈","\\in",!0),U(Q,ce,ze,"","\\@not"),U(Q,ce,ze,"⊂","\\subset",!0),U(Q,ce,ze,"⊃","\\supset",!0),U(Q,ce,ze,"⊆","\\subseteq",!0),U(Q,ce,ze,"⊇","\\supseteq",!0),U(Q,$e,ze,"⊈","\\nsubseteq",!0),U(Q,$e,ze,"⊉","\\nsupseteq",!0),U(Q,ce,ze,"⊨","\\models"),U(Q,ce,ze,"←","\\leftarrow",!0),U(Q,ce,ze,"≤","\\le"),U(Q,ce,ze,"≤","\\leq",!0),U(Q,ce,ze,"<","\\lt",!0),U(Q,ce,ze,"→","\\rightarrow",!0),U(Q,ce,ze,"→","\\to"),U(Q,$e,ze,"≱","\\ngeq",!0),U(Q,$e,ze,"≰","\\nleq",!0),U(Q,ce,_c," ","\\ "),U(Q,ce,_c," ","\\space"),U(Q,ce,_c," ","\\nobreakspace"),U(kt,ce,_c," ","\\ "),U(kt,ce,_c," "," "),U(kt,ce,_c," ","\\space"),U(kt,ce,_c," ","\\nobreakspace"),U(Q,ce,_c,"","\\nobreak"),U(Q,ce,_c,"","\\allowbreak"),U(Q,ce,db,",",","),U(Q,ce,db,";",";"),U(Q,$e,Yt,"⊼","\\barwedge",!0),U(Q,$e,Yt,"⊻","\\veebar",!0),U(Q,ce,Yt,"⊙","\\odot",!0),U(Q,ce,Yt,"⊕","\\oplus",!0),U(Q,ce,Yt,"⊗","\\otimes",!0),U(Q,ce,He,"∂","\\partial",!0),U(Q,ce,Yt,"⊘","\\oslash",!0),U(Q,$e,Yt,"⊚","\\circledcirc",!0),U(Q,$e,Yt,"⊡","\\boxdot",!0),U(Q,ce,Yt,"△","\\bigtriangleup"),U(Q,ce,Yt,"▽","\\bigtriangledown"),U(Q,ce,Yt,"†","\\dagger"),U(Q,ce,Yt,"⋄","\\diamond"),U(Q,ce,Yt,"⋆","\\star"),U(Q,ce,Yt,"◃","\\triangleleft"),U(Q,ce,Yt,"▹","\\triangleright"),U(Q,ce,Gs,"{","\\{"),U(kt,ce,He,"{","\\{"),U(kt,ce,He,"{","\\textbraceleft"),U(Q,ce,Ha,"}","\\}"),U(kt,ce,He,"}","\\}"),U(kt,ce,He,"}","\\textbraceright"),U(Q,ce,Gs,"{","\\lbrace"),U(Q,ce,Ha,"}","\\rbrace"),U(Q,ce,Gs,"[","\\lbrack",!0),U(kt,ce,He,"[","\\lbrack",!0),U(Q,ce,Ha,"]","\\rbrack",!0),U(kt,ce,He,"]","\\rbrack",!0),U(Q,ce,Gs,"(","\\lparen",!0),U(Q,ce,Ha,")","\\rparen",!0),U(kt,ce,He,"<","\\textless",!0),U(kt,ce,He,">","\\textgreater",!0),U(Q,ce,Gs,"⌊","\\lfloor",!0),U(Q,ce,Ha,"⌋","\\rfloor",!0),U(Q,ce,Gs,"⌈","\\lceil",!0),U(Q,ce,Ha,"⌉","\\rceil",!0),U(Q,ce,He,"\\","\\backslash"),U(Q,ce,He,"∣","|"),U(Q,ce,He,"∣","\\vert"),U(kt,ce,He,"|","\\textbar",!0),U(Q,ce,He,"∥","\\|"),U(Q,ce,He,"∥","\\Vert"),U(kt,ce,He,"∥","\\textbardbl"),U(kt,ce,He,"~","\\textasciitilde"),U(kt,ce,He,"\\","\\textbackslash"),U(kt,ce,He,"^","\\textasciicircum"),U(Q,ce,ze,"↑","\\uparrow",!0),U(Q,ce,ze,"⇑","\\Uparrow",!0),U(Q,ce,ze,"↓","\\downarrow",!0),U(Q,ce,ze,"⇓","\\Downarrow",!0),U(Q,ce,ze,"↕","\\updownarrow",!0),U(Q,ce,ze,"⇕","\\Updownarrow",!0),U(Q,ce,ki,"∐","\\coprod"),U(Q,ce,ki,"⋁","\\bigvee"),U(Q,ce,ki,"⋀","\\bigwedge"),U(Q,ce,ki,"⨄","\\biguplus"),U(Q,ce,ki,"⋂","\\bigcap"),U(Q,ce,ki,"⋃","\\bigcup"),U(Q,ce,ki,"∫","\\int"),U(Q,ce,ki,"∫","\\intop"),U(Q,ce,ki,"∬","\\iint"),U(Q,ce,ki,"∭","\\iiint"),U(Q,ce,ki,"∏","\\prod"),U(Q,ce,ki,"∑","\\sum"),U(Q,ce,ki,"⨂","\\bigotimes"),U(Q,ce,ki,"⨁","\\bigoplus"),U(Q,ce,ki,"⨀","\\bigodot"),U(Q,ce,ki,"∮","\\oint"),U(Q,ce,ki,"∯","\\oiint"),U(Q,ce,ki,"∰","\\oiiint"),U(Q,ce,ki,"⨆","\\bigsqcup"),U(Q,ce,ki,"∫","\\smallint"),U(kt,ce,l0,"…","\\textellipsis"),U(Q,ce,l0,"…","\\mathellipsis"),U(kt,ce,l0,"…","\\ldots",!0),U(Q,ce,l0,"…","\\ldots",!0),U(Q,ce,l0,"⋯","\\@cdots",!0),U(Q,ce,l0,"⋱","\\ddots",!0),U(Q,ce,He,"⋮","\\varvdots"),U(kt,ce,He,"⋮","\\varvdots"),U(Q,ce,Un,"ˊ","\\acute"),U(Q,ce,Un,"ˋ","\\grave"),U(Q,ce,Un,"¨","\\ddot"),U(Q,ce,Un,"~","\\tilde"),U(Q,ce,Un,"ˉ","\\bar"),U(Q,ce,Un,"˘","\\breve"),U(Q,ce,Un,"ˇ","\\check"),U(Q,ce,Un,"^","\\hat"),U(Q,ce,Un,"⃗","\\vec"),U(Q,ce,Un,"˙","\\dot"),U(Q,ce,Un,"˚","\\mathring"),U(Q,ce,mr,"","\\@imath"),U(Q,ce,mr,"","\\@jmath"),U(Q,ce,He,"ı","ı"),U(Q,ce,He,"ȷ","ȷ"),U(kt,ce,He,"ı","\\i",!0),U(kt,ce,He,"ȷ","\\j",!0),U(kt,ce,He,"ß","\\ss",!0),U(kt,ce,He,"æ","\\ae",!0),U(kt,ce,He,"œ","\\oe",!0),U(kt,ce,He,"ø","\\o",!0),U(kt,ce,He,"Æ","\\AE",!0),U(kt,ce,He,"Œ","\\OE",!0),U(kt,ce,He,"Ø","\\O",!0),U(kt,ce,Un,"ˊ","\\'"),U(kt,ce,Un,"ˋ","\\`"),U(kt,ce,Un,"ˆ","\\^"),U(kt,ce,Un,"˜","\\~"),U(kt,ce,Un,"ˉ","\\="),U(kt,ce,Un,"˘","\\u"),U(kt,ce,Un,"˙","\\."),U(kt,ce,Un,"¸","\\c"),U(kt,ce,Un,"˚","\\r"),U(kt,ce,Un,"ˇ","\\v"),U(kt,ce,Un,"¨",'\\"'),U(kt,ce,Un,"˝","\\H"),U(kt,ce,Un,"◯","\\textcircled");var xY={"--":!0,"---":!0,"``":!0,"''":!0};U(kt,ce,He,"–","--",!0),U(kt,ce,He,"–","\\textendash"),U(kt,ce,He,"—","---",!0),U(kt,ce,He,"—","\\textemdash"),U(kt,ce,He,"‘","`",!0),U(kt,ce,He,"‘","\\textquoteleft"),U(kt,ce,He,"’","'",!0),U(kt,ce,He,"’","\\textquoteright"),U(kt,ce,He,"“","``",!0),U(kt,ce,He,"“","\\textquotedblleft"),U(kt,ce,He,"”","''",!0),U(kt,ce,He,"”","\\textquotedblright"),U(Q,ce,He,"°","\\degree",!0),U(kt,ce,He,"°","\\degree"),U(kt,ce,He,"°","\\textdegree",!0),U(Q,ce,He,"£","\\pounds"),U(Q,ce,He,"£","\\mathsterling",!0),U(kt,ce,He,"£","\\pounds"),U(kt,ce,He,"£","\\textsterling",!0),U(Q,$e,He,"✠","\\maltese"),U(kt,$e,He,"✠","\\maltese");for(var TY='0123456789/@."',w7=0;w7{var e=t.charCodeAt(0),r=t.charCodeAt(1),n=(e-55296)*1024+(r-56320)+65536;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return IY[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return RRe[a]}else{if(n===120485||n===120486)return IY[0];if(120486{if(Pu(t.classes)!==Pu(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize||t.italic!==0&&t.hasClass("mathnormal"))return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n of Object.keys(t.style))if(t.style[n]!==e.style[n])return!1;for(var i of Object.keys(e.style))if(t.style[i]!==e.style[i])return!1;return!0},DY=t=>{for(var e=0;er&&(r=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},Rt=function(e,r,n,i){var a=new o0(e,r,n,i);return D7(a),a},zu=(t,e,r,n)=>new o0(t,e,r,n),c0=function(e,r,n){var i=Rt([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=$t(i.height),i.maxFontSize=1,i},MRe=function(e,r,n,i){var a=new bC(e,r,n,i);return D7(a),a},Rc=function(e){var r=new s0(e);return D7(r),r},u0=function(e,r){return e instanceof s0?Rt([],[e],r):e},NRe=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,s=1;s{var r=Rt(["mspace"],[],e),n=Xn(t,e);return r.style.marginRight=$t(n),r},SC=(t,e,r)=>{var n,i;switch(t){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=t}return e==="textbf"&&r==="textit"?i="BoldItalic":e==="textbf"?i="Bold":r==="textit"?i="Italic":i="Regular",n+"-"+i},M7={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},NY={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},OY=function(e,r){var[n,i,a]=NY[e],s=new Bu(n),o=new Ac([s],{width:$t(i),height:$t(a),style:"width:"+$t(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=zu(["overlay"],[o],r);return l.height=a,l.style.height=$t(a),l.style.width=$t(i),l},Kn={number:3,unit:"mu"},yd={number:4,unit:"mu"},Lc={number:5,unit:"mu"},ORe={mord:{mop:Kn,mbin:yd,mrel:Lc,minner:Kn},mop:{mord:Kn,mop:Kn,mrel:Lc,minner:Kn},mbin:{mord:yd,mop:yd,mopen:yd,minner:yd},mrel:{mord:Lc,mop:Lc,mopen:Lc,minner:Lc},mopen:{},mclose:{mop:Kn,mbin:yd,mrel:Lc,minner:Kn},mpunct:{mord:Kn,mop:Kn,mrel:Lc,mopen:Kn,mclose:Kn,mpunct:Kn,minner:Kn},minner:{mord:Kn,mop:Kn,mbin:yd,mrel:Lc,mopen:Kn,mpunct:Kn,minner:Kn}},$Re={mord:{mop:Kn},mop:{mord:Kn,mop:Kn},mbin:{},mrel:{},mopen:{},mclose:{mop:Kn},mpunct:{},minner:{mop:Kn}},$Y={},AC={},_C={};function Wt(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l{var y=m.classes[0],v=g.classes[0];y==="mbin"&&BRe.has(v)?m.classes[0]="mord":v==="mbin"&&PRe.has(y)&&(g.classes[0]="mord")},{node:d},f,p),N7(a,(g,m)=>{var y,v,x=$7(m),b=$7(g),w=x&&b?g.hasClass("mtight")?(y=$Re[x])==null?void 0:y[b]:(v=ORe[x])==null?void 0:v[b]:null;if(w)return MY(w,u)},{node:d},f,p),a},N7=function(e,r,n,i,a){i&&e.push(i);for(var s=0;sf=>{e.splice(d+1,0,f),s++})(s)}i&&e.pop()},PY=function(e){return e instanceof s0||e instanceof bC||e instanceof o0&&e.hasClass("enclosing")?e:null},O7=function(e,r){var n=PY(e);if(n){var i=n.children;if(i.length){if(r==="right")return O7(i[i.length-1],"right");if(r==="left")return O7(i[0],"left")}}return e},$7=function(e,r){if(!e)return null;r&&(e=O7(e,r));var n=e.classes[0];return zRe[n]||null},fb=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Rt(r.concat(n))},an=function(e,r,n){if(!e)return Rt();if(AC[e.type]){var i=AC[e.type](e,r);if(n&&r.size!==n.size){i=Rt(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Dt("Got group of unknown type: '"+e.type+"'")};function LC(t,e){var r=Rt(["base"],t,e),n=Rt(["strut"]);return n.style.height=$t(r.height+r.depth),r.depth&&(n.style.verticalAlign=$t(-r.depth)),r.children.unshift(n),r}function P7(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=Bi(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push(LC(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push(LC(s,e));var u;r?(u=LC(Bi(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=Rt(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=$t(h.height+h.depth),h.depth&&(d.style.verticalAlign=$t(-h.depth))}return h}function BY(t){return new s0(t)}class Mt{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=Pu(this.classes));for(var n=0;n0&&(e+=' class ="'+Ia(Pu(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Si{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ia(this.toText())}toText(){return this.text}}class FY{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",$t(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var GRe=new Set(["\\imath","\\jmath"]),qRe=new Set(["mrow","mtable"]),lo=function(e,r,n){return Wn[r][e]&&Wn[r][e].replace&&e.charCodeAt(0)!==55349&&!(xY.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=Wn[r][e].replace),new Si(e)},B7=function(e){return e.length===1?e[0]:new Mt("mrow",e)},VRe={mathit:"italic",boldsymbol:t=>t.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},F7=(t,e)=>{if(t.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var r=e.font;if(!r||r==="mathnormal")return null;var n=t.mode,i=VRe[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(GRe.has(a))return null;if(Wn[n][a]){var s=Wn[n][a].replace;s&&(a=s)}var o=M7[r].fontName;return x7(a,o,n)?M7[r].variant:null};function z7(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Si&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof Si&&r.text===","}else return!1}var qs=function(e,r,n){if(e.length===1){var i=Tn(e[0],r);return n&&i instanceof Mt&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o=1&&(s.type==="mn"||z7(s))){var u=l.children[0];u instanceof Mt&&u.type==="mn"&&(u.children=[...s.children,...u.children],a.pop())}else if(s.type==="mi"&&s.children.length===1){var h=s.children[0];if(h instanceof Si&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Si&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},Gu=function(e,r,n){return B7(qs(e,r,n))},Tn=function(e,r){if(!e)return new Mt("mrow");if(_C[e.type])return _C[e.type](e,r);throw new Dt("Got group of unknown type: '"+e.type+"'")};function zY(t,e,r,n,i){var a=qs(t,r),s;a.length===1&&a[0]instanceof Mt&&qRe.has(a[0].type)?s=a[0]:s=new Mt("mrow",a);var o=new Mt("annotation",[new Si(e)]);o.setAttribute("encoding","application/x-tex");var l=new Mt("semantics",[s,o]),u=new Mt("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return Rt([h],[u])}var WRe=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],GY=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],qY=function(e,r){return r.size<2?e:WRe[e-1][r.size-1]};class Ic{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Ic.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=GY[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(r,e),new Ic(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:qY(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:GY[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=qY(Ic.BASESIZE,e);return this.size===r&&this.textSize===Ic.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Ic.BASESIZE?["sizing","reset-size"+this.size,"size"+Ic.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=ARe(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Ic.BASESIZE=6;var VY=function(e){return new Ic({style:e.displayMode?Ir.DISPLAY:Ir.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},WY=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Rt(n,[e])}return e},URe=function(e,r,n){var i=VY(n),a;if(n.output==="mathml")return zY(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=P7(e,i);a=Rt(["katex"],[s])}else{var o=zY(e,r,i,n.displayMode,!1),l=P7(e,i);a=Rt(["katex"],[o,l])}return WY(a,n)},HRe=function(e,r,n){var i=VY(n),a=P7(e,i),s=Rt(["katex"],[a]);return WY(s,n)},YRe={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},IC=function(e){var r=new Mt("mo",[new Si(YRe[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},XRe={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},KRe=new Set(["widehat","widecheck","widetilde","utilde"]),DC=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(KRe.has(l)&&"base"in e){var u=e.base.type==="ordgroup"?e.base.body.length:1,h,d,f;if(u>5)l==="widehat"||l==="widecheck"?(h=420,o=2364,f=.42,d=l+"4"):(h=312,o=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][p],h=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(o=[0,600,1033,2339,2340][p],h=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],d="tilde"+p)}var g=new Bu(d),m=new Ac([g],{width:"100%",height:$t(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:zu([],[m],r),minWidth:0,height:f}}else{var y=[],v=XRe[l];if(!v)throw new Error('No SVG data for "'+l+'".');var[x,b,w]=v,k=w/1e3,S=x.length,C,_;if(S===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');C=["hide-tail"],_=[v[3]]}else if(S===2)C=["halfarrow-left","halfarrow-right"],_=["xMinYMin","xMaxYMin"];else if(S===3)C=["brace-left","brace-center","brace-right"],_=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+S+" children.");for(var L=0;L0&&(i.style.minWidth=$t(a)),i},jRe=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=Rt(["stretchy",r],[],a),r==="fbox"){var l=a.color&&a.getColor();l&&(s.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new b7({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new b7({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new Ac(u,{width:"100%",height:$t(o)});s=zu([],[h],a)}return s.height=o,s.style.height=$t(o),s},ZRe={bin:1,close:1,inner:1,open:1,punct:1,rel:1},QRe={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function JRe(t){return t in ZRe}function Or(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function MC(t){var e=NC(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function NC(t){return t&&(t.type==="atom"||QRe.hasOwnProperty(t.type))?t:null}var UY=t=>{if(t instanceof zs)return t;if(SRe(t)&&t.children.length===1)return UY(t.children[0])},G7=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=Or(t.base,"accent"),r=n.base,t.base=r,i=ERe(an(t,e)),t.base=n):(n=Or(t,"accent"),r=n.base);var a=an(r,e.havingCrampedStyle()),s=n.isShifty&&Ec(r),o=0;if(s){var l,u;o=(l=(u=UY(a))==null?void 0:u.skew)!=null?l:0}var h=n.label==="\\c",d=h?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=DC(n,e),f=nn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+$t(2*o)+")",marginLeft:$t(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=OY("vec",e),g=NY.vec[1]):(p=EC({mode:n.mode,text:n.label},e,"textord"),p=kRe(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=Rt(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=a.height);var y=o;m||(y-=g/2),f.style.left=$t(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=nn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var v=Rt(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},HY=(t,e)=>{var r=t.isStretchy?IC(t.label):new Mt("mo",[lo(t.label,t.mode)]),n=new Mt("mover",[Tn(t.base,e),r]);return n.setAttribute("accent","true"),n},eLe=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));Wt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=RC(e[0]),n=!eLe.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:G7,mathmlBuilder:HY}),Wt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:G7,mathmlBuilder:HY}),Wt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=an(t.base,e),n=DC(t,e),i=t.label==="\\utilde"?.12:0,a=nn({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return Rt(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=IC(t.label),n=new Mt("munder",[Tn(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var OC=t=>{var e=new Mt("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Wt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=u0(an(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;t.below&&(n=e.havingStyle(r.sub()),s=u0(an(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=DC(t,e),l=-e.fontMetrics().axisHeight+.5*o.height,u=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*o.height+.111;h=nn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:s,shift:d}]})}else h=nn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Rt(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=IC(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=OC(Tn(t.body,e));if(t.below){var a=OC(Tn(t.below,e));n=new Mt("munderover",[r,a,i])}else n=new Mt("mover",[r,i])}else if(t.below){var s=OC(Tn(t.below,e));n=new Mt("munder",[r,s])}else n=OC(),n=new Mt("mover",[r,n]);return n}});function YY(t,e){var r=Bi(t.body,e,!0);return Rt([t.mclass],r,e)}function XY(t,e){var r,n=qs(t.body,e);return t.mclass==="minner"?r=new Mt("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new Mt("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new Mt("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}Wt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:Ei(i),isCharacterBox:Ec(i)}},htmlBuilder:YY,mathmlBuilder:XY});var $C=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Wt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:$C(e[0]),body:Ei(e[1]),isCharacterBox:Ec(e[1])}}}),Wt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],s;n!=="\\stackrel"?s=$C(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Ei(i)},l={type:"supsub",mode:a.mode,base:o,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:s,body:[l],isCharacterBox:Ec(l)}},htmlBuilder:YY,mathmlBuilder:XY}),Wt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:$C(e[0]),body:Ei(e[0])}},htmlBuilder(t,e){var r=Bi(t.body,e,!0),n=Rt([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=qs(t.body,e),n=new Mt("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var tLe={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},KY=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),jY=t=>t.type==="textord"&&t.text==="@",rLe=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function nLe(t,e,r){var n=tLe[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=r.callFunction("\\Big",[a],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,o]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function iLe(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new Dt("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;aAV".includes(u))for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',s[l]);var g=nLe(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=KY()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Wt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=u0(an(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=$t(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new Mt("mrow",[Tn(t.label,e)]);return r=new Mt("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new Mt("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),Wt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=u0(an(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new Mt("mrow",[Tn(t.fragment,e)])}}),Wt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=Or(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new Dt("\\@char with invalid code point "+a);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var ZY=(t,e)=>{var r=Bi(t.body,e.withColor(t.color),!1);return Rc(r)},QY=(t,e)=>{var r=qs(t.body,e.withColor(t.color)),n=new Mt("mstyle",r);return n.setAttribute("mathcolor",t.color),n};Wt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=Or(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Ei(i)}},htmlBuilder:ZY,mathmlBuilder:QY}),Wt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=Or(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:ZY,mathmlBuilder:QY}),Wt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&Or(i,"size").value}},htmlBuilder(t,e){var r=Rt(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=$t(Xn(t.size,e)))),r},mathmlBuilder(t,e){var r=new Mt("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",$t(Xn(t.size,e)))),r}});var q7={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},JY=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Dt("Expected a control sequence",t);return e},aLe=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},eX=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};Wt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(q7[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=q7[n.text]),Or(e.parseFunction(),"internal");throw new Dt("Invalid token after macro prefix",n)}}),Wt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Dt("Expected a control sequence",n);for(var a=0,s,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),o[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Dt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new Dt('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new Dt("Expected a macro definition");o[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return s&&l.unshift(s),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:o},r===q7[r]),{type:"internal",mode:e.mode}}}),Wt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=JY(e.gullet.popToken());e.gullet.consumeSpaces();var i=aLe(e);return eX(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}}),Wt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=JY(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return eX(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var pb=function(e,r,n){var i=Wn.math[e]&&Wn.math[e].replace,a=x7(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},V7=function(e,r,n,i){var a=n.havingBaseStyle(r),s=Rt(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},tX=function(e,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=$t(a),e.height-=a,e.depth+=a},sLe=function(e,r,n,i,a,s){var o=Xa(e,"Main-Regular",a,i),l=V7(o,r,i,s);return tX(l,i,r),l},oLe=function(e,r,n,i){return Xa(e,"Size"+r+"-Regular",n,i)},rX=function(e,r,n,i,a,s){var o=oLe(e,r,a,i),l=V7(Rt(["delimsizing","size"+r],[o],i),Ir.TEXT,i,s);return n&&tX(l,i,Ir.TEXT),l},W7=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Rt(["delimsizinginner",i],[Rt([],[Xa(e,r,n)])]);return{type:"elem",elem:a}},U7=function(e,r,n){var i=wl["Size4-Regular"][e.charCodeAt(0)]?wl["Size4-Regular"][e.charCodeAt(0)][4]:wl["Size1-Regular"][e.charCodeAt(0)][4],a=new Bu("inner",yRe(e,Math.round(1e3*r))),s=new Ac([a],{width:$t(i),height:$t(r),style:"width:"+$t(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=zu([],[s],n);return o.height=r,o.style.height=$t(r),o.style.width=$t(i),{type:"elem",elem:o}},H7=.008,PC={type:"kern",size:-1*H7},lLe=new Set(["|","\\lvert","\\rvert","\\vert"]),cLe=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),nX=function(e,r,n,i,a,s){var o,l,u,h,d="",f=0;o=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?o=u="⏐":e==="\\Downarrow"?o=u="‖":e==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):lLe.has(e)?(u="∣",d="vert",f=333):cLe.has(e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(o="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(o="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=o="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(o="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=o="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(o="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(o="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(o="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=pb(o,p,a),m=g.height+g.depth,y=pb(u,p,a),v=y.height+y.depth,x=pb(h,p,a),b=x.height+x.depth,w=0,k=1;if(l!==null){var S=pb(l,p,a);w=S.height+S.depth,k=2}var C=m+b+w,_=Math.max(0,Math.ceil((r-C)/(k*v))),L=C+_*k*v,O=i.fontMetrics().axisHeight;n&&(O*=i.sizeMultiplier);var M=L/2-O,z=[];if(d.length>0){var F=L-m-b,A=Math.round(L*1e3),R=vRe(d,Math.round(F*1e3)),N=new Bu(d,R),D=$t(f/1e3),I=$t(A/1e3),$=new Ac([N],{width:D,height:I,viewBox:"0 0 "+f+" "+A}),B=zu([],[$],i);B.height=A/1e3,B.style.width=D,B.style.height=I,z.push({type:"elem",elem:B})}else{if(z.push(W7(h,p,a)),z.push(PC),l===null){var P=L-m-b+2*H7;z.push(U7(u,P,i))}else{var G=(L-m-b-w)/2+2*H7;z.push(U7(u,G,i)),z.push(PC),z.push(W7(l,p,a)),z.push(PC),z.push(U7(u,G,i))}z.push(PC),z.push(W7(o,p,a))}var V=i.havingBaseStyle(Ir.TEXT),X=nn({positionType:"bottom",positionData:M,children:z});return V7(Rt(["delimsizing","mult"],[X],V),Ir.TEXT,i,s)},Y7=80,X7=.08,K7=function(e,r,n,i,a){var s=mRe(e,i,n),o=new Bu(e,s),l=new Ac([o],{width:"400em",height:$t(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return zu(["hide-tail"],[l],a)},uLe=function(e,r){var n=r.havingBaseSizing(),i=lX("\\surd",e*n.sizeMultiplier,oX,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l,u,h,d;return i.type==="small"?(h=1e3+1e3*s+Y7,e<1?a=1:e<1.4&&(a=.7),l=(1+s+X7)/a,u=(1+s)/a,o=K7("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+Y7)*gb[i.size],u=(gb[i.size]+s)/a,l=(gb[i.size]+s+X7)/a,o=K7("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+X7,u=e+s,h=Math.floor(1e3*e+s)+Y7,o=K7("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=$t(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},iX=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),hLe=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),aX=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),gb=[0,1.2,1.8,2.4,3],sX=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),iX.has(e)||aX.has(e))return rX(e,r,!1,n,i,a);if(hLe.has(e))return nX(e,gb[r],!1,n,i,a);throw new Dt("Illegal delimiter: '"+e+"'")},dLe=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],fLe=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"stack"}],oX=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],pLe=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var r=e.type;throw new Error("Add support for delim type '"+r+"' here.")},lX=function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;sr)return o}return n[n.length-1]},j7=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;aX.has(e)?o=dLe:iX.has(e)?o=oX:o=fLe;var l=lX(e,r,o,i);return l.type==="small"?sLe(e,l.style,n,i,a,s):l.type==="large"?rX(e,l.size,n,i,a,s):nX(e,r,n,i,a,s)},Z7=function(e,r,n,i,a,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-o,n+o),d=Math.max(h/500*l,2*h-u);return j7(e,d,!0,i,a,s)},cX={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},gLe=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function uX(t){return"isMiddle"in t}function BC(t,e){var r=NC(t);if(r&&gLe.has(r.text))return r;throw r?new Dt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Dt("Invalid delimiter type '"+t.type+"'",t)}Wt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=BC(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:cX[t.funcName].size,mclass:cX[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Rt([t.mclass]):sX(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(lo(t.delim,t.mode));var r=new Mt("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=$t(gb[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function hX(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Wt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new Dt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:BC(e[0],t).text,color:r}}}),Wt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=BC(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=Or(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{hX(t);for(var r=Bi(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{hX(t);var r=qs(t.body,e);if(t.left!=="."){var n=new Mt("mo",[lo(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new Mt("mo",[lo(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return B7(r)}}),Wt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=BC(e[0],t);if(!t.parser.leftrightDepth)throw new Dt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=fb(e,[]):(r=sX(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?lo("|","text"):lo(t.delim,t.mode),n=new Mt("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var FC=(t,e)=>{var r=u0(an(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s,o=Ec(t.body);if(n==="sout")a=Rt(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=Xn({number:.6,unit:"pt"},e),u=Xn({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=$t(d/2+l);var f=Math.floor(1e3*d*i),p=pRe(f),g=new Ac([new Bu("phase",p)],{width:"400em",height:$t(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=zu(["hide-tail"],[g],e),a.style.height=$t(d),s=r.depth+l+u}else{/cancel/.test(n)?o||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m,y,v=0;/box/.test(n)?(v=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:v),y=m):n==="angl"?(v=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*v,y=Math.max(0,.25-r.depth)):(m=o?.2:0,y=m),a=jRe(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=$t(v)):n==="angl"&&v!==.049&&(a.style.borderTopWidth=$t(v),a.style.borderRightWidth=$t(v)),s=r.depth+y,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var x;if(t.backgroundColor)x=nn({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]});else{var b=/cancel|phase/.test(n)?["svg-align"]:[];x=nn({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:b}]})}return/cancel/.test(n)&&(x.height=r.height,x.depth=r.depth),/cancel/.test(n)&&!o?Rt(["mord","cancel-lap"],[x],e):Rt(["mord"],[x],e)},zC=(t,e)=>{var r,n=new Mt(t.label.includes("colorbox")?"mpadded":"menclose",[Tn(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+$t(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};Wt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Or(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:FC,mathmlBuilder:zC}),Wt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Or(e[0],"color-token").color,s=Or(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:FC,mathmlBuilder:zC}),Wt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}}),Wt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:FC,mathmlBuilder:zC}),Wt({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t;r.mode==="math"&&r.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:FC,mathmlBuilder:zC}),Wt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var dX={};function Cl(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var e=t.parser.settings;if(!e.displayMode)throw new Dt("{"+t.envName+"} can be used only in display mode.")},mLe=new Set(["gather","gather*"]);function Q7(t){if(!t.includes("ed"))return!t.includes("*")}function qu(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!s){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)s=1;else if(s=parseFloat(p),!s||s<0)throw new Dt("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],x=l!=null?[]:void 0;function b(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function w(){x&&(t.gullet.macros.get("\\df@tag")?(x.push(t.subparse([new Vs("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(b(),v.push(pX(t));;){var k=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var S={type:"ordgroup",mode:t.mode,body:k};r&&(S={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[S]}),g.push(S);var C=t.fetch().text;if(C==="&"){if(d&&g.length===d){if(u||o)throw new Dt("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(C==="\\end"){w(),g.length===1&&S.type==="styling"&&S.body.length===1&&S.body[0].type==="ordgroup"&&S.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),v.length0&&(b+=.25),u.push({pos:b,isDashed:je[Ce]})}for(w(s[0]),n=0;n0&&(M+=x,Cje))for(n=0;n=o)){var J=void 0;if(i>0||e.hskipBeforeAndAfter){var Z,ee;J=(Z=(ee=V)==null?void 0:ee.pregap)!=null?Z:f,J!==0&&(R=Rt(["arraycolsep"],[]),R.style.width=$t(J),A.push(R))}var ne=[];for(n=0;n0){for(var Te=c0("hline",r,h),Ze=c0("hdashline",r,h),ke=[{type:"elem",elem:Ge,shift:0}];u.length>0;){var Ve=u.pop(),Qe=Ve.pos-z;Ve.isDashed?ke.push({type:"elem",elem:Ze,shift:Qe}):ke.push({type:"elem",elem:Te,shift:Qe})}Ge=nn({positionType:"individualShift",children:ke})}if(D.length===0)return Rt(["mord"],[Ge],r);var nt=nn({positionType:"individualShift",children:D}),tt=Rt(["tag"],[nt],r);return Rc([Ge,tt])},yLe={c:"center ",l:"left ",r:"right "},El=function(e,r){for(var n=[],i=new Mt("mtd",[],["mtr-glue"]),a=new Mt("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,m="",y=!1,v=0,x=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",x-=1);for(var b=v;b0?"left ":"",f+=L[L.length-1].length>0?"right ":"";for(var O=1;O0&&p&&(y=1),n[g]={type:"align",align:m,pregap:y,postgap:0}}return s.colSeparationType=p?"align":"alignat",s};Cl({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=NC(e[0]),n=r?[e[0]]:Or(e[0],"ordgroup").body,i=n.map(function(s){var o=MC(s),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Dt("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return qu(t.parser,a,J7(t.envName))},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,!"lcr".includes(r))throw new Dt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=qu(t.parser,n,J7(t.envName)),s=Math.max(0,...a.body.map(o=>o.length));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=qu(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=NC(e[0]),n=r?[e[0]]:Or(e[0],"ordgroup").body,i=n.map(function(o){var l=MC(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Dt("Unknown column alignment: "+u,o)});if(i.length>1)throw new Dt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=qu(t.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new Dt("{subarray} can contain only one column");return s},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=qu(t.parser,e,J7(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:gX,htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){mLe.has(t.envName)&&GC(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Q7(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return qu(t.parser,e,"display")},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:gX,htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){GC(t);var e={autoTag:Q7(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return qu(t.parser,e,"display")},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["CD"],props:{numArgs:0},handler(t){return GC(t),iLe(t.parser)},htmlBuilder:kl,mathmlBuilder:El}),ge("\\nonumber","\\gdef\\@eqnsw{0}"),ge("\\notag","\\nonumber"),Wt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Dt(t.funcName+" valid only within array environment")}});var mX=dX;Wt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new Dt("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return an(t.body,n)},vX=(t,e)=>{var r=t.font,n=e.withFont(r);return Tn(t.body,n)},bX={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Wt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=RC(e[0]),a=n;return a in bX&&(a=bX[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:yX,mathmlBuilder:vX}),Wt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"mclass",mode:r.mode,mclass:$C(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:Ec(n)}}}),Wt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:s}}},htmlBuilder:yX,mathmlBuilder:vX});var vLe=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=an(t.numer,a,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height0?g=3*f:g=7*f,m=e.fontMetrics().denom1):(d>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var y;if(h){var x=e.fontMetrics().axisHeight;p-s.depth-(x+.5*d){var r=new Mt("mfrac",[Tn(t.numer,e),Tn(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=Xn(t.barSize,e);r.setAttribute("linethickness",$t(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var a=new Mt("mo",[new Si(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var s=new Mt("mo",[new Si(t.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return B7(i)}return r},xX=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};Wt({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1],s,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=n==="\\cfrac",h=null;return u||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),xX({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:vLe,mathmlBuilder:bLe}),Wt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var TX=["display","text","script","scriptscript"],wX=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};Wt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],a=RC(e[0]),s=a.type==="atom"&&a.family==="open"?wX(a.text):null,o=RC(e[1]),l=o.type==="atom"&&o.family==="close"?wX(o.text):null,u=Or(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f=null,p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=Or(p.body[0],"textord");f=TX[Number(g.text)]}}else p=Or(p,"textord"),f=TX[Number(p.text)];return xX({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},f)}}),Wt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Or(e[0],"size").value,token:i}}}),Wt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=Or(e[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var s=e[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null}}});var CX=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?an(t.sup,e.havingStyle(r.sup()),e):an(t.sub,e.havingStyle(r.sub()),e),i=Or(t.base,"horizBrace")):i=Or(t,"horizBrace");var a=an(i.base,e.havingBaseStyle(Ir.DISPLAY)),s=DC(i,e),o;if(i.isOver?o=nn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=nn({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=Rt(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=nn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=nn({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Rt(["minner",i.isOver?"mover":"munder"],[o],e)},xLe=(t,e)=>{var r=IC(t.label);return new Mt(t.isOver?"mover":"munder",[Tn(t.base,e),r])};Wt({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:CX,mathmlBuilder:xLe}),Wt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=Or(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Ei(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=Bi(t.body,e,!1);return MRe(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=Gu(t.body,e);return r instanceof Mt||(r=new Mt("mrow",[r])),r.setAttribute("href",t.href),r}}),Wt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=Or(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:r,funcName:n,token:i}=t,a=Or(e[0],"raw").string,s=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=a,o={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,o={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,o={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),h=0;h{var r=Bi(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Rt(n,r,e);for(var a in t.attributes)a!=="class"&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i},mathmlBuilder:(t,e)=>Gu(t.body,e)}),Wt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:Ei(e[0]),mathml:Ei(e[1])}},htmlBuilder:(t,e)=>{var r=Bi(t.html,e,!1);return Rc(r)},mathmlBuilder:(t,e)=>Gu(t.mathml,e)});var e8=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new Dt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!pY(n))throw new Dt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Wt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(r[0])for(var l=Or(r[0],"raw").string,u=l.split(","),h=0;h{var r=Xn(t.height,e),n=0;t.totalheight.number>0&&(n=Xn(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=Xn(t.width,e));var a={height:$t(r+n)};i>0&&(a.width=$t(i)),n>0&&(a.verticalAlign=$t(-n));var s=new wRe(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new Mt("mglyph",[]);r.setAttribute("alt",t.alt);var n=Xn(t.height,e),i=0;if(t.totalheight.number>0&&(i=Xn(t.totalheight,e)-n,r.setAttribute("valign",$t(-i))),r.setAttribute("height",$t(n+i)),t.width.number>0){var a=Xn(t.width,e);r.setAttribute("width",$t(a))}return r.setAttribute("src",t.src),r}}),Wt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=Or(e[0],"size");if(r.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return MY(t.dimension,e)},mathmlBuilder(t,e){var r=Xn(t.dimension,e);return new FY(r)}}),Wt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=Rt([],[an(t.body,e)]),r=Rt(["inner"],[r],e)):r=Rt(["inner"],[an(t.body,e)]);var n=Rt(["fix"],[]),i=Rt([t.alignment],[r,n],e),a=Rt(["strut"]);return a.style.height=$t(i.height+i.depth),i.depth&&(a.style.verticalAlign=$t(-i.depth)),i.children.unshift(a),i=Rt(["thinbox"],[i],e),Rt(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new Mt("mpadded",[Tn(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}}),Wt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:s}}}),Wt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Dt("Mismatched "+t.funcName)}});var kX=(t,e)=>{switch(e.style.size){case Ir.DISPLAY.size:return t.display;case Ir.TEXT.size:return t.text;case Ir.SCRIPT.size:return t.script;case Ir.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};Wt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:Ei(e[0]),text:Ei(e[1]),script:Ei(e[2]),scriptscript:Ei(e[3])}},htmlBuilder:(t,e)=>{var r=kX(t,e),n=Bi(r,e,!1);return Rc(n)},mathmlBuilder:(t,e)=>{var r=kX(t,e);return Gu(r,e)}});var EX=(t,e,r,n,i,a,s)=>{t=Rt([],[t]);var o=r&&Ec(r),l,u;if(e){var h=an(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=an(r,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+s;f=nn({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:$t(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:$t(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-s;f=nn({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:$t(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+s;f=nn({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:$t(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var y=[f];if(l&&a!==0&&!o){var v=Rt(["mspace"],[],n);v.style.marginRight=$t(a),y.unshift(v)}return Rt(["mop","op-limits"],y,n)},SX=new Set(["\\smallint"]),h0=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Or(t.base,"op"),i=!0):a=Or(t,"op");var s=e.style,o=!1;s.size===Ir.DISPLAY.size&&a.symbol&&!SX.has(a.name)&&(o=!0);var l,u;if(a.symbol){var h=o?"Size2-Regular":"Size1-Regular",d="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(d=a.name.slice(1),a.name=d==="oiint"?"\\iint":"\\iiint"),l=Xa(a.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=OY(d+"Size"+(o?"2":"1"),e);l=nn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]}),a.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var p=Bi(a.body,e,!0);p.length===1&&p[0]instanceof zs?(l=p[0],l.classes[0]="mop"):l=Rt(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new Mt("mo",[lo(t.name,t.mode)]),SX.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new Mt("mo",qs(t.body,e));else{r=new Mt("mi",[new Si(t.name.slice(1))]);var n=new Mt("mo",[lo("⁡","text")]);t.parentIsSupSub?r=new Mt("mrow",[r,n]):r=BY([r,n])}return r},TLe={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Wt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=TLe[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:h0,mathmlBuilder:mb}),Wt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Ei(n)}},htmlBuilder:h0,mathmlBuilder:mb});var wLe={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Wt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:h0,mathmlBuilder:mb}),Wt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:h0,mathmlBuilder:mb}),Wt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=wLe[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:h0,mathmlBuilder:mb});var AX=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Or(t.base,"operatorname"),i=!0):a=Or(t,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(d=>{var f="text"in d?d.text:void 0;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=Bi(o,e.withFont("mathrm"),!0),u=0;u{for(var r=qs(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new Si(o)]}var l=new Mt("mi",r);l.setAttribute("mathvariant","normal");var u=new Mt("mo",[lo("⁡","text")]);return t.parentIsSupSub?new Mt("mrow",[l,u]):BY([l,u])};Wt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:Ei(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:AX,mathmlBuilder:CLe}),ge("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),vd({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Rc(Bi(t.body,e,!1)):Rt(["mord"],Bi(t.body,e,!0),e)},mathmlBuilder(t,e){return Gu(t.body,e,!0)}}),Wt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=an(t.body,e.havingCrampedStyle()),n=c0("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=nn({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Rt(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new Mt("mo",[new Si("‾")]);r.setAttribute("stretchy","true");var n=new Mt("mover",[Tn(t.body,e),r]);return n.setAttribute("accent","true"),n}}),Wt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:Ei(n)}},htmlBuilder:(t,e)=>{var r=Bi(t.body,e.withPhantom(),!1);return Rc(r)},mathmlBuilder:(t,e)=>{var r=qs(t.body,e);return new Mt("mphantom",r)}}),ge("\\hphantom","\\smash{\\phantom{#1}}"),Wt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=Rt(["inner"],[an(t.body,e.withPhantom())]),n=Rt(["fix"],[]);return Rt(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=qs(Ei(t.body),e),n=new Mt("mphantom",r),i=new Mt("mpadded",[n]);return i.setAttribute("width","0px"),i}}),Wt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=Or(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=an(t.body,e),n=Xn(t.dy,e);return nn({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Mt("mpadded",[Tn(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}}),Wt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}}),Wt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=Or(e[0],"size"),s=Or(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&Or(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=Rt(["mord","rule"],[],e),n=Xn(t.width,e),i=Xn(t.height,e),a=t.shift?Xn(t.shift,e):0;return r.style.borderRightWidth=$t(n),r.style.borderTopWidth=$t(i),r.style.bottom=$t(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=Xn(t.width,e),n=Xn(t.height,e),i=t.shift?Xn(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new Mt("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",$t(r)),s.setAttribute("height",$t(n));var o=new Mt("mpadded",[s]);return i>=0?o.setAttribute("height",$t(i)):(o.setAttribute("height",$t(i)),o.setAttribute("depth",$t(-i))),o.setAttribute("voffset",$t(i)),o}});function _X(t,e,r){for(var n=Bi(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return _X(t.body,r,e)};Wt({type:"sizing",names:RX,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:RX.indexOf(n)+1,body:a}},htmlBuilder:kLe,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=qs(t.body,r),i=new Mt("mstyle",n);return i.setAttribute("mathsize",$t(r.sizeMultiplier)),i}}),Wt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&Or(r[0],"ordgroup");if(s)for(var o,l=0;l{var r=Rt([],[an(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0),t.smashDepth&&(r.depth=0),t.smashHeight&&t.smashDepth)return Rt(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new Mt("mpadded",[Tn(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}}),Wt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=an(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=u0(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+s&&(s=(s+d-r.height-r.depth)/2);var f=l.height-r.height-s-u;r.style.paddingLeft=$t(h);var p=nn({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]});if(t.index){var g=e.havingStyle(Ir.SCRIPTSCRIPT),m=an(t.index,g,e),y=.6*(p.height-p.depth),v=nn({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]}),x=Rt(["root"],[v]);return Rt(["mord","sqrt"],[x,p],e)}else return Rt(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new Mt("mroot",[Tn(r,e),Tn(n,e)]):new Mt("msqrt",[Tn(r,e)])}});var t8={display:Ir.DISPLAY,text:Ir.TEXT,script:Ir.SCRIPT,scriptscript:Ir.SCRIPTSCRIPT};function ELe(t){return t in t8}Wt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);if(!ELe(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=t8[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),_X(t.body,n,e)},mathmlBuilder(t,e){var r=t8[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=qs(t.body,n),a=new Mt("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[t.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});var SLe=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Ir.DISPLAY.size||n.alwaysHandleSupSub);return i?h0:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Ir.DISPLAY.size||n.limits);return a?AX:null}else{if(n.type==="accent")return Ec(n.base)?G7:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?CX:null}else return null}else return null};vd({type:"supsub",htmlBuilder(t,e){var r=SLe(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=an(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&Ec(n);if(i){var p=e.havingStyle(e.style.sup());o=an(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=an(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===Ir.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=$t(.5/u.ptPerEm/y),x=null;if(l){var b=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(s instanceof zs||b){var w;x=$t(-((w=s.italic)!=null?w:0))}}var k;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var S=u.defaultRuleThickness,C=4*S;if(h-o.depth-(l.height-d)0&&(h+=_,d-=_)}var L=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:x},{type:"elem",elem:o,shift:-h,marginRight:v}];k=nn({positionType:"individualShift",children:L})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var O=[{type:"elem",elem:l,marginLeft:x,marginRight:v}];k=nn({positionType:"shift",positionData:d,children:O})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),k=nn({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var M=$7(s,"right")||"mord";return Rt([M],[s,Rt(["msupsub"],[k])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var a=[Tn(t.base,e)];t.sub&&a.push(Tn(t.sub,e)),t.sup&&a.push(Tn(t.sup,e));var s;if(r)s=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===Ir.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Ir.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Ir.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Ir.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===Ir.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===Ir.DISPLAY)?s="mover":s="msup"}return new Mt(s,a)}}),vd({type:"atom",htmlBuilder(t,e){return I7(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new Mt("mo",[lo(t.text,t.mode)]);if(t.family==="bin"){var n=F7(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var LX={mi:"italic",mn:"normal",mtext:"normal"};vd({type:"mathord",htmlBuilder(t,e){return EC(t,e,"mathord")},mathmlBuilder(t,e){var r=new Mt("mi",[lo(t.text,t.mode,e)]),n=F7(t,e)||"italic";return n!==LX[r.type]&&r.setAttribute("mathvariant",n),r}}),vd({type:"textord",htmlBuilder(t,e){return EC(t,e,"textord")},mathmlBuilder(t,e){var r=lo(t.text,t.mode,e),n=F7(t,e)||"normal",i;return t.mode==="text"?i=new Mt("mtext",[r]):/[0-9]/.test(t.text)?i=new Mt("mn",[r]):t.text==="\\prime"?i=new Mt("mo",[r]):i=new Mt("mi",[r]),n!==LX[i.type]&&i.setAttribute("mathvariant",n),i}});var r8={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},n8={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};vd({type:"spacing",htmlBuilder(t,e){if(n8.hasOwnProperty(t.text)){var r=n8[t.text].className||"";if(t.mode==="text"){var n=EC(t,e,"textord");return n.classes.push(r),n}else return Rt(["mspace",r],[I7(t.text,t.mode,e)],e)}else{if(r8.hasOwnProperty(t.text))return Rt(["mspace",r8[t.text]],[],e);throw new Dt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(n8.hasOwnProperty(t.text))r=new Mt("mtext",[new Si(" ")]);else{if(r8.hasOwnProperty(t.text))return new Mt("mspace");throw new Dt('Unknown type of space "'+t.text+'"')}return r}});var IX=()=>{var t=new Mt("mtd",[]);return t.setAttribute("width","50%"),t};vd({type:"tag",mathmlBuilder(t,e){var r=new Mt("mtable",[new Mt("mtr",[IX(),new Mt("mtd",[Gu(t.body,e)]),IX(),new Mt("mtd",[Gu(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var DX={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},MX={"\\textbf":"textbf","\\textmd":"textmd"},ALe={"\\textit":"textit","\\textup":"textup"},NX=(t,e)=>{var r=t.font;if(r){if(DX[r])return e.withTextFontFamily(DX[r]);if(MX[r])return e.withTextFontWeight(MX[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(ALe[r])};Wt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:Ei(i),font:n}},htmlBuilder(t,e){var r=NX(t,e),n=Bi(t.body,r,!0);return Rt(["mord","text"],n,r)},mathmlBuilder(t,e){var r=NX(t,e);return Gu(t.body,r)}}),Wt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=an(t.body,e),n=c0("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=nn({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return Rt(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new Mt("mo",[new Si("‾")]);r.setAttribute("stretchy","true");var n=new Mt("munder",[Tn(t.body,e),r]);return n.setAttribute("accentunder","true"),n}}),Wt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=an(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return nn({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Mt("mpadded",[Tn(t.body,e)],["vcenter"]);return new Mt("mrow",[r])}}),Wt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new Dt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=OX(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),Vu=$Y,$X=`[ \r + ]`,_Le="\\\\[a-zA-Z@]+",RLe="\\\\[^\uD800-\uDFFF]",LLe="("+_Le+")"+$X+"*",ILe=`\\\\( |[ \r ]+ -?)[ \r ]*`,J7="[̀-ͯ]",bLe=new RegExp(J7+"+$"),xLe="("+LX+"+)|"+(vLe+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(J7+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(J7+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+yLe)+("|"+mLe+")");let IX=class{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(xLe,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new Vs("EOF",new xs(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Dt("Unexpected character: '"+e[r]+"'",new Vs(e[r],new xs(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(` -`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new Vs(i,new xs(this,r,this.tokenRegex.lastIndex))}};class TLe{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Dt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var wLe=oX;ge("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}}),ge("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}}),ge("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}}),ge("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}}),ge("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}}),ge("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),ge("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var DX={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ge("\\char",function(t){var e=t.popToken(),r,n=0;if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new Dt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=DX[e.text],n==null||n>=r)throw new Dt("Invalid base-"+r+" digit "+e.text);for(var i;(i=DX[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Dt("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new Dt("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new Dt("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Dt("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};ge("\\newcommand",t=>e8(t,!1,!0,!1)),ge("\\renewcommand",t=>e8(t,!0,!1,!1)),ge("\\providecommand",t=>e8(t,!0,!0,!0)),ge("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""}),ge("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""}),ge("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),Vu[r],Wn.math[r],Wn.text[r]),""}),ge("\\bgroup","{"),ge("\\egroup","}"),ge("~","\\nobreakspace"),ge("\\lq","`"),ge("\\rq","'"),ge("\\aa","\\r a"),ge("\\AA","\\r A"),ge("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),ge("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),ge("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),ge("ℬ","\\mathscr{B}"),ge("ℰ","\\mathscr{E}"),ge("ℱ","\\mathscr{F}"),ge("ℋ","\\mathscr{H}"),ge("ℐ","\\mathscr{I}"),ge("ℒ","\\mathscr{L}"),ge("ℳ","\\mathscr{M}"),ge("ℛ","\\mathscr{R}"),ge("ℭ","\\mathfrak{C}"),ge("ℌ","\\mathfrak{H}"),ge("ℨ","\\mathfrak{Z}"),ge("\\Bbbk","\\Bbb{k}"),ge("\\llap","\\mathllap{\\textrm{#1}}"),ge("\\rlap","\\mathrlap{\\textrm{#1}}"),ge("\\clap","\\mathclap{\\textrm{#1}}"),ge("\\mathstrut","\\vphantom{(}"),ge("\\underbar","\\underline{\\text{#1}}"),ge("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),ge("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),ge("\\ne","\\neq"),ge("≠","\\neq"),ge("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),ge("∉","\\notin"),ge("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),ge("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),ge("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),ge("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),ge("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),ge("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),ge("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),ge("⟂","\\perp"),ge("‼","\\mathclose{!\\mkern-0.8mu!}"),ge("∌","\\notni"),ge("⌜","\\ulcorner"),ge("⌝","\\urcorner"),ge("⌞","\\llcorner"),ge("⌟","\\lrcorner"),ge("©","\\copyright"),ge("®","\\textregistered"),ge("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),ge("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),ge("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),ge("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),ge("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),ge("⋮","\\vdots"),ge("\\varGamma","\\mathit{\\Gamma}"),ge("\\varDelta","\\mathit{\\Delta}"),ge("\\varTheta","\\mathit{\\Theta}"),ge("\\varLambda","\\mathit{\\Lambda}"),ge("\\varXi","\\mathit{\\Xi}"),ge("\\varPi","\\mathit{\\Pi}"),ge("\\varSigma","\\mathit{\\Sigma}"),ge("\\varUpsilon","\\mathit{\\Upsilon}"),ge("\\varPhi","\\mathit{\\Phi}"),ge("\\varPsi","\\mathit{\\Psi}"),ge("\\varOmega","\\mathit{\\Omega}"),ge("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),ge("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),ge("\\boxed","\\fbox{$\\displaystyle{#1}$}"),ge("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),ge("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),ge("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),ge("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),ge("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var MX={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},CLe=new Set(["bin","rel"]);ge("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in MX?e=MX[r]:(r.slice(0,4)==="\\not"||r in Wn.math&&CLe.has(Wn.math[r].group))&&(e="\\dotsb"),e});var t8={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ge("\\dotso",function(t){var e=t.future().text;return e in t8?"\\ldots\\,":"\\ldots"}),ge("\\dotsc",function(t){var e=t.future().text;return e in t8&&e!==","?"\\ldots\\,":"\\ldots"}),ge("\\cdots",function(t){var e=t.future().text;return e in t8?"\\@cdots\\,":"\\@cdots"}),ge("\\dotsb","\\cdots"),ge("\\dotsm","\\cdots"),ge("\\dotsi","\\!\\cdots"),ge("\\dotsx","\\ldots\\,"),ge("\\DOTSI","\\relax"),ge("\\DOTSB","\\relax"),ge("\\DOTSX","\\relax"),ge("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),ge("\\,","\\tmspace+{3mu}{.1667em}"),ge("\\thinspace","\\,"),ge("\\>","\\mskip{4mu}"),ge("\\:","\\tmspace+{4mu}{.2222em}"),ge("\\medspace","\\:"),ge("\\;","\\tmspace+{5mu}{.2777em}"),ge("\\thickspace","\\;"),ge("\\!","\\tmspace-{3mu}{.1667em}"),ge("\\negthinspace","\\!"),ge("\\negmedspace","\\tmspace-{4mu}{.2222em}"),ge("\\negthickspace","\\tmspace-{5mu}{.277em}"),ge("\\enspace","\\kern.5em "),ge("\\enskip","\\hskip.5em\\relax"),ge("\\quad","\\hskip1em\\relax"),ge("\\qquad","\\hskip2em\\relax"),ge("\\tag","\\@ifstar\\tag@literal\\tag@paren"),ge("\\tag@paren","\\tag@literal{({#1})}"),ge("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Dt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),ge("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),ge("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),ge("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),ge("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),ge("\\newline","\\\\\\relax"),ge("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var NX=$t(wl["Main-Regular"][84][1]-.7*wl["Main-Regular"][65][1]);ge("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+NX+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),ge("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+NX+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),ge("\\hspace","\\@ifstar\\@hspacer\\@hspace"),ge("\\@hspace","\\hskip #1\\relax"),ge("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),ge("\\ordinarycolon",":"),ge("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),ge("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),ge("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),ge("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),ge("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),ge("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),ge("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),ge("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),ge("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),ge("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),ge("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),ge("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),ge("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),ge("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),ge("∷","\\dblcolon"),ge("∹","\\eqcolon"),ge("≔","\\coloneqq"),ge("≕","\\eqqcolon"),ge("⩴","\\Coloneqq"),ge("\\ratio","\\vcentcolon"),ge("\\coloncolon","\\dblcolon"),ge("\\colonequals","\\coloneqq"),ge("\\coloncolonequals","\\Coloneqq"),ge("\\equalscolon","\\eqqcolon"),ge("\\equalscoloncolon","\\Eqqcolon"),ge("\\colonminus","\\coloneq"),ge("\\coloncolonminus","\\Coloneq"),ge("\\minuscolon","\\eqcolon"),ge("\\minuscoloncolon","\\Eqcolon"),ge("\\coloncolonapprox","\\Colonapprox"),ge("\\coloncolonsim","\\Colonsim"),ge("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ge("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ge("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ge("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ge("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),ge("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),ge("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),ge("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),ge("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),ge("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),ge("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),ge("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),ge("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),ge("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),ge("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),ge("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),ge("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),ge("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),ge("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),ge("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),ge("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),ge("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),ge("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),ge("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),ge("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),ge("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),ge("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),ge("\\imath","\\html@mathml{\\@imath}{ı}"),ge("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),ge("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),ge("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),ge("⟦","\\llbracket"),ge("⟧","\\rrbracket"),ge("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),ge("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),ge("⦃","\\lBrace"),ge("⦄","\\rBrace"),ge("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),ge("⦵","\\minuso"),ge("\\darr","\\downarrow"),ge("\\dArr","\\Downarrow"),ge("\\Darr","\\Downarrow"),ge("\\lang","\\langle"),ge("\\rang","\\rangle"),ge("\\uarr","\\uparrow"),ge("\\uArr","\\Uparrow"),ge("\\Uarr","\\Uparrow"),ge("\\N","\\mathbb{N}"),ge("\\R","\\mathbb{R}"),ge("\\Z","\\mathbb{Z}"),ge("\\alef","\\aleph"),ge("\\alefsym","\\aleph"),ge("\\Alpha","\\mathrm{A}"),ge("\\Beta","\\mathrm{B}"),ge("\\bull","\\bullet"),ge("\\Chi","\\mathrm{X}"),ge("\\clubs","\\clubsuit"),ge("\\cnums","\\mathbb{C}"),ge("\\Complex","\\mathbb{C}"),ge("\\Dagger","\\ddagger"),ge("\\diamonds","\\diamondsuit"),ge("\\empty","\\emptyset"),ge("\\Epsilon","\\mathrm{E}"),ge("\\Eta","\\mathrm{H}"),ge("\\exist","\\exists"),ge("\\harr","\\leftrightarrow"),ge("\\hArr","\\Leftrightarrow"),ge("\\Harr","\\Leftrightarrow"),ge("\\hearts","\\heartsuit"),ge("\\image","\\Im"),ge("\\infin","\\infty"),ge("\\Iota","\\mathrm{I}"),ge("\\isin","\\in"),ge("\\Kappa","\\mathrm{K}"),ge("\\larr","\\leftarrow"),ge("\\lArr","\\Leftarrow"),ge("\\Larr","\\Leftarrow"),ge("\\lrarr","\\leftrightarrow"),ge("\\lrArr","\\Leftrightarrow"),ge("\\Lrarr","\\Leftrightarrow"),ge("\\Mu","\\mathrm{M}"),ge("\\natnums","\\mathbb{N}"),ge("\\Nu","\\mathrm{N}"),ge("\\Omicron","\\mathrm{O}"),ge("\\plusmn","\\pm"),ge("\\rarr","\\rightarrow"),ge("\\rArr","\\Rightarrow"),ge("\\Rarr","\\Rightarrow"),ge("\\real","\\Re"),ge("\\reals","\\mathbb{R}"),ge("\\Reals","\\mathbb{R}"),ge("\\Rho","\\mathrm{P}"),ge("\\sdot","\\cdot"),ge("\\sect","\\S"),ge("\\spades","\\spadesuit"),ge("\\sub","\\subset"),ge("\\sube","\\subseteq"),ge("\\supe","\\supseteq"),ge("\\Tau","\\mathrm{T}"),ge("\\thetasym","\\vartheta"),ge("\\weierp","\\wp"),ge("\\Zeta","\\mathrm{Z}"),ge("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),ge("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),ge("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),ge("\\bra","\\mathinner{\\langle{#1}|}"),ge("\\ket","\\mathinner{|{#1}\\rangle}"),ge("\\braket","\\mathinner{\\langle{#1}\\rangle}"),ge("\\Bra","\\left\\langle#1\\right|"),ge("\\Ket","\\left|#1\\right\\rangle");var OX=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",s),i.length&&f.macros.set("\\|",o));var p=d;if(!d&&i.length){var g=f.future();g.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,h=e.expandTokens([...a,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};ge("\\bra@ket",OX(!1)),ge("\\bra@set",OX(!0)),ge("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),ge("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),ge("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),ge("\\angln","{\\angl n}"),ge("\\blue","\\textcolor{##6495ed}{#1}"),ge("\\orange","\\textcolor{##ffa500}{#1}"),ge("\\pink","\\textcolor{##ff00af}{#1}"),ge("\\red","\\textcolor{##df0030}{#1}"),ge("\\green","\\textcolor{##28ae7b}{#1}"),ge("\\gray","\\textcolor{gray}{#1}"),ge("\\purple","\\textcolor{##9d38bd}{#1}"),ge("\\blueA","\\textcolor{##ccfaff}{#1}"),ge("\\blueB","\\textcolor{##80f6ff}{#1}"),ge("\\blueC","\\textcolor{##63d9ea}{#1}"),ge("\\blueD","\\textcolor{##11accd}{#1}"),ge("\\blueE","\\textcolor{##0c7f99}{#1}"),ge("\\tealA","\\textcolor{##94fff5}{#1}"),ge("\\tealB","\\textcolor{##26edd5}{#1}"),ge("\\tealC","\\textcolor{##01d1c1}{#1}"),ge("\\tealD","\\textcolor{##01a995}{#1}"),ge("\\tealE","\\textcolor{##208170}{#1}"),ge("\\greenA","\\textcolor{##b6ffb0}{#1}"),ge("\\greenB","\\textcolor{##8af281}{#1}"),ge("\\greenC","\\textcolor{##74cf70}{#1}"),ge("\\greenD","\\textcolor{##1fab54}{#1}"),ge("\\greenE","\\textcolor{##0d923f}{#1}"),ge("\\goldA","\\textcolor{##ffd0a9}{#1}"),ge("\\goldB","\\textcolor{##ffbb71}{#1}"),ge("\\goldC","\\textcolor{##ff9c39}{#1}"),ge("\\goldD","\\textcolor{##e07d10}{#1}"),ge("\\goldE","\\textcolor{##a75a05}{#1}"),ge("\\redA","\\textcolor{##fca9a9}{#1}"),ge("\\redB","\\textcolor{##ff8482}{#1}"),ge("\\redC","\\textcolor{##f9685d}{#1}"),ge("\\redD","\\textcolor{##e84d39}{#1}"),ge("\\redE","\\textcolor{##bc2612}{#1}"),ge("\\maroonA","\\textcolor{##ffbde0}{#1}"),ge("\\maroonB","\\textcolor{##ff92c6}{#1}"),ge("\\maroonC","\\textcolor{##ed5fa6}{#1}"),ge("\\maroonD","\\textcolor{##ca337c}{#1}"),ge("\\maroonE","\\textcolor{##9e034e}{#1}"),ge("\\purpleA","\\textcolor{##ddd7ff}{#1}"),ge("\\purpleB","\\textcolor{##c6b9fc}{#1}"),ge("\\purpleC","\\textcolor{##aa87ff}{#1}"),ge("\\purpleD","\\textcolor{##7854ab}{#1}"),ge("\\purpleE","\\textcolor{##543b78}{#1}"),ge("\\mintA","\\textcolor{##f5f9e8}{#1}"),ge("\\mintB","\\textcolor{##edf2df}{#1}"),ge("\\mintC","\\textcolor{##e0e5cc}{#1}"),ge("\\grayA","\\textcolor{##f6f7f7}{#1}"),ge("\\grayB","\\textcolor{##f0f1f2}{#1}"),ge("\\grayC","\\textcolor{##e3e5e6}{#1}"),ge("\\grayD","\\textcolor{##d6d8da}{#1}"),ge("\\grayE","\\textcolor{##babec2}{#1}"),ge("\\grayF","\\textcolor{##888d93}{#1}"),ge("\\grayG","\\textcolor{##626569}{#1}"),ge("\\grayH","\\textcolor{##3b3e40}{#1}"),ge("\\grayI","\\textcolor{##21242c}{#1}"),ge("\\kaBlue","\\textcolor{##314453}{#1}"),ge("\\kaGreen","\\textcolor{##71B307}{#1}");var $X={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class kLe{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new TLe(wLe,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new IX(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new Vs("EOF",n.loc)),this.pushTokens(i),new Vs("",xs.range(r,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,o=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new Dt("Extra }",a)}else if(a.text==="EOF")throw new Dt("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[o]==="{")&&a.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(s!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new Dt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Dt("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new Dt("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var o=a.length-1;o>=0;--o){var l=a[o];if(l.text==="#"){if(o===0)throw new Dt("Incomplete placeholder at end of macro body",l);if(l=a[--o],l.text==="#")a.splice(o+1,1);else if(/^[1-9]$/.test(l.text))a.splice(o,2,...s[+l.text-1]);else throw new Dt("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Vs(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var s=i.replace(/##/g,"");s.includes("#"+(a+1));)++a;for(var o=new IX(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:a};return h}return i}isDefined(e){return this.macros.has(e)||Vu.hasOwnProperty(e)||Wn.math.hasOwnProperty(e)||Wn.text.hasOwnProperty(e)||$X.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:Vu.hasOwnProperty(e)&&!Vu[e].primitive}}var PX=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,FC=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),r8={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},BX={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let FX=class H2e{constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new kLe(e,r,this.mode),this.settings=r,this.leftrightDepth=0,this.nextToken=null}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new Dt("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new Vs("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(H2e.endOfExpression.has(i.text)||r&&i.text===r||e&&Vu[i.text]&&Vu[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=128)this.settings.strict&&(sY(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:xs.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;h0){if(++e>=fIe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function dp(t){return function(){return t}}var qC=(function(){try{var t=Cd(Object,"defineProperty");return t({},"",{}),t}catch{}})(),yIe=qC?function(t,e){return qC(t,"toString",{configurable:!0,enumerable:!1,value:dp(e),writable:!0})}:Td,nK=mIe(yIe);function iK(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var wIe=9007199254740991,CIe=/^(?:0|[1-9]\d*)$/;function VC(t,e){var r=typeof t;return e=e??wIe,!!e&&(r=="number"||r!="symbol"&&CIe.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=SIe}function Wu(t){return t!=null&&o8(t.length)&&!mb(t)}function vb(t,e,r){if(!Ws(r))return!1;var n=typeof e;return(n=="number"?Wu(r)&&VC(e,r.length):n=="string"&&e in r)?fp(r[e],t):!1}function AIe(t){return HC(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&vb(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function $9e(t,e){var r=this.__data__,n=jC(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Dc(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&GMe?new kb:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&vb(e[0],e[1],i)&&(n=1);++r-1?i[a?e[s]:s]:void 0}}var LNe=Math.max;function INe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:YLe(r);return i<0&&(i=LNe(n+i,0)),aK(t,Uu(e),i)}var A8=RNe(INe);function ij(t,e){var r=-1,n=Wu(t)?Array(t.length):[];return r5(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function _i(t,e){var r=Ai(t)?hp:ij;return r(t,Uu(e))}function DNe(t,e){return t==null?t:w8(t,S8(e),kd)}function MNe(t,e){return t&&C8(t,S8(e))}function NNe(t,e){return t>e}var ONe=Object.prototype,$Ne=ONe.hasOwnProperty;function PNe(t,e){return t!=null&&$Ne.call(t,e)}function aj(t,e){return t!=null&&JK(t,e,PNe)}function BNe(t,e){return hp(e,function(r){return t[r]})}function Oc(t){return t==null?[]:BNe(t,Us(t))}var FNe="[object Map]",zNe="[object Set]",GNe=Object.prototype,qNe=GNe.hasOwnProperty;function sj(t){if(t==null)return!0;if(Wu(t)&&(Ai(t)||typeof t=="string"||typeof t.splice=="function"||gp(t)||KC(t)||pp(t)))return!t.length;var e=uo(t);if(e==FNe||e==zNe)return!t.size;if(YC(t))return!yK(t).length;for(var r in t)if(qNe.call(t,r))return!1;return!0}function fi(t){return t===void 0}function oj(t,e){return te||a&&s&&l&&!o&&!u||n&&s&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&t=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function XNe(t,e,r){e.length?e=hp(e,function(a){return Ai(a)?function(s){return JC(s,a.length===1?a[0]:a)}:a}):e=[Td];var n=-1;e=hp(e,XC(Uu));var i=ij(t,function(a,s,o){var l=hp(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return UNe(i,function(a,s){return YNe(a,s,r)})}function KNe(t,e){return WNe(t,e,function(r,n){return ej(t,n)})}var a5=Z9e(function(t,e){return t==null?{}:KNe(t,e)}),jNe=Math.ceil,ZNe=Math.max;function QNe(t,e,r,n){for(var i=-1,a=ZNe(jNe((e-t)/(r||1)),0),s=Array(a);a--;)s[++i]=t,t+=r;return s}function JNe(t){return function(e,r,n){return n&&typeof n!="number"&&vb(e,r,n)&&(r=n=void 0),e=GC(e),r===void 0?(r=e,e=0):r=GC(r),n=n===void 0?e1&&vb(t,e[0],e[1])?e=[]:r>2&&vb(e[0],e[1],e[2])&&(e=[e[0]]),XNe(t,d8(e),[])}),tOe=1/0,rOe=vp&&1/b8(new vp([,-0]))[1]==tOe?function(t){return new vp(t)}:dIe,nOe=200;function iOe(t,e,r){var n=-1,i=TIe,a=t.length,s=!0,o=[],l=o;if(a>=nOe){var u=rOe(t);if(u)return b8(u);s=!1,i=UK,l=new kb}else l=o;e:for(;++n1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Ad,this._children[e]={},this._children[Ad][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],gt(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),gt(Us(this._in[e]),r),delete this._in[e],delete this._preds[e],gt(Us(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(fi(r))r=Ad;else{r+="";for(var n=r;!fi(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==Ad)return r}}children(e){if(fi(e)&&(e=Ad),this._isCompound){var r=this._children[e];if(r)return Us(r)}else{if(e===Ad)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Us(r)}successors(e){var r=this._sucs[e];if(r)return Us(r)}neighbors(e){var r=this.predecessors(e);if(r)return aOe(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;gt(this._nodes,function(s,o){e(o)&&r.setNode(o,s)}),gt(this._edgeObjs,function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,n.edge(s))});var i={};function a(s){var o=n.parent(s);return o===void 0||r.hasNode(o)?(i[s]=o,o):o in i?i[o]:a(o)}return this._isCompound&>(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return mb(e)||(e=dp(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Oc(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return Sb(e,function(a,s){return i.length>1?n.setEdge(a,s,r):n.setEdge(a,s),s}),this}setEdge(){var e,r,n,i,a=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,r=s.w,n=s.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=s,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,fi(n)||(n=""+n);var o=_b(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!fi(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=uOe(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,cj(this._preds[r],e),cj(this._sucs[e],r),this._in[r][o]=l,this._out[e][o]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?D8(this._isDirected,arguments[0]):_b(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?D8(this._isDirected,arguments[0]):_b(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?D8(this._isDirected,arguments[0]):_b(this._isDirected,e,r,n),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],uj(this._preds[r],e),uj(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=Oc(n);return r?Nc(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=Oc(n);return r?Nc(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}Ts.prototype._nodeCount=0,Ts.prototype._edgeCount=0;function cj(t,e){t[e]?t[e]++:t[e]=1}function uj(t,e){--t[e]||delete t[e]}function _b(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+lj+a+lj+(fi(n)?cOe:n)}function uOe(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function D8(t,e){return _b(t,e.v,e.w,e.name)}class hOe{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return hj(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&hj(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,dOe)),n=n._prev;return"["+e.join(", ")+"]"}}function hj(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function dOe(t,e){if(t!=="_next"&&t!=="_prev")return e}var fOe=dp(1);function pOe(t,e){if(t.nodeCount()<=1)return[];var r=mOe(t,e||fOe),n=gOe(r.graph,r.buckets,r.zeroIdx);return yp(_i(n,function(i){return t.outEdges(i.v,i.w)}))}function gOe(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)M8(t,e,r,s);for(;s=i.dequeue();)M8(t,e,r,s);if(t.nodeCount()){for(var o=e.length-2;o>0;--o)if(s=e[o].dequeue(),s){n=n.concat(M8(t,e,r,s,!0));break}}}return n}function M8(t,e,r,n,i){var a=i?[]:void 0;return gt(t.inEdges(n.v),function(s){var o=t.edge(s),l=t.node(s.v);i&&a.push({v:s.v,w:s.w}),l.out-=o,N8(e,r,l)}),gt(t.outEdges(n.v),function(s){var o=t.edge(s),l=s.w,u=t.node(l);u.in-=o,N8(e,r,u)}),t.removeNode(n.v),a}function mOe(t,e){var r=new Ts,n=0,i=0;gt(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),gt(t.edges(),function(o){var l=r.edge(o.v,o.w)||0,u=e(o),h=l+u;r.setEdge(o.v,o.w,h),i=Math.max(i,r.node(o.v).out+=u),n=Math.max(n,r.node(o.w).in+=u)});var a=bp(i+n+3).map(function(){return new hOe}),s=n+1;return gt(r.nodes(),function(o){N8(a,s,r.node(o))}),{graph:r,buckets:a,zeroIdx:s}}function N8(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function yOe(t){var e=t.graph().acyclicer==="greedy"?pOe(t,r(t)):vOe(t);gt(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,I8("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function vOe(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,gt(t.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return gt(t.nodes(),i),e}function bOe(t){gt(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function xp(t,e,r,n){var i;do i=I8(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function xOe(t){var e=new Ts().setGraph(t.graph());return gt(t.nodes(),function(r){e.setNode(r,t.node(r))}),gt(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function dj(t){var e=new Ts({multigraph:t.isMultigraph()}).setGraph(t.graph());return gt(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),gt(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function fj(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,u=o):(i<0&&(s=-s),l=s,u=s*a/i),{x:r+l,y:n+u}}function s5(t){var e=_i(bp(gj(t)+1),function(){return[]});return gt(t.nodes(),function(r){var n=t.node(r),i=n.rank;fi(i)||(e[i][n.order]=r)}),e}function TOe(t){var e=Eb(_i(t.nodes(),function(r){return t.node(r).rank}));gt(t.nodes(),function(r){var n=t.node(r);aj(n,"rank")&&(n.rank-=e)})}function wOe(t){var e=Eb(_i(t.nodes(),function(a){return t.node(a).rank})),r=[];gt(t.nodes(),function(a){var s=t.node(a).rank-e;r[s]||(r[s]=[]),r[s].push(a)});var n=0,i=t.graph().nodeRankFactor;gt(r,function(a,s){fi(a)&&s%i!==0?--n:n&>(a,function(o){t.node(o).rank+=n})})}function pj(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),xp(t,"border",i,e)}function gj(t){return Sd(_i(t.nodes(),function(e){var r=t.node(e).rank;if(!fi(r))return r}))}function COe(t,e){var r={lhs:[],rhs:[]};return gt(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function kOe(t,e){return e()}function EOe(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&>(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;as.lim&&(o=s,l=!0);var u=Nc(e.edges(),function(h){return l===Aj(t,t.node(h.v),o)&&l!==Aj(t,t.node(h.w),o)});return L8(u,function(h){return Rb(e,h)})}function Sj(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),F8(t),B8(t,e),zOe(t,e)}function zOe(t,e){var r=A8(t.nodes(),function(i){return!e.node(i).parent}),n=BOe(t,r);n=n.slice(1),gt(n,function(i){var a=t.node(i).parent,s=e.edge(i,a),o=!1;s||(s=e.edge(a,i),o=!0),e.node(i).rank=e.node(a).rank+(o?s.minlen:-s.minlen)})}function GOe(t,e,r){return t.hasEdge(e,r)}function Aj(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function qOe(t){switch(t.graph().ranker){case"network-simplex":_j(t);break;case"tight-tree":WOe(t);break;case"longest-path":VOe(t);break;default:_j(t)}}var VOe=P8;function WOe(t){P8(t),bj(t)}function _j(t){_d(t)}function UOe(t){var e=xp(t,"root",{},"_root"),r=HOe(t),n=Sd(Oc(r))-1,i=2*n+1;t.graph().nestingRoot=e,gt(t.edges(),function(s){t.edge(s).minlen*=i});var a=YOe(t)+1;gt(t.children(),function(s){Rj(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function Rj(t,e,r,n,i,a,s){var o=t.children(s);if(!o.length){s!==e&&t.setEdge(e,s,{weight:0,minlen:r});return}var l=pj(t,"_bt"),u=pj(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(u,s),h.borderBottom=u,gt(o,function(d){Rj(t,e,r,n,i,a,d);var f=t.node(d),p=f.borderTop?f.borderTop:d,g=f.borderBottom?f.borderBottom:d,m=f.borderTop?n:2*n,y=p!==g?1:i-a[s]+1;t.setEdge(l,p,{weight:m,minlen:y,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:y,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}function HOe(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&>(a,function(s){r(s,i+1)}),e[n]=i}return gt(t.children(),function(n){r(n,1)}),e}function YOe(t){return Sb(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function XOe(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,gt(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function KOe(t,e,r){var n={},i;gt(r,function(a){for(var s=t.parent(a),o,l;s;){if(o=t.parent(s),o?(l=n[o],n[o]=s):(l=i,i=s),l&&l!==s){e.setEdge(l,s);return}s=o}})}function jOe(t,e,r){var n=ZOe(t),i=new Ts({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return gt(t.nodes(),function(a){var s=t.node(a),o=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,o||n),gt(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=fi(h)?0:h.weight;i.setEdge(u,a,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),i}function ZOe(t){for(var e;t.hasNode(e=I8("_root")););return e}function QOe(t,e){for(var r=0,n=1;n0;)h%2&&(d+=o[h+1]),h=h-1>>1,o[h]+=u.weight;l+=u.weight*d})),l}function e$e(t){var e={},r=Nc(t.nodes(),function(o){return!t.children(o).length}),n=Sd(_i(r,function(o){return t.node(o).rank})),i=_i(bp(n+1),function(){return[]});function a(o){if(!aj(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),gt(t.successors(o),a)}}var s=Ab(r,function(o){return t.node(o).rank});return gt(s,a),i}function t$e(t,e){return _i(e,function(r){var n=t.inEdges(r);if(n.length){var i=Sb(n,function(a,s){var o=t.edge(s),l=t.node(s.v);return{sum:a.sum+o.weight*l.order,weight:a.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function r$e(t,e){var r={};gt(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};fi(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),gt(e.edges(),function(i){var a=r[i.v],s=r[i.w];!fi(a)&&!fi(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=Nc(r,function(i){return!i.indegree});return n$e(n)}function n$e(t){var e=[];function r(a){return function(s){s.merged||(fi(s.barycenter)||fi(a.barycenter)||s.barycenter>=a.barycenter)&&i$e(a,s)}}function n(a){return function(s){s.in.push(a),--s.indegree===0&&t.push(s)}}for(;t.length;){var i=t.pop();e.push(i),gt(i.in.reverse(),r(i)),gt(i.out,n(i))}return _i(Nc(e,function(a){return!a.merged}),function(a){return a5(a,["vs","i","barycenter","weight"])})}function i$e(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function a$e(t,e){var r=COe(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=Ab(r.rhs,function(h){return-h.i}),a=[],s=0,o=0,l=0;n.sort(s$e(!!e)),l=Lj(a,i,l),gt(n,function(h){l+=h.vs.length,a.push(h.vs),s+=h.barycenter*h.weight,o+=h.weight,l=Lj(a,i,l)});var u={vs:yp(a)};return o&&(u.barycenter=s/o,u.weight=o),u}function Lj(t,e,r){for(var n;e.length&&(n=n5(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function s$e(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function Ij(t,e,r,n){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=Nc(i,function(g){return g!==s&&g!==o}));var u=t$e(t,i);gt(u,function(g){if(t.children(g.v).length){var m=Ij(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&l$e(g,m)}});var h=r$e(u,r);o$e(h,l);var d=a$e(h,n);if(s&&(d.vs=yp([s,d.vs,o]),t.predecessors(s).length)){var f=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function o$e(t,e){gt(t,function(r){r.vs=yp(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function l$e(t,e){fi(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function c$e(t){var e=gj(t),r=Dj(t,bp(1,e+1),"inEdges"),n=Dj(t,bp(e-1,-1,-1),"outEdges"),i=e$e(t);Mj(t,i);for(var a=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){u$e(o%2?r:n,o%4>=2),i=s5(t);var u=QOe(t,i);us||o>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function f$e(t){var e={},r=0;function n(i){var a=r;gt(t.children(i),n),e[i]={low:a,lim:r++}}return gt(t.children(),n),e}function p$e(t,e){var r={};function n(i,a){var s=0,o=0,l=i.length,u=n5(a);return gt(a,function(h,d){var f=m$e(t,h),p=f?t.node(f).order:l;(f||h===u)&&(gt(a.slice(o,d+1),function(g){gt(t.predecessors(g),function(m){var y=t.node(m),v=y.order;(vu)&&Nj(r,f,h)})})}function i(a,s){var o=-1,l,u=0;return gt(s,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(s,u,d,o,l),u=d,o=l)}n(s,u,s.length,l,a.length)}),s}return Sb(e,i),r}function m$e(t,e){if(t.node(e).dummy)return A8(t.predecessors(e),function(r){return t.node(r).dummy})}function Nj(t,e,r){if(e>r){var n=e;e=r,r=n}Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=t[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function y$e(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function v$e(t,e,r,n){var i={},a={},s={};return gt(e,function(o){gt(o,function(l,u){i[l]=l,a[l]=l,s[l]=u})}),gt(e,function(o){var l=-1;gt(o,function(u){var h=n(u);if(h.length){h=Ab(h,function(m){return s[m]});for(var d=(h.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var g=h[f];a[u]===u&&l{var n=r(" buildLayoutGraph",()=>F$e(t));r(" runLayout",()=>R$e(n,r)),r(" updateInputGraph",()=>L$e(t,n))})}function R$e(t,e){e(" makeSpaceForEdgeLabels",()=>z$e(t)),e(" removeSelfEdges",()=>K$e(t)),e(" acyclic",()=>yOe(t)),e(" nestingGraph.run",()=>UOe(t)),e(" rank",()=>qOe(dj(t))),e(" injectEdgeLabelProxies",()=>G$e(t)),e(" removeEmptyRanks",()=>wOe(t)),e(" nestingGraph.cleanup",()=>XOe(t)),e(" normalizeRanks",()=>TOe(t)),e(" assignRankMinMax",()=>q$e(t)),e(" removeEdgeLabelProxies",()=>V$e(t)),e(" normalize.run",()=>LOe(t)),e(" parentDummyChains",()=>h$e(t)),e(" addBorderSegments",()=>EOe(t)),e(" order",()=>c$e(t)),e(" insertSelfEdges",()=>j$e(t)),e(" adjustCoordinateSystem",()=>SOe(t)),e(" position",()=>A$e(t)),e(" positionSelfEdges",()=>Z$e(t)),e(" removeBorderNodes",()=>X$e(t)),e(" normalize.undo",()=>DOe(t)),e(" fixupEdgeLabelCoords",()=>H$e(t)),e(" undoCoordinateSystem",()=>AOe(t)),e(" translateGraph",()=>W$e(t)),e(" assignNodeIntersects",()=>U$e(t)),e(" reversePoints",()=>Y$e(t)),e(" acyclic.undo",()=>bOe(t))}function L$e(t,e){gt(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),gt(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var I$e=["nodesep","edgesep","ranksep","marginx","marginy"],D$e={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},M$e=["acyclicer","ranker","rankdir","align"],N$e=["width","height"],O$e={width:0,height:0},$$e=["minlen","weight","width","height","labeloffset"],P$e={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},B$e=["labelpos"];function F$e(t){var e=new Ts({multigraph:!0,compound:!0}),r=G8(t.graph());return e.setGraph(R8({},D$e,z8(r,I$e),a5(r,M$e))),gt(t.nodes(),function(n){var i=G8(t.node(n));e.setNode(n,ENe(z8(i,N$e),O$e)),e.setParent(n,t.parent(n))}),gt(t.edges(),function(n){var i=G8(t.edge(n));e.setEdge(n,R8({},P$e,z8(i,$$e),a5(i,B$e)))}),e}function z$e(t){var e=t.graph();e.ranksep/=2,gt(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function G$e(t){gt(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e};xp(t,"edge-proxy",a,"_ep")}})}function q$e(t){var e=0;gt(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=Sd(e,n.maxRank))}),t.graph().maxRank=e}function V$e(t){gt(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function W$e(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=a.marginx||0,o=a.marginy||0;function l(u){var h=u.x,d=u.y,f=u.width,p=u.height;e=Math.min(e,h-f/2),r=Math.max(r,h+f/2),n=Math.min(n,d-p/2),i=Math.max(i,d+p/2)}gt(t.nodes(),function(u){l(t.node(u))}),gt(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=s,n-=o,gt(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),gt(t.edges(),function(u){var h=t.edge(u);gt(h.points,function(d){d.x-=e,d.y-=n}),Object.prototype.hasOwnProperty.call(h,"x")&&(h.x-=e),Object.prototype.hasOwnProperty.call(h,"y")&&(h.y-=n)}),a.width=r-e+s,a.height=i-n+o}function U$e(t){gt(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=i,s=n),r.points.unshift(fj(n,a)),r.points.push(fj(i,s))})}function H$e(t){gt(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Y$e(t){gt(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function X$e(t){gt(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(n5(r.borderLeft)),s=t.node(n5(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),gt(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function K$e(t){gt(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function j$e(t){var e=s5(t);gt(e,function(r){var n=0;gt(r,function(i,a){var s=t.node(i);s.order=a+n,gt(s.selfEdges,function(o){xp(t,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:a+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function Z$e(t){gt(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function z8(t,e){return i5(a5(t,e),Number)}function G8(t){var e={};return gt(t,function(r,n){e[n.toLowerCase()]=r}),e}function _l(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Q$e(t),edges:J$e(t)};return fi(t.graph())||(e.value=DMe(t.graph())),e}function Q$e(t){return _i(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return fi(r)||(i.value=r),fi(n)||(i.parent=n),i})}function J$e(t){return _i(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return fi(e.name)||(n.name=e.name),fi(r)||(n.value=r),n})}var Pr=new Map,Rd=new Map,$j=new Map,ePe=x(()=>{Rd.clear(),$j.clear(),Pr.clear()},"clear"),o5=x((t,e)=>{const r=Rd.get(e)||[];return ae.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),tPe=x((t,e)=>{const r=Rd.get(e)||[];return ae.info("Descendants of ",e," is ",r),ae.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||o5(t.v,e)||o5(t.w,e)||r.includes(t.w):(ae.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),Pj=x((t,e,r,n)=>{ae.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),ae.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)Pj(a,e,r,n);else{const s=e.node(a);ae.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(ae.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(ae.debug("Setting parent",a,t),r.setParent(a,t)):(ae.info("In copy ",t,"root",n,"data",e.node(t),n),ae.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const o=e.edges(a);ae.debug("Copying Edges",o),o.forEach(l=>{ae.info("Edge",l);const u=e.edge(l.v,l.w,l.name);ae.info("Edge data",u,n);try{tPe(l,n)?(ae.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),ae.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):ae.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){ae.error(h)}})}ae.debug("Removing node",a),e.removeNode(a)})},"copy"),Bj=x((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)$j.set(i,t),n=[...n,...Bj(i,e)];return n},"extractDescendants"),rPe=x((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),s=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>s.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),Lb=x((t,e,r)=>{const n=e.children(t);if(ae.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const s=Lb(a,e,r),o=rPe(e,r,s);if(s)if(o.length>0)i=s;else return s}return i},"findNonClusterChild"),Fj=x(t=>!Pr.has(t)||!Pr.get(t).externalConnections?t:Pr.has(t)?Pr.get(t).id:t,"getAnchorId"),nPe=x((t,e)=>{if(!t||e>10){ae.debug("Opting out, no graph ");return}else ae.debug("Opting in, graph ");t.nodes().forEach(function(r){t.children(r).length>0&&(ae.warn("Cluster identified",r," Replacement id in edges: ",Lb(r,t,r)),Rd.set(r,Bj(r,t)),Pr.set(r,{id:Lb(r,t,r),clusterData:t.node(r)}))}),t.nodes().forEach(function(r){const n=t.children(r),i=t.edges();n.length>0?(ae.debug("Cluster identified",r,Rd),i.forEach(a=>{const s=o5(a.v,r),o=o5(a.w,r);s^o&&(ae.warn("Edge: ",a," leaves cluster ",r),ae.warn("Descendants of XXX ",r,": ",Rd.get(r)),Pr.get(r).externalConnections=!0)})):ae.debug("Not a cluster ",r,Rd)});for(let r of Pr.keys()){const n=Pr.get(r).id,i=t.parent(n);i!==r&&Pr.has(i)&&!Pr.get(i).externalConnections&&(Pr.get(r).id=i)}t.edges().forEach(function(r){const n=t.edge(r);ae.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),ae.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(t.edge(r)));let i=r.v,a=r.w;if(ae.warn("Fix XXX",Pr,"ids:",r.v,r.w,"Translating: ",Pr.get(r.v)," --- ",Pr.get(r.w)),Pr.get(r.v)||Pr.get(r.w)){if(ae.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),i=Fj(r.v),a=Fj(r.w),t.removeEdge(r.v,r.w,r.name),i!==r.v){const s=t.parent(i);Pr.get(s).externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){const s=t.parent(a);Pr.get(s).externalConnections=!0,n.toCluster=r.w}ae.warn("Fix Replacing with XXX",i,a,r.name),t.setEdge(i,a,n,r.name)}}),ae.warn("Adjusted Graph",_l(t)),zj(t,0),ae.trace(Pr)},"adjustClustersAndEdges"),zj=x((t,e)=>{var i,a;if(ae.warn("extractor - ",e,_l(t),t.children("D")),e>10){ae.error("Bailing out");return}let r=t.nodes(),n=!1;for(const s of r){const o=t.children(s);n=n||o.length>0}if(!n){ae.debug("Done, no node has children",t.nodes());return}ae.debug("Nodes = ",r,e);for(const s of r)if(ae.debug("Extracting node",s,Pr,Pr.has(s)&&!Pr.get(s).externalConnections,!t.parent(s),t.node(s),t.children("D")," Depth ",e),!Pr.has(s))ae.debug("Not a cluster",s,e);else if(!Pr.get(s).externalConnections&&t.children(s)&&t.children(s).length>0){ae.warn("Cluster without external connections, without a parent and with children",s,e);let l=t.graph().rankdir==="TB"?"LR":"TB";(a=(i=Pr.get(s))==null?void 0:i.clusterData)!=null&&a.dir&&(l=Pr.get(s).clusterData.dir,ae.warn("Fixing dir",Pr.get(s).clusterData.dir,l));const u=new Ts({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});ae.warn("Old graph before copy",_l(t)),Pj(s,t,u,s),t.setNode(s,{clusterNode:!0,id:s,clusterData:Pr.get(s).clusterData,label:Pr.get(s).label,graph:u}),ae.warn("New graph after copy node: (",s,")",_l(u)),ae.debug("Old graph after copy",_l(t))}else ae.warn("Cluster ** ",s," **not meeting the criteria !externalConnections:",!Pr.get(s).externalConnections," no parent: ",!t.parent(s)," children ",t.children(s)&&t.children(s).length>0,t.children("D"),e),ae.debug(Pr);r=t.nodes(),ae.warn("New list of nodes",r);for(const s of r){const o=t.node(s);ae.warn(" Now next level",s,o),o!=null&&o.clusterNode&&zj(o.graph,e+1)}},"extractor"),Gj=x((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=Gj(t,i);r=[...r,...a]}),r},"sorter"),iPe=x(t=>Gj(t,t.children()),"sortNodesByHierarchy"),qj=x(async(t,e,r,n,i,a)=>{ae.warn("Graph in recursive render:XAX",_l(e),i);const s=e.graph().rankdir;ae.trace("Dir in recursive render - dir:",s);const o=t.insert("g").attr("class","root");e.nodes()?ae.info("Recursive render XXX",e.nodes()):ae.info("No nodes found for",e),e.edges().length>0&&ae.info("Recursive edges",e.edge(e.edges()[0]));const l=o.insert("g").attr("class","clusters"),u=o.insert("g").attr("class","edgePaths"),h=o.insert("g").attr("class","edgeLabels"),d=o.insert("g").attr("class","nodes");await Promise.all(e.nodes().map(async function(m){const y=e.node(m);if(i!==void 0){const v=JSON.parse(JSON.stringify(i.clusterData));ae.trace(`Setting data for parent cluster XXX +?)[ \r ]*`,i8="[̀-ͯ]",DLe=new RegExp(i8+"+$"),MLe="("+$X+"+)|"+(ILe+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(i8+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(i8+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+LLe)+("|"+RLe+")");let PX=class{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(MLe,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new Vs("EOF",new xs(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Dt("Unexpected character: '"+e[r]+"'",new Vs(e[r],new xs(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(` +`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new Vs(i,new xs(this,r,this.tokenRegex.lastIndex))}};class NLe{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Dt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var OLe=fX;ge("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}}),ge("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}}),ge("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}}),ge("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}}),ge("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}}),ge("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),ge("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var BX={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ge("\\char",function(t){var e=t.popToken(),r,n=0;if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new Dt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=BX[e.text],n==null||n>=r)throw new Dt("Invalid base-"+r+" digit "+e.text);for(var i;(i=BX[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Dt("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new Dt("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new Dt("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Dt("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};ge("\\newcommand",t=>a8(t,!1,!0,!1)),ge("\\renewcommand",t=>a8(t,!0,!1,!1)),ge("\\providecommand",t=>a8(t,!0,!0,!0)),ge("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""}),ge("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""}),ge("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),Vu[r],Wn.math[r],Wn.text[r]),""}),ge("\\bgroup","{"),ge("\\egroup","}"),ge("~","\\nobreakspace"),ge("\\lq","`"),ge("\\rq","'"),ge("\\aa","\\r a"),ge("\\AA","\\r A"),ge("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),ge("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),ge("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),ge("ℬ","\\mathscr{B}"),ge("ℰ","\\mathscr{E}"),ge("ℱ","\\mathscr{F}"),ge("ℋ","\\mathscr{H}"),ge("ℐ","\\mathscr{I}"),ge("ℒ","\\mathscr{L}"),ge("ℳ","\\mathscr{M}"),ge("ℛ","\\mathscr{R}"),ge("ℭ","\\mathfrak{C}"),ge("ℌ","\\mathfrak{H}"),ge("ℨ","\\mathfrak{Z}"),ge("\\Bbbk","\\Bbb{k}"),ge("\\llap","\\mathllap{\\textrm{#1}}"),ge("\\rlap","\\mathrlap{\\textrm{#1}}"),ge("\\clap","\\mathclap{\\textrm{#1}}"),ge("\\mathstrut","\\vphantom{(}"),ge("\\underbar","\\underline{\\text{#1}}"),ge("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),ge("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),ge("\\ne","\\neq"),ge("≠","\\neq"),ge("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),ge("∉","\\notin"),ge("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),ge("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),ge("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),ge("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),ge("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),ge("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),ge("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),ge("⟂","\\perp"),ge("‼","\\mathclose{!\\mkern-0.8mu!}"),ge("∌","\\notni"),ge("⌜","\\ulcorner"),ge("⌝","\\urcorner"),ge("⌞","\\llcorner"),ge("⌟","\\lrcorner"),ge("©","\\copyright"),ge("®","\\textregistered"),ge("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),ge("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),ge("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),ge("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),ge("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),ge("⋮","\\vdots"),ge("\\varGamma","\\mathit{\\Gamma}"),ge("\\varDelta","\\mathit{\\Delta}"),ge("\\varTheta","\\mathit{\\Theta}"),ge("\\varLambda","\\mathit{\\Lambda}"),ge("\\varXi","\\mathit{\\Xi}"),ge("\\varPi","\\mathit{\\Pi}"),ge("\\varSigma","\\mathit{\\Sigma}"),ge("\\varUpsilon","\\mathit{\\Upsilon}"),ge("\\varPhi","\\mathit{\\Phi}"),ge("\\varPsi","\\mathit{\\Psi}"),ge("\\varOmega","\\mathit{\\Omega}"),ge("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),ge("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),ge("\\boxed","\\fbox{$\\displaystyle{#1}$}"),ge("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),ge("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),ge("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),ge("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),ge("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var FX={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},$Le=new Set(["bin","rel"]);ge("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in FX?e=FX[r]:(r.slice(0,4)==="\\not"||r in Wn.math&&$Le.has(Wn.math[r].group))&&(e="\\dotsb"),e});var s8={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ge("\\dotso",function(t){var e=t.future().text;return e in s8?"\\ldots\\,":"\\ldots"}),ge("\\dotsc",function(t){var e=t.future().text;return e in s8&&e!==","?"\\ldots\\,":"\\ldots"}),ge("\\cdots",function(t){var e=t.future().text;return e in s8?"\\@cdots\\,":"\\@cdots"}),ge("\\dotsb","\\cdots"),ge("\\dotsm","\\cdots"),ge("\\dotsi","\\!\\cdots"),ge("\\dotsx","\\ldots\\,"),ge("\\DOTSI","\\relax"),ge("\\DOTSB","\\relax"),ge("\\DOTSX","\\relax"),ge("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),ge("\\,","\\tmspace+{3mu}{.1667em}"),ge("\\thinspace","\\,"),ge("\\>","\\mskip{4mu}"),ge("\\:","\\tmspace+{4mu}{.2222em}"),ge("\\medspace","\\:"),ge("\\;","\\tmspace+{5mu}{.2777em}"),ge("\\thickspace","\\;"),ge("\\!","\\tmspace-{3mu}{.1667em}"),ge("\\negthinspace","\\!"),ge("\\negmedspace","\\tmspace-{4mu}{.2222em}"),ge("\\negthickspace","\\tmspace-{5mu}{.277em}"),ge("\\enspace","\\kern.5em "),ge("\\enskip","\\hskip.5em\\relax"),ge("\\quad","\\hskip1em\\relax"),ge("\\qquad","\\hskip2em\\relax"),ge("\\tag","\\@ifstar\\tag@literal\\tag@paren"),ge("\\tag@paren","\\tag@literal{({#1})}"),ge("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Dt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),ge("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),ge("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),ge("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),ge("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),ge("\\newline","\\\\\\relax"),ge("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var zX=$t(wl["Main-Regular"][84][1]-.7*wl["Main-Regular"][65][1]);ge("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+zX+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),ge("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+zX+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),ge("\\hspace","\\@ifstar\\@hspacer\\@hspace"),ge("\\@hspace","\\hskip #1\\relax"),ge("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),ge("\\ordinarycolon",":"),ge("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),ge("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),ge("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),ge("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),ge("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),ge("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),ge("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),ge("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),ge("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),ge("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),ge("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),ge("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),ge("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),ge("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),ge("∷","\\dblcolon"),ge("∹","\\eqcolon"),ge("≔","\\coloneqq"),ge("≕","\\eqqcolon"),ge("⩴","\\Coloneqq"),ge("\\ratio","\\vcentcolon"),ge("\\coloncolon","\\dblcolon"),ge("\\colonequals","\\coloneqq"),ge("\\coloncolonequals","\\Coloneqq"),ge("\\equalscolon","\\eqqcolon"),ge("\\equalscoloncolon","\\Eqqcolon"),ge("\\colonminus","\\coloneq"),ge("\\coloncolonminus","\\Coloneq"),ge("\\minuscolon","\\eqcolon"),ge("\\minuscoloncolon","\\Eqcolon"),ge("\\coloncolonapprox","\\Colonapprox"),ge("\\coloncolonsim","\\Colonsim"),ge("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ge("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ge("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ge("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ge("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),ge("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),ge("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),ge("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),ge("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),ge("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),ge("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),ge("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),ge("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),ge("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),ge("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),ge("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),ge("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),ge("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),ge("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),ge("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),ge("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),ge("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),ge("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),ge("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),ge("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),ge("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),ge("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),ge("\\imath","\\html@mathml{\\@imath}{ı}"),ge("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),ge("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),ge("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),ge("⟦","\\llbracket"),ge("⟧","\\rrbracket"),ge("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),ge("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),ge("⦃","\\lBrace"),ge("⦄","\\rBrace"),ge("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),ge("⦵","\\minuso"),ge("\\darr","\\downarrow"),ge("\\dArr","\\Downarrow"),ge("\\Darr","\\Downarrow"),ge("\\lang","\\langle"),ge("\\rang","\\rangle"),ge("\\uarr","\\uparrow"),ge("\\uArr","\\Uparrow"),ge("\\Uarr","\\Uparrow"),ge("\\N","\\mathbb{N}"),ge("\\R","\\mathbb{R}"),ge("\\Z","\\mathbb{Z}"),ge("\\alef","\\aleph"),ge("\\alefsym","\\aleph"),ge("\\Alpha","\\mathrm{A}"),ge("\\Beta","\\mathrm{B}"),ge("\\bull","\\bullet"),ge("\\Chi","\\mathrm{X}"),ge("\\clubs","\\clubsuit"),ge("\\cnums","\\mathbb{C}"),ge("\\Complex","\\mathbb{C}"),ge("\\Dagger","\\ddagger"),ge("\\diamonds","\\diamondsuit"),ge("\\empty","\\emptyset"),ge("\\Epsilon","\\mathrm{E}"),ge("\\Eta","\\mathrm{H}"),ge("\\exist","\\exists"),ge("\\harr","\\leftrightarrow"),ge("\\hArr","\\Leftrightarrow"),ge("\\Harr","\\Leftrightarrow"),ge("\\hearts","\\heartsuit"),ge("\\image","\\Im"),ge("\\infin","\\infty"),ge("\\Iota","\\mathrm{I}"),ge("\\isin","\\in"),ge("\\Kappa","\\mathrm{K}"),ge("\\larr","\\leftarrow"),ge("\\lArr","\\Leftarrow"),ge("\\Larr","\\Leftarrow"),ge("\\lrarr","\\leftrightarrow"),ge("\\lrArr","\\Leftrightarrow"),ge("\\Lrarr","\\Leftrightarrow"),ge("\\Mu","\\mathrm{M}"),ge("\\natnums","\\mathbb{N}"),ge("\\Nu","\\mathrm{N}"),ge("\\Omicron","\\mathrm{O}"),ge("\\plusmn","\\pm"),ge("\\rarr","\\rightarrow"),ge("\\rArr","\\Rightarrow"),ge("\\Rarr","\\Rightarrow"),ge("\\real","\\Re"),ge("\\reals","\\mathbb{R}"),ge("\\Reals","\\mathbb{R}"),ge("\\Rho","\\mathrm{P}"),ge("\\sdot","\\cdot"),ge("\\sect","\\S"),ge("\\spades","\\spadesuit"),ge("\\sub","\\subset"),ge("\\sube","\\subseteq"),ge("\\supe","\\supseteq"),ge("\\Tau","\\mathrm{T}"),ge("\\thetasym","\\vartheta"),ge("\\weierp","\\wp"),ge("\\Zeta","\\mathrm{Z}"),ge("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),ge("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),ge("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),ge("\\bra","\\mathinner{\\langle{#1}|}"),ge("\\ket","\\mathinner{|{#1}\\rangle}"),ge("\\braket","\\mathinner{\\langle{#1}\\rangle}"),ge("\\Bra","\\left\\langle#1\\right|"),ge("\\Ket","\\left|#1\\right\\rangle");var GX=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",s),i.length&&f.macros.set("\\|",o));var p=d;if(!d&&i.length){var g=f.future();g.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,h=e.expandTokens([...a,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};ge("\\bra@ket",GX(!1)),ge("\\bra@set",GX(!0)),ge("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),ge("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),ge("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),ge("\\angln","{\\angl n}"),ge("\\blue","\\textcolor{##6495ed}{#1}"),ge("\\orange","\\textcolor{##ffa500}{#1}"),ge("\\pink","\\textcolor{##ff00af}{#1}"),ge("\\red","\\textcolor{##df0030}{#1}"),ge("\\green","\\textcolor{##28ae7b}{#1}"),ge("\\gray","\\textcolor{gray}{#1}"),ge("\\purple","\\textcolor{##9d38bd}{#1}"),ge("\\blueA","\\textcolor{##ccfaff}{#1}"),ge("\\blueB","\\textcolor{##80f6ff}{#1}"),ge("\\blueC","\\textcolor{##63d9ea}{#1}"),ge("\\blueD","\\textcolor{##11accd}{#1}"),ge("\\blueE","\\textcolor{##0c7f99}{#1}"),ge("\\tealA","\\textcolor{##94fff5}{#1}"),ge("\\tealB","\\textcolor{##26edd5}{#1}"),ge("\\tealC","\\textcolor{##01d1c1}{#1}"),ge("\\tealD","\\textcolor{##01a995}{#1}"),ge("\\tealE","\\textcolor{##208170}{#1}"),ge("\\greenA","\\textcolor{##b6ffb0}{#1}"),ge("\\greenB","\\textcolor{##8af281}{#1}"),ge("\\greenC","\\textcolor{##74cf70}{#1}"),ge("\\greenD","\\textcolor{##1fab54}{#1}"),ge("\\greenE","\\textcolor{##0d923f}{#1}"),ge("\\goldA","\\textcolor{##ffd0a9}{#1}"),ge("\\goldB","\\textcolor{##ffbb71}{#1}"),ge("\\goldC","\\textcolor{##ff9c39}{#1}"),ge("\\goldD","\\textcolor{##e07d10}{#1}"),ge("\\goldE","\\textcolor{##a75a05}{#1}"),ge("\\redA","\\textcolor{##fca9a9}{#1}"),ge("\\redB","\\textcolor{##ff8482}{#1}"),ge("\\redC","\\textcolor{##f9685d}{#1}"),ge("\\redD","\\textcolor{##e84d39}{#1}"),ge("\\redE","\\textcolor{##bc2612}{#1}"),ge("\\maroonA","\\textcolor{##ffbde0}{#1}"),ge("\\maroonB","\\textcolor{##ff92c6}{#1}"),ge("\\maroonC","\\textcolor{##ed5fa6}{#1}"),ge("\\maroonD","\\textcolor{##ca337c}{#1}"),ge("\\maroonE","\\textcolor{##9e034e}{#1}"),ge("\\purpleA","\\textcolor{##ddd7ff}{#1}"),ge("\\purpleB","\\textcolor{##c6b9fc}{#1}"),ge("\\purpleC","\\textcolor{##aa87ff}{#1}"),ge("\\purpleD","\\textcolor{##7854ab}{#1}"),ge("\\purpleE","\\textcolor{##543b78}{#1}"),ge("\\mintA","\\textcolor{##f5f9e8}{#1}"),ge("\\mintB","\\textcolor{##edf2df}{#1}"),ge("\\mintC","\\textcolor{##e0e5cc}{#1}"),ge("\\grayA","\\textcolor{##f6f7f7}{#1}"),ge("\\grayB","\\textcolor{##f0f1f2}{#1}"),ge("\\grayC","\\textcolor{##e3e5e6}{#1}"),ge("\\grayD","\\textcolor{##d6d8da}{#1}"),ge("\\grayE","\\textcolor{##babec2}{#1}"),ge("\\grayF","\\textcolor{##888d93}{#1}"),ge("\\grayG","\\textcolor{##626569}{#1}"),ge("\\grayH","\\textcolor{##3b3e40}{#1}"),ge("\\grayI","\\textcolor{##21242c}{#1}"),ge("\\kaBlue","\\textcolor{##314453}{#1}"),ge("\\kaGreen","\\textcolor{##71B307}{#1}");var qX={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class PLe{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new NLe(OLe,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new PX(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new Vs("EOF",n.loc)),this.pushTokens(i),new Vs("",xs.range(r,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,o=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new Dt("Extra }",a)}else if(a.text==="EOF")throw new Dt("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[o]==="{")&&a.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(s!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new Dt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Dt("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new Dt("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var o=a.length-1;o>=0;--o){var l=a[o];if(l.text==="#"){if(o===0)throw new Dt("Incomplete placeholder at end of macro body",l);if(l=a[--o],l.text==="#")a.splice(o+1,1);else if(/^[1-9]$/.test(l.text))a.splice(o,2,...s[+l.text-1]);else throw new Dt("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Vs(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var s=i.replace(/##/g,"");s.includes("#"+(a+1));)++a;for(var o=new PX(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:a};return h}return i}isDefined(e){return this.macros.has(e)||Vu.hasOwnProperty(e)||Wn.math.hasOwnProperty(e)||Wn.text.hasOwnProperty(e)||qX.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:Vu.hasOwnProperty(e)&&!Vu[e].primitive}}var VX=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,qC=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),o8={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},WX={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let UX=class Q2e{constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new PLe(e,r,this.mode),this.settings=r,this.leftrightDepth=0,this.nextToken=null}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new Dt("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new Vs("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(Q2e.endOfExpression.has(i.text)||r&&i.text===r||e&&Vu[i.text]&&Vu[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=128)this.settings.strict&&(dY(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:xs.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;h0){if(++e>=SIe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function f0(t){return function(){return t}}var UC=(function(){try{var t=Cd(Object,"defineProperty");return t({},"",{}),t}catch{}})(),LIe=UC?function(t,e){return UC(t,"toString",{configurable:!0,enumerable:!1,value:f0(e),writable:!0})}:Td,cK=RIe(LIe);function uK(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var OIe=9007199254740991,$Ie=/^(?:0|[1-9]\d*)$/;function HC(t,e){var r=typeof t;return e=e??OIe,!!e&&(r=="number"||r!="symbol"&&$Ie.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=FIe}function Wu(t){return t!=null&&d8(t.length)&&!vb(t)}function xb(t,e,r){if(!Ws(r))return!1;var n=typeof e;return(n=="number"?Wu(r)&&HC(e,r.length):n=="string"&&e in r)?p0(r[e],t):!1}function zIe(t){return KC(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&xb(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function K9e(t,e){var r=this.__data__,n=JC(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Dc(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&eNe?new Sb:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&xb(e[0],e[1],i)&&(n=1);++r-1?i[a?e[s]:s]:void 0}}var VNe=Math.max;function WNe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:sIe(r);return i<0&&(i=VNe(n+i,0)),hK(t,Uu(e),i)}var D8=qNe(WNe);function uj(t,e){var r=-1,n=Wu(t)?Array(t.length):[];return a5(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function _i(t,e){var r=Ai(t)?d0:uj;return r(t,Uu(e))}function UNe(t,e){return t==null?t:A8(t,I8(e),kd)}function HNe(t,e){return t&&_8(t,I8(e))}function YNe(t,e){return t>e}var XNe=Object.prototype,KNe=XNe.hasOwnProperty;function jNe(t,e){return t!=null&&KNe.call(t,e)}function hj(t,e){return t!=null&&aj(t,e,jNe)}function ZNe(t,e){return d0(e,function(r){return t[r]})}function Oc(t){return t==null?[]:ZNe(t,Us(t))}var QNe="[object Map]",JNe="[object Set]",eOe=Object.prototype,tOe=eOe.hasOwnProperty;function dj(t){if(t==null)return!0;if(Wu(t)&&(Ai(t)||typeof t=="string"||typeof t.splice=="function"||m0(t)||QC(t)||g0(t)))return!t.length;var e=uo(t);if(e==QNe||e==JNe)return!t.size;if(jC(t))return!CK(t).length;for(var r in t)if(tOe.call(t,r))return!1;return!0}function fi(t){return t===void 0}function fj(t,e){return te||a&&s&&l&&!o&&!u||n&&s&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&t=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function oOe(t,e,r){e.length?e=d0(e,function(a){return Ai(a)?function(s){return r5(s,a.length===1?a[0]:a)}:a}):e=[Td];var n=-1;e=d0(e,ZC(Uu));var i=uj(t,function(a,s,o){var l=d0(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return iOe(i,function(a,s){return sOe(a,s,r)})}function lOe(t,e){return nOe(t,e,function(r,n){return sj(t,n)})}var l5=uDe(function(t,e){return t==null?{}:lOe(t,e)}),cOe=Math.ceil,uOe=Math.max;function hOe(t,e,r,n){for(var i=-1,a=uOe(cOe((e-t)/(r||1)),0),s=Array(a);a--;)s[++i]=t,t+=r;return s}function dOe(t){return function(e,r,n){return n&&typeof n!="number"&&xb(e,r,n)&&(r=n=void 0),e=WC(e),r===void 0?(r=e,e=0):r=WC(r),n=n===void 0?e1&&xb(t,e[0],e[1])?e=[]:r>2&&xb(e[0],e[1],e[2])&&(e=[e[0]]),oOe(t,y8(e),[])}),pOe=1/0,gOe=b0&&1/k8(new b0([,-0]))[1]==pOe?function(t){return new b0(t)}:EIe,mOe=200;function yOe(t,e,r){var n=-1,i=NIe,a=t.length,s=!0,o=[],l=o;if(a>=mOe){var u=gOe(t);if(u)return k8(u);s=!1,i=ZK,l=new Sb}else l=o;e:for(;++n1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Ad,this._children[e]={},this._children[Ad][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],gt(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),gt(Us(this._in[e]),r),delete this._in[e],delete this._preds[e],gt(Us(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(fi(r))r=Ad;else{r+="";for(var n=r;!fi(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==Ad)return r}}children(e){if(fi(e)&&(e=Ad),this._isCompound){var r=this._children[e];if(r)return Us(r)}else{if(e===Ad)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Us(r)}successors(e){var r=this._sucs[e];if(r)return Us(r)}neighbors(e){var r=this.predecessors(e);if(r)return vOe(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;gt(this._nodes,function(s,o){e(o)&&r.setNode(o,s)}),gt(this._edgeObjs,function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,n.edge(s))});var i={};function a(s){var o=n.parent(s);return o===void 0||r.hasNode(o)?(i[s]=o,o):o in i?i[o]:a(o)}return this._isCompound&>(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return vb(e)||(e=f0(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Oc(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return _b(e,function(a,s){return i.length>1?n.setEdge(a,s,r):n.setEdge(a,s),s}),this}setEdge(){var e,r,n,i,a=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,r=s.w,n=s.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=s,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,fi(n)||(n=""+n);var o=Lb(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!fi(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=COe(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,gj(this._preds[r],e),gj(this._sucs[e],r),this._in[r][o]=l,this._out[e][o]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?P8(this._isDirected,arguments[0]):Lb(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?P8(this._isDirected,arguments[0]):Lb(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?P8(this._isDirected,arguments[0]):Lb(this._isDirected,e,r,n),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],mj(this._preds[r],e),mj(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=Oc(n);return r?Nc(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=Oc(n);return r?Nc(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}Ts.prototype._nodeCount=0,Ts.prototype._edgeCount=0;function gj(t,e){t[e]?t[e]++:t[e]=1}function mj(t,e){--t[e]||delete t[e]}function Lb(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+pj+a+pj+(fi(n)?wOe:n)}function COe(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function P8(t,e){return Lb(t,e.v,e.w,e.name)}class kOe{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return yj(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&yj(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,EOe)),n=n._prev;return"["+e.join(", ")+"]"}}function yj(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function EOe(t,e){if(t!=="_next"&&t!=="_prev")return e}var SOe=f0(1);function AOe(t,e){if(t.nodeCount()<=1)return[];var r=ROe(t,e||SOe),n=_Oe(r.graph,r.buckets,r.zeroIdx);return v0(_i(n,function(i){return t.outEdges(i.v,i.w)}))}function _Oe(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)B8(t,e,r,s);for(;s=i.dequeue();)B8(t,e,r,s);if(t.nodeCount()){for(var o=e.length-2;o>0;--o)if(s=e[o].dequeue(),s){n=n.concat(B8(t,e,r,s,!0));break}}}return n}function B8(t,e,r,n,i){var a=i?[]:void 0;return gt(t.inEdges(n.v),function(s){var o=t.edge(s),l=t.node(s.v);i&&a.push({v:s.v,w:s.w}),l.out-=o,F8(e,r,l)}),gt(t.outEdges(n.v),function(s){var o=t.edge(s),l=s.w,u=t.node(l);u.in-=o,F8(e,r,u)}),t.removeNode(n.v),a}function ROe(t,e){var r=new Ts,n=0,i=0;gt(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),gt(t.edges(),function(o){var l=r.edge(o.v,o.w)||0,u=e(o),h=l+u;r.setEdge(o.v,o.w,h),i=Math.max(i,r.node(o.v).out+=u),n=Math.max(n,r.node(o.w).in+=u)});var a=x0(i+n+3).map(function(){return new kOe}),s=n+1;return gt(r.nodes(),function(o){F8(a,s,r.node(o))}),{graph:r,buckets:a,zeroIdx:s}}function F8(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function LOe(t){var e=t.graph().acyclicer==="greedy"?AOe(t,r(t)):IOe(t);gt(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,$8("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function IOe(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,gt(t.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return gt(t.nodes(),i),e}function DOe(t){gt(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function T0(t,e,r,n){var i;do i=$8(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function MOe(t){var e=new Ts().setGraph(t.graph());return gt(t.nodes(),function(r){e.setNode(r,t.node(r))}),gt(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function vj(t){var e=new Ts({multigraph:t.isMultigraph()}).setGraph(t.graph());return gt(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),gt(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function bj(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,u=o):(i<0&&(s=-s),l=s,u=s*a/i),{x:r+l,y:n+u}}function c5(t){var e=_i(x0(Tj(t)+1),function(){return[]});return gt(t.nodes(),function(r){var n=t.node(r),i=n.rank;fi(i)||(e[i][n.order]=r)}),e}function NOe(t){var e=Ab(_i(t.nodes(),function(r){return t.node(r).rank}));gt(t.nodes(),function(r){var n=t.node(r);hj(n,"rank")&&(n.rank-=e)})}function OOe(t){var e=Ab(_i(t.nodes(),function(a){return t.node(a).rank})),r=[];gt(t.nodes(),function(a){var s=t.node(a).rank-e;r[s]||(r[s]=[]),r[s].push(a)});var n=0,i=t.graph().nodeRankFactor;gt(r,function(a,s){fi(a)&&s%i!==0?--n:n&>(a,function(o){t.node(o).rank+=n})})}function xj(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),T0(t,"border",i,e)}function Tj(t){return Sd(_i(t.nodes(),function(e){var r=t.node(e).rank;if(!fi(r))return r}))}function $Oe(t,e){var r={lhs:[],rhs:[]};return gt(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function POe(t,e){return e()}function BOe(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&>(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;as.lim&&(o=s,l=!0);var u=Nc(e.edges(),function(h){return l===Mj(t,t.node(h.v),o)&&l!==Mj(t,t.node(h.w),o)});return O8(u,function(h){return Ib(e,h)})}function Dj(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),W8(t),V8(t,e),JOe(t,e)}function JOe(t,e){var r=D8(t.nodes(),function(i){return!e.node(i).parent}),n=ZOe(t,r);n=n.slice(1),gt(n,function(i){var a=t.node(i).parent,s=e.edge(i,a),o=!1;s||(s=e.edge(a,i),o=!0),e.node(i).rank=e.node(a).rank+(o?s.minlen:-s.minlen)})}function e$e(t,e,r){return t.hasEdge(e,r)}function Mj(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function t$e(t){switch(t.graph().ranker){case"network-simplex":Nj(t);break;case"tight-tree":n$e(t);break;case"longest-path":r$e(t);break;default:Nj(t)}}var r$e=q8;function n$e(t){q8(t),Ej(t)}function Nj(t){_d(t)}function i$e(t){var e=T0(t,"root",{},"_root"),r=a$e(t),n=Sd(Oc(r))-1,i=2*n+1;t.graph().nestingRoot=e,gt(t.edges(),function(s){t.edge(s).minlen*=i});var a=s$e(t)+1;gt(t.children(),function(s){Oj(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function Oj(t,e,r,n,i,a,s){var o=t.children(s);if(!o.length){s!==e&&t.setEdge(e,s,{weight:0,minlen:r});return}var l=xj(t,"_bt"),u=xj(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(u,s),h.borderBottom=u,gt(o,function(d){Oj(t,e,r,n,i,a,d);var f=t.node(d),p=f.borderTop?f.borderTop:d,g=f.borderBottom?f.borderBottom:d,m=f.borderTop?n:2*n,y=p!==g?1:i-a[s]+1;t.setEdge(l,p,{weight:m,minlen:y,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:y,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}function a$e(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&>(a,function(s){r(s,i+1)}),e[n]=i}return gt(t.children(),function(n){r(n,1)}),e}function s$e(t){return _b(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function o$e(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,gt(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function l$e(t,e,r){var n={},i;gt(r,function(a){for(var s=t.parent(a),o,l;s;){if(o=t.parent(s),o?(l=n[o],n[o]=s):(l=i,i=s),l&&l!==s){e.setEdge(l,s);return}s=o}})}function c$e(t,e,r){var n=u$e(t),i=new Ts({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return gt(t.nodes(),function(a){var s=t.node(a),o=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,o||n),gt(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=fi(h)?0:h.weight;i.setEdge(u,a,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),i}function u$e(t){for(var e;t.hasNode(e=$8("_root")););return e}function h$e(t,e){for(var r=0,n=1;n0;)h%2&&(d+=o[h+1]),h=h-1>>1,o[h]+=u.weight;l+=u.weight*d})),l}function f$e(t){var e={},r=Nc(t.nodes(),function(o){return!t.children(o).length}),n=Sd(_i(r,function(o){return t.node(o).rank})),i=_i(x0(n+1),function(){return[]});function a(o){if(!hj(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),gt(t.successors(o),a)}}var s=Rb(r,function(o){return t.node(o).rank});return gt(s,a),i}function p$e(t,e){return _i(e,function(r){var n=t.inEdges(r);if(n.length){var i=_b(n,function(a,s){var o=t.edge(s),l=t.node(s.v);return{sum:a.sum+o.weight*l.order,weight:a.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function g$e(t,e){var r={};gt(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};fi(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),gt(e.edges(),function(i){var a=r[i.v],s=r[i.w];!fi(a)&&!fi(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=Nc(r,function(i){return!i.indegree});return m$e(n)}function m$e(t){var e=[];function r(a){return function(s){s.merged||(fi(s.barycenter)||fi(a.barycenter)||s.barycenter>=a.barycenter)&&y$e(a,s)}}function n(a){return function(s){s.in.push(a),--s.indegree===0&&t.push(s)}}for(;t.length;){var i=t.pop();e.push(i),gt(i.in.reverse(),r(i)),gt(i.out,n(i))}return _i(Nc(e,function(a){return!a.merged}),function(a){return l5(a,["vs","i","barycenter","weight"])})}function y$e(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function v$e(t,e){var r=$Oe(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=Rb(r.rhs,function(h){return-h.i}),a=[],s=0,o=0,l=0;n.sort(b$e(!!e)),l=$j(a,i,l),gt(n,function(h){l+=h.vs.length,a.push(h.vs),s+=h.barycenter*h.weight,o+=h.weight,l=$j(a,i,l)});var u={vs:v0(a)};return o&&(u.barycenter=s/o,u.weight=o),u}function $j(t,e,r){for(var n;e.length&&(n=s5(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function b$e(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function Pj(t,e,r,n){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=Nc(i,function(g){return g!==s&&g!==o}));var u=p$e(t,i);gt(u,function(g){if(t.children(g.v).length){var m=Pj(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&T$e(g,m)}});var h=g$e(u,r);x$e(h,l);var d=v$e(h,n);if(s&&(d.vs=v0([s,d.vs,o]),t.predecessors(s).length)){var f=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function x$e(t,e){gt(t,function(r){r.vs=v0(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function T$e(t,e){fi(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function w$e(t){var e=Tj(t),r=Bj(t,x0(1,e+1),"inEdges"),n=Bj(t,x0(e-1,-1,-1),"outEdges"),i=f$e(t);Fj(t,i);for(var a=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){C$e(o%2?r:n,o%4>=2),i=c5(t);var u=h$e(t,i);us||o>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function S$e(t){var e={},r=0;function n(i){var a=r;gt(t.children(i),n),e[i]={low:a,lim:r++}}return gt(t.children(),n),e}function A$e(t,e){var r={};function n(i,a){var s=0,o=0,l=i.length,u=s5(a);return gt(a,function(h,d){var f=R$e(t,h),p=f?t.node(f).order:l;(f||h===u)&&(gt(a.slice(o,d+1),function(g){gt(t.predecessors(g),function(m){var y=t.node(m),v=y.order;(vu)&&zj(r,f,h)})})}function i(a,s){var o=-1,l,u=0;return gt(s,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(s,u,d,o,l),u=d,o=l)}n(s,u,s.length,l,a.length)}),s}return _b(e,i),r}function R$e(t,e){if(t.node(e).dummy)return D8(t.predecessors(e),function(r){return t.node(r).dummy})}function zj(t,e,r){if(e>r){var n=e;e=r,r=n}Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=t[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function L$e(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function I$e(t,e,r,n){var i={},a={},s={};return gt(e,function(o){gt(o,function(l,u){i[l]=l,a[l]=l,s[l]=u})}),gt(e,function(o){var l=-1;gt(o,function(u){var h=n(u);if(h.length){h=Rb(h,function(m){return s[m]});for(var d=(h.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var g=h[f];a[u]===u&&l{var n=r(" buildLayoutGraph",()=>Q$e(t));r(" runLayout",()=>q$e(n,r)),r(" updateInputGraph",()=>V$e(t,n))})}function q$e(t,e){e(" makeSpaceForEdgeLabels",()=>J$e(t)),e(" removeSelfEdges",()=>lPe(t)),e(" acyclic",()=>LOe(t)),e(" nestingGraph.run",()=>i$e(t)),e(" rank",()=>t$e(vj(t))),e(" injectEdgeLabelProxies",()=>ePe(t)),e(" removeEmptyRanks",()=>OOe(t)),e(" nestingGraph.cleanup",()=>o$e(t)),e(" normalizeRanks",()=>NOe(t)),e(" assignRankMinMax",()=>tPe(t)),e(" removeEdgeLabelProxies",()=>rPe(t)),e(" normalize.run",()=>VOe(t)),e(" parentDummyChains",()=>k$e(t)),e(" addBorderSegments",()=>BOe(t)),e(" order",()=>w$e(t)),e(" insertSelfEdges",()=>cPe(t)),e(" adjustCoordinateSystem",()=>FOe(t)),e(" position",()=>z$e(t)),e(" positionSelfEdges",()=>uPe(t)),e(" removeBorderNodes",()=>oPe(t)),e(" normalize.undo",()=>UOe(t)),e(" fixupEdgeLabelCoords",()=>aPe(t)),e(" undoCoordinateSystem",()=>zOe(t)),e(" translateGraph",()=>nPe(t)),e(" assignNodeIntersects",()=>iPe(t)),e(" reversePoints",()=>sPe(t)),e(" acyclic.undo",()=>DOe(t))}function V$e(t,e){gt(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),gt(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var W$e=["nodesep","edgesep","ranksep","marginx","marginy"],U$e={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},H$e=["acyclicer","ranker","rankdir","align"],Y$e=["width","height"],X$e={width:0,height:0},K$e=["minlen","weight","width","height","labeloffset"],j$e={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Z$e=["labelpos"];function Q$e(t){var e=new Ts({multigraph:!0,compound:!0}),r=H8(t.graph());return e.setGraph(N8({},U$e,U8(r,W$e),l5(r,H$e))),gt(t.nodes(),function(n){var i=H8(t.node(n));e.setNode(n,BNe(U8(i,Y$e),X$e)),e.setParent(n,t.parent(n))}),gt(t.edges(),function(n){var i=H8(t.edge(n));e.setEdge(n,N8({},j$e,U8(i,K$e),l5(i,Z$e)))}),e}function J$e(t){var e=t.graph();e.ranksep/=2,gt(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function ePe(t){gt(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e};T0(t,"edge-proxy",a,"_ep")}})}function tPe(t){var e=0;gt(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=Sd(e,n.maxRank))}),t.graph().maxRank=e}function rPe(t){gt(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function nPe(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=a.marginx||0,o=a.marginy||0;function l(u){var h=u.x,d=u.y,f=u.width,p=u.height;e=Math.min(e,h-f/2),r=Math.max(r,h+f/2),n=Math.min(n,d-p/2),i=Math.max(i,d+p/2)}gt(t.nodes(),function(u){l(t.node(u))}),gt(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=s,n-=o,gt(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),gt(t.edges(),function(u){var h=t.edge(u);gt(h.points,function(d){d.x-=e,d.y-=n}),Object.prototype.hasOwnProperty.call(h,"x")&&(h.x-=e),Object.prototype.hasOwnProperty.call(h,"y")&&(h.y-=n)}),a.width=r-e+s,a.height=i-n+o}function iPe(t){gt(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=i,s=n),r.points.unshift(bj(n,a)),r.points.push(bj(i,s))})}function aPe(t){gt(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function sPe(t){gt(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function oPe(t){gt(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(s5(r.borderLeft)),s=t.node(s5(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),gt(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function lPe(t){gt(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function cPe(t){var e=c5(t);gt(e,function(r){var n=0;gt(r,function(i,a){var s=t.node(i);s.order=a+n,gt(s.selfEdges,function(o){T0(t,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:a+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function uPe(t){gt(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function U8(t,e){return o5(l5(t,e),Number)}function H8(t){var e={};return gt(t,function(r,n){e[n.toLowerCase()]=r}),e}function _l(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:hPe(t),edges:dPe(t)};return fi(t.graph())||(e.value=UMe(t.graph())),e}function hPe(t){return _i(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return fi(r)||(i.value=r),fi(n)||(i.parent=n),i})}function dPe(t){return _i(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return fi(e.name)||(n.name=e.name),fi(r)||(n.value=r),n})}var Pr=new Map,Rd=new Map,qj=new Map,fPe=T(()=>{Rd.clear(),qj.clear(),Pr.clear()},"clear"),u5=T((t,e)=>{const r=Rd.get(e)||[];return ae.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),pPe=T((t,e)=>{const r=Rd.get(e)||[];return ae.info("Descendants of ",e," is ",r),ae.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||u5(t.v,e)||u5(t.w,e)||r.includes(t.w):(ae.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),Vj=T((t,e,r,n)=>{ae.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),ae.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)Vj(a,e,r,n);else{const s=e.node(a);ae.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(ae.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(ae.debug("Setting parent",a,t),r.setParent(a,t)):(ae.info("In copy ",t,"root",n,"data",e.node(t),n),ae.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const o=e.edges(a);ae.debug("Copying Edges",o),o.forEach(l=>{ae.info("Edge",l);const u=e.edge(l.v,l.w,l.name);ae.info("Edge data",u,n);try{pPe(l,n)?(ae.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),ae.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):ae.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){ae.error(h)}})}ae.debug("Removing node",a),e.removeNode(a)})},"copy"),Wj=T((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)qj.set(i,t),n=[...n,...Wj(i,e)];return n},"extractDescendants"),gPe=T((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),s=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>s.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),Db=T((t,e,r)=>{const n=e.children(t);if(ae.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const s=Db(a,e,r),o=gPe(e,r,s);if(s)if(o.length>0)i=s;else return s}return i},"findNonClusterChild"),Uj=T(t=>!Pr.has(t)||!Pr.get(t).externalConnections?t:Pr.has(t)?Pr.get(t).id:t,"getAnchorId"),mPe=T((t,e)=>{if(!t||e>10){ae.debug("Opting out, no graph ");return}else ae.debug("Opting in, graph ");t.nodes().forEach(function(r){t.children(r).length>0&&(ae.warn("Cluster identified",r," Replacement id in edges: ",Db(r,t,r)),Rd.set(r,Wj(r,t)),Pr.set(r,{id:Db(r,t,r),clusterData:t.node(r)}))}),t.nodes().forEach(function(r){const n=t.children(r),i=t.edges();n.length>0?(ae.debug("Cluster identified",r,Rd),i.forEach(a=>{const s=u5(a.v,r),o=u5(a.w,r);s^o&&(ae.warn("Edge: ",a," leaves cluster ",r),ae.warn("Descendants of XXX ",r,": ",Rd.get(r)),Pr.get(r).externalConnections=!0)})):ae.debug("Not a cluster ",r,Rd)});for(let r of Pr.keys()){const n=Pr.get(r).id,i=t.parent(n);i!==r&&Pr.has(i)&&!Pr.get(i).externalConnections&&(Pr.get(r).id=i)}t.edges().forEach(function(r){const n=t.edge(r);ae.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),ae.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(t.edge(r)));let i=r.v,a=r.w;if(ae.warn("Fix XXX",Pr,"ids:",r.v,r.w,"Translating: ",Pr.get(r.v)," --- ",Pr.get(r.w)),Pr.get(r.v)||Pr.get(r.w)){if(ae.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),i=Uj(r.v),a=Uj(r.w),t.removeEdge(r.v,r.w,r.name),i!==r.v){const s=t.parent(i);Pr.get(s).externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){const s=t.parent(a);Pr.get(s).externalConnections=!0,n.toCluster=r.w}ae.warn("Fix Replacing with XXX",i,a,r.name),t.setEdge(i,a,n,r.name)}}),ae.warn("Adjusted Graph",_l(t)),Hj(t,0),ae.trace(Pr)},"adjustClustersAndEdges"),Hj=T((t,e)=>{var i,a;if(ae.warn("extractor - ",e,_l(t),t.children("D")),e>10){ae.error("Bailing out");return}let r=t.nodes(),n=!1;for(const s of r){const o=t.children(s);n=n||o.length>0}if(!n){ae.debug("Done, no node has children",t.nodes());return}ae.debug("Nodes = ",r,e);for(const s of r)if(ae.debug("Extracting node",s,Pr,Pr.has(s)&&!Pr.get(s).externalConnections,!t.parent(s),t.node(s),t.children("D")," Depth ",e),!Pr.has(s))ae.debug("Not a cluster",s,e);else if(!Pr.get(s).externalConnections&&t.children(s)&&t.children(s).length>0){ae.warn("Cluster without external connections, without a parent and with children",s,e);let l=t.graph().rankdir==="TB"?"LR":"TB";(a=(i=Pr.get(s))==null?void 0:i.clusterData)!=null&&a.dir&&(l=Pr.get(s).clusterData.dir,ae.warn("Fixing dir",Pr.get(s).clusterData.dir,l));const u=new Ts({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});ae.warn("Old graph before copy",_l(t)),Vj(s,t,u,s),t.setNode(s,{clusterNode:!0,id:s,clusterData:Pr.get(s).clusterData,label:Pr.get(s).label,graph:u}),ae.warn("New graph after copy node: (",s,")",_l(u)),ae.debug("Old graph after copy",_l(t))}else ae.warn("Cluster ** ",s," **not meeting the criteria !externalConnections:",!Pr.get(s).externalConnections," no parent: ",!t.parent(s)," children ",t.children(s)&&t.children(s).length>0,t.children("D"),e),ae.debug(Pr);r=t.nodes(),ae.warn("New list of nodes",r);for(const s of r){const o=t.node(s);ae.warn(" Now next level",s,o),o!=null&&o.clusterNode&&Hj(o.graph,e+1)}},"extractor"),Yj=T((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=Yj(t,i);r=[...r,...a]}),r},"sorter"),yPe=T(t=>Yj(t,t.children()),"sortNodesByHierarchy"),Xj=T(async(t,e,r,n,i,a)=>{ae.warn("Graph in recursive render:XAX",_l(e),i);const s=e.graph().rankdir;ae.trace("Dir in recursive render - dir:",s);const o=t.insert("g").attr("class","root");e.nodes()?ae.info("Recursive render XXX",e.nodes()):ae.info("No nodes found for",e),e.edges().length>0&&ae.info("Recursive edges",e.edge(e.edges()[0]));const l=o.insert("g").attr("class","clusters"),u=o.insert("g").attr("class","edgePaths"),h=o.insert("g").attr("class","edgeLabels"),d=o.insert("g").attr("class","nodes");await Promise.all(e.nodes().map(async function(m){const y=e.node(m);if(i!==void 0){const v=JSON.parse(JSON.stringify(i.clusterData));ae.trace(`Setting data for parent cluster XXX Node.id = `,m,` data=`,v.height,` -Parent cluster`,i.height),e.setNode(i.id,v),e.parent(m)||(ae.trace("Setting parent",m,i.id),e.setParent(m,i.id,v))}if(ae.info("(Insert) Node XXX"+m+": "+JSON.stringify(e.node(m))),y!=null&&y.clusterNode){ae.info("Cluster identified XBX",m,y.width,e.node(m));const{ranksep:v,nodesep:T}=e.graph();y.graph.setGraph({...y.graph.graph(),ranksep:v+25,nodesep:T});const b=await qj(d,y.graph,r,n,e.node(m),a),w=b.elem;rr(y,w),y.diff=b.diff||0,ae.info("New compound node after recursive render XAX",m,"width",y.width,"height",y.height),D6e(w,y)}else e.children(m).length>0?(ae.trace("Cluster - the non recursive path XBX",m,y.id,y,y.width,"Graph:",e),ae.trace(Lb(y.id,e)),Pr.set(y.id,{id:Lb(y.id,e),node:y})):(ae.trace("Node - the non recursive path XAX",m,d,e.node(m),s),await nC(d,e.node(m),{config:a,dir:s}))})),await x(async()=>{const m=e.edges().map(async function(y){const v=e.edge(y.v,y.w,y.name);ae.info("Edge "+y.v+" -> "+y.w+": "+JSON.stringify(y)),ae.info("Edge "+y.v+" -> "+y.w+": ",y," ",JSON.stringify(e.edge(y))),ae.info("Fix",Pr,"ids:",y.v,y.w,"Translating: ",Pr.get(y.v),Pr.get(y.w)),await HU(h,v)});await Promise.all(m)},"processEdges")(),ae.info("Graph before layout:",JSON.stringify(_l(e))),ae.info("############################################# XXX"),ae.info("### Layout ### XXX"),ae.info("############################################# XXX"),Oj(e),ae.info("Graph after layout:",JSON.stringify(_l(e)));let p=0,{subGraphTitleTotalMargin:g}=H2(a);return await Promise.all(iPe(e).map(async function(m){var v;const y=e.node(m);if(ae.info("Position XBX => "+m+": ("+y.x,","+y.y,") width: ",y.width," height: ",y.height),y!=null&&y.clusterNode)y.y+=g,ae.info("A tainted cluster node XBX1",m,y.id,y.width,y.height,y.x,y.y,e.parent(m)),Pr.get(y.id).node=y,K_(y);else if(e.children(m).length>0){ae.info("A pure cluster node XBX1",m,y.id,y.x,y.y,y.width,y.height,e.parent(m)),y.height+=g,e.node(y.parentId);const T=(y==null?void 0:y.padding)/2||0,b=((v=y==null?void 0:y.labelBBox)==null?void 0:v.height)||0,w=b-T||0;ae.debug("OffsetY",w,"labelHeight",b,"halfPadding",T),await V_(l,y),Pr.get(y.id).node=y}else{const T=e.node(y.parentId);y.y+=g/2,ae.info("A regular node XBX1 - using the padding",y.id,"parent",y.parentId,y.width,y.height,y.x,y.y,"offsetY",y.offsetY,"parent",T,T==null?void 0:T.offsetY,y),K_(y)}})),e.edges().forEach(function(m){const y=e.edge(m);ae.info("Edge "+m.v+" -> "+m.w+": "+JSON.stringify(y),y),y.points.forEach(w=>w.y+=g/2);const v=e.node(m.v);var T=e.node(m.w);const b=ZU(u,y,Pr,r,v,T,n);YU(y,b)}),e.nodes().forEach(function(m){const y=e.node(m);ae.info(m,y.type,y.diff),y.isGroup&&(p=y.diff)}),ae.warn("Returning from recursive render XAX",o,p),{elem:o,diff:p}},"recursiveRender"),aPe=x(async(t,e)=>{var a,s,o,l,u,h;const r=new Ts({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((a=t.config)==null?void 0:a.nodeSpacing)||((o=(s=t.config)==null?void 0:s.flowchart)==null?void 0:o.nodeSpacing)||t.nodeSpacing,ranksep:((l=t.config)==null?void 0:l.rankSpacing)||((h=(u=t.config)==null?void 0:u.flowchart)==null?void 0:h.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");eH(n,t.markers,t.type,t.diagramId),M6e(),B6e(),d6e(),ePe(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),ae.debug("Edges:",t.edges),t.edges.forEach(d=>{if(d.start===d.end){const f=d.start,p=f+"---"+f+"---1",g=f+"---"+f+"---2",m=r.node(f);r.setNode(p,{domId:p,id:p,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(p,m.parentId),r.setNode(g,{domId:g,id:g,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(g,m.parentId);const y=structuredClone(d),v=structuredClone(d),T=structuredClone(d);y.label="",y.arrowTypeEnd="none",y.endLabelLeft="",y.endLabelRight="",y.startLabelLeft="",y.id=f+"-cyclic-special-1",v.startLabelRight="",v.startLabelLeft="",v.endLabelLeft="",v.endLabelRight="",v.arrowTypeStart="none",v.arrowTypeEnd="none",v.id=f+"-cyclic-special-mid",T.label="",T.startLabelRight="",T.startLabelLeft="",T.arrowTypeStart="none",m.isGroup&&(y.fromCluster=f,T.toCluster=f),T.id=f+"-cyclic-special-2",T.arrowTypeStart="none",r.setEdge(f,p,y,f+"-cyclic-special-0"),r.setEdge(p,g,v,f+"-cyclic-special-1"),r.setEdge(g,f,T,f+"-cyct.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw a}}}}function Vj(t,e,r){return(e=Wj(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uPe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function hPe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function dPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fPe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ri(t,e){return oPe(t)||hPe(t,e)||V8(t,e)||dPe()}function l5(t){return lPe(t)||uPe(t)||V8(t)||fPe()}function pPe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Wj(t){var e=pPe(t,"string");return typeof e=="symbol"?e:e+""}function Fi(t){"@babel/helpers - typeof";return Fi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fi(t)}function V8(t,e){if(t){if(typeof t=="string")return q8(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?q8(t,e):void 0}}var zi=typeof window>"u"?null:window,Uj=zi?zi.navigator:null;zi&&zi.document;var gPe=Fi(""),Hj=Fi({}),mPe=Fi(function(){}),yPe=typeof HTMLElement>"u"?"undefined":Fi(HTMLElement),Ib=function(e){return e&&e.instanceString&&jn(e.instanceString)?e.instanceString():null},hr=function(e){return e!=null&&Fi(e)==gPe},jn=function(e){return e!=null&&Fi(e)===mPe},wn=function(e){return!Hs(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Kr=function(e){return e!=null&&Fi(e)===Hj&&!wn(e)&&e.constructor===Object},vPe=function(e){return e!=null&&Fi(e)===Hj},Gt=function(e){return e!=null&&Fi(e)===Fi(1)&&!isNaN(e)},bPe=function(e){return Gt(e)&&Math.floor(e)===e},c5=function(e){if(yPe!=="undefined")return e!=null&&e instanceof HTMLElement},Hs=function(e){return Db(e)||Yj(e)},Db=function(e){return Ib(e)==="collection"&&e._private.single},Yj=function(e){return Ib(e)==="collection"&&!e._private.single},W8=function(e){return Ib(e)==="core"},Xj=function(e){return Ib(e)==="stylesheet"},xPe=function(e){return Ib(e)==="event"},Xu=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},TPe=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},wPe=function(e){return Kr(e)&&Gt(e.x1)&&Gt(e.x2)&&Gt(e.y1)&&Gt(e.y2)},CPe=function(e){return vPe(e)&&jn(e.then)},kPe=function(){return Uj&&Uj.userAgent.match(/msie|trident|edge/i)},Tp=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;sr?1:0},IPe=function(e,r){return-1*Zj(e,r)},yr=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(y-=1),y<1/6?g+(m-g)*6*y:y<1/2?m:y<2/3?g+(m-g)*(2/3-y)*6:g}var d=new RegExp("^"+APe+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,a=parseFloat(d[3]),a<0||a>100)||(a=a/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)o=l=u=Math.round(a*255);else{var f=a<.5?a*(1+i):a+i-a*i,p=2*a-f;o=Math.round(255*h(p,f,n+1/3)),l=Math.round(255*h(p,f,n)),u=Math.round(255*h(p,f,n-1/3))}r=[o,l,u,s]}return r},NPe=function(e){var r,n=new RegExp("^"+EPe+"$").exec(e);if(n){r=[];for(var i=[],a=1;a<=3;a++){var s=n[a];if(s[s.length-1]==="%"&&(i[a]=!0),s=parseFloat(s),i[a]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},OPe=function(e){return $Pe[e.toLowerCase()]},Qj=function(e){return(wn(e)?e:null)||OPe(e)||DPe(e)||NPe(e)||MPe(e)},$Pe={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Jj=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a=l||S<0||T&&R>=f}function _(){var F=e();if(C(F))return L(F);g=setTimeout(_,A(F))}function L(F){return g=void 0,b&&h?w(F):(h=d=void 0,p)}function O(){g!==void 0&&clearTimeout(g),y=0,h=m=d=g=void 0}function M(){return g===void 0?p:L(e())}function z(){var F=e(),S=C(F);if(h=arguments,d=this,m=F,S){if(g===void 0)return k(m);if(T)return clearTimeout(g),g=setTimeout(_,l),w(m)}return g===void 0&&(g=setTimeout(_,l)),p}return z.cancel=O,z.flush=M,z}return sR=s,sR}var HPe=UPe(),$b=Mb(HPe),oR=zi?zi.performance:null,mZ=oR&&oR.now?function(){return oR.now()}:function(){return Date.now()},YPe=(function(){if(zi){if(zi.requestAnimationFrame)return function(t){zi.requestAnimationFrame(t)};if(zi.mozRequestAnimationFrame)return function(t){zi.mozRequestAnimationFrame(t)};if(zi.webkitRequestAnimationFrame)return function(t){zi.webkitRequestAnimationFrame(t)};if(zi.msRequestAnimationFrame)return function(t){zi.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(mZ())},1e3/60)}})(),f5=function(e){return YPe(e)},$c=mZ,Ld=9261,yZ=65599,wp=5381,vZ=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ld,n=r,i;i=e.next(),!i.done;)n=n*yZ+i.value|0;return n},Pb=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ld;return r*yZ+e|0},Bb=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wp;return(r<<5)+r+e|0},XPe=function(e,r){return e*2097152+r},ju=function(e){return e[0]*2097152+e[1]},p5=function(e,r){return[Pb(e[0],r[0]),Bb(e[1],r[1])]},bZ=function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i=0;i--)e[i]===r&&e.splice(i,1)},uR=function(e){e.splice(0,e.length)},iBe=function(e,r){for(var n=0;n"u"?"undefined":Fi(Set))!==sBe?Set:oBe,m5=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!W8(e)){Hn("An element must have a core reference and parameters set");return}var i=r.group;if(i==null&&(r.data&&r.data.source!=null&&r.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){Hn("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?i==="edges":!!r.pannable,active:!1,classes:new Cp,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();a.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];wn(r.classes)?u=r.classes:hr(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hT?1:0},h=function(v,T,b,w,k){var A;if(b==null&&(b=0),k==null&&(k=n),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=v.length);bO;0<=O?L++:L--)_.push(L);return _}).apply(this).reverse(),C=[],w=0,k=A.length;wM;0<=M?++_:--_)z.push(s(v,b));return z},m=function(v,T,b,w){var k,A,C;for(w==null&&(w=n),k=v[b];b>T;){if(C=b-1>>1,A=v[C],w(k,A)<0){v[b]=A,b=C;continue}break}return v[b]=k},y=function(v,T,b){var w,k,A,C,_;for(b==null&&(b=n),k=v.length,_=T,A=v[T],w=2*T+1;w0;){var A=T.pop(),C=y(A),_=A.id();if(f[_]=C,C!==1/0)for(var L=A.neighborhood().intersect(g),O=0;O0)for(I.unshift(D);d[B];){var P=d[B];I.unshift(P.edge),I.unshift(P.node),$=P.node,B=$.id()}return o.spawn(I)}}}},pBe={kruskal:function(e){e=e||function(b){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,s=new Array(a),o=n,l=function(w){for(var k=0;k0;){if(k(),C++,w===h){for(var _=[],L=a,O=h,M=v[O];_.unshift(L),M!=null&&_.unshift(M),L=y[O],L!=null;)O=L.id(),M=v[O];return{found:!0,distance:d[w],path:this.spawn(_),steps:C}}p[w]=!0;for(var z=b._private.edges,F=0;FM&&(g[O]=M,T[O]=L,b[O]=k),!a){var z=L*h+_;!a&&g[z]>M&&(g[z]=M,T[z]=_,b[z]=k)}}}for(var F=0;F1&&arguments[1]!==void 0?arguments[1]:s,Ge=b(me),Te=[],Ze=Ge;;){if(Ze==null)return r.spawn();var ke=T(Ze),Ve=ke.edge,Qe=ke.pred;if(Te.unshift(Ze[0]),Ze.same(ve)&&Te.length>0)break;Ve!=null&&Te.unshift(Ve),Ze=Qe}return l.spawn(Te)},A=0;A=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===o&&r[p]===l||r[f]===l&&r[p]===o)&&u.splice(h,1)}for(var g=0;gi;){var a=Math.floor(Math.random()*r.length);r=wBe(a,e,r),n--}return r},CBe={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(I){return I.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/TBe);if(a<2){Hn("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],h=0;h1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,a=0,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}a&&e.sort(function(f,p){return f-p});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},RBe=function(e){return Math.PI*e/180},b5=function(e,r){return Math.atan2(r,e)-Math.PI/2},pR=Math.log2||function(t){return Math.log(t)/Math.log(2)},gR=function(e){return e>0?1:e<0?-1:0},Dd=function(e,r){return Math.sqrt(Md(e,r))},Md=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},LBe=function(e){for(var r=e.length,n=0,i=0;i=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},DBe=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},MBe=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},NBe=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},IZ=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},x5=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},T5=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,s;if(r.length===1)n=i=a=s=r[0];else if(r.length===2)n=a=r[0],s=i=r[1];else if(r.length===4){var o=Ri(r,4);n=o[0],i=o[1],a=o[2],s=o[3]}return e.x1-=s,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},DZ=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},mR=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},Qu=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},MZ=function(e,r){return Qu(e,r.x,r.y)},NZ=function(e,r){return Qu(e,r.x1,r.y1)&&Qu(e,r.x2,r.y2)},OBe=(fR=Math.hypot)!==null&&fR!==void 0?fR:function(t,e){return Math.sqrt(t*t+e*e)};function $Be(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(_,L){return{x:_.x+L.x,y:_.y+L.y}},n=function(_,L){return{x:_.x-L.x,y:_.y-L.y}},i=function(_,L){return{x:_.x*L,y:_.y*L}},a=function(_,L){return _.x*L.y-_.y*L.x},s=function(_){var L=OBe(_.x,_.y);return L===0?{x:0,y:0}:{x:_.x/L,y:_.y/L}},o=function(_){for(var L=0,O=0;O<_.length;O++){var M=_[O],z=_[(O+1)%_.length];L+=M.x*z.y-z.x*M.y}return L/2},l=function(_,L,O,M){var z=n(L,_),F=n(M,O),S=a(z,F);if(Math.abs(S)<1e-9)return r(_,i(z,.5));var R=a(n(O,_),F)/S;return r(_,i(z,R))},u=t.map(function(C){return{x:C.x,y:C.y}});o(u)<0&&u.reverse();for(var h=u.length,d=[],f=0;f7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?eh(a,s):l,h=a/2,d=s/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-o,y=i-d-o,v=n+h-u+o,T=y;if(g=Ju(e,r,n,i,m,y,v,T,!1),g.length>0)return g}if(p){var b=n+h+o,w=i-d+u-o,k=b,A=i+d-u+o;if(g=Ju(e,r,n,i,b,w,k,A,!1),g.length>0)return g}if(f){var C=n-h+u-o,_=i+d+o,L=n+h-u+o,O=_;if(g=Ju(e,r,n,i,C,_,L,O,!1),g.length>0)return g}if(p){var M=n-h-o,z=i-d+u-o,F=M,S=i+d-u+o;if(g=Ju(e,r,n,i,M,z,F,S,!1),g.length>0)return g}var R;{var N=n-h+u,D=i-d+u;if(R=qb(e,r,n,i,N,D,u+o),R.length>0&&R[0]<=N&&R[1]<=D)return[R[0],R[1]]}{var I=n+h-u,$=i-d+u;if(R=qb(e,r,n,i,I,$,u+o),R.length>0&&R[0]>=I&&R[1]<=$)return[R[0],R[1]]}{var B=n+h-u,P=i+d-u;if(R=qb(e,r,n,i,B,P,u+o),R.length>0&&R[0]>=B&&R[1]>=P)return[R[0],R[1]]}{var G=n-h+u,V=i+d-u;if(R=qb(e,r,n,i,G,V,u+o),R.length>0&&R[0]<=G&&R[1]>=V)return[R[0],R[1]]}return[]},BBe=function(e,r,n,i,a,s,o){var l=o,u=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,s),f=Math.max(i,s);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},FBe=function(e,r,n,i,a,s,o,l,u){var h={x1:Math.min(n,o,a)-u,x2:Math.max(n,o,a)+u,y1:Math.min(i,l,s)-u,y2:Math.max(i,l,s)+u};return!(eh.x2||rh.y2)},zBe=function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var s=Math.sqrt(a),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},GBe=function(e,r,n,i,a){var s=1e-5;e===0&&(e=s),r/=e,n/=e,i/=e;var o,l,u,h,d,f,p,g;if(l=(3*n-r*r)/9,u=-(27*i)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,a[1]=0,p=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),a[0]=-p+d+f,p+=(d+f)/2,a[4]=a[2]=-p,p=Math.sqrt(3)*(-f+d)/2,a[3]=p,a[5]=-p;return}if(a[5]=a[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),a[0]=-p+2*g,a[4]=a[2]=-(g+p);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),a[0]=-p+g*Math.cos(h/3),a[2]=-p+g*Math.cos((h+2*Math.PI)/3),a[4]=-p+g*Math.cos((h+4*Math.PI)/3)},qBe=function(e,r,n,i,a,s,o,l){var u=1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+i*i-4*i*s+2*i*l+4*s*s-4*s*l+l*l,h=9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*i*s-3*i*i-3*i*l-6*s*s+3*s*l,d=3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*i*i-6*i*s+i*l-i*r+2*s*s+2*s*r-l*r,f=1*n*a-n*n+n*e-a*e+i*s-i*i+i*r-s*r,p=[];GBe(u,h,d,f,p);for(var g=1e-7,m=[],y=0;y<6;y+=2)Math.abs(p[y+1])=0&&p[y]<=1&&m.push(p[y]);m.push(1),m.push(0);for(var v=-1,T,b,w,k=0;k=0?wu?(e-a)*(e-a)+(r-s)*(r-s):h-f},Cs=function(e,r,n){for(var i,a,s,o,l,u=0,h=0;h=e&&e>=s||i<=e&&e<=s)l=(e-i)/(s-i)*(o-a)+a,l>r&&u++;else continue;return u%2!==0},Bc=function(e,r,n,i,a,s,o,l,u){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),p=Math.sin(-d),g=0;g0){var y=C5(h,-u);m=w5(y)}else m=h;return Cs(e,r,m)},WBe=function(e,r,n,i,a,s,o,l){for(var u=new Array(n.length*2),h=0;h=0&&y<=1&&T.push(y),v>=0&&v<=1&&T.push(v),T.length===0)return[];var b=T[0]*l[0]+e,w=T[0]*l[1]+r;if(T.length>1){if(T[0]==T[1])return[b,w];var k=T[1]*l[0]+e,A=T[1]*l[1]+r;return[b,w,k,A]}else return[b,w]},yR=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Ju=function(e,r,n,i,a,s,o,l,u){var h=e-a,d=n-e,f=o-a,p=r-s,g=i-r,m=l-s,y=f*p-m*h,v=d*p-g*h,T=m*d-f*g;if(T!==0){var b=y/T,w=v/T,k=.001,A=0-k,C=1+k;return A<=b&&b<=C&&A<=w&&w<=C?[e+b*d,r+b*g]:u?[e+b*d,r+b*g]:[]}else return y===0||v===0?yR(e,n,o)===o?[o,l]:yR(e,n,a)===a?[a,s]:yR(a,o,n)===n?[n,i]:[]:[]},HBe=function(e,r,n,i,a){var s=[],o=i/2,l=a/2,u=r,h=n;s.push({x:u+o*e[0],y:h+l*e[1]});for(var d=1;d0){var m=C5(d,-l);p=w5(m)}else p=d}else p=n;for(var y,v,T,b,w=0;w2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),y=1;yh&&(h=w)},get:function(b){return u[b]}},f=0;f0?R=S.edgesTo(F)[0]:R=F.edgesTo(S)[0];var N=i(R);F=F.id(),C[F]>C[M]+N&&(C[F]=C[M]+N,_.nodes.indexOf(F)<0?_.push(F):_.updateItem(F),A[F]=0,k[F]=[]),C[F]==C[M]+N&&(A[F]=A[F]+A[M],k[F].push(M))}else for(var D=0;D0;){for(var P=w.pop(),G=0;G0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},oFe=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:uFe,o=i,l,u,h=0;h=2?Wb(e,r,n,0,WZ,hFe):Wb(e,r,n,0,VZ)},squaredEuclidean:function(e,r,n){return Wb(e,r,n,0,WZ)},manhattan:function(e,r,n){return Wb(e,r,n,0,VZ)},max:function(e,r,n){return Wb(e,r,n,-1/0,dFe)}};_p["squared-euclidean"]=_p.squaredEuclidean,_p.squaredeuclidean=_p.squaredEuclidean;function E5(t,e,r,n,i,a){var s;return jn(t)?s=t:s=_p[t]||_p.euclidean,e===0&&jn(t)?s(i,a):s(e,r,n,i,a)}var fFe=ha({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),CR=function(e){return fFe(e)},S5=function(e,r,n,i,a){var s=a!=="kMedoids",o=s?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return E5(e,i.length,o,l,u,h)},kR=function(e,r,n){for(var i=n.length,a=new Array(i),s=new Array(i),o=new Array(r),l=null,u=0;un)return!1}return!0},mFe=function(e,r,n){for(var i=0;io&&(o=r[u][h],l=h);a[l].push(e[u])}for(var d=0;d=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var g=r[s],m=r[i[s]],y;a.mode==="dendrogram"?y={left:g,right:m,key:g.key}:y={value:g.value.concat(m.value),key:g.key},e[g.index]=y,e.splice(m.index,1),r[g.key]=y;for(var v=0;vn[m.key][T.key]&&(l=n[m.key][T.key])):a.linkage==="max"?(l=n[g.key][T.key],n[g.key][T.key]0&&i.push(a);return i},QZ=function(e,r,n){for(var i=[],a=0;ao&&(s=u,o=r[a*e+u])}s>0&&i.push(s)}for(var h=0;hu&&(l=h,u=d)}n[a]=s[l]}return i=QZ(e,r,n),i},JZ=function(e){for(var r=this.cy(),n=this.nodes(),i=_Fe(e),a={},s=0;s=M?(z=M,M=S,F=R):S>z&&(z=S);for(var N=0;N0?1:0;C[L%i.minIterations*o+G]=V,P+=V}if(P>0&&(L>=i.minIterations-1||L==i.maxIterations-1)){for(var Y=0,W=0;W1||A>1)&&(o=!0),d[b]=[],T.outgoers().forEach(function(_){_.isEdge()&&d[b].push(_.id())})}else f[b]=[void 0,T.target().id()]}):s.forEach(function(T){var b=T.id();if(T.isNode()){var w=T.degree(!0);w%2&&(l?u?o=!0:u=b:l=b),d[b]=[],T.connectedEdges().forEach(function(k){return d[b].push(k.id())})}else f[b]=[T.source().id(),T.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(u&&l)if(a){if(h&&u!=h)return p;h=u}else{if(h&&u!=h&&l!=h)return p;h||(h=u)}else h||(h=s[0].id());var g=function(b){for(var w=b,k=[b],A,C,_;d[w].length;)A=d[w].shift(),C=f[A][0],_=f[A][1],w!=_?(d[_]=d[_].filter(function(L){return L!=A}),w=_):!a&&w!=C&&(d[C]=d[C].filter(function(L){return L!=A}),w=C),k.unshift(A),k.unshift(w);return k},m=[],y=[];for(y=g(h);y.length!=1;)d[y[0]].length==0?(m.unshift(s.getElementById(y.shift())),m.unshift(s.getElementById(y.shift()))):y=g(y.shift()).concat(y);m.unshift(s.getElementById(y.shift()));for(var v in d)if(d[v].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},A5=function(){var e=this,r={},n=0,i=0,a=[],s=[],o={},l=function(f,p){for(var g=s.length-1,m=[],y=e.spawn();s[g].x!=f||s[g].y!=p;)m.push(s.pop().edge),g--;m.push(s.pop().edge),m.forEach(function(v){var T=v.connectedNodes().intersection(e);y.merge(v),T.forEach(function(b){var w=b.id(),k=b.connectedEdges().intersection(e);y.merge(b),r[w].cutVertex?y.merge(k.filter(function(A){return A.isLoop()})):y.merge(k)})}),a.push(y)},u=function(f,p,g){f===g&&(i+=1),r[p]={id:n,low:n++,cutVertex:!1};var m=e.getElementById(p).connectedEdges().intersection(e);if(m.size()===0)a.push(e.spawn(e.getElementById(p)));else{var y,v,T,b;m.forEach(function(w){y=w.source().id(),v=w.target().id(),T=y===p?v:y,T!==g&&(b=w.id(),o[b]||(o[b]=!0,s.push({x:p,y:T,edge:w})),T in r?r[p].low=Math.min(r[p].low,r[T].id):(u(f,T,p),r[p].low=Math.min(r[p].low,r[T].low),r[p].id<=r[T].low&&(r[p].cutVertex=!0,l(p,T))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var h=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:a}},$Fe={hopcroftTarjanBiconnected:A5,htbc:A5,htb:A5,hopcroftTarjanBiconnectedComponents:A5},_5=function(){var e=this,r={},n=0,i=[],a=[],s=e.spawn(e),o=function(u){a.push(u),r[u]={index:n,low:n++,explored:!1};var h=e.getElementById(u).connectedEdges().intersection(e);if(h.forEach(function(m){var y=m.target().id();y!==u&&(y in r||o(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=a.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=d.edgesWith(d),g=d.merge(p);i.push(g),s=s.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:i}},PFe={tarjanStronglyConnected:_5,tsc:_5,tscc:_5,tarjanStronglyConnectedComponents:_5},eQ={};[Fb,fBe,pBe,mBe,vBe,xBe,CBe,jBe,Sp,Ap,wR,cFe,wFe,SFe,MFe,OFe,$Fe,PFe].forEach(function(t){yr(eQ,t)});/*! +Parent cluster`,i.height),e.setNode(i.id,v),e.parent(m)||(ae.trace("Setting parent",m,i.id),e.setParent(m,i.id,v))}if(ae.info("(Insert) Node XXX"+m+": "+JSON.stringify(e.node(m))),y!=null&&y.clusterNode){ae.info("Cluster identified XBX",m,y.width,e.node(m));const{ranksep:v,nodesep:x}=e.graph();y.graph.setGraph({...y.graph.graph(),ranksep:v+25,nodesep:x});const b=await Xj(d,y.graph,r,n,e.node(m),a),w=b.elem;rr(y,w),y.diff=b.diff||0,ae.info("New compound node after recursive render XAX",m,"width",y.width,"height",y.height),B6e(w,y)}else e.children(m).length>0?(ae.trace("Cluster - the non recursive path XBX",m,y.id,y,y.width,"Graph:",e),ae.trace(Db(y.id,e)),Pr.set(y.id,{id:Db(y.id,e),node:y})):(ae.trace("Node - the non recursive path XAX",m,d,e.node(m),s),await aC(d,e.node(m),{config:a,dir:s}))})),await T(async()=>{const m=e.edges().map(async function(y){const v=e.edge(y.v,y.w,y.name);ae.info("Edge "+y.v+" -> "+y.w+": "+JSON.stringify(y)),ae.info("Edge "+y.v+" -> "+y.w+": ",y," ",JSON.stringify(e.edge(y))),ae.info("Fix",Pr,"ids:",y.v,y.w,"Translating: ",Pr.get(y.v),Pr.get(y.w)),await ZU(h,v)});await Promise.all(m)},"processEdges")(),ae.info("Graph before layout:",JSON.stringify(_l(e))),ae.info("############################################# XXX"),ae.info("### Layout ### XXX"),ae.info("############################################# XXX"),Gj(e),ae.info("Graph after layout:",JSON.stringify(_l(e)));let p=0,{subGraphTitleTotalMargin:g}=Y2(a);return await Promise.all(yPe(e).map(async function(m){var v;const y=e.node(m);if(ae.info("Position XBX => "+m+": ("+y.x,","+y.y,") width: ",y.width," height: ",y.height),y!=null&&y.clusterNode)y.y+=g,ae.info("A tainted cluster node XBX1",m,y.id,y.width,y.height,y.x,y.y,e.parent(m)),Pr.get(y.id).node=y,Q_(y);else if(e.children(m).length>0){ae.info("A pure cluster node XBX1",m,y.id,y.x,y.y,y.width,y.height,e.parent(m)),y.height+=g,e.node(y.parentId);const x=(y==null?void 0:y.padding)/2||0,b=((v=y==null?void 0:y.labelBBox)==null?void 0:v.height)||0,w=b-x||0;ae.debug("OffsetY",w,"labelHeight",b,"halfPadding",x),await H_(l,y),Pr.get(y.id).node=y}else{const x=e.node(y.parentId);y.y+=g/2,ae.info("A regular node XBX1 - using the padding",y.id,"parent",y.parentId,y.width,y.height,y.x,y.y,"offsetY",y.offsetY,"parent",x,x==null?void 0:x.offsetY,y),Q_(y)}})),e.edges().forEach(function(m){const y=e.edge(m);ae.info("Edge "+m.v+" -> "+m.w+": "+JSON.stringify(y),y),y.points.forEach(w=>w.y+=g/2);const v=e.node(m.v);var x=e.node(m.w);const b=rH(u,y,Pr,r,v,x,n);QU(y,b)}),e.nodes().forEach(function(m){const y=e.node(m);ae.info(m,y.type,y.diff),y.isGroup&&(p=y.diff)}),ae.warn("Returning from recursive render XAX",o,p),{elem:o,diff:p}},"recursiveRender"),vPe=T(async(t,e)=>{var a,s,o,l,u,h;const r=new Ts({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((a=t.config)==null?void 0:a.nodeSpacing)||((o=(s=t.config)==null?void 0:s.flowchart)==null?void 0:o.nodeSpacing)||t.nodeSpacing,ranksep:((l=t.config)==null?void 0:l.rankSpacing)||((h=(u=t.config)==null?void 0:u.flowchart)==null?void 0:h.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");aH(n,t.markers,t.type,t.diagramId),F6e(),W6e(),v6e(),fPe(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),ae.debug("Edges:",t.edges),t.edges.forEach(d=>{if(d.start===d.end){const f=d.start,p=f+"---"+f+"---1",g=f+"---"+f+"---2",m=r.node(f);r.setNode(p,{domId:p,id:p,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(p,m.parentId),r.setNode(g,{domId:g,id:g,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(g,m.parentId);const y=structuredClone(d),v=structuredClone(d),x=structuredClone(d);y.label="",y.arrowTypeEnd="none",y.endLabelLeft="",y.endLabelRight="",y.startLabelLeft="",y.id=f+"-cyclic-special-1",v.startLabelRight="",v.startLabelLeft="",v.endLabelLeft="",v.endLabelRight="",v.arrowTypeStart="none",v.arrowTypeEnd="none",v.id=f+"-cyclic-special-mid",x.label="",x.startLabelRight="",x.startLabelLeft="",x.arrowTypeStart="none",m.isGroup&&(y.fromCluster=f,x.toCluster=f),x.id=f+"-cyclic-special-2",x.arrowTypeStart="none",r.setEdge(f,p,y,f+"-cyclic-special-0"),r.setEdge(p,g,v,f+"-cyclic-special-1"),r.setEdge(g,f,x,f+"-cyct.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw a}}}}function Kj(t,e,r){return(e=jj(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function CPe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function kPe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function EPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SPe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ri(t,e){return xPe(t)||kPe(t,e)||X8(t,e)||EPe()}function h5(t){return TPe(t)||CPe(t)||X8(t)||SPe()}function APe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function jj(t){var e=APe(t,"string");return typeof e=="symbol"?e:e+""}function Fi(t){"@babel/helpers - typeof";return Fi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fi(t)}function X8(t,e){if(t){if(typeof t=="string")return Y8(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Y8(t,e):void 0}}var zi=typeof window>"u"?null:window,Zj=zi?zi.navigator:null;zi&&zi.document;var _Pe=Fi(""),Qj=Fi({}),RPe=Fi(function(){}),LPe=typeof HTMLElement>"u"?"undefined":Fi(HTMLElement),Mb=function(e){return e&&e.instanceString&&jn(e.instanceString)?e.instanceString():null},hr=function(e){return e!=null&&Fi(e)==_Pe},jn=function(e){return e!=null&&Fi(e)===RPe},wn=function(e){return!Hs(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Kr=function(e){return e!=null&&Fi(e)===Qj&&!wn(e)&&e.constructor===Object},IPe=function(e){return e!=null&&Fi(e)===Qj},Gt=function(e){return e!=null&&Fi(e)===Fi(1)&&!isNaN(e)},DPe=function(e){return Gt(e)&&Math.floor(e)===e},d5=function(e){if(LPe!=="undefined")return e!=null&&e instanceof HTMLElement},Hs=function(e){return Nb(e)||Jj(e)},Nb=function(e){return Mb(e)==="collection"&&e._private.single},Jj=function(e){return Mb(e)==="collection"&&!e._private.single},K8=function(e){return Mb(e)==="core"},eZ=function(e){return Mb(e)==="stylesheet"},MPe=function(e){return Mb(e)==="event"},Xu=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},NPe=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},OPe=function(e){return Kr(e)&&Gt(e.x1)&&Gt(e.x2)&&Gt(e.y1)&&Gt(e.y2)},$Pe=function(e){return IPe(e)&&jn(e.then)},PPe=function(){return Zj&&Zj.userAgent.match(/msie|trident|edge/i)},w0=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;sr?1:0},WPe=function(e,r){return-1*nZ(e,r)},yr=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(y-=1),y<1/6?g+(m-g)*6*y:y<1/2?m:y<2/3?g+(m-g)*(2/3-y)*6:g}var d=new RegExp("^"+zPe+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,a=parseFloat(d[3]),a<0||a>100)||(a=a/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)o=l=u=Math.round(a*255);else{var f=a<.5?a*(1+i):a+i-a*i,p=2*a-f;o=Math.round(255*h(p,f,n+1/3)),l=Math.round(255*h(p,f,n)),u=Math.round(255*h(p,f,n-1/3))}r=[o,l,u,s]}return r},YPe=function(e){var r,n=new RegExp("^"+BPe+"$").exec(e);if(n){r=[];for(var i=[],a=1;a<=3;a++){var s=n[a];if(s[s.length-1]==="%"&&(i[a]=!0),s=parseFloat(s),i[a]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},XPe=function(e){return KPe[e.toLowerCase()]},iZ=function(e){return(wn(e)?e:null)||XPe(e)||UPe(e)||YPe(e)||HPe(e)},KPe={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},aZ=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a=l||A<0||x&&R>=f}function _(){var F=e();if(C(F))return L(F);g=setTimeout(_,S(F))}function L(F){return g=void 0,b&&h?w(F):(h=d=void 0,p)}function O(){g!==void 0&&clearTimeout(g),y=0,h=m=d=g=void 0}function M(){return g===void 0?p:L(e())}function z(){var F=e(),A=C(F);if(h=arguments,d=this,m=F,A){if(g===void 0)return k(m);if(x)return clearTimeout(g),g=setTimeout(_,l),w(m)}return g===void 0&&(g=setTimeout(_,l)),p}return z.cancel=O,z.flush=M,z}return hR=s,hR}var aBe=iBe(),Bb=Ob(aBe),dR=zi?zi.performance:null,wZ=dR&&dR.now?function(){return dR.now()}:function(){return Date.now()},sBe=(function(){if(zi){if(zi.requestAnimationFrame)return function(t){zi.requestAnimationFrame(t)};if(zi.mozRequestAnimationFrame)return function(t){zi.mozRequestAnimationFrame(t)};if(zi.webkitRequestAnimationFrame)return function(t){zi.webkitRequestAnimationFrame(t)};if(zi.msRequestAnimationFrame)return function(t){zi.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(wZ())},1e3/60)}})(),m5=function(e){return sBe(e)},$c=wZ,Ld=9261,CZ=65599,C0=5381,kZ=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ld,n=r,i;i=e.next(),!i.done;)n=n*CZ+i.value|0;return n},Fb=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ld;return r*CZ+e|0},zb=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:C0;return(r<<5)+r+e|0},oBe=function(e,r){return e*2097152+r},ju=function(e){return e[0]*2097152+e[1]},y5=function(e,r){return[Fb(e[0],r[0]),zb(e[1],r[1])]},EZ=function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i=0;i--)e[i]===r&&e.splice(i,1)},gR=function(e){e.splice(0,e.length)},yBe=function(e,r){for(var n=0;n"u"?"undefined":Fi(Set))!==bBe?Set:xBe,b5=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!K8(e)){Hn("An element must have a core reference and parameters set");return}var i=r.group;if(i==null&&(r.data&&r.data.source!=null&&r.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){Hn("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?i==="edges":!!r.pannable,active:!1,classes:new k0,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();a.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];wn(r.classes)?u=r.classes:hr(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hx?1:0},h=function(v,x,b,w,k){var S;if(b==null&&(b=0),k==null&&(k=n),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=v.length);bO;0<=O?L++:L--)_.push(L);return _}).apply(this).reverse(),C=[],w=0,k=S.length;wM;0<=M?++_:--_)z.push(s(v,b));return z},m=function(v,x,b,w){var k,S,C;for(w==null&&(w=n),k=v[b];b>x;){if(C=b-1>>1,S=v[C],w(k,S)<0){v[b]=S,b=C;continue}break}return v[b]=k},y=function(v,x,b){var w,k,S,C,_;for(b==null&&(b=n),k=v.length,_=x,S=v[x],w=2*x+1;w0;){var S=x.pop(),C=y(S),_=S.id();if(f[_]=C,C!==1/0)for(var L=S.neighborhood().intersect(g),O=0;O0)for(I.unshift(D);d[B];){var P=d[B];I.unshift(P.edge),I.unshift(P.node),$=P.node,B=$.id()}return o.spawn(I)}}}},ABe={kruskal:function(e){e=e||function(b){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,s=new Array(a),o=n,l=function(w){for(var k=0;k0;){if(k(),C++,w===h){for(var _=[],L=a,O=h,M=v[O];_.unshift(L),M!=null&&_.unshift(M),L=y[O],L!=null;)O=L.id(),M=v[O];return{found:!0,distance:d[w],path:this.spawn(_),steps:C}}p[w]=!0;for(var z=b._private.edges,F=0;FM&&(g[O]=M,x[O]=L,b[O]=k),!a){var z=L*h+_;!a&&g[z]>M&&(g[z]=M,x[z]=_,b[z]=k)}}}for(var F=0;F1&&arguments[1]!==void 0?arguments[1]:s,Ge=b(me),Te=[],Ze=Ge;;){if(Ze==null)return r.spawn();var ke=x(Ze),Ve=ke.edge,Qe=ke.pred;if(Te.unshift(Ze[0]),Ze.same(ve)&&Te.length>0)break;Ve!=null&&Te.unshift(Ve),Ze=Qe}return l.spawn(Te)},S=0;S=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===o&&r[p]===l||r[f]===l&&r[p]===o)&&u.splice(h,1)}for(var g=0;gi;){var a=Math.floor(Math.random()*r.length);r=OBe(a,e,r),n--}return r},$Be={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(I){return I.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/NBe);if(a<2){Hn("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],h=0;h1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,a=0,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}a&&e.sort(function(f,p){return f-p});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},qBe=function(e){return Math.PI*e/180},w5=function(e,r){return Math.atan2(r,e)-Math.PI/2},bR=Math.log2||function(t){return Math.log(t)/Math.log(2)},xR=function(e){return e>0?1:e<0?-1:0},Dd=function(e,r){return Math.sqrt(Md(e,r))},Md=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},VBe=function(e){for(var r=e.length,n=0,i=0;i=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},UBe=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},HBe=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},YBe=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},PZ=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},C5=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},k5=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,s;if(r.length===1)n=i=a=s=r[0];else if(r.length===2)n=a=r[0],s=i=r[1];else if(r.length===4){var o=Ri(r,4);n=o[0],i=o[1],a=o[2],s=o[3]}return e.x1-=s,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},BZ=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},TR=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},Qu=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},FZ=function(e,r){return Qu(e,r.x,r.y)},zZ=function(e,r){return Qu(e,r.x1,r.y1)&&Qu(e,r.x2,r.y2)},XBe=(vR=Math.hypot)!==null&&vR!==void 0?vR:function(t,e){return Math.sqrt(t*t+e*e)};function KBe(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(_,L){return{x:_.x+L.x,y:_.y+L.y}},n=function(_,L){return{x:_.x-L.x,y:_.y-L.y}},i=function(_,L){return{x:_.x*L,y:_.y*L}},a=function(_,L){return _.x*L.y-_.y*L.x},s=function(_){var L=XBe(_.x,_.y);return L===0?{x:0,y:0}:{x:_.x/L,y:_.y/L}},o=function(_){for(var L=0,O=0;O<_.length;O++){var M=_[O],z=_[(O+1)%_.length];L+=M.x*z.y-z.x*M.y}return L/2},l=function(_,L,O,M){var z=n(L,_),F=n(M,O),A=a(z,F);if(Math.abs(A)<1e-9)return r(_,i(z,.5));var R=a(n(O,_),F)/A;return r(_,i(z,R))},u=t.map(function(C){return{x:C.x,y:C.y}});o(u)<0&&u.reverse();for(var h=u.length,d=[],f=0;f7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?eh(a,s):l,h=a/2,d=s/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-o,y=i-d-o,v=n+h-u+o,x=y;if(g=Ju(e,r,n,i,m,y,v,x,!1),g.length>0)return g}if(p){var b=n+h+o,w=i-d+u-o,k=b,S=i+d-u+o;if(g=Ju(e,r,n,i,b,w,k,S,!1),g.length>0)return g}if(f){var C=n-h+u-o,_=i+d+o,L=n+h-u+o,O=_;if(g=Ju(e,r,n,i,C,_,L,O,!1),g.length>0)return g}if(p){var M=n-h-o,z=i-d+u-o,F=M,A=i+d-u+o;if(g=Ju(e,r,n,i,M,z,F,A,!1),g.length>0)return g}var R;{var N=n-h+u,D=i-d+u;if(R=Wb(e,r,n,i,N,D,u+o),R.length>0&&R[0]<=N&&R[1]<=D)return[R[0],R[1]]}{var I=n+h-u,$=i-d+u;if(R=Wb(e,r,n,i,I,$,u+o),R.length>0&&R[0]>=I&&R[1]<=$)return[R[0],R[1]]}{var B=n+h-u,P=i+d-u;if(R=Wb(e,r,n,i,B,P,u+o),R.length>0&&R[0]>=B&&R[1]>=P)return[R[0],R[1]]}{var G=n-h+u,V=i+d-u;if(R=Wb(e,r,n,i,G,V,u+o),R.length>0&&R[0]<=G&&R[1]>=V)return[R[0],R[1]]}return[]},ZBe=function(e,r,n,i,a,s,o){var l=o,u=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,s),f=Math.max(i,s);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},QBe=function(e,r,n,i,a,s,o,l,u){var h={x1:Math.min(n,o,a)-u,x2:Math.max(n,o,a)+u,y1:Math.min(i,l,s)-u,y2:Math.max(i,l,s)+u};return!(eh.x2||rh.y2)},JBe=function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var s=Math.sqrt(a),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},eFe=function(e,r,n,i,a){var s=1e-5;e===0&&(e=s),r/=e,n/=e,i/=e;var o,l,u,h,d,f,p,g;if(l=(3*n-r*r)/9,u=-(27*i)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,a[1]=0,p=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),a[0]=-p+d+f,p+=(d+f)/2,a[4]=a[2]=-p,p=Math.sqrt(3)*(-f+d)/2,a[3]=p,a[5]=-p;return}if(a[5]=a[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),a[0]=-p+2*g,a[4]=a[2]=-(g+p);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),a[0]=-p+g*Math.cos(h/3),a[2]=-p+g*Math.cos((h+2*Math.PI)/3),a[4]=-p+g*Math.cos((h+4*Math.PI)/3)},tFe=function(e,r,n,i,a,s,o,l){var u=1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+i*i-4*i*s+2*i*l+4*s*s-4*s*l+l*l,h=9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*i*s-3*i*i-3*i*l-6*s*s+3*s*l,d=3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*i*i-6*i*s+i*l-i*r+2*s*s+2*s*r-l*r,f=1*n*a-n*n+n*e-a*e+i*s-i*i+i*r-s*r,p=[];eFe(u,h,d,f,p);for(var g=1e-7,m=[],y=0;y<6;y+=2)Math.abs(p[y+1])=0&&p[y]<=1&&m.push(p[y]);m.push(1),m.push(0);for(var v=-1,x,b,w,k=0;k=0?wu?(e-a)*(e-a)+(r-s)*(r-s):h-f},Cs=function(e,r,n){for(var i,a,s,o,l,u=0,h=0;h=e&&e>=s||i<=e&&e<=s)l=(e-i)/(s-i)*(o-a)+a,l>r&&u++;else continue;return u%2!==0},Bc=function(e,r,n,i,a,s,o,l,u){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),p=Math.sin(-d),g=0;g0){var y=S5(h,-u);m=E5(y)}else m=h;return Cs(e,r,m)},nFe=function(e,r,n,i,a,s,o,l){for(var u=new Array(n.length*2),h=0;h=0&&y<=1&&x.push(y),v>=0&&v<=1&&x.push(v),x.length===0)return[];var b=x[0]*l[0]+e,w=x[0]*l[1]+r;if(x.length>1){if(x[0]==x[1])return[b,w];var k=x[1]*l[0]+e,S=x[1]*l[1]+r;return[b,w,k,S]}else return[b,w]},wR=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Ju=function(e,r,n,i,a,s,o,l,u){var h=e-a,d=n-e,f=o-a,p=r-s,g=i-r,m=l-s,y=f*p-m*h,v=d*p-g*h,x=m*d-f*g;if(x!==0){var b=y/x,w=v/x,k=.001,S=0-k,C=1+k;return S<=b&&b<=C&&S<=w&&w<=C?[e+b*d,r+b*g]:u?[e+b*d,r+b*g]:[]}else return y===0||v===0?wR(e,n,o)===o?[o,l]:wR(e,n,a)===a?[a,s]:wR(a,o,n)===n?[n,i]:[]:[]},aFe=function(e,r,n,i,a){var s=[],o=i/2,l=a/2,u=r,h=n;s.push({x:u+o*e[0],y:h+l*e[1]});for(var d=1;d0){var m=S5(d,-l);p=E5(m)}else p=d}else p=n;for(var y,v,x,b,w=0;w2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),y=1;yh&&(h=w)},get:function(b){return u[b]}},f=0;f0?R=A.edgesTo(F)[0]:R=F.edgesTo(A)[0];var N=i(R);F=F.id(),C[F]>C[M]+N&&(C[F]=C[M]+N,_.nodes.indexOf(F)<0?_.push(F):_.updateItem(F),S[F]=0,k[F]=[]),C[F]==C[M]+N&&(S[F]=S[F]+S[M],k[F].push(M))}else for(var D=0;D0;){for(var P=w.pop(),G=0;G0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},xFe=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:CFe,o=i,l,u,h=0;h=2?Hb(e,r,n,0,jZ,kFe):Hb(e,r,n,0,KZ)},squaredEuclidean:function(e,r,n){return Hb(e,r,n,0,jZ)},manhattan:function(e,r,n){return Hb(e,r,n,0,KZ)},max:function(e,r,n){return Hb(e,r,n,-1/0,EFe)}};R0["squared-euclidean"]=R0.squaredEuclidean,R0.squaredeuclidean=R0.squaredEuclidean;function _5(t,e,r,n,i,a){var s;return jn(t)?s=t:s=R0[t]||R0.euclidean,e===0&&jn(t)?s(i,a):s(e,r,n,i,a)}var SFe=ha({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),_R=function(e){return SFe(e)},R5=function(e,r,n,i,a){var s=a!=="kMedoids",o=s?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return _5(e,i.length,o,l,u,h)},RR=function(e,r,n){for(var i=n.length,a=new Array(i),s=new Array(i),o=new Array(r),l=null,u=0;un)return!1}return!0},RFe=function(e,r,n){for(var i=0;io&&(o=r[u][h],l=h);a[l].push(e[u])}for(var d=0;d=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var g=r[s],m=r[i[s]],y;a.mode==="dendrogram"?y={left:g,right:m,key:g.key}:y={value:g.value.concat(m.value),key:g.key},e[g.index]=y,e.splice(m.index,1),r[g.key]=y;for(var v=0;vn[m.key][x.key]&&(l=n[m.key][x.key])):a.linkage==="max"?(l=n[g.key][x.key],n[g.key][x.key]0&&i.push(a);return i},iQ=function(e,r,n){for(var i=[],a=0;ao&&(s=u,o=r[a*e+u])}s>0&&i.push(s)}for(var h=0;hu&&(l=h,u=d)}n[a]=s[l]}return i=iQ(e,r,n),i},aQ=function(e){for(var r=this.cy(),n=this.nodes(),i=GFe(e),a={},s=0;s=M?(z=M,M=A,F=R):A>z&&(z=A);for(var N=0;N0?1:0;C[L%i.minIterations*o+G]=V,P+=V}if(P>0&&(L>=i.minIterations-1||L==i.maxIterations-1)){for(var X=0,W=0;W1||S>1)&&(o=!0),d[b]=[],x.outgoers().forEach(function(_){_.isEdge()&&d[b].push(_.id())})}else f[b]=[void 0,x.target().id()]}):s.forEach(function(x){var b=x.id();if(x.isNode()){var w=x.degree(!0);w%2&&(l?u?o=!0:u=b:l=b),d[b]=[],x.connectedEdges().forEach(function(k){return d[b].push(k.id())})}else f[b]=[x.source().id(),x.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(u&&l)if(a){if(h&&u!=h)return p;h=u}else{if(h&&u!=h&&l!=h)return p;h||(h=u)}else h||(h=s[0].id());var g=function(b){for(var w=b,k=[b],S,C,_;d[w].length;)S=d[w].shift(),C=f[S][0],_=f[S][1],w!=_?(d[_]=d[_].filter(function(L){return L!=S}),w=_):!a&&w!=C&&(d[C]=d[C].filter(function(L){return L!=S}),w=C),k.unshift(S),k.unshift(w);return k},m=[],y=[];for(y=g(h);y.length!=1;)d[y[0]].length==0?(m.unshift(s.getElementById(y.shift())),m.unshift(s.getElementById(y.shift()))):y=g(y.shift()).concat(y);m.unshift(s.getElementById(y.shift()));for(var v in d)if(d[v].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},L5=function(){var e=this,r={},n=0,i=0,a=[],s=[],o={},l=function(f,p){for(var g=s.length-1,m=[],y=e.spawn();s[g].x!=f||s[g].y!=p;)m.push(s.pop().edge),g--;m.push(s.pop().edge),m.forEach(function(v){var x=v.connectedNodes().intersection(e);y.merge(v),x.forEach(function(b){var w=b.id(),k=b.connectedEdges().intersection(e);y.merge(b),r[w].cutVertex?y.merge(k.filter(function(S){return S.isLoop()})):y.merge(k)})}),a.push(y)},u=function(f,p,g){f===g&&(i+=1),r[p]={id:n,low:n++,cutVertex:!1};var m=e.getElementById(p).connectedEdges().intersection(e);if(m.size()===0)a.push(e.spawn(e.getElementById(p)));else{var y,v,x,b;m.forEach(function(w){y=w.source().id(),v=w.target().id(),x=y===p?v:y,x!==g&&(b=w.id(),o[b]||(o[b]=!0,s.push({x:p,y:x,edge:w})),x in r?r[p].low=Math.min(r[p].low,r[x].id):(u(f,x,p),r[p].low=Math.min(r[p].low,r[x].low),r[p].id<=r[x].low&&(r[p].cutVertex=!0,l(p,x))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var h=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:a}},KFe={hopcroftTarjanBiconnected:L5,htbc:L5,htb:L5,hopcroftTarjanBiconnectedComponents:L5},I5=function(){var e=this,r={},n=0,i=[],a=[],s=e.spawn(e),o=function(u){a.push(u),r[u]={index:n,low:n++,explored:!1};var h=e.getElementById(u).connectedEdges().intersection(e);if(h.forEach(function(m){var y=m.target().id();y!==u&&(y in r||o(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=a.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=d.edgesWith(d),g=d.merge(p);i.push(g),s=s.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:i}},jFe={tarjanStronglyConnected:I5,tsc:I5,tscc:I5,tarjanStronglyConnectedComponents:I5},sQ={};[Gb,SBe,ABe,RBe,IBe,MBe,$Be,cFe,A0,_0,AR,wFe,OFe,FFe,HFe,XFe,KFe,jFe].forEach(function(t){yr(sQ,t)});/*! Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) Licensed under The MIT License (http://opensource.org/licenses/MIT) -*/var tQ=0,rQ=1,nQ=2,Po=function(e){if(!(this instanceof Po))return new Po(e);this.id="Thenable/1.0.7",this.state=tQ,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Po.prototype={fulfill:function(e){return iQ(this,rQ,"fulfillValue",e)},reject:function(e){return iQ(this,nQ,"rejectReason",e)},then:function(e,r){var n=this,i=new Po;return n.onFulfilled.push(oQ(e,i,"fulfill")),n.onRejected.push(oQ(r,i,"reject")),aQ(n),i.proxy}};var iQ=function(e,r,n,i){return e.state===tQ&&(e.state=r,e[n]=i,aQ(e)),e},aQ=function(e){e.state===rQ?sQ(e,"onFulfilled",e.fulfillValue):e.state===nQ&&sQ(e,"onRejected",e.rejectReason)},sQ=function(e,r,n){if(e[r].length!==0){var i=e[r];e[r]=[];var a=function(){for(var o=0;o0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var s=0;s-1}return jR=e,jR}var ZR,DQ;function rze(){if(DQ)return ZR;DQ=1;var t=I5();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return ZR=e,ZR}var QR,MQ;function nze(){if(MQ)return QR;MQ=1;var t=QFe(),e=JFe(),r=eze(),n=tze(),i=rze();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o-1&&n%1==0&&n0&&this.spawn(i).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){wn(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],s=0,o=n.length;s0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};M5.className=M5.classNames=M5.classes;var jr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Gi,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};jr.variable="(?:[\\w-.]|(?:\\\\"+jr.metaChar+"))+",jr.className="(?:[\\w-]|(?:\\\\"+jr.metaChar+"))+",jr.value=jr.string+"|"+jr.number,jr.id=jr.variable,(function(){var t,e,r;for(t=jr.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(jr.comparatorOp+="|\\!"+e)})();var vn=function(){return{checks:[]}},jt={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},AL=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return IPe(t.selector,e.selector)}),Nze=(function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return cn("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return cn("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&cn("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},zze=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return hr(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case jt.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case jt.DATA_COMPARE:{var m=h.field,y=h.operator;return"["+m+n(e(y))+r(p)+"]"}case jt.DATA_BOOL:{var v=h.operator,T=h.field;return"["+e(v)+T+"]"}case jt.DATA_EXIST:{var b=h.field;return"["+b+"]"}case jt.META_COMPARE:{var w=h.operator,k=h.field;return"[["+k+n(e(w))+r(p)+"]]"}case jt.STATE:return p;case jt.ID:return"#"+p;case jt.CLASS:return"."+p;case jt.PARENT:case jt.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case jt.ANCESTOR:case jt.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case jt.COMPOUND_SPLIT:{var A=a(h.left,d),C=a(h.subject,d),_=a(h.right,d);return A+(A.length>0?" ":"")+C+_}case jt.TRUE:return""}},a=function(h,d){return h.checks.reduce(function(f,p,g){return f+(d===h&&g===0?"$":"")+i(p,d)},"")},s="",o=0;o1&&o=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(a||o||h)&&(l=!a&&!s?"":""+e,u=""+n),h&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=e===n;break;case">":f=!0,i=e>n;break;case">=":f=!0,i=e>=n;break;case"<":f=!0,i=e0;){var h=i.shift();e(h),a.add(h.id()),o&&n(i,a,h)}return t}function dJ(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return LL(this,t,e,dJ)};function fJ(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}Dp.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return LL(this,t,e,fJ)};function Xze(t,e,r){fJ(t,e,r),dJ(t,e,r)}Dp.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return LL(this,t,e,Xze)},Dp.ancestors=Dp.parents;var Ub,pJ;Ub=pJ={data:un.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:un.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:un.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:un.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:un.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:un.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},Ub.attr=Ub.data,Ub.removeAttr=Ub.removeData;var Kze=pJ,N5={};function IL(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,i=r[0],a=i._private.edges,s=0;se}),minIndegree:Mp("indegree",function(t,e){return te}),minOutdegree:Mp("outdegree",function(t,e){return te})}),yr(N5,{totalDegree:function(e){for(var r=0,n=this.nodes(),i=0;i0,f=d;d&&(h=h[0]);var p=f?h.position():{x:0,y:0};r!==void 0?u.position(e,r+p[e]):a!==void 0&&u.position({x:a.x+p.x,y:a.y+p.y})}else{var g=n.position(),m=o?n.parent():null,y=m&&m.length>0,v=y;y&&(m=m[0]);var T=v?m.position():{x:0,y:0};return a={x:g.x-T.x,y:g.y-T.y},e===void 0?a:a[e]}else if(!s)return;return this}},Bo.modelPosition=Bo.point=Bo.position,Bo.modelPositions=Bo.points=Bo.positions,Bo.renderedPoint=Bo.renderedPosition,Bo.relativePoint=Bo.relativePosition;var jze=gJ,Np=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},Op=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},Zze=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},$p,ah;$p=ah={},ah.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}},ah.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)},ah.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function p(L,O,M){var z=0,F=0,S=O+M;return L>0&&S>0&&(z=O/S*L,F=M/S*L),{biasDiff:z,biasComplementDiff:F}}function g(L,O,M,z){if(M.units==="%")switch(z){case"width":return L>0?M.pfValue*L:0;case"height":return O>0?M.pfValue*O:0;case"average":return L>0&&O>0?M.pfValue*(L+O)/2:0;case"min":return L>0&&O>0?L>O?M.pfValue*O:M.pfValue*L:0;case"max":return L>0&&O>0?L>O?M.pfValue*L:M.pfValue*O:0;default:return 0}else return M.units==="px"?M.pfValue:0}var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var y=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(y=y*100/h.width.val);var v=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(v=v*100/h.height.val);var T=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(T=T*100/h.height.val);var b=p(h.width.val-d.w,m,y),w=b.biasDiff,k=b.biasComplementDiff,A=p(h.height.val-d.h,v,T),C=A.biasDiff,_=A.biasComplementDiff;o.autoPadding=g(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-w+d.x1+d.x2+k)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-C+d.y1+d.y2+_)/2}for(var n=0;ne.x2?i:e.x2,e.y1=ne.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},sh=function(e,r){return r==null?e:Fo(e,r.x1,r.y1,r.x2,r.y2)},Hb=function(e,r,n){return Ka(e,r,n)},O5=function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,s=a.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=a.srcX,u=a.srcY):n==="target"?(l=a.tgtX,u=a.tgtY):(l=a.midX,u=a.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,x5(d,1),Fo(e,d.x1,d.y1,d.x2,d.y2)}}},DL=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,s=a.rstyle,o=r.pstyle(i+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=Hb(s,"labelWidth",n),d=Hb(s,"labelHeight",n),f=Hb(s,"labelX",n),p=Hb(s,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,m=r.pstyle(i+"text-margin-y").pfValue,y=r.isEdge(),v=r.pstyle(i+"text-rotation"),T=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,w=b/2,k=r.pstyle("text-background-padding").pfValue,A=2,C=d,_=h,L=_/2,O=C/2,M,z,F,S;if(y)M=f-L,z=f+L,F=p-O,S=p+O;else{switch(Np(l.value)){case"left":M=f-_,z=f;break;case"center":M=f-L,z=f+L;break;case"right":M=f,z=f+_;break}switch(Op(u.value)){case"top":F=p-C,S=p;break;case"center":F=p-O,S=p+O;break;case"bottom":F=p,S=p+C;break}}var R=g-Math.max(T,w)-k-A,N=g+Math.max(T,w)+k+A,D=m-Math.max(T,w)-k-A,I=m+Math.max(T,w)+k+A;M+=R,z+=N,F+=D,S+=I;var $=n||"main",B=a.labelBounds,P=B[$]=B[$]||{};P.x1=M,P.y1=F,P.x2=z,P.y2=S,P.w=z-M,P.h=S-F,P.leftPad=R,P.rightPad=N,P.topPad=D,P.botPad=I;var G=y&&v.strValue==="autorotate",V=v.pfValue!=null&&v.pfValue!==0;if(G||V){var Y=G?Hb(a.rstyle,"labelAngle",n):v.pfValue,W=Math.cos(Y),ie=Math.sin(Y),K=(M+z)/2,se=(F+S)/2;if(!y){switch(Np(l.value)){case"left":K=z;break;case"right":K=M;break}switch(Op(u.value)){case"top":se=S;break;case"bottom":se=F;break}}var J=function(Ne,me){return Ne=Ne-K,me=me-se,{x:Ne*W-me*ie+K,y:Ne*ie+me*W+se}},Z=J(M,F),ee=J(M,S),ne=J(z,F),ue=J(z,S);M=Math.min(Z.x,ee.x,ne.x,ue.x),z=Math.max(Z.x,ee.x,ne.x,ue.x),F=Math.min(Z.y,ee.y,ne.y,ue.y),S=Math.max(Z.y,ee.y,ne.y,ue.y)}var fe=$+"Rot",_e=B[fe]=B[fe]||{};_e.x1=M,_e.y1=F,_e.x2=z,_e.y2=S,_e.w=z-M,_e.h=S-F,Fo(e,M,F,z,S),Fo(a.labelBounds.all,M,F,z,S)}return e}},vJ=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,a=r.pstyle("outline-offset").value,s=i+a;bJ(e,r,n,s,"outside",s/2)}},bJ=function(e,r,n,i,a,s){if(!(n===0||i<=0||a==="inside")){var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(u){var h=r.position(),d=h.x,f=h.y,p=r.width(),g=r.height();if(u.hasMiterBounds){a==="center"&&(i/=2);var m=u.miterBounds(d,f,p,g,i);sh(e,m)}else s!=null&&s>0&&T5(e,[s,s,s,s])}}},Qze=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,a=r.pstyle("border-position").value;bJ(e,r,n,i,a)}},Jze=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=ja(),o=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,y=o.rstyle,v=l&&i?e.pstyle("bounds-expansion").pfValue:[0],T=function(Ae){return Ae.pstyle("display").value!=="none"},b=!i||T(e)&&(!u||T(e.source())&&T(e.target()));if(b){var w=0,k=0;i&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(k=e.pstyle("overlay-padding").value));var A=0,C=0;i&&r.includeUnderlays&&(A=e.pstyle("underlay-opacity").value,A!==0&&(C=e.pstyle("underlay-padding").value));var _=Math.max(k,C),L=0,O=0;if(i&&(L=e.pstyle("width").pfValue,O=L/2),l&&r.includeNodes){var M=e.position();g=M.x,m=M.y;var z=e.outerWidth(),F=z/2,S=e.outerHeight(),R=S/2;h=g-F,d=g+F,f=m-R,p=m+R,Fo(s,h,f,d,p),i&&vJ(s,e),i&&r.includeOutlines&&!a&&vJ(s,e),i&&Qze(s,e)}else if(u&&r.includeEdges)if(i&&!a){var N=e.pstyle("curve-style").strValue;if(h=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),f=Math.min(y.srcY,y.midY,y.tgtY),p=Math.max(y.srcY,y.midY,y.tgtY),h-=O,d+=O,f-=O,p+=O,Fo(s,h,f,d,p),N==="haystack"){var D=y.haystackPts;if(D&&D.length===2){if(h=D[0].x,f=D[0].y,d=D[1].x,p=D[1].y,h>d){var I=h;h=d,d=I}if(f>p){var $=f;f=p,p=$}Fo(s,h-O,f-O,d+O,p+O)}}else if(N==="bezier"||N==="unbundled-bezier"||Ku(N,"segments")||Ku(N,"taxi")){var B;switch(N){case"bezier":case"unbundled-bezier":B=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":B=y.linePts;break}if(B!=null)for(var P=0;Pd){var K=h;h=d,d=K}if(f>p){var se=f;f=p,p=se}h-=O,d+=O,f-=O,p+=O,Fo(s,h,f,d,p)}if(i&&r.includeEdges&&u&&(O5(s,e,"mid-source"),O5(s,e,"mid-target"),O5(s,e,"source"),O5(s,e,"target")),i){var J=e.pstyle("ghost").value==="yes";if(J){var Z=e.pstyle("ghost-offset-x").pfValue,ee=e.pstyle("ghost-offset-y").pfValue;Fo(s,s.x1+Z,s.y1+ee,s.x2+Z,s.y2+ee)}}var ne=o.bodyBounds=o.bodyBounds||{};DZ(ne,s),T5(ne,v),x5(ne,1),i&&(h=s.x1,d=s.x2,f=s.y1,p=s.y2,Fo(s,h-_,f-_,d+_,p+_));var ue=o.overlayBounds=o.overlayBounds||{};DZ(ue,s),T5(ue,v),x5(ue,1);var fe=o.labelBounds=o.labelBounds||{};fe.all!=null?MBe(fe.all):fe.all=ja(),i&&r.includeLabels&&(r.includeMainLabels&&DL(s,e,null),u&&(r.includeSourceLabels&&DL(s,e,"source"),r.includeTargetLabels&&DL(s,e,"target")))}return s.x1=fo(s.x1),s.y1=fo(s.y1),s.x2=fo(s.x2),s.y2=fo(s.y2),s.w=fo(s.x2-s.x1),s.h=fo(s.y2-s.y1),s.w>0&&s.h>0&&b&&(T5(s,v),x5(s,1)),s},xJ=function(e){var r=0,n=function(s){return(s?1:0)<0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var s=0;s-1}return tL=e,tL}var rL,BQ;function gze(){if(BQ)return rL;BQ=1;var t=N5();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return rL=e,rL}var nL,FQ;function mze(){if(FQ)return nL;FQ=1;var t=hze(),e=dze(),r=fze(),n=pze(),i=gze();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o-1&&n%1==0&&n0&&this.spawn(i).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){wn(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],s=0,o=n.length;s0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};$5.className=$5.classNames=$5.classes;var jr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Gi,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};jr.variable="(?:[\\w-.]|(?:\\\\"+jr.metaChar+"))+",jr.className="(?:[\\w-]|(?:\\\\"+jr.metaChar+"))+",jr.value=jr.string+"|"+jr.number,jr.id=jr.variable,(function(){var t,e,r;for(t=jr.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(jr.comparatorOp+="|\\!"+e)})();var vn=function(){return{checks:[]}},jt={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},DL=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return WPe(t.selector,e.selector)}),Yze=(function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return cn("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return cn("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&cn("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},Jze=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return hr(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case jt.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case jt.DATA_COMPARE:{var m=h.field,y=h.operator;return"["+m+n(e(y))+r(p)+"]"}case jt.DATA_BOOL:{var v=h.operator,x=h.field;return"["+e(v)+x+"]"}case jt.DATA_EXIST:{var b=h.field;return"["+b+"]"}case jt.META_COMPARE:{var w=h.operator,k=h.field;return"[["+k+n(e(w))+r(p)+"]]"}case jt.STATE:return p;case jt.ID:return"#"+p;case jt.CLASS:return"."+p;case jt.PARENT:case jt.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case jt.ANCESTOR:case jt.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case jt.COMPOUND_SPLIT:{var S=a(h.left,d),C=a(h.subject,d),_=a(h.right,d);return S+(S.length>0?" ":"")+C+_}case jt.TRUE:return""}},a=function(h,d){return h.checks.reduce(function(f,p,g){return f+(d===h&&g===0?"$":"")+i(p,d)},"")},s="",o=0;o1&&o=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(a||o||h)&&(l=!a&&!s?"":""+e,u=""+n),h&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=e===n;break;case">":f=!0,i=e>n;break;case">=":f=!0,i=e>=n;break;case"<":f=!0,i=e0;){var h=i.shift();e(h),a.add(h.id()),o&&n(i,a,h)}return t}function vJ(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return OL(this,t,e,vJ)};function bJ(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}M0.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return OL(this,t,e,bJ)};function oGe(t,e,r){bJ(t,e,r),vJ(t,e,r)}M0.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return OL(this,t,e,oGe)},M0.ancestors=M0.parents;var Yb,xJ;Yb=xJ={data:un.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:un.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:un.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:un.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:un.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:un.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},Yb.attr=Yb.data,Yb.removeAttr=Yb.removeData;var lGe=xJ,P5={};function $L(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,i=r[0],a=i._private.edges,s=0;se}),minIndegree:N0("indegree",function(t,e){return te}),minOutdegree:N0("outdegree",function(t,e){return te})}),yr(P5,{totalDegree:function(e){for(var r=0,n=this.nodes(),i=0;i0,f=d;d&&(h=h[0]);var p=f?h.position():{x:0,y:0};r!==void 0?u.position(e,r+p[e]):a!==void 0&&u.position({x:a.x+p.x,y:a.y+p.y})}else{var g=n.position(),m=o?n.parent():null,y=m&&m.length>0,v=y;y&&(m=m[0]);var x=v?m.position():{x:0,y:0};return a={x:g.x-x.x,y:g.y-x.y},e===void 0?a:a[e]}else if(!s)return;return this}},Bo.modelPosition=Bo.point=Bo.position,Bo.modelPositions=Bo.points=Bo.positions,Bo.renderedPoint=Bo.renderedPosition,Bo.relativePoint=Bo.relativePosition;var cGe=TJ,O0=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},$0=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},uGe=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},P0,ah;P0=ah={},ah.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}},ah.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)},ah.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function p(L,O,M){var z=0,F=0,A=O+M;return L>0&&A>0&&(z=O/A*L,F=M/A*L),{biasDiff:z,biasComplementDiff:F}}function g(L,O,M,z){if(M.units==="%")switch(z){case"width":return L>0?M.pfValue*L:0;case"height":return O>0?M.pfValue*O:0;case"average":return L>0&&O>0?M.pfValue*(L+O)/2:0;case"min":return L>0&&O>0?L>O?M.pfValue*O:M.pfValue*L:0;case"max":return L>0&&O>0?L>O?M.pfValue*L:M.pfValue*O:0;default:return 0}else return M.units==="px"?M.pfValue:0}var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var y=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(y=y*100/h.width.val);var v=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(v=v*100/h.height.val);var x=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(x=x*100/h.height.val);var b=p(h.width.val-d.w,m,y),w=b.biasDiff,k=b.biasComplementDiff,S=p(h.height.val-d.h,v,x),C=S.biasDiff,_=S.biasComplementDiff;o.autoPadding=g(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-w+d.x1+d.x2+k)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-C+d.y1+d.y2+_)/2}for(var n=0;ne.x2?i:e.x2,e.y1=ne.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},sh=function(e,r){return r==null?e:Fo(e,r.x1,r.y1,r.x2,r.y2)},Xb=function(e,r,n){return Ka(e,r,n)},B5=function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,s=a.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=a.srcX,u=a.srcY):n==="target"?(l=a.tgtX,u=a.tgtY):(l=a.midX,u=a.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,C5(d,1),Fo(e,d.x1,d.y1,d.x2,d.y2)}}},PL=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,s=a.rstyle,o=r.pstyle(i+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=Xb(s,"labelWidth",n),d=Xb(s,"labelHeight",n),f=Xb(s,"labelX",n),p=Xb(s,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,m=r.pstyle(i+"text-margin-y").pfValue,y=r.isEdge(),v=r.pstyle(i+"text-rotation"),x=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,w=b/2,k=r.pstyle("text-background-padding").pfValue,S=2,C=d,_=h,L=_/2,O=C/2,M,z,F,A;if(y)M=f-L,z=f+L,F=p-O,A=p+O;else{switch(O0(l.value)){case"left":M=f-_,z=f;break;case"center":M=f-L,z=f+L;break;case"right":M=f,z=f+_;break}switch($0(u.value)){case"top":F=p-C,A=p;break;case"center":F=p-O,A=p+O;break;case"bottom":F=p,A=p+C;break}}var R=g-Math.max(x,w)-k-S,N=g+Math.max(x,w)+k+S,D=m-Math.max(x,w)-k-S,I=m+Math.max(x,w)+k+S;M+=R,z+=N,F+=D,A+=I;var $=n||"main",B=a.labelBounds,P=B[$]=B[$]||{};P.x1=M,P.y1=F,P.x2=z,P.y2=A,P.w=z-M,P.h=A-F,P.leftPad=R,P.rightPad=N,P.topPad=D,P.botPad=I;var G=y&&v.strValue==="autorotate",V=v.pfValue!=null&&v.pfValue!==0;if(G||V){var X=G?Xb(a.rstyle,"labelAngle",n):v.pfValue,W=Math.cos(X),ie=Math.sin(X),K=(M+z)/2,se=(F+A)/2;if(!y){switch(O0(l.value)){case"left":K=z;break;case"right":K=M;break}switch($0(u.value)){case"top":se=A;break;case"bottom":se=F;break}}var J=function(Ne,me){return Ne=Ne-K,me=me-se,{x:Ne*W-me*ie+K,y:Ne*ie+me*W+se}},Z=J(M,F),ee=J(M,A),ne=J(z,F),ue=J(z,A);M=Math.min(Z.x,ee.x,ne.x,ue.x),z=Math.max(Z.x,ee.x,ne.x,ue.x),F=Math.min(Z.y,ee.y,ne.y,ue.y),A=Math.max(Z.y,ee.y,ne.y,ue.y)}var fe=$+"Rot",_e=B[fe]=B[fe]||{};_e.x1=M,_e.y1=F,_e.x2=z,_e.y2=A,_e.w=z-M,_e.h=A-F,Fo(e,M,F,z,A),Fo(a.labelBounds.all,M,F,z,A)}return e}},kJ=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,a=r.pstyle("outline-offset").value,s=i+a;EJ(e,r,n,s,"outside",s/2)}},EJ=function(e,r,n,i,a,s){if(!(n===0||i<=0||a==="inside")){var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(u){var h=r.position(),d=h.x,f=h.y,p=r.width(),g=r.height();if(u.hasMiterBounds){a==="center"&&(i/=2);var m=u.miterBounds(d,f,p,g,i);sh(e,m)}else s!=null&&s>0&&k5(e,[s,s,s,s])}}},hGe=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,a=r.pstyle("border-position").value;EJ(e,r,n,i,a)}},dGe=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=ja(),o=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,y=o.rstyle,v=l&&i?e.pstyle("bounds-expansion").pfValue:[0],x=function(Ae){return Ae.pstyle("display").value!=="none"},b=!i||x(e)&&(!u||x(e.source())&&x(e.target()));if(b){var w=0,k=0;i&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(k=e.pstyle("overlay-padding").value));var S=0,C=0;i&&r.includeUnderlays&&(S=e.pstyle("underlay-opacity").value,S!==0&&(C=e.pstyle("underlay-padding").value));var _=Math.max(k,C),L=0,O=0;if(i&&(L=e.pstyle("width").pfValue,O=L/2),l&&r.includeNodes){var M=e.position();g=M.x,m=M.y;var z=e.outerWidth(),F=z/2,A=e.outerHeight(),R=A/2;h=g-F,d=g+F,f=m-R,p=m+R,Fo(s,h,f,d,p),i&&kJ(s,e),i&&r.includeOutlines&&!a&&kJ(s,e),i&&hGe(s,e)}else if(u&&r.includeEdges)if(i&&!a){var N=e.pstyle("curve-style").strValue;if(h=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),f=Math.min(y.srcY,y.midY,y.tgtY),p=Math.max(y.srcY,y.midY,y.tgtY),h-=O,d+=O,f-=O,p+=O,Fo(s,h,f,d,p),N==="haystack"){var D=y.haystackPts;if(D&&D.length===2){if(h=D[0].x,f=D[0].y,d=D[1].x,p=D[1].y,h>d){var I=h;h=d,d=I}if(f>p){var $=f;f=p,p=$}Fo(s,h-O,f-O,d+O,p+O)}}else if(N==="bezier"||N==="unbundled-bezier"||Ku(N,"segments")||Ku(N,"taxi")){var B;switch(N){case"bezier":case"unbundled-bezier":B=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":B=y.linePts;break}if(B!=null)for(var P=0;Pd){var K=h;h=d,d=K}if(f>p){var se=f;f=p,p=se}h-=O,d+=O,f-=O,p+=O,Fo(s,h,f,d,p)}if(i&&r.includeEdges&&u&&(B5(s,e,"mid-source"),B5(s,e,"mid-target"),B5(s,e,"source"),B5(s,e,"target")),i){var J=e.pstyle("ghost").value==="yes";if(J){var Z=e.pstyle("ghost-offset-x").pfValue,ee=e.pstyle("ghost-offset-y").pfValue;Fo(s,s.x1+Z,s.y1+ee,s.x2+Z,s.y2+ee)}}var ne=o.bodyBounds=o.bodyBounds||{};BZ(ne,s),k5(ne,v),C5(ne,1),i&&(h=s.x1,d=s.x2,f=s.y1,p=s.y2,Fo(s,h-_,f-_,d+_,p+_));var ue=o.overlayBounds=o.overlayBounds||{};BZ(ue,s),k5(ue,v),C5(ue,1);var fe=o.labelBounds=o.labelBounds||{};fe.all!=null?HBe(fe.all):fe.all=ja(),i&&r.includeLabels&&(r.includeMainLabels&&PL(s,e,null),u&&(r.includeSourceLabels&&PL(s,e,"source"),r.includeTargetLabels&&PL(s,e,"target")))}return s.x1=fo(s.x1),s.y1=fo(s.y1),s.x2=fo(s.x2),s.y2=fo(s.y2),s.w=fo(s.x2-s.x1),s.h=fo(s.y2-s.y1),s.w>0&&s.h>0&&b&&(k5(s,v),C5(s,1)),s},SJ=function(e){var r=0,n=function(s){return(s?1:0)<0&&arguments[0]!==void 0?arguments[0]:pGe,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)s(o);return this},oh.removeAllListeners=function(){return this.removeListener("*")},oh.emit=oh.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,wn(e)||(e=[e]),gGe(this,function(a,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===fGe)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&iBe(d,e),a.beforeEmit(a.context,h,s),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==h}));var f=a.callbackContext(a.context,h,s),p=h.callback.apply(f,d);a.afterEmit(a.context,h,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,a.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,i=r.map,a=i.get(n);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&hr(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],i=this,a=0;an&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,a=this,s=0;s=0&&a"u"?"undefined":Fi(Symbol))!=e&&Fi(Symbol.iterator)!=e;r&&(F5[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return Vj({next:function(){return a1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var a=n._private.style[e];return a??(r?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(Kr(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(hr(e))if(r===void 0){var o=this[0];return o?a.getStylePropertyValue(o,e):void 0}else a.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),a=this;if(e===void 0)for(var s=0;s0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Da.neighbourhood=Da.neighborhood,Da.closedNeighbourhood=Da.closedNeighborhood,Da.openNeighbourhood=Da.openNeighborhood,yr(Da,{source:ho(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:ho(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:GJ({attr:"source"}),targets:GJ({attr:"target"})});function GJ(t){return function(r){for(var n=[],i=0;i0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Da.componentsOf=Da.components;var fa=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Hn("A collection must have a reference to the core");return}var a=new Pc,s=!1;if(!r)r=[];else if(r.length>0&&Kr(r[0])&&!Db(r[0])){s=!0;for(var o=[],l=new Cp,u=0,h=r.length;u0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,a=[],s=[],o,l=0,u=r.length;l0){for(var $=o.length===r.length?r:new fa(n,o),B=0;B<$.length;B++){var P=$[B];P.isNode()||(P.parallelEdges().clearTraversalCache(),P.source().clearTraversalCache(),P.target().clearTraversalCache())}var G;i.hasCompoundNodes?G=n.collection().merge($).merge($.connectedNodes()).merge($.parent()):G=$,G.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?$.emitAndNotify("add"):e&&$.emit("add")}return r},kn.removed=function(){var t=this[0];return t&&t._private.removed},kn.inside=function(){var t=this[0];return t&&!t._private.removed},kn.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},a=r._private.cy;function s(S){for(var R=S._private.edges,N=0;N0&&(t?M.emitAndNotify("remove"):e&&M.emit("remove"));for(var z=0;z0?z=S:M=S;while(Math.abs(F)>s&&++R=a?T(O,R):N===0?R:w(O,M,M+u)}var A=!1;function C(){A=!0,(t!==e||r!==n)&&b()}var _=function(M){return A||C(),t===e&&r===n?M:M===0?0:M===1?1:y(k(M),e,n)};_.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var L="generateBezier("+[t,e,r,n]+")";return _.toString=function(){return L},_}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var SGe=(function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,a){var s={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,i){var a={dx:n.v,dv:t(n)},s=e(n,i*.5,a),o=e(n,i*.5,s),l=e(n,i,o),u=1/6*(a.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(a.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,a,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,d=16/1e3,f,p,g;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,o.tension=i,o.friction=a,f=s!==null,f?(u=n(i,a),p=u/s*d):p=d;g=r(g||o,p),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return f?function(m){return l[m*(l.length-1)|0]}:u}})(),En=function(e,r,n,i){var a=EGe(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},V5={linear:function(e,r,n){return e+(r-e)*n},ease:En(.25,.1,.25,1),"ease-in":En(.42,0,1,1),"ease-out":En(0,0,.58,1),"ease-in-out":En(.42,0,.58,1),"ease-in-sine":En(.47,0,.745,.715),"ease-out-sine":En(.39,.575,.565,1),"ease-in-out-sine":En(.445,.05,.55,.95),"ease-in-quad":En(.55,.085,.68,.53),"ease-out-quad":En(.25,.46,.45,.94),"ease-in-out-quad":En(.455,.03,.515,.955),"ease-in-cubic":En(.55,.055,.675,.19),"ease-out-cubic":En(.215,.61,.355,1),"ease-in-out-cubic":En(.645,.045,.355,1),"ease-in-quart":En(.895,.03,.685,.22),"ease-out-quart":En(.165,.84,.44,1),"ease-in-out-quart":En(.77,0,.175,1),"ease-in-quint":En(.755,.05,.855,.06),"ease-out-quint":En(.23,1,.32,1),"ease-in-out-quint":En(.86,0,.07,1),"ease-in-expo":En(.95,.05,.795,.035),"ease-out-expo":En(.19,1,.22,1),"ease-in-out-expo":En(1,0,0,1),"ease-in-circ":En(.6,.04,.98,.335),"ease-out-circ":En(.075,.82,.165,1),"ease-in-out-circ":En(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return V5.linear;var i=SGe(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":En};function WJ(t,e,r,n,i){if(n===1||e===r)return r;var a=i(e,r,n);return t==null||((t.roundValue||t.color)&&(a=Math.round(a)),t.min!==void 0&&(a=Math.max(a,t.min)),t.max!==void 0&&(a=Math.min(a,t.max))),a}function UJ(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Fp(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=UJ(t,i),o=UJ(e,i);if(Gt(s)&&Gt(o))return WJ(a,s,o,r,n);if(wn(s)&&wn(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(s.duration),s.easingImpl=V5[p].apply(null,g)):s.easingImpl=V5[p]}var m=s.easingImpl,y;if(s.duration===0?y=1:y=(r-l)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var v=s.startPosition,T=s.position;if(T&&i&&!t.locked()){var b={};Zb(v.x,T.x)&&(b.x=Fp(v.x,T.x,y,m)),Zb(v.y,T.y)&&(b.y=Fp(v.y,T.y,y,m)),t.position(b)}var w=s.startPan,k=s.pan,A=a.pan,C=k!=null&&n;C&&(Zb(w.x,k.x)&&(A.x=Fp(w.x,k.x,y,m)),Zb(w.y,k.y)&&(A.y=Fp(w.y,k.y,y,m)),t.emit("pan"));var _=s.startZoom,L=s.zoom,O=L!=null&&n;O&&(Zb(_,L)&&(a.zoom=Gb(a.minZoom,Fp(_,L,y,m),a.maxZoom)),t.emit("zoom")),(C||O)&&t.emit("viewport");var M=s.style;if(M&&M.length>0&&i){for(var z=0;z=0;C--){var _=A[C];_()}A.splice(0,A.length)},T=p.length-1;T>=0;T--){var b=p[T],w=b._private;if(w.stopped){p.splice(T,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||_Ge(h,b,t),AGe(h,b,t,d),w.applying&&(w.applying=!1),v(w.frames),w.step!=null&&w.step(t),b.completed()&&(p.splice(T,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var a=!1,s=0;s0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var RGe={animate:un.animate(),animation:un.animation(),animated:un.animated(),clearQueue:un.clearQueue(),delay:un.delay(),delayAnimation:un.delayAnimation(),stop:un.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&f5(function(a){HJ(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){HJ(s,e)},n.beforeRenderPriorities.animations):r()}},LGe={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&Db(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},W5=function(e){return hr(e)?new rh(e):e},YJ={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new P5(LGe,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,W5(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,W5(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,W5(r),n),this},once:function(e,r,n){return this.emitter().one(e,W5(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};un.eventAliasesOn(YJ);var OL={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};OL.jpeg=OL.jpg;var U5={layout:function(e){var r=this;if(e==null){Hn("Layout options must be specified to make a layout");return}if(e.name==null){Hn("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){Hn("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;hr(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(yr({},e,{cy:r,eles:a}));return s}};U5.createLayout=U5.makeLayout=U5.layout;var IGe={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};$L.invalidateDimensions=$L.resize;var H5={collection:function(e,r){return hr(e)?this.$(e):Hs(e)?e.collection():wn(e)?(r||(r={}),new fa(this,e,r.unique,r.removed)):new fa(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};H5.elements=H5.filter=H5.$;var Ji={},Qb="t",MGe="f";Ji.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m1&&(w=1),o.color){var A=n.valueMin[0],C=n.valueMax[0],_=n.valueMin[1],L=n.valueMax[1],O=n.valueMin[2],M=n.valueMax[2],z=n.valueMin[3]==null?1:n.valueMin[3],F=n.valueMax[3]==null?1:n.valueMax[3],S=[Math.round(A+(C-A)*w),Math.round(_+(L-_)*w),Math.round(O+(M-O)*w),Math.round(z+(F-z)*w)];a={bypass:n.bypass,name:n.name,value:S,strValue:"rgb("+S[0]+", "+S[1]+", "+S[2]+")"}}else if(o.number){var R=n.valueMin+(n.valueMax-n.valueMin)*w;a=this.parse(n.name,R,n.bypass,f)}else return!1;if(!a)return m(),!1;a.mapping=n,n=a;break}case s.data:{for(var N=n.field.split("."),D=d.data,I=0;I0&&a>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(s).play().promise().then(b):b()}).then(function(){return t.animation({style:o,duration:a,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)},Ji.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],o=i(s);t.removed()||o!=null&&o(r,n,t)&&a(s)},Ji.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",t)})},Ji.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})},Ji.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})},Ji.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})},Ji.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var Jb={};Jb.applyBypass=function(t,e,r,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;oi.length?n=n.substr(i.length):n=""}function l(){a.length>s.length?a=a.substr(s.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){cn("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var f=new rh(d);if(f.invalid){cn("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;a=p;for(var m=[];;){var y=a.match(/^\s*$/);if(y)break;var v=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!v){cn("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=v[0];var T=v[1],b=v[2],w=e.properties[T];if(!w){cn("Skipping property: Invalid property name in: "+s),l();continue}var k=r.parse(T,b);if(!k){cn("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:T,val:b}),l()}if(g){o();break}r.selector(d);for(var A=0;A=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:h,strValue:""+e,mapped:f,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var m=this.parse(t,d[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return cn("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var y=g.value,v=m.value,T=y[0]===v[0]&&y[1]===v[1]&&y[2]===v[2]&&(y[3]===v[3]||(y[3]==null||y[3]===1)&&(v[3]==null||v[3]===1));if(T)return!1}return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var b;if(l?b=e.split(/\s+/):wn(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var w=[],k=[],A=[],C="",_=!1,L=0;L0?" ":"")+O.strValue}return u.validate&&!u.validate(w,k)?null:u.singleEnum&&_?w.length===1&&hr(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:A,strValue:C,bypass:r,units:k}}var M=function(){for(var J=0;Ju.max||u.strictMax&&e===u.max))return null;var N={name:t,value:e,strValue:""+e+(z||""),units:z,bypass:r};return u.unitless||z!=="px"&&z!=="em"?N.pfValue=e:N.pfValue=z==="px"||!z?e:this.getEmSizeInPixels()*e,(z==="ms"||z==="s")&&(N.pfValue=z==="ms"?e:1e3*e),(z==="deg"||z==="rad")&&(N.pfValue=z==="rad"?e:RBe(e)),z==="%"&&(N.pfValue=e/100),N}else if(u.propList){var D=[],I=""+e;if(I!=="none"){for(var $=I.split(/\s*,\s*|\s+/),B=0;B<$.length;B++){var P=$[B].trim();i.properties[P]?D.push(P):cn("`"+P+"` is not a valid property name")}if(D.length===0)return null}return{name:t,value:D,strValue:D.length===0?"none":D.join(" "),bypass:r}}else if(u.color){var G=Qj(e);return G?{name:t,value:G,pfValue:G,strValue:"rgb("+G[0]+","+G[1]+","+G[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var V=M();if(V)return V}for(var Y=u.regexes?u.regexes:[u.regex],W=0;W0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,i=r.zoom,a,s,o=!1;if(r.zoomingEnabled||(o=!0),Gt(e)?s=e:Kr(e)&&(s=e.level,e.position!=null?a=v5(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=sr.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;Gt(u.x)&&(r.pan.x=u.x,o=!1),Gt(u.y)&&(r.pan.y=u.y,o=!1),o||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(hr(e)){var n=e;e=this.mutableElements().filter(n)}else Hs(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(a-r*(i.x1+i.x2))/2,y:(s-r*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?(function(){var i=n.window().getComputedStyle(r),a=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};$d.centre=$d.center,$d.autolockNodes=$d.autolock,$d.autoungrabifyNodes=$d.autoungrabify;var ex={data:un.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:un.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:un.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:un.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ex.attr=ex.data,ex.removeAttr=ex.removeData;var tx=function(e){var r=this;e=yr({},e);var n=e.container;n&&!c5(n)&&c5(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var s=zi!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=yr({name:s?"grid":"null"},o.layout),o.renderer=yr({name:s?"canvas":"null"},o.renderer);var l=function(g,m,y){return m!==void 0?m:y!==void 0?y:g},u=this._private={container:n,ready:!1,options:o,elements:new fa(this),listeners:[],aniEles:new fa(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:Gt(o.zoom)?o.zoom:1,pan:{x:Kr(o.pan)&&Gt(o.pan.x)?o.pan.x:0,y:Kr(o.pan)&&Gt(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(g,m){var y=g.some(CPe);if(y)return Lp.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=yr({},o,o.renderer);r.initRenderer(d);var f=function(g,m,y){r.notifications(!1);var v=r.mutableElements();v.length>0&&v.remove(),g!=null&&(Kr(g)||wn(g))&&r.add(g),r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var T=yr({},r._private.options.layout);T.eles=r.elements(),r.layout(T).run()};h([o.style,o.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,jn(o.ready)&&r.on("ready",o.ready);for(var y=0;y0,o=!!t.boundingBox,l=ja(o?t.boundingBox:structuredClone(e.extent())),u;if(Hs(t.roots))u=t.roots;else if(wn(t.roots)){for(var h=[],d=0;d0;){var S=F(),R=L(S,M);if(R)S.outgoers().filter(function(ve){return ve.isNode()&&r.has(ve)}).forEach(z);else if(R===null){cn("Detected double maximal shift for node `"+S.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var N=0;if(t.avoidOverlap)for(var D=0;D0&&v[0].length<=3?Ve/2:0),nt=2*Math.PI/v[Ze].length*ke;return Ze===0&&v[0].length===1&&(Qe=1),{x:ne.x+Qe*Math.cos(nt),y:ne.y+Qe*Math.sin(nt)}}else{var tt=v[Ze].length,je=Math.max(tt===1?0:o?(l.w-t.padding*2-ue.w)/((t.grid?_e:tt)-1):(l.w-t.padding*2-ue.w)/((t.grid?_e:tt)+1),N),Ce={x:ne.x+(ke+1-(tt+1)/2)*je,y:ne.y+(Ze+1-(W+1)/2)*fe};return Ce}},Ne={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Ne).indexOf(t.direction)===-1&&Hn("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Ne).join(", ")));var me=function(Ge){return QPe(Ae(Ge),l,Ne[t.direction])};return r.nodes().layoutPositions(this,t,me),this};var BGe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function jJ(t){this.options=yr({},BGe,t)}jJ.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s=ja(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,u=l/Math.max(1,a.length-1),h,d=0,f=0;f1&&e.avoidOverlap){d*=1.75;var v=Math.cos(u)-Math.cos(0),T=Math.sin(u)-Math.sin(0),b=Math.sqrt(d*d/(v*v+T*T));h=Math.max(b,h)}var w=function(A,C){var _=e.startAngle+C*u*(i?1:-1),L=h*Math.cos(_),O=h*Math.sin(_),M={x:o.x+L,y:o.y+O};return M};return n.nodes().layoutPositions(this,e,w),this};var FGe={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function ZJ(t){this.options=yr({},FGe,t)}ZJ.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=ja(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,h=0;h0){var k=Math.abs(T[0].value-w.value);k>=y&&(T=[],v.push(T))}T.push(w)}var A=u+e.minNodeSpacing;if(!e.avoidOverlap){var C=v.length>0&&v[0].length>1,_=Math.min(s.w,s.h)/2-A,L=_/(v.length+C?1:0);A=Math.min(A,L)}for(var O=0,M=0;M1&&e.avoidOverlap){var R=Math.cos(S)-Math.cos(0),N=Math.sin(S)-Math.sin(0),D=Math.sqrt(A*A/(R*R+N*N));O=Math.max(D,O)}z.r=O,O+=A}if(e.equidistant){for(var I=0,$=0,B=0;B=t.numIter||(HGe(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),f5(h)}};h()}else{for(;u;)u=s(l),l++;ree(n,t),o()}return this},j5.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},j5.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var GGe=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=ja(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=n.eles.components(),u={},h=0;h0){o.graphSet.push(_);for(var h=0;h<_.length;h++)v[++b]=_[h]}}for(var h=0;hi.count?0:i.graph},QJ=function(e,r,n,i){var a=i.graphSet[n];if(-10)var d=i.nodeOverlap*h,f=Math.sqrt(o*o+l*l),p=d*o/f,g=d*l/f;else var m=Z5(e,o,l),y=Z5(r,-1*o,-1*l),v=y.x-m.x,T=y.y-m.y,b=v*v+T*T,f=Math.sqrt(b),d=(e.nodeRepulsion+r.nodeRepulsion)/b,p=d*v/f,g=d*T/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},KGe=function(e,r,n,i){if(n>0)var a=e.maxX-r.minX;else var a=r.maxX-e.minX;if(i>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},Z5=function(e,r,n){var i=e.positionX,a=e.positionY,s=e.height||1,o=e.width||1,l=n/r,u=s/o,h={};return r===0&&0n?(h.x=i,h.y=a+s/2,h):0r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=a-o*n/2/r,h):0=u)?(h.x=i+s*r/2/n,h.y=a+s/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-s*r/2/n,h.y=a-s/2),h)},jGe=function(e,r){for(var n=0;nn){var y=r.gravity*p/m,v=r.gravity*g/m;f.offsetX+=y,f.offsetY+=v}}}}},QGe=function(e,r){var n=[],i=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;i<=a;){var s=n[i++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},tee=function(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],a=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(i.minX==null||e.minX-i.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTopv&&(g+=y+r.componentSpacing,p=0,m=0,y=0)}}},tqe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function nee(t){this.options=yr({},tqe,t)}nee.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=ja(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,e,function(V){return{x:a.x1,y:a.y1}});else{var s=i.size(),o=Math.sqrt(s*a.h/a.w),l=Math.round(o),u=Math.round(a.w/a.h*o),h=function(Y){if(Y==null)return Math.min(l,u);var W=Math.min(l,u);W==l?l=Y:u=Y},d=function(Y){if(Y==null)return Math.max(l,u);var W=Math.max(l,u);W==l?l=Y:u=Y},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(s/l);else if(f==null&&p!=null)u=p,l=Math.ceil(s/u);else if(u*l>s){var g=h(),m=d();(g-1)*m>=s?h(g-1):(m-1)*g>=s&&d(m-1)}else for(;u*l=s?d(v+1):h(y+1)}var T=a.w/u,b=a.h/l;if(e.condense&&(T=0,b=0),e.avoidOverlap)for(var w=0;w=u&&(R=0,S++)},D={},I=0;I(R=VBe(t,e,N[D],N[D+1],N[D+2],N[D+3])))return y(C,R),!0}else if(L.edgeType==="bezier"||L.edgeType==="multibezier"||L.edgeType==="self"||L.edgeType==="compound"){for(var N=L.allpts,D=0;D+5(R=qBe(t,e,N[D],N[D+1],N[D+2],N[D+3],N[D+4],N[D+5])))return y(C,R),!0}for(var I=I||_.source,$=$||_.target,B=i.getArrowWidth(O,M),P=[{name:"source",x:L.arrowStartX,y:L.arrowStartY,angle:L.srcArrowAngle},{name:"target",x:L.arrowEndX,y:L.arrowEndY,angle:L.tgtArrowAngle},{name:"mid-source",x:L.midX,y:L.midY,angle:L.midsrcArrowAngle},{name:"mid-target",x:L.midX,y:L.midY,angle:L.midtgtArrowAngle}],D=0;D0&&(v(I),v($))}function b(C,_,L){return Ka(C,_,L)}function w(C,_){var L=C._private,O=f,M;_?M=_+"-":M="",C.boundingBox();var z=L.labelBounds[_||"main"],F=C.pstyle(M+"label").value,S=C.pstyle("text-events").strValue==="yes";if(!(!S||!F)){var R=b(L.rscratch,"labelX",_),N=b(L.rscratch,"labelY",_),D=b(L.rscratch,"labelAngle",_),I=C.pstyle(M+"text-margin-x").pfValue,$=C.pstyle(M+"text-margin-y").pfValue,B=z.x1-O-I,P=z.x2+O-I,G=z.y1-O-$,V=z.y2+O-$;if(D){var Y=Math.cos(D),W=Math.sin(D),ie=function(ue,fe){return ue=ue-R,fe=fe-N,{x:ue*Y-fe*W+R,y:ue*W+fe*Y+N}},K=ie(B,G),se=ie(B,V),J=ie(P,G),Z=ie(P,V),ee=[K.x+I,K.y+$,J.x+I,J.y+$,Z.x+I,Z.y+$,se.x+I,se.y+$];if(Cs(t,e,ee))return y(C),!0}else if(Qu(z,t,e))return y(C),!0}}for(var k=s.length-1;k>=0;k--){var A=s[k];A.isNode()?v(A)||w(A):T(A)||w(A)||w(A,"source")||w(A,"target")}return o},Pd.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,o=[],l=Math.min(t,r),u=Math.max(t,r),h=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=h,n=d;var f=ja({x1:t,y1:e,x2:r,y2:n}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],g=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function m(ue,fe,_e){return Ka(ue,fe,_e)}function y(ue,fe){var _e=ue._private,Ae=s,Ne="";ue.boundingBox();var me=_e.labelBounds.main;if(!me)return null;var ve=m(_e.rscratch,"labelX",fe),Ge=m(_e.rscratch,"labelY",fe),Te=m(_e.rscratch,"labelAngle",fe),Ze=ue.pstyle(Ne+"text-margin-x").pfValue,ke=ue.pstyle(Ne+"text-margin-y").pfValue,Ve=me.x1-Ae-Ze,Qe=me.x2+Ae-Ze,nt=me.y1-Ae-ke,tt=me.y2+Ae-ke;if(Te){var je=Math.cos(Te),Ce=Math.sin(Te),Se=function(he,j){return he=he-ve,j=j-Ge,{x:he*je-j*Ce+ve,y:he*Ce+j*je+Ge}};return[Se(Ve,nt),Se(Qe,nt),Se(Qe,tt),Se(Ve,tt)]}else return[{x:Ve,y:nt},{x:Qe,y:nt},{x:Qe,y:tt},{x:Ve,y:tt}]}function v(ue,fe,_e,Ae){function Ne(me,ve,Ge){return(Ge.y-me.y)*(ve.x-me.x)>(ve.y-me.y)*(Ge.x-me.x)}return Ne(ue,_e,Ae)!==Ne(fe,_e,Ae)&&Ne(ue,fe,_e)!==Ne(ue,fe,Ae)}for(var T=0;T0?-(Math.PI-e.ang):Math.PI+e.ang},oqe=function(e,r,n,i,a){if(e!==fee?pee(r,e,Dl):sqe(po,Dl),pee(r,n,po),cee=Dl.nx*po.ny-Dl.ny*po.nx,uee=Dl.nx*po.nx-Dl.ny*-po.ny,Fc=Math.asin(Math.max(-1,Math.min(1,cee))),Math.abs(Fc)<1e-6){qL=r.x,VL=r.y,zd=Gp=0;return}Bd=1,J5=!1,uee<0?Fc<0?Fc=Math.PI+Fc:(Fc=Math.PI-Fc,Bd=-1,J5=!0):Fc>0&&(Bd=-1,J5=!0),r.radius!==void 0?Gp=r.radius:Gp=i,Fd=Fc/2,e3=Math.min(Dl.len/2,po.len/2),a?(Ml=Math.abs(Math.cos(Fd)*Gp/Math.sin(Fd)),Ml>e3?(Ml=e3,zd=Math.abs(Ml*Math.sin(Fd)/Math.cos(Fd))):zd=Gp):(Ml=Math.min(e3,Gp),zd=Math.abs(Ml*Math.sin(Fd)/Math.cos(Fd))),WL=r.x+po.nx*Ml,UL=r.y+po.ny*Ml,qL=WL-po.ny*zd*Bd,VL=UL+po.nx*zd*Bd,hee=r.x+Dl.nx*Ml,dee=r.y+Dl.ny*Ml,fee=r};function gee(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function HL(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(oqe(t,e,r,n,i),{cx:qL,cy:VL,radius:zd,startX:hee,startY:dee,stopX:WL,stopY:UL,startAngle:Dl.ang+Math.PI/2*Bd,endAngle:po.ang-Math.PI/2*Bd,counterClockwise:J5})}var rx=.01,lqe=Math.sqrt(2*rx),Na={};Na.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(k,A,C,_){var L=_-A,O=C-k,M=Math.sqrt(O*O+L*L);return{x:-L/M,y:O/M}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],s),f=Ri(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),y=Ri(m,2),v=y[0],T=y[1],b={x1:p,y1:g,x2:v,y2:T};i=u(p,g,v,T),a=b}else cn("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}},Na.findHaystackPoints=function(t){for(var e=0;e0?Math.max(j-pe,0):Math.min(j+pe,0)},F=z(O,_),S=z(M,L),R=!1;T===u?v=Math.abs(F)>Math.abs(S)?i:n:T===l||T===o?(v=n,R=!0):(T===a||T===s)&&(v=i,R=!0);var N=v===n,D=N?S:F,I=N?M:O,$=gR(I),B=!1;!(R&&(w||A))&&(T===o&&I<0||T===l&&I>0||T===a&&I>0||T===s&&I<0)&&($*=-1,D=$*Math.abs(D),B=!0);var P;if(w){var G=k<0?1+k:k;P=G*D}else{var V=k<0?D:0;P=V+k*$}var Y=function(j){return Math.abs(j)=Math.abs(D)},W=Y(P),ie=Y(Math.abs(D)-Math.abs(P)),K=W||ie;if(K&&!B)if(N){var se=Math.abs(I)<=f/2,J=Math.abs(O)<=p/2;if(se){var Z=(h.x1+h.x2)/2,ee=h.y1,ne=h.y2;r.segpts=[Z,ee,Z,ne]}else if(J){var ue=(h.y1+h.y2)/2,fe=h.x1,_e=h.x2;r.segpts=[fe,ue,_e,ue]}else r.segpts=[h.x1,h.y2]}else{var Ae=Math.abs(I)<=d/2,Ne=Math.abs(M)<=g/2;if(Ae){var me=(h.y1+h.y2)/2,ve=h.x1,Ge=h.x2;r.segpts=[ve,me,Ge,me]}else if(Ne){var Te=(h.x1+h.x2)/2,Ze=h.y1,ke=h.y2;r.segpts=[Te,Ze,Te,ke]}else r.segpts=[h.x2,h.y1]}else if(N){var Ve=h.y1+P+(y?f/2*$:0),Qe=h.x1,nt=h.x2;r.segpts=[Qe,Ve,nt,Ve]}else{var tt=h.x1+P+(y?d/2*$:0),je=h.y1,Ce=h.y2;r.segpts=[tt,je,tt,Ce]}if(r.isRound){var Se=t.pstyle("taxi-radius").value,H=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(Se),r.isArcRadius=new Array(r.segpts.length/2).fill(H)}},Na.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!Gt(r.startX)||!Gt(r.startY),y=!Gt(r.arrowStartX)||!Gt(r.arrowStartY),v=!Gt(r.endX)||!Gt(r.endY),T=!Gt(r.arrowEndX)||!Gt(r.arrowEndY),b=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,k=b*w,A=Dd({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),C=AI.poolIndex()){var $=D;D=I,I=$}var B=F.srcPos=D.position(),P=F.tgtPos=I.position(),G=F.srcW=D.outerWidth(),V=F.srcH=D.outerHeight(),Y=F.tgtW=I.outerWidth(),W=F.tgtH=I.outerHeight(),ie=F.srcShape=r.nodeShapes[e.getNodeShape(D)],K=F.tgtShape=r.nodeShapes[e.getNodeShape(I)],se=F.srcCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,J=F.tgtCornerRadius=I.pstyle("corner-radius").value==="auto"?"auto":I.pstyle("corner-radius").pfValue,Z=F.tgtRs=I._private.rscratch,ee=F.srcRs=D._private.rscratch;F.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ne=0;ne=lqe||(nt=Math.sqrt(Math.max(Qe*Qe,rx)+Math.max(Ve*Ve,rx)));var tt=F.vector={x:Qe,y:Ve},je=F.vectorNorm={x:tt.x/nt,y:tt.y/nt},Ce={x:-je.y,y:je.x};F.nodesOverlap=!Gt(nt)||K.checkPoint(me[0],me[1],0,Y,W,P.x,P.y,J,Z)||ie.checkPoint(Ge[0],Ge[1],0,G,V,B.x,B.y,se,ee),F.vectorNormInverse=Ce,S={nodesOverlap:F.nodesOverlap,dirCounts:F.dirCounts,calculatedIntersection:!0,hasBezier:F.hasBezier,hasUnbundled:F.hasUnbundled,eles:F.eles,srcPos:P,srcRs:Z,tgtPos:B,tgtRs:ee,srcW:Y,srcH:W,tgtW:G,tgtH:V,srcIntn:Te,tgtIntn:ve,srcShape:K,tgtShape:ie,posPts:{x1:ke.x2,y1:ke.y2,x2:ke.x1,y2:ke.y1},intersectionPts:{x1:Ze.x2,y1:Ze.y2,x2:Ze.x1,y2:Ze.y1},vector:{x:-tt.x,y:-tt.y},vectorNorm:{x:-je.x,y:-je.y},vectorNormInverse:{x:-Ce.x,y:-Ce.y}}}var Se=Ne?S:F;fe.nodesOverlap=Se.nodesOverlap,fe.srcIntn=Se.srcIntn,fe.tgtIntn=Se.tgtIntn,fe.isRound=_e.startsWith("round"),i&&(D.isParent()||D.isChild()||I.isParent()||I.isChild())&&(D.parents().anySame(I)||I.parents().anySame(D)||D.same(I)&&D.isParent())?e.findCompoundLoopPoints(ue,Se,ne,Ae):D===I?e.findLoopPoints(ue,Se,ne,Ae):_e.endsWith("segments")?e.findSegmentsPoints(ue,Se):_e.endsWith("taxi")?e.findTaxiPoints(ue,Se):_e==="straight"||!Ae&&F.eles.length%2===1&&ne===Math.floor(F.eles.length/2)?e.findStraightEdgePoints(ue):e.findBezierPoints(ue,Se,ne,Ae,Ne),e.findEndpoints(ue),e.tryToCorrectInvalidPoints(ue,Se),e.checkForInvalidEdgeWarning(ue),e.storeAllpts(ue),e.storeEdgeProjections(ue),e.calculateArrowAngles(ue),e.recalculateEdgeLabelProjections(ue),e.calculateLabelAngles(ue)}},C=0;C0){var me=u,ve=Md(me,kp(s)),Ge=Md(me,kp(Ne)),Te=ve;if(Ge2){var Ze=Md(me,{x:Ne[2],y:Ne[3]});Ze0){var re=h,Be=Md(re,kp(s)),xe=Md(re,kp(pe)),Ue=Be;if(xe2){var De=Md(re,{x:pe[2],y:pe[3]});De=g||C){y={cp:w,segment:A};break}}if(y)break}var _=y.cp,L=y.segment,O=(g-v)/L.length,M=L.t1-L.t0,z=p?L.t0+M*O:L.t1-M*O;z=Gb(0,z,1),e=Ep(_.p0,_.p1,_.p2,z),f=uqe(_.p0,_.p1,_.p2,z);break}case"straight":case"segments":case"haystack":{for(var F=0,S,R,N,D,I=n.allpts.length,$=0;$+3=g));$+=2);var B=g-R,P=B/S;P=Gb(0,P,1),e=IBe(N,D,P),f=vee(N,D);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}},Nl.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},Nl.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=Id(n,t._private.labelDimsKey);if(Ka(r.rscratch,"prefixedLabelDimsKey",e)!==i){Ll(r.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(t,n),s=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=Ka(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=o*s,f=a.width,p=a.height+(h-1)*(s-1)*o;Ll(r.rstyle,"labelWidth",e,f),Ll(r.rscratch,"labelWidth",e,f),Ll(r.rstyle,"labelHeight",e,p),Ll(r.rscratch,"labelHeight",e,p),Ll(r.rscratch,"labelLineHeight",e,d),Ll(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}},Nl.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=function(V,Y){return Y?(Ll(r.rscratch,V,e,Y),Y):Ka(r.rscratch,V,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="​",h=i.split(` -`),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,p=f==="anywhere",g=[],m=/[\s\u200b]+|$/g,y=0;yd){var k=v.matchAll(m),A="",C=0,_=ws(k),L;try{for(_.s();!(L=_.n()).done;){var O=L.value,M=O[0],z=v.substring(C,O.index);C=O.index+M.length;var F=A.length===0?z:A+z+M,S=this.calculateLabelDimensions(t,F),R=S.width;R<=d?A+=z+M:(A&&g.push(A),A=z+M)}}catch(G){_.e(G)}finally{_.f()}A.match(/^[\s\u200b]+$/)||g.push(A)}else g.push(v)}s("labelWrapCachedLines",g),i=s("labelWrapCachedText",g.join(` -`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var N=t.pstyle("text-max-width").pfValue,D="",I="…",$=!1;if(this.calculateLabelDimensions(t,i).widthN)break;D+=i[B],B===i.length-1&&($=!0)}return $||(D+=I),D}return i},Nl.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?Zze(r):"center":e},Nl.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,a=0,s=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,h=t.pstyle("text-metrics").strValue||"font",d=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=i.createElement("canvas"),f=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}f.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var g=0,m=0,y=e.split(` -`),v=y.length,T=0,b=0,w=0;w1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var xt=a(H);lt&&(t.hoverData.tapholdCancelled=!0);var ht=function(){var Ft=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Ft.length===0?(Ft.push(it[0]),Ft.push(it[1])):(Ft[0]+=it[0],Ft[1]+=it[1])};j=!0,i(Le,["mousemove","vmousemove","tapdrag"],H,{x:xe[0],y:xe[1]});var oe=function(Ft){return{originalEvent:H,type:Ft,position:{x:xe[0],y:xe[1]}}},At=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||pe.emit(oe("boxstart")),qe[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(lt){var dt=oe("cxtdrag");Ie?Ie.emit(dt):pe.emit(dt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Le!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(oe("cxtdragout")),t.hoverData.cxtOver=Le,Le&&Le.emit(oe("cxtdragover")))}}else if(t.hoverData.dragging){if(j=!0,pe.panningEnabled()&&pe.userPanningEnabled()){var ut;if(t.hoverData.justStartedPan){var wt=t.hoverData.mdownPos;ut={x:(xe[0]-wt[0])*re,y:(xe[1]-wt[1])*re},t.hoverData.justStartedPan=!1}else ut={x:it[0]*re,y:it[1]*re};pe.panBy(ut),pe.emit(oe("dragpan")),t.hoverData.dragged=!0}xe=t.projectIntoViewport(H.clientX,H.clientY)}else if(qe[4]==1&&(Ie==null||Ie.pannable())){if(lt){if(!t.hoverData.dragging&&pe.boxSelectionEnabled()&&(xt||!pe.panningEnabled()||!pe.userPanningEnabled()))At();else if(!t.hoverData.selecting&&pe.panningEnabled()&&pe.userPanningEnabled()){var Mr=s(Ie,t.hoverData.downs);Mr&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,qe[4]=0,t.data.bgActivePosistion=kp(Ue),t.redrawHint("select",!0),t.redraw())}Ie&&Ie.pannable()&&Ie.active()&&Ie.unactivate()}}else{if(Ie&&Ie.pannable()&&Ie.active()&&Ie.unactivate(),(!Ie||!Ie.grabbed())&&Le!=Xe&&(Xe&&i(Xe,["mouseout","tapdragout"],H,{x:xe[0],y:xe[1]}),Le&&i(Le,["mouseover","tapdragover"],H,{x:xe[0],y:xe[1]}),t.hoverData.last=Le),Ie)if(lt){if(pe.boxSelectionEnabled()&&xt)Ie&&Ie.grabbed()&&(m(we),Ie.emit(oe("freeon")),we.emit(oe("free")),t.dragData.didDrag&&(Ie.emit(oe("dragfreeon")),we.emit(oe("dragfree")))),At();else if(Ie&&Ie.grabbed()&&t.nodeIsDraggable(Ie)){var ye=!t.dragData.didDrag;ye&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(we,{inDragLayer:!0});var et={x:0,y:0};if(Gt(it[0])&&Gt(it[1])&&(et.x+=it[0],et.y+=it[1],ye)){var ct=t.hoverData.dragDelta;ct&&Gt(ct[0])&&Gt(ct[1])&&(et.x+=ct[0],et.y+=ct[1])}t.hoverData.draggingEles=!0,we.silentShift(et).emit(oe("position")).emit(oe("drag")),t.redrawHint("drag",!0),t.redraw()}}else ht();j=!0}if(qe[2]=xe[0],qe[3]=xe[1],j)return H.stopPropagation&&H.stopPropagation(),H.preventDefault&&H.preventDefault(),!1}},!1);var O,M,z;t.registerBinding(e,"mouseup",function(H){if(!(t.hoverData.which===1&&H.which!==1&&t.hoverData.capture)){var he=t.hoverData.capture;if(he){t.hoverData.capture=!1;var j=t.cy,pe=t.projectIntoViewport(H.clientX,H.clientY),re=t.selection,Be=t.findNearestElement(pe[0],pe[1],!0,!1),xe=t.dragData.possibleDragElements,Ue=t.hoverData.down,De=a(H);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Ue&&Ue.unactivate();var qe=function(be){return{originalEvent:H,type:be,position:{x:pe[0],y:pe[1]}}};if(t.hoverData.which===3){var Le=qe("cxttapend");if(Ue?Ue.emit(Le):j.emit(Le),!t.hoverData.cxtDragged){var Xe=qe("cxttap");Ue?Ue.emit(Xe):j.emit(Xe)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(Be,["mouseup","tapend","vmouseup"],H,{x:pe[0],y:pe[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Ue,["click","tap","vclick"],H,{x:pe[0],y:pe[1]}),M=!1,H.timeStamp-z<=j.multiClickDebounceTime()?(O&&clearTimeout(O),M=!0,z=null,i(Ue,["dblclick","dbltap","vdblclick"],H,{x:pe[0],y:pe[1]})):(O=setTimeout(function(){M||i(Ue,["oneclick","onetap","voneclick"],H,{x:pe[0],y:pe[1]})},j.multiClickDebounceTime()),z=H.timeStamp)),Ue==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(H)&&(j.$(r).unselect(["tapunselect"]),xe.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=xe=j.collection()),Be==Ue&&!t.dragData.didDrag&&!t.hoverData.selecting&&Be!=null&&Be._private.selectable&&(t.hoverData.dragging||(j.selectionType()==="additive"||De?Be.selected()?Be.unselect(["tapunselect"]):Be.select(["tapselect"]):De||(j.$(r).unmerge(Be).unselect(["tapunselect"]),Be.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ie=j.collection(t.getAllInBox(re[0],re[1],re[2],re[3]));t.redrawHint("select",!0),Ie.length>0&&t.redrawHint("eles",!0),j.emit(qe("boxend"));var it=function(be){return be.selectable()&&!be.selected()};j.selectionType()==="additive"||De||j.$(r).unmerge(Ie).unselect(),Ie.emit(qe("box")).stdFilter(it).select().emit(qe("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!re[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var we=Ue&&Ue.grabbed();m(xe),we&&(Ue.emit(qe("freeon")),xe.emit(qe("free")),t.dragData.didDrag&&(Ue.emit(qe("dragfreeon")),xe.emit(qe("dragfree"))))}}re[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var F=[],S=4,R,N=1e5,D=function(H,he){for(var j=0;j=S){var pe=F;if(R=D(pe,5),!R){var re=Math.abs(pe[0]);R=I(pe)&&re>5}if(R)for(var Be=0;Be5&&(j=gR(j)*5),Xe=j/-250,R&&(Xe/=N,Xe*=3),Xe=Xe*t.wheelSensitivity;var Ie=H.deltaMode===1;Ie&&(Xe*=33);var it=xe.zoom()*Math.pow(10,Xe);H.type==="gesturechange"&&(it=t.gestureStartZoom*H.scale),xe.zoom({level:it,renderedPosition:{x:Le[0],y:Le[1]}}),xe.emit({type:H.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:H,position:{x:qe[0],y:qe[1]}})}}}};t.registerBinding(t.container,"wheel",$,!0),t.registerBinding(e,"scroll",function(H){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(H){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||H.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(Se){t.hasTouchStarted||$(Se)},!0),t.registerBinding(t.container,"mouseout",function(H){var he=t.projectIntoViewport(H.clientX,H.clientY);t.cy.emit({originalEvent:H,type:"mouseout",position:{x:he[0],y:he[1]}})},!1),t.registerBinding(t.container,"mouseover",function(H){var he=t.projectIntoViewport(H.clientX,H.clientY);t.cy.emit({originalEvent:H,type:"mouseover",position:{x:he[0],y:he[1]}})},!1);var B,P,G,V,Y,W,ie,K,se,J,Z,ee,ne,ue=function(H,he,j,pe){return Math.sqrt((j-H)*(j-H)+(pe-he)*(pe-he))},fe=function(H,he,j,pe){return(j-H)*(j-H)+(pe-he)*(pe-he)},_e;t.registerBinding(t.container,"touchstart",_e=function(H){if(t.hasTouchStarted=!0,!!_(H)){v(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var he=t.cy,j=t.touchData.now,pe=t.touchData.earlier;if(H.touches[0]){var re=t.projectIntoViewport(H.touches[0].clientX,H.touches[0].clientY);j[0]=re[0],j[1]=re[1]}if(H.touches[1]){var re=t.projectIntoViewport(H.touches[1].clientX,H.touches[1].clientY);j[2]=re[0],j[3]=re[1]}if(H.touches[2]){var re=t.projectIntoViewport(H.touches[2].clientX,H.touches[2].clientY);j[4]=re[0],j[5]=re[1]}var Be=function(xt){return{originalEvent:H,type:xt,position:{x:j[0],y:j[1]}}};if(H.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var xe=t.findContainerClientCoords();se=xe[0],J=xe[1],Z=xe[2],ee=xe[3],B=H.touches[0].clientX-se,P=H.touches[0].clientY-J,G=H.touches[1].clientX-se,V=H.touches[1].clientY-J,ne=0<=B&&B<=Z&&0<=G&&G<=Z&&0<=P&&P<=ee&&0<=V&&V<=ee;var Ue=he.pan(),De=he.zoom();Y=ue(B,P,G,V),W=fe(B,P,G,V),ie=[(B+G)/2,(P+V)/2],K=[(ie[0]-Ue.x)/De,(ie[1]-Ue.y)/De];var qe=200,Le=qe*qe;if(W=1){for(var Et=t.touchData.startPosition=[null,null,null,null,null,null],vt=0;vt=t.touchTapThreshold2}if(he&&t.touchData.cxt){H.preventDefault();var vt=H.touches[0].clientX-se,ot=H.touches[0].clientY-J,It=H.touches[1].clientX-se,xt=H.touches[1].clientY-J,ht=fe(vt,ot,It,xt),oe=ht/W,At=150,dt=At*At,ut=1.5,wt=ut*ut;if(oe>=wt||ht>=dt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Mr=De("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Mr),t.touchData.start=null):pe.emit(Mr)}}if(he&&t.touchData.cxt){var Mr=De("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Mr):pe.emit(Mr),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var ye=t.findNearestElement(re[0],re[1],!0,!0);(!t.touchData.cxtOver||ye!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(De("cxtdragout")),t.touchData.cxtOver=ye,ye&&ye.emit(De("cxtdragover")))}else if(he&&H.touches[2]&&pe.boxSelectionEnabled())H.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||pe.emit(De("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,j[4]=1,!j||j.length===0||j[0]===void 0?(j[0]=(re[0]+re[2]+re[4])/3,j[1]=(re[1]+re[3]+re[5])/3,j[2]=(re[0]+re[2]+re[4])/3+1,j[3]=(re[1]+re[3]+re[5])/3+1):(j[2]=(re[0]+re[2]+re[4])/3,j[3]=(re[1]+re[3]+re[5])/3),t.redrawHint("select",!0),t.redraw();else if(he&&H.touches[1]&&!t.touchData.didSelect&&pe.zoomingEnabled()&&pe.panningEnabled()&&pe.userZoomingEnabled()&&pe.userPanningEnabled()){H.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var et=t.dragData.touchDragEles;if(et){t.redrawHint("drag",!0);for(var ct=0;ct0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Ne;t.registerBinding(e,"touchcancel",Ne=function(H){var he=t.touchData.start;t.touchData.capture=!1,he&&he.unactivate()});var me,ve,Ge,Te;if(t.registerBinding(e,"touchend",me=function(H){var he=t.touchData.start,j=t.touchData.capture;if(j)H.touches.length===0&&(t.touchData.capture=!1),H.preventDefault();else return;var pe=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var re=t.cy,Be=re.zoom(),xe=t.touchData.now,Ue=t.touchData.earlier;if(H.touches[0]){var De=t.projectIntoViewport(H.touches[0].clientX,H.touches[0].clientY);xe[0]=De[0],xe[1]=De[1]}if(H.touches[1]){var De=t.projectIntoViewport(H.touches[1].clientX,H.touches[1].clientY);xe[2]=De[0],xe[3]=De[1]}if(H.touches[2]){var De=t.projectIntoViewport(H.touches[2].clientX,H.touches[2].clientY);xe[4]=De[0],xe[5]=De[1]}var qe=function(dt){return{originalEvent:H,type:dt,position:{x:xe[0],y:xe[1]}}};he&&he.unactivate();var Le;if(t.touchData.cxt){if(Le=qe("cxttapend"),he?he.emit(Le):re.emit(Le),!t.touchData.cxtDragged){var Xe=qe("cxttap");he?he.emit(Xe):re.emit(Xe)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!H.touches[2]&&re.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ie=re.collection(t.getAllInBox(pe[0],pe[1],pe[2],pe[3]));pe[0]=void 0,pe[1]=void 0,pe[2]=void 0,pe[3]=void 0,pe[4]=0,t.redrawHint("select",!0),re.emit(qe("boxend"));var it=function(dt){return dt.selectable()&&!dt.selected()};Ie.emit(qe("box")).stdFilter(it).select().emit(qe("boxselect")),Ie.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(he!=null&&he.unactivate(),H.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!H.touches[1]){if(!H.touches[0]){if(!H.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var we=t.dragData.touchDragEles;if(he!=null){var lt=he._private.grabbed;m(we),t.redrawHint("drag",!0),t.redrawHint("eles",!0),lt&&(he.emit(qe("freeon")),we.emit(qe("free")),t.dragData.didDrag&&(he.emit(qe("dragfreeon")),we.emit(qe("dragfree")))),i(he,["touchend","tapend","vmouseup","tapdragout"],H,{x:xe[0],y:xe[1]}),he.unactivate(),t.touchData.start=null}else{var be=t.findNearestElement(xe[0],xe[1],!0,!0);i(be,["touchend","tapend","vmouseup","tapdragout"],H,{x:xe[0],y:xe[1]})}var Et=t.touchData.startPosition[0]-xe[0],vt=Et*Et,ot=t.touchData.startPosition[1]-xe[1],It=ot*ot,xt=vt+It,ht=xt*Be*Be;t.touchData.singleTouchMoved||(he||re.$(":selected").unselect(["tapunselect"]),i(he,["tap","vclick"],H,{x:xe[0],y:xe[1]}),ve=!1,H.timeStamp-Te<=re.multiClickDebounceTime()?(Ge&&clearTimeout(Ge),ve=!0,Te=null,i(he,["dbltap","vdblclick"],H,{x:xe[0],y:xe[1]})):(Ge=setTimeout(function(){ve||i(he,["onetap","voneclick"],H,{x:xe[0],y:xe[1]})},re.multiClickDebounceTime()),Te=H.timeStamp)),he!=null&&!t.dragData.didDrag&&he._private.selectable&&ht"u"){var Ze=[],ke=function(H){return{clientX:H.clientX,clientY:H.clientY,force:1,identifier:H.pointerId,pageX:H.pageX,pageY:H.pageY,radiusX:H.width/2,radiusY:H.height/2,screenX:H.screenX,screenY:H.screenY,target:H.target}},Ve=function(H){return{event:H,touch:ke(H)}},Qe=function(H){Ze.push(Ve(H))},nt=function(H){for(var he=0;he0)return G[0]}return null},g=Object.keys(f),m=0;m0?p:OZ(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?eh(i,a):l;var u=2*l;if(Bc(e,r,this.points,s,o,i,a-u,[0,-1],n)||Bc(e,r,this.points,s,o,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(Cs(e,r,f)||Nd(e,r,u,u,s+i/2-l,o+a/2-l,n)||Nd(e,r,u,u,s-i/2+l,o+a/2-l,n))}}},zc.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Za(3,0)),this.generateRoundPolygon("round-triangle",Za(3,0)),this.generatePolygon("rectangle",Za(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Za(5,0)),this.generateRoundPolygon("round-pentagon",Za(5,0)),this.generatePolygon("hexagon",Za(6,0)),this.generateRoundPolygon("round-hexagon",Za(6,0)),this.generatePolygon("heptagon",Za(7,0)),this.generateRoundPolygon("round-heptagon",Za(7,0)),this.generatePolygon("octagon",Za(8,0)),this.generateRoundPolygon("round-octagon",Za(8,0));var n=new Array(20);{var i=vR(5,0),a=vR(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*w)break}else if(u){if(T>=e.deqCost*p||T>=e.deqAvgCost*f)break}else if(b>=e.deqNoDrawCost*XL)break;var k=e.deq(n,y,m);if(k.length>0)for(var A=0;A0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,y,m)&&a())},o=e.priority||cR;i.beforeRender(s,o(n))}}}},pqe=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g5;Hu(this,t),this.idsByKey=new Pc,this.keyForId=new Pc,this.cachesByLvl=new Pc,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Yu(t,[{key:"getIdsFor",value:function(r){r==null&&Hn("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new Cp,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new Pc,n.set(r,a),i.push(r)),a}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])})(),_ee=25,n3=50,i3=-4,KL=3,Ree=7.99,gqe=8,mqe=1024,yqe=1024,vqe=1024,bqe=.2,xqe=.8,Tqe=10,wqe=.15,Cqe=.1,kqe=.9,Eqe=.9,Sqe=100,Aqe=1,Wp={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},_qe=ha({getKey:null,doesEleInvalidateKey:g5,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:wZ,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ax=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=_qe(r);yr(n,i),n.lookup=new pqe(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},qi=ax.prototype;qi.reasons=Wp,qi.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},qi.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},qi.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new zb(function(r,n){return n.reqs-r.reqs});return e},qi.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},qi.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(pR(o*r))),n=Ree||n>KL)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=_ee?g=_ee:h<=n3?g=n3:g=Math.ceil(h/n3)*n3,h>vqe||d>yqe)return null;var m=a.getTextureQueue(g),y=m[m.length-2],v=function(){return a.recycleTexture(g,d)||a.addTexture(g,d)};y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidthn;M--)L=a.getElement(t,e,r,M,Wp.downscale);O()}else return a.queueElement(t,A.level-1),A;else{var z;if(!b&&!w&&!k)for(var F=n-1;F>=i3;F--){var S=l.get(t,F);if(S){z=S;break}}if(T(z))return a.queueElement(t,n),z;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,f,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return p={x:y.usedWidth,texture:y,level:n,scale:u,width:d,height:h,scaledLabelShown:f},y.usedWidth+=Math.ceil(d+gqe),y.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(y),p},qi.invalidateElements=function(t){for(var e=0;e=bqe*t.width&&this.retireTexture(t)},qi.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>xqe&&t.fullnessChecks>=Tqe?Zu(r,t):t.fullnessChecks++},qi.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;Zu(n,t),t.retired=!0;for(var a=t.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,uR(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Zu(i,s),n.push(s),s}},qi.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(o),i[a]=o}},qi.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s0;s++){var o=r.pop(),l=o.key,u=o.eles[0],h=a.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,Wp.dequeue)}return i},qi.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=lR,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))},qi.onDequeue=function(t){this.onDequeues.push(t)},qi.offDequeue=function(t){Zu(this.onDequeues,t)},qi.setupDequeueing=Aee.setupDequeueing({deqRedrawThreshold:Sqe,deqCost:wqe,deqAvgCost:Cqe,deqNoDrawCost:kqe,deqFastCost:Eqe,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=Lqe||r>a3)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var O=function(R){if(n.validateLayersElesOrdering(R,t),n.levelIsComplete(R,t))return p=l[R],!0},M=function(R){if(!p)for(var N=r+R;sx<=N&&N<=a3&&!O(N);N+=R);};M(1),M(-1);for(var z=h.length-1;z>=0;z--){var F=h[z];F.invalid&&Zu(h,F)}};if(!f)g();else return h;var m=function(){if(!d){d=ja();for(var O=0;OIee||F>Iee)return null;var S=z*F;if(S>Bqe)return null;var R=n.makeLayer(d,r);if(M!=null){var N=h.indexOf(M)+1;h.splice(N,0,R)}else(O.insert===void 0||O.insert)&&h.unshift(R);return R};if(n.skipping&&!o)return null;for(var v=null,T=t.length/Rqe,b=!o,w=0;w=T||!NZ(v.bb,k.boundingBox()))&&(v=y({insert:!0,after:v}),!v))return null;p||b?n.queueLayer(v,k):n.drawEleInLayer(v,k,r,e),v.eles.push(k),C[r]=v}return p||(b?null:h)},pa.getEleLevelForLayerLevel=function(t,e){return t},pa.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,r,Fqe),a.setImgSmoothing(s,!0))},pa.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,a=0;a0||s.invalid)return!1;i+=s.eles.length}return i===e.length},pa.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e},pa.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=$c(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))},pa.invalidateLayer=function(t){if(this.lastInvalidationTime=$c(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];Zu(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,v=u*h,T=u*h,b=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;d==="straight-triangle"?(s.eleStrokeStyle(t,e,R),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,s.eleStrokeStyle(t,e,R),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},w=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;if(t.lineWidth=p+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,y[0],y[1],y[2],R);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},k=function(){i&&s.drawEdgeOverlay(t,e)},A=function(){i&&s.drawEdgeUnderlay(t,e)},C=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T;s.drawArrowheads(t,e,R)},_=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var L=e.pstyle("ghost").value==="yes";if(L){var O=e.pstyle("ghost-offset-x").pfValue,M=e.pstyle("ghost-offset-y").pfValue,z=e.pstyle("ghost-opacity").value,F=v*z;t.translate(O,M),b(F),C(F),t.translate(-O,-M)}else w();A(),b(),C(),k(),_(),r&&t.translate(l.x1,l.y1)}};var Pee=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,o.allpts,"solid")}}}};Gc.drawEdgeOverlay=Pee("overlay"),Gc.drawEdgeUnderlay=Pee("underlay"),Gc.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e),u=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=l,t.textBaseline=u?"alphabetic":"bottom"}else{var h=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(h||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var g=!r,m;r&&(m=r,t.translate(-m.x1,-m.y1)),i==null?(s.drawText(t,e,null,g,a),e.isEdge()&&(s.drawText(t,e,"source",g,a),s.drawText(t,e,"target",g,a))):s.drawText(t,e,i,g,a),r&&t.translate(m.x1,m.y1)},Gd.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function jqe(t,e,r,n,i){var a=Math.min(n,i),s=a/2,o=e+n/2,l=r+i/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function Bee(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(a,n/2,i/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+n-s,r),t.quadraticCurveTo(e+n,r,e+n,r+s),t.lineTo(e+n,r+i-s),t.quadraticCurveTo(e+n,r+i,e+n-s,r+i),t.lineTo(e+s,r+i),t.quadraticCurveTo(e,r+i,e,r+i-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}Gd.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",s=t.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=Ka(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r},Gd.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=Ka(s,"labelX",r),u=Ka(s,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=Ka(s,"labelWidth",r),m=Ka(s,"labelHeight",r),y=Ka(s,"labelActualDescent",r),v=e.pstyle(p+"text-margin-x").pfValue,T=e.pstyle(p+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,k=e.pstyle("text-valign").value;b&&(w="center",k="center"),l+=v,u+=T;var A;n?A=this.getTextAngle(e,r):A=0,A!==0&&(h=l,d=u,t.translate(h,d),t.rotate(A),l=0,u=0);var C=Np(w),_=Op(k);switch(_){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var L=e.pstyle("text-background-opacity").value,O=e.pstyle("text-border-opacity").value,M=e.pstyle("text-border-width").pfValue,z=e.pstyle("text-background-padding").pfValue,F=e.pstyle("text-background-shape").strValue,S=F==="round-rectangle"||F==="roundrectangle",R=F==="circle",N=2;if(L>0||M>0&&O>0){var D=t.fillStyle,I=t.strokeStyle,$=t.lineWidth,B=e.pstyle("text-background-color").value,P=e.pstyle("text-border-color").value,G=e.pstyle("text-border-style").value,V=L>0,Y=M>0&&O>0,W=l-z;switch(C){case"left":W-=g;break;case"center":W-=g/2;break}var ie=u-m-z,K=g+2*z,se=m+2*z;if(V&&(t.fillStyle="rgba(".concat(B[0],",").concat(B[1],",").concat(B[2],",").concat(L*o,")")),Y&&(t.strokeStyle="rgba(".concat(P[0],",").concat(P[1],",").concat(P[2],",").concat(O*o,")"),t.lineWidth=M,t.setLineDash))switch(G){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=M/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(S?(t.beginPath(),Bee(t,W,ie,K,se,N)):R?(t.beginPath(),jqe(t,W,ie,K,se)):(t.beginPath(),t.rect(W,ie,K,se)),V&&t.fill(),Y&&t.stroke(),Y&&G==="double"){var J=M/2;t.beginPath(),S?Bee(t,W+J,ie+J,K-2*J,se-2*J,N):t.rect(W+J,ie+J,K-2*J,se-2*J),t.stroke()}t.fillStyle=D,t.strokeStyle=I,t.lineWidth=$,t.setLineDash&&t.setLineDash([])}var Z=2*e.pstyle("text-outline-width").pfValue;if(Z>0&&(t.lineWidth=Z),u-=y,e.pstyle("text-wrap").value==="wrap"){var ee=Ka(s,"labelWrapCachedLines",r),ne=Ka(s,"labelLineHeight",r),ue=g/2,fe=this.getLabelJustification(e);switch(fe==="auto"||(C==="left"?fe==="left"?l+=-g:fe==="center"&&(l+=-ue):C==="center"?fe==="left"?l+=-ue:fe==="right"&&(l+=ue):C==="right"&&(fe==="center"?l+=ue:fe==="right"&&(l+=g))),_){case"top":u-=(ee.length-1)*ne;break;case"center":case"bottom":u-=(ee.length-1)*ne;break}for(var _e=0;_e0&&t.strokeText(ee[_e],l,u),t.fillText(ee[_e],l,u),u+=ne}else Z>0&&t.strokeText(f,l,u),t.fillText(f,l,u);A!==0&&(t.rotate(-A),t.translate(-h,-d))}}};var ch={};ch.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!Gt(d.x)||!Gt(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=s.usePaths(),g,m=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var v;r&&(v=r,t.translate(-v.x1,-v.y1));for(var T=e.pstyle("background-image"),b=T.value,w=new Array(b.length),k=new Array(b.length),A=0,C=0;C0&&arguments[0]!==void 0?arguments[0]:F;s.eleFillStyle(t,e,H)},J=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P;s.colorStrokeStyle(t,S[0],S[1],S[2],H)},Z=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:W;s.colorStrokeStyle(t,V[0],V[1],V[2],H)},ee=function(H,he,j,pe){var re=s.nodePathCache=s.nodePathCache||[],Be=xZ(j==="polygon"?j+","+pe.join(","):j,""+he,""+H,""+K),xe=re[Be],Ue,De=!1;return xe!=null?(Ue=xe,De=!0,h.pathCache=Ue):(Ue=new Path2D,re[Be]=h.pathCache=Ue),{path:Ue,cacheHit:De}},ne=e.pstyle("shape").strValue,ue=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var fe=ee(o,l,ne,ue);g=fe.path,m=fe.cacheHit}var _e=function(){if(!m){var H=d;p&&(H={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,H.x,H.y,o,l,K,h)}p?t.fill(g):t.fill()},Ae=function(){for(var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,j=u.backgrounding,pe=0,re=0;re0&&arguments[0]!==void 0?arguments[0]:!1,he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,he),H&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,K,h)))},me=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,K,h),t.clip()),s.drawStripe(t,e,he),t.restore(),H&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,K,h)))},ve=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,he=(M>0?M:-M)*H,j=M>0?0:255;M!==0&&(s.colorFillStyle(t,j,j,j,he),p?t.fill(g):t.fill())},Ge=function(){if(z>0){if(t.lineWidth=z,t.lineCap=D,t.lineJoin=N,t.setLineDash)switch(R){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash($),t.lineDashOffset=B;break;case"solid":case"double":t.setLineDash([]);break}if(I!=="center"){if(t.save(),t.lineWidth*=2,I==="inside")p?t.clip(g):t.clip();else{var H=new Path2D;H.rect(-o/2-z,-l/2-z,o+2*z,l+2*z),H.addPath(g),t.clip(H,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(R==="double"){t.lineWidth=z/3;var he=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=he}t.setLineDash&&t.setLineDash([])}},Te=function(){if(G>0){if(t.lineWidth=G,t.lineCap="butt",t.setLineDash)switch(Y){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var H=d;p&&(H={x:0,y:0});var he=s.getNodeShape(e),j=z;I==="inside"&&(j=0),I==="outside"&&(j*=2);var pe=(o+j+(G+ie))/o,re=(l+j+(G+ie))/l,Be=o*pe,xe=l*re,Ue=s.nodeShapes[he].points,De;if(p){var qe=ee(Be,xe,he,Ue);De=qe.path}if(he==="ellipse")s.drawEllipsePath(De||t,H.x,H.y,Be,xe);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(he)){var Le=0,Xe=0,Ie=0;he==="round-diamond"?Le=(j+ie+G)*1.4:he==="round-heptagon"?(Le=(j+ie+G)*1.075,Ie=-(j/2+ie+G)/35):he==="round-hexagon"?Le=(j+ie+G)*1.12:he==="round-pentagon"?(Le=(j+ie+G)*1.13,Ie=-(j/2+ie+G)/15):he==="round-tag"?(Le=(j+ie+G)*1.12,Xe=(j/2+G+ie)*.07):he==="round-triangle"&&(Le=(j+ie+G)*(Math.PI/2),Ie=-(j+ie/2+G)/Math.PI),Le!==0&&(pe=(o+Le)/o,Be=o*pe,["round-hexagon","round-tag"].includes(he)||(re=(l+Le)/l,xe=l*re)),K=K==="auto"?PZ(Be,xe):K;for(var it=Be/2,we=xe/2,lt=K+(j+G+ie)/2,be=new Array(Ue.length/2),Et=new Array(Ue.length/2),vt=0;vt0){if(i=i||n.position(),a==null||s==null){var p=n.padding();a=n.width()+2*p,s=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,a+l*2,s+l*2,f),r.fill()}}}};ch.drawNodeOverlay=Fee("overlay"),ch.drawNodeUnderlay=Fee("underlay"),ch.hasPie=function(t){return t=t[0],t._private.hasPie},ch.hasStripe=function(t){return t=t[0],t._private.hasStripe},ch.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),s.units==="%"?p=f*s.pfValue:s.pfValue!==void 0&&(p=s.pfValue/2),!(p>=f))for(var y=1;y<=i.pieBackgroundN;y++){var v=e.pstyle("pie-"+y+"-background-size").value,T=e.pstyle("pie-"+y+"-background-color").value,b=e.pstyle("pie-"+y+"-background-opacity").value*r,w=v/100;w+g>1&&(w=1-g);var k=1.5*Math.PI+2*Math.PI*g;k+=o;var A=2*Math.PI*w,C=k+A;v===0||g>=1||g+w>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,k,C),t.closePath()):(t.beginPath(),t.arc(l,u,f,k,C),t.arc(l,u,p,C,k,!0),t.closePath()),this.colorFillStyle(t,T[0],T[1],T[2],b),t.fill(),g+=w)}},ch.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(a=0,s=0),s-=p/2,a-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var y=e.pstyle("stripe-"+m+"-background-size").value,v=e.pstyle("stripe-"+m+"-background-color").value,T=e.pstyle("stripe-"+m+"-background-opacity").value*r,b=y/100;b+u>1&&(b=1-u),!(y===0||u>=1||u+b>1)&&(t.beginPath(),t.rect(a,s+g*u,p,g*b),t.closePath(),this.colorFillStyle(t,v[0],v[1],v[2],T),t.fill(),u+=b)}t.restore()};var Qa={},Zqe=100;Qa.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r},Qa.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;ie.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var T=r.style(),b=r.zoom(),w=s!==void 0?s:b,k=r.pan(),A={x:k.x,y:k.y},C={zoom:b,pan:{x:k.x,y:k.y}},_=e.prevViewport,L=_===void 0||C.zoom!==_.zoom||C.pan.x!==_.pan.x||C.pan.y!==_.pan.y;!L&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(A=o),w*=l,A.x*=l,A.y*=l;var O=e.getCachedZSortedEles();function M(J,Z,ee,ne,ue){var fe=J.globalCompositeOperation;J.globalCompositeOperation="destination-out",e.colorFillStyle(J,255,255,255,e.motionBlurTransparency),J.fillRect(Z,ee,ne,ue),J.globalCompositeOperation=fe}function z(J,Z){var ee,ne,ue,fe;!e.clearingMotionBlur&&(J===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||J===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(ee={x:k.x*p,y:k.y*p},ne=b*p,ue=e.canvasWidth*p,fe=e.canvasHeight*p):(ee=A,ne=w,ue=e.canvasWidth,fe=e.canvasHeight),J.setTransform(1,0,0,1,0,0),Z==="motionBlur"?M(J,0,0,ue,fe):!n&&(Z===void 0||Z)&&J.clearRect(0,0,ue,fe),i||(J.translate(ee.x,ee.y),J.scale(ne,ne)),o&&J.translate(o.x,o.y),s&&J.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var F=e.data.bufferContexts[e.TEXTURE_BUFFER];F.setTransform(1,0,0,1,0,0),F.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:F,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var C=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};C.mpan={x:(0-C.pan.x)/C.zoom,y:(0-C.pan.y)/C.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var S=u.contexts[e.NODE],R=e.textureCache.texture,C=e.textureCache.viewport;S.setTransform(1,0,0,1,0,0),f?M(S,0,0,C.width,C.height):S.clearRect(0,0,C.width,C.height);var N=T.core("outside-texture-bg-color").value,D=T.core("outside-texture-bg-opacity").value;e.colorFillStyle(S,N[0],N[1],N[2],D),S.fillRect(0,0,C.width,C.height);var b=r.zoom();z(S,!1),S.clearRect(C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l),S.drawImage(R,C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var I=r.extent(),$=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),B=e.hideEdgesOnViewport&&$,P=[];if(P[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,P[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),P[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,P[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||P[e.NODE]){var G=f&&!P[e.NODE]&&p!==1,S=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),V=f&&!G?"motionBlur":void 0;z(S,V),B?e.drawCachedNodes(S,O.nondrag,l,I):e.drawLayeredElements(S,O.nondrag,l,I),e.debug&&e.drawDebugPoints(S,O.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||P[e.DRAG])){var G=f&&!P[e.DRAG]&&p!==1,S=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);z(S,f&&!G?"motionBlur":void 0),B?e.drawCachedNodes(S,O.drag,l,I):e.drawCachedElements(S,O.drag,l,I),e.debug&&e.drawDebugPoints(S,O.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,z),f&&p!==1){var Y=u.contexts[e.NODE],W=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],ie=u.contexts[e.DRAG],K=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],se=function(Z,ee,ne){Z.setTransform(1,0,0,1,0,0),ne||!v?Z.clearRect(0,0,e.canvasWidth,e.canvasHeight):M(Z,0,0,e.canvasWidth,e.canvasHeight);var ue=p;Z.drawImage(ee,0,0,e.canvasWidth*ue,e.canvasHeight*ue,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||P[e.NODE])&&(se(Y,W,P[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||P[e.DRAG])&&(se(ie,K,P[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=C,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},Zqe)),n||r.emit("render")};var ox;Qa.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=a.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),y="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!ox){var v=h.measureText(y);ox=v.actualBoundingBoxAscent}h.fillText(y,0,ox);var T=60;h.strokeRect(0,ox+10,250,20),h.fillRect(0,ox+10,250*Math.min(m/T,1),20)}o||(l[r.SELECT_BOX]=!1)}};function zee(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function Qqe(t,e,r){var n=zee(t,t.VERTEX_SHADER,e),i=zee(t,t.FRAGMENT_SHADER,r),a=t.createProgram();if(t.attachShader(a,n),t.attachShader(a,i),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function Jqe(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function QL(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function eVe(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function tVe(t,e,r,n,i){var a=n*r+e.x,s=i*r+e.y;return s=Math.round(t.canvasHeight-s),[a,s]}function rVe(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function nVe(t,e){if(t.length!==e.length)return!1;for(var r=0;r>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function iVe(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function aVe(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function Gee(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function qee(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function sVe(t,e,r,n,i,a){switch(e){case t.FLOAT:return new Float32Array(r.buffer,a*n,i);case t.INT:return new Int32Array(r.buffer,a*n,i)}}function oVe(t,e,r,n){var i=Gee(t,e),a=Ri(i,2),s=a[0],o=a[1],l=qee(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function $l(t,e,r,n){var i=Gee(t,r),a=Ri(i,3),s=a[0],o=a[1],l=a[2],u=qee(t,o,e*s),h=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;ps&&(o=s/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(b,w){if(i&&w){var k=w.context,A=b.x,C=b.row,_=A,L=l*C;k.save(),k.translate(_,L),k.scale(h,h),i(k,n),k.restore()}},g=[null,null],m=function(){p(a.freePointer,a.canvas),g[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:f},g[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:f},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},y=function(){var b=a.scratch,w=a.canvas;b.clear(),p({x:0,row:0},b);var k=s-a.freePointer.x,A=d-k,C=l;{var _=a.freePointer.x,L=a.freePointer.row*l,O=k;w.context.drawImage(b,0,0,O,C,_,L,O,C),g[0]={x:_,y:L,w:O,h:f}}{var M=k,z=(a.freePointer.row+1)*l,F=A;w&&w.context.drawImage(b,M,0,F,C,0,z,F,C),g[1]={x:0,y:z,w:F,h:f}}a.freePointer.x=A,a.freePointer.row++},v=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(v(),m()):this.enableWrapping?y():(v(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(r),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=ws(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=ws(this.renderTypes.values()),v;try{var T=function(){var w=v.value,k=w.type;if(h(k)){var A=n.collections.get(w.collection),C=w.getKey(m),_=Array.isArray(C)?C:[C];if(s)_.forEach(function(z){return A.markKeyForGC(z)}),f=!0;else{var L=w.getID?w.getID(m):m.id(),O=n._key(k,L),M=n.typeAndIdToKey.get(O);M!==void 0&&!nVe(_,M)&&(d=!0,n.typeAndIdToKey.delete(O),M.forEach(function(z){return A.markKeyForGC(z)}))}}};for(y.s();!(v=y.n()).done;)T()}catch(b){y.e(b)}finally{y.f()}}}}catch(b){p.e(b)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=ws(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(a){r.e(a)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(a,i,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),s.drawElement(f,r,i,!0,!0),f.restore()):s.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=Ri(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=ws(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=Ri(i.value,2),s=a[0],o=a[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])})(),mVe=(function(){function t(e){Hu(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Yu(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])})(),yVe=` + */var MJ=function(e,r){this.recycle(e,r)};function Qb(){return!1}function F5(){return!0}MJ.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Qb,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?F5:Qb):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,i=this.cy.zoom(),a=this.cy.pan();this.renderedPosition={x:n.x*i+a.x,y:n.y*i+a.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=F5;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=F5;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=F5,this.stopPropagation()},isDefaultPrevented:Qb,isPropagationStopped:Qb,isImmediatePropagationStopped:Qb};var NJ=/^([^.]+)(\.(?:[^.]+))?$/,SGe=".*",OJ={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},$J=Object.keys(OJ),AGe={};function z5(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:AGe,e=arguments.length>1?arguments[1]:void 0,r=0;r<$J.length;r++){var n=$J[r];this[n]=t[n]||OJ[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var oh=z5.prototype,PJ=function(e,r,n,i,a,s,o){jn(i)&&(a=i,i=null),o&&(s==null?s=o:s=yr({},s,o));for(var l=wn(n)?n:n.split(/\s+/),u=0;u=0;o--)s(o);return this},oh.removeAllListeners=function(){return this.removeListener("*")},oh.emit=oh.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,wn(e)||(e=[e]),_Ge(this,function(a,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===SGe)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&yBe(d,e),a.beforeEmit(a.context,h,s),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==h}));var f=a.callbackContext(a.context,h,s),p=h.callback.apply(f,d);a.afterEmit(a.context,h,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,a.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,i=r.map,a=i.get(n);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&hr(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],i=this,a=0;an&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,a=this,s=0;s=0&&a"u"?"undefined":Fi(Symbol))!=e&&Fi(Symbol.iterator)!=e;r&&(q5[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return Kj({next:function(){return a1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var a=n._private.style[e];return a??(r?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(Kr(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(hr(e))if(r===void 0){var o=this[0];return o?a.getStylePropertyValue(o,e):void 0}else a.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),a=this;if(e===void 0)for(var s=0;s0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Da.neighbourhood=Da.neighborhood,Da.closedNeighbourhood=Da.closedNeighborhood,Da.openNeighbourhood=Da.openNeighborhood,yr(Da,{source:ho(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:ho(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:YJ({attr:"source"}),targets:YJ({attr:"target"})});function YJ(t){return function(r){for(var n=[],i=0;i0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Da.componentsOf=Da.components;var fa=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Hn("A collection must have a reference to the core");return}var a=new Pc,s=!1;if(!r)r=[];else if(r.length>0&&Kr(r[0])&&!Nb(r[0])){s=!0;for(var o=[],l=new k0,u=0,h=r.length;u0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,a=[],s=[],o,l=0,u=r.length;l0){for(var $=o.length===r.length?r:new fa(n,o),B=0;B<$.length;B++){var P=$[B];P.isNode()||(P.parallelEdges().clearTraversalCache(),P.source().clearTraversalCache(),P.target().clearTraversalCache())}var G;i.hasCompoundNodes?G=n.collection().merge($).merge($.connectedNodes()).merge($.parent()):G=$,G.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?$.emitAndNotify("add"):e&&$.emit("add")}return r},kn.removed=function(){var t=this[0];return t&&t._private.removed},kn.inside=function(){var t=this[0];return t&&!t._private.removed},kn.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},a=r._private.cy;function s(A){for(var R=A._private.edges,N=0;N0&&(t?M.emitAndNotify("remove"):e&&M.emit("remove"));for(var z=0;z0?z=A:M=A;while(Math.abs(F)>s&&++R=a?x(O,R):N===0?R:w(O,M,M+u)}var S=!1;function C(){S=!0,(t!==e||r!==n)&&b()}var _=function(M){return S||C(),t===e&&r===n?M:M===0?0:M===1?1:y(k(M),e,n)};_.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var L="generateBezier("+[t,e,r,n]+")";return _.toString=function(){return L},_}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var FGe=(function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,a){var s={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,i){var a={dx:n.v,dv:t(n)},s=e(n,i*.5,a),o=e(n,i*.5,s),l=e(n,i,o),u=1/6*(a.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(a.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,a,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,d=16/1e3,f,p,g;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,o.tension=i,o.friction=a,f=s!==null,f?(u=n(i,a),p=u/s*d):p=d;g=r(g||o,p),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return f?function(m){return l[m*(l.length-1)|0]}:u}})(),En=function(e,r,n,i){var a=BGe(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},H5={linear:function(e,r,n){return e+(r-e)*n},ease:En(.25,.1,.25,1),"ease-in":En(.42,0,1,1),"ease-out":En(0,0,.58,1),"ease-in-out":En(.42,0,.58,1),"ease-in-sine":En(.47,0,.745,.715),"ease-out-sine":En(.39,.575,.565,1),"ease-in-out-sine":En(.445,.05,.55,.95),"ease-in-quad":En(.55,.085,.68,.53),"ease-out-quad":En(.25,.46,.45,.94),"ease-in-out-quad":En(.455,.03,.515,.955),"ease-in-cubic":En(.55,.055,.675,.19),"ease-out-cubic":En(.215,.61,.355,1),"ease-in-out-cubic":En(.645,.045,.355,1),"ease-in-quart":En(.895,.03,.685,.22),"ease-out-quart":En(.165,.84,.44,1),"ease-in-out-quart":En(.77,0,.175,1),"ease-in-quint":En(.755,.05,.855,.06),"ease-out-quint":En(.23,1,.32,1),"ease-in-out-quint":En(.86,0,.07,1),"ease-in-expo":En(.95,.05,.795,.035),"ease-out-expo":En(.19,1,.22,1),"ease-in-out-expo":En(1,0,0,1),"ease-in-circ":En(.6,.04,.98,.335),"ease-out-circ":En(.075,.82,.165,1),"ease-in-out-circ":En(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return H5.linear;var i=FGe(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":En};function jJ(t,e,r,n,i){if(n===1||e===r)return r;var a=i(e,r,n);return t==null||((t.roundValue||t.color)&&(a=Math.round(a)),t.min!==void 0&&(a=Math.max(a,t.min)),t.max!==void 0&&(a=Math.min(a,t.max))),a}function ZJ(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function z0(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=ZJ(t,i),o=ZJ(e,i);if(Gt(s)&&Gt(o))return jJ(a,s,o,r,n);if(wn(s)&&wn(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(s.duration),s.easingImpl=H5[p].apply(null,g)):s.easingImpl=H5[p]}var m=s.easingImpl,y;if(s.duration===0?y=1:y=(r-l)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var v=s.startPosition,x=s.position;if(x&&i&&!t.locked()){var b={};Jb(v.x,x.x)&&(b.x=z0(v.x,x.x,y,m)),Jb(v.y,x.y)&&(b.y=z0(v.y,x.y,y,m)),t.position(b)}var w=s.startPan,k=s.pan,S=a.pan,C=k!=null&&n;C&&(Jb(w.x,k.x)&&(S.x=z0(w.x,k.x,y,m)),Jb(w.y,k.y)&&(S.y=z0(w.y,k.y,y,m)),t.emit("pan"));var _=s.startZoom,L=s.zoom,O=L!=null&&n;O&&(Jb(_,L)&&(a.zoom=Vb(a.minZoom,z0(_,L,y,m),a.maxZoom)),t.emit("zoom")),(C||O)&&t.emit("viewport");var M=s.style;if(M&&M.length>0&&i){for(var z=0;z=0;C--){var _=S[C];_()}S.splice(0,S.length)},x=p.length-1;x>=0;x--){var b=p[x],w=b._private;if(w.stopped){p.splice(x,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||GGe(h,b,t),zGe(h,b,t,d),w.applying&&(w.applying=!1),v(w.frames),w.step!=null&&w.step(t),b.completed()&&(p.splice(x,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var a=!1,s=0;s0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var qGe={animate:un.animate(),animation:un.animation(),animated:un.animated(),clearQueue:un.clearQueue(),delay:un.delay(),delayAnimation:un.delayAnimation(),stop:un.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&m5(function(a){QJ(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){QJ(s,e)},n.beforeRenderPriorities.animations):r()}},VGe={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&Nb(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},Y5=function(e){return hr(e)?new rh(e):e},JJ={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new z5(VGe,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,Y5(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,Y5(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,Y5(r),n),this},once:function(e,r,n){return this.emitter().one(e,Y5(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};un.eventAliasesOn(JJ);var zL={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};zL.jpeg=zL.jpg;var X5={layout:function(e){var r=this;if(e==null){Hn("Layout options must be specified to make a layout");return}if(e.name==null){Hn("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){Hn("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;hr(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(yr({},e,{cy:r,eles:a}));return s}};X5.createLayout=X5.makeLayout=X5.layout;var WGe={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};GL.invalidateDimensions=GL.resize;var K5={collection:function(e,r){return hr(e)?this.$(e):Hs(e)?e.collection():wn(e)?(r||(r={}),new fa(this,e,r.unique,r.removed)):new fa(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};K5.elements=K5.filter=K5.$;var Ji={},ex="t",HGe="f";Ji.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m1&&(w=1),o.color){var S=n.valueMin[0],C=n.valueMax[0],_=n.valueMin[1],L=n.valueMax[1],O=n.valueMin[2],M=n.valueMax[2],z=n.valueMin[3]==null?1:n.valueMin[3],F=n.valueMax[3]==null?1:n.valueMax[3],A=[Math.round(S+(C-S)*w),Math.round(_+(L-_)*w),Math.round(O+(M-O)*w),Math.round(z+(F-z)*w)];a={bypass:n.bypass,name:n.name,value:A,strValue:"rgb("+A[0]+", "+A[1]+", "+A[2]+")"}}else if(o.number){var R=n.valueMin+(n.valueMax-n.valueMin)*w;a=this.parse(n.name,R,n.bypass,f)}else return!1;if(!a)return m(),!1;a.mapping=n,n=a;break}case s.data:{for(var N=n.field.split("."),D=d.data,I=0;I0&&a>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(s).play().promise().then(b):b()}).then(function(){return t.animation({style:o,duration:a,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)},Ji.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],o=i(s);t.removed()||o!=null&&o(r,n,t)&&a(s)},Ji.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",t)})},Ji.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})},Ji.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})},Ji.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})},Ji.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var tx={};tx.applyBypass=function(t,e,r,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;oi.length?n=n.substr(i.length):n=""}function l(){a.length>s.length?a=a.substr(s.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){cn("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var f=new rh(d);if(f.invalid){cn("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;a=p;for(var m=[];;){var y=a.match(/^\s*$/);if(y)break;var v=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!v){cn("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=v[0];var x=v[1],b=v[2],w=e.properties[x];if(!w){cn("Skipping property: Invalid property name in: "+s),l();continue}var k=r.parse(x,b);if(!k){cn("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:x,val:b}),l()}if(g){o();break}r.selector(d);for(var S=0;S=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:h,strValue:""+e,mapped:f,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var m=this.parse(t,d[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return cn("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var y=g.value,v=m.value,x=y[0]===v[0]&&y[1]===v[1]&&y[2]===v[2]&&(y[3]===v[3]||(y[3]==null||y[3]===1)&&(v[3]==null||v[3]===1));if(x)return!1}return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var b;if(l?b=e.split(/\s+/):wn(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var w=[],k=[],S=[],C="",_=!1,L=0;L0?" ":"")+O.strValue}return u.validate&&!u.validate(w,k)?null:u.singleEnum&&_?w.length===1&&hr(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:S,strValue:C,bypass:r,units:k}}var M=function(){for(var J=0;Ju.max||u.strictMax&&e===u.max))return null;var N={name:t,value:e,strValue:""+e+(z||""),units:z,bypass:r};return u.unitless||z!=="px"&&z!=="em"?N.pfValue=e:N.pfValue=z==="px"||!z?e:this.getEmSizeInPixels()*e,(z==="ms"||z==="s")&&(N.pfValue=z==="ms"?e:1e3*e),(z==="deg"||z==="rad")&&(N.pfValue=z==="rad"?e:qBe(e)),z==="%"&&(N.pfValue=e/100),N}else if(u.propList){var D=[],I=""+e;if(I!=="none"){for(var $=I.split(/\s*,\s*|\s+/),B=0;B<$.length;B++){var P=$[B].trim();i.properties[P]?D.push(P):cn("`"+P+"` is not a valid property name")}if(D.length===0)return null}return{name:t,value:D,strValue:D.length===0?"none":D.join(" "),bypass:r}}else if(u.color){var G=iZ(e);return G?{name:t,value:G,pfValue:G,strValue:"rgb("+G[0]+","+G[1]+","+G[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var V=M();if(V)return V}for(var X=u.regexes?u.regexes:[u.regex],W=0;W0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,i=r.zoom,a,s,o=!1;if(r.zoomingEnabled||(o=!0),Gt(e)?s=e:Kr(e)&&(s=e.level,e.position!=null?a=T5(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=sr.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;Gt(u.x)&&(r.pan.x=u.x,o=!1),Gt(u.y)&&(r.pan.y=u.y,o=!1),o||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(hr(e)){var n=e;e=this.mutableElements().filter(n)}else Hs(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(a-r*(i.x1+i.x2))/2,y:(s-r*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?(function(){var i=n.window().getComputedStyle(r),a=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};$d.centre=$d.center,$d.autolockNodes=$d.autolock,$d.autoungrabifyNodes=$d.autoungrabify;var rx={data:un.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:un.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:un.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:un.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};rx.attr=rx.data,rx.removeAttr=rx.removeData;var nx=function(e){var r=this;e=yr({},e);var n=e.container;n&&!d5(n)&&d5(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var s=zi!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=yr({name:s?"grid":"null"},o.layout),o.renderer=yr({name:s?"canvas":"null"},o.renderer);var l=function(g,m,y){return m!==void 0?m:y!==void 0?y:g},u=this._private={container:n,ready:!1,options:o,elements:new fa(this),listeners:[],aniEles:new fa(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:Gt(o.zoom)?o.zoom:1,pan:{x:Kr(o.pan)&&Gt(o.pan.x)?o.pan.x:0,y:Kr(o.pan)&&Gt(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(g,m){var y=g.some($Pe);if(y)return I0.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=yr({},o,o.renderer);r.initRenderer(d);var f=function(g,m,y){r.notifications(!1);var v=r.mutableElements();v.length>0&&v.remove(),g!=null&&(Kr(g)||wn(g))&&r.add(g),r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var x=yr({},r._private.options.layout);x.eles=r.elements(),r.layout(x).run()};h([o.style,o.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,jn(o.ready)&&r.on("ready",o.ready);for(var y=0;y0,o=!!t.boundingBox,l=ja(o?t.boundingBox:structuredClone(e.extent())),u;if(Hs(t.roots))u=t.roots;else if(wn(t.roots)){for(var h=[],d=0;d0;){var A=F(),R=L(A,M);if(R)A.outgoers().filter(function(ve){return ve.isNode()&&r.has(ve)}).forEach(z);else if(R===null){cn("Detected double maximal shift for node `"+A.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var N=0;if(t.avoidOverlap)for(var D=0;D0&&v[0].length<=3?Ve/2:0),nt=2*Math.PI/v[Ze].length*ke;return Ze===0&&v[0].length===1&&(Qe=1),{x:ne.x+Qe*Math.cos(nt),y:ne.y+Qe*Math.sin(nt)}}else{var tt=v[Ze].length,je=Math.max(tt===1?0:o?(l.w-t.padding*2-ue.w)/((t.grid?_e:tt)-1):(l.w-t.padding*2-ue.w)/((t.grid?_e:tt)+1),N),Ce={x:ne.x+(ke+1-(tt+1)/2)*je,y:ne.y+(Ze+1-(W+1)/2)*fe};return Ce}},Ne={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Ne).indexOf(t.direction)===-1&&Hn("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Ne).join(", ")));var me=function(Ge){return hBe(Ae(Ge),l,Ne[t.direction])};return r.nodes().layoutPositions(this,t,me),this};var ZGe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function ree(t){this.options=yr({},ZGe,t)}ree.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s=ja(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,u=l/Math.max(1,a.length-1),h,d=0,f=0;f1&&e.avoidOverlap){d*=1.75;var v=Math.cos(u)-Math.cos(0),x=Math.sin(u)-Math.sin(0),b=Math.sqrt(d*d/(v*v+x*x));h=Math.max(b,h)}var w=function(S,C){var _=e.startAngle+C*u*(i?1:-1),L=h*Math.cos(_),O=h*Math.sin(_),M={x:o.x+L,y:o.y+O};return M};return n.nodes().layoutPositions(this,e,w),this};var QGe={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function nee(t){this.options=yr({},QGe,t)}nee.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=ja(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,h=0;h0){var k=Math.abs(x[0].value-w.value);k>=y&&(x=[],v.push(x))}x.push(w)}var S=u+e.minNodeSpacing;if(!e.avoidOverlap){var C=v.length>0&&v[0].length>1,_=Math.min(s.w,s.h)/2-S,L=_/(v.length+C?1:0);S=Math.min(S,L)}for(var O=0,M=0;M1&&e.avoidOverlap){var R=Math.cos(A)-Math.cos(0),N=Math.sin(A)-Math.sin(0),D=Math.sqrt(S*S/(R*R+N*N));O=Math.max(D,O)}z.r=O,O+=S}if(e.equidistant){for(var I=0,$=0,B=0;B=t.numIter||(aqe(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),m5(h)}};h()}else{for(;u;)u=s(l),l++;lee(n,t),o()}return this},J5.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},J5.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var eqe=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=ja(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=n.eles.components(),u={},h=0;h0){o.graphSet.push(_);for(var h=0;h<_.length;h++)v[++b]=_[h]}}for(var h=0;hi.count?0:i.graph},iee=function(e,r,n,i){var a=i.graphSet[n];if(-10)var d=i.nodeOverlap*h,f=Math.sqrt(o*o+l*l),p=d*o/f,g=d*l/f;else var m=e3(e,o,l),y=e3(r,-1*o,-1*l),v=y.x-m.x,x=y.y-m.y,b=v*v+x*x,f=Math.sqrt(b),d=(e.nodeRepulsion+r.nodeRepulsion)/b,p=d*v/f,g=d*x/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},lqe=function(e,r,n,i){if(n>0)var a=e.maxX-r.minX;else var a=r.maxX-e.minX;if(i>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},e3=function(e,r,n){var i=e.positionX,a=e.positionY,s=e.height||1,o=e.width||1,l=n/r,u=s/o,h={};return r===0&&0n?(h.x=i,h.y=a+s/2,h):0r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=a-o*n/2/r,h):0=u)?(h.x=i+s*r/2/n,h.y=a+s/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-s*r/2/n,h.y=a-s/2),h)},cqe=function(e,r){for(var n=0;nn){var y=r.gravity*p/m,v=r.gravity*g/m;f.offsetX+=y,f.offsetY+=v}}}}},hqe=function(e,r){var n=[],i=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;i<=a;){var s=n[i++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},oee=function(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],a=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(i.minX==null||e.minX-i.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTopv&&(g+=y+r.componentSpacing,p=0,m=0,y=0)}}},pqe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function cee(t){this.options=yr({},pqe,t)}cee.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=ja(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,e,function(V){return{x:a.x1,y:a.y1}});else{var s=i.size(),o=Math.sqrt(s*a.h/a.w),l=Math.round(o),u=Math.round(a.w/a.h*o),h=function(X){if(X==null)return Math.min(l,u);var W=Math.min(l,u);W==l?l=X:u=X},d=function(X){if(X==null)return Math.max(l,u);var W=Math.max(l,u);W==l?l=X:u=X},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(s/l);else if(f==null&&p!=null)u=p,l=Math.ceil(s/u);else if(u*l>s){var g=h(),m=d();(g-1)*m>=s?h(g-1):(m-1)*g>=s&&d(m-1)}else for(;u*l=s?d(v+1):h(y+1)}var x=a.w/u,b=a.h/l;if(e.condense&&(x=0,b=0),e.avoidOverlap)for(var w=0;w=u&&(R=0,A++)},D={},I=0;I(R=rFe(t,e,N[D],N[D+1],N[D+2],N[D+3])))return y(C,R),!0}else if(L.edgeType==="bezier"||L.edgeType==="multibezier"||L.edgeType==="self"||L.edgeType==="compound"){for(var N=L.allpts,D=0;D+5(R=tFe(t,e,N[D],N[D+1],N[D+2],N[D+3],N[D+4],N[D+5])))return y(C,R),!0}for(var I=I||_.source,$=$||_.target,B=i.getArrowWidth(O,M),P=[{name:"source",x:L.arrowStartX,y:L.arrowStartY,angle:L.srcArrowAngle},{name:"target",x:L.arrowEndX,y:L.arrowEndY,angle:L.tgtArrowAngle},{name:"mid-source",x:L.midX,y:L.midY,angle:L.midsrcArrowAngle},{name:"mid-target",x:L.midX,y:L.midY,angle:L.midtgtArrowAngle}],D=0;D0&&(v(I),v($))}function b(C,_,L){return Ka(C,_,L)}function w(C,_){var L=C._private,O=f,M;_?M=_+"-":M="",C.boundingBox();var z=L.labelBounds[_||"main"],F=C.pstyle(M+"label").value,A=C.pstyle("text-events").strValue==="yes";if(!(!A||!F)){var R=b(L.rscratch,"labelX",_),N=b(L.rscratch,"labelY",_),D=b(L.rscratch,"labelAngle",_),I=C.pstyle(M+"text-margin-x").pfValue,$=C.pstyle(M+"text-margin-y").pfValue,B=z.x1-O-I,P=z.x2+O-I,G=z.y1-O-$,V=z.y2+O-$;if(D){var X=Math.cos(D),W=Math.sin(D),ie=function(ue,fe){return ue=ue-R,fe=fe-N,{x:ue*X-fe*W+R,y:ue*W+fe*X+N}},K=ie(B,G),se=ie(B,V),J=ie(P,G),Z=ie(P,V),ee=[K.x+I,K.y+$,J.x+I,J.y+$,Z.x+I,Z.y+$,se.x+I,se.y+$];if(Cs(t,e,ee))return y(C),!0}else if(Qu(z,t,e))return y(C),!0}}for(var k=s.length-1;k>=0;k--){var S=s[k];S.isNode()?v(S)||w(S):x(S)||w(S)||w(S,"source")||w(S,"target")}return o},Pd.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,o=[],l=Math.min(t,r),u=Math.max(t,r),h=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=h,n=d;var f=ja({x1:t,y1:e,x2:r,y2:n}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],g=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function m(ue,fe,_e){return Ka(ue,fe,_e)}function y(ue,fe){var _e=ue._private,Ae=s,Ne="";ue.boundingBox();var me=_e.labelBounds.main;if(!me)return null;var ve=m(_e.rscratch,"labelX",fe),Ge=m(_e.rscratch,"labelY",fe),Te=m(_e.rscratch,"labelAngle",fe),Ze=ue.pstyle(Ne+"text-margin-x").pfValue,ke=ue.pstyle(Ne+"text-margin-y").pfValue,Ve=me.x1-Ae-Ze,Qe=me.x2+Ae-Ze,nt=me.y1-Ae-ke,tt=me.y2+Ae-ke;if(Te){var je=Math.cos(Te),Ce=Math.sin(Te),Se=function(he,j){return he=he-ve,j=j-Ge,{x:he*je-j*Ce+ve,y:he*Ce+j*je+Ge}};return[Se(Ve,nt),Se(Qe,nt),Se(Qe,tt),Se(Ve,tt)]}else return[{x:Ve,y:nt},{x:Qe,y:nt},{x:Qe,y:tt},{x:Ve,y:tt}]}function v(ue,fe,_e,Ae){function Ne(me,ve,Ge){return(Ge.y-me.y)*(ve.x-me.x)>(ve.y-me.y)*(Ge.x-me.x)}return Ne(ue,_e,Ae)!==Ne(fe,_e,Ae)&&Ne(ue,fe,_e)!==Ne(ue,fe,Ae)}for(var x=0;x0?-(Math.PI-e.ang):Math.PI+e.ang},xqe=function(e,r,n,i,a){if(e!==bee?xee(r,e,Dl):bqe(po,Dl),xee(r,n,po),gee=Dl.nx*po.ny-Dl.ny*po.nx,mee=Dl.nx*po.nx-Dl.ny*-po.ny,Fc=Math.asin(Math.max(-1,Math.min(1,gee))),Math.abs(Fc)<1e-6){YL=r.x,XL=r.y,zd=q0=0;return}Bd=1,r3=!1,mee<0?Fc<0?Fc=Math.PI+Fc:(Fc=Math.PI-Fc,Bd=-1,r3=!0):Fc>0&&(Bd=-1,r3=!0),r.radius!==void 0?q0=r.radius:q0=i,Fd=Fc/2,n3=Math.min(Dl.len/2,po.len/2),a?(Ml=Math.abs(Math.cos(Fd)*q0/Math.sin(Fd)),Ml>n3?(Ml=n3,zd=Math.abs(Ml*Math.sin(Fd)/Math.cos(Fd))):zd=q0):(Ml=Math.min(n3,q0),zd=Math.abs(Ml*Math.sin(Fd)/Math.cos(Fd))),KL=r.x+po.nx*Ml,jL=r.y+po.ny*Ml,YL=KL-po.ny*zd*Bd,XL=jL+po.nx*zd*Bd,yee=r.x+Dl.nx*Ml,vee=r.y+Dl.ny*Ml,bee=r};function Tee(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function ZL(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(xqe(t,e,r,n,i),{cx:YL,cy:XL,radius:zd,startX:yee,startY:vee,stopX:KL,stopY:jL,startAngle:Dl.ang+Math.PI/2*Bd,endAngle:po.ang-Math.PI/2*Bd,counterClockwise:r3})}var ix=.01,Tqe=Math.sqrt(2*ix),Na={};Na.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(k,S,C,_){var L=_-S,O=C-k,M=Math.sqrt(O*O+L*L);return{x:-L/M,y:O/M}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],s),f=Ri(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),y=Ri(m,2),v=y[0],x=y[1],b={x1:p,y1:g,x2:v,y2:x};i=u(p,g,v,x),a=b}else cn("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}},Na.findHaystackPoints=function(t){for(var e=0;e0?Math.max(j-pe,0):Math.min(j+pe,0)},F=z(O,_),A=z(M,L),R=!1;x===u?v=Math.abs(F)>Math.abs(A)?i:n:x===l||x===o?(v=n,R=!0):(x===a||x===s)&&(v=i,R=!0);var N=v===n,D=N?A:F,I=N?M:O,$=xR(I),B=!1;!(R&&(w||S))&&(x===o&&I<0||x===l&&I>0||x===a&&I>0||x===s&&I<0)&&($*=-1,D=$*Math.abs(D),B=!0);var P;if(w){var G=k<0?1+k:k;P=G*D}else{var V=k<0?D:0;P=V+k*$}var X=function(j){return Math.abs(j)=Math.abs(D)},W=X(P),ie=X(Math.abs(D)-Math.abs(P)),K=W||ie;if(K&&!B)if(N){var se=Math.abs(I)<=f/2,J=Math.abs(O)<=p/2;if(se){var Z=(h.x1+h.x2)/2,ee=h.y1,ne=h.y2;r.segpts=[Z,ee,Z,ne]}else if(J){var ue=(h.y1+h.y2)/2,fe=h.x1,_e=h.x2;r.segpts=[fe,ue,_e,ue]}else r.segpts=[h.x1,h.y2]}else{var Ae=Math.abs(I)<=d/2,Ne=Math.abs(M)<=g/2;if(Ae){var me=(h.y1+h.y2)/2,ve=h.x1,Ge=h.x2;r.segpts=[ve,me,Ge,me]}else if(Ne){var Te=(h.x1+h.x2)/2,Ze=h.y1,ke=h.y2;r.segpts=[Te,Ze,Te,ke]}else r.segpts=[h.x2,h.y1]}else if(N){var Ve=h.y1+P+(y?f/2*$:0),Qe=h.x1,nt=h.x2;r.segpts=[Qe,Ve,nt,Ve]}else{var tt=h.x1+P+(y?d/2*$:0),je=h.y1,Ce=h.y2;r.segpts=[tt,je,tt,Ce]}if(r.isRound){var Se=t.pstyle("taxi-radius").value,H=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(Se),r.isArcRadius=new Array(r.segpts.length/2).fill(H)}},Na.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!Gt(r.startX)||!Gt(r.startY),y=!Gt(r.arrowStartX)||!Gt(r.arrowStartY),v=!Gt(r.endX)||!Gt(r.endY),x=!Gt(r.arrowEndX)||!Gt(r.arrowEndY),b=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,k=b*w,S=Dd({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),C=SI.poolIndex()){var $=D;D=I,I=$}var B=F.srcPos=D.position(),P=F.tgtPos=I.position(),G=F.srcW=D.outerWidth(),V=F.srcH=D.outerHeight(),X=F.tgtW=I.outerWidth(),W=F.tgtH=I.outerHeight(),ie=F.srcShape=r.nodeShapes[e.getNodeShape(D)],K=F.tgtShape=r.nodeShapes[e.getNodeShape(I)],se=F.srcCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,J=F.tgtCornerRadius=I.pstyle("corner-radius").value==="auto"?"auto":I.pstyle("corner-radius").pfValue,Z=F.tgtRs=I._private.rscratch,ee=F.srcRs=D._private.rscratch;F.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ne=0;ne=Tqe||(nt=Math.sqrt(Math.max(Qe*Qe,ix)+Math.max(Ve*Ve,ix)));var tt=F.vector={x:Qe,y:Ve},je=F.vectorNorm={x:tt.x/nt,y:tt.y/nt},Ce={x:-je.y,y:je.x};F.nodesOverlap=!Gt(nt)||K.checkPoint(me[0],me[1],0,X,W,P.x,P.y,J,Z)||ie.checkPoint(Ge[0],Ge[1],0,G,V,B.x,B.y,se,ee),F.vectorNormInverse=Ce,A={nodesOverlap:F.nodesOverlap,dirCounts:F.dirCounts,calculatedIntersection:!0,hasBezier:F.hasBezier,hasUnbundled:F.hasUnbundled,eles:F.eles,srcPos:P,srcRs:Z,tgtPos:B,tgtRs:ee,srcW:X,srcH:W,tgtW:G,tgtH:V,srcIntn:Te,tgtIntn:ve,srcShape:K,tgtShape:ie,posPts:{x1:ke.x2,y1:ke.y2,x2:ke.x1,y2:ke.y1},intersectionPts:{x1:Ze.x2,y1:Ze.y2,x2:Ze.x1,y2:Ze.y1},vector:{x:-tt.x,y:-tt.y},vectorNorm:{x:-je.x,y:-je.y},vectorNormInverse:{x:-Ce.x,y:-Ce.y}}}var Se=Ne?A:F;fe.nodesOverlap=Se.nodesOverlap,fe.srcIntn=Se.srcIntn,fe.tgtIntn=Se.tgtIntn,fe.isRound=_e.startsWith("round"),i&&(D.isParent()||D.isChild()||I.isParent()||I.isChild())&&(D.parents().anySame(I)||I.parents().anySame(D)||D.same(I)&&D.isParent())?e.findCompoundLoopPoints(ue,Se,ne,Ae):D===I?e.findLoopPoints(ue,Se,ne,Ae):_e.endsWith("segments")?e.findSegmentsPoints(ue,Se):_e.endsWith("taxi")?e.findTaxiPoints(ue,Se):_e==="straight"||!Ae&&F.eles.length%2===1&&ne===Math.floor(F.eles.length/2)?e.findStraightEdgePoints(ue):e.findBezierPoints(ue,Se,ne,Ae,Ne),e.findEndpoints(ue),e.tryToCorrectInvalidPoints(ue,Se),e.checkForInvalidEdgeWarning(ue),e.storeAllpts(ue),e.storeEdgeProjections(ue),e.calculateArrowAngles(ue),e.recalculateEdgeLabelProjections(ue),e.calculateLabelAngles(ue)}},C=0;C0){var me=u,ve=Md(me,E0(s)),Ge=Md(me,E0(Ne)),Te=ve;if(Ge2){var Ze=Md(me,{x:Ne[2],y:Ne[3]});Ze0){var re=h,Fe=Md(re,E0(s)),xe=Md(re,E0(pe)),Ue=Fe;if(xe2){var Me=Md(re,{x:pe[2],y:pe[3]});Me=g||C){y={cp:w,segment:S};break}}if(y)break}var _=y.cp,L=y.segment,O=(g-v)/L.length,M=L.t1-L.t0,z=p?L.t0+M*O:L.t1-M*O;z=Vb(0,z,1),e=S0(_.p0,_.p1,_.p2,z),f=Cqe(_.p0,_.p1,_.p2,z);break}case"straight":case"segments":case"haystack":{for(var F=0,A,R,N,D,I=n.allpts.length,$=0;$+3=g));$+=2);var B=g-R,P=B/A;P=Vb(0,P,1),e=WBe(N,D,P),f=kee(N,D);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}},Nl.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},Nl.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=Id(n,t._private.labelDimsKey);if(Ka(r.rscratch,"prefixedLabelDimsKey",e)!==i){Ll(r.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(t,n),s=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=Ka(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=o*s,f=a.width,p=a.height+(h-1)*(s-1)*o;Ll(r.rstyle,"labelWidth",e,f),Ll(r.rscratch,"labelWidth",e,f),Ll(r.rstyle,"labelHeight",e,p),Ll(r.rscratch,"labelHeight",e,p),Ll(r.rscratch,"labelLineHeight",e,d),Ll(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}},Nl.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=function(V,X){return X?(Ll(r.rscratch,V,e,X),X):Ka(r.rscratch,V,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="​",h=i.split(` +`),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,p=f==="anywhere",g=[],m=/[\s\u200b]+|$/g,y=0;yd){var k=v.matchAll(m),S="",C=0,_=ws(k),L;try{for(_.s();!(L=_.n()).done;){var O=L.value,M=O[0],z=v.substring(C,O.index);C=O.index+M.length;var F=S.length===0?z:S+z+M,A=this.calculateLabelDimensions(t,F),R=A.width;R<=d?S+=z+M:(S&&g.push(S),S=z+M)}}catch(G){_.e(G)}finally{_.f()}S.match(/^[\s\u200b]+$/)||g.push(S)}else g.push(v)}s("labelWrapCachedLines",g),i=s("labelWrapCachedText",g.join(` +`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var N=t.pstyle("text-max-width").pfValue,D="",I="…",$=!1;if(this.calculateLabelDimensions(t,i).widthN)break;D+=i[B],B===i.length-1&&($=!0)}return $||(D+=I),D}return i},Nl.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?uGe(r):"center":e},Nl.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,a=0,s=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,h=t.pstyle("text-metrics").strValue||"font",d=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=i.createElement("canvas"),f=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}f.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var g=0,m=0,y=e.split(` +`),v=y.length,x=0,b=0,w=0;w1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var xt=a(H);lt&&(t.hoverData.tapholdCancelled=!0);var ht=function(){var Ft=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Ft.length===0?(Ft.push(it[0]),Ft.push(it[1])):(Ft[0]+=it[0],Ft[1]+=it[1])};j=!0,i(Le,["mousemove","vmousemove","tapdrag"],H,{x:xe[0],y:xe[1]});var oe=function(Ft){return{originalEvent:H,type:Ft,position:{x:xe[0],y:xe[1]}}},At=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||pe.emit(oe("boxstart")),qe[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(lt){var dt=oe("cxtdrag");De?De.emit(dt):pe.emit(dt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Le!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(oe("cxtdragout")),t.hoverData.cxtOver=Le,Le&&Le.emit(oe("cxtdragover")))}}else if(t.hoverData.dragging){if(j=!0,pe.panningEnabled()&&pe.userPanningEnabled()){var ut;if(t.hoverData.justStartedPan){var wt=t.hoverData.mdownPos;ut={x:(xe[0]-wt[0])*re,y:(xe[1]-wt[1])*re},t.hoverData.justStartedPan=!1}else ut={x:it[0]*re,y:it[1]*re};pe.panBy(ut),pe.emit(oe("dragpan")),t.hoverData.dragged=!0}xe=t.projectIntoViewport(H.clientX,H.clientY)}else if(qe[4]==1&&(De==null||De.pannable())){if(lt){if(!t.hoverData.dragging&&pe.boxSelectionEnabled()&&(xt||!pe.panningEnabled()||!pe.userPanningEnabled()))At();else if(!t.hoverData.selecting&&pe.panningEnabled()&&pe.userPanningEnabled()){var Mr=s(De,t.hoverData.downs);Mr&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,qe[4]=0,t.data.bgActivePosistion=E0(Ue),t.redrawHint("select",!0),t.redraw())}De&&De.pannable()&&De.active()&&De.unactivate()}}else{if(De&&De.pannable()&&De.active()&&De.unactivate(),(!De||!De.grabbed())&&Le!=Xe&&(Xe&&i(Xe,["mouseout","tapdragout"],H,{x:xe[0],y:xe[1]}),Le&&i(Le,["mouseover","tapdragover"],H,{x:xe[0],y:xe[1]}),t.hoverData.last=Le),De)if(lt){if(pe.boxSelectionEnabled()&&xt)De&&De.grabbed()&&(m(we),De.emit(oe("freeon")),we.emit(oe("free")),t.dragData.didDrag&&(De.emit(oe("dragfreeon")),we.emit(oe("dragfree")))),At();else if(De&&De.grabbed()&&t.nodeIsDraggable(De)){var ye=!t.dragData.didDrag;ye&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(we,{inDragLayer:!0});var et={x:0,y:0};if(Gt(it[0])&&Gt(it[1])&&(et.x+=it[0],et.y+=it[1],ye)){var ct=t.hoverData.dragDelta;ct&&Gt(ct[0])&&Gt(ct[1])&&(et.x+=ct[0],et.y+=ct[1])}t.hoverData.draggingEles=!0,we.silentShift(et).emit(oe("position")).emit(oe("drag")),t.redrawHint("drag",!0),t.redraw()}}else ht();j=!0}if(qe[2]=xe[0],qe[3]=xe[1],j)return H.stopPropagation&&H.stopPropagation(),H.preventDefault&&H.preventDefault(),!1}},!1);var O,M,z;t.registerBinding(e,"mouseup",function(H){if(!(t.hoverData.which===1&&H.which!==1&&t.hoverData.capture)){var he=t.hoverData.capture;if(he){t.hoverData.capture=!1;var j=t.cy,pe=t.projectIntoViewport(H.clientX,H.clientY),re=t.selection,Fe=t.findNearestElement(pe[0],pe[1],!0,!1),xe=t.dragData.possibleDragElements,Ue=t.hoverData.down,Me=a(H);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Ue&&Ue.unactivate();var qe=function(be){return{originalEvent:H,type:be,position:{x:pe[0],y:pe[1]}}};if(t.hoverData.which===3){var Le=qe("cxttapend");if(Ue?Ue.emit(Le):j.emit(Le),!t.hoverData.cxtDragged){var Xe=qe("cxttap");Ue?Ue.emit(Xe):j.emit(Xe)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(Fe,["mouseup","tapend","vmouseup"],H,{x:pe[0],y:pe[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Ue,["click","tap","vclick"],H,{x:pe[0],y:pe[1]}),M=!1,H.timeStamp-z<=j.multiClickDebounceTime()?(O&&clearTimeout(O),M=!0,z=null,i(Ue,["dblclick","dbltap","vdblclick"],H,{x:pe[0],y:pe[1]})):(O=setTimeout(function(){M||i(Ue,["oneclick","onetap","voneclick"],H,{x:pe[0],y:pe[1]})},j.multiClickDebounceTime()),z=H.timeStamp)),Ue==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(H)&&(j.$(r).unselect(["tapunselect"]),xe.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=xe=j.collection()),Fe==Ue&&!t.dragData.didDrag&&!t.hoverData.selecting&&Fe!=null&&Fe._private.selectable&&(t.hoverData.dragging||(j.selectionType()==="additive"||Me?Fe.selected()?Fe.unselect(["tapunselect"]):Fe.select(["tapselect"]):Me||(j.$(r).unmerge(Fe).unselect(["tapunselect"]),Fe.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var De=j.collection(t.getAllInBox(re[0],re[1],re[2],re[3]));t.redrawHint("select",!0),De.length>0&&t.redrawHint("eles",!0),j.emit(qe("boxend"));var it=function(be){return be.selectable()&&!be.selected()};j.selectionType()==="additive"||Me||j.$(r).unmerge(De).unselect(),De.emit(qe("box")).stdFilter(it).select().emit(qe("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!re[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var we=Ue&&Ue.grabbed();m(xe),we&&(Ue.emit(qe("freeon")),xe.emit(qe("free")),t.dragData.didDrag&&(Ue.emit(qe("dragfreeon")),xe.emit(qe("dragfree"))))}}re[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var F=[],A=4,R,N=1e5,D=function(H,he){for(var j=0;j=A){var pe=F;if(R=D(pe,5),!R){var re=Math.abs(pe[0]);R=I(pe)&&re>5}if(R)for(var Fe=0;Fe5&&(j=xR(j)*5),Xe=j/-250,R&&(Xe/=N,Xe*=3),Xe=Xe*t.wheelSensitivity;var De=H.deltaMode===1;De&&(Xe*=33);var it=xe.zoom()*Math.pow(10,Xe);H.type==="gesturechange"&&(it=t.gestureStartZoom*H.scale),xe.zoom({level:it,renderedPosition:{x:Le[0],y:Le[1]}}),xe.emit({type:H.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:H,position:{x:qe[0],y:qe[1]}})}}}};t.registerBinding(t.container,"wheel",$,!0),t.registerBinding(e,"scroll",function(H){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(H){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||H.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(Se){t.hasTouchStarted||$(Se)},!0),t.registerBinding(t.container,"mouseout",function(H){var he=t.projectIntoViewport(H.clientX,H.clientY);t.cy.emit({originalEvent:H,type:"mouseout",position:{x:he[0],y:he[1]}})},!1),t.registerBinding(t.container,"mouseover",function(H){var he=t.projectIntoViewport(H.clientX,H.clientY);t.cy.emit({originalEvent:H,type:"mouseover",position:{x:he[0],y:he[1]}})},!1);var B,P,G,V,X,W,ie,K,se,J,Z,ee,ne,ue=function(H,he,j,pe){return Math.sqrt((j-H)*(j-H)+(pe-he)*(pe-he))},fe=function(H,he,j,pe){return(j-H)*(j-H)+(pe-he)*(pe-he)},_e;t.registerBinding(t.container,"touchstart",_e=function(H){if(t.hasTouchStarted=!0,!!_(H)){v(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var he=t.cy,j=t.touchData.now,pe=t.touchData.earlier;if(H.touches[0]){var re=t.projectIntoViewport(H.touches[0].clientX,H.touches[0].clientY);j[0]=re[0],j[1]=re[1]}if(H.touches[1]){var re=t.projectIntoViewport(H.touches[1].clientX,H.touches[1].clientY);j[2]=re[0],j[3]=re[1]}if(H.touches[2]){var re=t.projectIntoViewport(H.touches[2].clientX,H.touches[2].clientY);j[4]=re[0],j[5]=re[1]}var Fe=function(xt){return{originalEvent:H,type:xt,position:{x:j[0],y:j[1]}}};if(H.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var xe=t.findContainerClientCoords();se=xe[0],J=xe[1],Z=xe[2],ee=xe[3],B=H.touches[0].clientX-se,P=H.touches[0].clientY-J,G=H.touches[1].clientX-se,V=H.touches[1].clientY-J,ne=0<=B&&B<=Z&&0<=G&&G<=Z&&0<=P&&P<=ee&&0<=V&&V<=ee;var Ue=he.pan(),Me=he.zoom();X=ue(B,P,G,V),W=fe(B,P,G,V),ie=[(B+G)/2,(P+V)/2],K=[(ie[0]-Ue.x)/Me,(ie[1]-Ue.y)/Me];var qe=200,Le=qe*qe;if(W=1){for(var Et=t.touchData.startPosition=[null,null,null,null,null,null],vt=0;vt=t.touchTapThreshold2}if(he&&t.touchData.cxt){H.preventDefault();var vt=H.touches[0].clientX-se,ot=H.touches[0].clientY-J,It=H.touches[1].clientX-se,xt=H.touches[1].clientY-J,ht=fe(vt,ot,It,xt),oe=ht/W,At=150,dt=At*At,ut=1.5,wt=ut*ut;if(oe>=wt||ht>=dt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Mr=Me("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Mr),t.touchData.start=null):pe.emit(Mr)}}if(he&&t.touchData.cxt){var Mr=Me("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Mr):pe.emit(Mr),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var ye=t.findNearestElement(re[0],re[1],!0,!0);(!t.touchData.cxtOver||ye!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(Me("cxtdragout")),t.touchData.cxtOver=ye,ye&&ye.emit(Me("cxtdragover")))}else if(he&&H.touches[2]&&pe.boxSelectionEnabled())H.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||pe.emit(Me("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,j[4]=1,!j||j.length===0||j[0]===void 0?(j[0]=(re[0]+re[2]+re[4])/3,j[1]=(re[1]+re[3]+re[5])/3,j[2]=(re[0]+re[2]+re[4])/3+1,j[3]=(re[1]+re[3]+re[5])/3+1):(j[2]=(re[0]+re[2]+re[4])/3,j[3]=(re[1]+re[3]+re[5])/3),t.redrawHint("select",!0),t.redraw();else if(he&&H.touches[1]&&!t.touchData.didSelect&&pe.zoomingEnabled()&&pe.panningEnabled()&&pe.userZoomingEnabled()&&pe.userPanningEnabled()){H.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var et=t.dragData.touchDragEles;if(et){t.redrawHint("drag",!0);for(var ct=0;ct0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Ne;t.registerBinding(e,"touchcancel",Ne=function(H){var he=t.touchData.start;t.touchData.capture=!1,he&&he.unactivate()});var me,ve,Ge,Te;if(t.registerBinding(e,"touchend",me=function(H){var he=t.touchData.start,j=t.touchData.capture;if(j)H.touches.length===0&&(t.touchData.capture=!1),H.preventDefault();else return;var pe=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var re=t.cy,Fe=re.zoom(),xe=t.touchData.now,Ue=t.touchData.earlier;if(H.touches[0]){var Me=t.projectIntoViewport(H.touches[0].clientX,H.touches[0].clientY);xe[0]=Me[0],xe[1]=Me[1]}if(H.touches[1]){var Me=t.projectIntoViewport(H.touches[1].clientX,H.touches[1].clientY);xe[2]=Me[0],xe[3]=Me[1]}if(H.touches[2]){var Me=t.projectIntoViewport(H.touches[2].clientX,H.touches[2].clientY);xe[4]=Me[0],xe[5]=Me[1]}var qe=function(dt){return{originalEvent:H,type:dt,position:{x:xe[0],y:xe[1]}}};he&&he.unactivate();var Le;if(t.touchData.cxt){if(Le=qe("cxttapend"),he?he.emit(Le):re.emit(Le),!t.touchData.cxtDragged){var Xe=qe("cxttap");he?he.emit(Xe):re.emit(Xe)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!H.touches[2]&&re.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var De=re.collection(t.getAllInBox(pe[0],pe[1],pe[2],pe[3]));pe[0]=void 0,pe[1]=void 0,pe[2]=void 0,pe[3]=void 0,pe[4]=0,t.redrawHint("select",!0),re.emit(qe("boxend"));var it=function(dt){return dt.selectable()&&!dt.selected()};De.emit(qe("box")).stdFilter(it).select().emit(qe("boxselect")),De.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(he!=null&&he.unactivate(),H.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!H.touches[1]){if(!H.touches[0]){if(!H.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var we=t.dragData.touchDragEles;if(he!=null){var lt=he._private.grabbed;m(we),t.redrawHint("drag",!0),t.redrawHint("eles",!0),lt&&(he.emit(qe("freeon")),we.emit(qe("free")),t.dragData.didDrag&&(he.emit(qe("dragfreeon")),we.emit(qe("dragfree")))),i(he,["touchend","tapend","vmouseup","tapdragout"],H,{x:xe[0],y:xe[1]}),he.unactivate(),t.touchData.start=null}else{var be=t.findNearestElement(xe[0],xe[1],!0,!0);i(be,["touchend","tapend","vmouseup","tapdragout"],H,{x:xe[0],y:xe[1]})}var Et=t.touchData.startPosition[0]-xe[0],vt=Et*Et,ot=t.touchData.startPosition[1]-xe[1],It=ot*ot,xt=vt+It,ht=xt*Fe*Fe;t.touchData.singleTouchMoved||(he||re.$(":selected").unselect(["tapunselect"]),i(he,["tap","vclick"],H,{x:xe[0],y:xe[1]}),ve=!1,H.timeStamp-Te<=re.multiClickDebounceTime()?(Ge&&clearTimeout(Ge),ve=!0,Te=null,i(he,["dbltap","vdblclick"],H,{x:xe[0],y:xe[1]})):(Ge=setTimeout(function(){ve||i(he,["onetap","voneclick"],H,{x:xe[0],y:xe[1]})},re.multiClickDebounceTime()),Te=H.timeStamp)),he!=null&&!t.dragData.didDrag&&he._private.selectable&&ht"u"){var Ze=[],ke=function(H){return{clientX:H.clientX,clientY:H.clientY,force:1,identifier:H.pointerId,pageX:H.pageX,pageY:H.pageY,radiusX:H.width/2,radiusY:H.height/2,screenX:H.screenX,screenY:H.screenY,target:H.target}},Ve=function(H){return{event:H,touch:ke(H)}},Qe=function(H){Ze.push(Ve(H))},nt=function(H){for(var he=0;he0)return G[0]}return null},g=Object.keys(f),m=0;m0?p:GZ(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?eh(i,a):l;var u=2*l;if(Bc(e,r,this.points,s,o,i,a-u,[0,-1],n)||Bc(e,r,this.points,s,o,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(Cs(e,r,f)||Nd(e,r,u,u,s+i/2-l,o+a/2-l,n)||Nd(e,r,u,u,s-i/2+l,o+a/2-l,n))}}},zc.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Za(3,0)),this.generateRoundPolygon("round-triangle",Za(3,0)),this.generatePolygon("rectangle",Za(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Za(5,0)),this.generateRoundPolygon("round-pentagon",Za(5,0)),this.generatePolygon("hexagon",Za(6,0)),this.generateRoundPolygon("round-hexagon",Za(6,0)),this.generatePolygon("heptagon",Za(7,0)),this.generateRoundPolygon("round-heptagon",Za(7,0)),this.generatePolygon("octagon",Za(8,0)),this.generateRoundPolygon("round-octagon",Za(8,0));var n=new Array(20);{var i=CR(5,0),a=CR(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*w)break}else if(u){if(x>=e.deqCost*p||x>=e.deqAvgCost*f)break}else if(b>=e.deqNoDrawCost*JL)break;var k=e.deq(n,y,m);if(k.length>0)for(var S=0;S0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,y,m)&&a())},o=e.priority||pR;i.beforeRender(s,o(n))}}}},Aqe=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v5;Hu(this,t),this.idsByKey=new Pc,this.keyForId=new Pc,this.cachesByLvl=new Pc,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Yu(t,[{key:"getIdsFor",value:function(r){r==null&&Hn("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new k0,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new Pc,n.set(r,a),i.push(r)),a}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])})(),Nee=25,s3=50,o3=-4,eI=3,Oee=7.99,_qe=8,Rqe=1024,Lqe=1024,Iqe=1024,Dqe=.2,Mqe=.8,Nqe=10,Oqe=.15,$qe=.1,Pqe=.9,Bqe=.9,Fqe=100,zqe=1,U0={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Gqe=ha({getKey:null,doesEleInvalidateKey:v5,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:_Z,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ox=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=Gqe(r);yr(n,i),n.lookup=new Aqe(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},qi=ox.prototype;qi.reasons=U0,qi.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},qi.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},qi.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new qb(function(r,n){return n.reqs-r.reqs});return e},qi.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},qi.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(bR(o*r))),n=Oee||n>eI)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=Nee?g=Nee:h<=s3?g=s3:g=Math.ceil(h/s3)*s3,h>Iqe||d>Lqe)return null;var m=a.getTextureQueue(g),y=m[m.length-2],v=function(){return a.recycleTexture(g,d)||a.addTexture(g,d)};y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidthn;M--)L=a.getElement(t,e,r,M,U0.downscale);O()}else return a.queueElement(t,S.level-1),S;else{var z;if(!b&&!w&&!k)for(var F=n-1;F>=o3;F--){var A=l.get(t,F);if(A){z=A;break}}if(x(z))return a.queueElement(t,n),z;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,f,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return p={x:y.usedWidth,texture:y,level:n,scale:u,width:d,height:h,scaledLabelShown:f},y.usedWidth+=Math.ceil(d+_qe),y.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(y),p},qi.invalidateElements=function(t){for(var e=0;e=Dqe*t.width&&this.retireTexture(t)},qi.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>Mqe&&t.fullnessChecks>=Nqe?Zu(r,t):t.fullnessChecks++},qi.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;Zu(n,t),t.retired=!0;for(var a=t.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,gR(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Zu(i,s),n.push(s),s}},qi.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(o),i[a]=o}},qi.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s0;s++){var o=r.pop(),l=o.key,u=o.eles[0],h=a.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,U0.dequeue)}return i},qi.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=fR,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))},qi.onDequeue=function(t){this.onDequeues.push(t)},qi.offDequeue=function(t){Zu(this.onDequeues,t)},qi.setupDequeueing=Mee.setupDequeueing({deqRedrawThreshold:Fqe,deqCost:Oqe,deqAvgCost:$qe,deqNoDrawCost:Pqe,deqFastCost:Bqe,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=Vqe||r>l3)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var O=function(R){if(n.validateLayersElesOrdering(R,t),n.levelIsComplete(R,t))return p=l[R],!0},M=function(R){if(!p)for(var N=r+R;lx<=N&&N<=l3&&!O(N);N+=R);};M(1),M(-1);for(var z=h.length-1;z>=0;z--){var F=h[z];F.invalid&&Zu(h,F)}};if(!f)g();else return h;var m=function(){if(!d){d=ja();for(var O=0;OPee||F>Pee)return null;var A=z*F;if(A>Zqe)return null;var R=n.makeLayer(d,r);if(M!=null){var N=h.indexOf(M)+1;h.splice(N,0,R)}else(O.insert===void 0||O.insert)&&h.unshift(R);return R};if(n.skipping&&!o)return null;for(var v=null,x=t.length/qqe,b=!o,w=0;w=x||!zZ(v.bb,k.boundingBox()))&&(v=y({insert:!0,after:v}),!v))return null;p||b?n.queueLayer(v,k):n.drawEleInLayer(v,k,r,e),v.eles.push(k),C[r]=v}return p||(b?null:h)},pa.getEleLevelForLayerLevel=function(t,e){return t},pa.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,r,Qqe),a.setImgSmoothing(s,!0))},pa.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,a=0;a0||s.invalid)return!1;i+=s.eles.length}return i===e.length},pa.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e},pa.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=$c(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))},pa.invalidateLayer=function(t){if(this.lastInvalidationTime=$c(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];Zu(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,v=u*h,x=u*h,b=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;d==="straight-triangle"?(s.eleStrokeStyle(t,e,R),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,s.eleStrokeStyle(t,e,R),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},w=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;if(t.lineWidth=p+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,y[0],y[1],y[2],R);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},k=function(){i&&s.drawEdgeOverlay(t,e)},S=function(){i&&s.drawEdgeUnderlay(t,e)},C=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x;s.drawArrowheads(t,e,R)},_=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var L=e.pstyle("ghost").value==="yes";if(L){var O=e.pstyle("ghost-offset-x").pfValue,M=e.pstyle("ghost-offset-y").pfValue,z=e.pstyle("ghost-opacity").value,F=v*z;t.translate(O,M),b(F),C(F),t.translate(-O,-M)}else w();S(),b(),C(),k(),_(),r&&t.translate(l.x1,l.y1)}};var Vee=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,o.allpts,"solid")}}}};Gc.drawEdgeOverlay=Vee("overlay"),Gc.drawEdgeUnderlay=Vee("underlay"),Gc.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e),u=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=l,t.textBaseline=u?"alphabetic":"bottom"}else{var h=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(h||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var g=!r,m;r&&(m=r,t.translate(-m.x1,-m.y1)),i==null?(s.drawText(t,e,null,g,a),e.isEdge()&&(s.drawText(t,e,"source",g,a),s.drawText(t,e,"target",g,a))):s.drawText(t,e,i,g,a),r&&t.translate(m.x1,m.y1)},Gd.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function cVe(t,e,r,n,i){var a=Math.min(n,i),s=a/2,o=e+n/2,l=r+i/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function Wee(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(a,n/2,i/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+n-s,r),t.quadraticCurveTo(e+n,r,e+n,r+s),t.lineTo(e+n,r+i-s),t.quadraticCurveTo(e+n,r+i,e+n-s,r+i),t.lineTo(e+s,r+i),t.quadraticCurveTo(e,r+i,e,r+i-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}Gd.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",s=t.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=Ka(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r},Gd.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=Ka(s,"labelX",r),u=Ka(s,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=Ka(s,"labelWidth",r),m=Ka(s,"labelHeight",r),y=Ka(s,"labelActualDescent",r),v=e.pstyle(p+"text-margin-x").pfValue,x=e.pstyle(p+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,k=e.pstyle("text-valign").value;b&&(w="center",k="center"),l+=v,u+=x;var S;n?S=this.getTextAngle(e,r):S=0,S!==0&&(h=l,d=u,t.translate(h,d),t.rotate(S),l=0,u=0);var C=O0(w),_=$0(k);switch(_){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var L=e.pstyle("text-background-opacity").value,O=e.pstyle("text-border-opacity").value,M=e.pstyle("text-border-width").pfValue,z=e.pstyle("text-background-padding").pfValue,F=e.pstyle("text-background-shape").strValue,A=F==="round-rectangle"||F==="roundrectangle",R=F==="circle",N=2;if(L>0||M>0&&O>0){var D=t.fillStyle,I=t.strokeStyle,$=t.lineWidth,B=e.pstyle("text-background-color").value,P=e.pstyle("text-border-color").value,G=e.pstyle("text-border-style").value,V=L>0,X=M>0&&O>0,W=l-z;switch(C){case"left":W-=g;break;case"center":W-=g/2;break}var ie=u-m-z,K=g+2*z,se=m+2*z;if(V&&(t.fillStyle="rgba(".concat(B[0],",").concat(B[1],",").concat(B[2],",").concat(L*o,")")),X&&(t.strokeStyle="rgba(".concat(P[0],",").concat(P[1],",").concat(P[2],",").concat(O*o,")"),t.lineWidth=M,t.setLineDash))switch(G){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=M/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(A?(t.beginPath(),Wee(t,W,ie,K,se,N)):R?(t.beginPath(),cVe(t,W,ie,K,se)):(t.beginPath(),t.rect(W,ie,K,se)),V&&t.fill(),X&&t.stroke(),X&&G==="double"){var J=M/2;t.beginPath(),A?Wee(t,W+J,ie+J,K-2*J,se-2*J,N):t.rect(W+J,ie+J,K-2*J,se-2*J),t.stroke()}t.fillStyle=D,t.strokeStyle=I,t.lineWidth=$,t.setLineDash&&t.setLineDash([])}var Z=2*e.pstyle("text-outline-width").pfValue;if(Z>0&&(t.lineWidth=Z),u-=y,e.pstyle("text-wrap").value==="wrap"){var ee=Ka(s,"labelWrapCachedLines",r),ne=Ka(s,"labelLineHeight",r),ue=g/2,fe=this.getLabelJustification(e);switch(fe==="auto"||(C==="left"?fe==="left"?l+=-g:fe==="center"&&(l+=-ue):C==="center"?fe==="left"?l+=-ue:fe==="right"&&(l+=ue):C==="right"&&(fe==="center"?l+=ue:fe==="right"&&(l+=g))),_){case"top":u-=(ee.length-1)*ne;break;case"center":case"bottom":u-=(ee.length-1)*ne;break}for(var _e=0;_e0&&t.strokeText(ee[_e],l,u),t.fillText(ee[_e],l,u),u+=ne}else Z>0&&t.strokeText(f,l,u),t.fillText(f,l,u);S!==0&&(t.rotate(-S),t.translate(-h,-d))}}};var ch={};ch.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!Gt(d.x)||!Gt(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=s.usePaths(),g,m=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var v;r&&(v=r,t.translate(-v.x1,-v.y1));for(var x=e.pstyle("background-image"),b=x.value,w=new Array(b.length),k=new Array(b.length),S=0,C=0;C0&&arguments[0]!==void 0?arguments[0]:F;s.eleFillStyle(t,e,H)},J=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P;s.colorStrokeStyle(t,A[0],A[1],A[2],H)},Z=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:W;s.colorStrokeStyle(t,V[0],V[1],V[2],H)},ee=function(H,he,j,pe){var re=s.nodePathCache=s.nodePathCache||[],Fe=SZ(j==="polygon"?j+","+pe.join(","):j,""+he,""+H,""+K),xe=re[Fe],Ue,Me=!1;return xe!=null?(Ue=xe,Me=!0,h.pathCache=Ue):(Ue=new Path2D,re[Fe]=h.pathCache=Ue),{path:Ue,cacheHit:Me}},ne=e.pstyle("shape").strValue,ue=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var fe=ee(o,l,ne,ue);g=fe.path,m=fe.cacheHit}var _e=function(){if(!m){var H=d;p&&(H={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,H.x,H.y,o,l,K,h)}p?t.fill(g):t.fill()},Ae=function(){for(var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,j=u.backgrounding,pe=0,re=0;re0&&arguments[0]!==void 0?arguments[0]:!1,he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,he),H&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,K,h)))},me=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,K,h),t.clip()),s.drawStripe(t,e,he),t.restore(),H&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,K,h)))},ve=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,he=(M>0?M:-M)*H,j=M>0?0:255;M!==0&&(s.colorFillStyle(t,j,j,j,he),p?t.fill(g):t.fill())},Ge=function(){if(z>0){if(t.lineWidth=z,t.lineCap=D,t.lineJoin=N,t.setLineDash)switch(R){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash($),t.lineDashOffset=B;break;case"solid":case"double":t.setLineDash([]);break}if(I!=="center"){if(t.save(),t.lineWidth*=2,I==="inside")p?t.clip(g):t.clip();else{var H=new Path2D;H.rect(-o/2-z,-l/2-z,o+2*z,l+2*z),H.addPath(g),t.clip(H,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(R==="double"){t.lineWidth=z/3;var he=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=he}t.setLineDash&&t.setLineDash([])}},Te=function(){if(G>0){if(t.lineWidth=G,t.lineCap="butt",t.setLineDash)switch(X){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var H=d;p&&(H={x:0,y:0});var he=s.getNodeShape(e),j=z;I==="inside"&&(j=0),I==="outside"&&(j*=2);var pe=(o+j+(G+ie))/o,re=(l+j+(G+ie))/l,Fe=o*pe,xe=l*re,Ue=s.nodeShapes[he].points,Me;if(p){var qe=ee(Fe,xe,he,Ue);Me=qe.path}if(he==="ellipse")s.drawEllipsePath(Me||t,H.x,H.y,Fe,xe);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(he)){var Le=0,Xe=0,De=0;he==="round-diamond"?Le=(j+ie+G)*1.4:he==="round-heptagon"?(Le=(j+ie+G)*1.075,De=-(j/2+ie+G)/35):he==="round-hexagon"?Le=(j+ie+G)*1.12:he==="round-pentagon"?(Le=(j+ie+G)*1.13,De=-(j/2+ie+G)/15):he==="round-tag"?(Le=(j+ie+G)*1.12,Xe=(j/2+G+ie)*.07):he==="round-triangle"&&(Le=(j+ie+G)*(Math.PI/2),De=-(j+ie/2+G)/Math.PI),Le!==0&&(pe=(o+Le)/o,Fe=o*pe,["round-hexagon","round-tag"].includes(he)||(re=(l+Le)/l,xe=l*re)),K=K==="auto"?VZ(Fe,xe):K;for(var it=Fe/2,we=xe/2,lt=K+(j+G+ie)/2,be=new Array(Ue.length/2),Et=new Array(Ue.length/2),vt=0;vt0){if(i=i||n.position(),a==null||s==null){var p=n.padding();a=n.width()+2*p,s=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,a+l*2,s+l*2,f),r.fill()}}}};ch.drawNodeOverlay=Uee("overlay"),ch.drawNodeUnderlay=Uee("underlay"),ch.hasPie=function(t){return t=t[0],t._private.hasPie},ch.hasStripe=function(t){return t=t[0],t._private.hasStripe},ch.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),s.units==="%"?p=f*s.pfValue:s.pfValue!==void 0&&(p=s.pfValue/2),!(p>=f))for(var y=1;y<=i.pieBackgroundN;y++){var v=e.pstyle("pie-"+y+"-background-size").value,x=e.pstyle("pie-"+y+"-background-color").value,b=e.pstyle("pie-"+y+"-background-opacity").value*r,w=v/100;w+g>1&&(w=1-g);var k=1.5*Math.PI+2*Math.PI*g;k+=o;var S=2*Math.PI*w,C=k+S;v===0||g>=1||g+w>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,k,C),t.closePath()):(t.beginPath(),t.arc(l,u,f,k,C),t.arc(l,u,p,C,k,!0),t.closePath()),this.colorFillStyle(t,x[0],x[1],x[2],b),t.fill(),g+=w)}},ch.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(a=0,s=0),s-=p/2,a-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var y=e.pstyle("stripe-"+m+"-background-size").value,v=e.pstyle("stripe-"+m+"-background-color").value,x=e.pstyle("stripe-"+m+"-background-opacity").value*r,b=y/100;b+u>1&&(b=1-u),!(y===0||u>=1||u+b>1)&&(t.beginPath(),t.rect(a,s+g*u,p,g*b),t.closePath(),this.colorFillStyle(t,v[0],v[1],v[2],x),t.fill(),u+=b)}t.restore()};var Qa={},uVe=100;Qa.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r},Qa.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;ie.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var x=r.style(),b=r.zoom(),w=s!==void 0?s:b,k=r.pan(),S={x:k.x,y:k.y},C={zoom:b,pan:{x:k.x,y:k.y}},_=e.prevViewport,L=_===void 0||C.zoom!==_.zoom||C.pan.x!==_.pan.x||C.pan.y!==_.pan.y;!L&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(S=o),w*=l,S.x*=l,S.y*=l;var O=e.getCachedZSortedEles();function M(J,Z,ee,ne,ue){var fe=J.globalCompositeOperation;J.globalCompositeOperation="destination-out",e.colorFillStyle(J,255,255,255,e.motionBlurTransparency),J.fillRect(Z,ee,ne,ue),J.globalCompositeOperation=fe}function z(J,Z){var ee,ne,ue,fe;!e.clearingMotionBlur&&(J===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||J===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(ee={x:k.x*p,y:k.y*p},ne=b*p,ue=e.canvasWidth*p,fe=e.canvasHeight*p):(ee=S,ne=w,ue=e.canvasWidth,fe=e.canvasHeight),J.setTransform(1,0,0,1,0,0),Z==="motionBlur"?M(J,0,0,ue,fe):!n&&(Z===void 0||Z)&&J.clearRect(0,0,ue,fe),i||(J.translate(ee.x,ee.y),J.scale(ne,ne)),o&&J.translate(o.x,o.y),s&&J.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var F=e.data.bufferContexts[e.TEXTURE_BUFFER];F.setTransform(1,0,0,1,0,0),F.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:F,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var C=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};C.mpan={x:(0-C.pan.x)/C.zoom,y:(0-C.pan.y)/C.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var A=u.contexts[e.NODE],R=e.textureCache.texture,C=e.textureCache.viewport;A.setTransform(1,0,0,1,0,0),f?M(A,0,0,C.width,C.height):A.clearRect(0,0,C.width,C.height);var N=x.core("outside-texture-bg-color").value,D=x.core("outside-texture-bg-opacity").value;e.colorFillStyle(A,N[0],N[1],N[2],D),A.fillRect(0,0,C.width,C.height);var b=r.zoom();z(A,!1),A.clearRect(C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l),A.drawImage(R,C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var I=r.extent(),$=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),B=e.hideEdgesOnViewport&&$,P=[];if(P[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,P[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),P[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,P[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||P[e.NODE]){var G=f&&!P[e.NODE]&&p!==1,A=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),V=f&&!G?"motionBlur":void 0;z(A,V),B?e.drawCachedNodes(A,O.nondrag,l,I):e.drawLayeredElements(A,O.nondrag,l,I),e.debug&&e.drawDebugPoints(A,O.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||P[e.DRAG])){var G=f&&!P[e.DRAG]&&p!==1,A=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);z(A,f&&!G?"motionBlur":void 0),B?e.drawCachedNodes(A,O.drag,l,I):e.drawCachedElements(A,O.drag,l,I),e.debug&&e.drawDebugPoints(A,O.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,z),f&&p!==1){var X=u.contexts[e.NODE],W=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],ie=u.contexts[e.DRAG],K=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],se=function(Z,ee,ne){Z.setTransform(1,0,0,1,0,0),ne||!v?Z.clearRect(0,0,e.canvasWidth,e.canvasHeight):M(Z,0,0,e.canvasWidth,e.canvasHeight);var ue=p;Z.drawImage(ee,0,0,e.canvasWidth*ue,e.canvasHeight*ue,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||P[e.NODE])&&(se(X,W,P[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||P[e.DRAG])&&(se(ie,K,P[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=C,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},uVe)),n||r.emit("render")};var cx;Qa.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=a.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),y="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!cx){var v=h.measureText(y);cx=v.actualBoundingBoxAscent}h.fillText(y,0,cx);var x=60;h.strokeRect(0,cx+10,250,20),h.fillRect(0,cx+10,250*Math.min(m/x,1),20)}o||(l[r.SELECT_BOX]=!1)}};function Hee(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function hVe(t,e,r){var n=Hee(t,t.VERTEX_SHADER,e),i=Hee(t,t.FRAGMENT_SHADER,r),a=t.createProgram();if(t.attachShader(a,n),t.attachShader(a,i),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function dVe(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function nI(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function fVe(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function pVe(t,e,r,n,i){var a=n*r+e.x,s=i*r+e.y;return s=Math.round(t.canvasHeight-s),[a,s]}function gVe(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function mVe(t,e){if(t.length!==e.length)return!1;for(var r=0;r>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function yVe(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function vVe(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function Yee(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function Xee(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function bVe(t,e,r,n,i,a){switch(e){case t.FLOAT:return new Float32Array(r.buffer,a*n,i);case t.INT:return new Int32Array(r.buffer,a*n,i)}}function xVe(t,e,r,n){var i=Yee(t,e),a=Ri(i,2),s=a[0],o=a[1],l=Xee(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function $l(t,e,r,n){var i=Yee(t,r),a=Ri(i,3),s=a[0],o=a[1],l=a[2],u=Xee(t,o,e*s),h=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;ps&&(o=s/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(b,w){if(i&&w){var k=w.context,S=b.x,C=b.row,_=S,L=l*C;k.save(),k.translate(_,L),k.scale(h,h),i(k,n),k.restore()}},g=[null,null],m=function(){p(a.freePointer,a.canvas),g[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:f},g[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:f},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},y=function(){var b=a.scratch,w=a.canvas;b.clear(),p({x:0,row:0},b);var k=s-a.freePointer.x,S=d-k,C=l;{var _=a.freePointer.x,L=a.freePointer.row*l,O=k;w.context.drawImage(b,0,0,O,C,_,L,O,C),g[0]={x:_,y:L,w:O,h:f}}{var M=k,z=(a.freePointer.row+1)*l,F=S;w&&w.context.drawImage(b,M,0,F,C,0,z,F,C),g[1]={x:0,y:z,w:F,h:f}}a.freePointer.x=S,a.freePointer.row++},v=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(v(),m()):this.enableWrapping?y():(v(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(r),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=ws(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=ws(this.renderTypes.values()),v;try{var x=function(){var w=v.value,k=w.type;if(h(k)){var S=n.collections.get(w.collection),C=w.getKey(m),_=Array.isArray(C)?C:[C];if(s)_.forEach(function(z){return S.markKeyForGC(z)}),f=!0;else{var L=w.getID?w.getID(m):m.id(),O=n._key(k,L),M=n.typeAndIdToKey.get(O);M!==void 0&&!mVe(_,M)&&(d=!0,n.typeAndIdToKey.delete(O),M.forEach(function(z){return S.markKeyForGC(z)}))}}};for(y.s();!(v=y.n()).done;)x()}catch(b){y.e(b)}finally{y.f()}}}}catch(b){p.e(b)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=ws(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(a){r.e(a)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(a,i,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),s.drawElement(f,r,i,!0,!0),f.restore()):s.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=Ri(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=ws(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=Ri(i.value,2),s=a[0],o=a[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])})(),RVe=(function(){function t(e){Hu(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Yu(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])})(),LVe=` float circleSD(vec2 p, float r) { return distance(vec2(0), p) - r; // signed distance } -`,vVe=` +`,IVe=` float rectangleSD(vec2 p, vec2 b) { vec2 d = abs(p)-b; return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0); } -`,bVe=` +`,DVe=` float roundRectangleSD(vec2 p, vec2 b, vec4 cr) { cr.xy = (p.x > 0.0) ? cr.xy : cr.zw; cr.x = (p.y > 0.0) ? cr.x : cr.y; vec2 q = abs(p) - b + cr.x; return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x; } -`,xVe=` +`,MVe=` float ellipseSD(vec2 p, vec2 ab) { p = abs( p ); // symmetry @@ -609,28 +609,28 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) vec2 v = ab*vec2(-cs.y,cs.x); w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v)); } - + // compute final point and distance float d = length(p-ab*vec2(cos(w),sin(w))); - + // return signed distance return (dot(p/ab,p/ab)>1.0) ? d : -d; } -`,lx={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},o3={IGNORE:1,USE_BB:2},tI=0,Hee=1,Yee=2,rI=3,Hp=4,l3=5,cx=6,ux=7,TVe=(function(){function t(e,r,n){Hu(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=Jqe,this.atlasManager=new gVe(e,n),this.batchManager=new mVe(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(lx.SCREEN),this.pickingProgram=this._createShaderProgram(lx.PICKING),this.vao=this._createVAO()}return Yu(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,a=this.atlasManager;return i?a.invalidate(r,{filterType:function(o){return o===i},forceRedraw:!0}):a.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es +`,ux={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},u3={IGNORE:1,USE_BB:2},sI=0,Qee=1,Jee=2,oI=3,Y0=4,h3=5,hx=6,dx=7,NVe=(function(){function t(e,r,n){Hu(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=dVe,this.atlasManager=new _Ve(e,n),this.batchManager=new RVe(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(ux.SCREEN),this.pickingProgram=this._createShaderProgram(ux.PICKING),this.vao=this._createVAO()}return Yu(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,a=this.atlasManager;return i?a.invalidate(r,{filterType:function(o){return o===i},forceRedraw:!0}):a.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es precision highp float; uniform mat3 uPanZoomMatrix; uniform int uAtlasSize; - + // instanced in vec2 aPosition; // a vertex from the unit square - + in mat3 aTransform; // used to transform verticies, eg into a bounding box in int aVertType; // the type of thing we are rendering // the z-index that is output when using picking mode in vec4 aIndex; - + // For textures in int aAtlasId; // which shader unit/atlas to use in vec4 aTex; // x/y/w/h of texture in atlas @@ -650,7 +650,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) out vec4 vColor; out vec2 vPosition; // flat values are not interpolated - flat out int vAtlasId; + flat out int vAtlasId; flat out int vVertType; flat out vec2 vTopRight; flat out vec2 vBotLeft; @@ -658,12 +658,12 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) flat out vec4 vBorderColor; flat out vec2 vBorderWidth; flat out vec4 vIndex; - + void main(void) { int vid = gl_VertexID; vec2 position = aPosition; // TODO make this a vec3, simplifies some code below - if(aVertType == `.concat(tI,`) { + if(aVertType == `.concat(sI,`) { float texX = aTex.x; // texture coordinates float texY = aTex.y; float texW = aTex.z; @@ -681,8 +681,8 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); } - else if(aVertType == `).concat(Hp," || aVertType == ").concat(ux,` - || aVertType == `).concat(l3," || aVertType == ").concat(cx,`) { // simple shapes + else if(aVertType == `).concat(Y0," || aVertType == ").concat(dx,` + || aVertType == `).concat(h3," || aVertType == ").concat(hx,`) { // simple shapes // the bounding box is needed by the fragment shader vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat @@ -697,7 +697,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); } - else if(aVertType == `).concat(Hee,`) { + else if(aVertType == `).concat(Qee,`) { vec2 source = aPointAPointB.xy; vec2 target = aPointAPointB.zw; @@ -711,8 +711,8 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0); vColor = aColor; - } - else if(aVertType == `).concat(Yee,`) { + } + else if(aVertType == `).concat(Jee,`) { vec2 pointA = aPointAPointB.xy; vec2 pointB = aPointAPointB.zw; vec2 pointC = aPointCPointD.xy; @@ -760,8 +760,8 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) } vColor = aColor; - } - else if(aVertType == `).concat(rI,` && vid < 3) { + } + else if(aVertType == `).concat(oI,` && vid < 3) { // massage the first triangle into an edge arrow if(vid == 0) position = vec2(-0.15, -0.3); @@ -806,40 +806,40 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) out vec4 outColor; - `).concat(yVe,` - `).concat(vVe,` - `).concat(bVe,` - `).concat(xVe,` + `).concat(LVe,` + `).concat(IVe,` + `).concat(DVe,` + `).concat(MVe,` vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha - return vec4( + return vec4( top.rgb + (bot.rgb * (1.0 - top.a)), - top.a + (bot.a * (1.0 - top.a)) + top.a + (bot.a * (1.0 - top.a)) ); } vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance // scale to the zoom level so that borders don't look blurry when zoomed in // note 1.5 is an aribitrary value chosen because it looks good - return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); + return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); } void main(void) { - if(vVertType == `).concat(tI,`) { + if(vVertType == `).concat(sI,`) { // look up the texel from the texture unit `).concat(a.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(` else `),` - } - else if(vVertType == `).concat(rI,`) { + } + else if(vVertType == `).concat(oI,`) { // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out'; outColor = blend(vColor, uBGColor); outColor.a = 1.0; // make opaque, masks out line under arrow } - else if(vVertType == `).concat(Hp,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border + else if(vVertType == `).concat(Y0,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done } - else if(vVertType == `).concat(Hp," || vVertType == ").concat(ux,` - || vVertType == `).concat(l3," || vVertType == ").concat(cx,`) { // use SDF + else if(vVertType == `).concat(Y0," || vVertType == ").concat(dx,` + || vVertType == `).concat(h3," || vVertType == ").concat(hx,`) { // use SDF float outerBorder = vBorderWidth[0]; float innerBorder = vBorderWidth[1]; @@ -850,11 +850,11 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center float d; // signed distance - if(vVertType == `).concat(Hp,`) { + if(vVertType == `).concat(Y0,`) { d = rectangleSD(p, b); - } else if(vVertType == `).concat(ux,` && w == h) { + } else if(vVertType == `).concat(dx,` && w == h) { d = circleSD(p, b.x); // faster than ellipse - } else if(vVertType == `).concat(ux,`) { + } else if(vVertType == `).concat(dx,`) { d = ellipseSD(p, b); } else { d = roundRectangleSD(p, b, vCornerRadius.wzyx); @@ -873,7 +873,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor; vec4 innerBorderColor = blend(vBorderColor, vColor); outColor = distInterp(innerBorderColor, outerColor, d); - } + } else { vec4 outerColor; if(innerBorder == 0.0 && outerBorder == 0.0) { @@ -894,16 +894,16 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) `).concat(r.picking?`if(outColor.a == 0.0) discard; else outColor = vIndex;`:"",` } - `),o=Qqe(n,i,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:lx.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,i){var a=this.atlasManager,s=this.batchManager,o=a.getRenderTypeOpts(i);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===o3.IGNORE)return;if(l==o3.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=ws(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;s.canAddToCurrentBatch(p)||this.endBatch();for(var y=s.getAtlasIndexForBatch(p),v=0,T=[[g,!0],[m,!1]];v=this.maxInstances&&this.endBatch()}}}}catch(M){h.e(M)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=r.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,u=a.tex1,h=a.tex2,d=u.w/(u.w+h.w);s||(d=1-d);var f=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,o,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,a){var s,o;Wee(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;s3(r,r,[h,d]),Uee(r,r,l);var f=i.getRotationOffset(a);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;s3(r,r,[s,o]),eI(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,a){var s=r.x1,o=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*a;return i&&a<1?l=f:!i&&a<1&&(d=l-f,s+=d,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=Hp;var o=this.indexBuffer.getView(s);Up(n,o);var l=this.colorBuffer.getView(s);qd([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(r,u,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var a=this.simpleShapeOptions.get(i);if(this._isVisible(r,a)){var s=a.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||a.isSimple&&!a.isSimple(r,this.renderTarget)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===l3||o===cx){var u=a.getBoundingBox(r),h=this._getCornerRadius(r,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===cx&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);Up(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(s.opacity).value*p,m=r.pstyle(s.color).value,y=this.colorBuffer.getView(l);qd(m,g,y);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,s.border){var T=r.pstyle("border-width").value;if(T>0){var b=r.pstyle("border-color").value,w=p*r.pstyle("border-opacity").value,k=this.borderColorBuffer.getView(l);qd(b,w,k);var A=r.pstyle("border-position").value;if(A==="inside")v[0]=0,v[1]=-T;else if(A==="outside")v[0]=T,v[1]=0;else{var C=T/2;v[0]=C,v[1]=-C}}}var _=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,_,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var i=r.pstyle(n).value;switch(i){case"rectangle":return Hp;case"ellipse":return ux;case"roundrectangle":case"round-rectangle":return l3;case"bottom-round-rectangle":return cx;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,s=i.h;if(r.pstyle(n).value==="auto")return eh(a,s);var o=r.pstyle(n).pfValue,l=a/2,u=s/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var a=r._private.rscratch,s,o,l;if(i==="source"?(s=a.arrowStartX,o=a.arrowStartY,l=a.srcArrowAngle):(s=a.arrowEndX,o=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(i+"-arrow-shape").value;if(u!=="none"){var h=r.pstyle(i+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=d*f,g=r.pstyle("width").pfValue,m=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(g,m),v=this.instanceCount,T=this.transformBuffer.getMatrixView(v);Wee(T),s3(T,T,[s,o]),eI(T,T,[y,y]),Uee(T,T,l),this.vertTypeBuffer.getView(v)[0]=rI;var b=this.indexBuffer.getView(v);Up(n,b);var w=this.colorBuffer.getView(v);qd(h,p,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var a=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=Hee;var d=this.indexBuffer.getView(h);Up(n,d);var f=this.colorBuffer.getView(h);qd(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=o;var g=this.pointAPointBBuffer.getView(h);g[0]=i[0],g[1]=i[1],g[2]=i[2],g[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var m=0;m=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var i=n.allpts;if(i.length==4)return i;var a=this._getNumSegments(r);return this._getCurveSegmentPoints(i,a)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var i=Array((n+1)*2),a=0;a<=n;a++)if(a==0)i[0]=r[0],i[1]=r[1];else if(a==n)i[a*2]=r[r.length-2],i[a*2+1]=r[r.length-1];else{var s=a/n;this._setCurvePoint(r,s,i,a*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,a){if(r.length<=2)i[a]=r[0],i[a+1]=r[1];else{for(var s=Array(r.length-2),o=0;o0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?o3.USE_BB:o3.IGNORE},l=function(d){var f=d.position(),p=f.x,g=f.y,m=d.outerWidth(),y=d.outerHeight();return{w:m,h:y,x1:p-m/2,y1:g-y/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:rVe,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:nI(e.getLabelKey,null),getBoundingBox:iI(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:a("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:nI(e.getSourceLabelKey,"source"),getBoundingBox:iI(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:a("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:nI(e.getTargetLabelKey,"target"),getBoundingBox:iI(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=$b(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(h,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),CVe(r)};function wVe(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return Qj(r)}function Kee(t,e){var r=t._private.rscratch;return Ka(r,"labelWrapCachedLines",e)||[]}var nI=function(e,r){return function(n){var i=e(n),a=Kee(n,r);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},iI=function(e,r){return function(n,i){var a=e(n);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var o=Number(i.substring(s+1)),l=Kee(n,r),u=a.h/l.length,h=u*o,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:u,yOffset:h}}}return a}};function CVe(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>Ree?(kVe(t),e.call(t,a)):(EVe(t),Zee(t,a,lx.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(a){r.call(t,a),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(a,s,o,l){return IVe(t,a,s)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(a,s){i.call(t,a,s),a==="viewport"||a==="bounds"?t.pickingFrameBuffer.needsDraw=!0:a==="background"&&t.drawing.invalidate(s,{type:"node-body"})}}}function kVe(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function EVe(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function SVe(t){var e=t.canvasWidth,r=t.canvasHeight,n=QL(t),i=n.pan,a=n.zoom,s=JL();s3(s,s,[i.x,i.y]),eI(s,s,[a,a]);var o=JL();hVe(o,e,r);var l=JL();return uVe(l,o,s),l}function jee(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=QL(t),a=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(a.x,a.y),e.scale(s,s)}function AVe(t,e){t.drawSelectionRectangle(e,function(r){return jee(t,r)})}function _Ve(t){var e=t.data.contexts[t.NODE];e.save(),jee(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function RVe(t){var e=function(i,a,s){for(var o=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h=0&&w.add(C)}return w}function IVe(t,e,r){var n=LVe(t,e,r),i=t.getCachedZSortedEles(),a,s,o=ws(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,h=i[u];if(!a&&h.isNode()&&(a=h),!s&&h.isEdge()&&(s=h),a&&s)break}}catch(d){o.e(d)}finally{o.f()}return[a,s].filter(Boolean)}function aI(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function Zee(t,e,r){var n;t.webglDebug&&(n=performance.now());var i=t.drawing,a=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&AVe(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];r.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=SVe(t),l=t.getCachedZSortedEles();if(a=l.length,i.startFrame(o,r),r.screen){for(var u=0;u0&&s>0){p.clearRect(0,0,a,s),p.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)p.translate(-n.x1*u,-n.y1*u),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(n.x1*u,n.y1*u);else{var m=e.pan(),y={x:m.x*u,y:m.y*u};u*=e.zoom(),p.translate(y.x,y.y),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(-y.x,-y.y)}t.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=t.bg,p.rect(0,0,a,s),p.fill())}return f};function DVe(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":Fi(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=t,r.height=e}return r},[Nee,Ol,Gc,ZL,Gd,ch,Qa,Xee,uh,hx,nte].forEach(function(t){yr(Br,t)});var OVe=[{name:"null",impl:see},{name:"base",impl:See},{name:"canvas",impl:MVe}],$Ve=[{type:"layout",extensions:aqe},{type:"renderer",extensions:OVe}],ate={},ste={};function ote(t,e,r){var n=r,i=function(_){cn("Can not register `"+e+"` for `"+t+"` since `"+_+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(tx.prototype[e])return i(e);tx.prototype[e]=r}else if(t==="collection"){if(fa.prototype[e])return i(e);fa.prototype[e]=r}else if(t==="layout"){for(var a=function(_){this.options=_,r.call(this,_),Kr(this._private)||(this._private={}),this._private.cy=_.cy,this._private.listeners=[],this.createEmitter()},s=a.prototype=Object.create(r.prototype),o=[],l=0;lg&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>m&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-m)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-m),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(6),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,T){a.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,T){if(v==null&&T==null){var b=y;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}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(v.owner==T.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=T.owner?null:(w.source=v,w.target=T,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),T!=v&&T.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=v.edges.slice(),b,w=T.length,k=0;k-1&&_>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(C,1),b.target!=b.source&&b.target.edges.splice(_,1);var A=b.source.owner.getEdges().indexOf(b);if(A==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(A,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,T,b,w,k=this.getNodes(),A=k.length,C=0;CT&&(y=T),v>b&&(v=b)}return y==s.MAX_VALUE?null:(k[0].getParent().paddingLeft!=null?w=k[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,k,A,C,_,L,O=this.nodes,M=O.length,z=0;zk&&(v=k),TC&&(b=C),w<_&&(w=_)}var S=new d(v,b,T-v,w-b);v==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),O[0].getParent().paddingLeft!=null?L=O[0].getParent().paddingLeft:L=this.margin,this.left=S.x-L,this.right=S.x+S.width+L,this.top=S.y-L,this.bottom=S.y+S.height+L},g.calculateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,k,A,C,_,L=y.length,O=0;Ok&&(v=k),TC&&(b=C),w<_&&(w=_)}var z=new d(v,b,T-v,w-b);return z},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var y=0,v=this.nodes,T=v.length,b=0;b=this.nodes.length){var M=0;T.forEach(function(z){z.owner==y&&M++}),M==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=O,!1;if(df)return u[0]=g,u[1]=d,u[2]=_,u[3]=p,!1;if(hf?(u[0]=v,u[1]=T,S=!0):(u[0]=y,u[1]=m,S=!0):N===I&&(h>f?(u[0]=g,u[1]=m,S=!0):(u[0]=b,u[1]=T,S=!0)),-D===I?f>h?(u[2]=L,u[3]=O,R=!0):(u[2]=_,u[3]=C,R=!0):D===I&&(f>h?(u[2]=A,u[3]=C,R=!0):(u[2]=M,u[3]=O,R=!0)),S&&R)return!1;if(h>f?d>p?($=this.getCardinalDirection(N,I,4),B=this.getCardinalDirection(D,I,2)):($=this.getCardinalDirection(-N,I,3),B=this.getCardinalDirection(-D,I,1)):d>p?($=this.getCardinalDirection(-N,I,1),B=this.getCardinalDirection(-D,I,3)):($=this.getCardinalDirection(N,I,2),B=this.getCardinalDirection(D,I,4)),!S)switch($){case 1:G=m,P=h+-k/I,u[0]=P,u[1]=G;break;case 2:P=b,G=d+w*I,u[0]=P,u[1]=G;break;case 3:G=T,P=h+k/I,u[0]=P,u[1]=G;break;case 4:P=v,G=d+-w*I,u[0]=P,u[1]=G;break}if(!R)switch(B){case 1:Y=C,V=f+-F/I,u[2]=V,u[3]=Y;break;case 2:V=M,Y=p+z*I,u[2]=V,u[3]=Y;break;case 3:Y=O,V=f+F/I,u[2]=V,u[3]=Y;break;case 4:V=L,Y=p+-z*I,u[2]=V,u[3]=Y;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,T=h.y,b=void 0,w=void 0,k=void 0,A=void 0,C=void 0,_=void 0,L=void 0,O=void 0,M=void 0;return k=g-f,C=d-p,L=p*f-d*g,A=T-y,_=m-v,O=v*y-m*T,M=k*_-A*C,M===0?null:(b=(C*O-_*L)/M,w=(A*L-k*O)/M,new a(b,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(k.push(C[0]);k.length>0&&y;){var _=k[0];k.splice(0,1),w.add(_);for(var L=_.getEdges(),b=0;b-1&&C.splice(F,1)}w=new Set,A=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,T=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var T=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(O,1);var M=A.getNeighborsList();M.forEach(function(S){if(v.indexOf(S)<0){var R=T.get(S),N=R-1;N==1&&_.push(S),T.set(S,N)}})}v=v.concat(_),(y.length==1||y.length==2)&&(b=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(4);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,T,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mk||w>k)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*T)):(k=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>k||w>k)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||k>=b[0].length)){for(var A=0;Ad}}]),u})();r.exports=l}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;uh.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),h.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},l.prototype.propogateDisplacementToChildren=function(h,d){for(var f=this.getChild().getNodes(),p,g=0;g0)this.positionNodesRadially(C);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var _=new Set(this.getAllNodes()),L=this.nodesWithGravity.filter(function(O){return _.has(O)});this.graphManager.setAllNodesToApplyGravitation(L),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},k.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!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 C=new Set(this.getAllNodes()),_=this.nodesWithGravity.filter(function(M){return C.has(M)});this.graphManager.setAllNodesToApplyGravitation(_),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.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()),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var L=!this.isTreeGrowing&&!this.isGrowthFinished,O=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(L,O),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},k.prototype.getPositionsData=function(){for(var C=this.graphManager.getAllNodes(),_={},L=0;L1){var S;for(S=0;SO&&(O=Math.floor(F.y)),z=Math.floor(F.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-F.x/2,p.WORLD_CENTER_Y-F.y/2))},k.radialLayout=function(C,_,L){var O=Math.max(this.maxDiagonalInTree(C),d.DEFAULT_RADIAL_SEPARATION);k.branchRadialLayout(_,null,0,359,0,O);var M=b.calculateBounds(C),z=new w;z.setDeviceOrgX(M.getMinX()),z.setDeviceOrgY(M.getMinY()),z.setWorldOrgX(L.x),z.setWorldOrgY(L.y);for(var F=0;F1;){var Y=V[0];V.splice(0,1);var W=I.indexOf(Y);W>=0&&I.splice(W,1),P--,$--}_!=null?G=(I.indexOf(V[0])+1)%P:G=0;for(var ie=Math.abs(O-L)/$,K=G;B!=$;K=++K%P){var se=I[K].getOtherEnd(C);if(se!=_){var J=(L+B*ie)%360,Z=(J+ie)%360;k.branchRadialLayout(se,C,J,Z,M+z,z),B++}}},k.maxDiagonalInTree=function(C){for(var _=v.MIN_VALUE,L=0;L_&&(_=M)}return _},k.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},k.prototype.groupZeroDegreeMembers=function(){var C=this,_={};this.memberGroups={},this.idToDummyNode={};for(var L=[],O=this.graphManager.getAllNodes(),M=0;M"u"&&(_[S]=[]),_[S]=_[S].concat(z)}Object.keys(_).forEach(function(R){if(_[R].length>1){var N="DummyCompound_"+R;C.memberGroups[N]=_[R];var D=_[R][0].getParent(),I=new u(C.graphManager);I.id=N,I.paddingLeft=D.paddingLeft||0,I.paddingRight=D.paddingRight||0,I.paddingBottom=D.paddingBottom||0,I.paddingTop=D.paddingTop||0,C.idToDummyNode[N]=I;var $=C.getGraphManager().add(C.newGraph(),I),B=D.getChild();B.add(I);for(var P=0;P<_[R].length;P++){var G=_[R][P];B.remove(G),$.add(G)}}})},k.prototype.clearCompounds=function(){var C={},_={};this.performDFSOnCompounds();for(var L=0;L=0;C--){var _=this.compoundOrder[C],L=_.id,O=_.paddingLeft,M=_.paddingTop;this.adjustLocations(this.tiledMemberPack[L],_.rect.x,_.rect.y,O,M)}},k.prototype.repopulateZeroDegreeMembers=function(){var C=this,_=this.tiledZeroDegreePack;Object.keys(_).forEach(function(L){var O=C.idToDummyNode[L],M=O.paddingLeft,z=O.paddingTop;C.adjustLocations(_[L],O.rect.x,O.rect.y,M,z)})},k.prototype.getToBeTiled=function(C){var _=C.id;if(this.toBeTiled[_]!=null)return this.toBeTiled[_];var L=C.getChild();if(L==null)return this.toBeTiled[_]=!1,!1;for(var O=L.getNodes(),M=0;M0)return this.toBeTiled[_]=!1,!1;if(z.getChild()==null){this.toBeTiled[z.id]=!1;continue}if(!this.getToBeTiled(z))return this.toBeTiled[_]=!1,!1}return this.toBeTiled[_]=!0,!0},k.prototype.getNodeDegree=function(C){C.id;for(var _=C.getEdges(),L=0,O=0;O<_.length;O++){var M=_[O];M.getSource().id!==M.getTarget().id&&(L=L+1)}return L},k.prototype.getNodeDegreeWithChildren=function(C){var _=this.getNodeDegree(C);if(C.getChild()==null)return _;for(var L=C.getChild().getNodes(),O=0;OR&&(R=D.rect.height)}L+=R+C.verticalPadding}},k.prototype.tileCompoundMembers=function(C,_){var L=this;this.tiledMemberPack=[],Object.keys(C).forEach(function(O){var M=_[O];L.tiledMemberPack[O]=L.tileNodes(C[O],M.paddingLeft+M.paddingRight),M.rect.width=L.tiledMemberPack[O].width,M.rect.height=L.tiledMemberPack[O].height})},k.prototype.tileNodes=function(C,_){var L=d.TILING_PADDING_VERTICAL,O=d.TILING_PADDING_HORIZONTAL,M={rows:[],rowWidth:[],rowHeight:[],width:0,height:_,verticalPadding:L,horizontalPadding:O};C.sort(function(S,R){return S.rect.width*S.rect.height>R.rect.width*R.rect.height?-1:S.rect.width*S.rect.height0&&(F+=C.horizontalPadding),C.rowWidth[L]=F,C.width0&&(S+=C.verticalPadding);var R=0;S>C.rowHeight[L]&&(R=C.rowHeight[L],C.rowHeight[L]=S,R=C.rowHeight[L]-R),C.height+=R,C.rows[L].push(_)},k.prototype.getShortestRowIndex=function(C){for(var _=-1,L=Number.MAX_VALUE,O=0;OL&&(_=O,L=C.rowWidth[O]);return _},k.prototype.canAddHorizontal=function(C,_,L){var O=this.getShortestRowIndex(C);if(O<0)return!0;var M=C.rowWidth[O];if(M+C.horizontalPadding+_<=C.width)return!0;var z=0;C.rowHeight[O]0&&(z=L+C.verticalPadding-C.rowHeight[O]);var F;C.width-M>=_+C.horizontalPadding?F=(C.height+z)/(M+_+C.horizontalPadding):F=(C.height+z)/C.width,z=L+C.verticalPadding;var S;return C.width<_?S=(C.height+z)/_:S=(C.height+z)/C.width,S<1&&(S=1/S),F<1&&(F=1/F),Fz&&_!=L){O.splice(-1,1),C.rows[L].push(M),C.rowWidth[_]=C.rowWidth[_]-z,C.rowWidth[L]=C.rowWidth[L]+z,C.width=C.rowWidth[instance.getLongestRowIndex(C)];for(var F=Number.MIN_VALUE,S=0;SF&&(F=O[S].height);_>0&&(F+=C.verticalPadding);var R=C.rowHeight[_]+C.rowHeight[L];C.rowHeight[_]=F,C.rowHeight[L]0)for(var B=M;B<=z;B++)$[0]+=this.grid[B][F-1].length+this.grid[B][F].length-1;if(z0)for(var B=F;B<=S;B++)$[3]+=this.grid[M-1][B].length+this.grid[M][B].length-1;for(var P=v.MAX_VALUE,G,V,Y=0;Y<$.length;Y++)$[Y]0){var S;S=w.getGraphManager().add(w.newGraph(),L),this.processChildrenList(S,_,w)}}},m.prototype.stop=function(){return this.stopped=!0,this};var v=function(b){b("layout","cose-bilkent",m)};typeof cytoscape<"u"&&v(cytoscape),n.exports=v})])})})(u3)),u3.exports}var HVe=UVe();const YVe=Os(HVe);Pl.use(YVe);function dte(t,e){t.forEach(r=>{const n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),e.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}x(dte,"addNodes");function fte(t,e){t.forEach(r=>{const n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),e.add({group:"edges",data:n})})}x(fte,"addEdges");function pte(t){return new Promise(e=>{const r=pt("body").append("div").attr("id","cy").attr("style","display:none"),n=Pl({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),dte(t.nodes,n),fte(t.edges,n),n.nodes().forEach(function(a){a.layoutDimensions=()=>{const s=a.data();return{w:s.width,h:s.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(a=>{ae.info("Cytoscape ready",a),e(n)})})}x(pte,"createCytoscapeInstance");function gte(t){return t.nodes().map(e=>{const r=e.data(),n=e.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(a=>{a!=="id"&&(i[a]=r[a])}),i})}x(gte,"extractPositionedNodes");function mte(t){return t.edges().map(e=>{const r=e.data(),n=e._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(a=>{["id","source","target"].includes(a)||(i[a]=r[a])}),i})}x(mte,"extractPositionedEdges");async function yte(t,e){ae.debug("Starting cose-bilkent layout algorithm");try{vte(t);const r=await pte(t),n=gte(r),i=mte(r);return ae.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw ae.error("Error in cose-bilkent layout algorithm:",r),r}}x(yte,"executeCoseBilkentLayout");function vte(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}x(vte,"validateLayoutData");var XVe=x(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:s,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");a(f,t.markers,t.type,t.diagramId);const p=f.insert("g").attr("class","subgraphs"),g=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),y=f.insert("g").attr("class","nodes");o.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async b=>{if(b.isGroup){const w={...b};d[b.id]=w,h[b.id]=w,await r(p,b)}else{const w={...b};h[b.id]=w;const k=await s(y,b,{config:t.config,dir:t.direction||"TB"}),A=k.node().getBBox();w.width=A.width,w.height=A.height,w.domId=k,o.debug(`Node ${b.id} dimensions: ${A.width}x${A.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const v={...t,nodes:t.nodes.map(b=>{const w=h[b.id];return{...b,width:w.width,height:w.height}})},T=await yte(v,t.config);o.debug("Positioning nodes based on layout results"),T.nodes.forEach(b=>{const w=h[b.id];w!=null&&w.domId&&(w.domId.attr("transform",`translate(${b.x}, ${b.y})`),w.x=b.x,w.y=b.y,o.debug(`Positioned node ${w.id} at center (${b.x}, ${b.y})`))}),T.edges.forEach(b=>{const w=t.edges.find(k=>k.id===b.id);w&&(w.points=[{x:b.startX,y:b.startY},{x:b.midX,y:b.midY},{x:b.endX,y:b.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async b=>{await i(m,b);const w=h[b.start??""],k=h[b.end??""];if(w&&k){const A=T.edges.find(C=>C.id===b.id);if(A){o.debug("APA01 positionedEdge",A);const C={...b},_=n(g,C,d,t.type,w,k,t.diagramId);l(C,_)}else{const C={...b,points:[{x:w.x||0,y:w.y||0},{x:k.x||0,y:k.y||0}]},_=n(g,C,d,t.type,w,k,t.diagramId);l(C,_)}}})),o.debug("Cose-bilkent rendering completed")},"render"),KVe=XVe;const jVe=Object.freeze(Object.defineProperty({__proto__:null,render:KVe},Symbol.toStringTag,{value:"Module"}));var f3=x((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),bte=x((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};f3(t,r).lower()},"drawBackgroundRect"),ZVe=x((t,e)=>{const r=e.text.replace(k0," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),cI=x((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=cd.sanitizeUrl(n);i.attr("xlink:href",a)},"drawImage"),uI=x((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=cd.sanitizeUrl(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),Ys=x(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),hI=x(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),xte=x(()=>{let t=pt(".mermaidTooltip");return t.empty()&&(t=pt("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip"),p3=(function(){var t=x(function(ke,Ve,Qe,nt){for(Qe=Qe||{},nt=ke.length;nt--;Qe[ke[nt]]=Ve);return Qe},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],o=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],f=[1,69],p=[1,29],g=[1,30],m=[1,31],y=[1,32],v=[1,33],T=[1,34],b=[1,35],w=[1,36],k=[1,37],A=[1,38],C=[1,39],_=[1,40],L=[1,41],O=[1,42],M=[1,43],z=[1,44],F=[1,45],S=[1,46],R=[1,47],N=[1,48],D=[1,50],I=[1,51],$=[1,52],B=[1,53],P=[1,54],G=[1,55],V=[1,56],Y=[1,57],W=[1,58],ie=[1,59],K=[1,60],se=[14,42],J=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Z=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ee=[1,82],ne=[1,83],ue=[1,84],fe=[1,85],_e=[12,14,42],Ae=[12,14,33,42],Ne=[12,14,33,42,76,77,79,80],me=[12,33],ve=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ge={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:x(function(Ve,Qe,nt,tt,je,Ce,Se){var H=Ce.length-1;switch(je){case 3:tt.setDirection("TB");break;case 4:tt.setDirection("BT");break;case 5:tt.setDirection("RL");break;case 6:tt.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:tt.setC4Type(Ce[H-3]);break;case 19:tt.setTitle(Ce[H].substring(6)),this.$=Ce[H].substring(6);break;case 20:tt.setAccDescription(Ce[H].substring(15)),this.$=Ce[H].substring(15);break;case 21:this.$=Ce[H].trim(),tt.setTitle(this.$);break;case 22:case 23:this.$=Ce[H].trim(),tt.setAccDescription(this.$);break;case 28:Ce[H].splice(2,0,"ENTERPRISE"),tt.addPersonOrSystemBoundary(...Ce[H]),this.$=Ce[H];break;case 29:Ce[H].splice(2,0,"SYSTEM"),tt.addPersonOrSystemBoundary(...Ce[H]),this.$=Ce[H];break;case 30:tt.addPersonOrSystemBoundary(...Ce[H]),this.$=Ce[H];break;case 31:Ce[H].splice(2,0,"CONTAINER"),tt.addContainerBoundary(...Ce[H]),this.$=Ce[H];break;case 32:tt.addDeploymentNode("node",...Ce[H]),this.$=Ce[H];break;case 33:tt.addDeploymentNode("nodeL",...Ce[H]),this.$=Ce[H];break;case 34:tt.addDeploymentNode("nodeR",...Ce[H]),this.$=Ce[H];break;case 35:tt.popBoundaryParseStack();break;case 39:tt.addPersonOrSystem("person",...Ce[H]),this.$=Ce[H];break;case 40:tt.addPersonOrSystem("external_person",...Ce[H]),this.$=Ce[H];break;case 41:tt.addPersonOrSystem("system",...Ce[H]),this.$=Ce[H];break;case 42:tt.addPersonOrSystem("system_db",...Ce[H]),this.$=Ce[H];break;case 43:tt.addPersonOrSystem("system_queue",...Ce[H]),this.$=Ce[H];break;case 44:tt.addPersonOrSystem("external_system",...Ce[H]),this.$=Ce[H];break;case 45:tt.addPersonOrSystem("external_system_db",...Ce[H]),this.$=Ce[H];break;case 46:tt.addPersonOrSystem("external_system_queue",...Ce[H]),this.$=Ce[H];break;case 47:tt.addContainer("container",...Ce[H]),this.$=Ce[H];break;case 48:tt.addContainer("container_db",...Ce[H]),this.$=Ce[H];break;case 49:tt.addContainer("container_queue",...Ce[H]),this.$=Ce[H];break;case 50:tt.addContainer("external_container",...Ce[H]),this.$=Ce[H];break;case 51:tt.addContainer("external_container_db",...Ce[H]),this.$=Ce[H];break;case 52:tt.addContainer("external_container_queue",...Ce[H]),this.$=Ce[H];break;case 53:tt.addComponent("component",...Ce[H]),this.$=Ce[H];break;case 54:tt.addComponent("component_db",...Ce[H]),this.$=Ce[H];break;case 55:tt.addComponent("component_queue",...Ce[H]),this.$=Ce[H];break;case 56:tt.addComponent("external_component",...Ce[H]),this.$=Ce[H];break;case 57:tt.addComponent("external_component_db",...Ce[H]),this.$=Ce[H];break;case 58:tt.addComponent("external_component_queue",...Ce[H]),this.$=Ce[H];break;case 60:tt.addRel("rel",...Ce[H]),this.$=Ce[H];break;case 61:tt.addRel("birel",...Ce[H]),this.$=Ce[H];break;case 62:tt.addRel("rel_u",...Ce[H]),this.$=Ce[H];break;case 63:tt.addRel("rel_d",...Ce[H]),this.$=Ce[H];break;case 64:tt.addRel("rel_l",...Ce[H]),this.$=Ce[H];break;case 65:tt.addRel("rel_r",...Ce[H]),this.$=Ce[H];break;case 66:tt.addRel("rel_b",...Ce[H]),this.$=Ce[H];break;case 67:Ce[H].splice(0,1),tt.addRel("rel",...Ce[H]),this.$=Ce[H];break;case 68:tt.updateElStyle("update_el_style",...Ce[H]),this.$=Ce[H];break;case 69:tt.updateRelStyle("update_rel_style",...Ce[H]),this.$=Ce[H];break;case 70:tt.updateLayoutConfig("update_layout_config",...Ce[H]),this.$=Ce[H];break;case 71:this.$=[Ce[H]];break;case 72:Ce[H].unshift(Ce[H-1]),this.$=Ce[H];break;case 73:case 75:this.$=Ce[H].trim();break;case 74:let he={};he[Ce[H-1].trim()]=Ce[H].trim(),this.$=he;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:k,53:A,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:S,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:Y,72:W,73:ie,74:K},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:k,53:A,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:S,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:Y,72:W,73:ie,74:K},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:k,53:A,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:S,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:Y,72:W,73:ie,74:K},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:k,53:A,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:S,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:Y,72:W,73:ie,74:K},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:k,53:A,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:S,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:Y,72:W,73:ie,74:K},{14:[1,74]},t(se,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:k,53:A,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:S,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:Y,72:W,73:ie,74:K}),t(se,[2,14]),t(J,[2,16],{12:[1,76]}),t(se,[2,36],{12:[1,77]}),t(Z,[2,19]),t(Z,[2,20]),{25:[1,78]},{27:[1,79]},t(Z,[2,23]),{35:80,75:81,76:ee,77:ne,79:ue,80:fe},{35:86,75:81,76:ee,77:ne,79:ue,80:fe},{35:87,75:81,76:ee,77:ne,79:ue,80:fe},{35:88,75:81,76:ee,77:ne,79:ue,80:fe},{35:89,75:81,76:ee,77:ne,79:ue,80:fe},{35:90,75:81,76:ee,77:ne,79:ue,80:fe},{35:91,75:81,76:ee,77:ne,79:ue,80:fe},{35:92,75:81,76:ee,77:ne,79:ue,80:fe},{35:93,75:81,76:ee,77:ne,79:ue,80:fe},{35:94,75:81,76:ee,77:ne,79:ue,80:fe},{35:95,75:81,76:ee,77:ne,79:ue,80:fe},{35:96,75:81,76:ee,77:ne,79:ue,80:fe},{35:97,75:81,76:ee,77:ne,79:ue,80:fe},{35:98,75:81,76:ee,77:ne,79:ue,80:fe},{35:99,75:81,76:ee,77:ne,79:ue,80:fe},{35:100,75:81,76:ee,77:ne,79:ue,80:fe},{35:101,75:81,76:ee,77:ne,79:ue,80:fe},{35:102,75:81,76:ee,77:ne,79:ue,80:fe},{35:103,75:81,76:ee,77:ne,79:ue,80:fe},{35:104,75:81,76:ee,77:ne,79:ue,80:fe},t(_e,[2,59]),{35:105,75:81,76:ee,77:ne,79:ue,80:fe},{35:106,75:81,76:ee,77:ne,79:ue,80:fe},{35:107,75:81,76:ee,77:ne,79:ue,80:fe},{35:108,75:81,76:ee,77:ne,79:ue,80:fe},{35:109,75:81,76:ee,77:ne,79:ue,80:fe},{35:110,75:81,76:ee,77:ne,79:ue,80:fe},{35:111,75:81,76:ee,77:ne,79:ue,80:fe},{35:112,75:81,76:ee,77:ne,79:ue,80:fe},{35:113,75:81,76:ee,77:ne,79:ue,80:fe},{35:114,75:81,76:ee,77:ne,79:ue,80:fe},{35:115,75:81,76:ee,77:ne,79:ue,80:fe},{20:116,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:k,53:A,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:S,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:Y,72:W,73:ie,74:K},{12:[1,118],33:[1,117]},{35:119,75:81,76:ee,77:ne,79:ue,80:fe},{35:120,75:81,76:ee,77:ne,79:ue,80:fe},{35:121,75:81,76:ee,77:ne,79:ue,80:fe},{35:122,75:81,76:ee,77:ne,79:ue,80:fe},{35:123,75:81,76:ee,77:ne,79:ue,80:fe},{35:124,75:81,76:ee,77:ne,79:ue,80:fe},{35:125,75:81,76:ee,77:ne,79:ue,80:fe},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(se,[2,15]),t(J,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(se,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:k,53:A,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:S,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:Y,72:W,73:ie,74:K}),t(Z,[2,21]),t(Z,[2,22]),t(_e,[2,39]),t(Ae,[2,71],{75:81,35:132,76:ee,77:ne,79:ue,80:fe}),t(Ne,[2,73]),{78:[1,133]},t(Ne,[2,75]),t(Ne,[2,76]),t(_e,[2,40]),t(_e,[2,41]),t(_e,[2,42]),t(_e,[2,43]),t(_e,[2,44]),t(_e,[2,45]),t(_e,[2,46]),t(_e,[2,47]),t(_e,[2,48]),t(_e,[2,49]),t(_e,[2,50]),t(_e,[2,51]),t(_e,[2,52]),t(_e,[2,53]),t(_e,[2,54]),t(_e,[2,55]),t(_e,[2,56]),t(_e,[2,57]),t(_e,[2,58]),t(_e,[2,60]),t(_e,[2,61]),t(_e,[2,62]),t(_e,[2,63]),t(_e,[2,64]),t(_e,[2,65]),t(_e,[2,66]),t(_e,[2,67]),t(_e,[2,68]),t(_e,[2,69]),t(_e,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(me,[2,28]),t(me,[2,29]),t(me,[2,30]),t(me,[2,31]),t(me,[2,32]),t(me,[2,33]),t(me,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(J,[2,18]),t(se,[2,38]),t(Ae,[2,72]),t(Ne,[2,74]),t(_e,[2,24]),t(_e,[2,35]),t(ve,[2,25]),t(ve,[2,26],{12:[1,138]}),t(ve,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:x(function(Ve,Qe){if(Qe.recoverable)this.trace(Ve);else{var nt=new Error(Ve);throw nt.hash=Qe,nt}},"parseError"),parse:x(function(Ve){var Qe=this,nt=[0],tt=[],je=[null],Ce=[],Se=this.table,H="",he=0,j=0,pe=2,re=1,Be=Ce.slice.call(arguments,1),xe=Object.create(this.lexer),Ue={yy:{}};for(var De in this.yy)Object.prototype.hasOwnProperty.call(this.yy,De)&&(Ue.yy[De]=this.yy[De]);xe.setInput(Ve,Ue.yy),Ue.yy.lexer=xe,Ue.yy.parser=this,typeof xe.yylloc>"u"&&(xe.yylloc={});var qe=xe.yylloc;Ce.push(qe);var Le=xe.options&&xe.options.ranges;typeof Ue.yy.parseError=="function"?this.parseError=Ue.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Xe(oe){nt.length=nt.length-2*oe,je.length=je.length-oe,Ce.length=Ce.length-oe}x(Xe,"popStack");function Ie(){var oe;return oe=tt.pop()||xe.lex()||re,typeof oe!="number"&&(oe instanceof Array&&(tt=oe,oe=tt.pop()),oe=Qe.symbols_[oe]||oe),oe}x(Ie,"lex");for(var it,we,lt,be,Et={},vt,ot,It,xt;;){if(we=nt[nt.length-1],this.defaultActions[we]?lt=this.defaultActions[we]:((it===null||typeof it>"u")&&(it=Ie()),lt=Se[we]&&Se[we][it]),typeof lt>"u"||!lt.length||!lt[0]){var ht="";xt=[];for(vt in Se[we])this.terminals_[vt]&&vt>pe&&xt.push("'"+this.terminals_[vt]+"'");xe.showPosition?ht="Parse error on line "+(he+1)+`: + `),o=hVe(n,i,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:ux.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,i){var a=this.atlasManager,s=this.batchManager,o=a.getRenderTypeOpts(i);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===u3.IGNORE)return;if(l==u3.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=ws(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;s.canAddToCurrentBatch(p)||this.endBatch();for(var y=s.getAtlasIndexForBatch(p),v=0,x=[[g,!0],[m,!1]];v=this.maxInstances&&this.endBatch()}}}}catch(M){h.e(M)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=r.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,u=a.tex1,h=a.tex2,d=u.w/(u.w+h.w);s||(d=1-d);var f=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,o,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,a){var s,o;jee(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;c3(r,r,[h,d]),Zee(r,r,l);var f=i.getRotationOffset(a);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;c3(r,r,[s,o]),aI(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,a){var s=r.x1,o=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*a;return i&&a<1?l=f:!i&&a<1&&(d=l-f,s+=d,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=Y0;var o=this.indexBuffer.getView(s);H0(n,o);var l=this.colorBuffer.getView(s);qd([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(r,u,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var a=this.simpleShapeOptions.get(i);if(this._isVisible(r,a)){var s=a.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||a.isSimple&&!a.isSimple(r,this.renderTarget)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===h3||o===hx){var u=a.getBoundingBox(r),h=this._getCornerRadius(r,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===hx&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);H0(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(s.opacity).value*p,m=r.pstyle(s.color).value,y=this.colorBuffer.getView(l);qd(m,g,y);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,s.border){var x=r.pstyle("border-width").value;if(x>0){var b=r.pstyle("border-color").value,w=p*r.pstyle("border-opacity").value,k=this.borderColorBuffer.getView(l);qd(b,w,k);var S=r.pstyle("border-position").value;if(S==="inside")v[0]=0,v[1]=-x;else if(S==="outside")v[0]=x,v[1]=0;else{var C=x/2;v[0]=C,v[1]=-C}}}var _=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,_,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var i=r.pstyle(n).value;switch(i){case"rectangle":return Y0;case"ellipse":return dx;case"roundrectangle":case"round-rectangle":return h3;case"bottom-round-rectangle":return hx;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,s=i.h;if(r.pstyle(n).value==="auto")return eh(a,s);var o=r.pstyle(n).pfValue,l=a/2,u=s/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var a=r._private.rscratch,s,o,l;if(i==="source"?(s=a.arrowStartX,o=a.arrowStartY,l=a.srcArrowAngle):(s=a.arrowEndX,o=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(i+"-arrow-shape").value;if(u!=="none"){var h=r.pstyle(i+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=d*f,g=r.pstyle("width").pfValue,m=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(g,m),v=this.instanceCount,x=this.transformBuffer.getMatrixView(v);jee(x),c3(x,x,[s,o]),aI(x,x,[y,y]),Zee(x,x,l),this.vertTypeBuffer.getView(v)[0]=oI;var b=this.indexBuffer.getView(v);H0(n,b);var w=this.colorBuffer.getView(v);qd(h,p,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var a=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=Qee;var d=this.indexBuffer.getView(h);H0(n,d);var f=this.colorBuffer.getView(h);qd(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=o;var g=this.pointAPointBBuffer.getView(h);g[0]=i[0],g[1]=i[1],g[2]=i[2],g[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var m=0;m=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var i=n.allpts;if(i.length==4)return i;var a=this._getNumSegments(r);return this._getCurveSegmentPoints(i,a)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var i=Array((n+1)*2),a=0;a<=n;a++)if(a==0)i[0]=r[0],i[1]=r[1];else if(a==n)i[a*2]=r[r.length-2],i[a*2+1]=r[r.length-1];else{var s=a/n;this._setCurvePoint(r,s,i,a*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,a){if(r.length<=2)i[a]=r[0],i[a+1]=r[1];else{for(var s=Array(r.length-2),o=0;o0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?u3.USE_BB:u3.IGNORE},l=function(d){var f=d.position(),p=f.x,g=f.y,m=d.outerWidth(),y=d.outerHeight();return{w:m,h:y,x1:p-m/2,y1:g-y/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:gVe,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:lI(e.getLabelKey,null),getBoundingBox:cI(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:a("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:lI(e.getSourceLabelKey,"source"),getBoundingBox:cI(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:a("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:lI(e.getTargetLabelKey,"target"),getBoundingBox:cI(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=Bb(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(h,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),$Ve(r)};function OVe(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return iZ(r)}function tte(t,e){var r=t._private.rscratch;return Ka(r,"labelWrapCachedLines",e)||[]}var lI=function(e,r){return function(n){var i=e(n),a=tte(n,r);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},cI=function(e,r){return function(n,i){var a=e(n);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var o=Number(i.substring(s+1)),l=tte(n,r),u=a.h/l.length,h=u*o,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:u,yOffset:h}}}return a}};function $Ve(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>Oee?(PVe(t),e.call(t,a)):(BVe(t),nte(t,a,ux.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(a){r.call(t,a),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(a,s,o,l){return WVe(t,a,s)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(a,s){i.call(t,a,s),a==="viewport"||a==="bounds"?t.pickingFrameBuffer.needsDraw=!0:a==="background"&&t.drawing.invalidate(s,{type:"node-body"})}}}function PVe(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function BVe(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function FVe(t){var e=t.canvasWidth,r=t.canvasHeight,n=nI(t),i=n.pan,a=n.zoom,s=iI();c3(s,s,[i.x,i.y]),aI(s,s,[a,a]);var o=iI();kVe(o,e,r);var l=iI();return CVe(l,o,s),l}function rte(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=nI(t),a=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(a.x,a.y),e.scale(s,s)}function zVe(t,e){t.drawSelectionRectangle(e,function(r){return rte(t,r)})}function GVe(t){var e=t.data.contexts[t.NODE];e.save(),rte(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function qVe(t){var e=function(i,a,s){for(var o=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h=0&&w.add(C)}return w}function WVe(t,e,r){var n=VVe(t,e,r),i=t.getCachedZSortedEles(),a,s,o=ws(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,h=i[u];if(!a&&h.isNode()&&(a=h),!s&&h.isEdge()&&(s=h),a&&s)break}}catch(d){o.e(d)}finally{o.f()}return[a,s].filter(Boolean)}function uI(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function nte(t,e,r){var n;t.webglDebug&&(n=performance.now());var i=t.drawing,a=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&zVe(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];r.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=FVe(t),l=t.getCachedZSortedEles();if(a=l.length,i.startFrame(o,r),r.screen){for(var u=0;u0&&s>0){p.clearRect(0,0,a,s),p.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)p.translate(-n.x1*u,-n.y1*u),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(n.x1*u,n.y1*u);else{var m=e.pan(),y={x:m.x*u,y:m.y*u};u*=e.zoom(),p.translate(y.x,y.y),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(-y.x,-y.y)}t.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=t.bg,p.rect(0,0,a,s),p.fill())}return f};function UVe(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":Fi(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=t,r.height=e}return r},[zee,Ol,Gc,rI,Gd,ch,Qa,ete,uh,fx,cte].forEach(function(t){yr(Br,t)});var XVe=[{name:"null",impl:dee},{name:"base",impl:Dee},{name:"canvas",impl:HVe}],KVe=[{type:"layout",extensions:vqe},{type:"renderer",extensions:XVe}],hte={},dte={};function fte(t,e,r){var n=r,i=function(_){cn("Can not register `"+e+"` for `"+t+"` since `"+_+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(nx.prototype[e])return i(e);nx.prototype[e]=r}else if(t==="collection"){if(fa.prototype[e])return i(e);fa.prototype[e]=r}else if(t==="layout"){for(var a=function(_){this.options=_,r.call(this,_),Kr(this._private)||(this._private={}),this._private.cy=_.cy,this._private.listeners=[],this.createEmitter()},s=a.prototype=Object.create(r.prototype),o=[],l=0;lg&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>m&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-m)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-m),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(6),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,x){a.call(this,x),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,x){if(v==null&&x==null){var b=y;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}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(v.owner==x.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=x.owner?null:(w.source=v,w.target=x,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),x!=v&&x.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var x=v.edges.slice(),b,w=x.length,k=0;k-1&&_>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(C,1),b.target!=b.source&&b.target.edges.splice(_,1);var S=b.source.owner.getEdges().indexOf(b);if(S==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,x,b,w,k=this.getNodes(),S=k.length,C=0;Cx&&(y=x),v>b&&(v=b)}return y==s.MAX_VALUE?null:(k[0].getParent().paddingLeft!=null?w=k[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,x=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,k,S,C,_,L,O=this.nodes,M=O.length,z=0;zk&&(v=k),xC&&(b=C),w<_&&(w=_)}var A=new d(v,b,x-v,w-b);v==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),O[0].getParent().paddingLeft!=null?L=O[0].getParent().paddingLeft:L=this.margin,this.left=A.x-L,this.right=A.x+A.width+L,this.top=A.y-L,this.bottom=A.y+A.height+L},g.calculateBounds=function(y){for(var v=s.MAX_VALUE,x=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,k,S,C,_,L=y.length,O=0;Ok&&(v=k),xC&&(b=C),w<_&&(w=_)}var z=new d(v,b,x-v,w-b);return z},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var y=0,v=this.nodes,x=v.length,b=0;b=this.nodes.length){var M=0;x.forEach(function(z){z.owner==y&&M++}),M==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=O,!1;if(df)return u[0]=g,u[1]=d,u[2]=_,u[3]=p,!1;if(hf?(u[0]=v,u[1]=x,A=!0):(u[0]=y,u[1]=m,A=!0):N===I&&(h>f?(u[0]=g,u[1]=m,A=!0):(u[0]=b,u[1]=x,A=!0)),-D===I?f>h?(u[2]=L,u[3]=O,R=!0):(u[2]=_,u[3]=C,R=!0):D===I&&(f>h?(u[2]=S,u[3]=C,R=!0):(u[2]=M,u[3]=O,R=!0)),A&&R)return!1;if(h>f?d>p?($=this.getCardinalDirection(N,I,4),B=this.getCardinalDirection(D,I,2)):($=this.getCardinalDirection(-N,I,3),B=this.getCardinalDirection(-D,I,1)):d>p?($=this.getCardinalDirection(-N,I,1),B=this.getCardinalDirection(-D,I,3)):($=this.getCardinalDirection(N,I,2),B=this.getCardinalDirection(D,I,4)),!A)switch($){case 1:G=m,P=h+-k/I,u[0]=P,u[1]=G;break;case 2:P=b,G=d+w*I,u[0]=P,u[1]=G;break;case 3:G=x,P=h+k/I,u[0]=P,u[1]=G;break;case 4:P=v,G=d+-w*I,u[0]=P,u[1]=G;break}if(!R)switch(B){case 1:X=C,V=f+-F/I,u[2]=V,u[3]=X;break;case 2:V=M,X=p+z*I,u[2]=V,u[3]=X;break;case 3:X=O,V=f+F/I,u[2]=V,u[3]=X;break;case 4:V=L,X=p+-z*I,u[2]=V,u[3]=X;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,x=h.y,b=void 0,w=void 0,k=void 0,S=void 0,C=void 0,_=void 0,L=void 0,O=void 0,M=void 0;return k=g-f,C=d-p,L=p*f-d*g,S=x-y,_=m-v,O=v*y-m*x,M=k*_-S*C,M===0?null:(b=(C*O-_*L)/M,w=(S*L-k*O)/M,new a(b,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(k.push(C[0]);k.length>0&&y;){var _=k[0];k.splice(0,1),w.add(_);for(var L=_.getEdges(),b=0;b-1&&C.splice(F,1)}w=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,x=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var x=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(O,1);var M=S.getNeighborsList();M.forEach(function(A){if(v.indexOf(A)<0){var R=x.get(A),N=R-1;N==1&&_.push(A),x.set(A,N)}})}v=v.concat(_),(y.length==1||y.length==2)&&(b=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(4);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,x,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mk||w>k)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*x)):(k=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>k||w>k)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*x*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||k>=b[0].length)){for(var S=0;Sd}}]),u})();r.exports=l}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;uh.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),h.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},l.prototype.propogateDisplacementToChildren=function(h,d){for(var f=this.getChild().getNodes(),p,g=0;g0)this.positionNodesRadially(C);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var _=new Set(this.getAllNodes()),L=this.nodesWithGravity.filter(function(O){return _.has(O)});this.graphManager.setAllNodesToApplyGravitation(L),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},k.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!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 C=new Set(this.getAllNodes()),_=this.nodesWithGravity.filter(function(M){return C.has(M)});this.graphManager.setAllNodesToApplyGravitation(_),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.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()),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var L=!this.isTreeGrowing&&!this.isGrowthFinished,O=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(L,O),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},k.prototype.getPositionsData=function(){for(var C=this.graphManager.getAllNodes(),_={},L=0;L1){var A;for(A=0;AO&&(O=Math.floor(F.y)),z=Math.floor(F.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-F.x/2,p.WORLD_CENTER_Y-F.y/2))},k.radialLayout=function(C,_,L){var O=Math.max(this.maxDiagonalInTree(C),d.DEFAULT_RADIAL_SEPARATION);k.branchRadialLayout(_,null,0,359,0,O);var M=b.calculateBounds(C),z=new w;z.setDeviceOrgX(M.getMinX()),z.setDeviceOrgY(M.getMinY()),z.setWorldOrgX(L.x),z.setWorldOrgY(L.y);for(var F=0;F1;){var X=V[0];V.splice(0,1);var W=I.indexOf(X);W>=0&&I.splice(W,1),P--,$--}_!=null?G=(I.indexOf(V[0])+1)%P:G=0;for(var ie=Math.abs(O-L)/$,K=G;B!=$;K=++K%P){var se=I[K].getOtherEnd(C);if(se!=_){var J=(L+B*ie)%360,Z=(J+ie)%360;k.branchRadialLayout(se,C,J,Z,M+z,z),B++}}},k.maxDiagonalInTree=function(C){for(var _=v.MIN_VALUE,L=0;L_&&(_=M)}return _},k.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},k.prototype.groupZeroDegreeMembers=function(){var C=this,_={};this.memberGroups={},this.idToDummyNode={};for(var L=[],O=this.graphManager.getAllNodes(),M=0;M"u"&&(_[A]=[]),_[A]=_[A].concat(z)}Object.keys(_).forEach(function(R){if(_[R].length>1){var N="DummyCompound_"+R;C.memberGroups[N]=_[R];var D=_[R][0].getParent(),I=new u(C.graphManager);I.id=N,I.paddingLeft=D.paddingLeft||0,I.paddingRight=D.paddingRight||0,I.paddingBottom=D.paddingBottom||0,I.paddingTop=D.paddingTop||0,C.idToDummyNode[N]=I;var $=C.getGraphManager().add(C.newGraph(),I),B=D.getChild();B.add(I);for(var P=0;P<_[R].length;P++){var G=_[R][P];B.remove(G),$.add(G)}}})},k.prototype.clearCompounds=function(){var C={},_={};this.performDFSOnCompounds();for(var L=0;L=0;C--){var _=this.compoundOrder[C],L=_.id,O=_.paddingLeft,M=_.paddingTop;this.adjustLocations(this.tiledMemberPack[L],_.rect.x,_.rect.y,O,M)}},k.prototype.repopulateZeroDegreeMembers=function(){var C=this,_=this.tiledZeroDegreePack;Object.keys(_).forEach(function(L){var O=C.idToDummyNode[L],M=O.paddingLeft,z=O.paddingTop;C.adjustLocations(_[L],O.rect.x,O.rect.y,M,z)})},k.prototype.getToBeTiled=function(C){var _=C.id;if(this.toBeTiled[_]!=null)return this.toBeTiled[_];var L=C.getChild();if(L==null)return this.toBeTiled[_]=!1,!1;for(var O=L.getNodes(),M=0;M0)return this.toBeTiled[_]=!1,!1;if(z.getChild()==null){this.toBeTiled[z.id]=!1;continue}if(!this.getToBeTiled(z))return this.toBeTiled[_]=!1,!1}return this.toBeTiled[_]=!0,!0},k.prototype.getNodeDegree=function(C){C.id;for(var _=C.getEdges(),L=0,O=0;O<_.length;O++){var M=_[O];M.getSource().id!==M.getTarget().id&&(L=L+1)}return L},k.prototype.getNodeDegreeWithChildren=function(C){var _=this.getNodeDegree(C);if(C.getChild()==null)return _;for(var L=C.getChild().getNodes(),O=0;OR&&(R=D.rect.height)}L+=R+C.verticalPadding}},k.prototype.tileCompoundMembers=function(C,_){var L=this;this.tiledMemberPack=[],Object.keys(C).forEach(function(O){var M=_[O];L.tiledMemberPack[O]=L.tileNodes(C[O],M.paddingLeft+M.paddingRight),M.rect.width=L.tiledMemberPack[O].width,M.rect.height=L.tiledMemberPack[O].height})},k.prototype.tileNodes=function(C,_){var L=d.TILING_PADDING_VERTICAL,O=d.TILING_PADDING_HORIZONTAL,M={rows:[],rowWidth:[],rowHeight:[],width:0,height:_,verticalPadding:L,horizontalPadding:O};C.sort(function(A,R){return A.rect.width*A.rect.height>R.rect.width*R.rect.height?-1:A.rect.width*A.rect.height0&&(F+=C.horizontalPadding),C.rowWidth[L]=F,C.width0&&(A+=C.verticalPadding);var R=0;A>C.rowHeight[L]&&(R=C.rowHeight[L],C.rowHeight[L]=A,R=C.rowHeight[L]-R),C.height+=R,C.rows[L].push(_)},k.prototype.getShortestRowIndex=function(C){for(var _=-1,L=Number.MAX_VALUE,O=0;OL&&(_=O,L=C.rowWidth[O]);return _},k.prototype.canAddHorizontal=function(C,_,L){var O=this.getShortestRowIndex(C);if(O<0)return!0;var M=C.rowWidth[O];if(M+C.horizontalPadding+_<=C.width)return!0;var z=0;C.rowHeight[O]0&&(z=L+C.verticalPadding-C.rowHeight[O]);var F;C.width-M>=_+C.horizontalPadding?F=(C.height+z)/(M+_+C.horizontalPadding):F=(C.height+z)/C.width,z=L+C.verticalPadding;var A;return C.width<_?A=(C.height+z)/_:A=(C.height+z)/C.width,A<1&&(A=1/A),F<1&&(F=1/F),Fz&&_!=L){O.splice(-1,1),C.rows[L].push(M),C.rowWidth[_]=C.rowWidth[_]-z,C.rowWidth[L]=C.rowWidth[L]+z,C.width=C.rowWidth[instance.getLongestRowIndex(C)];for(var F=Number.MIN_VALUE,A=0;AF&&(F=O[A].height);_>0&&(F+=C.verticalPadding);var R=C.rowHeight[_]+C.rowHeight[L];C.rowHeight[_]=F,C.rowHeight[L]0)for(var B=M;B<=z;B++)$[0]+=this.grid[B][F-1].length+this.grid[B][F].length-1;if(z0)for(var B=F;B<=A;B++)$[3]+=this.grid[M-1][B].length+this.grid[M][B].length-1;for(var P=v.MAX_VALUE,G,V,X=0;X<$.length;X++)$[X]0){var A;A=w.getGraphManager().add(w.newGraph(),L),this.processChildrenList(A,_,w)}}},m.prototype.stop=function(){return this.stopped=!0,this};var v=function(b){b("layout","cose-bilkent",m)};typeof cytoscape<"u"&&v(cytoscape),n.exports=v})])})})(f3)),f3.exports}var aWe=iWe();const sWe=Os(aWe);Pl.use(sWe);function vte(t,e){t.forEach(r=>{const n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),e.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}T(vte,"addNodes");function bte(t,e){t.forEach(r=>{const n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),e.add({group:"edges",data:n})})}T(bte,"addEdges");function xte(t){return new Promise(e=>{const r=pt("body").append("div").attr("id","cy").attr("style","display:none"),n=Pl({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),vte(t.nodes,n),bte(t.edges,n),n.nodes().forEach(function(a){a.layoutDimensions=()=>{const s=a.data();return{w:s.width,h:s.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(a=>{ae.info("Cytoscape ready",a),e(n)})})}T(xte,"createCytoscapeInstance");function Tte(t){return t.nodes().map(e=>{const r=e.data(),n=e.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(a=>{a!=="id"&&(i[a]=r[a])}),i})}T(Tte,"extractPositionedNodes");function wte(t){return t.edges().map(e=>{const r=e.data(),n=e._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(a=>{["id","source","target"].includes(a)||(i[a]=r[a])}),i})}T(wte,"extractPositionedEdges");async function Cte(t,e){ae.debug("Starting cose-bilkent layout algorithm");try{kte(t);const r=await xte(t),n=Tte(r),i=wte(r);return ae.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw ae.error("Error in cose-bilkent layout algorithm:",r),r}}T(Cte,"executeCoseBilkentLayout");function kte(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}T(kte,"validateLayoutData");var oWe=T(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:s,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");a(f,t.markers,t.type,t.diagramId);const p=f.insert("g").attr("class","subgraphs"),g=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),y=f.insert("g").attr("class","nodes");o.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async b=>{if(b.isGroup){const w={...b};d[b.id]=w,h[b.id]=w,await r(p,b)}else{const w={...b};h[b.id]=w;const k=await s(y,b,{config:t.config,dir:t.direction||"TB"}),S=k.node().getBBox();w.width=S.width,w.height=S.height,w.domId=k,o.debug(`Node ${b.id} dimensions: ${S.width}x${S.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const v={...t,nodes:t.nodes.map(b=>{const w=h[b.id];return{...b,width:w.width,height:w.height}})},x=await Cte(v,t.config);o.debug("Positioning nodes based on layout results"),x.nodes.forEach(b=>{const w=h[b.id];w!=null&&w.domId&&(w.domId.attr("transform",`translate(${b.x}, ${b.y})`),w.x=b.x,w.y=b.y,o.debug(`Positioned node ${w.id} at center (${b.x}, ${b.y})`))}),x.edges.forEach(b=>{const w=t.edges.find(k=>k.id===b.id);w&&(w.points=[{x:b.startX,y:b.startY},{x:b.midX,y:b.midY},{x:b.endX,y:b.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async b=>{await i(m,b);const w=h[b.start??""],k=h[b.end??""];if(w&&k){const S=x.edges.find(C=>C.id===b.id);if(S){o.debug("APA01 positionedEdge",S);const C={...b},_=n(g,C,d,t.type,w,k,t.diagramId);l(C,_)}else{const C={...b,points:[{x:w.x||0,y:w.y||0},{x:k.x||0,y:k.y||0}]},_=n(g,C,d,t.type,w,k,t.diagramId);l(C,_)}}})),o.debug("Cose-bilkent rendering completed")},"render"),lWe=oWe;const cWe=Object.freeze(Object.defineProperty({__proto__:null,render:lWe},Symbol.toStringTag,{value:"Module"}));var m3=T((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),Ete=T((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};m3(t,r).lower()},"drawBackgroundRect"),uWe=T((t,e)=>{const r=e.text.replace(kp," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),pI=T((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=cd.sanitizeUrl(n);i.attr("xlink:href",a)},"drawImage"),gI=T((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=cd.sanitizeUrl(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),Ys=T(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),mI=T(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),Ste=T(()=>{let t=pt(".mermaidTooltip");return t.empty()&&(t=pt("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip"),y3=(function(){var t=T(function(ke,Ve,Qe,nt){for(Qe=Qe||{},nt=ke.length;nt--;Qe[ke[nt]]=Ve);return Qe},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],o=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],f=[1,69],p=[1,29],g=[1,30],m=[1,31],y=[1,32],v=[1,33],x=[1,34],b=[1,35],w=[1,36],k=[1,37],S=[1,38],C=[1,39],_=[1,40],L=[1,41],O=[1,42],M=[1,43],z=[1,44],F=[1,45],A=[1,46],R=[1,47],N=[1,48],D=[1,50],I=[1,51],$=[1,52],B=[1,53],P=[1,54],G=[1,55],V=[1,56],X=[1,57],W=[1,58],ie=[1,59],K=[1,60],se=[14,42],J=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Z=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ee=[1,82],ne=[1,83],ue=[1,84],fe=[1,85],_e=[12,14,42],Ae=[12,14,33,42],Ne=[12,14,33,42,76,77,79,80],me=[12,33],ve=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ge={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:T(function(Ve,Qe,nt,tt,je,Ce,Se){var H=Ce.length-1;switch(je){case 3:tt.setDirection("TB");break;case 4:tt.setDirection("BT");break;case 5:tt.setDirection("RL");break;case 6:tt.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:tt.setC4Type(Ce[H-3]);break;case 19:tt.setTitle(Ce[H].substring(6)),this.$=Ce[H].substring(6);break;case 20:tt.setAccDescription(Ce[H].substring(15)),this.$=Ce[H].substring(15);break;case 21:this.$=Ce[H].trim(),tt.setTitle(this.$);break;case 22:case 23:this.$=Ce[H].trim(),tt.setAccDescription(this.$);break;case 28:Ce[H].splice(2,0,"ENTERPRISE"),tt.addPersonOrSystemBoundary(...Ce[H]),this.$=Ce[H];break;case 29:Ce[H].splice(2,0,"SYSTEM"),tt.addPersonOrSystemBoundary(...Ce[H]),this.$=Ce[H];break;case 30:tt.addPersonOrSystemBoundary(...Ce[H]),this.$=Ce[H];break;case 31:Ce[H].splice(2,0,"CONTAINER"),tt.addContainerBoundary(...Ce[H]),this.$=Ce[H];break;case 32:tt.addDeploymentNode("node",...Ce[H]),this.$=Ce[H];break;case 33:tt.addDeploymentNode("nodeL",...Ce[H]),this.$=Ce[H];break;case 34:tt.addDeploymentNode("nodeR",...Ce[H]),this.$=Ce[H];break;case 35:tt.popBoundaryParseStack();break;case 39:tt.addPersonOrSystem("person",...Ce[H]),this.$=Ce[H];break;case 40:tt.addPersonOrSystem("external_person",...Ce[H]),this.$=Ce[H];break;case 41:tt.addPersonOrSystem("system",...Ce[H]),this.$=Ce[H];break;case 42:tt.addPersonOrSystem("system_db",...Ce[H]),this.$=Ce[H];break;case 43:tt.addPersonOrSystem("system_queue",...Ce[H]),this.$=Ce[H];break;case 44:tt.addPersonOrSystem("external_system",...Ce[H]),this.$=Ce[H];break;case 45:tt.addPersonOrSystem("external_system_db",...Ce[H]),this.$=Ce[H];break;case 46:tt.addPersonOrSystem("external_system_queue",...Ce[H]),this.$=Ce[H];break;case 47:tt.addContainer("container",...Ce[H]),this.$=Ce[H];break;case 48:tt.addContainer("container_db",...Ce[H]),this.$=Ce[H];break;case 49:tt.addContainer("container_queue",...Ce[H]),this.$=Ce[H];break;case 50:tt.addContainer("external_container",...Ce[H]),this.$=Ce[H];break;case 51:tt.addContainer("external_container_db",...Ce[H]),this.$=Ce[H];break;case 52:tt.addContainer("external_container_queue",...Ce[H]),this.$=Ce[H];break;case 53:tt.addComponent("component",...Ce[H]),this.$=Ce[H];break;case 54:tt.addComponent("component_db",...Ce[H]),this.$=Ce[H];break;case 55:tt.addComponent("component_queue",...Ce[H]),this.$=Ce[H];break;case 56:tt.addComponent("external_component",...Ce[H]),this.$=Ce[H];break;case 57:tt.addComponent("external_component_db",...Ce[H]),this.$=Ce[H];break;case 58:tt.addComponent("external_component_queue",...Ce[H]),this.$=Ce[H];break;case 60:tt.addRel("rel",...Ce[H]),this.$=Ce[H];break;case 61:tt.addRel("birel",...Ce[H]),this.$=Ce[H];break;case 62:tt.addRel("rel_u",...Ce[H]),this.$=Ce[H];break;case 63:tt.addRel("rel_d",...Ce[H]),this.$=Ce[H];break;case 64:tt.addRel("rel_l",...Ce[H]),this.$=Ce[H];break;case 65:tt.addRel("rel_r",...Ce[H]),this.$=Ce[H];break;case 66:tt.addRel("rel_b",...Ce[H]),this.$=Ce[H];break;case 67:Ce[H].splice(0,1),tt.addRel("rel",...Ce[H]),this.$=Ce[H];break;case 68:tt.updateElStyle("update_el_style",...Ce[H]),this.$=Ce[H];break;case 69:tt.updateRelStyle("update_rel_style",...Ce[H]),this.$=Ce[H];break;case 70:tt.updateLayoutConfig("update_layout_config",...Ce[H]),this.$=Ce[H];break;case 71:this.$=[Ce[H]];break;case 72:Ce[H].unshift(Ce[H-1]),this.$=Ce[H];break;case 73:case 75:this.$=Ce[H].trim();break;case 74:let he={};he[Ce[H-1].trim()]=Ce[H].trim(),this.$=he;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:k,53:S,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:A,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:X,72:W,73:ie,74:K},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:k,53:S,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:A,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:X,72:W,73:ie,74:K},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:k,53:S,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:A,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:X,72:W,73:ie,74:K},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:k,53:S,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:A,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:X,72:W,73:ie,74:K},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:k,53:S,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:A,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:X,72:W,73:ie,74:K},{14:[1,74]},t(se,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:k,53:S,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:A,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:X,72:W,73:ie,74:K}),t(se,[2,14]),t(J,[2,16],{12:[1,76]}),t(se,[2,36],{12:[1,77]}),t(Z,[2,19]),t(Z,[2,20]),{25:[1,78]},{27:[1,79]},t(Z,[2,23]),{35:80,75:81,76:ee,77:ne,79:ue,80:fe},{35:86,75:81,76:ee,77:ne,79:ue,80:fe},{35:87,75:81,76:ee,77:ne,79:ue,80:fe},{35:88,75:81,76:ee,77:ne,79:ue,80:fe},{35:89,75:81,76:ee,77:ne,79:ue,80:fe},{35:90,75:81,76:ee,77:ne,79:ue,80:fe},{35:91,75:81,76:ee,77:ne,79:ue,80:fe},{35:92,75:81,76:ee,77:ne,79:ue,80:fe},{35:93,75:81,76:ee,77:ne,79:ue,80:fe},{35:94,75:81,76:ee,77:ne,79:ue,80:fe},{35:95,75:81,76:ee,77:ne,79:ue,80:fe},{35:96,75:81,76:ee,77:ne,79:ue,80:fe},{35:97,75:81,76:ee,77:ne,79:ue,80:fe},{35:98,75:81,76:ee,77:ne,79:ue,80:fe},{35:99,75:81,76:ee,77:ne,79:ue,80:fe},{35:100,75:81,76:ee,77:ne,79:ue,80:fe},{35:101,75:81,76:ee,77:ne,79:ue,80:fe},{35:102,75:81,76:ee,77:ne,79:ue,80:fe},{35:103,75:81,76:ee,77:ne,79:ue,80:fe},{35:104,75:81,76:ee,77:ne,79:ue,80:fe},t(_e,[2,59]),{35:105,75:81,76:ee,77:ne,79:ue,80:fe},{35:106,75:81,76:ee,77:ne,79:ue,80:fe},{35:107,75:81,76:ee,77:ne,79:ue,80:fe},{35:108,75:81,76:ee,77:ne,79:ue,80:fe},{35:109,75:81,76:ee,77:ne,79:ue,80:fe},{35:110,75:81,76:ee,77:ne,79:ue,80:fe},{35:111,75:81,76:ee,77:ne,79:ue,80:fe},{35:112,75:81,76:ee,77:ne,79:ue,80:fe},{35:113,75:81,76:ee,77:ne,79:ue,80:fe},{35:114,75:81,76:ee,77:ne,79:ue,80:fe},{35:115,75:81,76:ee,77:ne,79:ue,80:fe},{20:116,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:k,53:S,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:A,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:X,72:W,73:ie,74:K},{12:[1,118],33:[1,117]},{35:119,75:81,76:ee,77:ne,79:ue,80:fe},{35:120,75:81,76:ee,77:ne,79:ue,80:fe},{35:121,75:81,76:ee,77:ne,79:ue,80:fe},{35:122,75:81,76:ee,77:ne,79:ue,80:fe},{35:123,75:81,76:ee,77:ne,79:ue,80:fe},{35:124,75:81,76:ee,77:ne,79:ue,80:fe},{35:125,75:81,76:ee,77:ne,79:ue,80:fe},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(se,[2,15]),t(J,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(se,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:k,53:S,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:A,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:X,72:W,73:ie,74:K}),t(Z,[2,21]),t(Z,[2,22]),t(_e,[2,39]),t(Ae,[2,71],{75:81,35:132,76:ee,77:ne,79:ue,80:fe}),t(Ne,[2,73]),{78:[1,133]},t(Ne,[2,75]),t(Ne,[2,76]),t(_e,[2,40]),t(_e,[2,41]),t(_e,[2,42]),t(_e,[2,43]),t(_e,[2,44]),t(_e,[2,45]),t(_e,[2,46]),t(_e,[2,47]),t(_e,[2,48]),t(_e,[2,49]),t(_e,[2,50]),t(_e,[2,51]),t(_e,[2,52]),t(_e,[2,53]),t(_e,[2,54]),t(_e,[2,55]),t(_e,[2,56]),t(_e,[2,57]),t(_e,[2,58]),t(_e,[2,60]),t(_e,[2,61]),t(_e,[2,62]),t(_e,[2,63]),t(_e,[2,64]),t(_e,[2,65]),t(_e,[2,66]),t(_e,[2,67]),t(_e,[2,68]),t(_e,[2,69]),t(_e,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(me,[2,28]),t(me,[2,29]),t(me,[2,30]),t(me,[2,31]),t(me,[2,32]),t(me,[2,33]),t(me,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(J,[2,18]),t(se,[2,38]),t(Ae,[2,72]),t(Ne,[2,74]),t(_e,[2,24]),t(_e,[2,35]),t(ve,[2,25]),t(ve,[2,26],{12:[1,138]}),t(ve,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:T(function(Ve,Qe){if(Qe.recoverable)this.trace(Ve);else{var nt=new Error(Ve);throw nt.hash=Qe,nt}},"parseError"),parse:T(function(Ve){var Qe=this,nt=[0],tt=[],je=[null],Ce=[],Se=this.table,H="",he=0,j=0,pe=2,re=1,Fe=Ce.slice.call(arguments,1),xe=Object.create(this.lexer),Ue={yy:{}};for(var Me in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Me)&&(Ue.yy[Me]=this.yy[Me]);xe.setInput(Ve,Ue.yy),Ue.yy.lexer=xe,Ue.yy.parser=this,typeof xe.yylloc>"u"&&(xe.yylloc={});var qe=xe.yylloc;Ce.push(qe);var Le=xe.options&&xe.options.ranges;typeof Ue.yy.parseError=="function"?this.parseError=Ue.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Xe(oe){nt.length=nt.length-2*oe,je.length=je.length-oe,Ce.length=Ce.length-oe}T(Xe,"popStack");function De(){var oe;return oe=tt.pop()||xe.lex()||re,typeof oe!="number"&&(oe instanceof Array&&(tt=oe,oe=tt.pop()),oe=Qe.symbols_[oe]||oe),oe}T(De,"lex");for(var it,we,lt,be,Et={},vt,ot,It,xt;;){if(we=nt[nt.length-1],this.defaultActions[we]?lt=this.defaultActions[we]:((it===null||typeof it>"u")&&(it=De()),lt=Se[we]&&Se[we][it]),typeof lt>"u"||!lt.length||!lt[0]){var ht="";xt=[];for(vt in Se[we])this.terminals_[vt]&&vt>pe&&xt.push("'"+this.terminals_[vt]+"'");xe.showPosition?ht="Parse error on line "+(he+1)+`: `+xe.showPosition()+` -Expecting `+xt.join(", ")+", got '"+(this.terminals_[it]||it)+"'":ht="Parse error on line "+(he+1)+": Unexpected "+(it==re?"end of input":"'"+(this.terminals_[it]||it)+"'"),this.parseError(ht,{text:xe.match,token:this.terminals_[it]||it,line:xe.yylineno,loc:qe,expected:xt})}if(lt[0]instanceof Array&<.length>1)throw new Error("Parse Error: multiple actions possible at state: "+we+", token: "+it);switch(lt[0]){case 1:nt.push(it),je.push(xe.yytext),Ce.push(xe.yylloc),nt.push(lt[1]),it=null,j=xe.yyleng,H=xe.yytext,he=xe.yylineno,qe=xe.yylloc;break;case 2:if(ot=this.productions_[lt[1]][1],Et.$=je[je.length-ot],Et._$={first_line:Ce[Ce.length-(ot||1)].first_line,last_line:Ce[Ce.length-1].last_line,first_column:Ce[Ce.length-(ot||1)].first_column,last_column:Ce[Ce.length-1].last_column},Le&&(Et._$.range=[Ce[Ce.length-(ot||1)].range[0],Ce[Ce.length-1].range[1]]),be=this.performAction.apply(Et,[H,j,he,Ue.yy,lt[1],je,Ce].concat(Be)),typeof be<"u")return be;ot&&(nt=nt.slice(0,-1*ot*2),je=je.slice(0,-1*ot),Ce=Ce.slice(0,-1*ot)),nt.push(this.productions_[lt[1]][0]),je.push(Et.$),Ce.push(Et._$),It=Se[nt[nt.length-2]][nt[nt.length-1]],nt.push(It);break;case 3:return!0}}return!0},"parse")},Te=(function(){var ke={EOF:1,parseError:x(function(Qe,nt){if(this.yy.parser)this.yy.parser.parseError(Qe,nt);else throw new Error(Qe)},"parseError"),setInput:x(function(Ve,Qe){return this.yy=Qe||this.yy||{},this._input=Ve,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Ve=this._input[0];this.yytext+=Ve,this.yyleng++,this.offset++,this.match+=Ve,this.matched+=Ve;var Qe=Ve.match(/(?:\r\n?|\n).*/g);return Qe?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ve},"input"),unput:x(function(Ve){var Qe=Ve.length,nt=Ve.split(/(?:\r\n?|\n)/g);this._input=Ve+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Qe),this.offset-=Qe;var tt=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),nt.length-1&&(this.yylineno-=nt.length-1);var je=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:nt?(nt.length===tt.length?this.yylloc.first_column:0)+tt[tt.length-nt.length].length-nt[0].length:this.yylloc.first_column-Qe},this.options.ranges&&(this.yylloc.range=[je[0],je[0]+this.yyleng-Qe]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Ve){this.unput(this.match.slice(Ve))},"less"),pastInput:x(function(){var Ve=this.matched.substr(0,this.matched.length-this.match.length);return(Ve.length>20?"...":"")+Ve.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Ve=this.match;return Ve.length<20&&(Ve+=this._input.substr(0,20-Ve.length)),(Ve.substr(0,20)+(Ve.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Ve=this.pastInput(),Qe=new Array(Ve.length+1).join("-");return Ve+this.upcomingInput()+` -`+Qe+"^"},"showPosition"),test_match:x(function(Ve,Qe){var nt,tt,je;if(this.options.backtrack_lexer&&(je={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(je.yylloc.range=this.yylloc.range.slice(0))),tt=Ve[0].match(/(?:\r\n?|\n).*/g),tt&&(this.yylineno+=tt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:tt?tt[tt.length-1].length-tt[tt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ve[0].length},this.yytext+=Ve[0],this.match+=Ve[0],this.matches=Ve,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Ve[0].length),this.matched+=Ve[0],nt=this.performAction.call(this,this.yy,this,Qe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),nt)return nt;if(this._backtrack){for(var Ce in je)this[Ce]=je[Ce];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ve,Qe,nt,tt;this._more||(this.yytext="",this.match="");for(var je=this._currentRules(),Ce=0;CeQe[0].length)){if(Qe=nt,tt=Ce,this.options.backtrack_lexer){if(Ve=this.test_match(nt,je[Ce]),Ve!==!1)return Ve;if(this._backtrack){Qe=!1;continue}else return!1}else if(!this.options.flex)break}return Qe?(Ve=this.test_match(Qe,je[tt]),Ve!==!1?Ve:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Qe=this.next();return Qe||this.lex()},"lex"),begin:x(function(Qe){this.conditionStack.push(Qe)},"begin"),popState:x(function(){var Qe=this.conditionStack.length-1;return Qe>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Qe){return Qe=this.conditionStack.length-1-Math.abs(Qe||0),Qe>=0?this.conditionStack[Qe]:"INITIAL"},"topState"),pushState:x(function(Qe){this.begin(Qe)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(Qe,nt,tt,je){switch(tt){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return ke})();Ge.lexer=Te;function Ze(){this.yy={}}return x(Ze,"Parser"),Ze.prototype=Ge,Ge.Parser=Ze,new Ze})();p3.parser=p3;var QVe=p3,zo=[],hh=[""],Ja="global",Go="",Bl=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],dx=[],dI="",fI=!1,g3=4,m3=2,Tte,JVe=x(function(){return Tte},"getC4Type"),eWe=x(function(t){Tte=qr(t,Pe())},"setC4Type"),tWe=x(function(t,e,r,n,i,a,s,o,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=dx.find(d=>d.from===e&&d.to===r);if(h?u=h:dx.push(u),u.type=t,u.from=e,u.to=r,u.label={text:n},i==null)u.techn={text:""};else if(typeof i=="object"){let[d,f]=Object.entries(i)[0];u[d]={text:f}}else u.techn={text:i};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[d,f]=Object.entries(a)[0];u[d]={text:f}}else u.descr={text:a};if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]=f}else u.sprite=s;if(typeof o=="object"){let[d,f]=Object.entries(o)[0];u[d]=f}else u.tags=o;if(typeof l=="object"){let[d,f]=Object.entries(l)[0];u[d]=f}else u.link=l;u.wrap=dh()},"addRel"),rWe=x(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let o={};const l=zo.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,zo.push(o)),r==null?o.label={text:""}:o.label={text:r},n==null)o.descr={text:""};else if(typeof n=="object"){let[u,h]=Object.entries(n)[0];o[u]={text:h}}else o.descr={text:n};if(typeof i=="object"){let[u,h]=Object.entries(i)[0];o[u]=h}else o.sprite=i;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];o[u]=h}else o.tags=a;if(typeof s=="object"){let[u,h]=Object.entries(s)[0];o[u]=h}else o.link=s;o.typeC4Shape={text:t},o.parentBoundary=Ja,o.wrap=dh()},"addPersonOrSystem"),nWe=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=zo.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,zo.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=dh(),l.typeC4Shape={text:t},l.parentBoundary=Ja},"addContainer"),iWe=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=zo.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,zo.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=dh(),l.typeC4Shape={text:t},l.parentBoundary=Ja},"addComponent"),aWe=x(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=Bl.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,Bl.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Ja,a.wrap=dh(),Go=Ja,Ja=t,hh.push(Go)},"addPersonOrSystemBoundary"),sWe=x(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=Bl.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,Bl.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Ja,a.wrap=dh(),Go=Ja,Ja=t,hh.push(Go)},"addContainerBoundary"),oWe=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=Bl.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Bl.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.type={text:"node"};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.type={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.nodeType=t,l.parentBoundary=Ja,l.wrap=dh(),Go=Ja,Ja=e,hh.push(Go)},"addDeploymentNode"),lWe=x(function(){Ja=Go,hh.pop(),Go=hh.pop(),hh.push(Go)},"popBoundaryParseStack"),cWe=x(function(t,e,r,n,i,a,s,o,l,u,h){let d=zo.find(f=>f.alias===e);if(!(d===void 0&&(d=Bl.find(f=>f.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[f,p]=Object.entries(r)[0];d[f]=p}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[f,p]=Object.entries(n)[0];d[f]=p}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[f,p]=Object.entries(i)[0];d[f]=p}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[f,p]=Object.entries(a)[0];d[f]=p}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.shape=s;if(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];d[f]=p}else d.sprite=o;if(l!=null)if(typeof l=="object"){let[f,p]=Object.entries(l)[0];d[f]=p}else d.techn=l;if(u!=null)if(typeof u=="object"){let[f,p]=Object.entries(u)[0];d[f]=p}else d.legendText=u;if(h!=null)if(typeof h=="object"){let[f,p]=Object.entries(h)[0];d[f]=p}else d.legendSprite=h}},"updateElStyle"),uWe=x(function(t,e,r,n,i,a,s){const o=dx.find(l=>l.from===e&&l.to===r);if(o!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];o[l]=u}else o.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];o[l]=u}else o.lineColor=i;if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];o[l]=parseInt(u)}else o.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[l,u]=Object.entries(s)[0];o[l]=parseInt(u)}else o.offsetY=parseInt(s)}},"updateRelStyle"),hWe=x(function(t,e,r){let n=g3,i=m3;if(typeof e=="object"){const a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){const a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(g3=n),i>=1&&(m3=i)},"updateLayoutConfig"),dWe=x(function(){return g3},"getC4ShapeInRow"),fWe=x(function(){return m3},"getC4BoundaryInRow"),pWe=x(function(){return Ja},"getCurrentBoundaryParse"),gWe=x(function(){return Go},"getParentBoundaryParse"),wte=x(function(t){return t==null?zo:zo.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),mWe=x(function(t){return zo.find(e=>e.alias===t)},"getC4Shape"),yWe=x(function(t){return Object.keys(wte(t))},"getC4ShapeKeys"),Cte=x(function(t){return t==null?Bl:Bl.filter(e=>e.parentBoundary===t)},"getBoundaries"),vWe=Cte,bWe=x(function(){return dx},"getRels"),xWe=x(function(){return dI},"getTitle"),TWe=x(function(t){fI=t},"setWrap"),dh=x(function(){return fI},"autoWrap"),wWe=x(function(){zo=[],Bl=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Go="",Ja="global",hh=[""],dx=[],hh=[""],dI="",fI=!1,g3=4,m3=2},"clear"),CWe={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},kWe={FILLED:0,OPEN:1},EWe={LEFTOF:0,RIGHTOF:1,OVER:2},SWe=x(function(t){dI=qr(t,Pe())},"setTitle"),pI={addPersonOrSystem:rWe,addPersonOrSystemBoundary:aWe,addContainer:nWe,addContainerBoundary:sWe,addComponent:iWe,addDeploymentNode:oWe,popBoundaryParseStack:lWe,addRel:tWe,updateElStyle:cWe,updateRelStyle:uWe,updateLayoutConfig:hWe,autoWrap:dh,setWrap:TWe,getC4ShapeArray:wte,getC4Shape:mWe,getC4ShapeKeys:yWe,getBoundaries:Cte,getBoundarys:vWe,getCurrentBoundaryParse:pWe,getParentBoundaryParse:gWe,getRels:bWe,getTitle:xWe,getC4Type:JVe,getC4ShapeInRow:dWe,getC4BoundaryInRow:fWe,setAccTitle:Dn,getAccTitle:Fn,getAccDescription:Gn,setAccDescription:zn,getConfig:x(()=>Pe().c4,"getConfig"),clear:wWe,LINETYPE:CWe,ARROWTYPE:kWe,PLACEMENT:EWe,setTitle:SWe,setC4Type:eWe},gI=x(function(t,e){return f3(t,e)},"drawRect"),kte=x(function(t,e,r,n,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:cd.sanitizeUrl(a);s.attr("xlink:href",o)},"drawImage"),AWe=x((t,e,r,n)=>{const i=t.append("g");let a=0;for(let s of e){let o=s.textColor?s.textColor:"#444444",l=s.lineColor?s.lineColor:"#444444",u=s.offsetX?parseInt(s.offsetX):0,h=s.offsetY?parseInt(s.offsetY):0,d="";if(a===0){let p=i.append("line");p.attr("x1",s.startPoint.x),p.attr("y1",s.startPoint.y),p.attr("x2",s.endPoint.x),p.attr("y2",s.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)"),a=-1}else{let p=i.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",s.startPoint.x).replaceAll("starty",s.startPoint.y).replaceAll("controlx",s.startPoint.x+(s.endPoint.x-s.startPoint.x)/2-(s.endPoint.x-s.startPoint.x)/4).replaceAll("controly",s.startPoint.y+(s.endPoint.y-s.startPoint.y)/2).replaceAll("stopx",s.endPoint.x).replaceAll("stopy",s.endPoint.y)),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();qc(r)(s.label.text,i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+h,s.label.width,s.label.height,{fill:o},f),s.techn&&s.techn.text!==""&&(f=r.messageFont(),qc(r)("["+s.techn.text+"]",i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+r.messageFontSize+5+h,Math.max(s.label.width,s.techn.width),s.techn.height,{fill:o,"font-style":"italic"},f))}},"drawRels"),_We=x(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};gI(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=s,qc(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},u),e.type&&e.type.text!==""&&(u=r.boundaryFont(),u.fontColor=s,qc(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},u)),e.descr&&e.descr.text!==""&&(u=r.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=s,qc(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),RWe=x(function(t,e,r){var d;let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const o=t.append("g");o.attr("class","person-man");const l=Ys();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=e.x,l.y=e.y,l.fill=n,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},gI(o,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let u=PWe(r,e.typeC4Shape.text);switch(o.append("text").attr("fill",a).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":kte(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,qc(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.techn&&((d=e.techn)==null?void 0:d.text)!==""?qc(r)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&e.type.text!==""&&qc(r)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},h),e.descr&&e.descr.text!==""&&(h=r.personFont(),h.fontColor=a,qc(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),LWe=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),IWe=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),DWe=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),MWe=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),NWe=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),OWe=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),$We=x(function(t,e){const n=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),n.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),PWe=x((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),qc=(function(){function t(i,a,s,o,l,u,h){const d=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(Lt.lineBreakRegex);for(let y=0;y=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>Ete)&&(r=this.nextData.startx+e.margin+ar.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},yI(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},x(Rm,"Bounds"),Rm),yI=x(function(t){ci(ar,t),t.fontFamily&&(ar.personFontFamily=ar.systemFontFamily=ar.messageFontFamily=t.fontFamily),t.fontSize&&(ar.personFontSize=ar.systemFontSize=ar.messageFontSize=t.fontSize),t.fontWeight&&(ar.personFontWeight=ar.systemFontWeight=ar.messageFontWeight=t.fontWeight)},"setConf"),fx=x((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),b3=x(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),BWe=x(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function go(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=U2(e[t].text,i,n),e[t].textLines=e[t].text.split(Lt.lineBreakRegex).length,e[t].width=i,e[t].height=D4(e[t].text,n);else{let a=e[t].text.split(Lt.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(const o of a)e[t].width=Math.max(qa(o,n),e[t].width),s=D4(o,n),e[t].height=e[t].height+s}}x(go,"calcC4ShapeTextWH");var Ate=x(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=ar.c4ShapeMargin-35;let n=e.wrap&&ar.wrap,i=b3(ar);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=qa(e.label.text,i);go("label",e,n,i,a),Fl.drawBoundary(t,e,ar)},"drawBoundary"),_te=x(function(t,e,r,n){let i=0;for(const a of n){i=0;const s=r[a];let o=fx(ar,s.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,s.typeC4Shape.width=qa("«"+s.typeC4Shape.text+"»",o),s.typeC4Shape.height=o.fontSize+2,s.typeC4Shape.Y=ar.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height);let l=s.wrap&&ar.wrap,u=ar.width-ar.c4ShapePadding*2,h=fx(ar,s.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",go("label",s,l,h,u),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let p=fx(ar,s.typeC4Shape.text);go("type",s,l,p,u),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let p=fx(ar,s.techn.text);go("techn",s,l,p,u),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,f=s.label.width;if(s.descr&&s.descr.text!==""){let p=fx(ar,s.typeC4Shape.text);go("descr",s,l,p,u),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,f=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}f=f+ar.c4ShapePadding,s.width=Math.max(s.width||ar.width,f,ar.width),s.height=Math.max(s.height||ar.height,d,ar.height),s.margin=s.margin||ar.c4ShapeMargin,t.insert(s),Fl.drawC4Shape(e,s,ar)}t.bumpLastMargin(ar.c4ShapeMargin)},"drawC4ShapeArray"),mo=(Lm=class{constructor(e,r){this.x=e,this.y=r}},x(Lm,"Point"),Lm),Rte=x(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),u=Math.abs(n-a),h=u/l,d=t.height/t.width,f=null;return n==a&&ri?f=new mo(r,o):r==i&&na&&(f=new mo(s,n)),r>i&&n=h?f=new mo(r,o+h*t.width/2):f=new mo(s-l/u*t.height/2,n+t.height):r=h?f=new mo(r+t.width,o+h*t.width/2):f=new mo(s+l/u*t.height/2,n+t.height):ra?d>=h?f=new mo(r+t.width,o-h*t.width/2):f=new mo(s+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new mo(r,o-t.width/2*h):f=new mo(s-t.height/2*l/u,n)),f},"getIntersectPoint"),FWe=x(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=Rte(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=Rte(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),zWe=x(function(t,e,r,n,i){let a=0;for(let s of e){a=a+1;let o=s.wrap&&ar.wrap,l=BWe(ar);n.db.getC4Type()==="C4Dynamic"&&(s.label.text=a+": "+s.label.text);let h=qa(s.label.text,l);go("label",s,o,l,h),s.techn&&s.techn.text!==""&&(h=qa(s.techn.text,l),go("techn",s,o,l,h)),s.descr&&s.descr.text!==""&&(h=qa(s.descr.text,l),go("descr",s,o,l,h));let d=r(s.from),f=r(s.to),p=FWe(d,f);s.startPoint=p.startPoint,s.endPoint=p.endPoint}Fl.drawRels(t,e,ar,i)},"drawRels");function vI(t,e,r,n,i){let a=new Ste(i);a.data.widthLimit=r.data.widthLimit/Math.min(mI,n.length);for(let[s,o]of n.entries()){let l=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=l,l=o.image.Y+o.image.height);let u=o.wrap&&ar.wrap,h=b3(ar);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",go("label",o,u,h,a.data.widthLimit),o.label.Y=l+8,l=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let g=b3(ar);go("type",o,u,g,a.data.widthLimit),o.type.Y=l+5,l=o.type.Y+o.type.height}if(o.descr&&o.descr.text!==""){let g=b3(ar);g.fontSize=g.fontSize-2,go("descr",o,u,g,a.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(s==0||s%mI===0){let g=r.data.startx+ar.diagramMarginX,m=r.data.stopy+ar.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+ar.diagramMarginX:a.data.startx,m=a.data.starty;a.setData(g,g,m,m)}a.name=o.alias;let d=i.db.getC4ShapeArray(o.alias),f=i.db.getC4ShapeKeys(o.alias);f.length>0&&_te(a,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&vI(t,e,a,p,i),o.alias!=="global"&&Ate(t,o,a),r.data.stopy=Math.max(a.data.stopy+ar.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+ar.c4ShapeMargin,r.data.stopx),y3=Math.max(y3,r.data.stopx),v3=Math.max(v3,r.data.stopy)}}x(vI,"drawInsideBoundary");var GWe=x(function(t,e,r,n){ar=Pe().c4;const i=Pe().securityLevel;let a;i==="sandbox"&&(a=pt("#i"+e));const s=pt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(ar.wrap),Ete=o.getC4ShapeInRow(),mI=o.getC4BoundaryInRow(),ae.debug(`C:${JSON.stringify(ar,null,2)}`);const l=i==="sandbox"?s.select(`[id="${e}"]`):pt(`[id="${e}"]`);Fl.insertComputerIcon(l,e),Fl.insertDatabaseIcon(l,e),Fl.insertClockIcon(l,e);let u=new Ste(n);u.setData(ar.diagramMarginX,ar.diagramMarginX,ar.diagramMarginY,ar.diagramMarginY),u.data.widthLimit=screen.availWidth,y3=ar.diagramMarginX,v3=ar.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");vI(l,"",u,d,n),Fl.insertArrowHead(l,e),Fl.insertArrowEnd(l,e),Fl.insertArrowCrossHead(l,e),Fl.insertArrowFilledHead(l,e),zWe(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=y3,u.data.stopy=v3;const f=u.data;let g=f.stopy-f.starty+2*ar.diagramMarginY;const y=f.stopx-f.startx+2*ar.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*ar.diagramMarginX).attr("y",f.starty+ar.diagramMarginY),wi(l,g,y,ar.useMaxWidth);const v=h?60:0;l.attr("viewBox",f.startx-ar.diagramMarginX+" -"+(ar.diagramMarginY+v)+" "+y+" "+(g+v)),ae.debug("models:",f)},"draw"),Lte={drawPersonOrSystemArray:_te,drawBoundary:Ate,setConf:yI,draw:GWe},qWe=x(t=>`.person { +Expecting `+xt.join(", ")+", got '"+(this.terminals_[it]||it)+"'":ht="Parse error on line "+(he+1)+": Unexpected "+(it==re?"end of input":"'"+(this.terminals_[it]||it)+"'"),this.parseError(ht,{text:xe.match,token:this.terminals_[it]||it,line:xe.yylineno,loc:qe,expected:xt})}if(lt[0]instanceof Array&<.length>1)throw new Error("Parse Error: multiple actions possible at state: "+we+", token: "+it);switch(lt[0]){case 1:nt.push(it),je.push(xe.yytext),Ce.push(xe.yylloc),nt.push(lt[1]),it=null,j=xe.yyleng,H=xe.yytext,he=xe.yylineno,qe=xe.yylloc;break;case 2:if(ot=this.productions_[lt[1]][1],Et.$=je[je.length-ot],Et._$={first_line:Ce[Ce.length-(ot||1)].first_line,last_line:Ce[Ce.length-1].last_line,first_column:Ce[Ce.length-(ot||1)].first_column,last_column:Ce[Ce.length-1].last_column},Le&&(Et._$.range=[Ce[Ce.length-(ot||1)].range[0],Ce[Ce.length-1].range[1]]),be=this.performAction.apply(Et,[H,j,he,Ue.yy,lt[1],je,Ce].concat(Fe)),typeof be<"u")return be;ot&&(nt=nt.slice(0,-1*ot*2),je=je.slice(0,-1*ot),Ce=Ce.slice(0,-1*ot)),nt.push(this.productions_[lt[1]][0]),je.push(Et.$),Ce.push(Et._$),It=Se[nt[nt.length-2]][nt[nt.length-1]],nt.push(It);break;case 3:return!0}}return!0},"parse")},Te=(function(){var ke={EOF:1,parseError:T(function(Qe,nt){if(this.yy.parser)this.yy.parser.parseError(Qe,nt);else throw new Error(Qe)},"parseError"),setInput:T(function(Ve,Qe){return this.yy=Qe||this.yy||{},this._input=Ve,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var Ve=this._input[0];this.yytext+=Ve,this.yyleng++,this.offset++,this.match+=Ve,this.matched+=Ve;var Qe=Ve.match(/(?:\r\n?|\n).*/g);return Qe?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ve},"input"),unput:T(function(Ve){var Qe=Ve.length,nt=Ve.split(/(?:\r\n?|\n)/g);this._input=Ve+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Qe),this.offset-=Qe;var tt=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),nt.length-1&&(this.yylineno-=nt.length-1);var je=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:nt?(nt.length===tt.length?this.yylloc.first_column:0)+tt[tt.length-nt.length].length-nt[0].length:this.yylloc.first_column-Qe},this.options.ranges&&(this.yylloc.range=[je[0],je[0]+this.yyleng-Qe]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(Ve){this.unput(this.match.slice(Ve))},"less"),pastInput:T(function(){var Ve=this.matched.substr(0,this.matched.length-this.match.length);return(Ve.length>20?"...":"")+Ve.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var Ve=this.match;return Ve.length<20&&(Ve+=this._input.substr(0,20-Ve.length)),(Ve.substr(0,20)+(Ve.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var Ve=this.pastInput(),Qe=new Array(Ve.length+1).join("-");return Ve+this.upcomingInput()+` +`+Qe+"^"},"showPosition"),test_match:T(function(Ve,Qe){var nt,tt,je;if(this.options.backtrack_lexer&&(je={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(je.yylloc.range=this.yylloc.range.slice(0))),tt=Ve[0].match(/(?:\r\n?|\n).*/g),tt&&(this.yylineno+=tt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:tt?tt[tt.length-1].length-tt[tt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ve[0].length},this.yytext+=Ve[0],this.match+=Ve[0],this.matches=Ve,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Ve[0].length),this.matched+=Ve[0],nt=this.performAction.call(this,this.yy,this,Qe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),nt)return nt;if(this._backtrack){for(var Ce in je)this[Ce]=je[Ce];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ve,Qe,nt,tt;this._more||(this.yytext="",this.match="");for(var je=this._currentRules(),Ce=0;CeQe[0].length)){if(Qe=nt,tt=Ce,this.options.backtrack_lexer){if(Ve=this.test_match(nt,je[Ce]),Ve!==!1)return Ve;if(this._backtrack){Qe=!1;continue}else return!1}else if(!this.options.flex)break}return Qe?(Ve=this.test_match(Qe,je[tt]),Ve!==!1?Ve:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var Qe=this.next();return Qe||this.lex()},"lex"),begin:T(function(Qe){this.conditionStack.push(Qe)},"begin"),popState:T(function(){var Qe=this.conditionStack.length-1;return Qe>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(Qe){return Qe=this.conditionStack.length-1-Math.abs(Qe||0),Qe>=0?this.conditionStack[Qe]:"INITIAL"},"topState"),pushState:T(function(Qe){this.begin(Qe)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:T(function(Qe,nt,tt,je){switch(tt){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return ke})();Ge.lexer=Te;function Ze(){this.yy={}}return T(Ze,"Parser"),Ze.prototype=Ge,Ge.Parser=Ze,new Ze})();y3.parser=y3;var hWe=y3,zo=[],hh=[""],Ja="global",Go="",Bl=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],px=[],yI="",vI=!1,v3=4,b3=2,Ate,dWe=T(function(){return Ate},"getC4Type"),fWe=T(function(t){Ate=qr(t,Pe())},"setC4Type"),pWe=T(function(t,e,r,n,i,a,s,o,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=px.find(d=>d.from===e&&d.to===r);if(h?u=h:px.push(u),u.type=t,u.from=e,u.to=r,u.label={text:n},i==null)u.techn={text:""};else if(typeof i=="object"){let[d,f]=Object.entries(i)[0];u[d]={text:f}}else u.techn={text:i};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[d,f]=Object.entries(a)[0];u[d]={text:f}}else u.descr={text:a};if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]=f}else u.sprite=s;if(typeof o=="object"){let[d,f]=Object.entries(o)[0];u[d]=f}else u.tags=o;if(typeof l=="object"){let[d,f]=Object.entries(l)[0];u[d]=f}else u.link=l;u.wrap=dh()},"addRel"),gWe=T(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let o={};const l=zo.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,zo.push(o)),r==null?o.label={text:""}:o.label={text:r},n==null)o.descr={text:""};else if(typeof n=="object"){let[u,h]=Object.entries(n)[0];o[u]={text:h}}else o.descr={text:n};if(typeof i=="object"){let[u,h]=Object.entries(i)[0];o[u]=h}else o.sprite=i;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];o[u]=h}else o.tags=a;if(typeof s=="object"){let[u,h]=Object.entries(s)[0];o[u]=h}else o.link=s;o.typeC4Shape={text:t},o.parentBoundary=Ja,o.wrap=dh()},"addPersonOrSystem"),mWe=T(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=zo.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,zo.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=dh(),l.typeC4Shape={text:t},l.parentBoundary=Ja},"addContainer"),yWe=T(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=zo.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,zo.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=dh(),l.typeC4Shape={text:t},l.parentBoundary=Ja},"addComponent"),vWe=T(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=Bl.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,Bl.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Ja,a.wrap=dh(),Go=Ja,Ja=t,hh.push(Go)},"addPersonOrSystemBoundary"),bWe=T(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=Bl.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,Bl.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Ja,a.wrap=dh(),Go=Ja,Ja=t,hh.push(Go)},"addContainerBoundary"),xWe=T(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=Bl.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Bl.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.type={text:"node"};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.type={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.nodeType=t,l.parentBoundary=Ja,l.wrap=dh(),Go=Ja,Ja=e,hh.push(Go)},"addDeploymentNode"),TWe=T(function(){Ja=Go,hh.pop(),Go=hh.pop(),hh.push(Go)},"popBoundaryParseStack"),wWe=T(function(t,e,r,n,i,a,s,o,l,u,h){let d=zo.find(f=>f.alias===e);if(!(d===void 0&&(d=Bl.find(f=>f.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[f,p]=Object.entries(r)[0];d[f]=p}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[f,p]=Object.entries(n)[0];d[f]=p}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[f,p]=Object.entries(i)[0];d[f]=p}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[f,p]=Object.entries(a)[0];d[f]=p}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.shape=s;if(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];d[f]=p}else d.sprite=o;if(l!=null)if(typeof l=="object"){let[f,p]=Object.entries(l)[0];d[f]=p}else d.techn=l;if(u!=null)if(typeof u=="object"){let[f,p]=Object.entries(u)[0];d[f]=p}else d.legendText=u;if(h!=null)if(typeof h=="object"){let[f,p]=Object.entries(h)[0];d[f]=p}else d.legendSprite=h}},"updateElStyle"),CWe=T(function(t,e,r,n,i,a,s){const o=px.find(l=>l.from===e&&l.to===r);if(o!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];o[l]=u}else o.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];o[l]=u}else o.lineColor=i;if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];o[l]=parseInt(u)}else o.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[l,u]=Object.entries(s)[0];o[l]=parseInt(u)}else o.offsetY=parseInt(s)}},"updateRelStyle"),kWe=T(function(t,e,r){let n=v3,i=b3;if(typeof e=="object"){const a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){const a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(v3=n),i>=1&&(b3=i)},"updateLayoutConfig"),EWe=T(function(){return v3},"getC4ShapeInRow"),SWe=T(function(){return b3},"getC4BoundaryInRow"),AWe=T(function(){return Ja},"getCurrentBoundaryParse"),_We=T(function(){return Go},"getParentBoundaryParse"),_te=T(function(t){return t==null?zo:zo.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),RWe=T(function(t){return zo.find(e=>e.alias===t)},"getC4Shape"),LWe=T(function(t){return Object.keys(_te(t))},"getC4ShapeKeys"),Rte=T(function(t){return t==null?Bl:Bl.filter(e=>e.parentBoundary===t)},"getBoundaries"),IWe=Rte,DWe=T(function(){return px},"getRels"),MWe=T(function(){return yI},"getTitle"),NWe=T(function(t){vI=t},"setWrap"),dh=T(function(){return vI},"autoWrap"),OWe=T(function(){zo=[],Bl=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Go="",Ja="global",hh=[""],px=[],hh=[""],yI="",vI=!1,v3=4,b3=2},"clear"),$We={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},PWe={FILLED:0,OPEN:1},BWe={LEFTOF:0,RIGHTOF:1,OVER:2},FWe=T(function(t){yI=qr(t,Pe())},"setTitle"),bI={addPersonOrSystem:gWe,addPersonOrSystemBoundary:vWe,addContainer:mWe,addContainerBoundary:bWe,addComponent:yWe,addDeploymentNode:xWe,popBoundaryParseStack:TWe,addRel:pWe,updateElStyle:wWe,updateRelStyle:CWe,updateLayoutConfig:kWe,autoWrap:dh,setWrap:NWe,getC4ShapeArray:_te,getC4Shape:RWe,getC4ShapeKeys:LWe,getBoundaries:Rte,getBoundarys:IWe,getCurrentBoundaryParse:AWe,getParentBoundaryParse:_We,getRels:DWe,getTitle:MWe,getC4Type:dWe,getC4ShapeInRow:EWe,getC4BoundaryInRow:SWe,setAccTitle:Dn,getAccTitle:Fn,getAccDescription:Gn,setAccDescription:zn,getConfig:T(()=>Pe().c4,"getConfig"),clear:OWe,LINETYPE:$We,ARROWTYPE:PWe,PLACEMENT:BWe,setTitle:FWe,setC4Type:fWe},xI=T(function(t,e){return m3(t,e)},"drawRect"),Lte=T(function(t,e,r,n,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:cd.sanitizeUrl(a);s.attr("xlink:href",o)},"drawImage"),zWe=T((t,e,r,n)=>{const i=t.append("g");let a=0;for(let s of e){let o=s.textColor?s.textColor:"#444444",l=s.lineColor?s.lineColor:"#444444",u=s.offsetX?parseInt(s.offsetX):0,h=s.offsetY?parseInt(s.offsetY):0,d="";if(a===0){let p=i.append("line");p.attr("x1",s.startPoint.x),p.attr("y1",s.startPoint.y),p.attr("x2",s.endPoint.x),p.attr("y2",s.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)"),a=-1}else{let p=i.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",s.startPoint.x).replaceAll("starty",s.startPoint.y).replaceAll("controlx",s.startPoint.x+(s.endPoint.x-s.startPoint.x)/2-(s.endPoint.x-s.startPoint.x)/4).replaceAll("controly",s.startPoint.y+(s.endPoint.y-s.startPoint.y)/2).replaceAll("stopx",s.endPoint.x).replaceAll("stopy",s.endPoint.y)),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();qc(r)(s.label.text,i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+h,s.label.width,s.label.height,{fill:o},f),s.techn&&s.techn.text!==""&&(f=r.messageFont(),qc(r)("["+s.techn.text+"]",i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+r.messageFontSize+5+h,Math.max(s.label.width,s.techn.width),s.techn.height,{fill:o,"font-style":"italic"},f))}},"drawRels"),GWe=T(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};xI(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=s,qc(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},u),e.type&&e.type.text!==""&&(u=r.boundaryFont(),u.fontColor=s,qc(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},u)),e.descr&&e.descr.text!==""&&(u=r.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=s,qc(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),qWe=T(function(t,e,r){var d;let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const o=t.append("g");o.attr("class","person-man");const l=Ys();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=e.x,l.y=e.y,l.fill=n,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},xI(o,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let u=jWe(r,e.typeC4Shape.text);switch(o.append("text").attr("fill",a).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":Lte(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,qc(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.techn&&((d=e.techn)==null?void 0:d.text)!==""?qc(r)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&e.type.text!==""&&qc(r)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},h),e.descr&&e.descr.text!==""&&(h=r.personFont(),h.fontColor=a,qc(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),VWe=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),WWe=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),UWe=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),HWe=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),YWe=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),XWe=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),KWe=T(function(t,e){const n=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),n.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),jWe=T((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),qc=(function(){function t(i,a,s,o,l,u,h){const d=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}T(t,"byText");function e(i,a,s,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(Lt.lineBreakRegex);for(let y=0;y=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>Ite)&&(r=this.nextData.startx+e.margin+ar.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},wI(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},T(Lm,"Bounds"),Lm),wI=T(function(t){ci(ar,t),t.fontFamily&&(ar.personFontFamily=ar.systemFontFamily=ar.messageFontFamily=t.fontFamily),t.fontSize&&(ar.personFontSize=ar.systemFontSize=ar.messageFontSize=t.fontSize),t.fontWeight&&(ar.personFontWeight=ar.systemFontWeight=ar.messageFontWeight=t.fontWeight)},"setConf"),gx=T((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),w3=T(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),ZWe=T(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function go(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=H2(e[t].text,i,n),e[t].textLines=e[t].text.split(Lt.lineBreakRegex).length,e[t].width=i,e[t].height=N4(e[t].text,n);else{let a=e[t].text.split(Lt.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(const o of a)e[t].width=Math.max(qa(o,n),e[t].width),s=N4(o,n),e[t].height=e[t].height+s}}T(go,"calcC4ShapeTextWH");var Mte=T(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=ar.c4ShapeMargin-35;let n=e.wrap&&ar.wrap,i=w3(ar);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=qa(e.label.text,i);go("label",e,n,i,a),Fl.drawBoundary(t,e,ar)},"drawBoundary"),Nte=T(function(t,e,r,n){let i=0;for(const a of n){i=0;const s=r[a];let o=gx(ar,s.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,s.typeC4Shape.width=qa("«"+s.typeC4Shape.text+"»",o),s.typeC4Shape.height=o.fontSize+2,s.typeC4Shape.Y=ar.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height);let l=s.wrap&&ar.wrap,u=ar.width-ar.c4ShapePadding*2,h=gx(ar,s.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",go("label",s,l,h,u),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let p=gx(ar,s.typeC4Shape.text);go("type",s,l,p,u),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let p=gx(ar,s.techn.text);go("techn",s,l,p,u),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,f=s.label.width;if(s.descr&&s.descr.text!==""){let p=gx(ar,s.typeC4Shape.text);go("descr",s,l,p,u),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,f=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}f=f+ar.c4ShapePadding,s.width=Math.max(s.width||ar.width,f,ar.width),s.height=Math.max(s.height||ar.height,d,ar.height),s.margin=s.margin||ar.c4ShapeMargin,t.insert(s),Fl.drawC4Shape(e,s,ar)}t.bumpLastMargin(ar.c4ShapeMargin)},"drawC4ShapeArray"),mo=(Im=class{constructor(e,r){this.x=e,this.y=r}},T(Im,"Point"),Im),Ote=T(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),u=Math.abs(n-a),h=u/l,d=t.height/t.width,f=null;return n==a&&ri?f=new mo(r,o):r==i&&na&&(f=new mo(s,n)),r>i&&n=h?f=new mo(r,o+h*t.width/2):f=new mo(s-l/u*t.height/2,n+t.height):r=h?f=new mo(r+t.width,o+h*t.width/2):f=new mo(s+l/u*t.height/2,n+t.height):ra?d>=h?f=new mo(r+t.width,o-h*t.width/2):f=new mo(s+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new mo(r,o-t.width/2*h):f=new mo(s-t.height/2*l/u,n)),f},"getIntersectPoint"),QWe=T(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=Ote(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=Ote(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),JWe=T(function(t,e,r,n,i){let a=0;for(let s of e){a=a+1;let o=s.wrap&&ar.wrap,l=ZWe(ar);n.db.getC4Type()==="C4Dynamic"&&(s.label.text=a+": "+s.label.text);let h=qa(s.label.text,l);go("label",s,o,l,h),s.techn&&s.techn.text!==""&&(h=qa(s.techn.text,l),go("techn",s,o,l,h)),s.descr&&s.descr.text!==""&&(h=qa(s.descr.text,l),go("descr",s,o,l,h));let d=r(s.from),f=r(s.to),p=QWe(d,f);s.startPoint=p.startPoint,s.endPoint=p.endPoint}Fl.drawRels(t,e,ar,i)},"drawRels");function CI(t,e,r,n,i){let a=new Dte(i);a.data.widthLimit=r.data.widthLimit/Math.min(TI,n.length);for(let[s,o]of n.entries()){let l=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=l,l=o.image.Y+o.image.height);let u=o.wrap&&ar.wrap,h=w3(ar);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",go("label",o,u,h,a.data.widthLimit),o.label.Y=l+8,l=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let g=w3(ar);go("type",o,u,g,a.data.widthLimit),o.type.Y=l+5,l=o.type.Y+o.type.height}if(o.descr&&o.descr.text!==""){let g=w3(ar);g.fontSize=g.fontSize-2,go("descr",o,u,g,a.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(s==0||s%TI===0){let g=r.data.startx+ar.diagramMarginX,m=r.data.stopy+ar.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+ar.diagramMarginX:a.data.startx,m=a.data.starty;a.setData(g,g,m,m)}a.name=o.alias;let d=i.db.getC4ShapeArray(o.alias),f=i.db.getC4ShapeKeys(o.alias);f.length>0&&Nte(a,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&CI(t,e,a,p,i),o.alias!=="global"&&Mte(t,o,a),r.data.stopy=Math.max(a.data.stopy+ar.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+ar.c4ShapeMargin,r.data.stopx),x3=Math.max(x3,r.data.stopx),T3=Math.max(T3,r.data.stopy)}}T(CI,"drawInsideBoundary");var eUe=T(function(t,e,r,n){ar=Pe().c4;const i=Pe().securityLevel;let a;i==="sandbox"&&(a=pt("#i"+e));const s=pt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(ar.wrap),Ite=o.getC4ShapeInRow(),TI=o.getC4BoundaryInRow(),ae.debug(`C:${JSON.stringify(ar,null,2)}`);const l=i==="sandbox"?s.select(`[id="${e}"]`):pt(`[id="${e}"]`);Fl.insertComputerIcon(l,e),Fl.insertDatabaseIcon(l,e),Fl.insertClockIcon(l,e);let u=new Dte(n);u.setData(ar.diagramMarginX,ar.diagramMarginX,ar.diagramMarginY,ar.diagramMarginY),u.data.widthLimit=screen.availWidth,x3=ar.diagramMarginX,T3=ar.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");CI(l,"",u,d,n),Fl.insertArrowHead(l,e),Fl.insertArrowEnd(l,e),Fl.insertArrowCrossHead(l,e),Fl.insertArrowFilledHead(l,e),JWe(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=x3,u.data.stopy=T3;const f=u.data;let g=f.stopy-f.starty+2*ar.diagramMarginY;const y=f.stopx-f.startx+2*ar.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*ar.diagramMarginX).attr("y",f.starty+ar.diagramMarginY),wi(l,g,y,ar.useMaxWidth);const v=h?60:0;l.attr("viewBox",f.startx-ar.diagramMarginX+" -"+(ar.diagramMarginY+v)+" "+y+" "+(g+v)),ae.debug("models:",f)},"draw"),$te={drawPersonOrSystemArray:Nte,drawBoundary:Mte,setConf:wI,draw:eUe},tUe=T(t=>`.person { stroke: ${t.personBorder}; fill: ${t.personBkg}; } -`,"getStyles"),VWe=qWe,WWe={parser:QVe,db:pI,renderer:Lte,styles:VWe,init:x(({c4:t,wrap:e})=>{Lte.setConf(t),pI.setWrap(e)},"init")};const UWe=Object.freeze(Object.defineProperty({__proto__:null,diagram:WWe},Symbol.toStringTag,{value:"Module"}));var px=x(()=>` +`,"getStyles"),rUe=tUe,nUe={parser:hWe,db:bI,renderer:$te,styles:rUe,init:T(({c4:t,wrap:e})=>{$te.setConf(t),bI.setWrap(e)},"init")};const iUe=Object.freeze(Object.defineProperty({__proto__:null,diagram:nUe},Symbol.toStringTag,{value:"Module"}));var mx=T(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; @@ -911,27 +911,27 @@ Expecting `+xt.join(", ")+", got '"+(this.terminals_[it]||it)+"'":ht="Parse erro overflow: visible; vertical-align: -0.125em; } - + .node .label-icon path { fill: currentColor; stroke: revert; stroke-width: revert; } -`,"getIconStyles"),Xp=x((t,e)=>{let r;return e==="sandbox"&&(r=pt("#i"+t)),pt(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),Wd=x((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:s,y:o}=HWe(t,e);wi(t,a,i,n);const l=YWe(s,o,i,a,e);t.attr("viewBox",l),ae.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),HWe=x((t,e)=>{var n;const r=((n=t.node())==null?void 0:n.getBBox())||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),YWe=x((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),XWe="flowchart-",KWe=(Im=class{constructor(){this.vertexCounter=0,this.config=Pe(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Dn,this.setAccDescription=zn,this.setDiagramTitle=qn,this.getAccTitle=Fn,this.getAccDescription=Gn,this.getDiagramTitle=Mn,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(e){return Lt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,i,a,s,o={},l){var p,g;if(!e||e.trim().length===0)return;let u;if(l!==void 0){let m;l.includes(` +`,"getIconStyles"),K0=T((t,e)=>{let r;return e==="sandbox"&&(r=pt("#i"+t)),pt(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),Wd=T((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:s,y:o}=aUe(t,e);wi(t,a,i,n);const l=sUe(s,o,i,a,e);t.attr("viewBox",l),ae.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),aUe=T((t,e)=>{var n;const r=((n=t.node())==null?void 0:n.getBBox())||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),sUe=T((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),oUe="flowchart-",lUe=(Dm=class{constructor(){this.vertexCounter=0,this.config=Pe(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Dn,this.setAccDescription=zn,this.setDiagramTitle=qn,this.getAccTitle=Fn,this.getAccDescription=Gn,this.getDiagramTitle=Mn,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(e){return Lt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,i,a,s,o={},l){var p,g;if(!e||e.trim().length===0)return;let u;if(l!==void 0){let m;l.includes(` `)?m=l+` `:m=`{ `+l+` -}`,u=_4(m,{schema:A4})}const h=this.edges.find(m=>m.id===e);if(h){const m=u;(m==null?void 0:m.animate)!==void 0&&(h.animate=m.animate),(m==null?void 0:m.animation)!==void 0&&(h.animation=m.animation),(m==null?void 0:m.curve)!==void 0&&(h.interpolate=m.curve);return}let d,f=this.vertices.get(e);if(f===void 0&&(r===void 0&&n===void 0&&i!==void 0&&i!==null&&ae.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:XWe+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=Pe(),d=this.sanitizeText(r.text.trim()),f.labelType=r.type,d.startsWith('"')&&d.endsWith('"')&&(d=d.substring(1,d.length-1)),f.text=d):f.text===void 0&&(f.text=e),n!==void 0&&(f.type=n),i!=null&&i.forEach(m=>{f.styles.push(m)}),a!=null&&a.forEach(m=>{f.classes.push(m)}),s!==void 0&&(f.dir=s),f.props===void 0?f.props=o:o!==void 0&&Object.assign(f.props,o),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!WU(u.shape))throw new Error(`No such shape: ${u.shape}.`);f.type=u==null?void 0:u.shape}u!=null&&u.label&&(f.text=u==null?void 0:u.label,f.labelType=this.sanitizeNodeLabelType(u==null?void 0:u.labelType)),u!=null&&u.icon&&(f.icon=u==null?void 0:u.icon,!((p=u.label)!=null&&p.trim())&&f.text===e&&(f.text="")),u!=null&&u.form&&(f.form=u==null?void 0:u.form),u!=null&&u.pos&&(f.pos=u==null?void 0:u.pos),u!=null&&u.img&&(f.img=u==null?void 0:u.img,!((g=u.label)!=null&&g.trim())&&f.text===e&&(f.text="")),u!=null&&u.constraint&&(f.constraint=u.constraint),u.w&&(f.assetWidth=Number(u.w)),u.h&&(f.assetHeight=Number(u.h))}}addSingleLink(e,r,n,i){const o={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};ae.info("abc78 Got edge...",o);const l=n.text;if(l!==void 0&&(o.text=this.sanitizeText(l.text.trim()),o.text.startsWith('"')&&o.text.endsWith('"')&&(o.text=o.text.substring(1,o.text.length-1)),o.labelType=this.sanitizeNodeLabelType(l.type)),n!==void 0&&(o.type=n.type,o.stroke=n.stroke,o.length=n.length>10?10:n.length),i&&!this.edges.some(u=>u.id===i))o.id=i,o.isUserDefinedId=!0;else{const u=this.edges.filter(h=>h.start===o.start&&h.end===o.end);u.length===0?o.id=V0(o.start,o.end,{counter:0,prefix:"L"}):o.id=V0(o.start,o.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))ae.info("Pushing edge..."),this.edges.push(o);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. +}`,u=L4(m,{schema:R4})}const h=this.edges.find(m=>m.id===e);if(h){const m=u;(m==null?void 0:m.animate)!==void 0&&(h.animate=m.animate),(m==null?void 0:m.animation)!==void 0&&(h.animation=m.animation),(m==null?void 0:m.curve)!==void 0&&(h.interpolate=m.curve);return}let d,f=this.vertices.get(e);if(f===void 0&&(r===void 0&&n===void 0&&i!==void 0&&i!==null&&ae.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:oUe+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=Pe(),d=this.sanitizeText(r.text.trim()),f.labelType=r.type,d.startsWith('"')&&d.endsWith('"')&&(d=d.substring(1,d.length-1)),f.text=d):f.text===void 0&&(f.text=e),n!==void 0&&(f.type=n),i!=null&&i.forEach(m=>{f.styles.push(m)}),a!=null&&a.forEach(m=>{f.classes.push(m)}),s!==void 0&&(f.dir=s),f.props===void 0?f.props=o:o!==void 0&&Object.assign(f.props,o),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!KU(u.shape))throw new Error(`No such shape: ${u.shape}.`);f.type=u==null?void 0:u.shape}u!=null&&u.label&&(f.text=u==null?void 0:u.label,f.labelType=this.sanitizeNodeLabelType(u==null?void 0:u.labelType)),u!=null&&u.icon&&(f.icon=u==null?void 0:u.icon,!((p=u.label)!=null&&p.trim())&&f.text===e&&(f.text="")),u!=null&&u.form&&(f.form=u==null?void 0:u.form),u!=null&&u.pos&&(f.pos=u==null?void 0:u.pos),u!=null&&u.img&&(f.img=u==null?void 0:u.img,!((g=u.label)!=null&&g.trim())&&f.text===e&&(f.text="")),u!=null&&u.constraint&&(f.constraint=u.constraint),u.w&&(f.assetWidth=Number(u.w)),u.h&&(f.assetHeight=Number(u.h))}}addSingleLink(e,r,n,i){const o={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};ae.info("abc78 Got edge...",o);const l=n.text;if(l!==void 0&&(o.text=this.sanitizeText(l.text.trim()),o.text.startsWith('"')&&o.text.endsWith('"')&&(o.text=o.text.substring(1,o.text.length-1)),o.labelType=this.sanitizeNodeLabelType(l.type)),n!==void 0&&(o.type=n.type,o.stroke=n.stroke,o.length=n.length>10?10:n.length),i&&!this.edges.some(u=>u.id===i))o.id=i,o.isUserDefinedId=!0;else{const u=this.edges.filter(h=>h.start===o.start&&h.end===o.end);u.length===0?o.id=Vp(o.start,o.end,{counter:0,prefix:"L"}):o.id=Vp(o.start,o.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))ae.info("Pushing edge..."),this.edges.push(o);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. Initialize mermaid with maxEdges set to a higher number to allow more edges. You cannot set this config via configuration inside the diagram as it is a secure config. -You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){const i=this.isLinkData(n)?n.id.replace("@",""):void 0;ae.info("addLink",e,r,i);for(const a of e)for(const s of r){const o=a===e[e.length-1],l=s===r[0];o&&l?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{var i,a,s,o,l,u;if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(((a=(i=this.edges[n])==null?void 0:i.style)==null?void 0:a.length)??0)>0&&!((o=(s=this.edges[n])==null?void 0:s.style)!=null&&o.some(h=>h==null?void 0:h.startsWith("fill")))&&((u=(l=this.edges[n])==null?void 0:l.style)==null||u.push("fill:none")))})}addClass(e,r){const n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n!=null&&n.forEach(s=>{if(/color/.exec(s)){const o=s.replace("fill","bgFill");a.textStyles.push(o)}a.styles.push(s)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(const n of e.split(",")){const i=this.vertices.get(n);i&&i.classes.push(r);const a=this.edges.find(o=>o.id===n);a&&a.classes.push(r);const s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){if(Pe().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{const s=this.lookUpDomId(e),o=document.querySelector(`[id="${s}"]`);o!==null&&o.addEventListener("click",()=>{Lr.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=Lr.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){var e;return(e=this.direction)==null?void 0:e.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const r=xte();pt(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=pt(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(ku.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),pt(a.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=Pe(),In()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const o=x(f=>{const p={boolean:{},number:{},string:{}},g=[];let m;return{nodeList:f.filter(function(v){const T=typeof v;return v.stmt&&v.stmt==="dir"?(m=v.value,!1):v.trim()===""?!1:T in p?p[T].hasOwnProperty(v)?!1:p[T][v]=!0:g.includes(v)?!1:g.push(v)}),dir:m}},"uniq")(r.flat()),l=o.nodeList;let u=o.dir;const h=Pe().flowchart??{};if(u=u??(h.inheritDir?this.getDirection()??Pe().direction??void 0:void 0),this.version==="gen-1")for(let f=0;f2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,a=1;for(;i=0){const o=this.indexNodes2(e,s);if(o.result)return{result:!0,count:a+o.count};a=a+o.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){const n=r.length;let i=0;for(let a=0;a":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let a="normal",s=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");const o=this.countChar(".",n);return o&&(a="dotted",s=o),{type:i,stroke:a,length:s}}destructLink(e,r){const n=this.destructEndLink(e);let i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(const n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){const n=[];return e.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(e.nodes[a])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,a,s){var h;const o=n.get(e.id),l=i.get(e.id)??!1,u=this.findNode(r,e.id);if(u)u.cssStyles=e.styles,u.cssCompiledStyles=this.getCompiledStyles(e.classes),u.cssClasses=e.classes.join(" ");else{const d={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:((h=a.flowchart)==null?void 0:h.padding)||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:s,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};l?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}getData(){const e=Pe(),r=[],n=[],i=this.getSubGraphs(),a=new Map,s=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&s.set(h.id,!0);for(const d of h.nodes)a.set(d,h.id)}for(let u=i.length-1;u>=0;u--){const h=i[u];r.push({id:h.id,label:h.title,labelStyle:"",labelType:h.labelType,parentId:a.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir,isGroup:!0,look:e.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,a,s,e,e.look||"classic")});const l=this.getEdges();return l.forEach((u,h)=>{var m;const{arrowTypeStart:d,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:V0(u.start,u.end,{counter:h,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelType:u.labelType,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:(u==null?void 0:u.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":d,arrowTypeEnd:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:p,style:p,pattern:u.stroke,look:e.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||((m=e.flowchart)==null?void 0:m.curve)};n.push(g)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return $B.flowchart}},x(Im,"FlowDB"),Im),jWe=x(function(t,e){return e.db.getClasses()},"getClasses"),ZWe=x(async function(t,e,r,n){var d;ae.info("REF0:"),ae.info("Drawing state diagram (v2)",e);const{securityLevel:i,flowchart:a,layout:s}=Pe();n.db.setDiagramId(e),ae.debug("Before getData: ");const o=n.db.getData();ae.debug("Data: ",o);const l=Xp(e,i),u=n.db.getDirection();o.type=n.type,o.layoutAlgorithm=sb(s),o.layoutAlgorithm==="dagre"&&s==="elk"&&ae.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),o.direction=u,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["point","circle","cross"],o.diagramId=e,ae.debug("REF1:",o),await Z0(o,l);const h=((d=o.config.flowchart)==null?void 0:d.diagramPadding)??8;Lr.insertTitle(l,"flowchartTitleText",(a==null?void 0:a.titleTopMargin)||0,n.db.getDiagramTitle()),Wd(l,h,"flowchart",(a==null?void 0:a.useMaxWidth)||!1)},"draw"),QWe={getClasses:jWe,draw:ZWe},bI=(function(){var t=x(function(li,Bt,yt,Pt){for(yt=yt||{},Pt=li.length;Pt--;yt[li[Pt]]=Bt);return yt},"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],a=[2,2],s=[1,13],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,50],m=[1,49],y=[1,29],v=[1,30],T=[1,31],b=[1,32],w=[1,33],k=[1,45],A=[1,47],C=[1,43],_=[1,48],L=[1,44],O=[1,51],M=[1,46],z=[1,52],F=[1,53],S=[1,34],R=[1,35],N=[1,36],D=[1,37],I=[1,38],$=[1,58],B=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],P=[1,62],G=[1,61],V=[1,63],Y=[8,9,11,75,77,78],W=[1,79],ie=[1,92],K=[1,97],se=[1,96],J=[1,93],Z=[1,89],ee=[1,95],ne=[1,91],ue=[1,98],fe=[1,94],_e=[1,99],Ae=[1,90],Ne=[8,9,10,11,40,75,77,78],me=[8,9,10,11,40,46,75,77,78],ve=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],Ge=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],Te=[44,60,89,102,105,106,109,111,114,115,116],Ze=[1,122],ke=[1,123],Ve=[1,125],Qe=[1,124],nt=[44,60,62,74,89,102,105,106,109,111,114,115,116],tt=[1,134],je=[1,148],Ce=[1,149],Se=[1,150],H=[1,151],he=[1,136],j=[1,138],pe=[1,142],re=[1,143],Be=[1,144],xe=[1,145],Ue=[1,146],De=[1,147],qe=[1,152],Le=[1,153],Xe=[1,132],Ie=[1,133],it=[1,140],we=[1,135],lt=[1,139],be=[1,137],Et=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],vt=[1,155],ot=[1,157],It=[8,9,11],xt=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],ht=[1,177],oe=[1,173],At=[1,174],dt=[1,178],ut=[1,175],wt=[1,176],Mr=[77,116,119],ye=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],et=[10,106],ct=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],_t=[1,248],Ft=[1,246],nr=[1,250],ir=[1,244],_r=[1,245],or=[1,247],Rr=[1,249],Jt=[1,251],Nr=[1,269],gn=[8,9,11,106],$r=[8,9,10,11,60,84,105,106,109,110,111,112],Pa={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:x(function(Bt,yt,Pt,Ct,pr,Ee,Di){var Oe=Ee.length-1;switch(pr){case 2:this.$=[];break;case 3:(!Array.isArray(Ee[Oe])||Ee[Oe].length>0)&&Ee[Oe-1].push(Ee[Oe]),this.$=Ee[Oe-1];break;case 4:case 183:this.$=Ee[Oe];break;case 11:Ct.setDirection("TB"),this.$="TB";break;case 12:Ct.setDirection(Ee[Oe-1]),this.$=Ee[Oe-1];break;case 27:this.$=Ee[Oe-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=Ct.addSubGraph(Ee[Oe-6],Ee[Oe-1],Ee[Oe-4]);break;case 34:this.$=Ct.addSubGraph(Ee[Oe-3],Ee[Oe-1],Ee[Oe-3]);break;case 35:this.$=Ct.addSubGraph(void 0,Ee[Oe-1],void 0);break;case 37:this.$=Ee[Oe].trim(),Ct.setAccTitle(this.$);break;case 38:case 39:this.$=Ee[Oe].trim(),Ct.setAccDescription(this.$);break;case 43:this.$=Ee[Oe-1]+Ee[Oe];break;case 44:this.$=Ee[Oe];break;case 45:Ct.addVertex(Ee[Oe-1][Ee[Oe-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ee[Oe]),Ct.addLink(Ee[Oe-3].stmt,Ee[Oe-1],Ee[Oe-2]),this.$={stmt:Ee[Oe-1],nodes:Ee[Oe-1].concat(Ee[Oe-3].nodes)};break;case 46:Ct.addLink(Ee[Oe-2].stmt,Ee[Oe],Ee[Oe-1]),this.$={stmt:Ee[Oe],nodes:Ee[Oe].concat(Ee[Oe-2].nodes)};break;case 47:Ct.addLink(Ee[Oe-3].stmt,Ee[Oe-1],Ee[Oe-2]),this.$={stmt:Ee[Oe-1],nodes:Ee[Oe-1].concat(Ee[Oe-3].nodes)};break;case 48:this.$={stmt:Ee[Oe-1],nodes:Ee[Oe-1]};break;case 49:Ct.addVertex(Ee[Oe-1][Ee[Oe-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ee[Oe]),this.$={stmt:Ee[Oe-1],nodes:Ee[Oe-1],shapeData:Ee[Oe]};break;case 50:this.$={stmt:Ee[Oe],nodes:Ee[Oe]};break;case 51:this.$=[Ee[Oe]];break;case 52:Ct.addVertex(Ee[Oe-5][Ee[Oe-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ee[Oe-4]),this.$=Ee[Oe-5].concat(Ee[Oe]);break;case 53:this.$=Ee[Oe-4].concat(Ee[Oe]);break;case 54:this.$=Ee[Oe];break;case 55:this.$=Ee[Oe-2],Ct.setClass(Ee[Oe-2],Ee[Oe]);break;case 56:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"square");break;case 57:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"doublecircle");break;case 58:this.$=Ee[Oe-5],Ct.addVertex(Ee[Oe-5],Ee[Oe-2],"circle");break;case 59:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"ellipse");break;case 60:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"stadium");break;case 61:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"subroutine");break;case 62:this.$=Ee[Oe-7],Ct.addVertex(Ee[Oe-7],Ee[Oe-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Ee[Oe-5],Ee[Oe-3]]]));break;case 63:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"cylinder");break;case 64:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"round");break;case 65:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"diamond");break;case 66:this.$=Ee[Oe-5],Ct.addVertex(Ee[Oe-5],Ee[Oe-2],"hexagon");break;case 67:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"odd");break;case 68:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"trapezoid");break;case 69:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"inv_trapezoid");break;case 70:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"lean_right");break;case 71:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"lean_left");break;case 72:this.$=Ee[Oe],Ct.addVertex(Ee[Oe]);break;case 73:Ee[Oe-1].text=Ee[Oe],this.$=Ee[Oe-1];break;case 74:case 75:Ee[Oe-2].text=Ee[Oe-1],this.$=Ee[Oe-2];break;case 76:this.$=Ee[Oe];break;case 77:var Ln=Ct.destructLink(Ee[Oe],Ee[Oe-2]);this.$={type:Ln.type,stroke:Ln.stroke,length:Ln.length,text:Ee[Oe-1]};break;case 78:var Ln=Ct.destructLink(Ee[Oe],Ee[Oe-2]);this.$={type:Ln.type,stroke:Ln.stroke,length:Ln.length,text:Ee[Oe-1],id:Ee[Oe-3]};break;case 79:this.$={text:Ee[Oe],type:"text"};break;case 80:this.$={text:Ee[Oe-1].text+""+Ee[Oe],type:Ee[Oe-1].type};break;case 81:this.$={text:Ee[Oe],type:"string"};break;case 82:this.$={text:Ee[Oe],type:"markdown"};break;case 83:var Ln=Ct.destructLink(Ee[Oe]);this.$={type:Ln.type,stroke:Ln.stroke,length:Ln.length};break;case 84:var Ln=Ct.destructLink(Ee[Oe]);this.$={type:Ln.type,stroke:Ln.stroke,length:Ln.length,id:Ee[Oe-1]};break;case 85:this.$=Ee[Oe-1];break;case 86:this.$={text:Ee[Oe],type:"text"};break;case 87:this.$={text:Ee[Oe-1].text+""+Ee[Oe],type:Ee[Oe-1].type};break;case 88:this.$={text:Ee[Oe],type:"string"};break;case 89:case 104:this.$={text:Ee[Oe],type:"markdown"};break;case 101:this.$={text:Ee[Oe],type:"text"};break;case 102:this.$={text:Ee[Oe-1].text+""+Ee[Oe],type:Ee[Oe-1].type};break;case 103:this.$={text:Ee[Oe],type:"text"};break;case 105:this.$=Ee[Oe-4],Ct.addClass(Ee[Oe-2],Ee[Oe]);break;case 106:this.$=Ee[Oe-4],Ct.setClass(Ee[Oe-2],Ee[Oe]);break;case 107:case 115:this.$=Ee[Oe-1],Ct.setClickEvent(Ee[Oe-1],Ee[Oe]);break;case 108:case 116:this.$=Ee[Oe-3],Ct.setClickEvent(Ee[Oe-3],Ee[Oe-2]),Ct.setTooltip(Ee[Oe-3],Ee[Oe]);break;case 109:this.$=Ee[Oe-2],Ct.setClickEvent(Ee[Oe-2],Ee[Oe-1],Ee[Oe]);break;case 110:this.$=Ee[Oe-4],Ct.setClickEvent(Ee[Oe-4],Ee[Oe-3],Ee[Oe-2]),Ct.setTooltip(Ee[Oe-4],Ee[Oe]);break;case 111:this.$=Ee[Oe-2],Ct.setLink(Ee[Oe-2],Ee[Oe]);break;case 112:this.$=Ee[Oe-4],Ct.setLink(Ee[Oe-4],Ee[Oe-2]),Ct.setTooltip(Ee[Oe-4],Ee[Oe]);break;case 113:this.$=Ee[Oe-4],Ct.setLink(Ee[Oe-4],Ee[Oe-2],Ee[Oe]);break;case 114:this.$=Ee[Oe-6],Ct.setLink(Ee[Oe-6],Ee[Oe-4],Ee[Oe]),Ct.setTooltip(Ee[Oe-6],Ee[Oe-2]);break;case 117:this.$=Ee[Oe-1],Ct.setLink(Ee[Oe-1],Ee[Oe]);break;case 118:this.$=Ee[Oe-3],Ct.setLink(Ee[Oe-3],Ee[Oe-2]),Ct.setTooltip(Ee[Oe-3],Ee[Oe]);break;case 119:this.$=Ee[Oe-3],Ct.setLink(Ee[Oe-3],Ee[Oe-2],Ee[Oe]);break;case 120:this.$=Ee[Oe-5],Ct.setLink(Ee[Oe-5],Ee[Oe-4],Ee[Oe]),Ct.setTooltip(Ee[Oe-5],Ee[Oe-2]);break;case 121:this.$=Ee[Oe-4],Ct.addVertex(Ee[Oe-2],void 0,void 0,Ee[Oe]);break;case 122:this.$=Ee[Oe-4],Ct.updateLink([Ee[Oe-2]],Ee[Oe]);break;case 123:this.$=Ee[Oe-4],Ct.updateLink(Ee[Oe-2],Ee[Oe]);break;case 124:this.$=Ee[Oe-8],Ct.updateLinkInterpolate([Ee[Oe-6]],Ee[Oe-2]),Ct.updateLink([Ee[Oe-6]],Ee[Oe]);break;case 125:this.$=Ee[Oe-8],Ct.updateLinkInterpolate(Ee[Oe-6],Ee[Oe-2]),Ct.updateLink(Ee[Oe-6],Ee[Oe]);break;case 126:this.$=Ee[Oe-6],Ct.updateLinkInterpolate([Ee[Oe-4]],Ee[Oe]);break;case 127:this.$=Ee[Oe-6],Ct.updateLinkInterpolate(Ee[Oe-4],Ee[Oe]);break;case 128:case 130:this.$=[Ee[Oe]];break;case 129:case 131:Ee[Oe-2].push(Ee[Oe]),this.$=Ee[Oe-2];break;case 133:this.$=Ee[Oe-1]+Ee[Oe];break;case 181:this.$=Ee[Oe];break;case 182:this.$=Ee[Oe-1]+""+Ee[Oe];break;case 184:this.$=Ee[Oe-1]+""+Ee[Oe];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F,121:S,122:R,123:N,124:D,125:I},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,55],9:[1,56],10:$,15:54,18:57},t(B,[2,3]),t(B,[2,4]),t(B,[2,5]),t(B,[2,6]),t(B,[2,7]),t(B,[2,8]),{8:P,9:G,11:V,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:P,9:G,11:V,21:68},{8:P,9:G,11:V,21:69},{8:P,9:G,11:V,21:70},{8:P,9:G,11:V,21:71},{8:P,9:G,11:V,21:72},{8:P,9:G,10:[1,73],11:V,21:74},t(B,[2,36]),{35:[1,75]},{37:[1,76]},t(B,[2,39]),t(Y,[2,50],{18:77,39:78,10:$,40:W}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:ie,44:K,60:se,80:[1,87],89:J,95:[1,84],97:[1,85],101:86,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae,120:88},t(B,[2,185]),t(B,[2,186]),t(B,[2,187]),t(B,[2,188]),t(B,[2,189]),t(Ne,[2,51]),t(Ne,[2,54],{46:[1,100]}),t(me,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:m,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:k,102:A,105:C,106:_,109:L,111:O,114:M,115:z,116:F}),t(ve,[2,181]),t(ve,[2,142]),t(ve,[2,143]),t(ve,[2,144]),t(ve,[2,145]),t(ve,[2,146]),t(ve,[2,147]),t(ve,[2,148]),t(ve,[2,149]),t(ve,[2,150]),t(ve,[2,151]),t(ve,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(Ge,[2,26],{18:115,10:$}),t(B,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},t(B,[2,40]),t(B,[2,41]),t(B,[2,42]),t(Te,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Ze,81:ke,116:Ve,119:Qe},{75:[1,126],77:[1,127]},t(nt,[2,83]),t(B,[2,28]),t(B,[2,29]),t(B,[2,30]),t(B,[2,31]),t(B,[2,32]),{10:tt,12:je,14:Ce,27:Se,28:128,32:H,44:he,60:j,75:pe,80:[1,130],81:[1,131],83:141,84:re,85:Be,86:xe,87:Ue,88:De,89:qe,90:Le,91:129,105:Xe,109:Ie,111:it,114:we,115:lt,116:be},t(Et,a,{5:154}),t(B,[2,37]),t(B,[2,38]),t(Y,[2,48],{44:vt}),t(Y,[2,49],{18:156,10:$,40:ot}),t(Ne,[2,44]),{44:g,47:158,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},{44:g,47:163,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},t(It,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(It,[2,115],{120:168,10:[1,167],14:ie,44:K,60:se,89:J,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae}),t(It,[2,117],{10:[1,169]}),t(xt,[2,183]),t(xt,[2,170]),t(xt,[2,171]),t(xt,[2,172]),t(xt,[2,173]),t(xt,[2,174]),t(xt,[2,175]),t(xt,[2,176]),t(xt,[2,177]),t(xt,[2,178]),t(xt,[2,179]),t(xt,[2,180]),{44:g,47:170,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},{30:171,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:179,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:181,50:[1,180],67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:182,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:183,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:184,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{109:[1,185]},{30:186,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:187,65:[1,188],67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:189,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:190,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:191,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},t(ve,[2,182]),t(i,[2,20]),t(Ge,[2,25]),t(Y,[2,46],{39:192,18:193,10:$,40:W}),t(Te,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{77:[1,197],79:198,116:Ve,119:Qe},t(Mr,[2,79]),t(Mr,[2,81]),t(Mr,[2,82]),t(Mr,[2,168]),t(Mr,[2,169]),{76:199,79:121,80:Ze,81:ke,116:Ve,119:Qe},t(nt,[2,84]),{8:P,9:G,10:tt,11:V,12:je,14:Ce,21:201,27:Se,29:[1,200],32:H,44:he,60:j,75:pe,83:141,84:re,85:Be,86:xe,87:Ue,88:De,89:qe,90:Le,91:202,105:Xe,109:Ie,111:it,114:we,115:lt,116:be},t(ye,[2,101]),t(ye,[2,103]),t(ye,[2,104]),t(ye,[2,157]),t(ye,[2,158]),t(ye,[2,159]),t(ye,[2,160]),t(ye,[2,161]),t(ye,[2,162]),t(ye,[2,163]),t(ye,[2,164]),t(ye,[2,165]),t(ye,[2,166]),t(ye,[2,167]),t(ye,[2,90]),t(ye,[2,91]),t(ye,[2,92]),t(ye,[2,93]),t(ye,[2,94]),t(ye,[2,95]),t(ye,[2,96]),t(ye,[2,97]),t(ye,[2,98]),t(ye,[2,99]),t(ye,[2,100]),{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,203],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F,121:S,122:R,123:N,124:D,125:I},{10:$,18:204},{44:[1,205]},t(Ne,[2,43]),{10:[1,206],44:g,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:113,114:M,115:z,116:F},{10:[1,207]},{10:[1,208],106:[1,209]},t(et,[2,128]),{10:[1,210],44:g,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:113,114:M,115:z,116:F},{10:[1,211],44:g,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:113,114:M,115:z,116:F},{80:[1,212]},t(It,[2,109],{10:[1,213]}),t(It,[2,111],{10:[1,214]}),{80:[1,215]},t(xt,[2,184]),{80:[1,216],98:[1,217]},t(Ne,[2,55],{113:113,44:g,60:m,89:k,102:A,105:C,106:_,109:L,111:O,114:M,115:z,116:F}),{31:[1,218],67:ht,82:219,116:dt,117:ut,118:wt},t(ct,[2,86]),t(ct,[2,88]),t(ct,[2,89]),t(ct,[2,153]),t(ct,[2,154]),t(ct,[2,155]),t(ct,[2,156]),{49:[1,220],67:ht,82:219,116:dt,117:ut,118:wt},{30:221,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{51:[1,222],67:ht,82:219,116:dt,117:ut,118:wt},{53:[1,223],67:ht,82:219,116:dt,117:ut,118:wt},{55:[1,224],67:ht,82:219,116:dt,117:ut,118:wt},{57:[1,225],67:ht,82:219,116:dt,117:ut,118:wt},{60:[1,226]},{64:[1,227],67:ht,82:219,116:dt,117:ut,118:wt},{66:[1,228],67:ht,82:219,116:dt,117:ut,118:wt},{30:229,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{31:[1,230],67:ht,82:219,116:dt,117:ut,118:wt},{67:ht,69:[1,231],71:[1,232],82:219,116:dt,117:ut,118:wt},{67:ht,69:[1,234],71:[1,233],82:219,116:dt,117:ut,118:wt},t(Y,[2,45],{18:156,10:$,40:ot}),t(Y,[2,47],{44:vt}),t(Te,[2,75]),t(Te,[2,74]),{62:[1,235],67:ht,82:219,116:dt,117:ut,118:wt},t(Te,[2,77]),t(Mr,[2,80]),{77:[1,236],79:198,116:Ve,119:Qe},{30:237,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},t(Et,a,{5:238}),t(ye,[2,102]),t(B,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},{10:$,18:240},{10:_t,60:Ft,84:nr,92:241,105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},{10:_t,60:Ft,84:nr,92:252,104:[1,253],105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},{10:_t,60:Ft,84:nr,92:254,104:[1,255],105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},{105:[1,256]},{10:_t,60:Ft,84:nr,92:257,105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},{44:g,47:258,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},t(It,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(It,[2,116]),t(It,[2,118],{10:[1,262]}),t(It,[2,119]),t(me,[2,56]),t(ct,[2,87]),t(me,[2,57]),{51:[1,263],67:ht,82:219,116:dt,117:ut,118:wt},t(me,[2,64]),t(me,[2,59]),t(me,[2,60]),t(me,[2,61]),{109:[1,264]},t(me,[2,63]),t(me,[2,65]),{66:[1,265],67:ht,82:219,116:dt,117:ut,118:wt},t(me,[2,67]),t(me,[2,68]),t(me,[2,70]),t(me,[2,69]),t(me,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(Te,[2,78]),{31:[1,266],67:ht,82:219,116:dt,117:ut,118:wt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,267],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F,121:S,122:R,123:N,124:D,125:I},t(Ne,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},t(It,[2,121],{106:Nr}),t(gn,[2,130],{108:270,10:_t,60:Ft,84:nr,105:ir,109:_r,110:or,111:Rr,112:Jt}),t($r,[2,132]),t($r,[2,134]),t($r,[2,135]),t($r,[2,136]),t($r,[2,137]),t($r,[2,138]),t($r,[2,139]),t($r,[2,140]),t($r,[2,141]),t(It,[2,122],{106:Nr}),{10:[1,271]},t(It,[2,123],{106:Nr}),{10:[1,272]},t(et,[2,129]),t(It,[2,105],{106:Nr}),t(It,[2,106],{113:113,44:g,60:m,89:k,102:A,105:C,106:_,109:L,111:O,114:M,115:z,116:F}),t(It,[2,110]),t(It,[2,112],{10:[1,273]}),t(It,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:P,9:G,11:V,21:278},t(B,[2,34]),t(Ne,[2,52]),{10:_t,60:Ft,84:nr,105:ir,107:279,108:243,109:_r,110:or,111:Rr,112:Jt},t($r,[2,133]),{14:ie,44:K,60:se,89:J,101:280,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae,120:88},{14:ie,44:K,60:se,89:J,101:281,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae,120:88},{98:[1,282]},t(It,[2,120]),t(me,[2,58]),{30:283,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},t(me,[2,66]),t(Et,a,{5:284}),t(gn,[2,131],{108:270,10:_t,60:Ft,84:nr,105:ir,109:_r,110:or,111:Rr,112:Jt}),t(It,[2,126],{120:168,10:[1,285],14:ie,44:K,60:se,89:J,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae}),t(It,[2,127],{120:168,10:[1,286],14:ie,44:K,60:se,89:J,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae}),t(It,[2,114]),{31:[1,287],67:ht,82:219,116:dt,117:ut,118:wt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,288],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F,121:S,122:R,123:N,124:D,125:I},{10:_t,60:Ft,84:nr,92:289,105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},{10:_t,60:Ft,84:nr,92:290,105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},t(me,[2,62]),t(B,[2,33]),t(It,[2,124],{106:Nr}),t(It,[2,125],{106:Nr})],defaultActions:{},parseError:x(function(Bt,yt){if(yt.recoverable)this.trace(Bt);else{var Pt=new Error(Bt);throw Pt.hash=yt,Pt}},"parseError"),parse:x(function(Bt){var yt=this,Pt=[0],Ct=[],pr=[null],Ee=[],Di=this.table,Oe="",Ln=0,h0=0,jv=2,Zv=1,Qv=Ee.slice.call(arguments,1),Jn=Object.create(this.lexer),il={yy:{}};for(var yi in this.yy)Object.prototype.hasOwnProperty.call(this.yy,yi)&&(il.yy[yi]=this.yy[yi]);Jn.setInput(Bt,il.yy),il.yy.lexer=Jn,il.yy.parser=this,typeof Jn.yylloc>"u"&&(Jn.yylloc={});var al=Jn.yylloc;Ee.push(al);var xu=Jn.options&&Jn.options.ranges;typeof il.yy.parseError=="function"?this.parseError=il.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ot(Qr){Pt.length=Pt.length-2*Qr,pr.length=pr.length-Qr,Ee.length=Ee.length-Qr}x(Ot,"popStack");function Re(){var Qr;return Qr=Ct.pop()||Jn.lex()||Zv,typeof Qr!="number"&&(Qr instanceof Array&&(Ct=Qr,Qr=Ct.pop()),Qr=yt.symbols_[Qr]||Qr),Qr}x(Re,"lex");for(var Je,bt,Vt,dr,fr={},mn,dn,vi,ei;;){if(bt=Pt[Pt.length-1],this.defaultActions[bt]?Vt=this.defaultActions[bt]:((Je===null||typeof Je>"u")&&(Je=Re()),Vt=Di[bt]&&Di[bt][Je]),typeof Vt>"u"||!Vt.length||!Vt[0]){var bi="";ei=[];for(mn in Di[bt])this.terminals_[mn]&&mn>jv&&ei.push("'"+this.terminals_[mn]+"'");Jn.showPosition?bi="Parse error on line "+(Ln+1)+`: +You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){const i=this.isLinkData(n)?n.id.replace("@",""):void 0;ae.info("addLink",e,r,i);for(const a of e)for(const s of r){const o=a===e[e.length-1],l=s===r[0];o&&l?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{var i,a,s,o,l,u;if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(((a=(i=this.edges[n])==null?void 0:i.style)==null?void 0:a.length)??0)>0&&!((o=(s=this.edges[n])==null?void 0:s.style)!=null&&o.some(h=>h==null?void 0:h.startsWith("fill")))&&((u=(l=this.edges[n])==null?void 0:l.style)==null||u.push("fill:none")))})}addClass(e,r){const n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n!=null&&n.forEach(s=>{if(/color/.exec(s)){const o=s.replace("fill","bgFill");a.textStyles.push(o)}a.styles.push(s)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(const n of e.split(",")){const i=this.vertices.get(n);i&&i.classes.push(r);const a=this.edges.find(o=>o.id===n);a&&a.classes.push(r);const s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){if(Pe().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{const s=this.lookUpDomId(e),o=document.querySelector(`[id="${s}"]`);o!==null&&o.addEventListener("click",()=>{Lr.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=Lr.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){var e;return(e=this.direction)==null?void 0:e.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const r=Ste();pt(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=pt(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(ku.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),pt(a.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=Pe(),In()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const o=T(f=>{const p={boolean:{},number:{},string:{}},g=[];let m;return{nodeList:f.filter(function(v){const x=typeof v;return v.stmt&&v.stmt==="dir"?(m=v.value,!1):v.trim()===""?!1:x in p?p[x].hasOwnProperty(v)?!1:p[x][v]=!0:g.includes(v)?!1:g.push(v)}),dir:m}},"uniq")(r.flat()),l=o.nodeList;let u=o.dir;const h=Pe().flowchart??{};if(u=u??(h.inheritDir?this.getDirection()??Pe().direction??void 0:void 0),this.version==="gen-1")for(let f=0;f2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,a=1;for(;i=0){const o=this.indexNodes2(e,s);if(o.result)return{result:!0,count:a+o.count};a=a+o.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){const n=r.length;let i=0;for(let a=0;a":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let a="normal",s=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");const o=this.countChar(".",n);return o&&(a="dotted",s=o),{type:i,stroke:a,length:s}}destructLink(e,r){const n=this.destructEndLink(e);let i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(const n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){const n=[];return e.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(e.nodes[a])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,a,s){var h;const o=n.get(e.id),l=i.get(e.id)??!1,u=this.findNode(r,e.id);if(u)u.cssStyles=e.styles,u.cssCompiledStyles=this.getCompiledStyles(e.classes),u.cssClasses=e.classes.join(" ");else{const d={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:((h=a.flowchart)==null?void 0:h.padding)||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:s,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};l?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}getData(){const e=Pe(),r=[],n=[],i=this.getSubGraphs(),a=new Map,s=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&s.set(h.id,!0);for(const d of h.nodes)a.set(d,h.id)}for(let u=i.length-1;u>=0;u--){const h=i[u];r.push({id:h.id,label:h.title,labelStyle:"",labelType:h.labelType,parentId:a.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir,isGroup:!0,look:e.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,a,s,e,e.look||"classic")});const l=this.getEdges();return l.forEach((u,h)=>{var m;const{arrowTypeStart:d,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:Vp(u.start,u.end,{counter:h,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelType:u.labelType,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:(u==null?void 0:u.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":d,arrowTypeEnd:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:p,style:p,pattern:u.stroke,look:e.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||((m=e.flowchart)==null?void 0:m.curve)};n.push(g)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return GB.flowchart}},T(Dm,"FlowDB"),Dm),cUe=T(function(t,e){return e.db.getClasses()},"getClasses"),uUe=T(async function(t,e,r,n){var d;ae.info("REF0:"),ae.info("Drawing state diagram (v2)",e);const{securityLevel:i,flowchart:a,layout:s}=Pe();n.db.setDiagramId(e),ae.debug("Before getData: ");const o=n.db.getData();ae.debug("Data: ",o);const l=K0(e,i),u=n.db.getDirection();o.type=n.type,o.layoutAlgorithm=ob(s),o.layoutAlgorithm==="dagre"&&s==="elk"&&ae.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),o.direction=u,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["point","circle","cross"],o.diagramId=e,ae.debug("REF1:",o),await Zp(o,l);const h=((d=o.config.flowchart)==null?void 0:d.diagramPadding)??8;Lr.insertTitle(l,"flowchartTitleText",(a==null?void 0:a.titleTopMargin)||0,n.db.getDiagramTitle()),Wd(l,h,"flowchart",(a==null?void 0:a.useMaxWidth)||!1)},"draw"),hUe={getClasses:cUe,draw:uUe},kI=(function(){var t=T(function(li,Bt,yt,Pt){for(yt=yt||{},Pt=li.length;Pt--;yt[li[Pt]]=Bt);return yt},"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],a=[2,2],s=[1,13],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,50],m=[1,49],y=[1,29],v=[1,30],x=[1,31],b=[1,32],w=[1,33],k=[1,45],S=[1,47],C=[1,43],_=[1,48],L=[1,44],O=[1,51],M=[1,46],z=[1,52],F=[1,53],A=[1,34],R=[1,35],N=[1,36],D=[1,37],I=[1,38],$=[1,58],B=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],P=[1,62],G=[1,61],V=[1,63],X=[8,9,11,75,77,78],W=[1,79],ie=[1,92],K=[1,97],se=[1,96],J=[1,93],Z=[1,89],ee=[1,95],ne=[1,91],ue=[1,98],fe=[1,94],_e=[1,99],Ae=[1,90],Ne=[8,9,10,11,40,75,77,78],me=[8,9,10,11,40,46,75,77,78],ve=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],Ge=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],Te=[44,60,89,102,105,106,109,111,114,115,116],Ze=[1,122],ke=[1,123],Ve=[1,125],Qe=[1,124],nt=[44,60,62,74,89,102,105,106,109,111,114,115,116],tt=[1,134],je=[1,148],Ce=[1,149],Se=[1,150],H=[1,151],he=[1,136],j=[1,138],pe=[1,142],re=[1,143],Fe=[1,144],xe=[1,145],Ue=[1,146],Me=[1,147],qe=[1,152],Le=[1,153],Xe=[1,132],De=[1,133],it=[1,140],we=[1,135],lt=[1,139],be=[1,137],Et=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],vt=[1,155],ot=[1,157],It=[8,9,11],xt=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],ht=[1,177],oe=[1,173],At=[1,174],dt=[1,178],ut=[1,175],wt=[1,176],Mr=[77,116,119],ye=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],et=[10,106],ct=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],_t=[1,248],Ft=[1,246],nr=[1,250],ir=[1,244],_r=[1,245],or=[1,247],Rr=[1,249],Jt=[1,251],Nr=[1,269],gn=[8,9,11,106],$r=[8,9,10,11,60,84,105,106,109,110,111,112],Pa={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:T(function(Bt,yt,Pt,Ct,pr,Ee,Di){var Oe=Ee.length-1;switch(pr){case 2:this.$=[];break;case 3:(!Array.isArray(Ee[Oe])||Ee[Oe].length>0)&&Ee[Oe-1].push(Ee[Oe]),this.$=Ee[Oe-1];break;case 4:case 183:this.$=Ee[Oe];break;case 11:Ct.setDirection("TB"),this.$="TB";break;case 12:Ct.setDirection(Ee[Oe-1]),this.$=Ee[Oe-1];break;case 27:this.$=Ee[Oe-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=Ct.addSubGraph(Ee[Oe-6],Ee[Oe-1],Ee[Oe-4]);break;case 34:this.$=Ct.addSubGraph(Ee[Oe-3],Ee[Oe-1],Ee[Oe-3]);break;case 35:this.$=Ct.addSubGraph(void 0,Ee[Oe-1],void 0);break;case 37:this.$=Ee[Oe].trim(),Ct.setAccTitle(this.$);break;case 38:case 39:this.$=Ee[Oe].trim(),Ct.setAccDescription(this.$);break;case 43:this.$=Ee[Oe-1]+Ee[Oe];break;case 44:this.$=Ee[Oe];break;case 45:Ct.addVertex(Ee[Oe-1][Ee[Oe-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ee[Oe]),Ct.addLink(Ee[Oe-3].stmt,Ee[Oe-1],Ee[Oe-2]),this.$={stmt:Ee[Oe-1],nodes:Ee[Oe-1].concat(Ee[Oe-3].nodes)};break;case 46:Ct.addLink(Ee[Oe-2].stmt,Ee[Oe],Ee[Oe-1]),this.$={stmt:Ee[Oe],nodes:Ee[Oe].concat(Ee[Oe-2].nodes)};break;case 47:Ct.addLink(Ee[Oe-3].stmt,Ee[Oe-1],Ee[Oe-2]),this.$={stmt:Ee[Oe-1],nodes:Ee[Oe-1].concat(Ee[Oe-3].nodes)};break;case 48:this.$={stmt:Ee[Oe-1],nodes:Ee[Oe-1]};break;case 49:Ct.addVertex(Ee[Oe-1][Ee[Oe-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ee[Oe]),this.$={stmt:Ee[Oe-1],nodes:Ee[Oe-1],shapeData:Ee[Oe]};break;case 50:this.$={stmt:Ee[Oe],nodes:Ee[Oe]};break;case 51:this.$=[Ee[Oe]];break;case 52:Ct.addVertex(Ee[Oe-5][Ee[Oe-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ee[Oe-4]),this.$=Ee[Oe-5].concat(Ee[Oe]);break;case 53:this.$=Ee[Oe-4].concat(Ee[Oe]);break;case 54:this.$=Ee[Oe];break;case 55:this.$=Ee[Oe-2],Ct.setClass(Ee[Oe-2],Ee[Oe]);break;case 56:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"square");break;case 57:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"doublecircle");break;case 58:this.$=Ee[Oe-5],Ct.addVertex(Ee[Oe-5],Ee[Oe-2],"circle");break;case 59:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"ellipse");break;case 60:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"stadium");break;case 61:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"subroutine");break;case 62:this.$=Ee[Oe-7],Ct.addVertex(Ee[Oe-7],Ee[Oe-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Ee[Oe-5],Ee[Oe-3]]]));break;case 63:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"cylinder");break;case 64:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"round");break;case 65:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"diamond");break;case 66:this.$=Ee[Oe-5],Ct.addVertex(Ee[Oe-5],Ee[Oe-2],"hexagon");break;case 67:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"odd");break;case 68:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"trapezoid");break;case 69:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"inv_trapezoid");break;case 70:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"lean_right");break;case 71:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"lean_left");break;case 72:this.$=Ee[Oe],Ct.addVertex(Ee[Oe]);break;case 73:Ee[Oe-1].text=Ee[Oe],this.$=Ee[Oe-1];break;case 74:case 75:Ee[Oe-2].text=Ee[Oe-1],this.$=Ee[Oe-2];break;case 76:this.$=Ee[Oe];break;case 77:var Ln=Ct.destructLink(Ee[Oe],Ee[Oe-2]);this.$={type:Ln.type,stroke:Ln.stroke,length:Ln.length,text:Ee[Oe-1]};break;case 78:var Ln=Ct.destructLink(Ee[Oe],Ee[Oe-2]);this.$={type:Ln.type,stroke:Ln.stroke,length:Ln.length,text:Ee[Oe-1],id:Ee[Oe-3]};break;case 79:this.$={text:Ee[Oe],type:"text"};break;case 80:this.$={text:Ee[Oe-1].text+""+Ee[Oe],type:Ee[Oe-1].type};break;case 81:this.$={text:Ee[Oe],type:"string"};break;case 82:this.$={text:Ee[Oe],type:"markdown"};break;case 83:var Ln=Ct.destructLink(Ee[Oe]);this.$={type:Ln.type,stroke:Ln.stroke,length:Ln.length};break;case 84:var Ln=Ct.destructLink(Ee[Oe]);this.$={type:Ln.type,stroke:Ln.stroke,length:Ln.length,id:Ee[Oe-1]};break;case 85:this.$=Ee[Oe-1];break;case 86:this.$={text:Ee[Oe],type:"text"};break;case 87:this.$={text:Ee[Oe-1].text+""+Ee[Oe],type:Ee[Oe-1].type};break;case 88:this.$={text:Ee[Oe],type:"string"};break;case 89:case 104:this.$={text:Ee[Oe],type:"markdown"};break;case 101:this.$={text:Ee[Oe],type:"text"};break;case 102:this.$={text:Ee[Oe-1].text+""+Ee[Oe],type:Ee[Oe-1].type};break;case 103:this.$={text:Ee[Oe],type:"text"};break;case 105:this.$=Ee[Oe-4],Ct.addClass(Ee[Oe-2],Ee[Oe]);break;case 106:this.$=Ee[Oe-4],Ct.setClass(Ee[Oe-2],Ee[Oe]);break;case 107:case 115:this.$=Ee[Oe-1],Ct.setClickEvent(Ee[Oe-1],Ee[Oe]);break;case 108:case 116:this.$=Ee[Oe-3],Ct.setClickEvent(Ee[Oe-3],Ee[Oe-2]),Ct.setTooltip(Ee[Oe-3],Ee[Oe]);break;case 109:this.$=Ee[Oe-2],Ct.setClickEvent(Ee[Oe-2],Ee[Oe-1],Ee[Oe]);break;case 110:this.$=Ee[Oe-4],Ct.setClickEvent(Ee[Oe-4],Ee[Oe-3],Ee[Oe-2]),Ct.setTooltip(Ee[Oe-4],Ee[Oe]);break;case 111:this.$=Ee[Oe-2],Ct.setLink(Ee[Oe-2],Ee[Oe]);break;case 112:this.$=Ee[Oe-4],Ct.setLink(Ee[Oe-4],Ee[Oe-2]),Ct.setTooltip(Ee[Oe-4],Ee[Oe]);break;case 113:this.$=Ee[Oe-4],Ct.setLink(Ee[Oe-4],Ee[Oe-2],Ee[Oe]);break;case 114:this.$=Ee[Oe-6],Ct.setLink(Ee[Oe-6],Ee[Oe-4],Ee[Oe]),Ct.setTooltip(Ee[Oe-6],Ee[Oe-2]);break;case 117:this.$=Ee[Oe-1],Ct.setLink(Ee[Oe-1],Ee[Oe]);break;case 118:this.$=Ee[Oe-3],Ct.setLink(Ee[Oe-3],Ee[Oe-2]),Ct.setTooltip(Ee[Oe-3],Ee[Oe]);break;case 119:this.$=Ee[Oe-3],Ct.setLink(Ee[Oe-3],Ee[Oe-2],Ee[Oe]);break;case 120:this.$=Ee[Oe-5],Ct.setLink(Ee[Oe-5],Ee[Oe-4],Ee[Oe]),Ct.setTooltip(Ee[Oe-5],Ee[Oe-2]);break;case 121:this.$=Ee[Oe-4],Ct.addVertex(Ee[Oe-2],void 0,void 0,Ee[Oe]);break;case 122:this.$=Ee[Oe-4],Ct.updateLink([Ee[Oe-2]],Ee[Oe]);break;case 123:this.$=Ee[Oe-4],Ct.updateLink(Ee[Oe-2],Ee[Oe]);break;case 124:this.$=Ee[Oe-8],Ct.updateLinkInterpolate([Ee[Oe-6]],Ee[Oe-2]),Ct.updateLink([Ee[Oe-6]],Ee[Oe]);break;case 125:this.$=Ee[Oe-8],Ct.updateLinkInterpolate(Ee[Oe-6],Ee[Oe-2]),Ct.updateLink(Ee[Oe-6],Ee[Oe]);break;case 126:this.$=Ee[Oe-6],Ct.updateLinkInterpolate([Ee[Oe-4]],Ee[Oe]);break;case 127:this.$=Ee[Oe-6],Ct.updateLinkInterpolate(Ee[Oe-4],Ee[Oe]);break;case 128:case 130:this.$=[Ee[Oe]];break;case 129:case 131:Ee[Oe-2].push(Ee[Oe]),this.$=Ee[Oe-2];break;case 133:this.$=Ee[Oe-1]+Ee[Oe];break;case 181:this.$=Ee[Oe];break;case 182:this.$=Ee[Oe-1]+""+Ee[Oe];break;case 184:this.$=Ee[Oe-1]+""+Ee[Oe];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:w,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F,121:A,122:R,123:N,124:D,125:I},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,55],9:[1,56],10:$,15:54,18:57},t(B,[2,3]),t(B,[2,4]),t(B,[2,5]),t(B,[2,6]),t(B,[2,7]),t(B,[2,8]),{8:P,9:G,11:V,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:P,9:G,11:V,21:68},{8:P,9:G,11:V,21:69},{8:P,9:G,11:V,21:70},{8:P,9:G,11:V,21:71},{8:P,9:G,11:V,21:72},{8:P,9:G,10:[1,73],11:V,21:74},t(B,[2,36]),{35:[1,75]},{37:[1,76]},t(B,[2,39]),t(X,[2,50],{18:77,39:78,10:$,40:W}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:ie,44:K,60:se,80:[1,87],89:J,95:[1,84],97:[1,85],101:86,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae,120:88},t(B,[2,185]),t(B,[2,186]),t(B,[2,187]),t(B,[2,188]),t(B,[2,189]),t(Ne,[2,51]),t(Ne,[2,54],{46:[1,100]}),t(me,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:m,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:k,102:S,105:C,106:_,109:L,111:O,114:M,115:z,116:F}),t(ve,[2,181]),t(ve,[2,142]),t(ve,[2,143]),t(ve,[2,144]),t(ve,[2,145]),t(ve,[2,146]),t(ve,[2,147]),t(ve,[2,148]),t(ve,[2,149]),t(ve,[2,150]),t(ve,[2,151]),t(ve,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(Ge,[2,26],{18:115,10:$}),t(B,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},t(B,[2,40]),t(B,[2,41]),t(B,[2,42]),t(Te,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Ze,81:ke,116:Ve,119:Qe},{75:[1,126],77:[1,127]},t(nt,[2,83]),t(B,[2,28]),t(B,[2,29]),t(B,[2,30]),t(B,[2,31]),t(B,[2,32]),{10:tt,12:je,14:Ce,27:Se,28:128,32:H,44:he,60:j,75:pe,80:[1,130],81:[1,131],83:141,84:re,85:Fe,86:xe,87:Ue,88:Me,89:qe,90:Le,91:129,105:Xe,109:De,111:it,114:we,115:lt,116:be},t(Et,a,{5:154}),t(B,[2,37]),t(B,[2,38]),t(X,[2,48],{44:vt}),t(X,[2,49],{18:156,10:$,40:ot}),t(Ne,[2,44]),{44:g,47:158,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},{44:g,47:163,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},t(It,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(It,[2,115],{120:168,10:[1,167],14:ie,44:K,60:se,89:J,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae}),t(It,[2,117],{10:[1,169]}),t(xt,[2,183]),t(xt,[2,170]),t(xt,[2,171]),t(xt,[2,172]),t(xt,[2,173]),t(xt,[2,174]),t(xt,[2,175]),t(xt,[2,176]),t(xt,[2,177]),t(xt,[2,178]),t(xt,[2,179]),t(xt,[2,180]),{44:g,47:170,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},{30:171,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:179,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:181,50:[1,180],67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:182,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:183,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:184,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{109:[1,185]},{30:186,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:187,65:[1,188],67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:189,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:190,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:191,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},t(ve,[2,182]),t(i,[2,20]),t(Ge,[2,25]),t(X,[2,46],{39:192,18:193,10:$,40:W}),t(Te,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{77:[1,197],79:198,116:Ve,119:Qe},t(Mr,[2,79]),t(Mr,[2,81]),t(Mr,[2,82]),t(Mr,[2,168]),t(Mr,[2,169]),{76:199,79:121,80:Ze,81:ke,116:Ve,119:Qe},t(nt,[2,84]),{8:P,9:G,10:tt,11:V,12:je,14:Ce,21:201,27:Se,29:[1,200],32:H,44:he,60:j,75:pe,83:141,84:re,85:Fe,86:xe,87:Ue,88:Me,89:qe,90:Le,91:202,105:Xe,109:De,111:it,114:we,115:lt,116:be},t(ye,[2,101]),t(ye,[2,103]),t(ye,[2,104]),t(ye,[2,157]),t(ye,[2,158]),t(ye,[2,159]),t(ye,[2,160]),t(ye,[2,161]),t(ye,[2,162]),t(ye,[2,163]),t(ye,[2,164]),t(ye,[2,165]),t(ye,[2,166]),t(ye,[2,167]),t(ye,[2,90]),t(ye,[2,91]),t(ye,[2,92]),t(ye,[2,93]),t(ye,[2,94]),t(ye,[2,95]),t(ye,[2,96]),t(ye,[2,97]),t(ye,[2,98]),t(ye,[2,99]),t(ye,[2,100]),{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,203],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:w,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F,121:A,122:R,123:N,124:D,125:I},{10:$,18:204},{44:[1,205]},t(Ne,[2,43]),{10:[1,206],44:g,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:113,114:M,115:z,116:F},{10:[1,207]},{10:[1,208],106:[1,209]},t(et,[2,128]),{10:[1,210],44:g,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:113,114:M,115:z,116:F},{10:[1,211],44:g,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:113,114:M,115:z,116:F},{80:[1,212]},t(It,[2,109],{10:[1,213]}),t(It,[2,111],{10:[1,214]}),{80:[1,215]},t(xt,[2,184]),{80:[1,216],98:[1,217]},t(Ne,[2,55],{113:113,44:g,60:m,89:k,102:S,105:C,106:_,109:L,111:O,114:M,115:z,116:F}),{31:[1,218],67:ht,82:219,116:dt,117:ut,118:wt},t(ct,[2,86]),t(ct,[2,88]),t(ct,[2,89]),t(ct,[2,153]),t(ct,[2,154]),t(ct,[2,155]),t(ct,[2,156]),{49:[1,220],67:ht,82:219,116:dt,117:ut,118:wt},{30:221,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{51:[1,222],67:ht,82:219,116:dt,117:ut,118:wt},{53:[1,223],67:ht,82:219,116:dt,117:ut,118:wt},{55:[1,224],67:ht,82:219,116:dt,117:ut,118:wt},{57:[1,225],67:ht,82:219,116:dt,117:ut,118:wt},{60:[1,226]},{64:[1,227],67:ht,82:219,116:dt,117:ut,118:wt},{66:[1,228],67:ht,82:219,116:dt,117:ut,118:wt},{30:229,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{31:[1,230],67:ht,82:219,116:dt,117:ut,118:wt},{67:ht,69:[1,231],71:[1,232],82:219,116:dt,117:ut,118:wt},{67:ht,69:[1,234],71:[1,233],82:219,116:dt,117:ut,118:wt},t(X,[2,45],{18:156,10:$,40:ot}),t(X,[2,47],{44:vt}),t(Te,[2,75]),t(Te,[2,74]),{62:[1,235],67:ht,82:219,116:dt,117:ut,118:wt},t(Te,[2,77]),t(Mr,[2,80]),{77:[1,236],79:198,116:Ve,119:Qe},{30:237,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},t(Et,a,{5:238}),t(ye,[2,102]),t(B,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},{10:$,18:240},{10:_t,60:Ft,84:nr,92:241,105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},{10:_t,60:Ft,84:nr,92:252,104:[1,253],105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},{10:_t,60:Ft,84:nr,92:254,104:[1,255],105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},{105:[1,256]},{10:_t,60:Ft,84:nr,92:257,105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},{44:g,47:258,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},t(It,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(It,[2,116]),t(It,[2,118],{10:[1,262]}),t(It,[2,119]),t(me,[2,56]),t(ct,[2,87]),t(me,[2,57]),{51:[1,263],67:ht,82:219,116:dt,117:ut,118:wt},t(me,[2,64]),t(me,[2,59]),t(me,[2,60]),t(me,[2,61]),{109:[1,264]},t(me,[2,63]),t(me,[2,65]),{66:[1,265],67:ht,82:219,116:dt,117:ut,118:wt},t(me,[2,67]),t(me,[2,68]),t(me,[2,70]),t(me,[2,69]),t(me,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(Te,[2,78]),{31:[1,266],67:ht,82:219,116:dt,117:ut,118:wt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,267],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:w,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F,121:A,122:R,123:N,124:D,125:I},t(Ne,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},t(It,[2,121],{106:Nr}),t(gn,[2,130],{108:270,10:_t,60:Ft,84:nr,105:ir,109:_r,110:or,111:Rr,112:Jt}),t($r,[2,132]),t($r,[2,134]),t($r,[2,135]),t($r,[2,136]),t($r,[2,137]),t($r,[2,138]),t($r,[2,139]),t($r,[2,140]),t($r,[2,141]),t(It,[2,122],{106:Nr}),{10:[1,271]},t(It,[2,123],{106:Nr}),{10:[1,272]},t(et,[2,129]),t(It,[2,105],{106:Nr}),t(It,[2,106],{113:113,44:g,60:m,89:k,102:S,105:C,106:_,109:L,111:O,114:M,115:z,116:F}),t(It,[2,110]),t(It,[2,112],{10:[1,273]}),t(It,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:P,9:G,11:V,21:278},t(B,[2,34]),t(Ne,[2,52]),{10:_t,60:Ft,84:nr,105:ir,107:279,108:243,109:_r,110:or,111:Rr,112:Jt},t($r,[2,133]),{14:ie,44:K,60:se,89:J,101:280,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae,120:88},{14:ie,44:K,60:se,89:J,101:281,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae,120:88},{98:[1,282]},t(It,[2,120]),t(me,[2,58]),{30:283,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},t(me,[2,66]),t(Et,a,{5:284}),t(gn,[2,131],{108:270,10:_t,60:Ft,84:nr,105:ir,109:_r,110:or,111:Rr,112:Jt}),t(It,[2,126],{120:168,10:[1,285],14:ie,44:K,60:se,89:J,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae}),t(It,[2,127],{120:168,10:[1,286],14:ie,44:K,60:se,89:J,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae}),t(It,[2,114]),{31:[1,287],67:ht,82:219,116:dt,117:ut,118:wt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,288],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:w,89:k,102:S,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F,121:A,122:R,123:N,124:D,125:I},{10:_t,60:Ft,84:nr,92:289,105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},{10:_t,60:Ft,84:nr,92:290,105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},t(me,[2,62]),t(B,[2,33]),t(It,[2,124],{106:Nr}),t(It,[2,125],{106:Nr})],defaultActions:{},parseError:T(function(Bt,yt){if(yt.recoverable)this.trace(Bt);else{var Pt=new Error(Bt);throw Pt.hash=yt,Pt}},"parseError"),parse:T(function(Bt){var yt=this,Pt=[0],Ct=[],pr=[null],Ee=[],Di=this.table,Oe="",Ln=0,hp=0,Zv=2,Qv=1,Jv=Ee.slice.call(arguments,1),Jn=Object.create(this.lexer),il={yy:{}};for(var yi in this.yy)Object.prototype.hasOwnProperty.call(this.yy,yi)&&(il.yy[yi]=this.yy[yi]);Jn.setInput(Bt,il.yy),il.yy.lexer=Jn,il.yy.parser=this,typeof Jn.yylloc>"u"&&(Jn.yylloc={});var al=Jn.yylloc;Ee.push(al);var xu=Jn.options&&Jn.options.ranges;typeof il.yy.parseError=="function"?this.parseError=il.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ot(Qr){Pt.length=Pt.length-2*Qr,pr.length=pr.length-Qr,Ee.length=Ee.length-Qr}T(Ot,"popStack");function Re(){var Qr;return Qr=Ct.pop()||Jn.lex()||Qv,typeof Qr!="number"&&(Qr instanceof Array&&(Ct=Qr,Qr=Ct.pop()),Qr=yt.symbols_[Qr]||Qr),Qr}T(Re,"lex");for(var Je,bt,Vt,dr,fr={},mn,dn,vi,ei;;){if(bt=Pt[Pt.length-1],this.defaultActions[bt]?Vt=this.defaultActions[bt]:((Je===null||typeof Je>"u")&&(Je=Re()),Vt=Di[bt]&&Di[bt][Je]),typeof Vt>"u"||!Vt.length||!Vt[0]){var bi="";ei=[];for(mn in Di[bt])this.terminals_[mn]&&mn>Zv&&ei.push("'"+this.terminals_[mn]+"'");Jn.showPosition?bi="Parse error on line "+(Ln+1)+`: `+Jn.showPosition()+` -Expecting `+ei.join(", ")+", got '"+(this.terminals_[Je]||Je)+"'":bi="Parse error on line "+(Ln+1)+": Unexpected "+(Je==Zv?"end of input":"'"+(this.terminals_[Je]||Je)+"'"),this.parseError(bi,{text:Jn.match,token:this.terminals_[Je]||Je,line:Jn.yylineno,loc:al,expected:ei})}if(Vt[0]instanceof Array&&Vt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+bt+", token: "+Je);switch(Vt[0]){case 1:Pt.push(Je),pr.push(Jn.yytext),Ee.push(Jn.yylloc),Pt.push(Vt[1]),Je=null,h0=Jn.yyleng,Oe=Jn.yytext,Ln=Jn.yylineno,al=Jn.yylloc;break;case 2:if(dn=this.productions_[Vt[1]][1],fr.$=pr[pr.length-dn],fr._$={first_line:Ee[Ee.length-(dn||1)].first_line,last_line:Ee[Ee.length-1].last_line,first_column:Ee[Ee.length-(dn||1)].first_column,last_column:Ee[Ee.length-1].last_column},xu&&(fr._$.range=[Ee[Ee.length-(dn||1)].range[0],Ee[Ee.length-1].range[1]]),dr=this.performAction.apply(fr,[Oe,h0,Ln,il.yy,Vt[1],pr,Ee].concat(Qv)),typeof dr<"u")return dr;dn&&(Pt=Pt.slice(0,-1*dn*2),pr=pr.slice(0,-1*dn),Ee=Ee.slice(0,-1*dn)),Pt.push(this.productions_[Vt[1]][0]),pr.push(fr.$),Ee.push(fr._$),vi=Di[Pt[Pt.length-2]][Pt[Pt.length-1]],Pt.push(vi);break;case 3:return!0}}return!0},"parse")},ps=(function(){var li={EOF:1,parseError:x(function(yt,Pt){if(this.yy.parser)this.yy.parser.parseError(yt,Pt);else throw new Error(yt)},"parseError"),setInput:x(function(Bt,yt){return this.yy=yt||this.yy||{},this._input=Bt,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Bt=this._input[0];this.yytext+=Bt,this.yyleng++,this.offset++,this.match+=Bt,this.matched+=Bt;var yt=Bt.match(/(?:\r\n?|\n).*/g);return yt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Bt},"input"),unput:x(function(Bt){var yt=Bt.length,Pt=Bt.split(/(?:\r\n?|\n)/g);this._input=Bt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-yt),this.offset-=yt;var Ct=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Pt.length-1&&(this.yylineno-=Pt.length-1);var pr=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Pt?(Pt.length===Ct.length?this.yylloc.first_column:0)+Ct[Ct.length-Pt.length].length-Pt[0].length:this.yylloc.first_column-yt},this.options.ranges&&(this.yylloc.range=[pr[0],pr[0]+this.yyleng-yt]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Bt){this.unput(this.match.slice(Bt))},"less"),pastInput:x(function(){var Bt=this.matched.substr(0,this.matched.length-this.match.length);return(Bt.length>20?"...":"")+Bt.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Bt=this.match;return Bt.length<20&&(Bt+=this._input.substr(0,20-Bt.length)),(Bt.substr(0,20)+(Bt.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Bt=this.pastInput(),yt=new Array(Bt.length+1).join("-");return Bt+this.upcomingInput()+` -`+yt+"^"},"showPosition"),test_match:x(function(Bt,yt){var Pt,Ct,pr;if(this.options.backtrack_lexer&&(pr={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(pr.yylloc.range=this.yylloc.range.slice(0))),Ct=Bt[0].match(/(?:\r\n?|\n).*/g),Ct&&(this.yylineno+=Ct.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Ct?Ct[Ct.length-1].length-Ct[Ct.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Bt[0].length},this.yytext+=Bt[0],this.match+=Bt[0],this.matches=Bt,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Bt[0].length),this.matched+=Bt[0],Pt=this.performAction.call(this,this.yy,this,yt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Pt)return Pt;if(this._backtrack){for(var Ee in pr)this[Ee]=pr[Ee];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Bt,yt,Pt,Ct;this._more||(this.yytext="",this.match="");for(var pr=this._currentRules(),Ee=0;Eeyt[0].length)){if(yt=Pt,Ct=Ee,this.options.backtrack_lexer){if(Bt=this.test_match(Pt,pr[Ee]),Bt!==!1)return Bt;if(this._backtrack){yt=!1;continue}else return!1}else if(!this.options.flex)break}return yt?(Bt=this.test_match(yt,pr[Ct]),Bt!==!1?Bt:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var yt=this.next();return yt||this.lex()},"lex"),begin:x(function(yt){this.conditionStack.push(yt)},"begin"),popState:x(function(){var yt=this.conditionStack.length-1;return yt>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(yt){return yt=this.conditionStack.length-1-Math.abs(yt||0),yt>=0?this.conditionStack[yt]:"INITIAL"},"topState"),pushState:x(function(yt){this.begin(yt)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(yt,Pt,Ct,pr){switch(Ct){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),Pt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const Ee=/\n\s*/g;return Pt.yytext=Pt.yytext.replace(Ee,"
"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return yt.lex.firstGraph()&&this.begin("dir"),12;case 36:return yt.lex.firstGraph()&&this.begin("dir"),12;case 37:return yt.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:return 98;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return this.popState(),13;case 45:return this.popState(),14;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 125;case 60:return 78;case 61:return 105;case 62:return 111;case 63:return 46;case 64:return 60;case 65:return 44;case 66:return 8;case 67:return 106;case 68:return 115;case 69:return this.popState(),77;case 70:return this.pushState("edgeText"),75;case 71:return 119;case 72:return this.popState(),77;case 73:return this.pushState("thickEdgeText"),75;case 74:return 119;case 75:return this.popState(),77;case 76:return this.pushState("dottedEdgeText"),75;case 77:return 119;case 78:return 77;case 79:return this.popState(),53;case 80:return"TEXT";case 81:return this.pushState("ellipseText"),52;case 82:return this.popState(),55;case 83:return this.pushState("text"),54;case 84:return this.popState(),57;case 85:return this.pushState("text"),56;case 86:return 58;case 87:return this.pushState("text"),67;case 88:return this.popState(),64;case 89:return this.pushState("text"),63;case 90:return this.popState(),49;case 91:return this.pushState("text"),48;case 92:return this.popState(),69;case 93:return this.popState(),71;case 94:return 117;case 95:return this.pushState("trapText"),68;case 96:return this.pushState("trapText"),70;case 97:return 118;case 98:return 67;case 99:return 90;case 100:return"SEP";case 101:return 89;case 102:return 115;case 103:return 111;case 104:return 44;case 105:return 109;case 106:return 114;case 107:return 116;case 108:return this.popState(),62;case 109:return this.pushState("text"),62;case 110:return this.popState(),51;case 111:return this.pushState("text"),50;case 112:return this.popState(),31;case 113:return this.pushState("text"),29;case 114:return this.popState(),66;case 115:return this.pushState("text"),65;case 116:return"TEXT";case 117:return"QUOTE";case 118:return 9;case 119:return 10;case 120:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeData:{rules:[8,11,12,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackargs:{rules:[17,18,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackname:{rules:[14,15,16,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},href:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},click:{rules:[21,24,33,34,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dottedEdgeText:{rules:[21,24,75,77,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},thickEdgeText:{rules:[21,24,72,74,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},edgeText:{rules:[21,24,69,71,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},trapText:{rules:[21,24,78,81,83,85,89,91,92,93,94,95,96,109,111,113,115],inclusive:!1},ellipseText:{rules:[21,24,78,79,80,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},text:{rules:[21,24,78,81,82,83,84,85,88,89,90,91,95,96,108,109,110,111,112,113,114,115,116],inclusive:!1},vertex:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr:{rules:[3,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_title:{rules:[1,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},md_string:{rules:[19,20,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},string:{rules:[21,22,23,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,73,75,76,78,81,83,85,86,87,89,91,95,96,97,98,99,100,101,102,103,104,105,106,107,109,111,113,115,117,118,119,120],inclusive:!0}}};return li})();Pa.lexer=ps;function gs(){this.yy={}}return x(gs,"Parser"),gs.prototype=Pa,Pa.Parser=gs,new gs})();bI.parser=bI;var Ite=bI,Dte=Object.assign({},Ite);Dte.parse=t=>{const e=t.replace(/}\s*\n/g,`} -`);return Ite.parse(e)};var JWe=Dte,eUe=x((t,e)=>{const r=g6,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ao(n,i,a,e)},"fade"),tUe=x(t=>`.label { +Expecting `+ei.join(", ")+", got '"+(this.terminals_[Je]||Je)+"'":bi="Parse error on line "+(Ln+1)+": Unexpected "+(Je==Qv?"end of input":"'"+(this.terminals_[Je]||Je)+"'"),this.parseError(bi,{text:Jn.match,token:this.terminals_[Je]||Je,line:Jn.yylineno,loc:al,expected:ei})}if(Vt[0]instanceof Array&&Vt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+bt+", token: "+Je);switch(Vt[0]){case 1:Pt.push(Je),pr.push(Jn.yytext),Ee.push(Jn.yylloc),Pt.push(Vt[1]),Je=null,hp=Jn.yyleng,Oe=Jn.yytext,Ln=Jn.yylineno,al=Jn.yylloc;break;case 2:if(dn=this.productions_[Vt[1]][1],fr.$=pr[pr.length-dn],fr._$={first_line:Ee[Ee.length-(dn||1)].first_line,last_line:Ee[Ee.length-1].last_line,first_column:Ee[Ee.length-(dn||1)].first_column,last_column:Ee[Ee.length-1].last_column},xu&&(fr._$.range=[Ee[Ee.length-(dn||1)].range[0],Ee[Ee.length-1].range[1]]),dr=this.performAction.apply(fr,[Oe,hp,Ln,il.yy,Vt[1],pr,Ee].concat(Jv)),typeof dr<"u")return dr;dn&&(Pt=Pt.slice(0,-1*dn*2),pr=pr.slice(0,-1*dn),Ee=Ee.slice(0,-1*dn)),Pt.push(this.productions_[Vt[1]][0]),pr.push(fr.$),Ee.push(fr._$),vi=Di[Pt[Pt.length-2]][Pt[Pt.length-1]],Pt.push(vi);break;case 3:return!0}}return!0},"parse")},ps=(function(){var li={EOF:1,parseError:T(function(yt,Pt){if(this.yy.parser)this.yy.parser.parseError(yt,Pt);else throw new Error(yt)},"parseError"),setInput:T(function(Bt,yt){return this.yy=yt||this.yy||{},this._input=Bt,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var Bt=this._input[0];this.yytext+=Bt,this.yyleng++,this.offset++,this.match+=Bt,this.matched+=Bt;var yt=Bt.match(/(?:\r\n?|\n).*/g);return yt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Bt},"input"),unput:T(function(Bt){var yt=Bt.length,Pt=Bt.split(/(?:\r\n?|\n)/g);this._input=Bt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-yt),this.offset-=yt;var Ct=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Pt.length-1&&(this.yylineno-=Pt.length-1);var pr=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Pt?(Pt.length===Ct.length?this.yylloc.first_column:0)+Ct[Ct.length-Pt.length].length-Pt[0].length:this.yylloc.first_column-yt},this.options.ranges&&(this.yylloc.range=[pr[0],pr[0]+this.yyleng-yt]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(Bt){this.unput(this.match.slice(Bt))},"less"),pastInput:T(function(){var Bt=this.matched.substr(0,this.matched.length-this.match.length);return(Bt.length>20?"...":"")+Bt.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var Bt=this.match;return Bt.length<20&&(Bt+=this._input.substr(0,20-Bt.length)),(Bt.substr(0,20)+(Bt.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var Bt=this.pastInput(),yt=new Array(Bt.length+1).join("-");return Bt+this.upcomingInput()+` +`+yt+"^"},"showPosition"),test_match:T(function(Bt,yt){var Pt,Ct,pr;if(this.options.backtrack_lexer&&(pr={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(pr.yylloc.range=this.yylloc.range.slice(0))),Ct=Bt[0].match(/(?:\r\n?|\n).*/g),Ct&&(this.yylineno+=Ct.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Ct?Ct[Ct.length-1].length-Ct[Ct.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Bt[0].length},this.yytext+=Bt[0],this.match+=Bt[0],this.matches=Bt,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Bt[0].length),this.matched+=Bt[0],Pt=this.performAction.call(this,this.yy,this,yt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Pt)return Pt;if(this._backtrack){for(var Ee in pr)this[Ee]=pr[Ee];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Bt,yt,Pt,Ct;this._more||(this.yytext="",this.match="");for(var pr=this._currentRules(),Ee=0;Eeyt[0].length)){if(yt=Pt,Ct=Ee,this.options.backtrack_lexer){if(Bt=this.test_match(Pt,pr[Ee]),Bt!==!1)return Bt;if(this._backtrack){yt=!1;continue}else return!1}else if(!this.options.flex)break}return yt?(Bt=this.test_match(yt,pr[Ct]),Bt!==!1?Bt:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var yt=this.next();return yt||this.lex()},"lex"),begin:T(function(yt){this.conditionStack.push(yt)},"begin"),popState:T(function(){var yt=this.conditionStack.length-1;return yt>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(yt){return yt=this.conditionStack.length-1-Math.abs(yt||0),yt>=0?this.conditionStack[yt]:"INITIAL"},"topState"),pushState:T(function(yt){this.begin(yt)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:T(function(yt,Pt,Ct,pr){switch(Ct){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),Pt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const Ee=/\n\s*/g;return Pt.yytext=Pt.yytext.replace(Ee,"
"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return yt.lex.firstGraph()&&this.begin("dir"),12;case 36:return yt.lex.firstGraph()&&this.begin("dir"),12;case 37:return yt.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:return 98;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return this.popState(),13;case 45:return this.popState(),14;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 125;case 60:return 78;case 61:return 105;case 62:return 111;case 63:return 46;case 64:return 60;case 65:return 44;case 66:return 8;case 67:return 106;case 68:return 115;case 69:return this.popState(),77;case 70:return this.pushState("edgeText"),75;case 71:return 119;case 72:return this.popState(),77;case 73:return this.pushState("thickEdgeText"),75;case 74:return 119;case 75:return this.popState(),77;case 76:return this.pushState("dottedEdgeText"),75;case 77:return 119;case 78:return 77;case 79:return this.popState(),53;case 80:return"TEXT";case 81:return this.pushState("ellipseText"),52;case 82:return this.popState(),55;case 83:return this.pushState("text"),54;case 84:return this.popState(),57;case 85:return this.pushState("text"),56;case 86:return 58;case 87:return this.pushState("text"),67;case 88:return this.popState(),64;case 89:return this.pushState("text"),63;case 90:return this.popState(),49;case 91:return this.pushState("text"),48;case 92:return this.popState(),69;case 93:return this.popState(),71;case 94:return 117;case 95:return this.pushState("trapText"),68;case 96:return this.pushState("trapText"),70;case 97:return 118;case 98:return 67;case 99:return 90;case 100:return"SEP";case 101:return 89;case 102:return 115;case 103:return 111;case 104:return 44;case 105:return 109;case 106:return 114;case 107:return 116;case 108:return this.popState(),62;case 109:return this.pushState("text"),62;case 110:return this.popState(),51;case 111:return this.pushState("text"),50;case 112:return this.popState(),31;case 113:return this.pushState("text"),29;case 114:return this.popState(),66;case 115:return this.pushState("text"),65;case 116:return"TEXT";case 117:return"QUOTE";case 118:return 9;case 119:return 10;case 120:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeData:{rules:[8,11,12,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackargs:{rules:[17,18,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackname:{rules:[14,15,16,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},href:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},click:{rules:[21,24,33,34,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dottedEdgeText:{rules:[21,24,75,77,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},thickEdgeText:{rules:[21,24,72,74,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},edgeText:{rules:[21,24,69,71,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},trapText:{rules:[21,24,78,81,83,85,89,91,92,93,94,95,96,109,111,113,115],inclusive:!1},ellipseText:{rules:[21,24,78,79,80,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},text:{rules:[21,24,78,81,82,83,84,85,88,89,90,91,95,96,108,109,110,111,112,113,114,115,116],inclusive:!1},vertex:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr:{rules:[3,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_title:{rules:[1,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},md_string:{rules:[19,20,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},string:{rules:[21,22,23,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,73,75,76,78,81,83,85,86,87,89,91,95,96,97,98,99,100,101,102,103,104,105,106,107,109,111,113,115,117,118,119,120],inclusive:!0}}};return li})();Pa.lexer=ps;function gs(){this.yy={}}return T(gs,"Parser"),gs.prototype=Pa,Pa.Parser=gs,new gs})();kI.parser=kI;var Pte=kI,Bte=Object.assign({},Pte);Bte.parse=t=>{const e=t.replace(/}\s*\n/g,`} +`);return Pte.parse(e)};var dUe=Bte,fUe=T((t,e)=>{const r=v6,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ao(n,i,a,e)},"fade"),pUe=T(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -1018,7 +1018,7 @@ Expecting `+ei.join(", ")+", got '"+(this.terminals_[Je]||Je)+"'":bi="Parse erro /* For html labels only */ .labelBkg { - background-color: ${eUe(t.edgeLabelBackground,.5)}; + background-color: ${fUe(t.edgeLabelBackground,.5)}; // background-color: } @@ -1077,13 +1077,13 @@ Expecting `+ei.join(", ")+", got '"+(this.terminals_[Je]||Je)+"'":bi="Parse erro } text-align: center; } - ${px()} -`,"getStyles"),rUe=tUe,nUe={parser:JWe,get db(){return new KWe},renderer:QWe,styles:rUe,init:x(t=>{t.flowchart||(t.flowchart={}),t.layout&&O6({layout:t.layout}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,O6({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}})},"init")};const xI=Object.freeze(Object.defineProperty({__proto__:null,diagram:nUe},Symbol.toStringTag,{value:"Module"}));var TI=(function(){var t=x(function(_e,Ae,Ne,me){for(Ne=Ne||{},me=_e.length;me--;Ne[_e[me]]=Ae);return Ne},"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],n=[1,11],i=[1,12],a=[1,13],s=[1,23],o=[1,24],l=[1,25],u=[1,26],h=[1,27],d=[1,19],f=[1,28],p=[1,29],g=[1,20],m=[1,18],y=[1,21],v=[1,22],T=[1,36],b=[1,37],w=[1,38],k=[1,39],A=[1,40],C=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],_=[1,45],L=[1,46],O=[1,55],M=[40,48,50,51,52,70,71],z=[1,66],F=[1,64],S=[1,61],R=[1,65],N=[1,67],D=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],I=[65,66,67,68,69],$=[1,84],B=[1,83],P=[1,81],G=[1,82],V=[6,10,42,47],Y=[6,10,13,41,42,47,48,49],W=[1,92],ie=[1,91],K=[1,90],se=[19,58],J=[1,101],Z=[1,100],ee=[19,58,60,62],ne={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",65:"ZERO_OR_ONE",66:"ZERO_OR_MORE",67:"ONE_OR_MORE",68:"ONLY_ONE",69:"MD_PARENT",70:"NON_IDENTIFYING",71:"IDENTIFYING",72:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:x(function(Ae,Ne,me,ve,Ge,Te,Ze){var ke=Te.length-1;switch(Ge){case 1:break;case 2:this.$=[];break;case 3:Te[ke-1].push(Te[ke]),this.$=Te[ke-1];break;case 4:case 5:this.$=Te[ke];break;case 6:case 7:this.$=[];break;case 8:ve.addEntity(Te[ke-4]),ve.addEntity(Te[ke-2]),ve.addRelationship(Te[ke-4],Te[ke],Te[ke-2],Te[ke-3]);break;case 9:ve.addEntity(Te[ke-8]),ve.addEntity(Te[ke-4]),ve.addRelationship(Te[ke-8],Te[ke],Te[ke-4],Te[ke-5]),ve.setClass([Te[ke-8]],Te[ke-6]),ve.setClass([Te[ke-4]],Te[ke-2]);break;case 10:ve.addEntity(Te[ke-6]),ve.addEntity(Te[ke-2]),ve.addRelationship(Te[ke-6],Te[ke],Te[ke-2],Te[ke-3]),ve.setClass([Te[ke-6]],Te[ke-4]);break;case 11:ve.addEntity(Te[ke-6]),ve.addEntity(Te[ke-4]),ve.addRelationship(Te[ke-6],Te[ke],Te[ke-4],Te[ke-5]),ve.setClass([Te[ke-4]],Te[ke-2]);break;case 12:ve.addEntity(Te[ke-3]),ve.addAttributes(Te[ke-3],Te[ke-1]);break;case 13:ve.addEntity(Te[ke-5]),ve.addAttributes(Te[ke-5],Te[ke-1]),ve.setClass([Te[ke-5]],Te[ke-3]);break;case 14:ve.addEntity(Te[ke-2]);break;case 15:ve.addEntity(Te[ke-4]),ve.setClass([Te[ke-4]],Te[ke-2]);break;case 16:ve.addEntity(Te[ke]);break;case 17:ve.addEntity(Te[ke-2]),ve.setClass([Te[ke-2]],Te[ke]);break;case 18:ve.addEntity(Te[ke-6],Te[ke-4]),ve.addAttributes(Te[ke-6],Te[ke-1]);break;case 19:ve.addEntity(Te[ke-8],Te[ke-6]),ve.addAttributes(Te[ke-8],Te[ke-1]),ve.setClass([Te[ke-8]],Te[ke-3]);break;case 20:ve.addEntity(Te[ke-5],Te[ke-3]);break;case 21:ve.addEntity(Te[ke-7],Te[ke-5]),ve.setClass([Te[ke-7]],Te[ke-2]);break;case 22:ve.addEntity(Te[ke-3],Te[ke-1]);break;case 23:ve.addEntity(Te[ke-5],Te[ke-3]),ve.setClass([Te[ke-5]],Te[ke]);break;case 24:case 25:this.$=Te[ke].trim(),ve.setAccTitle(this.$);break;case 26:case 27:this.$=Te[ke].trim(),ve.setAccDescription(this.$);break;case 32:ve.setDirection("TB");break;case 33:ve.setDirection("BT");break;case 34:ve.setDirection("RL");break;case 35:ve.setDirection("LR");break;case 36:this.$=Te[ke-3],ve.addClass(Te[ke-2],Te[ke-1]);break;case 37:case 38:case 59:case 67:this.$=[Te[ke]];break;case 39:case 40:this.$=Te[ke-2].concat([Te[ke]]);break;case 41:this.$=Te[ke-2],ve.setClass(Te[ke-1],Te[ke]);break;case 42:this.$=Te[ke-3],ve.addCssStyles(Te[ke-2],Te[ke-1]);break;case 43:this.$=[Te[ke]];break;case 44:Te[ke-2].push(Te[ke]),this.$=Te[ke-2];break;case 46:this.$=Te[ke-1]+Te[ke];break;case 54:case 79:case 80:this.$=Te[ke].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 81:this.$=Te[ke];break;case 60:Te[ke].push(Te[ke-1]),this.$=Te[ke];break;case 61:this.$={type:Te[ke-1],name:Te[ke]};break;case 62:this.$={type:Te[ke-2],name:Te[ke-1],keys:Te[ke]};break;case 63:this.$={type:Te[ke-2],name:Te[ke-1],comment:Te[ke]};break;case 64:this.$={type:Te[ke-3],name:Te[ke-2],keys:Te[ke-1],comment:Te[ke]};break;case 65:case 66:case 69:this.$=Te[ke];break;case 68:Te[ke-2].push(Te[ke]),this.$=Te[ke-2];break;case 70:this.$=Te[ke].replace(/"/g,"");break;case 71:this.$={cardA:Te[ke],relType:Te[ke-1],cardB:Te[ke-2]};break;case 72:this.$=ve.Cardinality.ZERO_OR_ONE;break;case 73:this.$=ve.Cardinality.ZERO_OR_MORE;break;case 74:this.$=ve.Cardinality.ONE_OR_MORE;break;case 75:this.$=ve.Cardinality.ONLY_ONE;break;case 76:this.$=ve.Cardinality.MD_PARENT;break;case 77:this.$=ve.Identification.NON_IDENTIFYING;break;case 78:this.$=ve.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:30,11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:T,66:b,67:w,68:k,69:A}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(C,[2,54]),t(C,[2,55]),t(C,[2,56]),t(C,[2,57]),t(C,[2,58]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:44,40:_,41:L},{16:47,40:_,41:L},{16:48,40:_,41:L},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:y,52:v},{16:50,40:_,41:L},{18:51,19:[1,52],53:53,54:54,58:O},{11:56,40:d,48:g,50:m,51:y,52:v},{64:57,70:[1,58],71:[1,59]},t(M,[2,72]),t(M,[2,73]),t(M,[2,74]),t(M,[2,75]),t(M,[2,76]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:z,38:60,41:F,42:S,45:62,46:63,48:R,49:N},t(D,[2,37]),t(D,[2,38]),{16:68,40:_,41:L,42:S},{13:z,38:69,41:F,42:S,45:62,46:63,48:R,49:N},{13:[1,70],15:[1,71]},t(e,[2,17],{63:35,12:72,17:[1,73],42:S,65:T,66:b,67:w,68:k,69:A}),{19:[1,74]},t(e,[2,14]),{18:75,19:[2,59],53:53,54:54,58:O},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:T,66:b,67:w,68:k,69:A},t(I,[2,77]),t(I,[2,78]),{6:$,10:B,39:80,42:P,47:G},{40:[1,85],41:[1,86]},t(V,[2,43],{46:87,13:z,41:F,48:R,49:N}),t(Y,[2,45]),t(Y,[2,50]),t(Y,[2,51]),t(Y,[2,52]),t(Y,[2,53]),t(e,[2,41],{42:S}),{6:$,10:B,39:88,42:P,47:G},{14:89,40:W,50:ie,72:K},{16:93,40:_,41:L},{11:94,40:d,48:g,50:m,51:y,52:v},{18:95,19:[1,96],53:53,54:54,58:O},t(e,[2,12]),{19:[2,60]},t(se,[2,61],{56:97,57:98,59:99,61:J,62:Z}),t([19,58,61,62],[2,66]),t(e,[2,22],{15:[1,103],17:[1,102]}),t([40,48,50,51,52],[2,71]),t(e,[2,36]),{13:z,41:F,45:104,46:63,48:R,49:N},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(D,[2,39]),t(D,[2,40]),t(Y,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,79]),t(e,[2,80]),t(e,[2,81]),{13:[1,105],42:S},{13:[1,107],15:[1,106]},{19:[1,108]},t(e,[2,15]),t(se,[2,62],{57:109,60:[1,110],62:Z}),t(se,[2,63]),t(ee,[2,67]),t(se,[2,70]),t(ee,[2,69]),{18:111,19:[1,112],53:53,54:54,58:O},{16:113,40:_,41:L},t(V,[2,44],{46:87,13:z,41:F,48:R,49:N}),{14:114,40:W,50:ie,72:K},{16:115,40:_,41:L},{14:116,40:W,50:ie,72:K},t(e,[2,13]),t(se,[2,64]),{59:117,61:J},{19:[1,118]},t(e,[2,20]),t(e,[2,23],{17:[1,119],42:S}),t(e,[2,11]),{13:[1,120],42:S},t(e,[2,10]),t(ee,[2,68]),t(e,[2,18]),{18:121,19:[1,122],53:53,54:54,58:O},{14:123,40:W,50:ie,72:K},{19:[1,124]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:x(function(Ae,Ne){if(Ne.recoverable)this.trace(Ae);else{var me=new Error(Ae);throw me.hash=Ne,me}},"parseError"),parse:x(function(Ae){var Ne=this,me=[0],ve=[],Ge=[null],Te=[],Ze=this.table,ke="",Ve=0,Qe=0,nt=2,tt=1,je=Te.slice.call(arguments,1),Ce=Object.create(this.lexer),Se={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(Se.yy[H]=this.yy[H]);Ce.setInput(Ae,Se.yy),Se.yy.lexer=Ce,Se.yy.parser=this,typeof Ce.yylloc>"u"&&(Ce.yylloc={});var he=Ce.yylloc;Te.push(he);var j=Ce.options&&Ce.options.ranges;typeof Se.yy.parseError=="function"?this.parseError=Se.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(lt){me.length=me.length-2*lt,Ge.length=Ge.length-lt,Te.length=Te.length-lt}x(pe,"popStack");function re(){var lt;return lt=ve.pop()||Ce.lex()||tt,typeof lt!="number"&&(lt instanceof Array&&(ve=lt,lt=ve.pop()),lt=Ne.symbols_[lt]||lt),lt}x(re,"lex");for(var Be,xe,Ue,De,qe={},Le,Xe,Ie,it;;){if(xe=me[me.length-1],this.defaultActions[xe]?Ue=this.defaultActions[xe]:((Be===null||typeof Be>"u")&&(Be=re()),Ue=Ze[xe]&&Ze[xe][Be]),typeof Ue>"u"||!Ue.length||!Ue[0]){var we="";it=[];for(Le in Ze[xe])this.terminals_[Le]&&Le>nt&&it.push("'"+this.terminals_[Le]+"'");Ce.showPosition?we="Parse error on line "+(Ve+1)+`: + ${mx()} +`,"getStyles"),gUe=pUe,mUe={parser:dUe,get db(){return new lUe},renderer:hUe,styles:gUe,init:T(t=>{t.flowchart||(t.flowchart={}),t.layout&&B6({layout:t.layout}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,B6({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}})},"init")};const EI=Object.freeze(Object.defineProperty({__proto__:null,diagram:mUe},Symbol.toStringTag,{value:"Module"}));var SI=(function(){var t=T(function(_e,Ae,Ne,me){for(Ne=Ne||{},me=_e.length;me--;Ne[_e[me]]=Ae);return Ne},"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],n=[1,11],i=[1,12],a=[1,13],s=[1,23],o=[1,24],l=[1,25],u=[1,26],h=[1,27],d=[1,19],f=[1,28],p=[1,29],g=[1,20],m=[1,18],y=[1,21],v=[1,22],x=[1,36],b=[1,37],w=[1,38],k=[1,39],S=[1,40],C=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],_=[1,45],L=[1,46],O=[1,55],M=[40,48,50,51,52,70,71],z=[1,66],F=[1,64],A=[1,61],R=[1,65],N=[1,67],D=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],I=[65,66,67,68,69],$=[1,84],B=[1,83],P=[1,81],G=[1,82],V=[6,10,42,47],X=[6,10,13,41,42,47,48,49],W=[1,92],ie=[1,91],K=[1,90],se=[19,58],J=[1,101],Z=[1,100],ee=[19,58,60,62],ne={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",65:"ZERO_OR_ONE",66:"ZERO_OR_MORE",67:"ONE_OR_MORE",68:"ONLY_ONE",69:"MD_PARENT",70:"NON_IDENTIFYING",71:"IDENTIFYING",72:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:T(function(Ae,Ne,me,ve,Ge,Te,Ze){var ke=Te.length-1;switch(Ge){case 1:break;case 2:this.$=[];break;case 3:Te[ke-1].push(Te[ke]),this.$=Te[ke-1];break;case 4:case 5:this.$=Te[ke];break;case 6:case 7:this.$=[];break;case 8:ve.addEntity(Te[ke-4]),ve.addEntity(Te[ke-2]),ve.addRelationship(Te[ke-4],Te[ke],Te[ke-2],Te[ke-3]);break;case 9:ve.addEntity(Te[ke-8]),ve.addEntity(Te[ke-4]),ve.addRelationship(Te[ke-8],Te[ke],Te[ke-4],Te[ke-5]),ve.setClass([Te[ke-8]],Te[ke-6]),ve.setClass([Te[ke-4]],Te[ke-2]);break;case 10:ve.addEntity(Te[ke-6]),ve.addEntity(Te[ke-2]),ve.addRelationship(Te[ke-6],Te[ke],Te[ke-2],Te[ke-3]),ve.setClass([Te[ke-6]],Te[ke-4]);break;case 11:ve.addEntity(Te[ke-6]),ve.addEntity(Te[ke-4]),ve.addRelationship(Te[ke-6],Te[ke],Te[ke-4],Te[ke-5]),ve.setClass([Te[ke-4]],Te[ke-2]);break;case 12:ve.addEntity(Te[ke-3]),ve.addAttributes(Te[ke-3],Te[ke-1]);break;case 13:ve.addEntity(Te[ke-5]),ve.addAttributes(Te[ke-5],Te[ke-1]),ve.setClass([Te[ke-5]],Te[ke-3]);break;case 14:ve.addEntity(Te[ke-2]);break;case 15:ve.addEntity(Te[ke-4]),ve.setClass([Te[ke-4]],Te[ke-2]);break;case 16:ve.addEntity(Te[ke]);break;case 17:ve.addEntity(Te[ke-2]),ve.setClass([Te[ke-2]],Te[ke]);break;case 18:ve.addEntity(Te[ke-6],Te[ke-4]),ve.addAttributes(Te[ke-6],Te[ke-1]);break;case 19:ve.addEntity(Te[ke-8],Te[ke-6]),ve.addAttributes(Te[ke-8],Te[ke-1]),ve.setClass([Te[ke-8]],Te[ke-3]);break;case 20:ve.addEntity(Te[ke-5],Te[ke-3]);break;case 21:ve.addEntity(Te[ke-7],Te[ke-5]),ve.setClass([Te[ke-7]],Te[ke-2]);break;case 22:ve.addEntity(Te[ke-3],Te[ke-1]);break;case 23:ve.addEntity(Te[ke-5],Te[ke-3]),ve.setClass([Te[ke-5]],Te[ke]);break;case 24:case 25:this.$=Te[ke].trim(),ve.setAccTitle(this.$);break;case 26:case 27:this.$=Te[ke].trim(),ve.setAccDescription(this.$);break;case 32:ve.setDirection("TB");break;case 33:ve.setDirection("BT");break;case 34:ve.setDirection("RL");break;case 35:ve.setDirection("LR");break;case 36:this.$=Te[ke-3],ve.addClass(Te[ke-2],Te[ke-1]);break;case 37:case 38:case 59:case 67:this.$=[Te[ke]];break;case 39:case 40:this.$=Te[ke-2].concat([Te[ke]]);break;case 41:this.$=Te[ke-2],ve.setClass(Te[ke-1],Te[ke]);break;case 42:this.$=Te[ke-3],ve.addCssStyles(Te[ke-2],Te[ke-1]);break;case 43:this.$=[Te[ke]];break;case 44:Te[ke-2].push(Te[ke]),this.$=Te[ke-2];break;case 46:this.$=Te[ke-1]+Te[ke];break;case 54:case 79:case 80:this.$=Te[ke].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 81:this.$=Te[ke];break;case 60:Te[ke].push(Te[ke-1]),this.$=Te[ke];break;case 61:this.$={type:Te[ke-1],name:Te[ke]};break;case 62:this.$={type:Te[ke-2],name:Te[ke-1],keys:Te[ke]};break;case 63:this.$={type:Te[ke-2],name:Te[ke-1],comment:Te[ke]};break;case 64:this.$={type:Te[ke-3],name:Te[ke-2],keys:Te[ke-1],comment:Te[ke]};break;case 65:case 66:case 69:this.$=Te[ke];break;case 68:Te[ke-2].push(Te[ke]),this.$=Te[ke-2];break;case 70:this.$=Te[ke].replace(/"/g,"");break;case 71:this.$={cardA:Te[ke],relType:Te[ke-1],cardB:Te[ke-2]};break;case 72:this.$=ve.Cardinality.ZERO_OR_ONE;break;case 73:this.$=ve.Cardinality.ZERO_OR_MORE;break;case 74:this.$=ve.Cardinality.ONE_OR_MORE;break;case 75:this.$=ve.Cardinality.ONLY_ONE;break;case 76:this.$=ve.Cardinality.MD_PARENT;break;case 77:this.$=ve.Identification.NON_IDENTIFYING;break;case 78:this.$=ve.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:30,11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:x,66:b,67:w,68:k,69:S}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(C,[2,54]),t(C,[2,55]),t(C,[2,56]),t(C,[2,57]),t(C,[2,58]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:44,40:_,41:L},{16:47,40:_,41:L},{16:48,40:_,41:L},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:y,52:v},{16:50,40:_,41:L},{18:51,19:[1,52],53:53,54:54,58:O},{11:56,40:d,48:g,50:m,51:y,52:v},{64:57,70:[1,58],71:[1,59]},t(M,[2,72]),t(M,[2,73]),t(M,[2,74]),t(M,[2,75]),t(M,[2,76]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:z,38:60,41:F,42:A,45:62,46:63,48:R,49:N},t(D,[2,37]),t(D,[2,38]),{16:68,40:_,41:L,42:A},{13:z,38:69,41:F,42:A,45:62,46:63,48:R,49:N},{13:[1,70],15:[1,71]},t(e,[2,17],{63:35,12:72,17:[1,73],42:A,65:x,66:b,67:w,68:k,69:S}),{19:[1,74]},t(e,[2,14]),{18:75,19:[2,59],53:53,54:54,58:O},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:x,66:b,67:w,68:k,69:S},t(I,[2,77]),t(I,[2,78]),{6:$,10:B,39:80,42:P,47:G},{40:[1,85],41:[1,86]},t(V,[2,43],{46:87,13:z,41:F,48:R,49:N}),t(X,[2,45]),t(X,[2,50]),t(X,[2,51]),t(X,[2,52]),t(X,[2,53]),t(e,[2,41],{42:A}),{6:$,10:B,39:88,42:P,47:G},{14:89,40:W,50:ie,72:K},{16:93,40:_,41:L},{11:94,40:d,48:g,50:m,51:y,52:v},{18:95,19:[1,96],53:53,54:54,58:O},t(e,[2,12]),{19:[2,60]},t(se,[2,61],{56:97,57:98,59:99,61:J,62:Z}),t([19,58,61,62],[2,66]),t(e,[2,22],{15:[1,103],17:[1,102]}),t([40,48,50,51,52],[2,71]),t(e,[2,36]),{13:z,41:F,45:104,46:63,48:R,49:N},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(D,[2,39]),t(D,[2,40]),t(X,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,79]),t(e,[2,80]),t(e,[2,81]),{13:[1,105],42:A},{13:[1,107],15:[1,106]},{19:[1,108]},t(e,[2,15]),t(se,[2,62],{57:109,60:[1,110],62:Z}),t(se,[2,63]),t(ee,[2,67]),t(se,[2,70]),t(ee,[2,69]),{18:111,19:[1,112],53:53,54:54,58:O},{16:113,40:_,41:L},t(V,[2,44],{46:87,13:z,41:F,48:R,49:N}),{14:114,40:W,50:ie,72:K},{16:115,40:_,41:L},{14:116,40:W,50:ie,72:K},t(e,[2,13]),t(se,[2,64]),{59:117,61:J},{19:[1,118]},t(e,[2,20]),t(e,[2,23],{17:[1,119],42:A}),t(e,[2,11]),{13:[1,120],42:A},t(e,[2,10]),t(ee,[2,68]),t(e,[2,18]),{18:121,19:[1,122],53:53,54:54,58:O},{14:123,40:W,50:ie,72:K},{19:[1,124]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:T(function(Ae,Ne){if(Ne.recoverable)this.trace(Ae);else{var me=new Error(Ae);throw me.hash=Ne,me}},"parseError"),parse:T(function(Ae){var Ne=this,me=[0],ve=[],Ge=[null],Te=[],Ze=this.table,ke="",Ve=0,Qe=0,nt=2,tt=1,je=Te.slice.call(arguments,1),Ce=Object.create(this.lexer),Se={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(Se.yy[H]=this.yy[H]);Ce.setInput(Ae,Se.yy),Se.yy.lexer=Ce,Se.yy.parser=this,typeof Ce.yylloc>"u"&&(Ce.yylloc={});var he=Ce.yylloc;Te.push(he);var j=Ce.options&&Ce.options.ranges;typeof Se.yy.parseError=="function"?this.parseError=Se.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(lt){me.length=me.length-2*lt,Ge.length=Ge.length-lt,Te.length=Te.length-lt}T(pe,"popStack");function re(){var lt;return lt=ve.pop()||Ce.lex()||tt,typeof lt!="number"&&(lt instanceof Array&&(ve=lt,lt=ve.pop()),lt=Ne.symbols_[lt]||lt),lt}T(re,"lex");for(var Fe,xe,Ue,Me,qe={},Le,Xe,De,it;;){if(xe=me[me.length-1],this.defaultActions[xe]?Ue=this.defaultActions[xe]:((Fe===null||typeof Fe>"u")&&(Fe=re()),Ue=Ze[xe]&&Ze[xe][Fe]),typeof Ue>"u"||!Ue.length||!Ue[0]){var we="";it=[];for(Le in Ze[xe])this.terminals_[Le]&&Le>nt&&it.push("'"+this.terminals_[Le]+"'");Ce.showPosition?we="Parse error on line "+(Ve+1)+`: `+Ce.showPosition()+` -Expecting `+it.join(", ")+", got '"+(this.terminals_[Be]||Be)+"'":we="Parse error on line "+(Ve+1)+": Unexpected "+(Be==tt?"end of input":"'"+(this.terminals_[Be]||Be)+"'"),this.parseError(we,{text:Ce.match,token:this.terminals_[Be]||Be,line:Ce.yylineno,loc:he,expected:it})}if(Ue[0]instanceof Array&&Ue.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xe+", token: "+Be);switch(Ue[0]){case 1:me.push(Be),Ge.push(Ce.yytext),Te.push(Ce.yylloc),me.push(Ue[1]),Be=null,Qe=Ce.yyleng,ke=Ce.yytext,Ve=Ce.yylineno,he=Ce.yylloc;break;case 2:if(Xe=this.productions_[Ue[1]][1],qe.$=Ge[Ge.length-Xe],qe._$={first_line:Te[Te.length-(Xe||1)].first_line,last_line:Te[Te.length-1].last_line,first_column:Te[Te.length-(Xe||1)].first_column,last_column:Te[Te.length-1].last_column},j&&(qe._$.range=[Te[Te.length-(Xe||1)].range[0],Te[Te.length-1].range[1]]),De=this.performAction.apply(qe,[ke,Qe,Ve,Se.yy,Ue[1],Ge,Te].concat(je)),typeof De<"u")return De;Xe&&(me=me.slice(0,-1*Xe*2),Ge=Ge.slice(0,-1*Xe),Te=Te.slice(0,-1*Xe)),me.push(this.productions_[Ue[1]][0]),Ge.push(qe.$),Te.push(qe._$),Ie=Ze[me[me.length-2]][me[me.length-1]],me.push(Ie);break;case 3:return!0}}return!0},"parse")},ue=(function(){var _e={EOF:1,parseError:x(function(Ne,me){if(this.yy.parser)this.yy.parser.parseError(Ne,me);else throw new Error(Ne)},"parseError"),setInput:x(function(Ae,Ne){return this.yy=Ne||this.yy||{},this._input=Ae,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Ae=this._input[0];this.yytext+=Ae,this.yyleng++,this.offset++,this.match+=Ae,this.matched+=Ae;var Ne=Ae.match(/(?:\r\n?|\n).*/g);return Ne?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ae},"input"),unput:x(function(Ae){var Ne=Ae.length,me=Ae.split(/(?:\r\n?|\n)/g);this._input=Ae+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ne),this.offset-=Ne;var ve=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),me.length-1&&(this.yylineno-=me.length-1);var Ge=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:me?(me.length===ve.length?this.yylloc.first_column:0)+ve[ve.length-me.length].length-me[0].length:this.yylloc.first_column-Ne},this.options.ranges&&(this.yylloc.range=[Ge[0],Ge[0]+this.yyleng-Ne]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Ae){this.unput(this.match.slice(Ae))},"less"),pastInput:x(function(){var Ae=this.matched.substr(0,this.matched.length-this.match.length);return(Ae.length>20?"...":"")+Ae.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Ae=this.match;return Ae.length<20&&(Ae+=this._input.substr(0,20-Ae.length)),(Ae.substr(0,20)+(Ae.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Ae=this.pastInput(),Ne=new Array(Ae.length+1).join("-");return Ae+this.upcomingInput()+` -`+Ne+"^"},"showPosition"),test_match:x(function(Ae,Ne){var me,ve,Ge;if(this.options.backtrack_lexer&&(Ge={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ge.yylloc.range=this.yylloc.range.slice(0))),ve=Ae[0].match(/(?:\r\n?|\n).*/g),ve&&(this.yylineno+=ve.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ve?ve[ve.length-1].length-ve[ve.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ae[0].length},this.yytext+=Ae[0],this.match+=Ae[0],this.matches=Ae,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Ae[0].length),this.matched+=Ae[0],me=this.performAction.call(this,this.yy,this,Ne,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),me)return me;if(this._backtrack){for(var Te in Ge)this[Te]=Ge[Te];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ae,Ne,me,ve;this._more||(this.yytext="",this.match="");for(var Ge=this._currentRules(),Te=0;TeNe[0].length)){if(Ne=me,ve=Te,this.options.backtrack_lexer){if(Ae=this.test_match(me,Ge[Te]),Ae!==!1)return Ae;if(this._backtrack){Ne=!1;continue}else return!1}else if(!this.options.flex)break}return Ne?(Ae=this.test_match(Ne,Ge[ve]),Ae!==!1?Ae:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Ne=this.next();return Ne||this.lex()},"lex"),begin:x(function(Ne){this.conditionStack.push(Ne)},"begin"),popState:x(function(){var Ne=this.conditionStack.length-1;return Ne>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Ne){return Ne=this.conditionStack.length-1-Math.abs(Ne||0),Ne>=0?this.conditionStack[Ne]:"INITIAL"},"topState"),pushState:x(function(Ne){this.begin(Ne)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Ne,me,ve,Ge){switch(ve){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 72;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 61;case 25:return 58;case 26:return 58;case 27:return 62;case 28:break;case 29:return this.popState(),19;case 30:return me.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;case 40:return 43;case 41:return 65;case 42:return 67;case 43:return 67;case 44:return 67;case 45:return 65;case 46:return 65;case 47:return 66;case 48:return 66;case 49:return 66;case 50:return 66;case 51:return 66;case 52:return 67;case 53:return 66;case 54:return 67;case 55:return 68;case 56:return 68;case 57:return 51;case 58:return 68;case 59:return 68;case 60:return 68;case 61:return 52;case 62:return 48;case 63:return 68;case 64:return 65;case 65:return 66;case 66:return 67;case 67:return 69;case 68:return 70;case 69:return 71;case 70:return 71;case 71:return 70;case 72:return 70;case 73:return 70;case 74:return 41;case 75:return 47;case 76:return 40;case 77:return me.yytext[0];case 78:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,74,75],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,76,77,78],inclusive:!0}}};return _e})();ne.lexer=ue;function fe(){this.yy={}}return x(fe,"Parser"),fe.prototype=ne,ne.Parser=fe,new fe})();TI.parser=TI;var iUe=TI,aUe=(Dm=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Dn,this.getAccTitle=Fn,this.setAccDescription=zn,this.getAccDescription=Gn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getConfig=x(()=>Pe().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(e,r=""){var n;return this.entities.has(e)?!((n=this.entities.get(e))!=null&&n.alias)&&r&&(this.entities.get(e).alias=r,ae.info(`Add alias '${r}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:r,shape:"erBox",look:Pe().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),ae.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,r){const n=this.addEntity(e);let i;for(i=r.length-1;i>=0;i--)r[i].keys||(r[i].keys=[]),r[i].comment||(r[i].comment=""),n.attributes.push(r[i]),ae.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){const a=this.entities.get(e),s=this.entities.get(n);if(!a||!s)return;const o={entityA:a.id,roleA:r,entityB:s.id,relSpec:i};this.relationships.push(o),ae.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}addCssStyles(e,r){for(const n of e){const i=this.entities.get(n);if(!r||!i)return;for(const a of r)i.cssStyles.push(a)}}addClass(e,r){e.forEach(n=>{let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)})})}setClass(e,r){for(const n of e){const i=this.entities.get(n);if(i)for(const a of r)i.cssClasses+=" "+a}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],In()}getData(){const e=[],r=[],n=Pe();let i=0;for(const s of this.entities.keys()){const o=this.entities.get(s);o&&(o.cssCompiledStyles=this.getCompiledStyles(o.cssClasses.split(" ")),o.colorIndex=i++,e.push(o))}let a=0;for(const s of this.relationships){const o={id:V0(s.entityA,s.entityB,{prefix:"id",counter:a++}),type:"normal",curve:"basis",start:s.entityA,end:s.entityB,label:s.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:s.relSpec.cardB.toLowerCase(),arrowTypeEnd:s.relSpec.cardA.toLowerCase(),pattern:s.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(o)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},x(Dm,"ErDB"),Dm),Mte={};bw(Mte,{draw:()=>sUe});var sUe=x(async function(t,e,r,n){ae.info("REF0:"),ae.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=Pe(),o=n.db.getData(),l=Xp(e,i);o.type=n.type,o.layoutAlgorithm=sb(s),o.config.flowchart.nodeSpacing=(a==null?void 0:a.nodeSpacing)||140,o.config.flowchart.rankSpacing=(a==null?void 0:a.rankSpacing)||80,o.direction=n.db.getDirection();const{config:u}=o,{look:h}=u;h==="neo"?o.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await Z0(o,l),o.layoutAlgorithm==="elk"&&l.select(".edges").lower();const d=l.selectAll('[id*="-background"]');Array.from(d).length>0&&d.each(function(){const p=pt(this),m=p.attr("id").replace("-background",""),y=l.select(`#${CSS.escape(m)}`);if(!y.empty()){const v=y.attr("transform");p.attr("transform",v)}});const f=8;Lr.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Wd(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Nte=x((t,e)=>{const r=g6,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ao(n,i,a,e)},"fade"),x3=new Set(["redux-color","redux-dark-color"]),oUe=x(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!x3.has(e))return"";const a=(n==null?void 0:n.length)>0;let s="";for(let o=0;o1)throw new Error("Parse Error: multiple actions possible at state: "+xe+", token: "+Fe);switch(Ue[0]){case 1:me.push(Fe),Ge.push(Ce.yytext),Te.push(Ce.yylloc),me.push(Ue[1]),Fe=null,Qe=Ce.yyleng,ke=Ce.yytext,Ve=Ce.yylineno,he=Ce.yylloc;break;case 2:if(Xe=this.productions_[Ue[1]][1],qe.$=Ge[Ge.length-Xe],qe._$={first_line:Te[Te.length-(Xe||1)].first_line,last_line:Te[Te.length-1].last_line,first_column:Te[Te.length-(Xe||1)].first_column,last_column:Te[Te.length-1].last_column},j&&(qe._$.range=[Te[Te.length-(Xe||1)].range[0],Te[Te.length-1].range[1]]),Me=this.performAction.apply(qe,[ke,Qe,Ve,Se.yy,Ue[1],Ge,Te].concat(je)),typeof Me<"u")return Me;Xe&&(me=me.slice(0,-1*Xe*2),Ge=Ge.slice(0,-1*Xe),Te=Te.slice(0,-1*Xe)),me.push(this.productions_[Ue[1]][0]),Ge.push(qe.$),Te.push(qe._$),De=Ze[me[me.length-2]][me[me.length-1]],me.push(De);break;case 3:return!0}}return!0},"parse")},ue=(function(){var _e={EOF:1,parseError:T(function(Ne,me){if(this.yy.parser)this.yy.parser.parseError(Ne,me);else throw new Error(Ne)},"parseError"),setInput:T(function(Ae,Ne){return this.yy=Ne||this.yy||{},this._input=Ae,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var Ae=this._input[0];this.yytext+=Ae,this.yyleng++,this.offset++,this.match+=Ae,this.matched+=Ae;var Ne=Ae.match(/(?:\r\n?|\n).*/g);return Ne?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ae},"input"),unput:T(function(Ae){var Ne=Ae.length,me=Ae.split(/(?:\r\n?|\n)/g);this._input=Ae+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ne),this.offset-=Ne;var ve=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),me.length-1&&(this.yylineno-=me.length-1);var Ge=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:me?(me.length===ve.length?this.yylloc.first_column:0)+ve[ve.length-me.length].length-me[0].length:this.yylloc.first_column-Ne},this.options.ranges&&(this.yylloc.range=[Ge[0],Ge[0]+this.yyleng-Ne]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(Ae){this.unput(this.match.slice(Ae))},"less"),pastInput:T(function(){var Ae=this.matched.substr(0,this.matched.length-this.match.length);return(Ae.length>20?"...":"")+Ae.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var Ae=this.match;return Ae.length<20&&(Ae+=this._input.substr(0,20-Ae.length)),(Ae.substr(0,20)+(Ae.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var Ae=this.pastInput(),Ne=new Array(Ae.length+1).join("-");return Ae+this.upcomingInput()+` +`+Ne+"^"},"showPosition"),test_match:T(function(Ae,Ne){var me,ve,Ge;if(this.options.backtrack_lexer&&(Ge={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ge.yylloc.range=this.yylloc.range.slice(0))),ve=Ae[0].match(/(?:\r\n?|\n).*/g),ve&&(this.yylineno+=ve.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ve?ve[ve.length-1].length-ve[ve.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ae[0].length},this.yytext+=Ae[0],this.match+=Ae[0],this.matches=Ae,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Ae[0].length),this.matched+=Ae[0],me=this.performAction.call(this,this.yy,this,Ne,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),me)return me;if(this._backtrack){for(var Te in Ge)this[Te]=Ge[Te];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ae,Ne,me,ve;this._more||(this.yytext="",this.match="");for(var Ge=this._currentRules(),Te=0;TeNe[0].length)){if(Ne=me,ve=Te,this.options.backtrack_lexer){if(Ae=this.test_match(me,Ge[Te]),Ae!==!1)return Ae;if(this._backtrack){Ne=!1;continue}else return!1}else if(!this.options.flex)break}return Ne?(Ae=this.test_match(Ne,Ge[ve]),Ae!==!1?Ae:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var Ne=this.next();return Ne||this.lex()},"lex"),begin:T(function(Ne){this.conditionStack.push(Ne)},"begin"),popState:T(function(){var Ne=this.conditionStack.length-1;return Ne>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(Ne){return Ne=this.conditionStack.length-1-Math.abs(Ne||0),Ne>=0?this.conditionStack[Ne]:"INITIAL"},"topState"),pushState:T(function(Ne){this.begin(Ne)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(Ne,me,ve,Ge){switch(ve){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 72;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 61;case 25:return 58;case 26:return 58;case 27:return 62;case 28:break;case 29:return this.popState(),19;case 30:return me.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;case 40:return 43;case 41:return 65;case 42:return 67;case 43:return 67;case 44:return 67;case 45:return 65;case 46:return 65;case 47:return 66;case 48:return 66;case 49:return 66;case 50:return 66;case 51:return 66;case 52:return 67;case 53:return 66;case 54:return 67;case 55:return 68;case 56:return 68;case 57:return 51;case 58:return 68;case 59:return 68;case 60:return 68;case 61:return 52;case 62:return 48;case 63:return 68;case 64:return 65;case 65:return 66;case 66:return 67;case 67:return 69;case 68:return 70;case 69:return 71;case 70:return 71;case 71:return 70;case 72:return 70;case 73:return 70;case 74:return 41;case 75:return 47;case 76:return 40;case 77:return me.yytext[0];case 78:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,74,75],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,76,77,78],inclusive:!0}}};return _e})();ne.lexer=ue;function fe(){this.yy={}}return T(fe,"Parser"),fe.prototype=ne,ne.Parser=fe,new fe})();SI.parser=SI;var yUe=SI,vUe=(Mm=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Dn,this.getAccTitle=Fn,this.setAccDescription=zn,this.getAccDescription=Gn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getConfig=T(()=>Pe().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(e,r=""){var n;return this.entities.has(e)?!((n=this.entities.get(e))!=null&&n.alias)&&r&&(this.entities.get(e).alias=r,ae.info(`Add alias '${r}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:r,shape:"erBox",look:Pe().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),ae.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,r){const n=this.addEntity(e);let i;for(i=r.length-1;i>=0;i--)r[i].keys||(r[i].keys=[]),r[i].comment||(r[i].comment=""),n.attributes.push(r[i]),ae.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){const a=this.entities.get(e),s=this.entities.get(n);if(!a||!s)return;const o={entityA:a.id,roleA:r,entityB:s.id,relSpec:i};this.relationships.push(o),ae.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}addCssStyles(e,r){for(const n of e){const i=this.entities.get(n);if(!r||!i)return;for(const a of r)i.cssStyles.push(a)}}addClass(e,r){e.forEach(n=>{let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)})})}setClass(e,r){for(const n of e){const i=this.entities.get(n);if(i)for(const a of r)i.cssClasses+=" "+a}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],In()}getData(){const e=[],r=[],n=Pe();let i=0;for(const s of this.entities.keys()){const o=this.entities.get(s);o&&(o.cssCompiledStyles=this.getCompiledStyles(o.cssClasses.split(" ")),o.colorIndex=i++,e.push(o))}let a=0;for(const s of this.relationships){const o={id:Vp(s.entityA,s.entityB,{prefix:"id",counter:a++}),type:"normal",curve:"basis",start:s.entityA,end:s.entityB,label:s.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:s.relSpec.cardB.toLowerCase(),arrowTypeEnd:s.relSpec.cardA.toLowerCase(),pattern:s.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(o)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},T(Mm,"ErDB"),Mm),Fte={};Tw(Fte,{draw:()=>bUe});var bUe=T(async function(t,e,r,n){ae.info("REF0:"),ae.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=Pe(),o=n.db.getData(),l=K0(e,i);o.type=n.type,o.layoutAlgorithm=ob(s),o.config.flowchart.nodeSpacing=(a==null?void 0:a.nodeSpacing)||140,o.config.flowchart.rankSpacing=(a==null?void 0:a.rankSpacing)||80,o.direction=n.db.getDirection();const{config:u}=o,{look:h}=u;h==="neo"?o.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await Zp(o,l),o.layoutAlgorithm==="elk"&&l.select(".edges").lower();const d=l.selectAll('[id*="-background"]');Array.from(d).length>0&&d.each(function(){const p=pt(this),m=p.attr("id").replace("-background",""),y=l.select(`#${CSS.escape(m)}`);if(!y.empty()){const v=y.attr("transform");p.attr("transform",v)}});const f=8;Lr.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Wd(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),zte=T((t,e)=>{const r=v6,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ao(n,i,a,e)},"fade"),C3=new Set(["redux-color","redux-dark-color"]),xUe=T(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!C3.has(e))return"";const a=(n==null?void 0:n.length)>0;let s="";for(let o=0;o{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return` - ${oUe(t)} + `;return s},"genColor"),TUe=T(t=>{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return` + ${xUe(t)} .entityBox { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; @@ -1111,14 +1111,14 @@ Expecting `+it.join(", ")+", got '"+(this.terminals_[Be]||Be)+"'":we="Parse erro } .labelBkg { - background-color: ${x3.has(r)&&n?n:Nte(t.tertiaryColor,.5)}; + background-color: ${C3.has(r)&&n?n:zte(t.tertiaryColor,.5)}; } .edgeLabel { - background-color: ${x3.has(r)&&n?n:t.edgeLabelBackground}; + background-color: ${C3.has(r)&&n?n:t.edgeLabelBackground}; } .edgeLabel .label rect { - fill: ${x3.has(r)&&n?n:t.edgeLabelBackground}; + fill: ${C3.has(r)&&n?n:t.edgeLabelBackground}; } .edgeLabel .label text { fill: ${t.textColor}; @@ -1160,107 +1160,107 @@ Expecting `+it.join(", ")+", got '"+(this.terminals_[Be]||Be)+"'":we="Parse erro stroke-width: 1; } [data-look=neo].labelBkg { - background-color: ${Nte(t.tertiaryColor,.5)}; + background-color: ${zte(t.tertiaryColor,.5)}; } -`},"getStyles"),cUe=lUe,uUe={parser:iUe,get db(){return new aUe},renderer:Mte,styles:cUe};const hUe=Object.freeze(Object.defineProperty({__proto__:null,diagram:uUe},Symbol.toStringTag,{value:"Module"}));function zl(t,e){var r,n,i;t.accDescr&&((r=e.setAccDescription)==null||r.call(e,t.accDescr)),t.accTitle&&((n=e.setAccTitle)==null||n.call(e,t.accTitle)),t.title&&((i=e.setDiagramTitle)==null||i.call(e,t.title))}x(zl,"populateCommonDb");var wI=(Mm=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},x(Mm,"ImperativeState"),Mm),dUe=Object.create,gx=Object.defineProperty,fUe=Object.getOwnPropertyDescriptor,CI=Object.getOwnPropertyNames,pUe=Object.getPrototypeOf,gUe=Object.prototype.hasOwnProperty,E=(t,e)=>gx(t,"name",{value:e,configurable:!0}),mUe=(t,e)=>function(){return t&&(e=(0,t[CI(t)[0]])(t=0)),e},Dr=(t,e)=>function(){return e||(0,t[CI(t)[0]])((e={exports:{}}).exports,e),e.exports},fh=(t,e)=>{for(var r in e)gx(t,r,{get:e[r],enumerable:!0})},kI=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of CI(e))!gUe.call(t,i)&&i!==r&&gx(t,i,{get:()=>e[i],enumerable:!(n=fUe(e,i))||n.enumerable});return t},T3=(t,e,r)=>(kI(t,e,"default"),r),EI=(t,e,r)=>(r=t!=null?dUe(pUe(t)):{},kI(gx(r,"default",{value:t,enumerable:!0}),t)),SI=t=>kI(gx({},"__esModule",{value:!0}),t),w3={};fh(w3,{AnnotatedTextEdit:()=>Vc,ChangeAnnotation:()=>Hd,ChangeAnnotationIdentifier:()=>ga,CodeAction:()=>o9,CodeActionContext:()=>s9,CodeActionKind:()=>a9,CodeActionTriggerKind:()=>Cx,CodeDescription:()=>$I,CodeLens:()=>l9,Color:()=>k3,ColorInformation:()=>LI,ColorPresentation:()=>II,Command:()=>Ud,CompletionItem:()=>YI,CompletionItemKind:()=>GI,CompletionItemLabelDetails:()=>HI,CompletionItemTag:()=>VI,CompletionList:()=>XI,CreateFile:()=>Kp,DeleteFile:()=>Zp,Diagnostic:()=>vx,DiagnosticRelatedInformation:()=>E3,DiagnosticSeverity:()=>NI,DiagnosticTag:()=>OI,DocumentHighlight:()=>JI,DocumentHighlightKind:()=>QI,DocumentLink:()=>u9,DocumentSymbol:()=>i9,DocumentUri:()=>AI,EOL:()=>$te,FoldingRange:()=>MI,FoldingRangeKind:()=>DI,FormattingOptions:()=>c9,Hover:()=>KI,InlayHint:()=>b9,InlayHintKind:()=>_3,InlayHintLabelPart:()=>R3,InlineCompletionContext:()=>E9,InlineCompletionItem:()=>T9,InlineCompletionList:()=>w9,InlineCompletionTriggerKind:()=>C9,InlineValueContext:()=>v9,InlineValueEvaluatableExpression:()=>y9,InlineValueText:()=>g9,InlineValueVariableLookup:()=>m9,InsertReplaceEdit:()=>WI,InsertTextFormat:()=>qI,InsertTextMode:()=>UI,Location:()=>yx,LocationLink:()=>RI,MarkedString:()=>wx,MarkupContent:()=>Qp,MarkupKind:()=>A3,OptionalVersionedTextDocumentIdentifier:()=>Tx,ParameterInformation:()=>jI,Position:()=>sn,Range:()=>Ur,RenameFile:()=>jp,SelectedCompletionInfo:()=>k9,SelectionRange:()=>h9,SemanticTokenModifiers:()=>f9,SemanticTokenTypes:()=>d9,SemanticTokens:()=>p9,SignatureInformation:()=>ZI,StringValue:()=>x9,SymbolInformation:()=>r9,SymbolKind:()=>e9,SymbolTag:()=>t9,TextDocument:()=>A9,TextDocumentEdit:()=>bx,TextDocumentIdentifier:()=>BI,TextDocumentItem:()=>zI,TextEdit:()=>Gl,URI:()=>C3,VersionedTextDocumentIdentifier:()=>FI,WorkspaceChange:()=>Ote,WorkspaceEdit:()=>S3,WorkspaceFolder:()=>S9,WorkspaceSymbol:()=>n9,integer:()=>_I,uinteger:()=>mx});var AI,C3,_I,mx,sn,Ur,yx,RI,k3,LI,II,DI,MI,E3,NI,OI,$I,vx,Ud,Gl,Hd,ga,Vc,bx,Kp,jp,Zp,S3,xx,PI,Ote,BI,FI,Tx,zI,A3,Qp,GI,qI,VI,WI,UI,HI,YI,XI,wx,KI,jI,ZI,QI,JI,e9,t9,r9,n9,i9,a9,Cx,s9,o9,l9,c9,u9,h9,d9,f9,p9,g9,m9,y9,v9,_3,R3,b9,x9,T9,w9,C9,k9,E9,S9,$te,A9,Pte,rt,kx=mUe({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(i){function a(s){return typeof s=="string"}E(a,"is"),i.is=a})(AI||(AI={})),(function(i){function a(s){return typeof s=="string"}E(a,"is"),i.is=a})(C3||(C3={})),(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}E(a,"is"),i.is=a})(_I||(_I={})),(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}E(a,"is"),i.is=a})(mx||(mx={})),(function(i){function a(o,l){return o===Number.MAX_VALUE&&(o=mx.MAX_VALUE),l===Number.MAX_VALUE&&(l=mx.MAX_VALUE),{line:o,character:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&rt.uinteger(l.line)&&rt.uinteger(l.character)}E(s,"is"),i.is=s})(sn||(sn={})),(function(i){function a(o,l,u,h){if(rt.uinteger(o)&&rt.uinteger(l)&&rt.uinteger(u)&&rt.uinteger(h))return{start:sn.create(o,l),end:sn.create(u,h)};if(sn.is(o)&&sn.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&sn.is(l.start)&&sn.is(l.end)}E(s,"is"),i.is=s})(Ur||(Ur={})),(function(i){function a(o,l){return{uri:o,range:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&Ur.is(l.range)&&(rt.string(l.uri)||rt.undefined(l.uri))}E(s,"is"),i.is=s})(yx||(yx={})),(function(i){function a(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&Ur.is(l.targetRange)&&rt.string(l.targetUri)&&Ur.is(l.targetSelectionRange)&&(Ur.is(l.originSelectionRange)||rt.undefined(l.originSelectionRange))}E(s,"is"),i.is=s})(RI||(RI={})),(function(i){function a(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.numberRange(l.red,0,1)&&rt.numberRange(l.green,0,1)&&rt.numberRange(l.blue,0,1)&&rt.numberRange(l.alpha,0,1)}E(s,"is"),i.is=s})(k3||(k3={})),(function(i){function a(o,l){return{range:o,color:l}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&Ur.is(l.range)&&k3.is(l.color)}E(s,"is"),i.is=s})(LI||(LI={})),(function(i){function a(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.string(l.label)&&(rt.undefined(l.textEdit)||Gl.is(l))&&(rt.undefined(l.additionalTextEdits)||rt.typedArray(l.additionalTextEdits,Gl.is))}E(s,"is"),i.is=s})(II||(II={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(DI||(DI={})),(function(i){function a(o,l,u,h,d,f){const p={startLine:o,endLine:l};return rt.defined(u)&&(p.startCharacter=u),rt.defined(h)&&(p.endCharacter=h),rt.defined(d)&&(p.kind=d),rt.defined(f)&&(p.collapsedText=f),p}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.uinteger(l.startLine)&&rt.uinteger(l.startLine)&&(rt.undefined(l.startCharacter)||rt.uinteger(l.startCharacter))&&(rt.undefined(l.endCharacter)||rt.uinteger(l.endCharacter))&&(rt.undefined(l.kind)||rt.string(l.kind))}E(s,"is"),i.is=s})(MI||(MI={})),(function(i){function a(o,l){return{location:o,message:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&yx.is(l.location)&&rt.string(l.message)}E(s,"is"),i.is=s})(E3||(E3={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(NI||(NI={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(OI||(OI={})),(function(i){function a(s){const o=s;return rt.objectLiteral(o)&&rt.string(o.href)}E(a,"is"),i.is=a})($I||($I={})),(function(i){function a(o,l,u,h,d,f){let p={range:o,message:l};return rt.defined(u)&&(p.severity=u),rt.defined(h)&&(p.code=h),rt.defined(d)&&(p.source=d),rt.defined(f)&&(p.relatedInformation=f),p}E(a,"create"),i.create=a;function s(o){var l;let u=o;return rt.defined(u)&&Ur.is(u.range)&&rt.string(u.message)&&(rt.number(u.severity)||rt.undefined(u.severity))&&(rt.integer(u.code)||rt.string(u.code)||rt.undefined(u.code))&&(rt.undefined(u.codeDescription)||rt.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(rt.string(u.source)||rt.undefined(u.source))&&(rt.undefined(u.relatedInformation)||rt.typedArray(u.relatedInformation,E3.is))}E(s,"is"),i.is=s})(vx||(vx={})),(function(i){function a(o,l,...u){let h={title:o,command:l};return rt.defined(u)&&u.length>0&&(h.arguments=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.title)&&rt.string(l.command)}E(s,"is"),i.is=s})(Ud||(Ud={})),(function(i){function a(u,h){return{range:u,newText:h}}E(a,"replace"),i.replace=a;function s(u,h){return{range:{start:u,end:u},newText:h}}E(s,"insert"),i.insert=s;function o(u){return{range:u,newText:""}}E(o,"del"),i.del=o;function l(u){const h=u;return rt.objectLiteral(h)&&rt.string(h.newText)&&Ur.is(h.range)}E(l,"is"),i.is=l})(Gl||(Gl={})),(function(i){function a(o,l,u){const h={label:o};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.string(l.label)&&(rt.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(rt.string(l.description)||l.description===void 0)}E(s,"is"),i.is=s})(Hd||(Hd={})),(function(i){function a(s){const o=s;return rt.string(o)}E(a,"is"),i.is=a})(ga||(ga={})),(function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}E(a,"replace"),i.replace=a;function s(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}E(s,"insert"),i.insert=s;function o(u,h){return{range:u,newText:"",annotationId:h}}E(o,"del"),i.del=o;function l(u){const h=u;return Gl.is(h)&&(Hd.is(h.annotationId)||ga.is(h.annotationId))}E(l,"is"),i.is=l})(Vc||(Vc={})),(function(i){function a(o,l){return{textDocument:o,edits:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&Tx.is(l.textDocument)&&Array.isArray(l.edits)}E(s,"is"),i.is=s})(bx||(bx={})),(function(i){function a(o,l,u){let h={kind:"create",uri:o};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="create"&&rt.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||rt.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||rt.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||ga.is(l.annotationId))}E(s,"is"),i.is=s})(Kp||(Kp={})),(function(i){function a(o,l,u,h){let d={kind:"rename",oldUri:o,newUri:l};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(d.options=u),h!==void 0&&(d.annotationId=h),d}E(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="rename"&&rt.string(l.oldUri)&&rt.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||rt.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||rt.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||ga.is(l.annotationId))}E(s,"is"),i.is=s})(jp||(jp={})),(function(i){function a(o,l,u){let h={kind:"delete",uri:o};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="delete"&&rt.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||rt.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||rt.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||ga.is(l.annotationId))}E(s,"is"),i.is=s})(Zp||(Zp={})),(function(i){function a(s){let o=s;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(l=>rt.string(l.kind)?Kp.is(l)||jp.is(l)||Zp.is(l):bx.is(l)))}E(a,"is"),i.is=a})(S3||(S3={})),xx=(t=class{constructor(a,s){this.edits=a,this.changeAnnotations=s}insert(a,s,o){let l,u;if(o===void 0?l=Gl.insert(a,s):ga.is(o)?(u=o,l=Vc.insert(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Vc.insert(a,s,u)),this.edits.push(l),u!==void 0)return u}replace(a,s,o){let l,u;if(o===void 0?l=Gl.replace(a,s):ga.is(o)?(u=o,l=Vc.replace(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Vc.replace(a,s,u)),this.edits.push(l),u!==void 0)return u}delete(a,s){let o,l;if(s===void 0?o=Gl.del(a):ga.is(s)?(l=s,o=Vc.del(a,s)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(s),o=Vc.del(a,l)),this.edits.push(o),l!==void 0)return l}add(a){this.edits.push(a)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(a){if(a===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},E(t,"TextEditChangeImpl"),t),PI=(e=class{constructor(a){this._annotations=a===void 0?Object.create(null):a,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(a,s){let o;if(ga.is(a)?o=a:(o=this.nextId(),s=a),this._annotations[o]!==void 0)throw new Error(`Id ${o} is already in use.`);if(s===void 0)throw new Error(`No annotation provided for id ${o}`);return this._annotations[o]=s,this._size++,o}nextId(){return this._counter++,this._counter.toString()}},E(e,"ChangeAnnotations"),e),Ote=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new PI(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(s=>{if(bx.is(s)){const o=new xx(s.edits,this._changeAnnotations);this._textEditChanges[s.textDocument.uri]=o}})):a.changes&&Object.keys(a.changes).forEach(s=>{const o=new xx(a.changes[s]);this._textEditChanges[s]=o})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(a){if(Tx.is(a)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const s={uri:a.uri,version:a.version};let o=this._textEditChanges[s.uri];if(!o){const l=[],u={textDocument:s,edits:l};this._workspaceEdit.documentChanges.push(u),o=new xx(l,this._changeAnnotations),this._textEditChanges[s.uri]=o}return o}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let s=this._textEditChanges[a];if(!s){let o=[];this._workspaceEdit.changes[a]=o,s=new xx(o),this._textEditChanges[a]=s}return s}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new PI,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;Hd.is(s)||ga.is(s)?l=s:o=s;let u,h;if(l===void 0?u=Kp.create(a,o):(h=ga.is(l)?l:this._changeAnnotations.manage(l),u=Kp.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(a,s,o,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;Hd.is(o)||ga.is(o)?u=o:l=o;let h,d;if(u===void 0?h=jp.create(a,s,l):(d=ga.is(u)?u:this._changeAnnotations.manage(u),h=jp.create(a,s,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;Hd.is(s)||ga.is(s)?l=s:o=s;let u,h;if(l===void 0?u=Zp.create(a,o):(h=ga.is(l)?l:this._changeAnnotations.manage(l),u=Zp.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},E(r,"WorkspaceChange"),r),(function(i){function a(o){return{uri:o}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)}E(s,"is"),i.is=s})(BI||(BI={})),(function(i){function a(o,l){return{uri:o,version:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)&&rt.integer(l.version)}E(s,"is"),i.is=s})(FI||(FI={})),(function(i){function a(o,l){return{uri:o,version:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)&&(l.version===null||rt.integer(l.version))}E(s,"is"),i.is=s})(Tx||(Tx={})),(function(i){function a(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)&&rt.string(l.languageId)&&rt.integer(l.version)&&rt.string(l.text)}E(s,"is"),i.is=s})(zI||(zI={})),(function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(s){const o=s;return o===i.PlainText||o===i.Markdown}E(a,"is"),i.is=a})(A3||(A3={})),(function(i){function a(s){const o=s;return rt.objectLiteral(s)&&A3.is(o.kind)&&rt.string(o.value)}E(a,"is"),i.is=a})(Qp||(Qp={})),(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(GI||(GI={})),(function(i){i.PlainText=1,i.Snippet=2})(qI||(qI={})),(function(i){i.Deprecated=1})(VI||(VI={})),(function(i){function a(o,l,u){return{newText:o,insert:l,replace:u}}E(a,"create"),i.create=a;function s(o){const l=o;return l&&rt.string(l.newText)&&Ur.is(l.insert)&&Ur.is(l.replace)}E(s,"is"),i.is=s})(WI||(WI={})),(function(i){i.asIs=1,i.adjustIndentation=2})(UI||(UI={})),(function(i){function a(s){const o=s;return o&&(rt.string(o.detail)||o.detail===void 0)&&(rt.string(o.description)||o.description===void 0)}E(a,"is"),i.is=a})(HI||(HI={})),(function(i){function a(s){return{label:s}}E(a,"create"),i.create=a})(YI||(YI={})),(function(i){function a(s,o){return{items:s||[],isIncomplete:!!o}}E(a,"create"),i.create=a})(XI||(XI={})),(function(i){function a(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}E(a,"fromPlainText"),i.fromPlainText=a;function s(o){const l=o;return rt.string(l)||rt.objectLiteral(l)&&rt.string(l.language)&&rt.string(l.value)}E(s,"is"),i.is=s})(wx||(wx={})),(function(i){function a(s){let o=s;return!!o&&rt.objectLiteral(o)&&(Qp.is(o.contents)||wx.is(o.contents)||rt.typedArray(o.contents,wx.is))&&(s.range===void 0||Ur.is(s.range))}E(a,"is"),i.is=a})(KI||(KI={})),(function(i){function a(s,o){return o?{label:s,documentation:o}:{label:s}}E(a,"create"),i.create=a})(jI||(jI={})),(function(i){function a(s,o,...l){let u={label:s};return rt.defined(o)&&(u.documentation=o),rt.defined(l)?u.parameters=l:u.parameters=[],u}E(a,"create"),i.create=a})(ZI||(ZI={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(QI||(QI={})),(function(i){function a(s,o){let l={range:s};return rt.number(o)&&(l.kind=o),l}E(a,"create"),i.create=a})(JI||(JI={})),(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(e9||(e9={})),(function(i){i.Deprecated=1})(t9||(t9={})),(function(i){function a(s,o,l,u,h){let d={name:s,kind:o,location:{uri:u,range:l}};return h&&(d.containerName=h),d}E(a,"create"),i.create=a})(r9||(r9={})),(function(i){function a(s,o,l,u){return u!==void 0?{name:s,kind:o,location:{uri:l,range:u}}:{name:s,kind:o,location:{uri:l}}}E(a,"create"),i.create=a})(n9||(n9={})),(function(i){function a(o,l,u,h,d,f){let p={name:o,detail:l,kind:u,range:h,selectionRange:d};return f!==void 0&&(p.children=f),p}E(a,"create"),i.create=a;function s(o){let l=o;return l&&rt.string(l.name)&&rt.number(l.kind)&&Ur.is(l.range)&&Ur.is(l.selectionRange)&&(l.detail===void 0||rt.string(l.detail))&&(l.deprecated===void 0||rt.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}E(s,"is"),i.is=s})(i9||(i9={})),(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(a9||(a9={})),(function(i){i.Invoked=1,i.Automatic=2})(Cx||(Cx={})),(function(i){function a(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.typedArray(l.diagnostics,vx.is)&&(l.only===void 0||rt.typedArray(l.only,rt.string))&&(l.triggerKind===void 0||l.triggerKind===Cx.Invoked||l.triggerKind===Cx.Automatic)}E(s,"is"),i.is=s})(s9||(s9={})),(function(i){function a(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):Ud.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return l&&rt.string(l.title)&&(l.diagnostics===void 0||rt.typedArray(l.diagnostics,vx.is))&&(l.kind===void 0||rt.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||Ud.is(l.command))&&(l.isPreferred===void 0||rt.boolean(l.isPreferred))&&(l.edit===void 0||S3.is(l.edit))}E(s,"is"),i.is=s})(o9||(o9={})),(function(i){function a(o,l){let u={range:o};return rt.defined(l)&&(u.data=l),u}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&Ur.is(l.range)&&(rt.undefined(l.command)||Ud.is(l.command))}E(s,"is"),i.is=s})(l9||(l9={})),(function(i){function a(o,l){return{tabSize:o,insertSpaces:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.uinteger(l.tabSize)&&rt.boolean(l.insertSpaces)}E(s,"is"),i.is=s})(c9||(c9={})),(function(i){function a(o,l,u){return{range:o,target:l,data:u}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&Ur.is(l.range)&&(rt.undefined(l.target)||rt.string(l.target))}E(s,"is"),i.is=s})(u9||(u9={})),(function(i){function a(o,l){return{range:o,parent:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&Ur.is(l.range)&&(l.parent===void 0||i.is(l.parent))}E(s,"is"),i.is=s})(h9||(h9={})),(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(d9||(d9={})),(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(f9||(f9={})),(function(i){function a(s){const o=s;return rt.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}E(a,"is"),i.is=a})(p9||(p9={})),(function(i){function a(o,l){return{range:o,text:l}}E(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Ur.is(l.range)&&rt.string(l.text)}E(s,"is"),i.is=s})(g9||(g9={})),(function(i){function a(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}E(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Ur.is(l.range)&&rt.boolean(l.caseSensitiveLookup)&&(rt.string(l.variableName)||l.variableName===void 0)}E(s,"is"),i.is=s})(m9||(m9={})),(function(i){function a(o,l){return{range:o,expression:l}}E(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Ur.is(l.range)&&(rt.string(l.expression)||l.expression===void 0)}E(s,"is"),i.is=s})(y9||(y9={})),(function(i){function a(o,l){return{frameId:o,stoppedLocation:l}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.defined(l)&&Ur.is(o.stoppedLocation)}E(s,"is"),i.is=s})(v9||(v9={})),(function(i){i.Type=1,i.Parameter=2;function a(s){return s===1||s===2}E(a,"is"),i.is=a})(_3||(_3={})),(function(i){function a(o){return{value:o}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&(l.tooltip===void 0||rt.string(l.tooltip)||Qp.is(l.tooltip))&&(l.location===void 0||yx.is(l.location))&&(l.command===void 0||Ud.is(l.command))}E(s,"is"),i.is=s})(R3||(R3={})),(function(i){function a(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&sn.is(l.position)&&(rt.string(l.label)||rt.typedArray(l.label,R3.is))&&(l.kind===void 0||_3.is(l.kind))&&l.textEdits===void 0||rt.typedArray(l.textEdits,Gl.is)&&(l.tooltip===void 0||rt.string(l.tooltip)||Qp.is(l.tooltip))&&(l.paddingLeft===void 0||rt.boolean(l.paddingLeft))&&(l.paddingRight===void 0||rt.boolean(l.paddingRight))}E(s,"is"),i.is=s})(b9||(b9={})),(function(i){function a(s){return{kind:"snippet",value:s}}E(a,"createSnippet"),i.createSnippet=a})(x9||(x9={})),(function(i){function a(s,o,l,u){return{insertText:s,filterText:o,range:l,command:u}}E(a,"create"),i.create=a})(T9||(T9={})),(function(i){function a(s){return{items:s}}E(a,"create"),i.create=a})(w9||(w9={})),(function(i){i.Invoked=0,i.Automatic=1})(C9||(C9={})),(function(i){function a(s,o){return{range:s,text:o}}E(a,"create"),i.create=a})(k9||(k9={})),(function(i){function a(s,o){return{triggerKind:s,selectedCompletionInfo:o}}E(a,"create"),i.create=a})(E9||(E9={})),(function(i){function a(s){const o=s;return rt.objectLiteral(o)&&C3.is(o.uri)&&rt.string(o.name)}E(a,"is"),i.is=a})(S9||(S9={})),$te=[` +`},"getStyles"),wUe=TUe,CUe={parser:yUe,get db(){return new vUe},renderer:Fte,styles:wUe};const kUe=Object.freeze(Object.defineProperty({__proto__:null,diagram:CUe},Symbol.toStringTag,{value:"Module"}));function zl(t,e){var r,n,i;t.accDescr&&((r=e.setAccDescription)==null||r.call(e,t.accDescr)),t.accTitle&&((n=e.setAccTitle)==null||n.call(e,t.accTitle)),t.title&&((i=e.setDiagramTitle)==null||i.call(e,t.title))}T(zl,"populateCommonDb");var AI=(Nm=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},T(Nm,"ImperativeState"),Nm),EUe=Object.create,yx=Object.defineProperty,SUe=Object.getOwnPropertyDescriptor,_I=Object.getOwnPropertyNames,AUe=Object.getPrototypeOf,_Ue=Object.prototype.hasOwnProperty,E=(t,e)=>yx(t,"name",{value:e,configurable:!0}),RUe=(t,e)=>function(){return t&&(e=(0,t[_I(t)[0]])(t=0)),e},Dr=(t,e)=>function(){return e||(0,t[_I(t)[0]])((e={exports:{}}).exports,e),e.exports},fh=(t,e)=>{for(var r in e)yx(t,r,{get:e[r],enumerable:!0})},RI=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _I(e))!_Ue.call(t,i)&&i!==r&&yx(t,i,{get:()=>e[i],enumerable:!(n=SUe(e,i))||n.enumerable});return t},k3=(t,e,r)=>(RI(t,e,"default"),r),LI=(t,e,r)=>(r=t!=null?EUe(AUe(t)):{},RI(yx(r,"default",{value:t,enumerable:!0}),t)),II=t=>RI(yx({},"__esModule",{value:!0}),t),E3={};fh(E3,{AnnotatedTextEdit:()=>Vc,ChangeAnnotation:()=>Hd,ChangeAnnotationIdentifier:()=>ga,CodeAction:()=>d9,CodeActionContext:()=>h9,CodeActionKind:()=>u9,CodeActionTriggerKind:()=>Ex,CodeDescription:()=>GI,CodeLens:()=>f9,Color:()=>A3,ColorInformation:()=>OI,ColorPresentation:()=>$I,Command:()=>Ud,CompletionItem:()=>QI,CompletionItemKind:()=>HI,CompletionItemLabelDetails:()=>ZI,CompletionItemTag:()=>XI,CompletionList:()=>JI,CreateFile:()=>j0,DeleteFile:()=>Q0,Diagnostic:()=>xx,DiagnosticRelatedInformation:()=>_3,DiagnosticSeverity:()=>FI,DiagnosticTag:()=>zI,DocumentHighlight:()=>i9,DocumentHighlightKind:()=>n9,DocumentLink:()=>g9,DocumentSymbol:()=>c9,DocumentUri:()=>DI,EOL:()=>qte,FoldingRange:()=>BI,FoldingRangeKind:()=>PI,FormattingOptions:()=>p9,Hover:()=>e9,InlayHint:()=>k9,InlayHintKind:()=>I3,InlayHintLabelPart:()=>D3,InlineCompletionContext:()=>L9,InlineCompletionItem:()=>S9,InlineCompletionList:()=>A9,InlineCompletionTriggerKind:()=>_9,InlineValueContext:()=>C9,InlineValueEvaluatableExpression:()=>w9,InlineValueText:()=>x9,InlineValueVariableLookup:()=>T9,InsertReplaceEdit:()=>KI,InsertTextFormat:()=>YI,InsertTextMode:()=>jI,Location:()=>bx,LocationLink:()=>NI,MarkedString:()=>kx,MarkupContent:()=>J0,MarkupKind:()=>L3,OptionalVersionedTextDocumentIdentifier:()=>Cx,ParameterInformation:()=>t9,Position:()=>sn,Range:()=>Ur,RenameFile:()=>Z0,SelectedCompletionInfo:()=>R9,SelectionRange:()=>m9,SemanticTokenModifiers:()=>v9,SemanticTokenTypes:()=>y9,SemanticTokens:()=>b9,SignatureInformation:()=>r9,StringValue:()=>E9,SymbolInformation:()=>o9,SymbolKind:()=>a9,SymbolTag:()=>s9,TextDocument:()=>D9,TextDocumentEdit:()=>Tx,TextDocumentIdentifier:()=>VI,TextDocumentItem:()=>UI,TextEdit:()=>Gl,URI:()=>S3,VersionedTextDocumentIdentifier:()=>WI,WorkspaceChange:()=>Gte,WorkspaceEdit:()=>R3,WorkspaceFolder:()=>I9,WorkspaceSymbol:()=>l9,integer:()=>MI,uinteger:()=>vx});var DI,S3,MI,vx,sn,Ur,bx,NI,A3,OI,$I,PI,BI,_3,FI,zI,GI,xx,Ud,Gl,Hd,ga,Vc,Tx,j0,Z0,Q0,R3,wx,qI,Gte,VI,WI,Cx,UI,L3,J0,HI,YI,XI,KI,jI,ZI,QI,JI,kx,e9,t9,r9,n9,i9,a9,s9,o9,l9,c9,u9,Ex,h9,d9,f9,p9,g9,m9,y9,v9,b9,x9,T9,w9,C9,I3,D3,k9,E9,S9,A9,_9,R9,L9,I9,qte,D9,Vte,rt,Sx=RUe({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(i){function a(s){return typeof s=="string"}E(a,"is"),i.is=a})(DI||(DI={})),(function(i){function a(s){return typeof s=="string"}E(a,"is"),i.is=a})(S3||(S3={})),(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}E(a,"is"),i.is=a})(MI||(MI={})),(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}E(a,"is"),i.is=a})(vx||(vx={})),(function(i){function a(o,l){return o===Number.MAX_VALUE&&(o=vx.MAX_VALUE),l===Number.MAX_VALUE&&(l=vx.MAX_VALUE),{line:o,character:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&rt.uinteger(l.line)&&rt.uinteger(l.character)}E(s,"is"),i.is=s})(sn||(sn={})),(function(i){function a(o,l,u,h){if(rt.uinteger(o)&&rt.uinteger(l)&&rt.uinteger(u)&&rt.uinteger(h))return{start:sn.create(o,l),end:sn.create(u,h)};if(sn.is(o)&&sn.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&sn.is(l.start)&&sn.is(l.end)}E(s,"is"),i.is=s})(Ur||(Ur={})),(function(i){function a(o,l){return{uri:o,range:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&Ur.is(l.range)&&(rt.string(l.uri)||rt.undefined(l.uri))}E(s,"is"),i.is=s})(bx||(bx={})),(function(i){function a(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&Ur.is(l.targetRange)&&rt.string(l.targetUri)&&Ur.is(l.targetSelectionRange)&&(Ur.is(l.originSelectionRange)||rt.undefined(l.originSelectionRange))}E(s,"is"),i.is=s})(NI||(NI={})),(function(i){function a(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.numberRange(l.red,0,1)&&rt.numberRange(l.green,0,1)&&rt.numberRange(l.blue,0,1)&&rt.numberRange(l.alpha,0,1)}E(s,"is"),i.is=s})(A3||(A3={})),(function(i){function a(o,l){return{range:o,color:l}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&Ur.is(l.range)&&A3.is(l.color)}E(s,"is"),i.is=s})(OI||(OI={})),(function(i){function a(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.string(l.label)&&(rt.undefined(l.textEdit)||Gl.is(l))&&(rt.undefined(l.additionalTextEdits)||rt.typedArray(l.additionalTextEdits,Gl.is))}E(s,"is"),i.is=s})($I||($I={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(PI||(PI={})),(function(i){function a(o,l,u,h,d,f){const p={startLine:o,endLine:l};return rt.defined(u)&&(p.startCharacter=u),rt.defined(h)&&(p.endCharacter=h),rt.defined(d)&&(p.kind=d),rt.defined(f)&&(p.collapsedText=f),p}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.uinteger(l.startLine)&&rt.uinteger(l.startLine)&&(rt.undefined(l.startCharacter)||rt.uinteger(l.startCharacter))&&(rt.undefined(l.endCharacter)||rt.uinteger(l.endCharacter))&&(rt.undefined(l.kind)||rt.string(l.kind))}E(s,"is"),i.is=s})(BI||(BI={})),(function(i){function a(o,l){return{location:o,message:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&bx.is(l.location)&&rt.string(l.message)}E(s,"is"),i.is=s})(_3||(_3={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(FI||(FI={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(zI||(zI={})),(function(i){function a(s){const o=s;return rt.objectLiteral(o)&&rt.string(o.href)}E(a,"is"),i.is=a})(GI||(GI={})),(function(i){function a(o,l,u,h,d,f){let p={range:o,message:l};return rt.defined(u)&&(p.severity=u),rt.defined(h)&&(p.code=h),rt.defined(d)&&(p.source=d),rt.defined(f)&&(p.relatedInformation=f),p}E(a,"create"),i.create=a;function s(o){var l;let u=o;return rt.defined(u)&&Ur.is(u.range)&&rt.string(u.message)&&(rt.number(u.severity)||rt.undefined(u.severity))&&(rt.integer(u.code)||rt.string(u.code)||rt.undefined(u.code))&&(rt.undefined(u.codeDescription)||rt.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(rt.string(u.source)||rt.undefined(u.source))&&(rt.undefined(u.relatedInformation)||rt.typedArray(u.relatedInformation,_3.is))}E(s,"is"),i.is=s})(xx||(xx={})),(function(i){function a(o,l,...u){let h={title:o,command:l};return rt.defined(u)&&u.length>0&&(h.arguments=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.title)&&rt.string(l.command)}E(s,"is"),i.is=s})(Ud||(Ud={})),(function(i){function a(u,h){return{range:u,newText:h}}E(a,"replace"),i.replace=a;function s(u,h){return{range:{start:u,end:u},newText:h}}E(s,"insert"),i.insert=s;function o(u){return{range:u,newText:""}}E(o,"del"),i.del=o;function l(u){const h=u;return rt.objectLiteral(h)&&rt.string(h.newText)&&Ur.is(h.range)}E(l,"is"),i.is=l})(Gl||(Gl={})),(function(i){function a(o,l,u){const h={label:o};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.string(l.label)&&(rt.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(rt.string(l.description)||l.description===void 0)}E(s,"is"),i.is=s})(Hd||(Hd={})),(function(i){function a(s){const o=s;return rt.string(o)}E(a,"is"),i.is=a})(ga||(ga={})),(function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}E(a,"replace"),i.replace=a;function s(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}E(s,"insert"),i.insert=s;function o(u,h){return{range:u,newText:"",annotationId:h}}E(o,"del"),i.del=o;function l(u){const h=u;return Gl.is(h)&&(Hd.is(h.annotationId)||ga.is(h.annotationId))}E(l,"is"),i.is=l})(Vc||(Vc={})),(function(i){function a(o,l){return{textDocument:o,edits:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&Cx.is(l.textDocument)&&Array.isArray(l.edits)}E(s,"is"),i.is=s})(Tx||(Tx={})),(function(i){function a(o,l,u){let h={kind:"create",uri:o};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="create"&&rt.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||rt.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||rt.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||ga.is(l.annotationId))}E(s,"is"),i.is=s})(j0||(j0={})),(function(i){function a(o,l,u,h){let d={kind:"rename",oldUri:o,newUri:l};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(d.options=u),h!==void 0&&(d.annotationId=h),d}E(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="rename"&&rt.string(l.oldUri)&&rt.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||rt.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||rt.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||ga.is(l.annotationId))}E(s,"is"),i.is=s})(Z0||(Z0={})),(function(i){function a(o,l,u){let h={kind:"delete",uri:o};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="delete"&&rt.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||rt.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||rt.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||ga.is(l.annotationId))}E(s,"is"),i.is=s})(Q0||(Q0={})),(function(i){function a(s){let o=s;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(l=>rt.string(l.kind)?j0.is(l)||Z0.is(l)||Q0.is(l):Tx.is(l)))}E(a,"is"),i.is=a})(R3||(R3={})),wx=(t=class{constructor(a,s){this.edits=a,this.changeAnnotations=s}insert(a,s,o){let l,u;if(o===void 0?l=Gl.insert(a,s):ga.is(o)?(u=o,l=Vc.insert(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Vc.insert(a,s,u)),this.edits.push(l),u!==void 0)return u}replace(a,s,o){let l,u;if(o===void 0?l=Gl.replace(a,s):ga.is(o)?(u=o,l=Vc.replace(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Vc.replace(a,s,u)),this.edits.push(l),u!==void 0)return u}delete(a,s){let o,l;if(s===void 0?o=Gl.del(a):ga.is(s)?(l=s,o=Vc.del(a,s)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(s),o=Vc.del(a,l)),this.edits.push(o),l!==void 0)return l}add(a){this.edits.push(a)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(a){if(a===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},E(t,"TextEditChangeImpl"),t),qI=(e=class{constructor(a){this._annotations=a===void 0?Object.create(null):a,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(a,s){let o;if(ga.is(a)?o=a:(o=this.nextId(),s=a),this._annotations[o]!==void 0)throw new Error(`Id ${o} is already in use.`);if(s===void 0)throw new Error(`No annotation provided for id ${o}`);return this._annotations[o]=s,this._size++,o}nextId(){return this._counter++,this._counter.toString()}},E(e,"ChangeAnnotations"),e),Gte=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new qI(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(s=>{if(Tx.is(s)){const o=new wx(s.edits,this._changeAnnotations);this._textEditChanges[s.textDocument.uri]=o}})):a.changes&&Object.keys(a.changes).forEach(s=>{const o=new wx(a.changes[s]);this._textEditChanges[s]=o})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(a){if(Cx.is(a)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const s={uri:a.uri,version:a.version};let o=this._textEditChanges[s.uri];if(!o){const l=[],u={textDocument:s,edits:l};this._workspaceEdit.documentChanges.push(u),o=new wx(l,this._changeAnnotations),this._textEditChanges[s.uri]=o}return o}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let s=this._textEditChanges[a];if(!s){let o=[];this._workspaceEdit.changes[a]=o,s=new wx(o),this._textEditChanges[a]=s}return s}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new qI,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;Hd.is(s)||ga.is(s)?l=s:o=s;let u,h;if(l===void 0?u=j0.create(a,o):(h=ga.is(l)?l:this._changeAnnotations.manage(l),u=j0.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(a,s,o,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;Hd.is(o)||ga.is(o)?u=o:l=o;let h,d;if(u===void 0?h=Z0.create(a,s,l):(d=ga.is(u)?u:this._changeAnnotations.manage(u),h=Z0.create(a,s,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;Hd.is(s)||ga.is(s)?l=s:o=s;let u,h;if(l===void 0?u=Q0.create(a,o):(h=ga.is(l)?l:this._changeAnnotations.manage(l),u=Q0.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},E(r,"WorkspaceChange"),r),(function(i){function a(o){return{uri:o}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)}E(s,"is"),i.is=s})(VI||(VI={})),(function(i){function a(o,l){return{uri:o,version:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)&&rt.integer(l.version)}E(s,"is"),i.is=s})(WI||(WI={})),(function(i){function a(o,l){return{uri:o,version:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)&&(l.version===null||rt.integer(l.version))}E(s,"is"),i.is=s})(Cx||(Cx={})),(function(i){function a(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)&&rt.string(l.languageId)&&rt.integer(l.version)&&rt.string(l.text)}E(s,"is"),i.is=s})(UI||(UI={})),(function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(s){const o=s;return o===i.PlainText||o===i.Markdown}E(a,"is"),i.is=a})(L3||(L3={})),(function(i){function a(s){const o=s;return rt.objectLiteral(s)&&L3.is(o.kind)&&rt.string(o.value)}E(a,"is"),i.is=a})(J0||(J0={})),(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(HI||(HI={})),(function(i){i.PlainText=1,i.Snippet=2})(YI||(YI={})),(function(i){i.Deprecated=1})(XI||(XI={})),(function(i){function a(o,l,u){return{newText:o,insert:l,replace:u}}E(a,"create"),i.create=a;function s(o){const l=o;return l&&rt.string(l.newText)&&Ur.is(l.insert)&&Ur.is(l.replace)}E(s,"is"),i.is=s})(KI||(KI={})),(function(i){i.asIs=1,i.adjustIndentation=2})(jI||(jI={})),(function(i){function a(s){const o=s;return o&&(rt.string(o.detail)||o.detail===void 0)&&(rt.string(o.description)||o.description===void 0)}E(a,"is"),i.is=a})(ZI||(ZI={})),(function(i){function a(s){return{label:s}}E(a,"create"),i.create=a})(QI||(QI={})),(function(i){function a(s,o){return{items:s||[],isIncomplete:!!o}}E(a,"create"),i.create=a})(JI||(JI={})),(function(i){function a(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}E(a,"fromPlainText"),i.fromPlainText=a;function s(o){const l=o;return rt.string(l)||rt.objectLiteral(l)&&rt.string(l.language)&&rt.string(l.value)}E(s,"is"),i.is=s})(kx||(kx={})),(function(i){function a(s){let o=s;return!!o&&rt.objectLiteral(o)&&(J0.is(o.contents)||kx.is(o.contents)||rt.typedArray(o.contents,kx.is))&&(s.range===void 0||Ur.is(s.range))}E(a,"is"),i.is=a})(e9||(e9={})),(function(i){function a(s,o){return o?{label:s,documentation:o}:{label:s}}E(a,"create"),i.create=a})(t9||(t9={})),(function(i){function a(s,o,...l){let u={label:s};return rt.defined(o)&&(u.documentation=o),rt.defined(l)?u.parameters=l:u.parameters=[],u}E(a,"create"),i.create=a})(r9||(r9={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(n9||(n9={})),(function(i){function a(s,o){let l={range:s};return rt.number(o)&&(l.kind=o),l}E(a,"create"),i.create=a})(i9||(i9={})),(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(a9||(a9={})),(function(i){i.Deprecated=1})(s9||(s9={})),(function(i){function a(s,o,l,u,h){let d={name:s,kind:o,location:{uri:u,range:l}};return h&&(d.containerName=h),d}E(a,"create"),i.create=a})(o9||(o9={})),(function(i){function a(s,o,l,u){return u!==void 0?{name:s,kind:o,location:{uri:l,range:u}}:{name:s,kind:o,location:{uri:l}}}E(a,"create"),i.create=a})(l9||(l9={})),(function(i){function a(o,l,u,h,d,f){let p={name:o,detail:l,kind:u,range:h,selectionRange:d};return f!==void 0&&(p.children=f),p}E(a,"create"),i.create=a;function s(o){let l=o;return l&&rt.string(l.name)&&rt.number(l.kind)&&Ur.is(l.range)&&Ur.is(l.selectionRange)&&(l.detail===void 0||rt.string(l.detail))&&(l.deprecated===void 0||rt.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}E(s,"is"),i.is=s})(c9||(c9={})),(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(u9||(u9={})),(function(i){i.Invoked=1,i.Automatic=2})(Ex||(Ex={})),(function(i){function a(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.typedArray(l.diagnostics,xx.is)&&(l.only===void 0||rt.typedArray(l.only,rt.string))&&(l.triggerKind===void 0||l.triggerKind===Ex.Invoked||l.triggerKind===Ex.Automatic)}E(s,"is"),i.is=s})(h9||(h9={})),(function(i){function a(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):Ud.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return l&&rt.string(l.title)&&(l.diagnostics===void 0||rt.typedArray(l.diagnostics,xx.is))&&(l.kind===void 0||rt.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||Ud.is(l.command))&&(l.isPreferred===void 0||rt.boolean(l.isPreferred))&&(l.edit===void 0||R3.is(l.edit))}E(s,"is"),i.is=s})(d9||(d9={})),(function(i){function a(o,l){let u={range:o};return rt.defined(l)&&(u.data=l),u}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&Ur.is(l.range)&&(rt.undefined(l.command)||Ud.is(l.command))}E(s,"is"),i.is=s})(f9||(f9={})),(function(i){function a(o,l){return{tabSize:o,insertSpaces:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.uinteger(l.tabSize)&&rt.boolean(l.insertSpaces)}E(s,"is"),i.is=s})(p9||(p9={})),(function(i){function a(o,l,u){return{range:o,target:l,data:u}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&Ur.is(l.range)&&(rt.undefined(l.target)||rt.string(l.target))}E(s,"is"),i.is=s})(g9||(g9={})),(function(i){function a(o,l){return{range:o,parent:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&Ur.is(l.range)&&(l.parent===void 0||i.is(l.parent))}E(s,"is"),i.is=s})(m9||(m9={})),(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(y9||(y9={})),(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(v9||(v9={})),(function(i){function a(s){const o=s;return rt.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}E(a,"is"),i.is=a})(b9||(b9={})),(function(i){function a(o,l){return{range:o,text:l}}E(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Ur.is(l.range)&&rt.string(l.text)}E(s,"is"),i.is=s})(x9||(x9={})),(function(i){function a(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}E(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Ur.is(l.range)&&rt.boolean(l.caseSensitiveLookup)&&(rt.string(l.variableName)||l.variableName===void 0)}E(s,"is"),i.is=s})(T9||(T9={})),(function(i){function a(o,l){return{range:o,expression:l}}E(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Ur.is(l.range)&&(rt.string(l.expression)||l.expression===void 0)}E(s,"is"),i.is=s})(w9||(w9={})),(function(i){function a(o,l){return{frameId:o,stoppedLocation:l}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.defined(l)&&Ur.is(o.stoppedLocation)}E(s,"is"),i.is=s})(C9||(C9={})),(function(i){i.Type=1,i.Parameter=2;function a(s){return s===1||s===2}E(a,"is"),i.is=a})(I3||(I3={})),(function(i){function a(o){return{value:o}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&(l.tooltip===void 0||rt.string(l.tooltip)||J0.is(l.tooltip))&&(l.location===void 0||bx.is(l.location))&&(l.command===void 0||Ud.is(l.command))}E(s,"is"),i.is=s})(D3||(D3={})),(function(i){function a(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&sn.is(l.position)&&(rt.string(l.label)||rt.typedArray(l.label,D3.is))&&(l.kind===void 0||I3.is(l.kind))&&l.textEdits===void 0||rt.typedArray(l.textEdits,Gl.is)&&(l.tooltip===void 0||rt.string(l.tooltip)||J0.is(l.tooltip))&&(l.paddingLeft===void 0||rt.boolean(l.paddingLeft))&&(l.paddingRight===void 0||rt.boolean(l.paddingRight))}E(s,"is"),i.is=s})(k9||(k9={})),(function(i){function a(s){return{kind:"snippet",value:s}}E(a,"createSnippet"),i.createSnippet=a})(E9||(E9={})),(function(i){function a(s,o,l,u){return{insertText:s,filterText:o,range:l,command:u}}E(a,"create"),i.create=a})(S9||(S9={})),(function(i){function a(s){return{items:s}}E(a,"create"),i.create=a})(A9||(A9={})),(function(i){i.Invoked=0,i.Automatic=1})(_9||(_9={})),(function(i){function a(s,o){return{range:s,text:o}}E(a,"create"),i.create=a})(R9||(R9={})),(function(i){function a(s,o){return{triggerKind:s,selectedCompletionInfo:o}}E(a,"create"),i.create=a})(L9||(L9={})),(function(i){function a(s){const o=s;return rt.objectLiteral(o)&&S3.is(o.uri)&&rt.string(o.name)}E(a,"is"),i.is=a})(I9||(I9={})),qte=[` `,`\r -`,"\r"],(function(i){function a(u,h,d,f){return new Pte(u,h,d,f)}E(a,"create"),i.create=a;function s(u){let h=u;return!!(rt.defined(h)&&rt.string(h.uri)&&(rt.undefined(h.languageId)||rt.string(h.languageId))&&rt.uinteger(h.lineCount)&&rt.func(h.getText)&&rt.func(h.positionAt)&&rt.func(h.offsetAt))}E(s,"is"),i.is=s;function o(u,h){let d=u.getText(),f=l(h,(g,m)=>{let y=g.range.start.line-m.range.start.line;return y===0?g.range.start.character-m.range.start.character:y}),p=d.length;for(let g=f.length-1;g>=0;g--){let m=f[g],y=u.offsetAt(m.range.start),v=u.offsetAt(m.range.end);if(v<=p)d=d.substring(0,y)+m.newText+d.substring(v,d.length);else throw new Error("Overlapping edit");p=y}return d}E(o,"applyEdits"),i.applyEdits=o;function l(u,h){if(u.length<=1)return u;const d=u.length/2|0,f=u.slice(0,d),p=u.slice(d);l(f,h),l(p,h);let g=0,m=0,y=0;for(;g{let y=g.range.start.line-m.range.start.line;return y===0?g.range.start.character-m.range.start.character:y}),p=d.length;for(let g=f.length-1;g>=0;g--){let m=f[g],y=u.offsetAt(m.range.start),v=u.offsetAt(m.range.end);if(v<=p)d=d.substring(0,y)+m.newText+d.substring(v,d.length);else throw new Error("Overlapping edit");p=y}return d}E(o,"applyEdits"),i.applyEdits=o;function l(u,h){if(u.length<=1)return u;const d=u.length/2|0,f=u.slice(0,d),p=u.slice(d);l(f,h),l(p,h);let g=0,m=0,y=0;for(;g0&&a.push(s.length),this._lineOffsets=a}return this._lineOffsets}positionAt(a){a=Math.max(Math.min(a,this._content.length),0);let s=this.getLineOffsets(),o=0,l=s.length;if(l===0)return sn.create(0,a);for(;oa?l=h:o=h+1}let u=o-1;return sn.create(u,a-s[u])}offsetAt(a){let s=this.getLineOffsets();if(a.line>=s.length)return this._content.length;if(a.line<0)return 0;let o=s[a.line],l=a.line+1"u"}E(o,"undefined"),i.undefined=o;function l(v){return v===!0||v===!1}E(l,"boolean"),i.boolean=l;function u(v){return a.call(v)==="[object String]"}E(u,"string"),i.string=u;function h(v){return a.call(v)==="[object Number]"}E(h,"number"),i.number=h;function d(v,T,b){return a.call(v)==="[object Number]"&&T<=v&&v<=b}E(d,"numberRange"),i.numberRange=d;function f(v){return a.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}E(f,"integer"),i.integer=f;function p(v){return a.call(v)==="[object Number]"&&0<=v&&v<=2147483647}E(p,"uinteger"),i.uinteger=p;function g(v){return a.call(v)==="[object Function]"}E(g,"func"),i.func=g;function m(v){return v!==null&&typeof v=="object"}E(m,"objectLiteral"),i.objectLiteral=m;function y(v,T){return Array.isArray(v)&&v.every(T)}E(y,"typedArray"),i.typedArray=y})(rt||(rt={}))}}),Yd=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}E(r,"RAL"),(function(n){function i(a){if(a===void 0)throw new Error("No runtime abstraction layer provided");e=a}E(i,"install"),n.install=i})(r||(r={})),t.default=r}}),Ex=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(l){return l===!0||l===!1}E(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}E(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}E(n,"number"),t.number=n;function i(l){return l instanceof Error}E(i,"error"),t.error=i;function a(l){return typeof l=="function"}E(a,"func"),t.func=a;function s(l){return Array.isArray(l)}E(s,"array"),t.array=s;function o(l){return s(l)&&l.every(u=>r(u))}E(o,"stringArray"),t.stringArray=o}}),Jp=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var a,s;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=Yd(),r;(function(o){const l={dispose(){}};o.None=function(){return l}})(r||(t.Event=r={}));var n=(a=class{add(l,u=null,h){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(h)&&h.push({dispose:E(()=>this.remove(l,u),"dispose")})}remove(l,u=null){if(!this._callbacks)return;let h=!1;for(let d=0,f=this._callbacks.length;d{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,u);const d={dispose:E(()=>{this._callbacks&&(this._callbacks.remove(l,u),d.dispose=s._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(h)&&h.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},E(s,"Emitter"),s);t.Emitter=i,i._noop=function(){}}}),L3=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,u;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=Yd(),r=Ex(),n=Jp(),i;(function(h){h.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),h.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function d(f){const p=f;return p&&(p===h.None||p===h.Cancelled||r.boolean(p.isCancellationRequested)&&!!p.onCancellationRequested)}E(d,"is"),h.is=d})(i||(t.CancellationToken=i={}));var a=Object.freeze(function(h,d){const f=(0,e.default)().timer.setTimeout(h.bind(d),0);return{dispose(){f.dispose()}}}),s=(l=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},E(l,"MutableToken"),l),o=(u=class{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}},E(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),Bte=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var F,S,R,N,D,I,$,B,P,G,V,Y,W,ie,K,se,J,Z,ee,ne,ue,fe,_e,Ae,Ne;Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var e=Ex(),r;(function(me){me.ParseError=-32700,me.InvalidRequest=-32600,me.MethodNotFound=-32601,me.InvalidParams=-32602,me.InternalError=-32603,me.jsonrpcReservedErrorRangeStart=-32099,me.serverErrorStart=-32099,me.MessageWriteError=-32099,me.MessageReadError=-32098,me.PendingResponseRejected=-32097,me.ConnectionInactive=-32096,me.ServerNotInitialized=-32002,me.UnknownErrorCode=-32001,me.jsonrpcReservedErrorRangeEnd=-32e3,me.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(F=class extends Error{constructor(ve,Ge,Te){super(Ge),this.code=e.number(ve)?ve:r.UnknownErrorCode,this.data=Te,Object.setPrototypeOf(this,F.prototype)}toJson(){const ve={code:this.code,message:this.message};return this.data!==void 0&&(ve.data=this.data),ve}},E(F,"ResponseError"),F);t.ResponseError=n;var i=(S=class{constructor(ve){this.kind=ve}static is(ve){return ve===S.auto||ve===S.byName||ve===S.byPosition}toString(){return this.kind}},E(S,"ParameterStructures"),S);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var a=(R=class{constructor(ve,Ge){this.method=ve,this.numberOfParams=Ge}get parameterStructures(){return i.auto}},E(R,"AbstractMessageSignature"),R);t.AbstractMessageSignature=a;var s=(N=class extends a{constructor(ve){super(ve,0)}},E(N,"RequestType0"),N);t.RequestType0=s;var o=(D=class extends a{constructor(ve,Ge=i.auto){super(ve,1),this._parameterStructures=Ge}get parameterStructures(){return this._parameterStructures}},E(D,"RequestType"),D);t.RequestType=o;var l=(I=class extends a{constructor(ve,Ge=i.auto){super(ve,1),this._parameterStructures=Ge}get parameterStructures(){return this._parameterStructures}},E(I,"RequestType1"),I);t.RequestType1=l;var u=($=class extends a{constructor(ve){super(ve,2)}},E($,"RequestType2"),$);t.RequestType2=u;var h=(B=class extends a{constructor(ve){super(ve,3)}},E(B,"RequestType3"),B);t.RequestType3=h;var d=(P=class extends a{constructor(ve){super(ve,4)}},E(P,"RequestType4"),P);t.RequestType4=d;var f=(G=class extends a{constructor(ve){super(ve,5)}},E(G,"RequestType5"),G);t.RequestType5=f;var p=(V=class extends a{constructor(ve){super(ve,6)}},E(V,"RequestType6"),V);t.RequestType6=p;var g=(Y=class extends a{constructor(ve){super(ve,7)}},E(Y,"RequestType7"),Y);t.RequestType7=g;var m=(W=class extends a{constructor(ve){super(ve,8)}},E(W,"RequestType8"),W);t.RequestType8=m;var y=(ie=class extends a{constructor(ve){super(ve,9)}},E(ie,"RequestType9"),ie);t.RequestType9=y;var v=(K=class extends a{constructor(ve,Ge=i.auto){super(ve,1),this._parameterStructures=Ge}get parameterStructures(){return this._parameterStructures}},E(K,"NotificationType"),K);t.NotificationType=v;var T=(se=class extends a{constructor(ve){super(ve,0)}},E(se,"NotificationType0"),se);t.NotificationType0=T;var b=(J=class extends a{constructor(ve,Ge=i.auto){super(ve,1),this._parameterStructures=Ge}get parameterStructures(){return this._parameterStructures}},E(J,"NotificationType1"),J);t.NotificationType1=b;var w=(Z=class extends a{constructor(ve){super(ve,2)}},E(Z,"NotificationType2"),Z);t.NotificationType2=w;var k=(ee=class extends a{constructor(ve){super(ve,3)}},E(ee,"NotificationType3"),ee);t.NotificationType3=k;var A=(ne=class extends a{constructor(ve){super(ve,4)}},E(ne,"NotificationType4"),ne);t.NotificationType4=A;var C=(ue=class extends a{constructor(ve){super(ve,5)}},E(ue,"NotificationType5"),ue);t.NotificationType5=C;var _=(fe=class extends a{constructor(ve){super(ve,6)}},E(fe,"NotificationType6"),fe);t.NotificationType6=_;var L=(_e=class extends a{constructor(ve){super(ve,7)}},E(_e,"NotificationType7"),_e);t.NotificationType7=L;var O=(Ae=class extends a{constructor(ve){super(ve,8)}},E(Ae,"NotificationType8"),Ae);t.NotificationType8=O;var M=(Ne=class extends a{constructor(ve){super(ve,9)}},E(Ne,"NotificationType9"),Ne);t.NotificationType9=M;var z;(function(me){function ve(Ze){const ke=Ze;return ke&&e.string(ke.method)&&(e.string(ke.id)||e.number(ke.id))}E(ve,"isRequest"),me.isRequest=ve;function Ge(Ze){const ke=Ze;return ke&&e.string(ke.method)&&Ze.id===void 0}E(Ge,"isNotification"),me.isNotification=Ge;function Te(Ze){const ke=Ze;return ke&&(ke.result!==void 0||!!ke.error)&&(e.string(ke.id)||e.number(ke.id)||ke.id===null)}E(Te,"isResponse"),me.isResponse=Te})(z||(t.Message=z={}))}}),Fte=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var a,s;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(o){o.None=0,o.First=1,o.AsOld=o.First,o.Last=2,o.AsNew=o.Last})(r||(t.Touch=r={}));var n=(a=class{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var l;return(l=this._head)==null?void 0:l.value}get last(){var l;return(l=this._tail)==null?void 0:l.value}has(l){return this._map.has(l)}get(l,u=r.None){const h=this._map.get(l);if(h)return u!==r.None&&this.touch(h,u),h.value}set(l,u,h=r.None){let d=this._map.get(l);if(d)d.value=u,h!==r.None&&this.touch(d,h);else{switch(d={key:l,value:u,next:void 0,previous:void 0},h){case r.None:this.addItemLast(d);break;case r.First:this.addItemFirst(d);break;case r.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(l,d),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const u=this._map.get(l);if(u)return this._map.delete(l),this.removeItem(u),this._size--,u.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,u){const h=this._state;let d=this._head;for(;d;){if(u?l.bind(u)(d.value,d.key,this):l(d.value,d.key,this),this._state!==h)throw new Error("LinkedMap got modified during iteration.");d=d.next}}keys(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:E(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.key,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}values(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:E(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.value,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}entries(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:E(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:[u.key,u.value],done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let u=this._head,h=this.size;for(;u&&h>l;)this._map.delete(u.key),u=u.next,h--;this._head=u,this._size=h,u&&(u.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const u=l.next,h=l.previous;if(!u||!h)throw new Error("Invalid list");u.previous=h,h.next=u}l.next=void 0,l.previous=void 0,this._state++}touch(l,u){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(u!==r.First&&u!==r.Last)){if(u===r.First){if(l===this._head)return;const h=l.next,d=l.previous;l===this._tail?(d.next=void 0,this._tail=d):(h.previous=d,d.next=h),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(u===r.Last){if(l===this._tail)return;const h=l.next,d=l.previous;l===this._head?(h.previous=void 0,this._head=h):(h.previous=d,d.next=h),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((u,h)=>{l.push([h,u])}),l}fromJSON(l){this.clear();for(const[u,h]of l)this.set(u,h)}},E(a,"LinkedMap"),a);t.LinkedMap=n;var i=(s=class extends n{constructor(l,u=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,u),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,u=r.AsNew){return super.get(l,u)}peek(l){return super.get(l,r.None)}set(l,u){return super.set(l,u,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},E(s,"LRUCache"),s);t.LRUCache=i}}),yUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function n(i){return{dispose:i}}E(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),vUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var o,l,u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=L3(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(o=class{constructor(){this.buffers=new Map}enableCancellation(f){if(f.id===null)return;const p=new SharedArrayBuffer(4),g=new Int32Array(p,0,1);g[0]=r.Continue,this.buffers.set(f.id,p),f.$cancellationData=p}async sendCancellation(f,p){const g=this.buffers.get(p);if(g===void 0)return;const m=new Int32Array(g,0,1);Atomics.store(m,0,r.Cancelled)}cleanup(f){this.buffers.delete(f)}dispose(){this.buffers.clear()}},E(o,"SharedArraySenderStrategy"),o);t.SharedArraySenderStrategy=n;var i=(l=class{constructor(f){this.data=new Int32Array(f,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},E(l,"SharedArrayBufferCancellationToken"),l),a=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},E(u,"SharedArrayBufferCancellationTokenSource"),u),s=(h=class{constructor(){this.kind="request"}createCancellationTokenSource(f){const p=f.$cancellationData;return p===void 0?new e.CancellationTokenSource:new a(p)}},E(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=s}}),zte=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var e=Yd(),r=(n=class{constructor(a=1){if(a<=0)throw new Error("Capacity must be greater than 0");this._capacity=a,this._active=0,this._waiting=[]}lock(a){return new Promise((s,o)=>{this._waiting.push({thunk:a,resolve:s,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const a=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const s=a.thunk();s instanceof Promise?s.then(o=>{this._active--,a.resolve(o),this.runNext()},o=>{this._active--,a.reject(o),this.runNext()}):(this._active--,a.resolve(s),this.runNext())}catch(s){this._active--,a.reject(s),this.runNext()}}},E(n,"Semaphore"),n);t.Semaphore=r}}),bUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var e=Yd(),r=Ex(),n=Jp(),i=zte(),a;(function(d){function f(p){let g=p;return g&&r.func(g.listen)&&r.func(g.dispose)&&r.func(g.onError)&&r.func(g.onClose)&&r.func(g.onPartialMessage)}E(f,"is"),d.is=f})(a||(t.MessageReader=a={}));var s=(u=class{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f){this.errorEmitter.fire(this.asError(f))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(f){this.partialMessageEmitter.fire(f)}asError(f){return f instanceof Error?f:new Error(`Reader received error. Reason: ${r.string(f.message)?f.message:"unknown"}`)}},E(u,"AbstractMessageReader"),u);t.AbstractMessageReader=s;var o;(function(d){function f(p){let g,m;const y=new Map;let v;const T=new Map;if(p===void 0||typeof p=="string")g=p??"utf-8";else{if(g=p.charset??"utf-8",p.contentDecoder!==void 0&&(m=p.contentDecoder,y.set(m.name,m)),p.contentDecoders!==void 0)for(const b of p.contentDecoders)y.set(b.name,b);if(p.contentTypeDecoder!==void 0&&(v=p.contentTypeDecoder,T.set(v.name,v)),p.contentTypeDecoders!==void 0)for(const b of p.contentTypeDecoders)T.set(b.name,b)}return v===void 0&&(v=(0,e.default)().applicationJson.decoder,T.set(v.name,v)),{charset:g,contentDecoder:m,contentDecoders:y,contentTypeDecoder:v,contentTypeDecoders:T}}E(f,"fromOptions"),d.fromOptions=f})(o||(o={}));var l=(h=class extends s{constructor(f,p){super(),this.readable=f,this.options=o.fromOptions(p),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(f){this._partialMessageTimeout=f}get partialMessageTimeout(){return this._partialMessageTimeout}listen(f){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=f;const p=this.readable.onData(g=>{this.onData(g)});return this.readable.onError(g=>this.fireError(g)),this.readable.onClose(()=>this.fireClose()),p}onData(f){try{for(this.buffer.append(f);;){if(this.nextMessageLength===-1){const g=this.buffer.tryReadHeaders(!0);if(!g)return;const m=g.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property. -${JSON.stringify(Object.fromEntries(g))}`));return}const y=parseInt(m);if(isNaN(y)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=y}const p=this.buffer.tryReadBody(this.nextMessageLength);if(p===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const g=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(p):p,m=await this.options.contentTypeDecoder.decode(g,this.options);this.callback(m)}).catch(g=>{this.fireError(g)})}}catch(p){this.fireError(p)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((f,p)=>{this.partialMessageTimer=void 0,f===this.messageToken&&(this.firePartialMessage({messageToken:f,waitingTime:p}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},E(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),xUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=Yd(),r=Ex(),n=zte(),i=Jp(),a="Content-Length: ",s=`\r -`,o;(function(p){function g(m){let y=m;return y&&r.func(y.dispose)&&r.func(y.onClose)&&r.func(y.onError)&&r.func(y.write)}E(g,"is"),p.is=g})(o||(t.MessageWriter=o={}));var l=(d=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(g,m,y){this.errorEmitter.fire([this.asError(g),m,y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(g){return g instanceof Error?g:new Error(`Writer received error. Reason: ${r.string(g.message)?g.message:"unknown"}`)}},E(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var u;(function(p){function g(m){return m===void 0||typeof m=="string"?{charset:m??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}E(g,"fromOptions"),p.fromOptions=g})(u||(u={}));var h=(f=class extends l{constructor(g,m){super(),this.writable=g,this.options=u.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(y=>this.fireError(y)),this.writable.onClose(()=>this.fireClose())}async write(g){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(g,this.options).then(y=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(y):y).then(y=>{const v=[];return v.push(a,y.byteLength.toString(),s),v.push(s),this.doWrite(g,v,y)},y=>{throw this.fireError(y),y}))}async doWrite(g,m,y){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(y)}catch(v){return this.handleError(v,g),Promise.reject(v)}}handleError(g,m){this.errorCount++,this.fireError(g,m,this.errorCount)}end(){this.writable.end()}},E(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),TUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var a;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r +`&&l++}o&&s.length>0&&a.push(s.length),this._lineOffsets=a}return this._lineOffsets}positionAt(a){a=Math.max(Math.min(a,this._content.length),0);let s=this.getLineOffsets(),o=0,l=s.length;if(l===0)return sn.create(0,a);for(;oa?l=h:o=h+1}let u=o-1;return sn.create(u,a-s[u])}offsetAt(a){let s=this.getLineOffsets();if(a.line>=s.length)return this._content.length;if(a.line<0)return 0;let o=s[a.line],l=a.line+1"u"}E(o,"undefined"),i.undefined=o;function l(v){return v===!0||v===!1}E(l,"boolean"),i.boolean=l;function u(v){return a.call(v)==="[object String]"}E(u,"string"),i.string=u;function h(v){return a.call(v)==="[object Number]"}E(h,"number"),i.number=h;function d(v,x,b){return a.call(v)==="[object Number]"&&x<=v&&v<=b}E(d,"numberRange"),i.numberRange=d;function f(v){return a.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}E(f,"integer"),i.integer=f;function p(v){return a.call(v)==="[object Number]"&&0<=v&&v<=2147483647}E(p,"uinteger"),i.uinteger=p;function g(v){return a.call(v)==="[object Function]"}E(g,"func"),i.func=g;function m(v){return v!==null&&typeof v=="object"}E(m,"objectLiteral"),i.objectLiteral=m;function y(v,x){return Array.isArray(v)&&v.every(x)}E(y,"typedArray"),i.typedArray=y})(rt||(rt={}))}}),Yd=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}E(r,"RAL"),(function(n){function i(a){if(a===void 0)throw new Error("No runtime abstraction layer provided");e=a}E(i,"install"),n.install=i})(r||(r={})),t.default=r}}),Ax=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(l){return l===!0||l===!1}E(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}E(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}E(n,"number"),t.number=n;function i(l){return l instanceof Error}E(i,"error"),t.error=i;function a(l){return typeof l=="function"}E(a,"func"),t.func=a;function s(l){return Array.isArray(l)}E(s,"array"),t.array=s;function o(l){return s(l)&&l.every(u=>r(u))}E(o,"stringArray"),t.stringArray=o}}),eg=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var a,s;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=Yd(),r;(function(o){const l={dispose(){}};o.None=function(){return l}})(r||(t.Event=r={}));var n=(a=class{add(l,u=null,h){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(h)&&h.push({dispose:E(()=>this.remove(l,u),"dispose")})}remove(l,u=null){if(!this._callbacks)return;let h=!1;for(let d=0,f=this._callbacks.length;d{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,u);const d={dispose:E(()=>{this._callbacks&&(this._callbacks.remove(l,u),d.dispose=s._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(h)&&h.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},E(s,"Emitter"),s);t.Emitter=i,i._noop=function(){}}}),M3=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,u;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=Yd(),r=Ax(),n=eg(),i;(function(h){h.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),h.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function d(f){const p=f;return p&&(p===h.None||p===h.Cancelled||r.boolean(p.isCancellationRequested)&&!!p.onCancellationRequested)}E(d,"is"),h.is=d})(i||(t.CancellationToken=i={}));var a=Object.freeze(function(h,d){const f=(0,e.default)().timer.setTimeout(h.bind(d),0);return{dispose(){f.dispose()}}}),s=(l=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},E(l,"MutableToken"),l),o=(u=class{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}},E(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),Wte=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var F,A,R,N,D,I,$,B,P,G,V,X,W,ie,K,se,J,Z,ee,ne,ue,fe,_e,Ae,Ne;Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var e=Ax(),r;(function(me){me.ParseError=-32700,me.InvalidRequest=-32600,me.MethodNotFound=-32601,me.InvalidParams=-32602,me.InternalError=-32603,me.jsonrpcReservedErrorRangeStart=-32099,me.serverErrorStart=-32099,me.MessageWriteError=-32099,me.MessageReadError=-32098,me.PendingResponseRejected=-32097,me.ConnectionInactive=-32096,me.ServerNotInitialized=-32002,me.UnknownErrorCode=-32001,me.jsonrpcReservedErrorRangeEnd=-32e3,me.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(F=class extends Error{constructor(ve,Ge,Te){super(Ge),this.code=e.number(ve)?ve:r.UnknownErrorCode,this.data=Te,Object.setPrototypeOf(this,F.prototype)}toJson(){const ve={code:this.code,message:this.message};return this.data!==void 0&&(ve.data=this.data),ve}},E(F,"ResponseError"),F);t.ResponseError=n;var i=(A=class{constructor(ve){this.kind=ve}static is(ve){return ve===A.auto||ve===A.byName||ve===A.byPosition}toString(){return this.kind}},E(A,"ParameterStructures"),A);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var a=(R=class{constructor(ve,Ge){this.method=ve,this.numberOfParams=Ge}get parameterStructures(){return i.auto}},E(R,"AbstractMessageSignature"),R);t.AbstractMessageSignature=a;var s=(N=class extends a{constructor(ve){super(ve,0)}},E(N,"RequestType0"),N);t.RequestType0=s;var o=(D=class extends a{constructor(ve,Ge=i.auto){super(ve,1),this._parameterStructures=Ge}get parameterStructures(){return this._parameterStructures}},E(D,"RequestType"),D);t.RequestType=o;var l=(I=class extends a{constructor(ve,Ge=i.auto){super(ve,1),this._parameterStructures=Ge}get parameterStructures(){return this._parameterStructures}},E(I,"RequestType1"),I);t.RequestType1=l;var u=($=class extends a{constructor(ve){super(ve,2)}},E($,"RequestType2"),$);t.RequestType2=u;var h=(B=class extends a{constructor(ve){super(ve,3)}},E(B,"RequestType3"),B);t.RequestType3=h;var d=(P=class extends a{constructor(ve){super(ve,4)}},E(P,"RequestType4"),P);t.RequestType4=d;var f=(G=class extends a{constructor(ve){super(ve,5)}},E(G,"RequestType5"),G);t.RequestType5=f;var p=(V=class extends a{constructor(ve){super(ve,6)}},E(V,"RequestType6"),V);t.RequestType6=p;var g=(X=class extends a{constructor(ve){super(ve,7)}},E(X,"RequestType7"),X);t.RequestType7=g;var m=(W=class extends a{constructor(ve){super(ve,8)}},E(W,"RequestType8"),W);t.RequestType8=m;var y=(ie=class extends a{constructor(ve){super(ve,9)}},E(ie,"RequestType9"),ie);t.RequestType9=y;var v=(K=class extends a{constructor(ve,Ge=i.auto){super(ve,1),this._parameterStructures=Ge}get parameterStructures(){return this._parameterStructures}},E(K,"NotificationType"),K);t.NotificationType=v;var x=(se=class extends a{constructor(ve){super(ve,0)}},E(se,"NotificationType0"),se);t.NotificationType0=x;var b=(J=class extends a{constructor(ve,Ge=i.auto){super(ve,1),this._parameterStructures=Ge}get parameterStructures(){return this._parameterStructures}},E(J,"NotificationType1"),J);t.NotificationType1=b;var w=(Z=class extends a{constructor(ve){super(ve,2)}},E(Z,"NotificationType2"),Z);t.NotificationType2=w;var k=(ee=class extends a{constructor(ve){super(ve,3)}},E(ee,"NotificationType3"),ee);t.NotificationType3=k;var S=(ne=class extends a{constructor(ve){super(ve,4)}},E(ne,"NotificationType4"),ne);t.NotificationType4=S;var C=(ue=class extends a{constructor(ve){super(ve,5)}},E(ue,"NotificationType5"),ue);t.NotificationType5=C;var _=(fe=class extends a{constructor(ve){super(ve,6)}},E(fe,"NotificationType6"),fe);t.NotificationType6=_;var L=(_e=class extends a{constructor(ve){super(ve,7)}},E(_e,"NotificationType7"),_e);t.NotificationType7=L;var O=(Ae=class extends a{constructor(ve){super(ve,8)}},E(Ae,"NotificationType8"),Ae);t.NotificationType8=O;var M=(Ne=class extends a{constructor(ve){super(ve,9)}},E(Ne,"NotificationType9"),Ne);t.NotificationType9=M;var z;(function(me){function ve(Ze){const ke=Ze;return ke&&e.string(ke.method)&&(e.string(ke.id)||e.number(ke.id))}E(ve,"isRequest"),me.isRequest=ve;function Ge(Ze){const ke=Ze;return ke&&e.string(ke.method)&&Ze.id===void 0}E(Ge,"isNotification"),me.isNotification=Ge;function Te(Ze){const ke=Ze;return ke&&(ke.result!==void 0||!!ke.error)&&(e.string(ke.id)||e.number(ke.id)||ke.id===null)}E(Te,"isResponse"),me.isResponse=Te})(z||(t.Message=z={}))}}),Ute=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var a,s;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(o){o.None=0,o.First=1,o.AsOld=o.First,o.Last=2,o.AsNew=o.Last})(r||(t.Touch=r={}));var n=(a=class{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var l;return(l=this._head)==null?void 0:l.value}get last(){var l;return(l=this._tail)==null?void 0:l.value}has(l){return this._map.has(l)}get(l,u=r.None){const h=this._map.get(l);if(h)return u!==r.None&&this.touch(h,u),h.value}set(l,u,h=r.None){let d=this._map.get(l);if(d)d.value=u,h!==r.None&&this.touch(d,h);else{switch(d={key:l,value:u,next:void 0,previous:void 0},h){case r.None:this.addItemLast(d);break;case r.First:this.addItemFirst(d);break;case r.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(l,d),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const u=this._map.get(l);if(u)return this._map.delete(l),this.removeItem(u),this._size--,u.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,u){const h=this._state;let d=this._head;for(;d;){if(u?l.bind(u)(d.value,d.key,this):l(d.value,d.key,this),this._state!==h)throw new Error("LinkedMap got modified during iteration.");d=d.next}}keys(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:E(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.key,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}values(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:E(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.value,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}entries(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:E(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:[u.key,u.value],done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let u=this._head,h=this.size;for(;u&&h>l;)this._map.delete(u.key),u=u.next,h--;this._head=u,this._size=h,u&&(u.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const u=l.next,h=l.previous;if(!u||!h)throw new Error("Invalid list");u.previous=h,h.next=u}l.next=void 0,l.previous=void 0,this._state++}touch(l,u){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(u!==r.First&&u!==r.Last)){if(u===r.First){if(l===this._head)return;const h=l.next,d=l.previous;l===this._tail?(d.next=void 0,this._tail=d):(h.previous=d,d.next=h),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(u===r.Last){if(l===this._tail)return;const h=l.next,d=l.previous;l===this._head?(h.previous=void 0,this._head=h):(h.previous=d,d.next=h),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((u,h)=>{l.push([h,u])}),l}fromJSON(l){this.clear();for(const[u,h]of l)this.set(u,h)}},E(a,"LinkedMap"),a);t.LinkedMap=n;var i=(s=class extends n{constructor(l,u=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,u),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,u=r.AsNew){return super.get(l,u)}peek(l){return super.get(l,r.None)}set(l,u){return super.set(l,u,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},E(s,"LRUCache"),s);t.LRUCache=i}}),LUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function n(i){return{dispose:i}}E(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),IUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var o,l,u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=M3(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(o=class{constructor(){this.buffers=new Map}enableCancellation(f){if(f.id===null)return;const p=new SharedArrayBuffer(4),g=new Int32Array(p,0,1);g[0]=r.Continue,this.buffers.set(f.id,p),f.$cancellationData=p}async sendCancellation(f,p){const g=this.buffers.get(p);if(g===void 0)return;const m=new Int32Array(g,0,1);Atomics.store(m,0,r.Cancelled)}cleanup(f){this.buffers.delete(f)}dispose(){this.buffers.clear()}},E(o,"SharedArraySenderStrategy"),o);t.SharedArraySenderStrategy=n;var i=(l=class{constructor(f){this.data=new Int32Array(f,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},E(l,"SharedArrayBufferCancellationToken"),l),a=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},E(u,"SharedArrayBufferCancellationTokenSource"),u),s=(h=class{constructor(){this.kind="request"}createCancellationTokenSource(f){const p=f.$cancellationData;return p===void 0?new e.CancellationTokenSource:new a(p)}},E(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=s}}),Hte=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var e=Yd(),r=(n=class{constructor(a=1){if(a<=0)throw new Error("Capacity must be greater than 0");this._capacity=a,this._active=0,this._waiting=[]}lock(a){return new Promise((s,o)=>{this._waiting.push({thunk:a,resolve:s,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const a=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const s=a.thunk();s instanceof Promise?s.then(o=>{this._active--,a.resolve(o),this.runNext()},o=>{this._active--,a.reject(o),this.runNext()}):(this._active--,a.resolve(s),this.runNext())}catch(s){this._active--,a.reject(s),this.runNext()}}},E(n,"Semaphore"),n);t.Semaphore=r}}),DUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var e=Yd(),r=Ax(),n=eg(),i=Hte(),a;(function(d){function f(p){let g=p;return g&&r.func(g.listen)&&r.func(g.dispose)&&r.func(g.onError)&&r.func(g.onClose)&&r.func(g.onPartialMessage)}E(f,"is"),d.is=f})(a||(t.MessageReader=a={}));var s=(u=class{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f){this.errorEmitter.fire(this.asError(f))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(f){this.partialMessageEmitter.fire(f)}asError(f){return f instanceof Error?f:new Error(`Reader received error. Reason: ${r.string(f.message)?f.message:"unknown"}`)}},E(u,"AbstractMessageReader"),u);t.AbstractMessageReader=s;var o;(function(d){function f(p){let g,m;const y=new Map;let v;const x=new Map;if(p===void 0||typeof p=="string")g=p??"utf-8";else{if(g=p.charset??"utf-8",p.contentDecoder!==void 0&&(m=p.contentDecoder,y.set(m.name,m)),p.contentDecoders!==void 0)for(const b of p.contentDecoders)y.set(b.name,b);if(p.contentTypeDecoder!==void 0&&(v=p.contentTypeDecoder,x.set(v.name,v)),p.contentTypeDecoders!==void 0)for(const b of p.contentTypeDecoders)x.set(b.name,b)}return v===void 0&&(v=(0,e.default)().applicationJson.decoder,x.set(v.name,v)),{charset:g,contentDecoder:m,contentDecoders:y,contentTypeDecoder:v,contentTypeDecoders:x}}E(f,"fromOptions"),d.fromOptions=f})(o||(o={}));var l=(h=class extends s{constructor(f,p){super(),this.readable=f,this.options=o.fromOptions(p),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(f){this._partialMessageTimeout=f}get partialMessageTimeout(){return this._partialMessageTimeout}listen(f){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=f;const p=this.readable.onData(g=>{this.onData(g)});return this.readable.onError(g=>this.fireError(g)),this.readable.onClose(()=>this.fireClose()),p}onData(f){try{for(this.buffer.append(f);;){if(this.nextMessageLength===-1){const g=this.buffer.tryReadHeaders(!0);if(!g)return;const m=g.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(g))}`));return}const y=parseInt(m);if(isNaN(y)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=y}const p=this.buffer.tryReadBody(this.nextMessageLength);if(p===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const g=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(p):p,m=await this.options.contentTypeDecoder.decode(g,this.options);this.callback(m)}).catch(g=>{this.fireError(g)})}}catch(p){this.fireError(p)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((f,p)=>{this.partialMessageTimer=void 0,f===this.messageToken&&(this.firePartialMessage({messageToken:f,waitingTime:p}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},E(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),MUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=Yd(),r=Ax(),n=Hte(),i=eg(),a="Content-Length: ",s=`\r +`,o;(function(p){function g(m){let y=m;return y&&r.func(y.dispose)&&r.func(y.onClose)&&r.func(y.onError)&&r.func(y.write)}E(g,"is"),p.is=g})(o||(t.MessageWriter=o={}));var l=(d=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(g,m,y){this.errorEmitter.fire([this.asError(g),m,y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(g){return g instanceof Error?g:new Error(`Writer received error. Reason: ${r.string(g.message)?g.message:"unknown"}`)}},E(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var u;(function(p){function g(m){return m===void 0||typeof m=="string"?{charset:m??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}E(g,"fromOptions"),p.fromOptions=g})(u||(u={}));var h=(f=class extends l{constructor(g,m){super(),this.writable=g,this.options=u.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(y=>this.fireError(y)),this.writable.onClose(()=>this.fireClose())}async write(g){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(g,this.options).then(y=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(y):y).then(y=>{const v=[];return v.push(a,y.byteLength.toString(),s),v.push(s),this.doWrite(g,v,y)},y=>{throw this.fireError(y),y}))}async doWrite(g,m,y){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(y)}catch(v){return this.handleError(v,g),Promise.reject(v)}}handleError(g,m){this.errorCount++,this.fireError(g,m,this.errorCount)}end(){this.writable.end()}},E(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),NUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var a;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r `,i=(a=class{constructor(o="utf-8"){this._encoding=o,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(o){const l=typeof o=="string"?this.fromString(o,this._encoding):o;this._chunks.push(l),this._totalLength+=l.byteLength}tryReadHeaders(o=!1){if(this._chunks.length===0)return;let l=0,u=0,h=0,d=0;e:for(;uthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},E(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),wUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var F,S;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=Yd(),r=Ex(),n=Bte(),i=Fte(),a=Jp(),s=L3(),o;(function(R){R.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(R){function N(D){return typeof D=="string"||typeof D=="number"}E(N,"is"),R.is=N})(l||(t.ProgressToken=l={}));var u;(function(R){R.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(F=class{constructor(){}},E(F,"ProgressType"),F);t.ProgressType=h;var d;(function(R){function N(D){return r.func(D)}E(N,"is"),R.is=N})(d||(d={})),t.NullLogger=Object.freeze({error:E(()=>{},"error"),warn:E(()=>{},"warn"),info:E(()=>{},"info"),log:E(()=>{},"log")});var f;(function(R){R[R.Off=0]="Off",R[R.Messages=1]="Messages",R[R.Compact=2]="Compact",R[R.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(R){R.Off="off",R.Messages="messages",R.Compact="compact",R.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(R){function N(I){if(!r.string(I))return R.Off;switch(I=I.toLowerCase(),I){case"off":return R.Off;case"messages":return R.Messages;case"compact":return R.Compact;case"verbose":return R.Verbose;default:return R.Off}}E(N,"fromString"),R.fromString=N;function D(I){switch(I){case R.Off:return"off";case R.Messages:return"messages";case R.Compact:return"compact";case R.Verbose:return"verbose";default:return"off"}}E(D,"toString"),R.toString=D})(f||(t.Trace=f={}));var g;(function(R){R.Text="text",R.JSON="json"})(g||(t.TraceFormat=g={})),(function(R){function N(D){return r.string(D)?(D=D.toLowerCase(),D==="json"?R.JSON:R.Text):R.Text}E(N,"fromString"),R.fromString=N})(g||(t.TraceFormat=g={}));var m;(function(R){R.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(R){R.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(R){R[R.Closed=1]="Closed",R[R.Disposed=2]="Disposed",R[R.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var T=(S=class extends Error{constructor(N,D){super(D),this.code=N,Object.setPrototypeOf(this,S.prototype)}},E(S,"ConnectionError"),S);t.ConnectionError=T;var b;(function(R){function N(D){const I=D;return I&&r.func(I.cancelUndispatched)}E(N,"is"),R.is=N})(b||(t.ConnectionStrategy=b={}));var w;(function(R){function N(D){const I=D;return I&&(I.kind===void 0||I.kind==="id")&&r.func(I.createCancellationTokenSource)&&(I.dispose===void 0||r.func(I.dispose))}E(N,"is"),R.is=N})(w||(t.IdCancellationReceiverStrategy=w={}));var k;(function(R){function N(D){const I=D;return I&&I.kind==="request"&&r.func(I.createCancellationTokenSource)&&(I.dispose===void 0||r.func(I.dispose))}E(N,"is"),R.is=N})(k||(t.RequestCancellationReceiverStrategy=k={}));var A;(function(R){R.Message=Object.freeze({createCancellationTokenSource(D){return new s.CancellationTokenSource}});function N(D){return w.is(D)||k.is(D)}E(N,"is"),R.is=N})(A||(t.CancellationReceiverStrategy=A={}));var C;(function(R){R.Message=Object.freeze({sendCancellation(D,I){return D.sendNotification(o.type,{id:I})},cleanup(D){}});function N(D){const I=D;return I&&r.func(I.sendCancellation)&&r.func(I.cleanup)}E(N,"is"),R.is=N})(C||(t.CancellationSenderStrategy=C={}));var _;(function(R){R.Message=Object.freeze({receiver:A.Message,sender:C.Message});function N(D){const I=D;return I&&A.is(I.receiver)&&C.is(I.sender)}E(N,"is"),R.is=N})(_||(t.CancellationStrategy=_={}));var L;(function(R){function N(D){const I=D;return I&&r.func(I.handleMessage)}E(N,"is"),R.is=N})(L||(t.MessageStrategy=L={}));var O;(function(R){function N(D){const I=D;return I&&(_.is(I.cancellationStrategy)||b.is(I.connectionStrategy)||L.is(I.messageStrategy))}E(N,"is"),R.is=N})(O||(t.ConnectionOptions=O={}));var M;(function(R){R[R.New=1]="New",R[R.Listening=2]="Listening",R[R.Closed=3]="Closed",R[R.Disposed=4]="Disposed"})(M||(M={}));function z(R,N,D,I){const $=D!==void 0?D:t.NullLogger;let B=0,P=0,G=0;const V="2.0";let Y;const W=new Map;let ie;const K=new Map,se=new Map;let J,Z=new i.LinkedMap,ee=new Map,ne=new Set,ue=new Map,fe=f.Off,_e=g.Text,Ae,Ne=M.New;const me=new a.Emitter,ve=new a.Emitter,Ge=new a.Emitter,Te=new a.Emitter,Ze=new a.Emitter,ke=I&&I.cancellationStrategy?I.cancellationStrategy:_.Message;function Ve(ye){if(ye===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+ye.toString()}E(Ve,"createRequestQueueKey");function Qe(ye){return ye===null?"res-unknown-"+(++G).toString():"res-"+ye.toString()}E(Qe,"createResponseQueueKey");function nt(){return"not-"+(++P).toString()}E(nt,"createNotificationQueueKey");function tt(ye,et){n.Message.isRequest(et)?ye.set(Ve(et.id),et):n.Message.isResponse(et)?ye.set(Qe(et.id),et):ye.set(nt(),et)}E(tt,"addMessageToQueue");function je(ye){}E(je,"cancelUndispatched");function Ce(){return Ne===M.Listening}E(Ce,"isListening");function Se(){return Ne===M.Closed}E(Se,"isClosed");function H(){return Ne===M.Disposed}E(H,"isDisposed");function he(){(Ne===M.New||Ne===M.Listening)&&(Ne=M.Closed,ve.fire(void 0))}E(he,"closeHandler");function j(ye){me.fire([ye,void 0,void 0])}E(j,"readErrorHandler");function pe(ye){me.fire(ye)}E(pe,"writeErrorHandler"),R.onClose(he),R.onError(j),N.onClose(he),N.onError(pe);function re(){J||Z.size===0||(J=(0,e.default)().timer.setImmediate(()=>{J=void 0,xe()}))}E(re,"triggerMessageQueue");function Be(ye){n.Message.isRequest(ye)?De(ye):n.Message.isNotification(ye)?Le(ye):n.Message.isResponse(ye)?qe(ye):Xe(ye)}E(Be,"handleMessage");function xe(){if(Z.size===0)return;const ye=Z.shift();try{const et=I==null?void 0:I.messageStrategy;L.is(et)?et.handleMessage(ye,Be):Be(ye)}finally{re()}}E(xe,"processMessageQueue");const Ue=E(ye=>{try{if(n.Message.isNotification(ye)&&ye.method===o.type.method){const et=ye.params.id,ct=Ve(et),_t=Z.get(ct);if(n.Message.isRequest(_t)){const nr=I==null?void 0:I.connectionStrategy,ir=nr&&nr.cancelUndispatched?nr.cancelUndispatched(_t,je):void 0;if(ir&&(ir.error!==void 0||ir.result!==void 0)){Z.delete(ct),ue.delete(et),ir.id=_t.id,lt(ir,ye.method,Date.now()),N.write(ir).catch(()=>$.error("Sending response for canceled message failed."));return}}const Ft=ue.get(et);if(Ft!==void 0){Ft.cancel(),Et(ye);return}else ne.add(et)}tt(Z,ye)}finally{re()}},"callback");function De(ye){if(H())return;function et(or,Rr,Jt){const Nr={jsonrpc:V,id:ye.id};or instanceof n.ResponseError?Nr.error=or.toJson():Nr.result=or===void 0?null:or,lt(Nr,Rr,Jt),N.write(Nr).catch(()=>$.error("Sending response failed."))}E(et,"reply");function ct(or,Rr,Jt){const Nr={jsonrpc:V,id:ye.id,error:or.toJson()};lt(Nr,Rr,Jt),N.write(Nr).catch(()=>$.error("Sending response failed."))}E(ct,"replyError");function _t(or,Rr,Jt){or===void 0&&(or=null);const Nr={jsonrpc:V,id:ye.id,result:or};lt(Nr,Rr,Jt),N.write(Nr).catch(()=>$.error("Sending response failed."))}E(_t,"replySuccess"),be(ye);const Ft=W.get(ye.method);let nr,ir;Ft&&(nr=Ft.type,ir=Ft.handler);const _r=Date.now();if(ir||Y){const or=ye.id??String(Date.now()),Rr=w.is(ke.receiver)?ke.receiver.createCancellationTokenSource(or):ke.receiver.createCancellationTokenSource(ye);ye.id!==null&&ne.has(ye.id)&&Rr.cancel(),ye.id!==null&&ue.set(or,Rr);try{let Jt;if(ir)if(ye.params===void 0){if(nr!==void 0&&nr.numberOfParams!==0){ct(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${ye.method} defines ${nr.numberOfParams} params but received none.`),ye.method,_r);return}Jt=ir(Rr.token)}else if(Array.isArray(ye.params)){if(nr!==void 0&&nr.parameterStructures===n.ParameterStructures.byName){ct(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${ye.method} defines parameters by name but received parameters by position`),ye.method,_r);return}Jt=ir(...ye.params,Rr.token)}else{if(nr!==void 0&&nr.parameterStructures===n.ParameterStructures.byPosition){ct(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${ye.method} defines parameters by position but received parameters by name`),ye.method,_r);return}Jt=ir(ye.params,Rr.token)}else Y&&(Jt=Y(ye.method,ye.params,Rr.token));const Nr=Jt;Jt?Nr.then?Nr.then(gn=>{ue.delete(or),et(gn,ye.method,_r)},gn=>{ue.delete(or),gn instanceof n.ResponseError?ct(gn,ye.method,_r):gn&&r.string(gn.message)?ct(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${ye.method} failed with message: ${gn.message}`),ye.method,_r):ct(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${ye.method} failed unexpectedly without providing any details.`),ye.method,_r)}):(ue.delete(or),et(Jt,ye.method,_r)):(ue.delete(or),_t(Jt,ye.method,_r))}catch(Jt){ue.delete(or),Jt instanceof n.ResponseError?et(Jt,ye.method,_r):Jt&&r.string(Jt.message)?ct(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${ye.method} failed with message: ${Jt.message}`),ye.method,_r):ct(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${ye.method} failed unexpectedly without providing any details.`),ye.method,_r)}}else ct(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${ye.method}`),ye.method,_r)}E(De,"handleRequest");function qe(ye){if(!H())if(ye.id===null)ye.error?$.error(`Received response message without id: Error is: +${y}`);const x=y.substr(0,v),b=y.substr(v+1).trim();p.set(o?x.toLowerCase():x,b)}return p}tryReadBody(o){if(!(this._totalLengththis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},E(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),OUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var F,A;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=Yd(),r=Ax(),n=Wte(),i=Ute(),a=eg(),s=M3(),o;(function(R){R.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(R){function N(D){return typeof D=="string"||typeof D=="number"}E(N,"is"),R.is=N})(l||(t.ProgressToken=l={}));var u;(function(R){R.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(F=class{constructor(){}},E(F,"ProgressType"),F);t.ProgressType=h;var d;(function(R){function N(D){return r.func(D)}E(N,"is"),R.is=N})(d||(d={})),t.NullLogger=Object.freeze({error:E(()=>{},"error"),warn:E(()=>{},"warn"),info:E(()=>{},"info"),log:E(()=>{},"log")});var f;(function(R){R[R.Off=0]="Off",R[R.Messages=1]="Messages",R[R.Compact=2]="Compact",R[R.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(R){R.Off="off",R.Messages="messages",R.Compact="compact",R.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(R){function N(I){if(!r.string(I))return R.Off;switch(I=I.toLowerCase(),I){case"off":return R.Off;case"messages":return R.Messages;case"compact":return R.Compact;case"verbose":return R.Verbose;default:return R.Off}}E(N,"fromString"),R.fromString=N;function D(I){switch(I){case R.Off:return"off";case R.Messages:return"messages";case R.Compact:return"compact";case R.Verbose:return"verbose";default:return"off"}}E(D,"toString"),R.toString=D})(f||(t.Trace=f={}));var g;(function(R){R.Text="text",R.JSON="json"})(g||(t.TraceFormat=g={})),(function(R){function N(D){return r.string(D)?(D=D.toLowerCase(),D==="json"?R.JSON:R.Text):R.Text}E(N,"fromString"),R.fromString=N})(g||(t.TraceFormat=g={}));var m;(function(R){R.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(R){R.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(R){R[R.Closed=1]="Closed",R[R.Disposed=2]="Disposed",R[R.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var x=(A=class extends Error{constructor(N,D){super(D),this.code=N,Object.setPrototypeOf(this,A.prototype)}},E(A,"ConnectionError"),A);t.ConnectionError=x;var b;(function(R){function N(D){const I=D;return I&&r.func(I.cancelUndispatched)}E(N,"is"),R.is=N})(b||(t.ConnectionStrategy=b={}));var w;(function(R){function N(D){const I=D;return I&&(I.kind===void 0||I.kind==="id")&&r.func(I.createCancellationTokenSource)&&(I.dispose===void 0||r.func(I.dispose))}E(N,"is"),R.is=N})(w||(t.IdCancellationReceiverStrategy=w={}));var k;(function(R){function N(D){const I=D;return I&&I.kind==="request"&&r.func(I.createCancellationTokenSource)&&(I.dispose===void 0||r.func(I.dispose))}E(N,"is"),R.is=N})(k||(t.RequestCancellationReceiverStrategy=k={}));var S;(function(R){R.Message=Object.freeze({createCancellationTokenSource(D){return new s.CancellationTokenSource}});function N(D){return w.is(D)||k.is(D)}E(N,"is"),R.is=N})(S||(t.CancellationReceiverStrategy=S={}));var C;(function(R){R.Message=Object.freeze({sendCancellation(D,I){return D.sendNotification(o.type,{id:I})},cleanup(D){}});function N(D){const I=D;return I&&r.func(I.sendCancellation)&&r.func(I.cleanup)}E(N,"is"),R.is=N})(C||(t.CancellationSenderStrategy=C={}));var _;(function(R){R.Message=Object.freeze({receiver:S.Message,sender:C.Message});function N(D){const I=D;return I&&S.is(I.receiver)&&C.is(I.sender)}E(N,"is"),R.is=N})(_||(t.CancellationStrategy=_={}));var L;(function(R){function N(D){const I=D;return I&&r.func(I.handleMessage)}E(N,"is"),R.is=N})(L||(t.MessageStrategy=L={}));var O;(function(R){function N(D){const I=D;return I&&(_.is(I.cancellationStrategy)||b.is(I.connectionStrategy)||L.is(I.messageStrategy))}E(N,"is"),R.is=N})(O||(t.ConnectionOptions=O={}));var M;(function(R){R[R.New=1]="New",R[R.Listening=2]="Listening",R[R.Closed=3]="Closed",R[R.Disposed=4]="Disposed"})(M||(M={}));function z(R,N,D,I){const $=D!==void 0?D:t.NullLogger;let B=0,P=0,G=0;const V="2.0";let X;const W=new Map;let ie;const K=new Map,se=new Map;let J,Z=new i.LinkedMap,ee=new Map,ne=new Set,ue=new Map,fe=f.Off,_e=g.Text,Ae,Ne=M.New;const me=new a.Emitter,ve=new a.Emitter,Ge=new a.Emitter,Te=new a.Emitter,Ze=new a.Emitter,ke=I&&I.cancellationStrategy?I.cancellationStrategy:_.Message;function Ve(ye){if(ye===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+ye.toString()}E(Ve,"createRequestQueueKey");function Qe(ye){return ye===null?"res-unknown-"+(++G).toString():"res-"+ye.toString()}E(Qe,"createResponseQueueKey");function nt(){return"not-"+(++P).toString()}E(nt,"createNotificationQueueKey");function tt(ye,et){n.Message.isRequest(et)?ye.set(Ve(et.id),et):n.Message.isResponse(et)?ye.set(Qe(et.id),et):ye.set(nt(),et)}E(tt,"addMessageToQueue");function je(ye){}E(je,"cancelUndispatched");function Ce(){return Ne===M.Listening}E(Ce,"isListening");function Se(){return Ne===M.Closed}E(Se,"isClosed");function H(){return Ne===M.Disposed}E(H,"isDisposed");function he(){(Ne===M.New||Ne===M.Listening)&&(Ne=M.Closed,ve.fire(void 0))}E(he,"closeHandler");function j(ye){me.fire([ye,void 0,void 0])}E(j,"readErrorHandler");function pe(ye){me.fire(ye)}E(pe,"writeErrorHandler"),R.onClose(he),R.onError(j),N.onClose(he),N.onError(pe);function re(){J||Z.size===0||(J=(0,e.default)().timer.setImmediate(()=>{J=void 0,xe()}))}E(re,"triggerMessageQueue");function Fe(ye){n.Message.isRequest(ye)?Me(ye):n.Message.isNotification(ye)?Le(ye):n.Message.isResponse(ye)?qe(ye):Xe(ye)}E(Fe,"handleMessage");function xe(){if(Z.size===0)return;const ye=Z.shift();try{const et=I==null?void 0:I.messageStrategy;L.is(et)?et.handleMessage(ye,Fe):Fe(ye)}finally{re()}}E(xe,"processMessageQueue");const Ue=E(ye=>{try{if(n.Message.isNotification(ye)&&ye.method===o.type.method){const et=ye.params.id,ct=Ve(et),_t=Z.get(ct);if(n.Message.isRequest(_t)){const nr=I==null?void 0:I.connectionStrategy,ir=nr&&nr.cancelUndispatched?nr.cancelUndispatched(_t,je):void 0;if(ir&&(ir.error!==void 0||ir.result!==void 0)){Z.delete(ct),ue.delete(et),ir.id=_t.id,lt(ir,ye.method,Date.now()),N.write(ir).catch(()=>$.error("Sending response for canceled message failed."));return}}const Ft=ue.get(et);if(Ft!==void 0){Ft.cancel(),Et(ye);return}else ne.add(et)}tt(Z,ye)}finally{re()}},"callback");function Me(ye){if(H())return;function et(or,Rr,Jt){const Nr={jsonrpc:V,id:ye.id};or instanceof n.ResponseError?Nr.error=or.toJson():Nr.result=or===void 0?null:or,lt(Nr,Rr,Jt),N.write(Nr).catch(()=>$.error("Sending response failed."))}E(et,"reply");function ct(or,Rr,Jt){const Nr={jsonrpc:V,id:ye.id,error:or.toJson()};lt(Nr,Rr,Jt),N.write(Nr).catch(()=>$.error("Sending response failed."))}E(ct,"replyError");function _t(or,Rr,Jt){or===void 0&&(or=null);const Nr={jsonrpc:V,id:ye.id,result:or};lt(Nr,Rr,Jt),N.write(Nr).catch(()=>$.error("Sending response failed."))}E(_t,"replySuccess"),be(ye);const Ft=W.get(ye.method);let nr,ir;Ft&&(nr=Ft.type,ir=Ft.handler);const _r=Date.now();if(ir||X){const or=ye.id??String(Date.now()),Rr=w.is(ke.receiver)?ke.receiver.createCancellationTokenSource(or):ke.receiver.createCancellationTokenSource(ye);ye.id!==null&&ne.has(ye.id)&&Rr.cancel(),ye.id!==null&&ue.set(or,Rr);try{let Jt;if(ir)if(ye.params===void 0){if(nr!==void 0&&nr.numberOfParams!==0){ct(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${ye.method} defines ${nr.numberOfParams} params but received none.`),ye.method,_r);return}Jt=ir(Rr.token)}else if(Array.isArray(ye.params)){if(nr!==void 0&&nr.parameterStructures===n.ParameterStructures.byName){ct(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${ye.method} defines parameters by name but received parameters by position`),ye.method,_r);return}Jt=ir(...ye.params,Rr.token)}else{if(nr!==void 0&&nr.parameterStructures===n.ParameterStructures.byPosition){ct(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${ye.method} defines parameters by position but received parameters by name`),ye.method,_r);return}Jt=ir(ye.params,Rr.token)}else X&&(Jt=X(ye.method,ye.params,Rr.token));const Nr=Jt;Jt?Nr.then?Nr.then(gn=>{ue.delete(or),et(gn,ye.method,_r)},gn=>{ue.delete(or),gn instanceof n.ResponseError?ct(gn,ye.method,_r):gn&&r.string(gn.message)?ct(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${ye.method} failed with message: ${gn.message}`),ye.method,_r):ct(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${ye.method} failed unexpectedly without providing any details.`),ye.method,_r)}):(ue.delete(or),et(Jt,ye.method,_r)):(ue.delete(or),_t(Jt,ye.method,_r))}catch(Jt){ue.delete(or),Jt instanceof n.ResponseError?et(Jt,ye.method,_r):Jt&&r.string(Jt.message)?ct(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${ye.method} failed with message: ${Jt.message}`),ye.method,_r):ct(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${ye.method} failed unexpectedly without providing any details.`),ye.method,_r)}}else ct(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${ye.method}`),ye.method,_r)}E(Me,"handleRequest");function qe(ye){if(!H())if(ye.id===null)ye.error?$.error(`Received response message without id: Error is: ${JSON.stringify(ye.error,void 0,4)}`):$.error("Received response message without id. No further error information provided.");else{const et=ye.id,ct=ee.get(et);if(vt(ye,ct),ct!==void 0){ee.delete(et);try{if(ye.error){const _t=ye.error;ct.reject(new n.ResponseError(_t.code,_t.message,_t.data))}else if(ye.result!==void 0)ct.resolve(ye.result);else throw new Error("Should never happen.")}catch(_t){_t.message?$.error(`Response handler '${ct.method}' failed with message: ${_t.message}`):$.error(`Response handler '${ct.method}' failed unexpectedly.`)}}}}E(qe,"handleResponse");function Le(ye){if(H())return;let et,ct;if(ye.method===o.type.method){const _t=ye.params.id;ne.delete(_t),Et(ye);return}else{const _t=K.get(ye.method);_t&&(ct=_t.handler,et=_t.type)}if(ct||ie)try{if(Et(ye),ct)if(ye.params===void 0)et!==void 0&&et.numberOfParams!==0&&et.parameterStructures!==n.ParameterStructures.byName&&$.error(`Notification ${ye.method} defines ${et.numberOfParams} params but received none.`),ct();else if(Array.isArray(ye.params)){const _t=ye.params;ye.method===u.type.method&&_t.length===2&&l.is(_t[0])?ct({token:_t[0],value:_t[1]}):(et!==void 0&&(et.parameterStructures===n.ParameterStructures.byName&&$.error(`Notification ${ye.method} defines parameters by name but received parameters by position`),et.numberOfParams!==ye.params.length&&$.error(`Notification ${ye.method} defines ${et.numberOfParams} params but received ${_t.length} arguments`)),ct(..._t))}else et!==void 0&&et.parameterStructures===n.ParameterStructures.byPosition&&$.error(`Notification ${ye.method} defines parameters by position but received parameters by name`),ct(ye.params);else ie&&ie(ye.method,ye.params)}catch(_t){_t.message?$.error(`Notification handler '${ye.method}' failed with message: ${_t.message}`):$.error(`Notification handler '${ye.method}' failed unexpectedly.`)}else Ge.fire(ye)}E(Le,"handleNotification");function Xe(ye){if(!ye){$.error("Received empty message.");return}$.error(`Received message which is neither a response nor a notification message: -${JSON.stringify(ye,null,4)}`);const et=ye;if(r.string(et.id)||r.number(et.id)){const ct=et.id,_t=ee.get(ct);_t&&_t.reject(new Error("The received response has neither a result nor an error property."))}}E(Xe,"handleInvalidMessage");function Ie(ye){if(ye!=null)switch(fe){case f.Verbose:return JSON.stringify(ye,null,4);case f.Compact:return JSON.stringify(ye);default:return}}E(Ie,"stringifyTrace");function it(ye){if(!(fe===f.Off||!Ae))if(_e===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&ye.params&&(et=`Params: ${Ie(ye.params)} +${JSON.stringify(ye,null,4)}`);const et=ye;if(r.string(et.id)||r.number(et.id)){const ct=et.id,_t=ee.get(ct);_t&&_t.reject(new Error("The received response has neither a result nor an error property."))}}E(Xe,"handleInvalidMessage");function De(ye){if(ye!=null)switch(fe){case f.Verbose:return JSON.stringify(ye,null,4);case f.Compact:return JSON.stringify(ye);default:return}}E(De,"stringifyTrace");function it(ye){if(!(fe===f.Off||!Ae))if(_e===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&ye.params&&(et=`Params: ${De(ye.params)} -`),Ae.log(`Sending request '${ye.method} - (${ye.id})'.`,et)}else ot("send-request",ye)}E(it,"traceSendingRequest");function we(ye){if(!(fe===f.Off||!Ae))if(_e===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&(ye.params?et=`Params: ${Ie(ye.params)} +`),Ae.log(`Sending request '${ye.method} - (${ye.id})'.`,et)}else ot("send-request",ye)}E(it,"traceSendingRequest");function we(ye){if(!(fe===f.Off||!Ae))if(_e===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&(ye.params?et=`Params: ${De(ye.params)} `:et=`No parameters provided. -`),Ae.log(`Sending notification '${ye.method}'.`,et)}else ot("send-notification",ye)}E(we,"traceSendingNotification");function lt(ye,et,ct){if(!(fe===f.Off||!Ae))if(_e===g.Text){let _t;(fe===f.Verbose||fe===f.Compact)&&(ye.error&&ye.error.data?_t=`Error data: ${Ie(ye.error.data)} +`),Ae.log(`Sending notification '${ye.method}'.`,et)}else ot("send-notification",ye)}E(we,"traceSendingNotification");function lt(ye,et,ct){if(!(fe===f.Off||!Ae))if(_e===g.Text){let _t;(fe===f.Verbose||fe===f.Compact)&&(ye.error&&ye.error.data?_t=`Error data: ${De(ye.error.data)} -`:ye.result?_t=`Result: ${Ie(ye.result)} +`:ye.result?_t=`Result: ${De(ye.result)} `:ye.error===void 0&&(_t=`No result returned. -`)),Ae.log(`Sending response '${et} - (${ye.id})'. Processing request took ${Date.now()-ct}ms`,_t)}else ot("send-response",ye)}E(lt,"traceSendingResponse");function be(ye){if(!(fe===f.Off||!Ae))if(_e===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&ye.params&&(et=`Params: ${Ie(ye.params)} +`)),Ae.log(`Sending response '${et} - (${ye.id})'. Processing request took ${Date.now()-ct}ms`,_t)}else ot("send-response",ye)}E(lt,"traceSendingResponse");function be(ye){if(!(fe===f.Off||!Ae))if(_e===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&ye.params&&(et=`Params: ${De(ye.params)} -`),Ae.log(`Received request '${ye.method} - (${ye.id})'.`,et)}else ot("receive-request",ye)}E(be,"traceReceivedRequest");function Et(ye){if(!(fe===f.Off||!Ae||ye.method===y.type.method))if(_e===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&(ye.params?et=`Params: ${Ie(ye.params)} +`),Ae.log(`Received request '${ye.method} - (${ye.id})'.`,et)}else ot("receive-request",ye)}E(be,"traceReceivedRequest");function Et(ye){if(!(fe===f.Off||!Ae||ye.method===y.type.method))if(_e===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&(ye.params?et=`Params: ${De(ye.params)} `:et=`No parameters provided. -`),Ae.log(`Received notification '${ye.method}'.`,et)}else ot("receive-notification",ye)}E(Et,"traceReceivedNotification");function vt(ye,et){if(!(fe===f.Off||!Ae))if(_e===g.Text){let ct;if((fe===f.Verbose||fe===f.Compact)&&(ye.error&&ye.error.data?ct=`Error data: ${Ie(ye.error.data)} +`),Ae.log(`Received notification '${ye.method}'.`,et)}else ot("receive-notification",ye)}E(Et,"traceReceivedNotification");function vt(ye,et){if(!(fe===f.Off||!Ae))if(_e===g.Text){let ct;if((fe===f.Verbose||fe===f.Compact)&&(ye.error&&ye.error.data?ct=`Error data: ${De(ye.error.data)} -`:ye.result?ct=`Result: ${Ie(ye.result)} +`:ye.result?ct=`Result: ${De(ye.result)} `:ye.error===void 0&&(ct=`No result returned. -`)),et){const _t=ye.error?` Request failed: ${ye.error.message} (${ye.error.code}).`:"";Ae.log(`Received response '${et.method} - (${ye.id})' in ${Date.now()-et.timerStart}ms.${_t}`,ct)}else Ae.log(`Received response ${ye.id} without active response promise.`,ct)}else ot("receive-response",ye)}E(vt,"traceReceivedResponse");function ot(ye,et){if(!Ae||fe===f.Off)return;const ct={isLSPMessage:!0,type:ye,message:et,timestamp:Date.now()};Ae.log(ct)}E(ot,"logLSPMessage");function It(){if(Se())throw new T(v.Closed,"Connection is closed.");if(H())throw new T(v.Disposed,"Connection is disposed.")}E(It,"throwIfClosedOrDisposed");function xt(){if(Ce())throw new T(v.AlreadyListening,"Connection is already listening")}E(xt,"throwIfListening");function ht(){if(!Ce())throw new Error("Call listen() first.")}E(ht,"throwIfNotListening");function oe(ye){return ye===void 0?null:ye}E(oe,"undefinedToNull");function At(ye){if(ye!==null)return ye}E(At,"nullToUndefined");function dt(ye){return ye!=null&&!Array.isArray(ye)&&typeof ye=="object"}E(dt,"isNamedParam");function ut(ye,et){switch(ye){case n.ParameterStructures.auto:return dt(et)?At(et):[oe(et)];case n.ParameterStructures.byName:if(!dt(et))throw new Error("Received parameters by name but param is not an object literal.");return At(et);case n.ParameterStructures.byPosition:return[oe(et)];default:throw new Error(`Unknown parameter structure ${ye.toString()}`)}}E(ut,"computeSingleParam");function wt(ye,et){let ct;const _t=ye.numberOfParams;switch(_t){case 0:ct=void 0;break;case 1:ct=ut(ye.parameterStructures,et[0]);break;default:ct=[];for(let Ft=0;Ft{It();let ct,_t;if(r.string(ye)){ct=ye;const nr=et[0];let ir=0,_r=n.ParameterStructures.auto;n.ParameterStructures.is(nr)&&(ir=1,_r=nr);let or=et.length;const Rr=or-ir;switch(Rr){case 0:_t=void 0;break;case 1:_t=ut(_r,et[ir]);break;default:if(_r===n.ParameterStructures.byName)throw new Error(`Received ${Rr} parameters for 'by Name' notification parameter structure.`);_t=et.slice(ir,or).map(Jt=>oe(Jt));break}}else{const nr=et;ct=ye.method,_t=wt(ye,nr)}const Ft={jsonrpc:V,method:ct,params:_t};return we(Ft),N.write(Ft).catch(nr=>{throw $.error("Sending notification failed."),nr})},"sendNotification"),onNotification:E((ye,et)=>{It();let ct;return r.func(ye)?ie=ye:et&&(r.string(ye)?(ct=ye,K.set(ye,{type:void 0,handler:et})):(ct=ye.method,K.set(ye.method,{type:ye,handler:et}))),{dispose:E(()=>{ct!==void 0?K.delete(ct):ie=void 0},"dispose")}},"onNotification"),onProgress:E((ye,et,ct)=>{if(se.has(et))throw new Error(`Progress handler for token ${et} already registered`);return se.set(et,ct),{dispose:E(()=>{se.delete(et)},"dispose")}},"onProgress"),sendProgress:E((ye,et,ct)=>Mr.sendNotification(u.type,{token:et,value:ct}),"sendProgress"),onUnhandledProgress:Te.event,sendRequest:E((ye,...et)=>{It(),ht();let ct,_t,Ft;if(r.string(ye)){ct=ye;const or=et[0],Rr=et[et.length-1];let Jt=0,Nr=n.ParameterStructures.auto;n.ParameterStructures.is(or)&&(Jt=1,Nr=or);let gn=et.length;s.CancellationToken.is(Rr)&&(gn=gn-1,Ft=Rr);const $r=gn-Jt;switch($r){case 0:_t=void 0;break;case 1:_t=ut(Nr,et[Jt]);break;default:if(Nr===n.ParameterStructures.byName)throw new Error(`Received ${$r} parameters for 'by Name' request parameter structure.`);_t=et.slice(Jt,gn).map(Pa=>oe(Pa));break}}else{const or=et;ct=ye.method,_t=wt(ye,or);const Rr=ye.numberOfParams;Ft=s.CancellationToken.is(or[Rr])?or[Rr]:void 0}const nr=B++;let ir;Ft&&(ir=Ft.onCancellationRequested(()=>{const or=ke.sender.sendCancellation(Mr,nr);return or===void 0?($.log(`Received no promise from cancellation strategy when cancelling id ${nr}`),Promise.resolve()):or.catch(()=>{$.log(`Sending cancellation messages for id ${nr} failed`)})}));const _r={jsonrpc:V,id:nr,method:ct,params:_t};return it(_r),typeof ke.sender.enableCancellation=="function"&&ke.sender.enableCancellation(_r),new Promise(async(or,Rr)=>{const Jt=E($r=>{or($r),ke.sender.cleanup(nr),ir==null||ir.dispose()},"resolveWithCleanup"),Nr=E($r=>{Rr($r),ke.sender.cleanup(nr),ir==null||ir.dispose()},"rejectWithCleanup"),gn={method:ct,timerStart:Date.now(),resolve:Jt,reject:Nr};try{await N.write(_r),ee.set(nr,gn)}catch($r){throw $.error("Sending request failed."),gn.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,$r.message?$r.message:"Unknown reason")),$r}})},"sendRequest"),onRequest:E((ye,et)=>{It();let ct=null;return d.is(ye)?(ct=void 0,Y=ye):r.string(ye)?(ct=null,et!==void 0&&(ct=ye,W.set(ye,{handler:et,type:void 0}))):et!==void 0&&(ct=ye.method,W.set(ye.method,{type:ye,handler:et})),{dispose:E(()=>{ct!==null&&(ct!==void 0?W.delete(ct):Y=void 0)},"dispose")}},"onRequest"),hasPendingResponse:E(()=>ee.size>0,"hasPendingResponse"),trace:E(async(ye,et,ct)=>{let _t=!1,Ft=g.Text;ct!==void 0&&(r.boolean(ct)?_t=ct:(_t=ct.sendNotification||!1,Ft=ct.traceFormat||g.Text)),fe=ye,_e=Ft,fe===f.Off?Ae=void 0:Ae=et,_t&&!Se()&&!H()&&await Mr.sendNotification(m.type,{value:f.toString(ye)})},"trace"),onError:me.event,onClose:ve.event,onUnhandledNotification:Ge.event,onDispose:Ze.event,end:E(()=>{N.end()},"end"),dispose:E(()=>{if(H())return;Ne=M.Disposed,Ze.fire(void 0);const ye=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const et of ee.values())et.reject(ye);ee=new Map,ue=new Map,ne=new Set,Z=new i.LinkedMap,r.func(N.dispose)&&N.dispose(),r.func(R.dispose)&&R.dispose()},"dispose"),listen:E(()=>{It(),xt(),Ne=M.Listening,R.listen(Ue)},"listen"),inspect:E(()=>{(0,e.default)().console.log("inspect")},"inspect")};return Mr.onNotification(y.type,ye=>{if(fe===f.Off||!Ae)return;const et=fe===f.Verbose||fe===f.Compact;Ae.log(ye.message,et?ye.verbose:void 0)}),Mr.onNotification(u.type,ye=>{const et=se.get(ye.token);et?et(ye.value):Te.fire(ye)}),Mr}E(z,"createMessageConnection"),t.createMessageConnection=z}}),_9=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;var e=Bte();Object.defineProperty(t,"Message",{enumerable:!0,get:E(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:E(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:E(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:E(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:E(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:E(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:E(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:E(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:E(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:E(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:E(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:E(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:E(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:E(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:E(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:E(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:E(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:E(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:E(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:E(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:E(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:E(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:E(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:E(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:E(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:E(function(){return e.ParameterStructures},"get")});var r=Fte();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:E(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:E(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:E(function(){return r.Touch},"get")});var n=yUe();Object.defineProperty(t,"Disposable",{enumerable:!0,get:E(function(){return n.Disposable},"get")});var i=Jp();Object.defineProperty(t,"Event",{enumerable:!0,get:E(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:E(function(){return i.Emitter},"get")});var a=L3();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:E(function(){return a.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:E(function(){return a.CancellationToken},"get")});var s=vUe();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:E(function(){return s.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:E(function(){return s.SharedArrayReceiverStrategy},"get")});var o=bUe();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:E(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:E(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:E(function(){return o.ReadableStreamMessageReader},"get")});var l=xUe();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:E(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:E(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:E(function(){return l.WriteableStreamMessageWriter},"get")});var u=TUe();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:E(function(){return u.AbstractMessageBuffer},"get")});var h=wUe();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:E(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:E(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:E(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:E(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:E(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:E(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:E(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:E(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:E(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:E(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:E(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:E(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:E(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:E(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:E(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:E(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:E(function(){return h.MessageStrategy},"get")});var d=Yd();t.RAL=d.default}}),CUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,u,h;Object.defineProperty(t,"__esModule",{value:!0});var e=_9(),r=(l=class extends e.AbstractMessageBuffer{constructor(f="utf-8"){super(f),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return l.emptyBuffer}fromString(f,p){return new TextEncoder().encode(f)}toString(f,p){return p==="ascii"?this.asciiDecoder.decode(f):new TextDecoder(p).decode(f)}asNative(f,p){return p===void 0?f:f.slice(0,p)}allocNative(f){return new Uint8Array(f)}},E(l,"MessageBuffer"),l);r.emptyBuffer=new Uint8Array(0);var n=(u=class{constructor(f){this.socket=f,this._onData=new e.Emitter,this._messageListener=p=>{p.data.arrayBuffer().then(m=>{this._onData.fire(new Uint8Array(m))},()=>{(0,e.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}onData(f){return this._onData.event(f)}},E(u,"ReadableStreamWrapper"),u),i=(h=class{constructor(f){this.socket=f}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}write(f,p){if(typeof f=="string"){if(p!==void 0&&p!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${p}`);this.socket.send(f)}else this.socket.send(f);return Promise.resolve()}end(){this.socket.close()}},E(h,"WritableStreamWrapper"),h),a=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:E(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:E((d,f)=>{if(f.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${f.charset}`);return Promise.resolve(a.encode(JSON.stringify(d,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:E((d,f)=>{if(!(d instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(f.charset).decode(d)))},"decode")})}),stream:Object.freeze({asReadableStream:E(d=>new n(d),"asReadableStream"),asWritableStream:E(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:E(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:E(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:E(()=>clearInterval(g),"dispose")}}})});function o(){return s}E(o,"RIL"),(function(d){function f(){e.RAL.install(s)}E(f,"install"),d.install=f})(o||(o={})),t.default=o}}),eg=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(t){var l,u;var e=t&&t.__createBinding||(Object.create?(function(h,d,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:E(function(){return d[f]},"get")}),Object.defineProperty(h,p,g)}):(function(h,d,f,p){p===void 0&&(p=f),h[p]=d[f]})),r=t&&t.__exportStar||function(h,d){for(var f in h)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&e(d,h,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=CUe();n.default.install();var i=_9();r(_9(),t);var a=(l=class extends i.AbstractMessageReader{constructor(d){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},d.addEventListener("error",f=>this.fireError(f)),d.onmessage=this._messageListener}listen(d){return this._onData.event(d)}},E(l,"BrowserMessageReader"),l);t.BrowserMessageReader=a;var s=(u=class extends i.AbstractMessageWriter{constructor(d){super(),this.port=d,this.errorCount=0,d.addEventListener("error",f=>this.fireError(f))}write(d){try{return this.port.postMessage(d),Promise.resolve()}catch(f){return this.handleError(f,d),Promise.reject(f)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){}},E(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=s;function o(h,d,f,p){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(h,d,f,p)}E(o,"createMessageConnection"),t.createMessageConnection=o}}),Gte=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=eg()}}),Zn=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,u,h,d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=eg(),r;(function(p){p.clientToServer="clientToServer",p.serverToClient="serverToClient",p.both="both"})(r||(t.MessageDirection=r={}));var n=(l=class{constructor(g){this.method=g}},E(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},E(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var a=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},E(h,"ProtocolRequestType"),h);t.ProtocolRequestType=a;var s=(d=class extends e.NotificationType0{constructor(g){super(g)}},E(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=s;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},E(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),R9=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(h){return h===!0||h===!1}E(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}E(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}E(n,"number"),t.number=n;function i(h){return h instanceof Error}E(i,"error"),t.error=i;function a(h){return typeof h=="function"}E(a,"func"),t.func=a;function s(h){return Array.isArray(h)}E(s,"array"),t.array=s;function o(h){return s(h)&&h.every(d=>r(d))}E(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}E(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}E(u,"objectLiteral"),t.objectLiteral=u}}),kUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;var e=Zn(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),EUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;var e=Zn(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),SUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;var e=Zn(),r;(function(i){i.method="workspace/workspaceFolders",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(r||(t.WorkspaceFoldersRequest=r={}));var n;(function(i){i.method="workspace/didChangeWorkspaceFolders",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolNotificationType(i.method)})(n||(t.DidChangeWorkspaceFoldersNotification=n={}))}}),AUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;var e=Zn(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),_Ue=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;var e=Zn(),r;(function(i){i.method="textDocument/documentColor",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.DocumentColorRequest=r={}));var n;(function(i){i.method="textDocument/colorPresentation",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.ColorPresentationRequest=n={}))}}),RUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;var e=Zn(),r;(function(i){i.method="textDocument/foldingRange",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.FoldingRangeRequest=r={}));var n;(function(i){i.method="workspace/foldingRange/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.FoldingRangeRefreshRequest=n={}))}}),LUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;var e=Zn(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),IUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;var e=Zn(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),DUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;var e=eg(),r=Zn(),n;(function(s){s.type=new e.ProgressType;function o(l){return l===s.type}E(o,"is"),s.is=o})(n||(t.WorkDoneProgress=n={}));var i;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=r.MessageDirection.serverToClient,s.type=new r.ProtocolRequestType(s.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var a;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolNotificationType(s.method)})(a||(t.WorkDoneProgressCancelNotification=a={}))}}),MUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;var e=Zn(),r;(function(a){a.method="textDocument/prepareCallHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.CallHierarchyPrepareRequest=r={}));var n;(function(a){a.method="callHierarchy/incomingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.CallHierarchyIncomingCallsRequest=n={}));var i;(function(a){a.method="callHierarchy/outgoingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.CallHierarchyOutgoingCallsRequest=i={}))}}),NUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;var e=Zn(),r;(function(l){l.Relative="relative"})(r||(t.TokenFormat=r={}));var n;(function(l){l.method="textDocument/semanticTokens",l.type=new e.RegistrationType(l.method)})(n||(t.SemanticTokensRegistrationType=n={}));var i;(function(l){l.method="textDocument/semanticTokens/full",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(i||(t.SemanticTokensRequest=i={}));var a;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(t.SemanticTokensDeltaRequest=a={}));var s;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(s||(t.SemanticTokensRangeRequest=s={}));var o;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(o||(t.SemanticTokensRefreshRequest=o={}))}}),OUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;var e=Zn(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),$Ue=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;var e=Zn(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),PUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;var e=Zn(),r;(function(u){u.file="file",u.folder="folder"})(r||(t.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(n||(t.WillCreateFilesRequest=n={}));var i;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(i||(t.DidCreateFilesNotification=i={}));var a;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(a||(t.WillRenameFilesRequest=a={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(s||(t.DidRenameFilesNotification=s={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(o||(t.DidDeleteFilesNotification=o={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),BUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;var e=Zn(),r;(function(a){a.document="document",a.project="project",a.group="group",a.scheme="scheme",a.global="global"})(r||(t.UniquenessLevel=r={}));var n;(function(a){a.$import="import",a.$export="export",a.local="local"})(n||(t.MonikerKind=n={}));var i;(function(a){a.method="textDocument/moniker",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.MonikerRequest=i={}))}}),FUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;var e=Zn(),r;(function(a){a.method="textDocument/prepareTypeHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.TypeHierarchyPrepareRequest=r={}));var n;(function(a){a.method="typeHierarchy/supertypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.TypeHierarchySupertypesRequest=n={}));var i;(function(a){a.method="typeHierarchy/subtypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.TypeHierarchySubtypesRequest=i={}))}}),zUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;var e=Zn(),r;(function(i){i.method="textDocument/inlineValue",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.InlineValueRequest=r={}));var n;(function(i){i.method="workspace/inlineValue/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.InlineValueRefreshRequest=n={}))}}),GUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;var e=Zn(),r;(function(a){a.method="textDocument/inlayHint",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.InlayHintRequest=r={}));var n;(function(a){a.method="inlayHint/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.InlayHintResolveRequest=n={}));var i;(function(a){a.method="workspace/inlayHint/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(i||(t.InlayHintRefreshRequest=i={}))}}),qUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;var e=eg(),r=R9(),n=Zn(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}E(h,"is"),u.is=h})(i||(t.DiagnosticServerCancellationData=i={}));var a;(function(u){u.Full="full",u.Unchanged="unchanged"})(a||(t.DocumentDiagnosticReportKind=a={}));var s;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(s||(t.DocumentDiagnosticRequest=s={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(o||(t.WorkspaceDiagnosticRequest=o={}));var l;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(l||(t.DiagnosticRefreshRequest=l={}))}}),VUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;var e=(kx(),SI(w3)),r=R9(),n=Zn(),i;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}E(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var a;(function(g){function m(T,b){const w={executionOrder:T};return(b===!0||b===!1)&&(w.success=b),w}E(m,"create"),g.create=m;function y(T){const b=T;return r.objectLiteral(b)&&e.uinteger.is(b.executionOrder)&&(b.success===void 0||r.boolean(b.success))}E(y,"is"),g.is=y;function v(T,b){return T===b?!0:T==null||b===null||b===void 0?!1:T.executionOrder===b.executionOrder&&T.success===b.success}E(v,"equals"),g.equals=v})(a||(t.ExecutionSummary=a={}));var s;(function(g){function m(b,w){return{kind:b,document:w}}E(m,"create"),g.create=m;function y(b){const w=b;return r.objectLiteral(w)&&i.is(w.kind)&&e.DocumentUri.is(w.document)&&(w.metadata===void 0||r.objectLiteral(w.metadata))}E(y,"is"),g.is=y;function v(b,w){const k=new Set;return b.document!==w.document&&k.add("document"),b.kind!==w.kind&&k.add("kind"),b.executionSummary!==w.executionSummary&&k.add("executionSummary"),(b.metadata!==void 0||w.metadata!==void 0)&&!T(b.metadata,w.metadata)&&k.add("metadata"),(b.executionSummary!==void 0||w.executionSummary!==void 0)&&!a.equals(b.executionSummary,w.executionSummary)&&k.add("executionSummary"),k}E(v,"diff"),g.diff=v;function T(b,w){if(b===w)return!0;if(b==null||w===null||w===void 0||typeof b!=typeof w||typeof b!="object")return!1;const k=Array.isArray(b),A=Array.isArray(w);if(k!==A)return!1;if(k&&A){if(b.length!==w.length)return!1;for(let C=0;C0}E(At,"hasId"),oe.hasId=At})(I||(t.StaticRegistrationOptions=I={}));var $;(function(oe){function At(dt){const ut=dt;return ut&&(ut.documentSelector===null||z.is(ut.documentSelector))}E(At,"is"),oe.is=At})($||(t.TextDocumentRegistrationOptions=$={}));var B;(function(oe){function At(ut){const wt=ut;return n.objectLiteral(wt)&&(wt.workDoneProgress===void 0||n.boolean(wt.workDoneProgress))}E(At,"is"),oe.is=At;function dt(ut){const wt=ut;return wt&&n.boolean(wt.workDoneProgress)}E(dt,"hasWorkDoneProgress"),oe.hasWorkDoneProgress=dt})(B||(t.WorkDoneProgressOptions=B={}));var P;(function(oe){oe.method="initialize",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(P||(t.InitializeRequest=P={}));var G;(function(oe){oe.unknownProtocolVersion=1})(G||(t.InitializeErrorCodes=G={}));var V;(function(oe){oe.method="initialized",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(V||(t.InitializedNotification=V={}));var Y;(function(oe){oe.method="shutdown",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType0(oe.method)})(Y||(t.ShutdownRequest=Y={}));var W;(function(oe){oe.method="exit",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType0(oe.method)})(W||(t.ExitNotification=W={}));var ie;(function(oe){oe.method="workspace/didChangeConfiguration",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(ie||(t.DidChangeConfigurationNotification=ie={}));var K;(function(oe){oe.Error=1,oe.Warning=2,oe.Info=3,oe.Log=4,oe.Debug=5})(K||(t.MessageType=K={}));var se;(function(oe){oe.method="window/showMessage",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolNotificationType(oe.method)})(se||(t.ShowMessageNotification=se={}));var J;(function(oe){oe.method="window/showMessageRequest",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolRequestType(oe.method)})(J||(t.ShowMessageRequest=J={}));var Z;(function(oe){oe.method="window/logMessage",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolNotificationType(oe.method)})(Z||(t.LogMessageNotification=Z={}));var ee;(function(oe){oe.method="telemetry/event",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolNotificationType(oe.method)})(ee||(t.TelemetryEventNotification=ee={}));var ne;(function(oe){oe.None=0,oe.Full=1,oe.Incremental=2})(ne||(t.TextDocumentSyncKind=ne={}));var ue;(function(oe){oe.method="textDocument/didOpen",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(ue||(t.DidOpenTextDocumentNotification=ue={}));var fe;(function(oe){function At(ut){let wt=ut;return wt!=null&&typeof wt.text=="string"&&wt.range!==void 0&&(wt.rangeLength===void 0||typeof wt.rangeLength=="number")}E(At,"isIncremental"),oe.isIncremental=At;function dt(ut){let wt=ut;return wt!=null&&typeof wt.text=="string"&&wt.range===void 0&&wt.rangeLength===void 0}E(dt,"isFull"),oe.isFull=dt})(fe||(t.TextDocumentContentChangeEvent=fe={}));var _e;(function(oe){oe.method="textDocument/didChange",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(_e||(t.DidChangeTextDocumentNotification=_e={}));var Ae;(function(oe){oe.method="textDocument/didClose",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(Ae||(t.DidCloseTextDocumentNotification=Ae={}));var Ne;(function(oe){oe.method="textDocument/didSave",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(Ne||(t.DidSaveTextDocumentNotification=Ne={}));var me;(function(oe){oe.Manual=1,oe.AfterDelay=2,oe.FocusOut=3})(me||(t.TextDocumentSaveReason=me={}));var ve;(function(oe){oe.method="textDocument/willSave",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(ve||(t.WillSaveTextDocumentNotification=ve={}));var Ge;(function(oe){oe.method="textDocument/willSaveWaitUntil",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Ge||(t.WillSaveTextDocumentWaitUntilRequest=Ge={}));var Te;(function(oe){oe.method="workspace/didChangeWatchedFiles",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(Te||(t.DidChangeWatchedFilesNotification=Te={}));var Ze;(function(oe){oe.Created=1,oe.Changed=2,oe.Deleted=3})(Ze||(t.FileChangeType=Ze={}));var ke;(function(oe){function At(dt){const ut=dt;return n.objectLiteral(ut)&&(r.URI.is(ut.baseUri)||r.WorkspaceFolder.is(ut.baseUri))&&n.string(ut.pattern)}E(At,"is"),oe.is=At})(ke||(t.RelativePattern=ke={}));var Ve;(function(oe){oe.Create=1,oe.Change=2,oe.Delete=4})(Ve||(t.WatchKind=Ve={}));var Qe;(function(oe){oe.method="textDocument/publishDiagnostics",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolNotificationType(oe.method)})(Qe||(t.PublishDiagnosticsNotification=Qe={}));var nt;(function(oe){oe.Invoked=1,oe.TriggerCharacter=2,oe.TriggerForIncompleteCompletions=3})(nt||(t.CompletionTriggerKind=nt={}));var tt;(function(oe){oe.method="textDocument/completion",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(tt||(t.CompletionRequest=tt={}));var je;(function(oe){oe.method="completionItem/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(je||(t.CompletionResolveRequest=je={}));var Ce;(function(oe){oe.method="textDocument/hover",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Ce||(t.HoverRequest=Ce={}));var Se;(function(oe){oe.Invoked=1,oe.TriggerCharacter=2,oe.ContentChange=3})(Se||(t.SignatureHelpTriggerKind=Se={}));var H;(function(oe){oe.method="textDocument/signatureHelp",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(H||(t.SignatureHelpRequest=H={}));var he;(function(oe){oe.method="textDocument/definition",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(he||(t.DefinitionRequest=he={}));var j;(function(oe){oe.method="textDocument/references",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(j||(t.ReferencesRequest=j={}));var pe;(function(oe){oe.method="textDocument/documentHighlight",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(pe||(t.DocumentHighlightRequest=pe={}));var re;(function(oe){oe.method="textDocument/documentSymbol",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(re||(t.DocumentSymbolRequest=re={}));var Be;(function(oe){oe.method="textDocument/codeAction",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Be||(t.CodeActionRequest=Be={}));var xe;(function(oe){oe.method="codeAction/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(xe||(t.CodeActionResolveRequest=xe={}));var Ue;(function(oe){oe.method="workspace/symbol",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Ue||(t.WorkspaceSymbolRequest=Ue={}));var De;(function(oe){oe.method="workspaceSymbol/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(De||(t.WorkspaceSymbolResolveRequest=De={}));var qe;(function(oe){oe.method="textDocument/codeLens",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(qe||(t.CodeLensRequest=qe={}));var Le;(function(oe){oe.method="codeLens/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Le||(t.CodeLensResolveRequest=Le={}));var Xe;(function(oe){oe.method="workspace/codeLens/refresh",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolRequestType0(oe.method)})(Xe||(t.CodeLensRefreshRequest=Xe={}));var Ie;(function(oe){oe.method="textDocument/documentLink",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Ie||(t.DocumentLinkRequest=Ie={}));var it;(function(oe){oe.method="documentLink/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(it||(t.DocumentLinkResolveRequest=it={}));var we;(function(oe){oe.method="textDocument/formatting",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(we||(t.DocumentFormattingRequest=we={}));var lt;(function(oe){oe.method="textDocument/rangeFormatting",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(lt||(t.DocumentRangeFormattingRequest=lt={}));var be;(function(oe){oe.method="textDocument/rangesFormatting",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(be||(t.DocumentRangesFormattingRequest=be={}));var Et;(function(oe){oe.method="textDocument/onTypeFormatting",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Et||(t.DocumentOnTypeFormattingRequest=Et={}));var vt;(function(oe){oe.Identifier=1})(vt||(t.PrepareSupportDefaultBehavior=vt={}));var ot;(function(oe){oe.method="textDocument/rename",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(ot||(t.RenameRequest=ot={}));var It;(function(oe){oe.method="textDocument/prepareRename",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(It||(t.PrepareRenameRequest=It={}));var xt;(function(oe){oe.method="workspace/executeCommand",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(xt||(t.ExecuteCommandRequest=xt={}));var ht;(function(oe){oe.method="workspace/applyEdit",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolRequestType("workspace/applyEdit")})(ht||(t.ApplyWorkspaceEditRequest=ht={}))}}),HUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var e=eg();function r(n,i,a,s){return e.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,e.createMessageConnection)(n,i,a,s)}E(r,"createProtocolConnection"),t.createProtocolConnection=r}}),YUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:E(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(eg(),t),r((kx(),SI(w3)),t),r(Zn(),t),r(UUe(),t);var n=HUe();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:E(function(){return n.createProtocolConnection},"get")});var i;(function(a){a.lspReservedErrorRangeStart=-32899,a.RequestFailed=-32803,a.ServerCancelled=-32802,a.ContentModified=-32801,a.RequestCancelled=-32800,a.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}}),XUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:E(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=Gte();r(Gte(),t),r(YUe(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}E(i,"createProtocolConnection"),t.createProtocolConnection=i}}),qte={};fh(qte,{AbstractAstReflection:()=>D9,AbstractCstNode:()=>mN,AbstractLangiumParser:()=>vN,AbstractParserErrorMessageProvider:()=>Kde,AbstractThreadedAsyncParser:()=>xnt,AstUtils:()=>M9,BiMap:()=>DE,Cancellation:()=>_n,CompositeCstNodeImpl:()=>xE,ContextCache:()=>NE,CstNodeBuilder:()=>Ude,CstUtils:()=>L9,DEFAULT_TOKENIZE_OPTIONS:()=>FN,DONE_RESULT:()=>ts,DatatypeSymbol:()=>TE,DefaultAstNodeDescriptionProvider:()=>Sfe,DefaultAstNodeLocator:()=>_fe,DefaultAsyncParser:()=>Xfe,DefaultCommentProvider:()=>Yfe,DefaultConfigurationProvider:()=>Rfe,DefaultDocumentBuilder:()=>Lfe,DefaultDocumentValidator:()=>Efe,DefaultHydrator:()=>jfe,DefaultIndexManager:()=>Ife,DefaultJsonSerializer:()=>Tfe,DefaultLangiumDocumentFactory:()=>dfe,DefaultLangiumDocuments:()=>ffe,DefaultLangiumProfiler:()=>Ent,DefaultLexer:()=>zN,DefaultLexerErrorMessageProvider:()=>Mfe,DefaultLinker:()=>pfe,DefaultNameProvider:()=>gfe,DefaultReferenceDescriptionProvider:()=>Afe,DefaultReferences:()=>mfe,DefaultScopeComputation:()=>yfe,DefaultScopeProvider:()=>xfe,DefaultServiceRegistry:()=>wfe,DefaultTokenBuilder:()=>SE,DefaultValueConverter:()=>EN,DefaultWorkspaceLock:()=>Kfe,DefaultWorkspaceManager:()=>Dfe,Deferred:()=>au,Disposable:()=>Ff,DisposableCache:()=>ME,DocumentCache:()=>bfe,DocumentState:()=>zr,DocumentValidator:()=>wo,EMPTY_SCOPE:()=>mnt,EMPTY_STREAM:()=>tg,EmptyFileSystem:()=>ba,EmptyFileSystemProvider:()=>e0e,ErrorWithLocation:()=>rk,GrammarAST:()=>Ute,GrammarUtils:()=>uD,IndentationAwareLexer:()=>wnt,IndentationAwareTokenBuilder:()=>Jfe,JSDocDocumentationProvider:()=>Hfe,LangiumCompletionParser:()=>jde,LangiumParser:()=>Xde,LangiumParserErrorMessageProvider:()=>bN,LeafCstNodeImpl:()=>bE,LexingMode:()=>zf,MapScope:()=>gnt,Module:()=>jN,MultiMap:()=>su,MultiMapScope:()=>vfe,OperationCancelled:()=>Jl,ParserWorker:()=>Tnt,ProfilingTask:()=>r0e,Reduction:()=>Ax,RefResolving:()=>Pf,RegExpUtils:()=>dD,RootCstNodeImpl:()=>yN,SimpleCache:()=>MN,StreamImpl:()=>Vl,StreamScope:()=>DN,TextDocument:()=>LE,TreeStreamImpl:()=>rg,URI:()=>eo,UriTrie:()=>LN,UriUtils:()=>ls,VALIDATE_EACH_NODE:()=>kfe,ValidationCategory:()=>OE,ValidationRegistry:()=>Cfe,ValueConverter:()=>Ql,WorkspaceCache:()=>NN,assertCondition:()=>hD,assertUnreachable:()=>xh,createCompletionParser:()=>wN,createDefaultCoreModule:()=>na,createDefaultSharedCoreModule:()=>ia,createGrammarConfig:()=>ID,createLangiumParser:()=>CN,createParser:()=>CE,delayNextTick:()=>AE,diagnosticData:()=>Bf,eagerLoad:()=>ZN,getDiagnosticRange:()=>PN,indentationBuilderDefaultOptions:()=>eO,inject:()=>Xr,interruptAndCheck:()=>ra,isAstNode:()=>Ii,isAstNodeDescription:()=>I9,isAstNodeWithComment:()=>ON,isCompositeCstNode:()=>Wc,isIMultiModeLexerDefinition:()=>FE,isJSDoc:()=>qN,isLeafCstNode:()=>Kd,isLinkingError:()=>Xd,isMultiReference:()=>ql,isNamed:()=>IN,isOperationCancelled:()=>$f,isReference:()=>es,isRootCstNode:()=>I3,isTokenTypeArray:()=>BE,isTokenTypeDictionary:()=>zE,loadGrammarFromJson:()=>aa,parseJSDoc:()=>GN,prepareLangiumParser:()=>kN,setInterruptionPeriod:()=>SN,startCancelableOperation:()=>RE,stream:()=>pn,toDiagnosticData:()=>BN,toDiagnosticSeverity:()=>RT});var L9={};fh(L9,{DefaultNameRegexp:()=>iD,RangeComparison:()=>Ul,compareRange:()=>rD,findCommentNode:()=>aD,findDeclarationNodeAtOffset:()=>ure,findLeafNodeAtOffset:()=>tk,findLeafNodeBeforeOffset:()=>sD,flattenCst:()=>cre,getDatatypeNode:()=>lre,getInteriorNodes:()=>fre,getNextNode:()=>hre,getPreviousNode:()=>lD,getStartlineNode:()=>dre,inRange:()=>nD,isChildNode:()=>tD,isCommentNode:()=>ek,streamCst:()=>pg,toDocumentSegment:()=>gg,tokenToRange:()=>Bx});function Ii(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}E(Ii,"isAstNode");function es(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}E(es,"isReference");function ql(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}E(ql,"isMultiReference");function I9(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}E(I9,"isAstNodeDescription");function Xd(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}E(Xd,"isLinkingError");var D9=(Nm=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return Ii(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}},E(Nm,"AbstractAstReflection"),Nm);function Wc(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}E(Wc,"isCompositeCstNode");function Kd(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}E(Kd,"isLeafCstNode");function I3(t){return Wc(t)&&typeof t.fullText=="string"}E(I3,"isRootCstNode");var Vl=(Ns=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:E(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new Ns(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return ts})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=Vte(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new Ns(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?ts:{done:!1,value:e(i)}})}filter(e){return new Ns(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return ts})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new Ns(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(Sx(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return ts})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new Ns(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(Sx(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return ts})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new Ns(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?ts:this.nextFn(r.state)))}distinct(e){return new Ns(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return ts})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}},E(Ns,"StreamImpl"),Ns);function Vte(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}E(Vte,"toString");function Sx(t){return!!t&&typeof t[Symbol.iterator]=="function"}E(Sx,"isIterable");var tg=new Vl(()=>{},()=>ts),ts=Object.freeze({done:!0,value:void 0});function pn(...t){if(t.length===1){const e=t[0];if(e instanceof Vl)return e;if(Sx(e))return new Vl(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Vl(()=>({index:0}),r=>r.index1?new Vl(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return ts})}iterator(){const e={state:this.startFn(),next:E(()=>this.nextFn(e.state),"next"),prune:E(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},E(Om,"TreeStreamImpl"),Om),Ax;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}E(e,"sum"),t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}E(r,"product"),t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}E(n,"min"),t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}E(i,"max"),t.max=i})(Ax||(Ax={}));var M9={};fh(M9,{assignMandatoryProperties:()=>N9,copyAstNode:()=>N3,findRootNode:()=>ig,getContainerOfType:()=>jd,getDocument:()=>qo,getReferenceNodes:()=>D3,hasContainerOfType:()=>Wte,linkContentToContainer:()=>ng,streamAllContents:()=>Uc,streamAst:()=>Vo,streamContents:()=>_x,streamReferences:()=>ag});function ng(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Ii(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&ng(i,e))}):Ii(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&ng(n,e)))}E(ng,"linkContentToContainer");function jd(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}E(jd,"getContainerOfType");function Wte(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}E(Wte,"hasContainerOfType");function qo(t){const r=ig(t).$document;if(!r)throw new Error("AST node has no document.");return r}E(qo,"getDocument");function ig(t){for(;t.$container;)t=t.$container;return t}E(ig,"findRootNode");function D3(t){return es(t)?t.ref?[t.ref]:[]:ql(t)?t.items.map(e=>e.ref):[]}E(D3,"getReferenceNodes");function _x(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new Vl(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex_x(r,e))}E(Uc,"streamAllContents");function Vo(t,e){if(t){if(e!=null&&e.range&&!M3(t,e.range))return new rg(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new rg(t,r=>_x(r,e),{includeRoot:!0})}E(Vo,"streamAst");function M3(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?nD(r,e):!1}E(M3,"isAstNodeInRange");function ag(t){return new Vl(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexks,AbstractParserRule:()=>Rx,AbstractRule:()=>sg,AbstractType:()=>Xs,Action:()=>ph,Alternatives:()=>Lx,ArrayLiteral:()=>P3,ArrayType:()=>B3,Assignment:()=>mh,BooleanLiteral:()=>F3,CharacterRange:()=>yh,Condition:()=>vh,Conjunction:()=>Ix,CrossReference:()=>bh,Disjunction:()=>Dx,EndOfFile:()=>z3,Grammar:()=>Yc,GrammarImport:()=>G3,Group:()=>Jd,InferredType:()=>q3,InfixRule:()=>Wl,InfixRuleOperatorList:()=>Nx,InfixRuleOperators:()=>V3,Interface:()=>lg,Keyword:()=>cg,LangiumGrammarAstReflection:()=>eD,LangiumGrammarTerminals:()=>KUe,NamedArgument:()=>ug,NegatedToken:()=>tf,Negation:()=>W3,NumberLiteral:()=>U3,Parameter:()=>hg,ParameterReference:()=>H3,ParserRule:()=>Wo,ReferenceType:()=>Ox,RegexToken:()=>rf,ReturnType:()=>Y3,RuleCall:()=>nf,SimpleType:()=>dg,StringLiteral:()=>K3,TerminalAlternatives:()=>af,TerminalElement:()=>Es,TerminalGroup:()=>sf,TerminalRule:()=>jc,TerminalRuleCall:()=>of,Type:()=>$x,TypeAttribute:()=>lf,TypeDefinition:()=>cf,UnionType:()=>Q3,UnorderedGroup:()=>Px,UntilToken:()=>uf,ValueLiteral:()=>hf,Wildcard:()=>fg,isAbstractElement:()=>O3,isAbstractParserRule:()=>Zd,isAbstractRule:()=>Hte,isAbstractType:()=>Yte,isAction:()=>gh,isAlternatives:()=>$3,isArrayLiteral:()=>Xte,isArrayType:()=>$9,isAssignment:()=>Hc,isBooleanLiteral:()=>P9,isCharacterRange:()=>B9,isCondition:()=>Kte,isConjunction:()=>F9,isCrossReference:()=>Qd,isDisjunction:()=>z9,isEndOfFile:()=>G9,isGrammar:()=>jte,isGrammarImport:()=>Zte,isGroup:()=>ef,isInferredType:()=>Mx,isInfixRule:()=>og,isInfixRuleOperatorList:()=>Qte,isInfixRuleOperators:()=>Jte,isInterface:()=>q9,isKeyword:()=>Xc,isNamedArgument:()=>ere,isNegatedToken:()=>V9,isNegation:()=>W9,isNumberLiteral:()=>tre,isParameter:()=>rre,isParameterReference:()=>U9,isParserRule:()=>rs,isReferenceType:()=>H9,isRegexToken:()=>Y9,isReturnType:()=>X9,isRuleCall:()=>Kc,isSimpleType:()=>X3,isStringLiteral:()=>nre,isTerminalAlternatives:()=>K9,isTerminalElement:()=>ire,isTerminalGroup:()=>j9,isTerminalRule:()=>yo,isTerminalRuleCall:()=>j3,isType:()=>Z3,isTypeAttribute:()=>are,isTypeDefinition:()=>sre,isUnionType:()=>Z9,isUnorderedGroup:()=>J3,isUntilToken:()=>Q9,isValueLiteral:()=>ore,isWildcard:()=>J9,reflection:()=>vr});var KUe={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},ks={$type:"AbstractElement",cardinality:"cardinality"};function O3(t){return vr.isInstance(t,ks.$type)}E(O3,"isAbstractElement");var Rx={$type:"AbstractParserRule"};function Zd(t){return vr.isInstance(t,Rx.$type)}E(Zd,"isAbstractParserRule");var sg={$type:"AbstractRule"};function Hte(t){return vr.isInstance(t,sg.$type)}E(Hte,"isAbstractRule");var Xs={$type:"AbstractType"};function Yte(t){return vr.isInstance(t,Xs.$type)}E(Yte,"isAbstractType");var ph={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function gh(t){return vr.isInstance(t,ph.$type)}E(gh,"isAction");var Lx={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function $3(t){return vr.isInstance(t,Lx.$type)}E($3,"isAlternatives");var P3={$type:"ArrayLiteral",elements:"elements"};function Xte(t){return vr.isInstance(t,P3.$type)}E(Xte,"isArrayLiteral");var B3={$type:"ArrayType",elementType:"elementType"};function $9(t){return vr.isInstance(t,B3.$type)}E($9,"isArrayType");var mh={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Hc(t){return vr.isInstance(t,mh.$type)}E(Hc,"isAssignment");var F3={$type:"BooleanLiteral",true:"true"};function P9(t){return vr.isInstance(t,F3.$type)}E(P9,"isBooleanLiteral");var yh={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function B9(t){return vr.isInstance(t,yh.$type)}E(B9,"isCharacterRange");var vh={$type:"Condition"};function Kte(t){return vr.isInstance(t,vh.$type)}E(Kte,"isCondition");var Ix={$type:"Conjunction",left:"left",right:"right"};function F9(t){return vr.isInstance(t,Ix.$type)}E(F9,"isConjunction");var bh={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Qd(t){return vr.isInstance(t,bh.$type)}E(Qd,"isCrossReference");var Dx={$type:"Disjunction",left:"left",right:"right"};function z9(t){return vr.isInstance(t,Dx.$type)}E(z9,"isDisjunction");var z3={$type:"EndOfFile",cardinality:"cardinality"};function G9(t){return vr.isInstance(t,z3.$type)}E(G9,"isEndOfFile");var Yc={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function jte(t){return vr.isInstance(t,Yc.$type)}E(jte,"isGrammar");var G3={$type:"GrammarImport",path:"path"};function Zte(t){return vr.isInstance(t,G3.$type)}E(Zte,"isGrammarImport");var Jd={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function ef(t){return vr.isInstance(t,Jd.$type)}E(ef,"isGroup");var q3={$type:"InferredType",name:"name"};function Mx(t){return vr.isInstance(t,q3.$type)}E(Mx,"isInferredType");var Wl={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function og(t){return vr.isInstance(t,Wl.$type)}E(og,"isInfixRule");var Nx={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function Qte(t){return vr.isInstance(t,Nx.$type)}E(Qte,"isInfixRuleOperatorList");var V3={$type:"InfixRuleOperators",precedences:"precedences"};function Jte(t){return vr.isInstance(t,V3.$type)}E(Jte,"isInfixRuleOperators");var lg={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function q9(t){return vr.isInstance(t,lg.$type)}E(q9,"isInterface");var cg={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Xc(t){return vr.isInstance(t,cg.$type)}E(Xc,"isKeyword");var ug={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function ere(t){return vr.isInstance(t,ug.$type)}E(ere,"isNamedArgument");var tf={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function V9(t){return vr.isInstance(t,tf.$type)}E(V9,"isNegatedToken");var W3={$type:"Negation",value:"value"};function W9(t){return vr.isInstance(t,W3.$type)}E(W9,"isNegation");var U3={$type:"NumberLiteral",value:"value"};function tre(t){return vr.isInstance(t,U3.$type)}E(tre,"isNumberLiteral");var hg={$type:"Parameter",name:"name"};function rre(t){return vr.isInstance(t,hg.$type)}E(rre,"isParameter");var H3={$type:"ParameterReference",parameter:"parameter"};function U9(t){return vr.isInstance(t,H3.$type)}E(U9,"isParameterReference");var Wo={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function rs(t){return vr.isInstance(t,Wo.$type)}E(rs,"isParserRule");var Ox={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function H9(t){return vr.isInstance(t,Ox.$type)}E(H9,"isReferenceType");var rf={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Y9(t){return vr.isInstance(t,rf.$type)}E(Y9,"isRegexToken");var Y3={$type:"ReturnType",name:"name"};function X9(t){return vr.isInstance(t,Y3.$type)}E(X9,"isReturnType");var nf={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Kc(t){return vr.isInstance(t,nf.$type)}E(Kc,"isRuleCall");var dg={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function X3(t){return vr.isInstance(t,dg.$type)}E(X3,"isSimpleType");var K3={$type:"StringLiteral",value:"value"};function nre(t){return vr.isInstance(t,K3.$type)}E(nre,"isStringLiteral");var af={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function K9(t){return vr.isInstance(t,af.$type)}E(K9,"isTerminalAlternatives");var Es={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function ire(t){return vr.isInstance(t,Es.$type)}E(ire,"isTerminalElement");var sf={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function j9(t){return vr.isInstance(t,sf.$type)}E(j9,"isTerminalGroup");var jc={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function yo(t){return vr.isInstance(t,jc.$type)}E(yo,"isTerminalRule");var of={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function j3(t){return vr.isInstance(t,of.$type)}E(j3,"isTerminalRuleCall");var $x={$type:"Type",name:"name",type:"type"};function Z3(t){return vr.isInstance(t,$x.$type)}E(Z3,"isType");var lf={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function are(t){return vr.isInstance(t,lf.$type)}E(are,"isTypeAttribute");var cf={$type:"TypeDefinition"};function sre(t){return vr.isInstance(t,cf.$type)}E(sre,"isTypeDefinition");var Q3={$type:"UnionType",types:"types"};function Z9(t){return vr.isInstance(t,Q3.$type)}E(Z9,"isUnionType");var Px={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function J3(t){return vr.isInstance(t,Px.$type)}E(J3,"isUnorderedGroup");var uf={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Q9(t){return vr.isInstance(t,uf.$type)}E(Q9,"isUntilToken");var hf={$type:"ValueLiteral"};function ore(t){return vr.isInstance(t,hf.$type)}E(ore,"isValueLiteral");var fg={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function J9(t){return vr.isInstance(t,fg.$type)}E(J9,"isWildcard");var eD=($m=class extends D9{constructor(){super(...arguments),this.types={AbstractElement:{name:ks.$type,properties:{cardinality:{name:ks.cardinality}},superTypes:[]},AbstractParserRule:{name:Rx.$type,properties:{},superTypes:[sg.$type,Xs.$type]},AbstractRule:{name:sg.$type,properties:{},superTypes:[]},AbstractType:{name:Xs.$type,properties:{},superTypes:[]},Action:{name:ph.$type,properties:{cardinality:{name:ph.cardinality},feature:{name:ph.feature},inferredType:{name:ph.inferredType},operator:{name:ph.operator},type:{name:ph.type,referenceType:Xs.$type}},superTypes:[ks.$type]},Alternatives:{name:Lx.$type,properties:{cardinality:{name:Lx.cardinality},elements:{name:Lx.elements,defaultValue:[]}},superTypes:[ks.$type]},ArrayLiteral:{name:P3.$type,properties:{elements:{name:P3.elements,defaultValue:[]}},superTypes:[hf.$type]},ArrayType:{name:B3.$type,properties:{elementType:{name:B3.elementType}},superTypes:[cf.$type]},Assignment:{name:mh.$type,properties:{cardinality:{name:mh.cardinality},feature:{name:mh.feature},operator:{name:mh.operator},predicate:{name:mh.predicate},terminal:{name:mh.terminal}},superTypes:[ks.$type]},BooleanLiteral:{name:F3.$type,properties:{true:{name:F3.true,defaultValue:!1}},superTypes:[vh.$type,hf.$type]},CharacterRange:{name:yh.$type,properties:{cardinality:{name:yh.cardinality},left:{name:yh.left},lookahead:{name:yh.lookahead},parenthesized:{name:yh.parenthesized,defaultValue:!1},right:{name:yh.right}},superTypes:[Es.$type]},Condition:{name:vh.$type,properties:{},superTypes:[]},Conjunction:{name:Ix.$type,properties:{left:{name:Ix.left},right:{name:Ix.right}},superTypes:[vh.$type]},CrossReference:{name:bh.$type,properties:{cardinality:{name:bh.cardinality},deprecatedSyntax:{name:bh.deprecatedSyntax,defaultValue:!1},isMulti:{name:bh.isMulti,defaultValue:!1},terminal:{name:bh.terminal},type:{name:bh.type,referenceType:Xs.$type}},superTypes:[ks.$type]},Disjunction:{name:Dx.$type,properties:{left:{name:Dx.left},right:{name:Dx.right}},superTypes:[vh.$type]},EndOfFile:{name:z3.$type,properties:{cardinality:{name:z3.cardinality}},superTypes:[ks.$type]},Grammar:{name:Yc.$type,properties:{imports:{name:Yc.imports,defaultValue:[]},interfaces:{name:Yc.interfaces,defaultValue:[]},isDeclared:{name:Yc.isDeclared,defaultValue:!1},name:{name:Yc.name},rules:{name:Yc.rules,defaultValue:[]},types:{name:Yc.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:G3.$type,properties:{path:{name:G3.path}},superTypes:[]},Group:{name:Jd.$type,properties:{cardinality:{name:Jd.cardinality},elements:{name:Jd.elements,defaultValue:[]},guardCondition:{name:Jd.guardCondition},predicate:{name:Jd.predicate}},superTypes:[ks.$type]},InferredType:{name:q3.$type,properties:{name:{name:q3.name}},superTypes:[Xs.$type]},InfixRule:{name:Wl.$type,properties:{call:{name:Wl.call},dataType:{name:Wl.dataType},inferredType:{name:Wl.inferredType},name:{name:Wl.name},operators:{name:Wl.operators},parameters:{name:Wl.parameters,defaultValue:[]},returnType:{name:Wl.returnType,referenceType:Xs.$type}},superTypes:[Rx.$type]},InfixRuleOperatorList:{name:Nx.$type,properties:{associativity:{name:Nx.associativity},operators:{name:Nx.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:V3.$type,properties:{precedences:{name:V3.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:lg.$type,properties:{attributes:{name:lg.attributes,defaultValue:[]},name:{name:lg.name},superTypes:{name:lg.superTypes,defaultValue:[],referenceType:Xs.$type}},superTypes:[Xs.$type]},Keyword:{name:cg.$type,properties:{cardinality:{name:cg.cardinality},predicate:{name:cg.predicate},value:{name:cg.value}},superTypes:[ks.$type]},NamedArgument:{name:ug.$type,properties:{calledByName:{name:ug.calledByName,defaultValue:!1},parameter:{name:ug.parameter,referenceType:hg.$type},value:{name:ug.value}},superTypes:[]},NegatedToken:{name:tf.$type,properties:{cardinality:{name:tf.cardinality},lookahead:{name:tf.lookahead},parenthesized:{name:tf.parenthesized,defaultValue:!1},terminal:{name:tf.terminal}},superTypes:[Es.$type]},Negation:{name:W3.$type,properties:{value:{name:W3.value}},superTypes:[vh.$type]},NumberLiteral:{name:U3.$type,properties:{value:{name:U3.value}},superTypes:[hf.$type]},Parameter:{name:hg.$type,properties:{name:{name:hg.name}},superTypes:[]},ParameterReference:{name:H3.$type,properties:{parameter:{name:H3.parameter,referenceType:hg.$type}},superTypes:[vh.$type]},ParserRule:{name:Wo.$type,properties:{dataType:{name:Wo.dataType},definition:{name:Wo.definition},entry:{name:Wo.entry,defaultValue:!1},fragment:{name:Wo.fragment,defaultValue:!1},inferredType:{name:Wo.inferredType},name:{name:Wo.name},parameters:{name:Wo.parameters,defaultValue:[]},returnType:{name:Wo.returnType,referenceType:Xs.$type}},superTypes:[Rx.$type]},ReferenceType:{name:Ox.$type,properties:{isMulti:{name:Ox.isMulti,defaultValue:!1},referenceType:{name:Ox.referenceType}},superTypes:[cf.$type]},RegexToken:{name:rf.$type,properties:{cardinality:{name:rf.cardinality},lookahead:{name:rf.lookahead},parenthesized:{name:rf.parenthesized,defaultValue:!1},regex:{name:rf.regex}},superTypes:[Es.$type]},ReturnType:{name:Y3.$type,properties:{name:{name:Y3.name}},superTypes:[]},RuleCall:{name:nf.$type,properties:{arguments:{name:nf.arguments,defaultValue:[]},cardinality:{name:nf.cardinality},predicate:{name:nf.predicate},rule:{name:nf.rule,referenceType:sg.$type}},superTypes:[ks.$type]},SimpleType:{name:dg.$type,properties:{primitiveType:{name:dg.primitiveType},stringType:{name:dg.stringType},typeRef:{name:dg.typeRef,referenceType:Xs.$type}},superTypes:[cf.$type]},StringLiteral:{name:K3.$type,properties:{value:{name:K3.value}},superTypes:[hf.$type]},TerminalAlternatives:{name:af.$type,properties:{cardinality:{name:af.cardinality},elements:{name:af.elements,defaultValue:[]},lookahead:{name:af.lookahead},parenthesized:{name:af.parenthesized,defaultValue:!1}},superTypes:[Es.$type]},TerminalElement:{name:Es.$type,properties:{cardinality:{name:Es.cardinality},lookahead:{name:Es.lookahead},parenthesized:{name:Es.parenthesized,defaultValue:!1}},superTypes:[ks.$type]},TerminalGroup:{name:sf.$type,properties:{cardinality:{name:sf.cardinality},elements:{name:sf.elements,defaultValue:[]},lookahead:{name:sf.lookahead},parenthesized:{name:sf.parenthesized,defaultValue:!1}},superTypes:[Es.$type]},TerminalRule:{name:jc.$type,properties:{definition:{name:jc.definition},fragment:{name:jc.fragment,defaultValue:!1},hidden:{name:jc.hidden,defaultValue:!1},name:{name:jc.name},type:{name:jc.type}},superTypes:[sg.$type]},TerminalRuleCall:{name:of.$type,properties:{cardinality:{name:of.cardinality},lookahead:{name:of.lookahead},parenthesized:{name:of.parenthesized,defaultValue:!1},rule:{name:of.rule,referenceType:jc.$type}},superTypes:[Es.$type]},Type:{name:$x.$type,properties:{name:{name:$x.name},type:{name:$x.type}},superTypes:[Xs.$type]},TypeAttribute:{name:lf.$type,properties:{defaultValue:{name:lf.defaultValue},isOptional:{name:lf.isOptional,defaultValue:!1},name:{name:lf.name},type:{name:lf.type}},superTypes:[]},TypeDefinition:{name:cf.$type,properties:{},superTypes:[]},UnionType:{name:Q3.$type,properties:{types:{name:Q3.types,defaultValue:[]}},superTypes:[cf.$type]},UnorderedGroup:{name:Px.$type,properties:{cardinality:{name:Px.cardinality},elements:{name:Px.elements,defaultValue:[]}},superTypes:[ks.$type]},UntilToken:{name:uf.$type,properties:{cardinality:{name:uf.cardinality},lookahead:{name:uf.lookahead},parenthesized:{name:uf.parenthesized,defaultValue:!1},terminal:{name:uf.terminal}},superTypes:[Es.$type]},ValueLiteral:{name:hf.$type,properties:{},superTypes:[]},Wildcard:{name:fg.$type,properties:{cardinality:{name:fg.cardinality},lookahead:{name:fg.lookahead},parenthesized:{name:fg.parenthesized,defaultValue:!1}},superTypes:[Es.$type]}}}},E($m,"LangiumGrammarAstReflection"),$m),vr=new eD;function lre(t){let e=t,r=!1;for(;e;){const n=jd(e.grammarSource,rs);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}E(lre,"getDatatypeNode");function pg(t){return new rg(t,e=>Wc(e)?e.content:[],{includeRoot:!0})}E(pg,"streamCst");function cre(t){return pg(t).filter(Kd)}E(cre,"flattenCst");function tD(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}E(tD,"isChildNode");function Bx(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}E(Bx,"tokenToRange");function gg(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}E(gg,"toDocumentSegment");var Ul;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(Ul||(Ul={}));function rD(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Ul.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.lineUl.After}E(nD,"inRange");var iD=/^[\w\p{L}]$/u;function ure(t,e,r=iD){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return tk(t,e)}}E(ure,"findDeclarationNodeAtOffset");function aD(t,e){if(t){const r=lD(t,!0);if(r&&ek(r,e))return r;if(I3(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(ek(a,e))return a}}}}E(aD,"findCommentNode");function ek(t,e){return Kd(t)&&e.includes(t.tokenType.name)}E(ek,"isCommentNode");function tk(t,e){if(Kd(t))return t;if(Wc(t)){const r=oD(t,e,!1);if(r)return tk(r,e)}}E(tk,"findLeafNodeAtOffset");function sD(t,e){if(Kd(t))return t;if(Wc(t)){const r=oD(t,e,!0);if(r)return sD(r,e)}}E(sD,"findLeafNodeBeforeOffset");function oD(t,e,r){let n=0,i=t.content.length-1,a;for(;n<=i;){const s=Math.floor((n+i)/2),o=t.content[s];if(o.offset<=e&&o.end>e)return o;o.end<=e?(a=r?o:void 0,n=s+1):i=s-1}return a}E(oD,"binarySearch");function lD(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}E(lD,"getPreviousNode");function hre(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nkD,findNameAssignment:()=>fk,findNodeForKeyword:()=>CD,findNodeForProperty:()=>uk,findNodesForKeyword:()=>Cre,findNodesForKeywordInternal:()=>dk,findNodesForProperty:()=>wD,getActionAtElement:()=>SD,getActionType:()=>_D,getAllReachableRules:()=>ck,getAllRulesUsedForCrossReferences:()=>wre,getCrossReferenceTerminal:()=>xD,getEntryRule:()=>yD,getExplicitRuleType:()=>zx,getHiddenRules:()=>vD,getRuleType:()=>RD,getRuleTypeName:()=>_re,getTypeName:()=>pf,isArrayCardinality:()=>Ere,isArrayOperator:()=>Sre,isCommentTerminal:()=>TD,isDataType:()=>Are,isDataTypeRule:()=>Fx,isOptionalCardinality:()=>kre,terminalRegex:()=>Gx});var rk=(Pm=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},E(Pm,"ErrorWithLocation"),Pm);function xh(t,e="Error: Got unexpected value."){throw new Error(e)}E(xh,"assertUnreachable");function hD(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}E(hD,"assertCondition");var dD={};fh(dD,{NEWLINE_REGEXP:()=>vre,escapeRegExp:()=>yg,getTerminalParts:()=>xre,isMultilineComment:()=>pD,isWhitespace:()=>lk,partialMatches:()=>gD,partialRegExp:()=>mD,whitespaceCharacters:()=>Tre});function Cr(t){return t.charCodeAt(0)}E(Cr,"cc");function nk(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}E(nk,"insertToSet");function mg(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}E(mg,"addFlag");function df(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}E(df,"ASSERT_EXISTS");function gre(){throw Error("Internal Error - Should never get here!")}E(gre,"ASSERT_NEVER_REACH_HERE");function fD(t){return t.type==="Character"}E(fD,"isCharacter");var ik=[];for(let t=Cr("0");t<=Cr("9");t++)ik.push(t);var ak=[Cr("_")].concat(ik);for(let t=Cr("a");t<=Cr("z");t++)ak.push(t);for(let t=Cr("A");t<=Cr("Z");t++)ak.push(t);var mre=[Cr(" "),Cr("\f"),Cr(` -`),Cr("\r"),Cr(" "),Cr("\v"),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr("\u2028"),Cr("\u2029"),Cr(" "),Cr(" "),Cr(" "),Cr("\uFEFF")],jUe=/[0-9a-fA-F]/,sk=/[0-9]/,ZUe=/[1-9]/,yre=(Bm=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const r=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":mg(n,"global");break;case"i":mg(n,"ignoreCase");break;case"m":mg(n,"multiLine");break;case"u":mg(n,"unicode");break;case"y":mg(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){const e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){const e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}df(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return gre()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;df(r);break}if(!(e===!0&&r===void 0)&&df(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e;const r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),df(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Cr(` -`),Cr("\r"),Cr("\u2028"),Cr("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=ik;break;case"D":e=ik,r=!0;break;case"s":e=mre;break;case"S":e=mre,r=!0;break;case"w":e=ak;break;case"W":e=ak,r=!0;break}if(df(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Cr("\f");break;case"n":e=Cr(` +`)),et){const _t=ye.error?` Request failed: ${ye.error.message} (${ye.error.code}).`:"";Ae.log(`Received response '${et.method} - (${ye.id})' in ${Date.now()-et.timerStart}ms.${_t}`,ct)}else Ae.log(`Received response ${ye.id} without active response promise.`,ct)}else ot("receive-response",ye)}E(vt,"traceReceivedResponse");function ot(ye,et){if(!Ae||fe===f.Off)return;const ct={isLSPMessage:!0,type:ye,message:et,timestamp:Date.now()};Ae.log(ct)}E(ot,"logLSPMessage");function It(){if(Se())throw new x(v.Closed,"Connection is closed.");if(H())throw new x(v.Disposed,"Connection is disposed.")}E(It,"throwIfClosedOrDisposed");function xt(){if(Ce())throw new x(v.AlreadyListening,"Connection is already listening")}E(xt,"throwIfListening");function ht(){if(!Ce())throw new Error("Call listen() first.")}E(ht,"throwIfNotListening");function oe(ye){return ye===void 0?null:ye}E(oe,"undefinedToNull");function At(ye){if(ye!==null)return ye}E(At,"nullToUndefined");function dt(ye){return ye!=null&&!Array.isArray(ye)&&typeof ye=="object"}E(dt,"isNamedParam");function ut(ye,et){switch(ye){case n.ParameterStructures.auto:return dt(et)?At(et):[oe(et)];case n.ParameterStructures.byName:if(!dt(et))throw new Error("Received parameters by name but param is not an object literal.");return At(et);case n.ParameterStructures.byPosition:return[oe(et)];default:throw new Error(`Unknown parameter structure ${ye.toString()}`)}}E(ut,"computeSingleParam");function wt(ye,et){let ct;const _t=ye.numberOfParams;switch(_t){case 0:ct=void 0;break;case 1:ct=ut(ye.parameterStructures,et[0]);break;default:ct=[];for(let Ft=0;Ft{It();let ct,_t;if(r.string(ye)){ct=ye;const nr=et[0];let ir=0,_r=n.ParameterStructures.auto;n.ParameterStructures.is(nr)&&(ir=1,_r=nr);let or=et.length;const Rr=or-ir;switch(Rr){case 0:_t=void 0;break;case 1:_t=ut(_r,et[ir]);break;default:if(_r===n.ParameterStructures.byName)throw new Error(`Received ${Rr} parameters for 'by Name' notification parameter structure.`);_t=et.slice(ir,or).map(Jt=>oe(Jt));break}}else{const nr=et;ct=ye.method,_t=wt(ye,nr)}const Ft={jsonrpc:V,method:ct,params:_t};return we(Ft),N.write(Ft).catch(nr=>{throw $.error("Sending notification failed."),nr})},"sendNotification"),onNotification:E((ye,et)=>{It();let ct;return r.func(ye)?ie=ye:et&&(r.string(ye)?(ct=ye,K.set(ye,{type:void 0,handler:et})):(ct=ye.method,K.set(ye.method,{type:ye,handler:et}))),{dispose:E(()=>{ct!==void 0?K.delete(ct):ie=void 0},"dispose")}},"onNotification"),onProgress:E((ye,et,ct)=>{if(se.has(et))throw new Error(`Progress handler for token ${et} already registered`);return se.set(et,ct),{dispose:E(()=>{se.delete(et)},"dispose")}},"onProgress"),sendProgress:E((ye,et,ct)=>Mr.sendNotification(u.type,{token:et,value:ct}),"sendProgress"),onUnhandledProgress:Te.event,sendRequest:E((ye,...et)=>{It(),ht();let ct,_t,Ft;if(r.string(ye)){ct=ye;const or=et[0],Rr=et[et.length-1];let Jt=0,Nr=n.ParameterStructures.auto;n.ParameterStructures.is(or)&&(Jt=1,Nr=or);let gn=et.length;s.CancellationToken.is(Rr)&&(gn=gn-1,Ft=Rr);const $r=gn-Jt;switch($r){case 0:_t=void 0;break;case 1:_t=ut(Nr,et[Jt]);break;default:if(Nr===n.ParameterStructures.byName)throw new Error(`Received ${$r} parameters for 'by Name' request parameter structure.`);_t=et.slice(Jt,gn).map(Pa=>oe(Pa));break}}else{const or=et;ct=ye.method,_t=wt(ye,or);const Rr=ye.numberOfParams;Ft=s.CancellationToken.is(or[Rr])?or[Rr]:void 0}const nr=B++;let ir;Ft&&(ir=Ft.onCancellationRequested(()=>{const or=ke.sender.sendCancellation(Mr,nr);return or===void 0?($.log(`Received no promise from cancellation strategy when cancelling id ${nr}`),Promise.resolve()):or.catch(()=>{$.log(`Sending cancellation messages for id ${nr} failed`)})}));const _r={jsonrpc:V,id:nr,method:ct,params:_t};return it(_r),typeof ke.sender.enableCancellation=="function"&&ke.sender.enableCancellation(_r),new Promise(async(or,Rr)=>{const Jt=E($r=>{or($r),ke.sender.cleanup(nr),ir==null||ir.dispose()},"resolveWithCleanup"),Nr=E($r=>{Rr($r),ke.sender.cleanup(nr),ir==null||ir.dispose()},"rejectWithCleanup"),gn={method:ct,timerStart:Date.now(),resolve:Jt,reject:Nr};try{await N.write(_r),ee.set(nr,gn)}catch($r){throw $.error("Sending request failed."),gn.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,$r.message?$r.message:"Unknown reason")),$r}})},"sendRequest"),onRequest:E((ye,et)=>{It();let ct=null;return d.is(ye)?(ct=void 0,X=ye):r.string(ye)?(ct=null,et!==void 0&&(ct=ye,W.set(ye,{handler:et,type:void 0}))):et!==void 0&&(ct=ye.method,W.set(ye.method,{type:ye,handler:et})),{dispose:E(()=>{ct!==null&&(ct!==void 0?W.delete(ct):X=void 0)},"dispose")}},"onRequest"),hasPendingResponse:E(()=>ee.size>0,"hasPendingResponse"),trace:E(async(ye,et,ct)=>{let _t=!1,Ft=g.Text;ct!==void 0&&(r.boolean(ct)?_t=ct:(_t=ct.sendNotification||!1,Ft=ct.traceFormat||g.Text)),fe=ye,_e=Ft,fe===f.Off?Ae=void 0:Ae=et,_t&&!Se()&&!H()&&await Mr.sendNotification(m.type,{value:f.toString(ye)})},"trace"),onError:me.event,onClose:ve.event,onUnhandledNotification:Ge.event,onDispose:Ze.event,end:E(()=>{N.end()},"end"),dispose:E(()=>{if(H())return;Ne=M.Disposed,Ze.fire(void 0);const ye=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const et of ee.values())et.reject(ye);ee=new Map,ue=new Map,ne=new Set,Z=new i.LinkedMap,r.func(N.dispose)&&N.dispose(),r.func(R.dispose)&&R.dispose()},"dispose"),listen:E(()=>{It(),xt(),Ne=M.Listening,R.listen(Ue)},"listen"),inspect:E(()=>{(0,e.default)().console.log("inspect")},"inspect")};return Mr.onNotification(y.type,ye=>{if(fe===f.Off||!Ae)return;const et=fe===f.Verbose||fe===f.Compact;Ae.log(ye.message,et?ye.verbose:void 0)}),Mr.onNotification(u.type,ye=>{const et=se.get(ye.token);et?et(ye.value):Te.fire(ye)}),Mr}E(z,"createMessageConnection"),t.createMessageConnection=z}}),M9=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;var e=Wte();Object.defineProperty(t,"Message",{enumerable:!0,get:E(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:E(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:E(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:E(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:E(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:E(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:E(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:E(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:E(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:E(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:E(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:E(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:E(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:E(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:E(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:E(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:E(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:E(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:E(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:E(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:E(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:E(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:E(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:E(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:E(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:E(function(){return e.ParameterStructures},"get")});var r=Ute();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:E(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:E(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:E(function(){return r.Touch},"get")});var n=LUe();Object.defineProperty(t,"Disposable",{enumerable:!0,get:E(function(){return n.Disposable},"get")});var i=eg();Object.defineProperty(t,"Event",{enumerable:!0,get:E(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:E(function(){return i.Emitter},"get")});var a=M3();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:E(function(){return a.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:E(function(){return a.CancellationToken},"get")});var s=IUe();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:E(function(){return s.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:E(function(){return s.SharedArrayReceiverStrategy},"get")});var o=DUe();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:E(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:E(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:E(function(){return o.ReadableStreamMessageReader},"get")});var l=MUe();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:E(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:E(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:E(function(){return l.WriteableStreamMessageWriter},"get")});var u=NUe();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:E(function(){return u.AbstractMessageBuffer},"get")});var h=OUe();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:E(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:E(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:E(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:E(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:E(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:E(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:E(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:E(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:E(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:E(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:E(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:E(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:E(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:E(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:E(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:E(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:E(function(){return h.MessageStrategy},"get")});var d=Yd();t.RAL=d.default}}),$Ue=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,u,h;Object.defineProperty(t,"__esModule",{value:!0});var e=M9(),r=(l=class extends e.AbstractMessageBuffer{constructor(f="utf-8"){super(f),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return l.emptyBuffer}fromString(f,p){return new TextEncoder().encode(f)}toString(f,p){return p==="ascii"?this.asciiDecoder.decode(f):new TextDecoder(p).decode(f)}asNative(f,p){return p===void 0?f:f.slice(0,p)}allocNative(f){return new Uint8Array(f)}},E(l,"MessageBuffer"),l);r.emptyBuffer=new Uint8Array(0);var n=(u=class{constructor(f){this.socket=f,this._onData=new e.Emitter,this._messageListener=p=>{p.data.arrayBuffer().then(m=>{this._onData.fire(new Uint8Array(m))},()=>{(0,e.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}onData(f){return this._onData.event(f)}},E(u,"ReadableStreamWrapper"),u),i=(h=class{constructor(f){this.socket=f}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}write(f,p){if(typeof f=="string"){if(p!==void 0&&p!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${p}`);this.socket.send(f)}else this.socket.send(f);return Promise.resolve()}end(){this.socket.close()}},E(h,"WritableStreamWrapper"),h),a=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:E(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:E((d,f)=>{if(f.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${f.charset}`);return Promise.resolve(a.encode(JSON.stringify(d,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:E((d,f)=>{if(!(d instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(f.charset).decode(d)))},"decode")})}),stream:Object.freeze({asReadableStream:E(d=>new n(d),"asReadableStream"),asWritableStream:E(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:E(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:E(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:E(()=>clearInterval(g),"dispose")}}})});function o(){return s}E(o,"RIL"),(function(d){function f(){e.RAL.install(s)}E(f,"install"),d.install=f})(o||(o={})),t.default=o}}),tg=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(t){var l,u;var e=t&&t.__createBinding||(Object.create?(function(h,d,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:E(function(){return d[f]},"get")}),Object.defineProperty(h,p,g)}):(function(h,d,f,p){p===void 0&&(p=f),h[p]=d[f]})),r=t&&t.__exportStar||function(h,d){for(var f in h)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&e(d,h,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=$Ue();n.default.install();var i=M9();r(M9(),t);var a=(l=class extends i.AbstractMessageReader{constructor(d){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},d.addEventListener("error",f=>this.fireError(f)),d.onmessage=this._messageListener}listen(d){return this._onData.event(d)}},E(l,"BrowserMessageReader"),l);t.BrowserMessageReader=a;var s=(u=class extends i.AbstractMessageWriter{constructor(d){super(),this.port=d,this.errorCount=0,d.addEventListener("error",f=>this.fireError(f))}write(d){try{return this.port.postMessage(d),Promise.resolve()}catch(f){return this.handleError(f,d),Promise.reject(f)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){}},E(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=s;function o(h,d,f,p){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(h,d,f,p)}E(o,"createMessageConnection"),t.createMessageConnection=o}}),Yte=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=tg()}}),Zn=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,u,h,d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=tg(),r;(function(p){p.clientToServer="clientToServer",p.serverToClient="serverToClient",p.both="both"})(r||(t.MessageDirection=r={}));var n=(l=class{constructor(g){this.method=g}},E(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},E(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var a=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},E(h,"ProtocolRequestType"),h);t.ProtocolRequestType=a;var s=(d=class extends e.NotificationType0{constructor(g){super(g)}},E(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=s;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},E(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),N9=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(h){return h===!0||h===!1}E(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}E(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}E(n,"number"),t.number=n;function i(h){return h instanceof Error}E(i,"error"),t.error=i;function a(h){return typeof h=="function"}E(a,"func"),t.func=a;function s(h){return Array.isArray(h)}E(s,"array"),t.array=s;function o(h){return s(h)&&h.every(d=>r(d))}E(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}E(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}E(u,"objectLiteral"),t.objectLiteral=u}}),PUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;var e=Zn(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),BUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;var e=Zn(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),FUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;var e=Zn(),r;(function(i){i.method="workspace/workspaceFolders",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(r||(t.WorkspaceFoldersRequest=r={}));var n;(function(i){i.method="workspace/didChangeWorkspaceFolders",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolNotificationType(i.method)})(n||(t.DidChangeWorkspaceFoldersNotification=n={}))}}),zUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;var e=Zn(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),GUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;var e=Zn(),r;(function(i){i.method="textDocument/documentColor",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.DocumentColorRequest=r={}));var n;(function(i){i.method="textDocument/colorPresentation",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.ColorPresentationRequest=n={}))}}),qUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;var e=Zn(),r;(function(i){i.method="textDocument/foldingRange",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.FoldingRangeRequest=r={}));var n;(function(i){i.method="workspace/foldingRange/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.FoldingRangeRefreshRequest=n={}))}}),VUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;var e=Zn(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),WUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;var e=Zn(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),UUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;var e=tg(),r=Zn(),n;(function(s){s.type=new e.ProgressType;function o(l){return l===s.type}E(o,"is"),s.is=o})(n||(t.WorkDoneProgress=n={}));var i;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=r.MessageDirection.serverToClient,s.type=new r.ProtocolRequestType(s.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var a;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolNotificationType(s.method)})(a||(t.WorkDoneProgressCancelNotification=a={}))}}),HUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;var e=Zn(),r;(function(a){a.method="textDocument/prepareCallHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.CallHierarchyPrepareRequest=r={}));var n;(function(a){a.method="callHierarchy/incomingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.CallHierarchyIncomingCallsRequest=n={}));var i;(function(a){a.method="callHierarchy/outgoingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.CallHierarchyOutgoingCallsRequest=i={}))}}),YUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;var e=Zn(),r;(function(l){l.Relative="relative"})(r||(t.TokenFormat=r={}));var n;(function(l){l.method="textDocument/semanticTokens",l.type=new e.RegistrationType(l.method)})(n||(t.SemanticTokensRegistrationType=n={}));var i;(function(l){l.method="textDocument/semanticTokens/full",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(i||(t.SemanticTokensRequest=i={}));var a;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(t.SemanticTokensDeltaRequest=a={}));var s;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(s||(t.SemanticTokensRangeRequest=s={}));var o;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(o||(t.SemanticTokensRefreshRequest=o={}))}}),XUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;var e=Zn(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),KUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;var e=Zn(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),jUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;var e=Zn(),r;(function(u){u.file="file",u.folder="folder"})(r||(t.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(n||(t.WillCreateFilesRequest=n={}));var i;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(i||(t.DidCreateFilesNotification=i={}));var a;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(a||(t.WillRenameFilesRequest=a={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(s||(t.DidRenameFilesNotification=s={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(o||(t.DidDeleteFilesNotification=o={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),ZUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;var e=Zn(),r;(function(a){a.document="document",a.project="project",a.group="group",a.scheme="scheme",a.global="global"})(r||(t.UniquenessLevel=r={}));var n;(function(a){a.$import="import",a.$export="export",a.local="local"})(n||(t.MonikerKind=n={}));var i;(function(a){a.method="textDocument/moniker",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.MonikerRequest=i={}))}}),QUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;var e=Zn(),r;(function(a){a.method="textDocument/prepareTypeHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.TypeHierarchyPrepareRequest=r={}));var n;(function(a){a.method="typeHierarchy/supertypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.TypeHierarchySupertypesRequest=n={}));var i;(function(a){a.method="typeHierarchy/subtypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.TypeHierarchySubtypesRequest=i={}))}}),JUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;var e=Zn(),r;(function(i){i.method="textDocument/inlineValue",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.InlineValueRequest=r={}));var n;(function(i){i.method="workspace/inlineValue/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.InlineValueRefreshRequest=n={}))}}),eHe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;var e=Zn(),r;(function(a){a.method="textDocument/inlayHint",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.InlayHintRequest=r={}));var n;(function(a){a.method="inlayHint/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.InlayHintResolveRequest=n={}));var i;(function(a){a.method="workspace/inlayHint/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(i||(t.InlayHintRefreshRequest=i={}))}}),tHe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;var e=tg(),r=N9(),n=Zn(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}E(h,"is"),u.is=h})(i||(t.DiagnosticServerCancellationData=i={}));var a;(function(u){u.Full="full",u.Unchanged="unchanged"})(a||(t.DocumentDiagnosticReportKind=a={}));var s;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(s||(t.DocumentDiagnosticRequest=s={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(o||(t.WorkspaceDiagnosticRequest=o={}));var l;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(l||(t.DiagnosticRefreshRequest=l={}))}}),rHe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;var e=(Sx(),II(E3)),r=N9(),n=Zn(),i;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}E(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var a;(function(g){function m(x,b){const w={executionOrder:x};return(b===!0||b===!1)&&(w.success=b),w}E(m,"create"),g.create=m;function y(x){const b=x;return r.objectLiteral(b)&&e.uinteger.is(b.executionOrder)&&(b.success===void 0||r.boolean(b.success))}E(y,"is"),g.is=y;function v(x,b){return x===b?!0:x==null||b===null||b===void 0?!1:x.executionOrder===b.executionOrder&&x.success===b.success}E(v,"equals"),g.equals=v})(a||(t.ExecutionSummary=a={}));var s;(function(g){function m(b,w){return{kind:b,document:w}}E(m,"create"),g.create=m;function y(b){const w=b;return r.objectLiteral(w)&&i.is(w.kind)&&e.DocumentUri.is(w.document)&&(w.metadata===void 0||r.objectLiteral(w.metadata))}E(y,"is"),g.is=y;function v(b,w){const k=new Set;return b.document!==w.document&&k.add("document"),b.kind!==w.kind&&k.add("kind"),b.executionSummary!==w.executionSummary&&k.add("executionSummary"),(b.metadata!==void 0||w.metadata!==void 0)&&!x(b.metadata,w.metadata)&&k.add("metadata"),(b.executionSummary!==void 0||w.executionSummary!==void 0)&&!a.equals(b.executionSummary,w.executionSummary)&&k.add("executionSummary"),k}E(v,"diff"),g.diff=v;function x(b,w){if(b===w)return!0;if(b==null||w===null||w===void 0||typeof b!=typeof w||typeof b!="object")return!1;const k=Array.isArray(b),S=Array.isArray(w);if(k!==S)return!1;if(k&&S){if(b.length!==w.length)return!1;for(let C=0;C0}E(At,"hasId"),oe.hasId=At})(I||(t.StaticRegistrationOptions=I={}));var $;(function(oe){function At(dt){const ut=dt;return ut&&(ut.documentSelector===null||z.is(ut.documentSelector))}E(At,"is"),oe.is=At})($||(t.TextDocumentRegistrationOptions=$={}));var B;(function(oe){function At(ut){const wt=ut;return n.objectLiteral(wt)&&(wt.workDoneProgress===void 0||n.boolean(wt.workDoneProgress))}E(At,"is"),oe.is=At;function dt(ut){const wt=ut;return wt&&n.boolean(wt.workDoneProgress)}E(dt,"hasWorkDoneProgress"),oe.hasWorkDoneProgress=dt})(B||(t.WorkDoneProgressOptions=B={}));var P;(function(oe){oe.method="initialize",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(P||(t.InitializeRequest=P={}));var G;(function(oe){oe.unknownProtocolVersion=1})(G||(t.InitializeErrorCodes=G={}));var V;(function(oe){oe.method="initialized",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(V||(t.InitializedNotification=V={}));var X;(function(oe){oe.method="shutdown",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType0(oe.method)})(X||(t.ShutdownRequest=X={}));var W;(function(oe){oe.method="exit",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType0(oe.method)})(W||(t.ExitNotification=W={}));var ie;(function(oe){oe.method="workspace/didChangeConfiguration",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(ie||(t.DidChangeConfigurationNotification=ie={}));var K;(function(oe){oe.Error=1,oe.Warning=2,oe.Info=3,oe.Log=4,oe.Debug=5})(K||(t.MessageType=K={}));var se;(function(oe){oe.method="window/showMessage",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolNotificationType(oe.method)})(se||(t.ShowMessageNotification=se={}));var J;(function(oe){oe.method="window/showMessageRequest",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolRequestType(oe.method)})(J||(t.ShowMessageRequest=J={}));var Z;(function(oe){oe.method="window/logMessage",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolNotificationType(oe.method)})(Z||(t.LogMessageNotification=Z={}));var ee;(function(oe){oe.method="telemetry/event",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolNotificationType(oe.method)})(ee||(t.TelemetryEventNotification=ee={}));var ne;(function(oe){oe.None=0,oe.Full=1,oe.Incremental=2})(ne||(t.TextDocumentSyncKind=ne={}));var ue;(function(oe){oe.method="textDocument/didOpen",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(ue||(t.DidOpenTextDocumentNotification=ue={}));var fe;(function(oe){function At(ut){let wt=ut;return wt!=null&&typeof wt.text=="string"&&wt.range!==void 0&&(wt.rangeLength===void 0||typeof wt.rangeLength=="number")}E(At,"isIncremental"),oe.isIncremental=At;function dt(ut){let wt=ut;return wt!=null&&typeof wt.text=="string"&&wt.range===void 0&&wt.rangeLength===void 0}E(dt,"isFull"),oe.isFull=dt})(fe||(t.TextDocumentContentChangeEvent=fe={}));var _e;(function(oe){oe.method="textDocument/didChange",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(_e||(t.DidChangeTextDocumentNotification=_e={}));var Ae;(function(oe){oe.method="textDocument/didClose",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(Ae||(t.DidCloseTextDocumentNotification=Ae={}));var Ne;(function(oe){oe.method="textDocument/didSave",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(Ne||(t.DidSaveTextDocumentNotification=Ne={}));var me;(function(oe){oe.Manual=1,oe.AfterDelay=2,oe.FocusOut=3})(me||(t.TextDocumentSaveReason=me={}));var ve;(function(oe){oe.method="textDocument/willSave",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(ve||(t.WillSaveTextDocumentNotification=ve={}));var Ge;(function(oe){oe.method="textDocument/willSaveWaitUntil",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Ge||(t.WillSaveTextDocumentWaitUntilRequest=Ge={}));var Te;(function(oe){oe.method="workspace/didChangeWatchedFiles",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(Te||(t.DidChangeWatchedFilesNotification=Te={}));var Ze;(function(oe){oe.Created=1,oe.Changed=2,oe.Deleted=3})(Ze||(t.FileChangeType=Ze={}));var ke;(function(oe){function At(dt){const ut=dt;return n.objectLiteral(ut)&&(r.URI.is(ut.baseUri)||r.WorkspaceFolder.is(ut.baseUri))&&n.string(ut.pattern)}E(At,"is"),oe.is=At})(ke||(t.RelativePattern=ke={}));var Ve;(function(oe){oe.Create=1,oe.Change=2,oe.Delete=4})(Ve||(t.WatchKind=Ve={}));var Qe;(function(oe){oe.method="textDocument/publishDiagnostics",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolNotificationType(oe.method)})(Qe||(t.PublishDiagnosticsNotification=Qe={}));var nt;(function(oe){oe.Invoked=1,oe.TriggerCharacter=2,oe.TriggerForIncompleteCompletions=3})(nt||(t.CompletionTriggerKind=nt={}));var tt;(function(oe){oe.method="textDocument/completion",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(tt||(t.CompletionRequest=tt={}));var je;(function(oe){oe.method="completionItem/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(je||(t.CompletionResolveRequest=je={}));var Ce;(function(oe){oe.method="textDocument/hover",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Ce||(t.HoverRequest=Ce={}));var Se;(function(oe){oe.Invoked=1,oe.TriggerCharacter=2,oe.ContentChange=3})(Se||(t.SignatureHelpTriggerKind=Se={}));var H;(function(oe){oe.method="textDocument/signatureHelp",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(H||(t.SignatureHelpRequest=H={}));var he;(function(oe){oe.method="textDocument/definition",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(he||(t.DefinitionRequest=he={}));var j;(function(oe){oe.method="textDocument/references",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(j||(t.ReferencesRequest=j={}));var pe;(function(oe){oe.method="textDocument/documentHighlight",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(pe||(t.DocumentHighlightRequest=pe={}));var re;(function(oe){oe.method="textDocument/documentSymbol",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(re||(t.DocumentSymbolRequest=re={}));var Fe;(function(oe){oe.method="textDocument/codeAction",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Fe||(t.CodeActionRequest=Fe={}));var xe;(function(oe){oe.method="codeAction/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(xe||(t.CodeActionResolveRequest=xe={}));var Ue;(function(oe){oe.method="workspace/symbol",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Ue||(t.WorkspaceSymbolRequest=Ue={}));var Me;(function(oe){oe.method="workspaceSymbol/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Me||(t.WorkspaceSymbolResolveRequest=Me={}));var qe;(function(oe){oe.method="textDocument/codeLens",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(qe||(t.CodeLensRequest=qe={}));var Le;(function(oe){oe.method="codeLens/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Le||(t.CodeLensResolveRequest=Le={}));var Xe;(function(oe){oe.method="workspace/codeLens/refresh",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolRequestType0(oe.method)})(Xe||(t.CodeLensRefreshRequest=Xe={}));var De;(function(oe){oe.method="textDocument/documentLink",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(De||(t.DocumentLinkRequest=De={}));var it;(function(oe){oe.method="documentLink/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(it||(t.DocumentLinkResolveRequest=it={}));var we;(function(oe){oe.method="textDocument/formatting",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(we||(t.DocumentFormattingRequest=we={}));var lt;(function(oe){oe.method="textDocument/rangeFormatting",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(lt||(t.DocumentRangeFormattingRequest=lt={}));var be;(function(oe){oe.method="textDocument/rangesFormatting",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(be||(t.DocumentRangesFormattingRequest=be={}));var Et;(function(oe){oe.method="textDocument/onTypeFormatting",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Et||(t.DocumentOnTypeFormattingRequest=Et={}));var vt;(function(oe){oe.Identifier=1})(vt||(t.PrepareSupportDefaultBehavior=vt={}));var ot;(function(oe){oe.method="textDocument/rename",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(ot||(t.RenameRequest=ot={}));var It;(function(oe){oe.method="textDocument/prepareRename",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(It||(t.PrepareRenameRequest=It={}));var xt;(function(oe){oe.method="workspace/executeCommand",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(xt||(t.ExecuteCommandRequest=xt={}));var ht;(function(oe){oe.method="workspace/applyEdit",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolRequestType("workspace/applyEdit")})(ht||(t.ApplyWorkspaceEditRequest=ht={}))}}),aHe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var e=tg();function r(n,i,a,s){return e.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,e.createMessageConnection)(n,i,a,s)}E(r,"createProtocolConnection"),t.createProtocolConnection=r}}),sHe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:E(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(tg(),t),r((Sx(),II(E3)),t),r(Zn(),t),r(iHe(),t);var n=aHe();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:E(function(){return n.createProtocolConnection},"get")});var i;(function(a){a.lspReservedErrorRangeStart=-32899,a.RequestFailed=-32803,a.ServerCancelled=-32802,a.ContentModified=-32801,a.RequestCancelled=-32800,a.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}}),oHe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:E(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=Yte();r(Yte(),t),r(sHe(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}E(i,"createProtocolConnection"),t.createProtocolConnection=i}}),Xte={};fh(Xte,{AbstractAstReflection:()=>P9,AbstractCstNode:()=>TN,AbstractLangiumParser:()=>CN,AbstractParserErrorMessageProvider:()=>tfe,AbstractThreadedAsyncParser:()=>Mnt,AstUtils:()=>B9,BiMap:()=>OE,Cancellation:()=>_n,CompositeCstNodeImpl:()=>CE,ContextCache:()=>PE,CstNodeBuilder:()=>Zde,CstUtils:()=>O9,DEFAULT_TOKENIZE_OPTIONS:()=>WN,DONE_RESULT:()=>ts,DatatypeSymbol:()=>kE,DefaultAstNodeDescriptionProvider:()=>Dfe,DefaultAstNodeLocator:()=>Nfe,DefaultAsyncParser:()=>epe,DefaultCommentProvider:()=>Jfe,DefaultConfigurationProvider:()=>Ofe,DefaultDocumentBuilder:()=>$fe,DefaultDocumentValidator:()=>Ife,DefaultHydrator:()=>rpe,DefaultIndexManager:()=>Pfe,DefaultJsonSerializer:()=>Afe,DefaultLangiumDocumentFactory:()=>vfe,DefaultLangiumDocuments:()=>bfe,DefaultLangiumProfiler:()=>Bnt,DefaultLexer:()=>UN,DefaultLexerErrorMessageProvider:()=>Ffe,DefaultLinker:()=>xfe,DefaultNameProvider:()=>Tfe,DefaultReferenceDescriptionProvider:()=>Mfe,DefaultReferences:()=>wfe,DefaultScopeComputation:()=>Cfe,DefaultScopeProvider:()=>Sfe,DefaultServiceRegistry:()=>_fe,DefaultTokenBuilder:()=>RE,DefaultValueConverter:()=>LN,DefaultWorkspaceLock:()=>tpe,DefaultWorkspaceManager:()=>Bfe,Deferred:()=>au,Disposable:()=>Ff,DisposableCache:()=>$E,DocumentCache:()=>Efe,DocumentState:()=>zr,DocumentValidator:()=>wo,EMPTY_SCOPE:()=>Rnt,EMPTY_STREAM:()=>rg,EmptyFileSystem:()=>ba,EmptyFileSystemProvider:()=>spe,ErrorWithLocation:()=>ak,GrammarAST:()=>Zte,GrammarUtils:()=>gD,IndentationAwareLexer:()=>Ont,IndentationAwareTokenBuilder:()=>ape,JSDocDocumentationProvider:()=>Qfe,LangiumCompletionParser:()=>rfe,LangiumParser:()=>efe,LangiumParserErrorMessageProvider:()=>kN,LeafCstNodeImpl:()=>wE,LexingMode:()=>zf,MapScope:()=>_nt,Module:()=>tO,MultiMap:()=>su,MultiMapScope:()=>kfe,OperationCancelled:()=>Jl,ParserWorker:()=>Nnt,ProfilingTask:()=>lpe,Reduction:()=>Rx,RefResolving:()=>Pf,RegExpUtils:()=>yD,RootCstNodeImpl:()=>wN,SimpleCache:()=>BN,StreamImpl:()=>Vl,StreamScope:()=>PN,TextDocument:()=>ME,TreeStreamImpl:()=>ng,URI:()=>eo,UriTrie:()=>ON,UriUtils:()=>ls,VALIDATE_EACH_NODE:()=>Lfe,ValidationCategory:()=>BE,ValidationRegistry:()=>Rfe,ValueConverter:()=>Ql,WorkspaceCache:()=>FN,assertCondition:()=>mD,assertUnreachable:()=>xh,createCompletionParser:()=>AN,createDefaultCoreModule:()=>na,createDefaultSharedCoreModule:()=>ia,createGrammarConfig:()=>$D,createLangiumParser:()=>_N,createParser:()=>SE,delayNextTick:()=>LE,diagnosticData:()=>Bf,eagerLoad:()=>rO,getDiagnosticRange:()=>qN,indentationBuilderDefaultOptions:()=>aO,inject:()=>Xr,interruptAndCheck:()=>ra,isAstNode:()=>Ii,isAstNodeDescription:()=>$9,isAstNodeWithComment:()=>zN,isCompositeCstNode:()=>Wc,isIMultiModeLexerDefinition:()=>qE,isJSDoc:()=>YN,isLeafCstNode:()=>Kd,isLinkingError:()=>Xd,isMultiReference:()=>ql,isNamed:()=>$N,isOperationCancelled:()=>$f,isReference:()=>es,isRootCstNode:()=>N3,isTokenTypeArray:()=>GE,isTokenTypeDictionary:()=>VE,loadGrammarFromJson:()=>aa,parseJSDoc:()=>HN,prepareLangiumParser:()=>RN,setInterruptionPeriod:()=>IN,startCancelableOperation:()=>DE,stream:()=>pn,toDiagnosticData:()=>VN,toDiagnosticSeverity:()=>IT});var O9={};fh(O9,{DefaultNameRegexp:()=>cD,RangeComparison:()=>Ul,compareRange:()=>oD,findCommentNode:()=>uD,findDeclarationNodeAtOffset:()=>mre,findLeafNodeAtOffset:()=>ik,findLeafNodeBeforeOffset:()=>hD,flattenCst:()=>gre,getDatatypeNode:()=>pre,getInteriorNodes:()=>bre,getNextNode:()=>yre,getPreviousNode:()=>fD,getStartlineNode:()=>vre,inRange:()=>lD,isChildNode:()=>sD,isCommentNode:()=>nk,streamCst:()=>gg,toDocumentSegment:()=>mg,tokenToRange:()=>zx});function Ii(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}E(Ii,"isAstNode");function es(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}E(es,"isReference");function ql(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}E(ql,"isMultiReference");function $9(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}E($9,"isAstNodeDescription");function Xd(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}E(Xd,"isLinkingError");var P9=(Om=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return Ii(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}},E(Om,"AbstractAstReflection"),Om);function Wc(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}E(Wc,"isCompositeCstNode");function Kd(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}E(Kd,"isLeafCstNode");function N3(t){return Wc(t)&&typeof t.fullText=="string"}E(N3,"isRootCstNode");var Vl=(Ns=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:E(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new Ns(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return ts})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=Kte(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new Ns(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?ts:{done:!1,value:e(i)}})}filter(e){return new Ns(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return ts})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new Ns(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(_x(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return ts})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new Ns(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(_x(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return ts})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new Ns(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?ts:this.nextFn(r.state)))}distinct(e){return new Ns(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return ts})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}},E(Ns,"StreamImpl"),Ns);function Kte(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}E(Kte,"toString");function _x(t){return!!t&&typeof t[Symbol.iterator]=="function"}E(_x,"isIterable");var rg=new Vl(()=>{},()=>ts),ts=Object.freeze({done:!0,value:void 0});function pn(...t){if(t.length===1){const e=t[0];if(e instanceof Vl)return e;if(_x(e))return new Vl(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Vl(()=>({index:0}),r=>r.index1?new Vl(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return ts})}iterator(){const e={state:this.startFn(),next:E(()=>this.nextFn(e.state),"next"),prune:E(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},E($m,"TreeStreamImpl"),$m),Rx;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}E(e,"sum"),t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}E(r,"product"),t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}E(n,"min"),t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}E(i,"max"),t.max=i})(Rx||(Rx={}));var B9={};fh(B9,{assignMandatoryProperties:()=>F9,copyAstNode:()=>P3,findRootNode:()=>ag,getContainerOfType:()=>jd,getDocument:()=>qo,getReferenceNodes:()=>O3,hasContainerOfType:()=>jte,linkContentToContainer:()=>ig,streamAllContents:()=>Uc,streamAst:()=>Vo,streamContents:()=>Lx,streamReferences:()=>sg});function ig(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Ii(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&ig(i,e))}):Ii(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&ig(n,e)))}E(ig,"linkContentToContainer");function jd(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}E(jd,"getContainerOfType");function jte(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}E(jte,"hasContainerOfType");function qo(t){const r=ag(t).$document;if(!r)throw new Error("AST node has no document.");return r}E(qo,"getDocument");function ag(t){for(;t.$container;)t=t.$container;return t}E(ag,"findRootNode");function O3(t){return es(t)?t.ref?[t.ref]:[]:ql(t)?t.items.map(e=>e.ref):[]}E(O3,"getReferenceNodes");function Lx(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new Vl(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexLx(r,e))}E(Uc,"streamAllContents");function Vo(t,e){if(t){if(e!=null&&e.range&&!$3(t,e.range))return new ng(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new ng(t,r=>Lx(r,e),{includeRoot:!0})}E(Vo,"streamAst");function $3(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?lD(r,e):!1}E($3,"isAstNodeInRange");function sg(t){return new Vl(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexks,AbstractParserRule:()=>Ix,AbstractRule:()=>og,AbstractType:()=>Xs,Action:()=>ph,Alternatives:()=>Dx,ArrayLiteral:()=>z3,ArrayType:()=>G3,Assignment:()=>mh,BooleanLiteral:()=>q3,CharacterRange:()=>yh,Condition:()=>vh,Conjunction:()=>Mx,CrossReference:()=>bh,Disjunction:()=>Nx,EndOfFile:()=>V3,Grammar:()=>Yc,GrammarImport:()=>W3,Group:()=>Jd,InferredType:()=>U3,InfixRule:()=>Wl,InfixRuleOperatorList:()=>$x,InfixRuleOperators:()=>H3,Interface:()=>cg,Keyword:()=>ug,LangiumGrammarAstReflection:()=>aD,LangiumGrammarTerminals:()=>lHe,NamedArgument:()=>hg,NegatedToken:()=>tf,Negation:()=>Y3,NumberLiteral:()=>X3,Parameter:()=>dg,ParameterReference:()=>K3,ParserRule:()=>Wo,ReferenceType:()=>Px,RegexToken:()=>rf,ReturnType:()=>j3,RuleCall:()=>nf,SimpleType:()=>fg,StringLiteral:()=>Q3,TerminalAlternatives:()=>af,TerminalElement:()=>Es,TerminalGroup:()=>sf,TerminalRule:()=>jc,TerminalRuleCall:()=>of,Type:()=>Bx,TypeAttribute:()=>lf,TypeDefinition:()=>cf,UnionType:()=>tk,UnorderedGroup:()=>Fx,UntilToken:()=>uf,ValueLiteral:()=>hf,Wildcard:()=>pg,isAbstractElement:()=>B3,isAbstractParserRule:()=>Zd,isAbstractRule:()=>Qte,isAbstractType:()=>Jte,isAction:()=>gh,isAlternatives:()=>F3,isArrayLiteral:()=>ere,isArrayType:()=>G9,isAssignment:()=>Hc,isBooleanLiteral:()=>q9,isCharacterRange:()=>V9,isCondition:()=>tre,isConjunction:()=>W9,isCrossReference:()=>Qd,isDisjunction:()=>U9,isEndOfFile:()=>H9,isGrammar:()=>rre,isGrammarImport:()=>nre,isGroup:()=>ef,isInferredType:()=>Ox,isInfixRule:()=>lg,isInfixRuleOperatorList:()=>ire,isInfixRuleOperators:()=>are,isInterface:()=>Y9,isKeyword:()=>Xc,isNamedArgument:()=>sre,isNegatedToken:()=>X9,isNegation:()=>K9,isNumberLiteral:()=>ore,isParameter:()=>lre,isParameterReference:()=>j9,isParserRule:()=>rs,isReferenceType:()=>Z9,isRegexToken:()=>Q9,isReturnType:()=>J9,isRuleCall:()=>Kc,isSimpleType:()=>Z3,isStringLiteral:()=>cre,isTerminalAlternatives:()=>eD,isTerminalElement:()=>ure,isTerminalGroup:()=>tD,isTerminalRule:()=>yo,isTerminalRuleCall:()=>J3,isType:()=>ek,isTypeAttribute:()=>hre,isTypeDefinition:()=>dre,isUnionType:()=>rD,isUnorderedGroup:()=>rk,isUntilToken:()=>nD,isValueLiteral:()=>fre,isWildcard:()=>iD,reflection:()=>vr});var lHe={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},ks={$type:"AbstractElement",cardinality:"cardinality"};function B3(t){return vr.isInstance(t,ks.$type)}E(B3,"isAbstractElement");var Ix={$type:"AbstractParserRule"};function Zd(t){return vr.isInstance(t,Ix.$type)}E(Zd,"isAbstractParserRule");var og={$type:"AbstractRule"};function Qte(t){return vr.isInstance(t,og.$type)}E(Qte,"isAbstractRule");var Xs={$type:"AbstractType"};function Jte(t){return vr.isInstance(t,Xs.$type)}E(Jte,"isAbstractType");var ph={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function gh(t){return vr.isInstance(t,ph.$type)}E(gh,"isAction");var Dx={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function F3(t){return vr.isInstance(t,Dx.$type)}E(F3,"isAlternatives");var z3={$type:"ArrayLiteral",elements:"elements"};function ere(t){return vr.isInstance(t,z3.$type)}E(ere,"isArrayLiteral");var G3={$type:"ArrayType",elementType:"elementType"};function G9(t){return vr.isInstance(t,G3.$type)}E(G9,"isArrayType");var mh={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Hc(t){return vr.isInstance(t,mh.$type)}E(Hc,"isAssignment");var q3={$type:"BooleanLiteral",true:"true"};function q9(t){return vr.isInstance(t,q3.$type)}E(q9,"isBooleanLiteral");var yh={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function V9(t){return vr.isInstance(t,yh.$type)}E(V9,"isCharacterRange");var vh={$type:"Condition"};function tre(t){return vr.isInstance(t,vh.$type)}E(tre,"isCondition");var Mx={$type:"Conjunction",left:"left",right:"right"};function W9(t){return vr.isInstance(t,Mx.$type)}E(W9,"isConjunction");var bh={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Qd(t){return vr.isInstance(t,bh.$type)}E(Qd,"isCrossReference");var Nx={$type:"Disjunction",left:"left",right:"right"};function U9(t){return vr.isInstance(t,Nx.$type)}E(U9,"isDisjunction");var V3={$type:"EndOfFile",cardinality:"cardinality"};function H9(t){return vr.isInstance(t,V3.$type)}E(H9,"isEndOfFile");var Yc={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function rre(t){return vr.isInstance(t,Yc.$type)}E(rre,"isGrammar");var W3={$type:"GrammarImport",path:"path"};function nre(t){return vr.isInstance(t,W3.$type)}E(nre,"isGrammarImport");var Jd={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function ef(t){return vr.isInstance(t,Jd.$type)}E(ef,"isGroup");var U3={$type:"InferredType",name:"name"};function Ox(t){return vr.isInstance(t,U3.$type)}E(Ox,"isInferredType");var Wl={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function lg(t){return vr.isInstance(t,Wl.$type)}E(lg,"isInfixRule");var $x={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function ire(t){return vr.isInstance(t,$x.$type)}E(ire,"isInfixRuleOperatorList");var H3={$type:"InfixRuleOperators",precedences:"precedences"};function are(t){return vr.isInstance(t,H3.$type)}E(are,"isInfixRuleOperators");var cg={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Y9(t){return vr.isInstance(t,cg.$type)}E(Y9,"isInterface");var ug={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Xc(t){return vr.isInstance(t,ug.$type)}E(Xc,"isKeyword");var hg={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function sre(t){return vr.isInstance(t,hg.$type)}E(sre,"isNamedArgument");var tf={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function X9(t){return vr.isInstance(t,tf.$type)}E(X9,"isNegatedToken");var Y3={$type:"Negation",value:"value"};function K9(t){return vr.isInstance(t,Y3.$type)}E(K9,"isNegation");var X3={$type:"NumberLiteral",value:"value"};function ore(t){return vr.isInstance(t,X3.$type)}E(ore,"isNumberLiteral");var dg={$type:"Parameter",name:"name"};function lre(t){return vr.isInstance(t,dg.$type)}E(lre,"isParameter");var K3={$type:"ParameterReference",parameter:"parameter"};function j9(t){return vr.isInstance(t,K3.$type)}E(j9,"isParameterReference");var Wo={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function rs(t){return vr.isInstance(t,Wo.$type)}E(rs,"isParserRule");var Px={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function Z9(t){return vr.isInstance(t,Px.$type)}E(Z9,"isReferenceType");var rf={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Q9(t){return vr.isInstance(t,rf.$type)}E(Q9,"isRegexToken");var j3={$type:"ReturnType",name:"name"};function J9(t){return vr.isInstance(t,j3.$type)}E(J9,"isReturnType");var nf={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Kc(t){return vr.isInstance(t,nf.$type)}E(Kc,"isRuleCall");var fg={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function Z3(t){return vr.isInstance(t,fg.$type)}E(Z3,"isSimpleType");var Q3={$type:"StringLiteral",value:"value"};function cre(t){return vr.isInstance(t,Q3.$type)}E(cre,"isStringLiteral");var af={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function eD(t){return vr.isInstance(t,af.$type)}E(eD,"isTerminalAlternatives");var Es={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function ure(t){return vr.isInstance(t,Es.$type)}E(ure,"isTerminalElement");var sf={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function tD(t){return vr.isInstance(t,sf.$type)}E(tD,"isTerminalGroup");var jc={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function yo(t){return vr.isInstance(t,jc.$type)}E(yo,"isTerminalRule");var of={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function J3(t){return vr.isInstance(t,of.$type)}E(J3,"isTerminalRuleCall");var Bx={$type:"Type",name:"name",type:"type"};function ek(t){return vr.isInstance(t,Bx.$type)}E(ek,"isType");var lf={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function hre(t){return vr.isInstance(t,lf.$type)}E(hre,"isTypeAttribute");var cf={$type:"TypeDefinition"};function dre(t){return vr.isInstance(t,cf.$type)}E(dre,"isTypeDefinition");var tk={$type:"UnionType",types:"types"};function rD(t){return vr.isInstance(t,tk.$type)}E(rD,"isUnionType");var Fx={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function rk(t){return vr.isInstance(t,Fx.$type)}E(rk,"isUnorderedGroup");var uf={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function nD(t){return vr.isInstance(t,uf.$type)}E(nD,"isUntilToken");var hf={$type:"ValueLiteral"};function fre(t){return vr.isInstance(t,hf.$type)}E(fre,"isValueLiteral");var pg={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function iD(t){return vr.isInstance(t,pg.$type)}E(iD,"isWildcard");var aD=(Pm=class extends P9{constructor(){super(...arguments),this.types={AbstractElement:{name:ks.$type,properties:{cardinality:{name:ks.cardinality}},superTypes:[]},AbstractParserRule:{name:Ix.$type,properties:{},superTypes:[og.$type,Xs.$type]},AbstractRule:{name:og.$type,properties:{},superTypes:[]},AbstractType:{name:Xs.$type,properties:{},superTypes:[]},Action:{name:ph.$type,properties:{cardinality:{name:ph.cardinality},feature:{name:ph.feature},inferredType:{name:ph.inferredType},operator:{name:ph.operator},type:{name:ph.type,referenceType:Xs.$type}},superTypes:[ks.$type]},Alternatives:{name:Dx.$type,properties:{cardinality:{name:Dx.cardinality},elements:{name:Dx.elements,defaultValue:[]}},superTypes:[ks.$type]},ArrayLiteral:{name:z3.$type,properties:{elements:{name:z3.elements,defaultValue:[]}},superTypes:[hf.$type]},ArrayType:{name:G3.$type,properties:{elementType:{name:G3.elementType}},superTypes:[cf.$type]},Assignment:{name:mh.$type,properties:{cardinality:{name:mh.cardinality},feature:{name:mh.feature},operator:{name:mh.operator},predicate:{name:mh.predicate},terminal:{name:mh.terminal}},superTypes:[ks.$type]},BooleanLiteral:{name:q3.$type,properties:{true:{name:q3.true,defaultValue:!1}},superTypes:[vh.$type,hf.$type]},CharacterRange:{name:yh.$type,properties:{cardinality:{name:yh.cardinality},left:{name:yh.left},lookahead:{name:yh.lookahead},parenthesized:{name:yh.parenthesized,defaultValue:!1},right:{name:yh.right}},superTypes:[Es.$type]},Condition:{name:vh.$type,properties:{},superTypes:[]},Conjunction:{name:Mx.$type,properties:{left:{name:Mx.left},right:{name:Mx.right}},superTypes:[vh.$type]},CrossReference:{name:bh.$type,properties:{cardinality:{name:bh.cardinality},deprecatedSyntax:{name:bh.deprecatedSyntax,defaultValue:!1},isMulti:{name:bh.isMulti,defaultValue:!1},terminal:{name:bh.terminal},type:{name:bh.type,referenceType:Xs.$type}},superTypes:[ks.$type]},Disjunction:{name:Nx.$type,properties:{left:{name:Nx.left},right:{name:Nx.right}},superTypes:[vh.$type]},EndOfFile:{name:V3.$type,properties:{cardinality:{name:V3.cardinality}},superTypes:[ks.$type]},Grammar:{name:Yc.$type,properties:{imports:{name:Yc.imports,defaultValue:[]},interfaces:{name:Yc.interfaces,defaultValue:[]},isDeclared:{name:Yc.isDeclared,defaultValue:!1},name:{name:Yc.name},rules:{name:Yc.rules,defaultValue:[]},types:{name:Yc.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:W3.$type,properties:{path:{name:W3.path}},superTypes:[]},Group:{name:Jd.$type,properties:{cardinality:{name:Jd.cardinality},elements:{name:Jd.elements,defaultValue:[]},guardCondition:{name:Jd.guardCondition},predicate:{name:Jd.predicate}},superTypes:[ks.$type]},InferredType:{name:U3.$type,properties:{name:{name:U3.name}},superTypes:[Xs.$type]},InfixRule:{name:Wl.$type,properties:{call:{name:Wl.call},dataType:{name:Wl.dataType},inferredType:{name:Wl.inferredType},name:{name:Wl.name},operators:{name:Wl.operators},parameters:{name:Wl.parameters,defaultValue:[]},returnType:{name:Wl.returnType,referenceType:Xs.$type}},superTypes:[Ix.$type]},InfixRuleOperatorList:{name:$x.$type,properties:{associativity:{name:$x.associativity},operators:{name:$x.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:H3.$type,properties:{precedences:{name:H3.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:cg.$type,properties:{attributes:{name:cg.attributes,defaultValue:[]},name:{name:cg.name},superTypes:{name:cg.superTypes,defaultValue:[],referenceType:Xs.$type}},superTypes:[Xs.$type]},Keyword:{name:ug.$type,properties:{cardinality:{name:ug.cardinality},predicate:{name:ug.predicate},value:{name:ug.value}},superTypes:[ks.$type]},NamedArgument:{name:hg.$type,properties:{calledByName:{name:hg.calledByName,defaultValue:!1},parameter:{name:hg.parameter,referenceType:dg.$type},value:{name:hg.value}},superTypes:[]},NegatedToken:{name:tf.$type,properties:{cardinality:{name:tf.cardinality},lookahead:{name:tf.lookahead},parenthesized:{name:tf.parenthesized,defaultValue:!1},terminal:{name:tf.terminal}},superTypes:[Es.$type]},Negation:{name:Y3.$type,properties:{value:{name:Y3.value}},superTypes:[vh.$type]},NumberLiteral:{name:X3.$type,properties:{value:{name:X3.value}},superTypes:[hf.$type]},Parameter:{name:dg.$type,properties:{name:{name:dg.name}},superTypes:[]},ParameterReference:{name:K3.$type,properties:{parameter:{name:K3.parameter,referenceType:dg.$type}},superTypes:[vh.$type]},ParserRule:{name:Wo.$type,properties:{dataType:{name:Wo.dataType},definition:{name:Wo.definition},entry:{name:Wo.entry,defaultValue:!1},fragment:{name:Wo.fragment,defaultValue:!1},inferredType:{name:Wo.inferredType},name:{name:Wo.name},parameters:{name:Wo.parameters,defaultValue:[]},returnType:{name:Wo.returnType,referenceType:Xs.$type}},superTypes:[Ix.$type]},ReferenceType:{name:Px.$type,properties:{isMulti:{name:Px.isMulti,defaultValue:!1},referenceType:{name:Px.referenceType}},superTypes:[cf.$type]},RegexToken:{name:rf.$type,properties:{cardinality:{name:rf.cardinality},lookahead:{name:rf.lookahead},parenthesized:{name:rf.parenthesized,defaultValue:!1},regex:{name:rf.regex}},superTypes:[Es.$type]},ReturnType:{name:j3.$type,properties:{name:{name:j3.name}},superTypes:[]},RuleCall:{name:nf.$type,properties:{arguments:{name:nf.arguments,defaultValue:[]},cardinality:{name:nf.cardinality},predicate:{name:nf.predicate},rule:{name:nf.rule,referenceType:og.$type}},superTypes:[ks.$type]},SimpleType:{name:fg.$type,properties:{primitiveType:{name:fg.primitiveType},stringType:{name:fg.stringType},typeRef:{name:fg.typeRef,referenceType:Xs.$type}},superTypes:[cf.$type]},StringLiteral:{name:Q3.$type,properties:{value:{name:Q3.value}},superTypes:[hf.$type]},TerminalAlternatives:{name:af.$type,properties:{cardinality:{name:af.cardinality},elements:{name:af.elements,defaultValue:[]},lookahead:{name:af.lookahead},parenthesized:{name:af.parenthesized,defaultValue:!1}},superTypes:[Es.$type]},TerminalElement:{name:Es.$type,properties:{cardinality:{name:Es.cardinality},lookahead:{name:Es.lookahead},parenthesized:{name:Es.parenthesized,defaultValue:!1}},superTypes:[ks.$type]},TerminalGroup:{name:sf.$type,properties:{cardinality:{name:sf.cardinality},elements:{name:sf.elements,defaultValue:[]},lookahead:{name:sf.lookahead},parenthesized:{name:sf.parenthesized,defaultValue:!1}},superTypes:[Es.$type]},TerminalRule:{name:jc.$type,properties:{definition:{name:jc.definition},fragment:{name:jc.fragment,defaultValue:!1},hidden:{name:jc.hidden,defaultValue:!1},name:{name:jc.name},type:{name:jc.type}},superTypes:[og.$type]},TerminalRuleCall:{name:of.$type,properties:{cardinality:{name:of.cardinality},lookahead:{name:of.lookahead},parenthesized:{name:of.parenthesized,defaultValue:!1},rule:{name:of.rule,referenceType:jc.$type}},superTypes:[Es.$type]},Type:{name:Bx.$type,properties:{name:{name:Bx.name},type:{name:Bx.type}},superTypes:[Xs.$type]},TypeAttribute:{name:lf.$type,properties:{defaultValue:{name:lf.defaultValue},isOptional:{name:lf.isOptional,defaultValue:!1},name:{name:lf.name},type:{name:lf.type}},superTypes:[]},TypeDefinition:{name:cf.$type,properties:{},superTypes:[]},UnionType:{name:tk.$type,properties:{types:{name:tk.types,defaultValue:[]}},superTypes:[cf.$type]},UnorderedGroup:{name:Fx.$type,properties:{cardinality:{name:Fx.cardinality},elements:{name:Fx.elements,defaultValue:[]}},superTypes:[ks.$type]},UntilToken:{name:uf.$type,properties:{cardinality:{name:uf.cardinality},lookahead:{name:uf.lookahead},parenthesized:{name:uf.parenthesized,defaultValue:!1},terminal:{name:uf.terminal}},superTypes:[Es.$type]},ValueLiteral:{name:hf.$type,properties:{},superTypes:[]},Wildcard:{name:pg.$type,properties:{cardinality:{name:pg.cardinality},lookahead:{name:pg.lookahead},parenthesized:{name:pg.parenthesized,defaultValue:!1}},superTypes:[Es.$type]}}}},E(Pm,"LangiumGrammarAstReflection"),Pm),vr=new aD;function pre(t){let e=t,r=!1;for(;e;){const n=jd(e.grammarSource,rs);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}E(pre,"getDatatypeNode");function gg(t){return new ng(t,e=>Wc(e)?e.content:[],{includeRoot:!0})}E(gg,"streamCst");function gre(t){return gg(t).filter(Kd)}E(gre,"flattenCst");function sD(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}E(sD,"isChildNode");function zx(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}E(zx,"tokenToRange");function mg(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}E(mg,"toDocumentSegment");var Ul;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(Ul||(Ul={}));function oD(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Ul.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.lineUl.After}E(lD,"inRange");var cD=/^[\w\p{L}]$/u;function mre(t,e,r=cD){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return ik(t,e)}}E(mre,"findDeclarationNodeAtOffset");function uD(t,e){if(t){const r=fD(t,!0);if(r&&nk(r,e))return r;if(N3(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(nk(a,e))return a}}}}E(uD,"findCommentNode");function nk(t,e){return Kd(t)&&e.includes(t.tokenType.name)}E(nk,"isCommentNode");function ik(t,e){if(Kd(t))return t;if(Wc(t)){const r=dD(t,e,!1);if(r)return ik(r,e)}}E(ik,"findLeafNodeAtOffset");function hD(t,e){if(Kd(t))return t;if(Wc(t)){const r=dD(t,e,!0);if(r)return hD(r,e)}}E(hD,"findLeafNodeBeforeOffset");function dD(t,e,r){let n=0,i=t.content.length-1,a;for(;n<=i;){const s=Math.floor((n+i)/2),o=t.content[s];if(o.offset<=e&&o.end>e)return o;o.end<=e?(a=r?o:void 0,n=s+1):i=s-1}return a}E(dD,"binarySearch");function fD(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}E(fD,"getPreviousNode");function yre(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nRD,findNameAssignment:()=>mk,findNodeForKeyword:()=>_D,findNodeForProperty:()=>fk,findNodesForKeyword:()=>Rre,findNodesForKeywordInternal:()=>gk,findNodesForProperty:()=>AD,getActionAtElement:()=>ID,getActionType:()=>MD,getAllReachableRules:()=>dk,getAllRulesUsedForCrossReferences:()=>_re,getCrossReferenceTerminal:()=>ED,getEntryRule:()=>wD,getExplicitRuleType:()=>qx,getHiddenRules:()=>CD,getRuleType:()=>ND,getRuleTypeName:()=>Nre,getTypeName:()=>pf,isArrayCardinality:()=>Ire,isArrayOperator:()=>Dre,isCommentTerminal:()=>SD,isDataType:()=>Mre,isDataTypeRule:()=>Gx,isOptionalCardinality:()=>Lre,terminalRegex:()=>Vx});var ak=(Bm=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},E(Bm,"ErrorWithLocation"),Bm);function xh(t,e="Error: Got unexpected value."){throw new Error(e)}E(xh,"assertUnreachable");function mD(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}E(mD,"assertCondition");var yD={};fh(yD,{NEWLINE_REGEXP:()=>kre,escapeRegExp:()=>vg,getTerminalParts:()=>Sre,isMultilineComment:()=>bD,isWhitespace:()=>hk,partialMatches:()=>xD,partialRegExp:()=>TD,whitespaceCharacters:()=>Are});function Cr(t){return t.charCodeAt(0)}E(Cr,"cc");function sk(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}E(sk,"insertToSet");function yg(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}E(yg,"addFlag");function df(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}E(df,"ASSERT_EXISTS");function Tre(){throw Error("Internal Error - Should never get here!")}E(Tre,"ASSERT_NEVER_REACH_HERE");function vD(t){return t.type==="Character"}E(vD,"isCharacter");var ok=[];for(let t=Cr("0");t<=Cr("9");t++)ok.push(t);var lk=[Cr("_")].concat(ok);for(let t=Cr("a");t<=Cr("z");t++)lk.push(t);for(let t=Cr("A");t<=Cr("Z");t++)lk.push(t);var wre=[Cr(" "),Cr("\f"),Cr(` +`),Cr("\r"),Cr(" "),Cr("\v"),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr("\u2028"),Cr("\u2029"),Cr(" "),Cr(" "),Cr(" "),Cr("\uFEFF")],cHe=/[0-9a-fA-F]/,ck=/[0-9]/,uHe=/[1-9]/,Cre=(Fm=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const r=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":yg(n,"global");break;case"i":yg(n,"ignoreCase");break;case"m":yg(n,"multiLine");break;case"u":yg(n,"unicode");break;case"y":yg(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){const e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){const e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}df(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return Tre()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;df(r);break}if(!(e===!0&&r===void 0)&&df(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e;const r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),df(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Cr(` +`),Cr("\r"),Cr("\u2028"),Cr("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=ok;break;case"D":e=ok,r=!0;break;case"s":e=wre;break;case"S":e=wre,r=!0;break;case"w":e=lk;break;case"W":e=lk,r=!0;break}if(df(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Cr("\f");break;case"n":e=Cr(` `);break;case"r":e=Cr("\r");break;case"t":e=Cr(" ");break;case"v":e=Cr("\v");break}if(df(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:Cr("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:Cr(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case` -`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:Cr(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,fD(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,fD(i)){if(i.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},E(Bm,"RegExpParser"),Bm),ok=(Fm=class{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},E(Fm,"BaseRegExpVisitor"),Fm),vre=/\r?\n/gm,bre=new yre,QUe=(zm=class extends ok{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const r=String.fromCharCode(e.value);if(!this.multiline&&r===` -`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=yg(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!` -`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},E(zm,"TerminalRegExpVisitor"),zm),ff=new QUe;function xre(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=bre.pattern(t),r=[];for(const n of e.value.value)ff.reset(t),ff.visit(n),r.push({start:ff.startRegexp,end:ff.endRegex});return r}catch{return[]}}E(xre,"getTerminalParts");function pD(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),ff.reset(t),ff.visit(bre.pattern(t)),ff.multiline}catch{return!1}}E(pD,"isMultilineComment");var Tre=`\f -\r \v              \u2028\u2029   \uFEFF`.split("");function lk(t){const e=typeof t=="string"?new RegExp(t):t;return Tre.some(r=>e.test(r))}E(lk,"isWhitespace");function yg(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}E(yg,"escapeRegExp");function gD(t,e){const r=mD(t),n=e.match(r);return!!n&&n[0].length>0}E(gD,"partialMatches");function mD(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(u){a+=r.substr(n,u),n+=u}E(o,"appendRaw");function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(E(l,"appendOptional");n",n)-n+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return E(i,"process"),new RegExp(i(),t.flags)}E(mD,"partialRegExp");function yD(t){return t.rules.find(e=>rs(e)&&e.entry)}E(yD,"getEntryRule");function vD(t){return t.rules.filter(e=>yo(e)&&e.hidden)}E(vD,"getHiddenRules");function ck(t,e){const r=new Set,n=yD(t);if(!n)return new Set(t.rules);const i=[n].concat(vD(t));for(const s of i)bD(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||yo(s)&&s.hidden)&&a.add(s);return a}E(ck,"getAllReachableRules");function bD(t,e,r){e.add(t.name),Uc(t).forEach(n=>{if(Kc(n)||r&&j3(n)){const i=n.rule.ref;i&&!e.has(i.name)&&bD(i,e,r)}})}E(bD,"ruleDfs");function wre(t){const e=new Set;return Uc(t).forEach(r=>{Qd(r)&&(rs(r.type.ref)&&e.add(r.type.ref),Mx(r.type.ref)&&rs(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}E(wre,"getAllRulesUsedForCrossReferences");function xD(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=fk(t.type.ref);return e==null?void 0:e.terminal}}E(xD,"getCrossReferenceTerminal");function TD(t){return t.hidden&&!lk(Gx(t))}E(TD,"isCommentTerminal");function wD(t,e){return!t||!e?[]:hk(t,e,t.astNode,!0)}E(wD,"findNodesForProperty");function uk(t,e,r){if(!t||!e)return;const n=hk(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}E(uk,"findNodeForProperty");function hk(t,e,r,n){if(!n){const i=jd(t.grammarSource,Hc);if(i&&i.feature===e)return[t]}return Wc(t)&&t.astNode===r?t.content.flatMap(i=>hk(i,e,r,!1)):[]}E(hk,"findNodesForPropertyInternal");function Cre(t,e){return t?dk(t,e,t==null?void 0:t.astNode):[]}E(Cre,"findNodesForKeyword");function CD(t,e,r){if(!t)return;const n=dk(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}E(CD,"findNodeForKeyword");function dk(t,e,r){if(t.astNode!==r)return[];if(Xc(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=pg(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?Xc(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}E(dk,"findNodesForKeywordInternal");function kD(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=jd(t.grammarSource,Hc);if(n)return n;t=t.container}}E(kD,"findAssignment");function fk(t){let e=t;return Mx(e)&&(gh(e.$container)?e=e.$container.$container:Zd(e.$container)?e=e.$container:xh(e.$container)),ED(t,e,new Map)}E(fk,"findNameAssignment");function ED(t,e,r){var i;function n(a,s){let o;return jd(a,Hc)||(o=ED(s,s,r)),r.set(t,o),o}if(E(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of Uc(e)){if(Hc(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Kc(a)&&rs(a.rule.ref))return n(a,a.rule.ref);if(X3(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}E(ED,"findNameAssignmentInternal");function SD(t){const e=t.$container;if(ef(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(gh(a))return a;{const s=Uc(r[i]).find(gh);if(s)return s}}}if(O3(e))return SD(e)}E(SD,"getActionAtElement");function kre(t,e){return t==="?"||t==="*"||ef(e)&&!!e.guardCondition}E(kre,"isOptionalCardinality");function Ere(t){return t==="*"||t==="+"}E(Ere,"isArrayCardinality");function Sre(t){return t==="+="}E(Sre,"isArrayOperator");function Fx(t){return AD(t,new Set)}E(Fx,"isDataTypeRule");function AD(t,e){if(e.has(t))return!0;e.add(t);for(const r of Uc(t))if(Kc(r)){if(!r.rule.ref||rs(r.rule.ref)&&!AD(r.rule.ref,e)||og(r.rule.ref))return!1}else{if(Hc(r))return!1;if(gh(r))return!1}return!!t.definition}E(AD,"isDataTypeRuleInternal");function Are(t){return pk(t.type,new Set)}E(Are,"isDataType");function pk(t,e){if(e.has(t))return!0;if(e.add(t),$9(t))return!1;if(H9(t))return!1;if(Z9(t))return t.types.every(r=>pk(r,e));if(X3(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const r=t.typeRef.ref;return Z3(r)?pk(r.type,e):!1}else return!1}else return!1}E(pk,"isDataTypeInternal");function zx(t){if(!yo(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}E(zx,"getExplicitRuleType");function pf(t){if(Zd(t))return rs(t)&&Fx(t)?t.name:zx(t)??t.name;if(q9(t)||Z3(t)||X9(t))return t.name;if(gh(t)){const e=_D(t);if(e)return e}else if(Mx(t))return t.name;throw new Error("Cannot get name of Unknown Type")}E(pf,"getTypeName");function _D(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return pf(t.type.ref)}E(_D,"getActionType");function _re(t){var e;return yo(t)?((e=t.type)==null?void 0:e.name)??"string":rs(t)&&Fx(t)?t.name:zx(t)??t.name}E(_re,"getRuleTypeName");function RD(t){var e;return yo(t)?((e=t.type)==null?void 0:e.name)??"string":zx(t)??t.name}E(RD,"getRuleType");function Gx(t){const e={s:!1,i:!1,u:!1},r=gf(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}E(Gx,"terminalRegex");var LD=/[\s\S]/.source;function gf(t,e){var r;if(K9(t))return Rre(t);if(j9(t))return Lre(t);if(B9(t))return Mre(t);if(j3(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Hl(gf(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(V9(t))return Dre(t);if(Q9(t))return Ire(t);if(Y9(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),a=t.regex.substring(n+1);return e&&(e.i=a.includes("i"),e.s=a.includes("s"),e.u=a.includes("u")),Hl(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(J9(t))return Hl(LD,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}E(gf,"abstractElementToRegex");function Rre(t){return Hl(t.elements.map(e=>gf(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}E(Rre,"terminalAlternativesToRegex");function Lre(t){return Hl(t.elements.map(e=>gf(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}E(Lre,"terminalGroupToRegex");function Ire(t){return Hl(`${LD}*?${gf(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}E(Ire,"untilTokenToRegex");function Dre(t){return Hl(`(?!${gf(t.terminal)})${LD}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}E(Dre,"negateTokenToRegex");function Mre(t){return t.right?Hl(`[${gk(t.left)}-${gk(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Hl(gk(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}E(Mre,"characterRangeToRegex");function gk(t){return yg(t.value)}E(gk,"keywordToRegex");function Hl(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}E(Hl,"withCardinality");function ID(t){const e=[],r=t.Grammar;for(const n of r.rules)yo(n)&&TD(n)&&pD(Gx(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:iD}}E(ID,"createGrammarConfig");var JUe=typeof global=="object"&&global&&global.Object===Object&&global,Nre=JUe,eHe=typeof self=="object"&&self&&self.Object===Object&&self,tHe=Nre||eHe||Function("return this")(),Yl=tHe,rHe=Yl.Symbol,vo=rHe,Ore=Object.prototype,nHe=Ore.hasOwnProperty,iHe=Ore.toString,qx=vo?vo.toStringTag:void 0;function $re(t){var e=nHe.call(t,qx),r=t[qx];try{t[qx]=void 0;var n=!0}catch{}var i=iHe.call(t);return n&&(e?t[qx]=r:delete t[qx]),i}E($re,"getRawTag");var aHe=$re,sHe=Object.prototype,oHe=sHe.toString;function Pre(t){return oHe.call(t)}E(Pre,"objectToString");var lHe=Pre,cHe="[object Null]",uHe="[object Undefined]",Bre=vo?vo.toStringTag:void 0;function Fre(t){return t==null?t===void 0?uHe:cHe:Bre&&Bre in Object(t)?aHe(t):lHe(t)}E(Fre,"baseGetTag");var Th=Fre;function zre(t){return t!=null&&typeof t=="object"}E(zre,"isObjectLike");var Uo=zre,hHe="[object Symbol]";function Gre(t){return typeof t=="symbol"||Uo(t)&&Th(t)==hHe}E(Gre,"isSymbol");var mk=Gre;function qre(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=YHe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}E(hne,"shortOut");var jHe=hne;function dne(t){return function(){return t}}E(dne,"constant");var ZHe=dne,QHe=(function(){try{var t=yf(Object,"defineProperty");return t({},"",{}),t}catch{}})(),yk=QHe,JHe=yk?function(t,e){return yk(t,"toString",{configurable:!0,enumerable:!1,value:ZHe(e),writable:!0})}:Ux,eYe=JHe,tYe=jHe(eYe),rYe=tYe;function fne(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}E(xne,"arrayIncludes");var Tne=xne,aYe=9007199254740991,sYe=/^(?:0|[1-9]\d*)$/;function wne(t,e){var r=typeof t;return e=e??aYe,!!e&&(r=="number"||r!="symbol"&&sYe.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=uYe}E(Lne,"isLength");var BD=Lne;function Ine(t){return t!=null&&BD(t.length)&&!Zc(t)}E(Ine,"isArrayLike");var Xl=Ine;function Dne(t,e,r){if(!bo(r))return!1;var n=typeof e;return(n=="number"?Xl(r)&&vk(e,r.length):n=="string"&&e in r)?Hx(r[e],t):!1}E(Dne,"isIterateeCall");var xk=Dne;function Mne(t){return PD(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&xk(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}E(pie,"listCacheHas");var _Xe=pie;function gie(t,e){var r=this.__data__,n=Ck(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}E(gie,"listCacheSet");var RXe=gie;function bf(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?WD(o,e-1,r,n,i):VD(i,o):n||(i[i.length]=o)}return i}E(WD,"baseFlatten");var UD=WD;function Die(t){var e=t==null?0:t.length;return e?UD(t,1):[]}E(Die,"flatten");var Ho=Die,XXe=jne(Object.getPrototypeOf,Object),Mie=XXe;function Nie(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++no))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&Bje?new QD:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&xk(e[0],e[1],i)&&(n=1);++r=IZe&&(a=JD,s=!1,e=new QD(e));e:for(;++i-1?i[a?e[s]:s]:void 0}}E(Mse,"createFind");var PZe=Mse,BZe=Math.max;function Nse(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Wx(r);return i<0&&(i=BZe(n+i,0)),mne(t,Kl(e),i)}E(Nse,"findIndex");var FZe=Nse,zZe=PZe(FZe),xg=zZe;function Ose(t){return t&&t.length?t[0]:void 0}E(Ose,"head");var Xo=Ose;function $se(t,e){var r=-1,n=Xl(t)?Array(t.length):[];return Cf(t,function(i,a,s){n[++r]=e(i,a,s)}),n}E($se,"baseMap");var GZe=$se;function Pse(t,e){var r=Zr(t)?Vx:GZe;return r(t,Kl(e))}E(Pse,"map");var ur=Pse;function Bse(t,e){return UD(ur(t,e),1)}E(Bse,"flatMap");var To=Bse,qZe=Object.prototype,VZe=qZe.hasOwnProperty,WZe=_Ze(function(t,e,r){VZe.call(t,r)?t[r].push(e):$D(t,r,[e])}),UZe=WZe,HZe=Object.prototype,YZe=HZe.hasOwnProperty;function Fse(t,e){return t!=null&&YZe.call(t,e)}E(Fse,"baseHas");var XZe=Fse;function zse(t,e){return t!=null&&nse(t,e,XZe)}E(zse,"has");var br=zse,KZe="[object String]";function Gse(t){return typeof t=="string"||!Zr(t)&&Uo(t)&&Th(t)==KZe}E(Gse,"isString");var Ss=Gse;function qse(t,e){return Vx(e,function(r){return t[r]})}E(qse,"baseValues");var jZe=qse;function Vse(t){return t==null?[]:jZe(t,Ks(t))}E(Vse,"values");var Vi=Vse,ZZe=Math.max;function Wse(t,e,r,n){t=Xl(t)?t:Vi(t),r=r&&!n?Wx(r):0;var i=t.length;return r<0&&(r=ZZe(i+r,0)),Ss(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&OD(t,e,r)>-1}E(Wse,"includes");var ns=Wse,QZe=Math.max;function Use(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Wx(r);return i<0&&(i=QZe(n+i,0)),OD(t,e,i)}E(Use,"indexOf");var Hse=Use,JZe="[object Map]",eQe="[object Set]",tQe=Object.prototype,rQe=tQe.hasOwnProperty;function Yse(t){if(t==null)return!0;if(Xl(t)&&(Zr(t)||typeof t=="string"||typeof t.splice=="function"||Kx(t)||zD(t)||Tk(t)))return!t.length;var e=bg(t);if(e==JZe||e==eQe)return!t.size;if(Xx(t))return!Qne(t).length;for(var r in t)if(rQe.call(t,r))return!1;return!0}E(Yse,"isEmpty");var An=Yse,nQe="[object RegExp]";function Xse(t){return Uo(t)&&Th(t)==nQe}E(Xse,"baseIsRegExp");var iQe=Xse,Kse=wh&&wh.isRegExp,aQe=Kse?jx(Kse):iQe,Qc=aQe;function jse(t){return t===void 0}E(jse,"isUndefined");var Jc=jse,sQe="Expected a function";function Zse(t){if(typeof t!="function")throw new TypeError(sQe);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}E(Zse,"negate");var oQe=Zse;function Qse(t,e,r,n){if(!bo(t))return t;e=_k(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i=gQe){var u=e?null:pQe(t);if(u)return eM(u);s=!1,i=JD,l=new QD}else l=e?[]:o;e:for(;++n{r.accept(e)})}},E(Gm,"AbstractProduction"),Gm),is=(qm=class extends jl{constructor(e){super([]),this.idx=1,js(this,Ko(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},E(qm,"NonTerminal"),qm),Tg=(Vm=class extends jl{constructor(e){super(e.definition),this.orgText="",js(this,Ko(e,r=>r!==void 0))}},E(Vm,"Rule"),Vm),As=(Wm=class extends jl{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,js(this,Ko(e,r=>r!==void 0))}},E(Wm,"Alternative"),Wm),va=(Um=class extends jl{constructor(e){super(e.definition),this.idx=1,js(this,Ko(e,r=>r!==void 0))}},E(Um,"Option"),Um),Qs=(Hm=class extends jl{constructor(e){super(e.definition),this.idx=1,js(this,Ko(e,r=>r!==void 0))}},E(Hm,"RepetitionMandatory"),Hm),Js=(Ym=class extends jl{constructor(e){super(e.definition),this.idx=1,js(this,Ko(e,r=>r!==void 0))}},E(Ym,"RepetitionMandatoryWithSeparator"),Ym),ai=(Xm=class extends jl{constructor(e){super(e.definition),this.idx=1,js(this,Ko(e,r=>r!==void 0))}},E(Xm,"Repetition"),Xm),_s=(Km=class extends jl{constructor(e){super(e.definition),this.idx=1,js(this,Ko(e,r=>r!==void 0))}},E(Km,"RepetitionWithSeparator"),Km),Rs=(jm=class extends jl{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,js(this,Ko(e,r=>r!==void 0))}},E(jm,"Alternation"),jm),Pn=(Zm=class{constructor(e){this.idx=1,js(this,Ko(e,r=>r!==void 0))}accept(e){e.visit(this)}},E(Zm,"Terminal"),Zm);function hoe(t){return ur(t,sT)}E(hoe,"serializeGrammar");function sT(t){function e(r){return ur(r,sT)}if(E(e,"convertDefinition"),t instanceof is){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return Ss(t.label)&&(r.label=t.label),r}else{if(t instanceof As)return{type:"Alternative",definition:e(t.definition)};if(t instanceof va)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Qs)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Js)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:sT(new Pn({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof _s)return{type:"RepetitionWithSeparator",idx:t.idx,separator:sT(new Pn({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ai)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Rs)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Pn){const r={type:"Terminal",name:t.terminalType.name,label:coe(t.terminalType),idx:t.idx};Ss(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=Qc(n)?n.source:n),r}else{if(t instanceof Tg)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}E(sT,"serializeProduction");var wg=(Qm=class{visit(e){const r=e;switch(r.constructor){case is:return this.visitNonTerminal(r);case As:return this.visitAlternative(r);case va:return this.visitOption(r);case Qs:return this.visitRepetitionMandatory(r);case Js:return this.visitRepetitionMandatoryWithSeparator(r);case _s:return this.visitRepetitionWithSeparator(r);case ai:return this.visitRepetition(r);case Rs:return this.visitAlternation(r);case Pn:return this.visitTerminal(r);case Tg:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}},E(Qm,"GAstVisitor"),Qm);function doe(t){return t instanceof As||t instanceof va||t instanceof ai||t instanceof Qs||t instanceof Js||t instanceof _s||t instanceof Pn||t instanceof Tg}E(doe,"isSequenceProd");function oT(t,e=[]){return t instanceof va||t instanceof ai||t instanceof _s?!0:t instanceof Rs?soe(t.definition,n=>oT(n,e)):t instanceof is&&ns(e,t)?!1:t instanceof jl?(t instanceof is&&e.push(t),Yo(t.definition,n=>oT(n,e))):!1}E(oT,"isOptionalProd");function foe(t){return t instanceof Rs}E(foe,"isBranchingProd");function jo(t){if(t instanceof is)return"SUBRULE";if(t instanceof va)return"OPTION";if(t instanceof Rs)return"OR";if(t instanceof Qs)return"AT_LEAST_ONE";if(t instanceof Js)return"AT_LEAST_ONE_SEP";if(t instanceof _s)return"MANY_SEP";if(t instanceof ai)return"MANY";if(t instanceof Pn)return"CONSUME";throw Error("non exhaustive match")}E(jo,"getProductionDslName");var Nk=(Jm=class{walk(e,r=[]){kr(e.definition,(n,i)=>{const a=ya(e.definition,i+1);if(n instanceof is)this.walkProdRef(n,a,r);else if(n instanceof Pn)this.walkTerminal(n,a,r);else if(n instanceof As)this.walkFlat(n,a,r);else if(n instanceof va)this.walkOption(n,a,r);else if(n instanceof Qs)this.walkAtLeastOne(n,a,r);else if(n instanceof Js)this.walkAtLeastOneSep(n,a,r);else if(n instanceof _s)this.walkManySep(n,a,r);else if(n instanceof ai)this.walkMany(n,a,r);else if(n instanceof Rs)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new va({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=lM(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new va({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=lM(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);kr(e.definition,a=>{const s=new As({definition:[a]});this.walk(s,i)})}},E(Jm,"RestWalker"),Jm);function lM(t,e,r){return[new va({definition:[new Pn({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}E(lM,"restForRepetitionWithSeparator");function Cg(t){if(t instanceof is)return Cg(t.referencedRule);if(t instanceof Pn)return moe(t);if(doe(t))return poe(t);if(foe(t))return goe(t);throw Error("non exhaustive match")}E(Cg,"first");function poe(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=oT(a),e=e.concat(Cg(a)),n=n+1,i=r.length>n;return iM(e)}E(poe,"firstForSequence");function goe(t){const e=ur(t.definition,r=>Cg(r));return iM(Ho(e))}E(goe,"firstForBranching");function moe(t){return[t.terminalType]}E(moe,"firstForTerminal");var yoe="_~IN~_",yQe=(e1=class extends Nk{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=boe(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new As({definition:a}),o=Cg(s);this.follows[i]=o}},E(e1,"ResyncFollowsWalker"),e1);function voe(t){const e={};return kr(t,r=>{const n=new yQe(r).startWalking();js(e,n)}),e}E(voe,"computeAllProdsFollows");function boe(t,e){return t.name+e+yoe}E(boe,"buildBetweenProdsFollowPrefix");var Ok={},vQe=new yre;function lT(t){const e=t.toString();if(Ok.hasOwnProperty(e))return Ok[e];{const r=vQe.pattern(e);return Ok[e]=r,r}}E(lT,"getRegExpAst");function xoe(){Ok={}}E(xoe,"clearRegExpParserCache");var Toe="Complement Sets are not supported for first char optimization",$k=`Unable to use "first char" lexer optimizations: -`;function woe(t,e=!1){try{const r=lT(t);return Pk(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Toe)e&&aM(`${$k} Unable to optimize: < ${t.toString()} > +`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},E(Fm,"RegExpParser"),Fm),uk=(zm=class{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},E(zm,"BaseRegExpVisitor"),zm),kre=/\r?\n/gm,Ere=new Cre,hHe=(Gm=class extends uk{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const r=String.fromCharCode(e.value);if(!this.multiline&&r===` +`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=vg(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!` +`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},E(Gm,"TerminalRegExpVisitor"),Gm),ff=new hHe;function Sre(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=Ere.pattern(t),r=[];for(const n of e.value.value)ff.reset(t),ff.visit(n),r.push({start:ff.startRegexp,end:ff.endRegex});return r}catch{return[]}}E(Sre,"getTerminalParts");function bD(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),ff.reset(t),ff.visit(Ere.pattern(t)),ff.multiline}catch{return!1}}E(bD,"isMultilineComment");var Are=`\f +\r \v              \u2028\u2029   \uFEFF`.split("");function hk(t){const e=typeof t=="string"?new RegExp(t):t;return Are.some(r=>e.test(r))}E(hk,"isWhitespace");function vg(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}E(vg,"escapeRegExp");function xD(t,e){const r=TD(t),n=e.match(r);return!!n&&n[0].length>0}E(xD,"partialMatches");function TD(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(u){a+=r.substr(n,u),n+=u}E(o,"appendRaw");function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(E(l,"appendOptional");n",n)-n+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return E(i,"process"),new RegExp(i(),t.flags)}E(TD,"partialRegExp");function wD(t){return t.rules.find(e=>rs(e)&&e.entry)}E(wD,"getEntryRule");function CD(t){return t.rules.filter(e=>yo(e)&&e.hidden)}E(CD,"getHiddenRules");function dk(t,e){const r=new Set,n=wD(t);if(!n)return new Set(t.rules);const i=[n].concat(CD(t));for(const s of i)kD(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||yo(s)&&s.hidden)&&a.add(s);return a}E(dk,"getAllReachableRules");function kD(t,e,r){e.add(t.name),Uc(t).forEach(n=>{if(Kc(n)||r&&J3(n)){const i=n.rule.ref;i&&!e.has(i.name)&&kD(i,e,r)}})}E(kD,"ruleDfs");function _re(t){const e=new Set;return Uc(t).forEach(r=>{Qd(r)&&(rs(r.type.ref)&&e.add(r.type.ref),Ox(r.type.ref)&&rs(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}E(_re,"getAllRulesUsedForCrossReferences");function ED(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=mk(t.type.ref);return e==null?void 0:e.terminal}}E(ED,"getCrossReferenceTerminal");function SD(t){return t.hidden&&!hk(Vx(t))}E(SD,"isCommentTerminal");function AD(t,e){return!t||!e?[]:pk(t,e,t.astNode,!0)}E(AD,"findNodesForProperty");function fk(t,e,r){if(!t||!e)return;const n=pk(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}E(fk,"findNodeForProperty");function pk(t,e,r,n){if(!n){const i=jd(t.grammarSource,Hc);if(i&&i.feature===e)return[t]}return Wc(t)&&t.astNode===r?t.content.flatMap(i=>pk(i,e,r,!1)):[]}E(pk,"findNodesForPropertyInternal");function Rre(t,e){return t?gk(t,e,t==null?void 0:t.astNode):[]}E(Rre,"findNodesForKeyword");function _D(t,e,r){if(!t)return;const n=gk(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}E(_D,"findNodeForKeyword");function gk(t,e,r){if(t.astNode!==r)return[];if(Xc(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=gg(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?Xc(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}E(gk,"findNodesForKeywordInternal");function RD(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=jd(t.grammarSource,Hc);if(n)return n;t=t.container}}E(RD,"findAssignment");function mk(t){let e=t;return Ox(e)&&(gh(e.$container)?e=e.$container.$container:Zd(e.$container)?e=e.$container:xh(e.$container)),LD(t,e,new Map)}E(mk,"findNameAssignment");function LD(t,e,r){var i;function n(a,s){let o;return jd(a,Hc)||(o=LD(s,s,r)),r.set(t,o),o}if(E(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of Uc(e)){if(Hc(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Kc(a)&&rs(a.rule.ref))return n(a,a.rule.ref);if(Z3(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}E(LD,"findNameAssignmentInternal");function ID(t){const e=t.$container;if(ef(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(gh(a))return a;{const s=Uc(r[i]).find(gh);if(s)return s}}}if(B3(e))return ID(e)}E(ID,"getActionAtElement");function Lre(t,e){return t==="?"||t==="*"||ef(e)&&!!e.guardCondition}E(Lre,"isOptionalCardinality");function Ire(t){return t==="*"||t==="+"}E(Ire,"isArrayCardinality");function Dre(t){return t==="+="}E(Dre,"isArrayOperator");function Gx(t){return DD(t,new Set)}E(Gx,"isDataTypeRule");function DD(t,e){if(e.has(t))return!0;e.add(t);for(const r of Uc(t))if(Kc(r)){if(!r.rule.ref||rs(r.rule.ref)&&!DD(r.rule.ref,e)||lg(r.rule.ref))return!1}else{if(Hc(r))return!1;if(gh(r))return!1}return!!t.definition}E(DD,"isDataTypeRuleInternal");function Mre(t){return yk(t.type,new Set)}E(Mre,"isDataType");function yk(t,e){if(e.has(t))return!0;if(e.add(t),G9(t))return!1;if(Z9(t))return!1;if(rD(t))return t.types.every(r=>yk(r,e));if(Z3(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const r=t.typeRef.ref;return ek(r)?yk(r.type,e):!1}else return!1}else return!1}E(yk,"isDataTypeInternal");function qx(t){if(!yo(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}E(qx,"getExplicitRuleType");function pf(t){if(Zd(t))return rs(t)&&Gx(t)?t.name:qx(t)??t.name;if(Y9(t)||ek(t)||J9(t))return t.name;if(gh(t)){const e=MD(t);if(e)return e}else if(Ox(t))return t.name;throw new Error("Cannot get name of Unknown Type")}E(pf,"getTypeName");function MD(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return pf(t.type.ref)}E(MD,"getActionType");function Nre(t){var e;return yo(t)?((e=t.type)==null?void 0:e.name)??"string":rs(t)&&Gx(t)?t.name:qx(t)??t.name}E(Nre,"getRuleTypeName");function ND(t){var e;return yo(t)?((e=t.type)==null?void 0:e.name)??"string":qx(t)??t.name}E(ND,"getRuleType");function Vx(t){const e={s:!1,i:!1,u:!1},r=gf(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}E(Vx,"terminalRegex");var OD=/[\s\S]/.source;function gf(t,e){var r;if(eD(t))return Ore(t);if(tD(t))return $re(t);if(V9(t))return Fre(t);if(J3(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Hl(gf(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(X9(t))return Bre(t);if(nD(t))return Pre(t);if(Q9(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),a=t.regex.substring(n+1);return e&&(e.i=a.includes("i"),e.s=a.includes("s"),e.u=a.includes("u")),Hl(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(iD(t))return Hl(OD,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}E(gf,"abstractElementToRegex");function Ore(t){return Hl(t.elements.map(e=>gf(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}E(Ore,"terminalAlternativesToRegex");function $re(t){return Hl(t.elements.map(e=>gf(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}E($re,"terminalGroupToRegex");function Pre(t){return Hl(`${OD}*?${gf(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}E(Pre,"untilTokenToRegex");function Bre(t){return Hl(`(?!${gf(t.terminal)})${OD}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}E(Bre,"negateTokenToRegex");function Fre(t){return t.right?Hl(`[${vk(t.left)}-${vk(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Hl(vk(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}E(Fre,"characterRangeToRegex");function vk(t){return vg(t.value)}E(vk,"keywordToRegex");function Hl(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}E(Hl,"withCardinality");function $D(t){const e=[],r=t.Grammar;for(const n of r.rules)yo(n)&&SD(n)&&bD(Vx(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:cD}}E($D,"createGrammarConfig");var dHe=typeof global=="object"&&global&&global.Object===Object&&global,zre=dHe,fHe=typeof self=="object"&&self&&self.Object===Object&&self,pHe=zre||fHe||Function("return this")(),Yl=pHe,gHe=Yl.Symbol,vo=gHe,Gre=Object.prototype,mHe=Gre.hasOwnProperty,yHe=Gre.toString,Wx=vo?vo.toStringTag:void 0;function qre(t){var e=mHe.call(t,Wx),r=t[Wx];try{t[Wx]=void 0;var n=!0}catch{}var i=yHe.call(t);return n&&(e?t[Wx]=r:delete t[Wx]),i}E(qre,"getRawTag");var vHe=qre,bHe=Object.prototype,xHe=bHe.toString;function Vre(t){return xHe.call(t)}E(Vre,"objectToString");var THe=Vre,wHe="[object Null]",CHe="[object Undefined]",Wre=vo?vo.toStringTag:void 0;function Ure(t){return t==null?t===void 0?CHe:wHe:Wre&&Wre in Object(t)?vHe(t):THe(t)}E(Ure,"baseGetTag");var Th=Ure;function Hre(t){return t!=null&&typeof t=="object"}E(Hre,"isObjectLike");var Uo=Hre,kHe="[object Symbol]";function Yre(t){return typeof t=="symbol"||Uo(t)&&Th(t)==kHe}E(Yre,"isSymbol");var bk=Yre;function Xre(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=sYe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}E(yne,"shortOut");var cYe=yne;function vne(t){return function(){return t}}E(vne,"constant");var uYe=vne,hYe=(function(){try{var t=yf(Object,"defineProperty");return t({},"",{}),t}catch{}})(),xk=hYe,dYe=xk?function(t,e){return xk(t,"toString",{configurable:!0,enumerable:!1,value:uYe(e),writable:!0})}:Yx,fYe=dYe,pYe=cYe(fYe),gYe=pYe;function bne(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}E(Sne,"arrayIncludes");var Ane=Sne,vYe=9007199254740991,bYe=/^(?:0|[1-9]\d*)$/;function _ne(t,e){var r=typeof t;return e=e??vYe,!!e&&(r=="number"||r!="symbol"&&bYe.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=CYe}E($ne,"isLength");var VD=$ne;function Pne(t){return t!=null&&VD(t.length)&&!Zc(t)}E(Pne,"isArrayLike");var Xl=Pne;function Bne(t,e,r){if(!bo(r))return!1;var n=typeof e;return(n=="number"?Xl(r)&&Tk(e,r.length):n=="string"&&e in r)?Xx(r[e],t):!1}E(Bne,"isIterateeCall");var Ck=Bne;function Fne(t){return qD(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&Ck(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}E(xie,"listCacheHas");var GXe=xie;function Tie(t,e){var r=this.__data__,n=Sk(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}E(Tie,"listCacheSet");var qXe=Tie;function bf(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?KD(o,e-1,r,n,i):XD(i,o):n||(i[i.length]=o)}return i}E(KD,"baseFlatten");var jD=KD;function Bie(t){var e=t==null?0:t.length;return e?jD(t,1):[]}E(Bie,"flatten");var Ho=Bie,oKe=rie(Object.getPrototypeOf,Object),Fie=oKe;function zie(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++no))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&Zje?new nM:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&Ck(e[0],e[1],i)&&(n=1);++r=WZe&&(a=iM,s=!1,e=new nM(e));e:for(;++i-1?i[a?e[s]:s]:void 0}}E(Fse,"createFind");var jZe=Fse,ZZe=Math.max;function zse(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Hx(r);return i<0&&(i=ZZe(n+i,0)),wne(t,Kl(e),i)}E(zse,"findIndex");var QZe=zse,JZe=jZe(QZe),Tg=JZe;function Gse(t){return t&&t.length?t[0]:void 0}E(Gse,"head");var Xo=Gse;function qse(t,e){var r=-1,n=Xl(t)?Array(t.length):[];return Cf(t,function(i,a,s){n[++r]=e(i,a,s)}),n}E(qse,"baseMap");var eQe=qse;function Vse(t,e){var r=Zr(t)?Ux:eQe;return r(t,Kl(e))}E(Vse,"map");var ur=Vse;function Wse(t,e){return jD(ur(t,e),1)}E(Wse,"flatMap");var To=Wse,tQe=Object.prototype,rQe=tQe.hasOwnProperty,nQe=GZe(function(t,e,r){rQe.call(t,r)?t[r].push(e):GD(t,r,[e])}),iQe=nQe,aQe=Object.prototype,sQe=aQe.hasOwnProperty;function Use(t,e){return t!=null&&sQe.call(t,e)}E(Use,"baseHas");var oQe=Use;function Hse(t,e){return t!=null&&cse(t,e,oQe)}E(Hse,"has");var br=Hse,lQe="[object String]";function Yse(t){return typeof t=="string"||!Zr(t)&&Uo(t)&&Th(t)==lQe}E(Yse,"isString");var Ss=Yse;function Xse(t,e){return Ux(e,function(r){return t[r]})}E(Xse,"baseValues");var cQe=Xse;function Kse(t){return t==null?[]:cQe(t,Ks(t))}E(Kse,"values");var Vi=Kse,uQe=Math.max;function jse(t,e,r,n){t=Xl(t)?t:Vi(t),r=r&&!n?Hx(r):0;var i=t.length;return r<0&&(r=uQe(i+r,0)),Ss(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&zD(t,e,r)>-1}E(jse,"includes");var ns=jse,hQe=Math.max;function Zse(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Hx(r);return i<0&&(i=hQe(n+i,0)),zD(t,e,i)}E(Zse,"indexOf");var Qse=Zse,dQe="[object Map]",fQe="[object Set]",pQe=Object.prototype,gQe=pQe.hasOwnProperty;function Jse(t){if(t==null)return!0;if(Xl(t)&&(Zr(t)||typeof t=="string"||typeof t.splice=="function"||Zx(t)||UD(t)||kk(t)))return!t.length;var e=xg(t);if(e==dQe||e==fQe)return!t.size;if(jx(t))return!iie(t).length;for(var r in t)if(gQe.call(t,r))return!1;return!0}E(Jse,"isEmpty");var An=Jse,mQe="[object RegExp]";function eoe(t){return Uo(t)&&Th(t)==mQe}E(eoe,"baseIsRegExp");var yQe=eoe,toe=wh&&wh.isRegExp,vQe=toe?Qx(toe):yQe,Qc=vQe;function roe(t){return t===void 0}E(roe,"isUndefined");var Jc=roe,bQe="Expected a function";function noe(t){if(typeof t!="function")throw new TypeError(bQe);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}E(noe,"negate");var xQe=noe;function ioe(t,e,r,n){if(!bo(t))return t;e=Ik(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i=_Qe){var u=e?null:AQe(t);if(u)return aM(u);s=!1,i=iM,l=new nM}else l=e?[]:o;e:for(;++n{r.accept(e)})}},E(qm,"AbstractProduction"),qm),is=(Vm=class extends jl{constructor(e){super([]),this.idx=1,js(this,Ko(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},E(Vm,"NonTerminal"),Vm),wg=(Wm=class extends jl{constructor(e){super(e.definition),this.orgText="",js(this,Ko(e,r=>r!==void 0))}},E(Wm,"Rule"),Wm),As=(Um=class extends jl{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,js(this,Ko(e,r=>r!==void 0))}},E(Um,"Alternative"),Um),va=(Hm=class extends jl{constructor(e){super(e.definition),this.idx=1,js(this,Ko(e,r=>r!==void 0))}},E(Hm,"Option"),Hm),Qs=(Ym=class extends jl{constructor(e){super(e.definition),this.idx=1,js(this,Ko(e,r=>r!==void 0))}},E(Ym,"RepetitionMandatory"),Ym),Js=(Xm=class extends jl{constructor(e){super(e.definition),this.idx=1,js(this,Ko(e,r=>r!==void 0))}},E(Xm,"RepetitionMandatoryWithSeparator"),Xm),ai=(Km=class extends jl{constructor(e){super(e.definition),this.idx=1,js(this,Ko(e,r=>r!==void 0))}},E(Km,"Repetition"),Km),_s=(jm=class extends jl{constructor(e){super(e.definition),this.idx=1,js(this,Ko(e,r=>r!==void 0))}},E(jm,"RepetitionWithSeparator"),jm),Rs=(Zm=class extends jl{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,js(this,Ko(e,r=>r!==void 0))}},E(Zm,"Alternation"),Zm),Pn=(Qm=class{constructor(e){this.idx=1,js(this,Ko(e,r=>r!==void 0))}accept(e){e.visit(this)}},E(Qm,"Terminal"),Qm);function yoe(t){return ur(t,lT)}E(yoe,"serializeGrammar");function lT(t){function e(r){return ur(r,lT)}if(E(e,"convertDefinition"),t instanceof is){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return Ss(t.label)&&(r.label=t.label),r}else{if(t instanceof As)return{type:"Alternative",definition:e(t.definition)};if(t instanceof va)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Qs)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Js)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:lT(new Pn({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof _s)return{type:"RepetitionWithSeparator",idx:t.idx,separator:lT(new Pn({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ai)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Rs)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Pn){const r={type:"Terminal",name:t.terminalType.name,label:goe(t.terminalType),idx:t.idx};Ss(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=Qc(n)?n.source:n),r}else{if(t instanceof wg)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}E(lT,"serializeProduction");var Cg=(Jm=class{visit(e){const r=e;switch(r.constructor){case is:return this.visitNonTerminal(r);case As:return this.visitAlternative(r);case va:return this.visitOption(r);case Qs:return this.visitRepetitionMandatory(r);case Js:return this.visitRepetitionMandatoryWithSeparator(r);case _s:return this.visitRepetitionWithSeparator(r);case ai:return this.visitRepetition(r);case Rs:return this.visitAlternation(r);case Pn:return this.visitTerminal(r);case wg:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}},E(Jm,"GAstVisitor"),Jm);function voe(t){return t instanceof As||t instanceof va||t instanceof ai||t instanceof Qs||t instanceof Js||t instanceof _s||t instanceof Pn||t instanceof wg}E(voe,"isSequenceProd");function cT(t,e=[]){return t instanceof va||t instanceof ai||t instanceof _s?!0:t instanceof Rs?doe(t.definition,n=>cT(n,e)):t instanceof is&&ns(e,t)?!1:t instanceof jl?(t instanceof is&&e.push(t),Yo(t.definition,n=>cT(n,e))):!1}E(cT,"isOptionalProd");function boe(t){return t instanceof Rs}E(boe,"isBranchingProd");function jo(t){if(t instanceof is)return"SUBRULE";if(t instanceof va)return"OPTION";if(t instanceof Rs)return"OR";if(t instanceof Qs)return"AT_LEAST_ONE";if(t instanceof Js)return"AT_LEAST_ONE_SEP";if(t instanceof _s)return"MANY_SEP";if(t instanceof ai)return"MANY";if(t instanceof Pn)return"CONSUME";throw Error("non exhaustive match")}E(jo,"getProductionDslName");var Pk=(e1=class{walk(e,r=[]){kr(e.definition,(n,i)=>{const a=ya(e.definition,i+1);if(n instanceof is)this.walkProdRef(n,a,r);else if(n instanceof Pn)this.walkTerminal(n,a,r);else if(n instanceof As)this.walkFlat(n,a,r);else if(n instanceof va)this.walkOption(n,a,r);else if(n instanceof Qs)this.walkAtLeastOne(n,a,r);else if(n instanceof Js)this.walkAtLeastOneSep(n,a,r);else if(n instanceof _s)this.walkManySep(n,a,r);else if(n instanceof ai)this.walkMany(n,a,r);else if(n instanceof Rs)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new va({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=fM(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new va({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=fM(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);kr(e.definition,a=>{const s=new As({definition:[a]});this.walk(s,i)})}},E(e1,"RestWalker"),e1);function fM(t,e,r){return[new va({definition:[new Pn({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}E(fM,"restForRepetitionWithSeparator");function kg(t){if(t instanceof is)return kg(t.referencedRule);if(t instanceof Pn)return woe(t);if(voe(t))return xoe(t);if(boe(t))return Toe(t);throw Error("non exhaustive match")}E(kg,"first");function xoe(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=cT(a),e=e.concat(kg(a)),n=n+1,i=r.length>n;return cM(e)}E(xoe,"firstForSequence");function Toe(t){const e=ur(t.definition,r=>kg(r));return cM(Ho(e))}E(Toe,"firstForBranching");function woe(t){return[t.terminalType]}E(woe,"firstForTerminal");var Coe="_~IN~_",LQe=(t1=class extends Pk{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=Eoe(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new As({definition:a}),o=kg(s);this.follows[i]=o}},E(t1,"ResyncFollowsWalker"),t1);function koe(t){const e={};return kr(t,r=>{const n=new LQe(r).startWalking();js(e,n)}),e}E(koe,"computeAllProdsFollows");function Eoe(t,e){return t.name+e+Coe}E(Eoe,"buildBetweenProdsFollowPrefix");var Bk={},IQe=new Cre;function uT(t){const e=t.toString();if(Bk.hasOwnProperty(e))return Bk[e];{const r=IQe.pattern(e);return Bk[e]=r,r}}E(uT,"getRegExpAst");function Soe(){Bk={}}E(Soe,"clearRegExpParserCache");var Aoe="Complement Sets are not supported for first char optimization",Fk=`Unable to use "first char" lexer optimizations: +`;function _oe(t,e=!1){try{const r=uT(t);return zk(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Aoe)e&&uM(`${Fk} Unable to optimize: < ${t.toString()} > Complement Sets cannot be automatically optimized. This will disable the lexer's first char optimizations. See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=` This will disable the lexer's first char optimizations. - See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Mk(`${$k} + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),$k(`${Fk} Failed parsing: < ${t.toString()} > Using the @chevrotain/regexp-to-ast library - Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}E(woe,"getOptimizedStartCodesIndices");function Pk(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")cT(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)cT(h,e,r);else{for(let h=u.from;h<=u.to&&h=hT){const h=u.from>=hT?u.from:hT,d=u.to,f=eu(h),p=eu(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":Pk(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&Bk(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Vi(e)}E(Pk,"firstCharOptimizedIndices");function cT(t,e,r){const n=eu(t);e[n]=n,r===!0&&Coe(t,e)}E(cT,"addOptimizedIdxToResult");function Coe(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=eu(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=eu(i.charCodeAt(0));e[a]=a}}}E(Coe,"handleIgnoreCase");function cM(t,e){return xg(t.value,r=>{if(typeof r=="number")return ns(e,r);{const n=r;return xg(e,i=>n.from<=i&&i<=n.to)!==void 0}})}E(cM,"findCode");function Bk(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Zr(t.value)?Yo(t.value,Bk):Bk(t.value):!1}E(Bk,"isWholeOptional");var bQe=(t1=class extends ok{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){ns(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?cM(e,this.targetCharCodes)===void 0&&(this.found=!0):cM(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},E(t1,"CharCodeFinder"),t1);function Fk(t,e){if(e instanceof RegExp){const r=lT(e),n=new bQe(t);return n.visit(r),n.found}else return xg(e,r=>ns(t,r.charCodeAt(0)))!==void 0}E(Fk,"canMatchCharCode");var Ef="PATTERN",uT="defaultMode",zk="modes";function koe(t,e){e=nM(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` -`],tracer:E((T,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{Uoe()});let n;r("Reject Lexer.NA",()=>{n=Dk(t,T=>T[Ef]===as.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=ur(n,T=>{const b=T[Ef];if(Qc(b)){const w=b.source;return w.length===1&&w!=="^"&&w!=="$"&&w!=="."&&!b.ignoreCase?w:w.length===2&&w[0]==="\\"&&!ns(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],w[1])?w[1]:uM(b)}else{if(Zc(b))return i=!0,{exec:b};if(typeof b=="object")return i=!0,b;if(typeof b=="string"){if(b.length===1)return b;{const w=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),k=new RegExp(w);return uM(k)}}else throw Error("non exhaustive match")}})});let s,o,l,u,h;r("misc mapping",()=>{s=ur(n,T=>T.tokenTypeIdx),o=ur(n,T=>{const b=T.GROUP;if(b!==as.SKIPPED){if(Ss(b))return b;if(Jc(b))return!1;throw Error("non exhaustive match")}}),l=ur(n,T=>{const b=T.LONGER_ALT;if(b)return Zr(b)?ur(b,k=>Hse(n,k)):[Hse(n,b)]}),u=ur(n,T=>T.PUSH_MODE),h=ur(n,T=>br(T,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const T=fM(e.lineTerminatorCharacters);d=ur(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=ur(n,b=>br(b,"LINE_BREAKS")?!!b.LINE_BREAKS:dM(b,T)===!1&&Fk(T,b.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=ur(n,hM),p=ur(a,Voe),g=Zs(n,(T,b)=>{const w=b.GROUP;return Ss(w)&&w!==as.SKIPPED&&(T[w]=[]),T},{}),m=ur(a,(T,b)=>({pattern:a[b],longerAlt:l[b],canLineTerminator:d[b],isCustom:f[b],short:p[b],group:o[b],push:u[b],pop:h[b],tokenTypeIdx:s[b],tokenType:n[b]}))});let y=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=Zs(n,(T,b,w)=>{if(typeof b.PATTERN=="string"){const k=b.PATTERN.charCodeAt(0),A=eu(k);Gk(T,A,m[w])}else if(Zr(b.START_CHARS_HINT)){let k;kr(b.START_CHARS_HINT,A=>{const C=typeof A=="string"?A.charCodeAt(0):A,_=eu(C);k!==_&&(k=_,Gk(T,_,m[w]))})}else if(Qc(b.PATTERN))if(b.PATTERN.unicode)y=!1,e.ensureOptimizations&&Mk(`${$k} Unable to analyze < ${b.PATTERN.toString()} > pattern. + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}E(_oe,"getOptimizedStartCodesIndices");function zk(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")hT(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)hT(h,e,r);else{for(let h=u.from;h<=u.to&&h=fT){const h=u.from>=fT?u.from:fT,d=u.to,f=eu(h),p=eu(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":zk(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&Gk(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Vi(e)}E(zk,"firstCharOptimizedIndices");function hT(t,e,r){const n=eu(t);e[n]=n,r===!0&&Roe(t,e)}E(hT,"addOptimizedIdxToResult");function Roe(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=eu(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=eu(i.charCodeAt(0));e[a]=a}}}E(Roe,"handleIgnoreCase");function pM(t,e){return Tg(t.value,r=>{if(typeof r=="number")return ns(e,r);{const n=r;return Tg(e,i=>n.from<=i&&i<=n.to)!==void 0}})}E(pM,"findCode");function Gk(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Zr(t.value)?Yo(t.value,Gk):Gk(t.value):!1}E(Gk,"isWholeOptional");var DQe=(r1=class extends uk{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){ns(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?pM(e,this.targetCharCodes)===void 0&&(this.found=!0):pM(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},E(r1,"CharCodeFinder"),r1);function qk(t,e){if(e instanceof RegExp){const r=uT(e),n=new DQe(t);return n.visit(r),n.found}else return Tg(e,r=>ns(t,r.charCodeAt(0)))!==void 0}E(qk,"canMatchCharCode");var Ef="PATTERN",dT="defaultMode",Vk="modes";function Loe(t,e){e=lM(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:E((x,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{Zoe()});let n;r("Reject Lexer.NA",()=>{n=Ok(t,x=>x[Ef]===as.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=ur(n,x=>{const b=x[Ef];if(Qc(b)){const w=b.source;return w.length===1&&w!=="^"&&w!=="$"&&w!=="."&&!b.ignoreCase?w:w.length===2&&w[0]==="\\"&&!ns(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],w[1])?w[1]:gM(b)}else{if(Zc(b))return i=!0,{exec:b};if(typeof b=="object")return i=!0,b;if(typeof b=="string"){if(b.length===1)return b;{const w=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),k=new RegExp(w);return gM(k)}}else throw Error("non exhaustive match")}})});let s,o,l,u,h;r("misc mapping",()=>{s=ur(n,x=>x.tokenTypeIdx),o=ur(n,x=>{const b=x.GROUP;if(b!==as.SKIPPED){if(Ss(b))return b;if(Jc(b))return!1;throw Error("non exhaustive match")}}),l=ur(n,x=>{const b=x.LONGER_ALT;if(b)return Zr(b)?ur(b,k=>Qse(n,k)):[Qse(n,b)]}),u=ur(n,x=>x.PUSH_MODE),h=ur(n,x=>br(x,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const x=vM(e.lineTerminatorCharacters);d=ur(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=ur(n,b=>br(b,"LINE_BREAKS")?!!b.LINE_BREAKS:yM(b,x)===!1&&qk(x,b.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=ur(n,mM),p=ur(a,Koe),g=Zs(n,(x,b)=>{const w=b.GROUP;return Ss(w)&&w!==as.SKIPPED&&(x[w]=[]),x},{}),m=ur(a,(x,b)=>({pattern:a[b],longerAlt:l[b],canLineTerminator:d[b],isCustom:f[b],short:p[b],group:o[b],push:u[b],pop:h[b],tokenTypeIdx:s[b],tokenType:n[b]}))});let y=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=Zs(n,(x,b,w)=>{if(typeof b.PATTERN=="string"){const k=b.PATTERN.charCodeAt(0),S=eu(k);Wk(x,S,m[w])}else if(Zr(b.START_CHARS_HINT)){let k;kr(b.START_CHARS_HINT,S=>{const C=typeof S=="string"?S.charCodeAt(0):S,_=eu(C);k!==_&&(k=_,Wk(x,_,m[w]))})}else if(Qc(b.PATTERN))if(b.PATTERN.unicode)y=!1,e.ensureOptimizations&&$k(`${Fk} Unable to analyze < ${b.PATTERN.toString()} > pattern. The regexp unicode flag is not currently supported by the regexp-to-ast library. This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const k=woe(b.PATTERN,e.ensureOptimizations);An(k)&&(y=!1),kr(k,A=>{Gk(T,A,m[w])})}else e.ensureOptimizations&&Mk(`${$k} TokenType: <${b.name}> is using a custom token pattern without providing parameter. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const k=_oe(b.PATTERN,e.ensureOptimizations);An(k)&&(y=!1),kr(k,S=>{Wk(x,S,m[w])})}else e.ensureOptimizations&&$k(`${Fk} TokenType: <${b.name}> is using a custom token pattern without providing parameter. This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return T},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:y}}E(koe,"analyzeTokenTypes");function Eoe(t,e){let r=[];const n=Aoe(t);r=r.concat(n.errors);const i=_oe(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(Soe(a)),r=r.concat(Noe(a)),r=r.concat(Ooe(a,e)),r=r.concat($oe(a)),r}E(Eoe,"validatePatterns");function Soe(t){let e=[];const r=xo(t,n=>Qc(n[Ef]));return e=e.concat(Roe(r)),e=e.concat(Ioe(r)),e=e.concat(Doe(r)),e=e.concat(Moe(r)),e=e.concat(Loe(r)),e}E(Soe,"validateRegExpPattern");function Aoe(t){const e=xo(t,i=>!br(i,Ef)),r=ur(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:si.MISSING_PATTERN,tokenTypes:[i]})),n=Ik(t,e);return{errors:r,valid:n}}E(Aoe,"findMissingPatterns");function _oe(t){const e=xo(t,i=>{const a=i[Ef];return!Qc(a)&&!Zc(a)&&!br(a,"exec")&&!Ss(a)}),r=ur(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:si.INVALID_PATTERN,tokenTypes:[i]})),n=Ik(t,e);return{errors:r,valid:n}}E(_oe,"findInvalidPatterns");var xQe=/[^\\][$]/;function Roe(t){const i=class i extends ok{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}};E(i,"EndAnchorFinder");let e=i;const r=xo(t,a=>{const s=a.PATTERN;try{const o=lT(s),l=new e;return l.visit(o),l.found}catch{return xQe.test(s.source)}});return ur(r,a=>({message:`Unexpected RegExp Anchor Error: + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return x},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:y}}E(Loe,"analyzeTokenTypes");function Ioe(t,e){let r=[];const n=Moe(t);r=r.concat(n.errors);const i=Noe(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(Doe(a)),r=r.concat(zoe(a)),r=r.concat(Goe(a,e)),r=r.concat(qoe(a)),r}E(Ioe,"validatePatterns");function Doe(t){let e=[];const r=xo(t,n=>Qc(n[Ef]));return e=e.concat(Ooe(r)),e=e.concat(Poe(r)),e=e.concat(Boe(r)),e=e.concat(Foe(r)),e=e.concat($oe(r)),e}E(Doe,"validateRegExpPattern");function Moe(t){const e=xo(t,i=>!br(i,Ef)),r=ur(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:si.MISSING_PATTERN,tokenTypes:[i]})),n=Nk(t,e);return{errors:r,valid:n}}E(Moe,"findMissingPatterns");function Noe(t){const e=xo(t,i=>{const a=i[Ef];return!Qc(a)&&!Zc(a)&&!br(a,"exec")&&!Ss(a)}),r=ur(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:si.INVALID_PATTERN,tokenTypes:[i]})),n=Nk(t,e);return{errors:r,valid:n}}E(Noe,"findInvalidPatterns");var MQe=/[^\\][$]/;function Ooe(t){const i=class i extends uk{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}};E(i,"EndAnchorFinder");let e=i;const r=xo(t,a=>{const s=a.PATTERN;try{const o=uT(s),l=new e;return l.visit(o),l.found}catch{return MQe.test(s.source)}});return ur(r,a=>({message:`Unexpected RegExp Anchor Error: Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain end of input anchor '$' - See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:si.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}E(Roe,"findEndOfInputAnchor");function Loe(t){const e=xo(t,n=>n.PATTERN.test(""));return ur(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:si.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}E(Loe,"findEmptyMatchRegExps");var TQe=/[^\\[][\^]|^\^/;function Ioe(t){const i=class i extends ok{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}};E(i,"StartAnchorFinder");let e=i;const r=xo(t,a=>{const s=a.PATTERN;try{const o=lT(s),l=new e;return l.visit(o),l.found}catch{return TQe.test(s.source)}});return ur(r,a=>({message:`Unexpected RegExp Anchor Error: + See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:si.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}E(Ooe,"findEndOfInputAnchor");function $oe(t){const e=xo(t,n=>n.PATTERN.test(""));return ur(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:si.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}E($oe,"findEmptyMatchRegExps");var NQe=/[^\\[][\^]|^\^/;function Poe(t){const i=class i extends uk{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}};E(i,"StartAnchorFinder");let e=i;const r=xo(t,a=>{const s=a.PATTERN;try{const o=uT(s),l=new e;return l.visit(o),l.found}catch{return NQe.test(s.source)}});return ur(r,a=>({message:`Unexpected RegExp Anchor Error: Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain start of input anchor '^' - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:si.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}E(Ioe,"findStartOfInputAnchor");function Doe(t){const e=xo(t,n=>{const i=n[Ef];return i instanceof RegExp&&(i.multiline||i.global)});return ur(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:si.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}E(Doe,"findUnsupportedFlags");function Moe(t){const e=[];let r=ur(t,a=>Zs(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!ns(e,o)&&o.PATTERN!==as.NA&&(e.push(o),s.push(o)),s),[]));r=nT(r);const n=xo(r,a=>a.length>1);return ur(n,a=>{const s=ur(a,l=>l.name);return{message:`The same RegExp pattern ->${Xo(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:si.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}E(Moe,"findDuplicatePatterns");function Noe(t){const e=xo(t,n=>{if(!br(n,"GROUP"))return!1;const i=n.GROUP;return i!==as.SKIPPED&&i!==as.NA&&!Ss(i)});return ur(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:si.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}E(Noe,"findInvalidGroupType");function Ooe(t,e){const r=xo(t,i=>i.PUSH_MODE!==void 0&&!ns(e,i.PUSH_MODE));return ur(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:si.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}E(Ooe,"findModesThatDoNotExist");function $oe(t){const e=[],r=Zs(t,(n,i,a)=>{const s=i.PATTERN;return s===as.NA||(Ss(s)?n.push({str:s,idx:a,tokenType:i}):Qc(s)&&Boe(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return kr(t,(n,i)=>{kr(r,({str:a,idx:s,tokenType:o})=>{if(i${o.name}<- can never be matched. + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:si.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}E(Poe,"findStartOfInputAnchor");function Boe(t){const e=xo(t,n=>{const i=n[Ef];return i instanceof RegExp&&(i.multiline||i.global)});return ur(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:si.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}E(Boe,"findUnsupportedFlags");function Foe(t){const e=[];let r=ur(t,a=>Zs(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!ns(e,o)&&o.PATTERN!==as.NA&&(e.push(o),s.push(o)),s),[]));r=aT(r);const n=xo(r,a=>a.length>1);return ur(n,a=>{const s=ur(a,l=>l.name);return{message:`The same RegExp pattern ->${Xo(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:si.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}E(Foe,"findDuplicatePatterns");function zoe(t){const e=xo(t,n=>{if(!br(n,"GROUP"))return!1;const i=n.GROUP;return i!==as.SKIPPED&&i!==as.NA&&!Ss(i)});return ur(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:si.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}E(zoe,"findInvalidGroupType");function Goe(t,e){const r=xo(t,i=>i.PUSH_MODE!==void 0&&!ns(e,i.PUSH_MODE));return ur(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:si.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}E(Goe,"findModesThatDoNotExist");function qoe(t){const e=[],r=Zs(t,(n,i,a)=>{const s=i.PATTERN;return s===as.NA||(Ss(s)?n.push({str:s,idx:a,tokenType:i}):Qc(s)&&Woe(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return kr(t,(n,i)=>{kr(r,({str:a,idx:s,tokenType:o})=>{if(i${o.name}<- can never be matched. Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition. -See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:si.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}E($oe,"findUnreachablePatterns");function Poe(t,e){if(Qc(e)){if(Foe(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(Zc(e))return e(t,0,[],{});if(br(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}E(Poe,"tryToMatchStrToPattern");function Boe(t){return xg([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}E(Boe,"noMetaChar");function Foe(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition -`,type:si.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),br(t,zk)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+zk+`> property in its definition -`,type:si.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),br(t,zk)&&br(t,uT)&&!br(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${uT}: <${t.defaultMode}>which does not exist -`,type:si.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),br(t,zk)&&kr(t.modes,(i,a)=>{kr(i,(s,o)=>{if(Jc(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}> +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:si.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}E(qoe,"findUnreachablePatterns");function Voe(t,e){if(Qc(e)){if(Uoe(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(Zc(e))return e(t,0,[],{});if(br(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}E(Voe,"tryToMatchStrToPattern");function Woe(t){return Tg([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}E(Woe,"noMetaChar");function Uoe(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition +`,type:si.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),br(t,Vk)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Vk+`> property in its definition +`,type:si.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),br(t,Vk)&&br(t,dT)&&!br(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${dT}: <${t.defaultMode}>which does not exist +`,type:si.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),br(t,Vk)&&kr(t.modes,(i,a)=>{kr(i,(s,o)=>{if(Jc(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}> `,type:si.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(br(s,"LONGER_ALT")){const l=Zr(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];kr(l,u=>{!Jc(u)&&!ns(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${s.name}> outside of mode <${a}> -`,type:si.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}E(zoe,"performRuntimeChecks");function Goe(t,e,r){const n=[];let i=!1;const a=nT(Ho(Vi(t.modes))),s=Dk(a,l=>l[Ef]===as.NA),o=fM(r);return e&&kr(s,l=>{const u=dM(l,o);if(u!==!1){const d={message:Woe(l,u),type:u.issue,tokenType:l};n.push(d)}else br(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):Fk(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. +`,type:si.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}E(Hoe,"performRuntimeChecks");function Yoe(t,e,r){const n=[];let i=!1;const a=aT(Ho(Vi(t.modes))),s=Ok(a,l=>l[Ef]===as.NA),o=vM(r);return e&&kr(s,l=>{const u=yM(l,o);if(u!==!1){const d={message:joe(l,u),type:u.issue,tokenType:l};n.push(d)}else br(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):qk(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. This Lexer has been defined to track line and column information, But none of the Token Types can be identified as matching a line terminator. - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS - for details.`,type:si.NO_LINE_BREAKS_FLAGS}),n}E(Goe,"performWarningRuntimeChecks");function qoe(t){const e={},r=Ks(t);return kr(r,n=>{const i=t[n];if(Zr(i))e[n]=[];else throw Error("non exhaustive match")}),e}E(qoe,"cloneEmptyGroups");function hM(t){const e=t.PATTERN;if(Qc(e))return!1;if(Zc(e))return!0;if(br(e,"exec"))return!0;if(Ss(e))return!1;throw Error("non exhaustive match")}E(hM,"isCustomPattern");function Voe(t){return Ss(t)&&t.length===1?t.charCodeAt(0):!1}E(Voe,"isShortPattern");var wQe={test:E(function(t){const e=t.length;for(let r=this.lastIndex;r{const i=t[n];if(Zr(i))e[n]=[];else throw Error("non exhaustive match")}),e}E(Xoe,"cloneEmptyGroups");function mM(t){const e=t.PATTERN;if(Qc(e))return!1;if(Zc(e))return!0;if(br(e,"exec"))return!0;if(Ss(e))return!1;throw Error("non exhaustive match")}E(mM,"isCustomPattern");function Koe(t){return Ss(t)&&t.length===1?t.charCodeAt(0):!1}E(Koe,"isShortPattern");var OQe={test:E(function(t){const e=t.length;for(let r=this.lastIndex;r Token Type Root cause: ${e.errMsg}. For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===si.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. The problem is in the <${t.name}> Token Type - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}E(Woe,"buildLineBreakIssueMessage");function fM(t){return ur(t,r=>Ss(r)?r.charCodeAt(0):r)}E(fM,"getCharCodes");function Gk(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}E(Gk,"addToMapOfArrays");var hT=256,qk=[];function eu(t){return t255?255+~~(t/255):t}}E(Uoe,"initCharCodeToOptimizedIndexMap");function kg(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}E(kg,"tokenStructuredMatcher");function dT(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}E(dT,"tokenStructuredMatcherNoCategories");var Hoe=1,Yoe={};function Eg(t){const e=Xoe(t);Koe(e),Zoe(e),joe(e),kr(e,r=>{r.isParent=r.categoryMatches.length>0})}E(Eg,"augmentTokenTypes");function Xoe(t){let e=ma(t),r=t,n=!0;for(;n;){r=nT(Ho(ur(r,a=>a.CATEGORIES)));const i=Ik(r,e);e=e.concat(i),An(i)?n=!1:r=i}return e}E(Xoe,"expandCategories");function Koe(t){kr(t,e=>{gM(e)||(Yoe[Hoe]=e,e.tokenTypeIdx=Hoe++),mM(e)&&!Zr(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),mM(e)||(e.CATEGORIES=[]),Qoe(e)||(e.categoryMatches=[]),Joe(e)||(e.categoryMatchesMap={})})}E(Koe,"assignTokenDefaultProps");function joe(t){kr(t,e=>{e.categoryMatches=[],kr(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(Yoe[n].tokenTypeIdx)})})}E(joe,"assignCategoriesTokensProp");function Zoe(t){kr(t,e=>{pM([],e)})}E(Zoe,"assignCategoriesMapProp");function pM(t,e){kr(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),kr(e.CATEGORIES,r=>{const n=t.concat(e);ns(n,r)||pM(n,r)})}E(pM,"singleAssignCategoriesToksMap");function gM(t){return br(t,"tokenTypeIdx")}E(gM,"hasShortKeyProperty");function mM(t){return br(t,"CATEGORIES")}E(mM,"hasCategoriesProperty");function Qoe(t){return br(t,"categoryMatches")}E(Qoe,"hasExtendingTokensTypesProperty");function Joe(t){return br(t,"categoryMatchesMap")}E(Joe,"hasExtendingTokensTypesMapProperty");function ele(t){return br(t,"tokenTypeIdx")}E(ele,"isTokenType");var yM={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,a){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},si;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(si||(si={}));var fT={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` -`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:yM,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(fT);var as=(r1=class{constructor(e,r=fT){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${i}>`);const{time:o,value:l}=sM(a),u=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. -a boolean 2nd argument is no longer supported`);this.config=js({},fT,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===fT.lineTerminatorsPattern)this.config.lineTerminatorsPattern=wQe;else if(this.config.lineTerminatorCharacters===fT.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Zr(e)?i={modes:{defaultMode:ma(e)},defaultMode:uT}:(a=!1,i=ma(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(zoe(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Goe(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},kr(i.modes,(o,l)=>{i.modes[l]=Dk(o,u=>Jc(u))});const s=Ks(i.modes);if(kr(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Eoe(o,s))}),An(this.lexerDefinitionErrors)){Eg(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=koe(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=js({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!An(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=ur(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}E(joe,"buildLineBreakIssueMessage");function vM(t){return ur(t,r=>Ss(r)?r.charCodeAt(0):r)}E(vM,"getCharCodes");function Wk(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}E(Wk,"addToMapOfArrays");var fT=256,Uk=[];function eu(t){return t255?255+~~(t/255):t}}E(Zoe,"initCharCodeToOptimizedIndexMap");function Eg(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}E(Eg,"tokenStructuredMatcher");function pT(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}E(pT,"tokenStructuredMatcherNoCategories");var Qoe=1,Joe={};function Sg(t){const e=ele(t);tle(e),nle(e),rle(e),kr(e,r=>{r.isParent=r.categoryMatches.length>0})}E(Sg,"augmentTokenTypes");function ele(t){let e=ma(t),r=t,n=!0;for(;n;){r=aT(Ho(ur(r,a=>a.CATEGORIES)));const i=Nk(r,e);e=e.concat(i),An(i)?n=!1:r=i}return e}E(ele,"expandCategories");function tle(t){kr(t,e=>{xM(e)||(Joe[Qoe]=e,e.tokenTypeIdx=Qoe++),TM(e)&&!Zr(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),TM(e)||(e.CATEGORIES=[]),ile(e)||(e.categoryMatches=[]),ale(e)||(e.categoryMatchesMap={})})}E(tle,"assignTokenDefaultProps");function rle(t){kr(t,e=>{e.categoryMatches=[],kr(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(Joe[n].tokenTypeIdx)})})}E(rle,"assignCategoriesTokensProp");function nle(t){kr(t,e=>{bM([],e)})}E(nle,"assignCategoriesMapProp");function bM(t,e){kr(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),kr(e.CATEGORIES,r=>{const n=t.concat(e);ns(n,r)||bM(n,r)})}E(bM,"singleAssignCategoriesToksMap");function xM(t){return br(t,"tokenTypeIdx")}E(xM,"hasShortKeyProperty");function TM(t){return br(t,"CATEGORIES")}E(TM,"hasCategoriesProperty");function ile(t){return br(t,"categoryMatches")}E(ile,"hasExtendingTokensTypesProperty");function ale(t){return br(t,"categoryMatchesMap")}E(ale,"hasExtendingTokensTypesMapProperty");function sle(t){return br(t,"tokenTypeIdx")}E(sle,"isTokenType");var wM={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,a){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},si;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(si||(si={}));var gT={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` +`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:wM,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(gT);var as=(n1=class{constructor(e,r=gT){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${i}>`);const{time:o,value:l}=hM(a),u=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. +a boolean 2nd argument is no longer supported`);this.config=js({},gT,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===gT.lineTerminatorsPattern)this.config.lineTerminatorsPattern=OQe;else if(this.config.lineTerminatorCharacters===gT.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Zr(e)?i={modes:{defaultMode:ma(e)},defaultMode:dT}:(a=!1,i=ma(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Hoe(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Yoe(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},kr(i.modes,(o,l)=>{i.modes[l]=Ok(o,u=>Jc(u))});const s=Ks(i.modes);if(kr(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Ioe(o,s))}),An(this.lexerDefinitionErrors)){Sg(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=Loe(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=js({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!An(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=ur(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- `);throw new Error(`Errors detected in definition of Lexer: -`+l)}kr(this.lexerDefinitionWarning,o=>{aM(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=ta),this.trackStartLines===!1&&(this.computeNewColumn=Ux),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=ta),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=Zs(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!An(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. +`+l)}kr(this.lexerDefinitionWarning,o=>{uM(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=ta),this.trackStartLines===!1&&(this.computeNewColumn=Yx),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=ta),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=Zs(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!An(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. - Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{xoe()}),this.TRACE_INIT("toFastProperties",()=>{oM(this)})})}tokenize(e,r=this.defaultMode){if(!An(this.lexerDefinitionErrors)){const i=ur(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- + Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Soe()}),this.TRACE_INIT("toFastProperties",()=>{dM(this)})})}tokenize(e,r=this.defaultMode){if(!An(this.lexerDefinitionErrors)){const i=ur(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: -`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,l,u,h,d,f,p,g,m,y,v;const T=e,b=T.length;let w=0,k=0;const A=this.hasCustom?0:Math.floor(e.length/10),C=new Array(A),_=[];let L=this.trackStartLines?1:void 0,O=this.trackStartLines?1:void 0;const M=qoe(this.emptyGroups),z=this.trackStartLines,F=this.config.lineTerminatorsPattern;let S=0,R=[],N=[];const D=[],I=[];Object.freeze(I);let $=!1;const B=E(Y=>{if(D.length===1&&Y.tokenType.PUSH_MODE===void 0){const W=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Y);_.push({offset:Y.startOffset,line:Y.startLine,column:Y.startColumn,length:Y.image.length,message:W})}else{D.pop();const W=kf(D);R=this.patternIdxToConfig[W],N=this.charCodeToPatternIdxToConfig[W],S=R.length;const ie=this.canModeBeOptimized[W]&&this.config.safeMode===!1;N&&ie?$=!0:$=!1}},"pop_mode");function P(Y){D.push(Y),N=this.charCodeToPatternIdxToConfig[Y],R=this.patternIdxToConfig[Y],S=R.length,S=R.length;const W=this.canModeBeOptimized[Y]&&this.config.safeMode===!1;N&&W?$=!0:$=!1}E(P,"push_mode"),P.call(this,r);let G;const V=this.config.recoveryEnabled;for(;wl.length){l=s,d=s.length,u=h,G=Z;break}}}break}}if(d!==-1){if(f=G.group,f!==void 0&&(l=l!==null?l:e.substring(w,w+d),p=G.tokenTypeIdx,g=this.createTokenInstance(l,w,p,G.tokenType,L,O,d),this.handlePayload(g,u),f===!1?k=this.addToken(C,k,g):M[f].push(g)),z===!0&&G.canLineTerminator===!0){let K=0,se,J;F.lastIndex=0;do l=l!==null?l:e.substring(w,w+d),se=F.test(l),se===!0&&(J=F.lastIndex-1,K++);while(se===!0);K!==0?(L=L+K,O=d-J,this.updateTokenEndLineColumnLocation(g,f,J,K,L,O,d)):O=this.computeNewColumn(O,d)}else O=this.computeNewColumn(O,d);w=w+d,this.handleModes(G,B,P,g)}else{const K=w,se=L,J=O;let Z=V===!1;for(;Z===!1&&w ${Sf(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){const a="Expecting: ",o=` +`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,l,u,h,d,f,p,g,m,y,v;const x=e,b=x.length;let w=0,k=0;const S=this.hasCustom?0:Math.floor(e.length/10),C=new Array(S),_=[];let L=this.trackStartLines?1:void 0,O=this.trackStartLines?1:void 0;const M=Xoe(this.emptyGroups),z=this.trackStartLines,F=this.config.lineTerminatorsPattern;let A=0,R=[],N=[];const D=[],I=[];Object.freeze(I);let $=!1;const B=E(X=>{if(D.length===1&&X.tokenType.PUSH_MODE===void 0){const W=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(X);_.push({offset:X.startOffset,line:X.startLine,column:X.startColumn,length:X.image.length,message:W})}else{D.pop();const W=kf(D);R=this.patternIdxToConfig[W],N=this.charCodeToPatternIdxToConfig[W],A=R.length;const ie=this.canModeBeOptimized[W]&&this.config.safeMode===!1;N&&ie?$=!0:$=!1}},"pop_mode");function P(X){D.push(X),N=this.charCodeToPatternIdxToConfig[X],R=this.patternIdxToConfig[X],A=R.length,A=R.length;const W=this.canModeBeOptimized[X]&&this.config.safeMode===!1;N&&W?$=!0:$=!1}E(P,"push_mode"),P.call(this,r);let G;const V=this.config.recoveryEnabled;for(;wl.length){l=s,d=s.length,u=h,G=Z;break}}}break}}if(d!==-1){if(f=G.group,f!==void 0&&(l=l!==null?l:e.substring(w,w+d),p=G.tokenTypeIdx,g=this.createTokenInstance(l,w,p,G.tokenType,L,O,d),this.handlePayload(g,u),f===!1?k=this.addToken(C,k,g):M[f].push(g)),z===!0&&G.canLineTerminator===!0){let K=0,se,J;F.lastIndex=0;do l=l!==null?l:e.substring(w,w+d),se=F.test(l),se===!0&&(J=F.lastIndex-1,K++);while(se===!0);K!==0?(L=L+K,O=d-J,this.updateTokenEndLineColumnLocation(g,f,J,K,L,O,d)):O=this.computeNewColumn(O,d)}else O=this.computeNewColumn(O,d);w=w+d,this.handleModes(G,B,P,g)}else{const K=w,se=L,J=O;let Z=V===!1;for(;Z===!1&&w ${Sf(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){const a="Expecting: ",o=` but found: '`+Xo(e).image+"'";if(n)return a+n+o;{const l=Zs(t,(f,p)=>f.concat(p),[]),u=ur(l,f=>`[${ur(f,p=>Sf(p)).join(", ")}]`),d=`one of these possible Token sequences: ${ur(u,(f,p)=>` ${p+1}. ${f}`).join(` `)}`;return a+d+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",s=` but found: '`+Xo(e).image+"'";if(r)return i+r+s;{const l=`expecting at least one iteration which starts with one of these possible Token sequences:: - <${ur(t,u=>`[${ur(u,h=>Sf(h)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(Ag);var kQe={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- + <${ur(t,u=>`[${ur(u,h=>Sf(h)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(_g);var PQe={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- inside top level rule: ->`+t.name+"<-"}},Af={buildDuplicateFoundError(t,e){function r(h){return h instanceof Pn?h.terminalType.name:h instanceof is?h.nonTerminalName:""}E(r,"getExtraProductionArgument");const n=t.name,i=Xo(e),a=i.idx,s=jo(i),o=r(i),l=a>0;let u=`->${s}${l?a:""}<- ${o?`with argument: ->${o}<-`:""} - appears more than once (${e.length} times) in the top level rule: ->${n}<-. - For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + appears more than once (${e.length} times) in the top level rule: ->${n}<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,` `),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar. The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>. @@ -1281,48 +1281,48 @@ Only the last alternative may be an empty alternative.`},buildTooManyAlternative inside <${t.topLevelRule.name}> Rule. has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=ur(t.leftRecursionPath,a=>a.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar. rule: <${e}> can be invoked from itself (directly or indirectly) -without consuming any Tokens. The grammar path that causes this is: +without consuming any Tokens. The grammar path that causes this is: ${n} To fix this refactor your grammar to remove the left recursion. -see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Tg?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function ule(t,e){const r=new EQe(t,e);return r.resolveRefs(),r.errors}E(ule,"resolveGrammar");var EQe=(n1=class extends wg{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){kr(Vi(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:ss.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},E(n1,"GastRefResolverVisitor"),n1),SQe=(i1=class extends Nk{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=ma(this.path.ruleStack).reverse(),this.occurrenceStack=ma(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){An(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},E(i1,"AbstractNextPossibleTokensWalker"),i1),AQe=(a1=class extends SQe{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),a=new As({definition:i});this.possibleTokTypes=Cg(a),this.found=!0}}},E(a1,"NextAfterTokenWalker"),a1),Vk=(s1=class extends Nk{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},E(s1,"AbstractNextTerminalAfterProductionWalker"),s1),_Qe=(o1=class extends Vk{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Xo(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Pn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},E(o1,"NextTerminalAfterManyWalker"),o1),hle=(l1=class extends Vk{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Xo(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Pn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},E(l1,"NextTerminalAfterManySepWalker"),l1),RQe=(c1=class extends Vk{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Xo(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Pn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},E(c1,"NextTerminalAfterAtLeastOneWalker"),c1),dle=(u1=class extends Vk{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Xo(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Pn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},E(u1,"NextTerminalAfterAtLeastOneSepWalker"),u1);function Wk(t,e,r=[]){r=ma(r);let n=[],i=0;function a(o){return o.concat(ya(t,i+1))}E(a,"remainingPathWith");function s(o){const l=Wk(a(o),e,r);return n.concat(l)}for(E(s,"getAlternativesForProd");r.length{An(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof Pn)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:ya(t,i)}),n}E(Wk,"possiblePathsFrom");function xM(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!An(d);){const f=d.pop();if(f===s){o&&kf(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(An(p))continue;const v=p[0];if(v===i){const T={idx:g,def:ya(p),ruleStack:aT(m),occurrenceStack:aT(y)};d.push(T)}else if(v instanceof Pn)if(g=0;T--){const b=v.definition[T],w={idx:g,def:b.definition.concat(ya(p)),ruleStack:m,occurrenceStack:y};d.push(w),d.push(s)}else if(v instanceof As)d.push({idx:g,def:v.definition.concat(ya(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof Tg)d.push(fle(v,g,m,y));else throw Error("non exhaustive match")}return h}E(xM,"nextPossibleTokensAfter");function fle(t,e,r,n){const i=ma(r);i.push(t.name);const a=ma(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}E(fle,"expandTopLevelRule");var Qn;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(Qn||(Qn={}));function Uk(t){if(t instanceof va||t==="Option")return Qn.OPTION;if(t instanceof ai||t==="Repetition")return Qn.REPETITION;if(t instanceof Qs||t==="RepetitionMandatory")return Qn.REPETITION_MANDATORY;if(t instanceof Js||t==="RepetitionMandatoryWithSeparator")return Qn.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof _s||t==="RepetitionWithSeparator")return Qn.REPETITION_WITH_SEPARATOR;if(t instanceof Rs||t==="Alternation")return Qn.ALTERNATION;throw Error("non exhaustive match")}E(Uk,"getProdType");function TM(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=Uk(n);return a===Qn.ALTERNATION?gT(e,r,i):mT(e,r,a,i)}E(TM,"getLookaheadPaths");function ple(t,e,r,n,i,a){const s=gT(t,e,r),o=kM(s)?dT:kg;return a(s,n,o,i)}E(ple,"buildLookaheadFuncForOr");function gle(t,e,r,n,i,a){const s=mT(t,e,i,r),o=kM(s)?dT:kg;return a(s[0],o,n)}E(gle,"buildLookaheadFuncForOptionalProd");function mle(t,e,r,n){const i=t.length,a=Yo(t,s=>Yo(s,o=>o.length===1));if(e)return function(s){const o=ur(s,l=>l.GATE);for(let l=0;lHo(l)),o=Zs(s,(l,u,h)=>(kr(u,d=>{br(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),kr(d.categoryMatches,f=>{br(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let s=0;sa.length===1),i=t.length;if(n&&!r){const a=Ho(t);if(a.length===1&&An(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=Zs(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,kr(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;aWk([s],1)),n=wM(r.length),i=ur(r,s=>{const o={};return kr(s,l=>{const u=Hk(l.partialPath);kr(u,h=>{o[h]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=wM(o.length);for(let l=0;l{const v=Hk(y.partialPath);kr(v,T=>{i[l][T]=!0})})}}}}return n}E(CM,"lookAheadSequenceFromAlternatives");function gT(t,e,r,n){const i=new vle(t,Qn.ALTERNATION,n);return e.accept(i),CM(i.result,r)}E(gT,"getLookaheadPathsForOr");function mT(t,e,r,n){const i=new vle(t,r);e.accept(i);const a=i.result,o=new LQe(e,t,r).startWalking(),l=new As({definition:a}),u=new As({definition:o});return CM([l,u],n)}E(mT,"getLookaheadPathsForOptionalProd");function Yk(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}E(xle,"isStrictPrefixOfPath");function kM(t){return Yo(t,e=>Yo(e,r=>Yo(r,n=>An(n.categoryMatches))))}E(kM,"areTokenCategoriesNotUsed");function Tle(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return ur(e,r=>Object.assign({type:ss.CUSTOM_LOOKAHEAD_VALIDATION},r))}E(Tle,"validateLookahead");function wle(t,e,r,n){const i=To(t,l=>Cle(l,r)),a=Mle(t,e,r),s=To(t,l=>Rle(l,r)),o=To(t,l=>Ele(l,t,n,r));return i.concat(a,s,o)}E(wle,"validateGrammar");function Cle(t,e){const r=new IQe;t.accept(r);const n=r.allProductions,i=UZe(n,kle),a=Ko(i,o=>o.length>1);return ur(Vi(a),o=>{const l=Xo(o),u=e.buildDuplicateFoundError(t,o),h=jo(l),d={message:u,type:ss.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=EM(l);return f&&(d.parameter=f),d})}E(Cle,"validateDuplicateProductions");function kle(t){return`${jo(t)}_#_${t.idx}_#_${EM(t)}`}E(kle,"identifyProductionForDuplicates");function EM(t){return t instanceof Pn?t.terminalType.name:t instanceof is?t.nonTerminalName:""}E(EM,"getExtraProductionArgument");var IQe=(f1=class extends wg{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}},E(f1,"OccurrenceValidationCollector"),f1);function Ele(t,e,r,n){const i=[];if(Zs(e,(s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:ss.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}E(Ele,"validateRuleDoesNotAlreadyExist");function Sle(t,e,r){const n=[];let i;return ns(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:ss.INVALID_RULE_OVERRIDE,ruleName:t})),n}E(Sle,"validateRuleIsOverridden");function SM(t,e,r,n=[]){const i=[],a=yT(e.definition);if(An(a))return[];{const s=t.name;ns(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:ss.LEFT_RECURSION,ruleName:s});const l=Ik(a,n.concat([t])),u=To(l,h=>{const d=ma(n);return d.push(h),SM(t,h,r,d)});return i.concat(u)}}E(SM,"validateNoLeftRecursion");function yT(t){let e=[];if(An(t))return e;const r=Xo(t);if(r instanceof is)e.push(r.referencedRule);else if(r instanceof As||r instanceof va||r instanceof Qs||r instanceof Js||r instanceof _s||r instanceof ai)e=e.concat(yT(r.definition));else if(r instanceof Rs)e=Ho(ur(r.definition,a=>yT(a.definition)));else if(!(r instanceof Pn))throw Error("non exhaustive match");const n=oT(r),i=t.length>1;if(n&&i){const a=ya(t);return e.concat(yT(a))}else return e}E(yT,"getFirstNoneTerminal");var AM=(p1=class extends wg{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},E(p1,"OrCollector"),p1);function Ale(t,e){const r=new AM;t.accept(r);const n=r.alternations;return To(n,a=>{const s=aT(a.definition);return To(s,(o,l)=>{const u=xM([o],[],kg,1);return An(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:ss.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}E(Ale,"validateEmptyOrAlternative");function _le(t,e,r){const n=new AM;t.accept(n);let i=n.alternations;return i=Dk(i,s=>s.ignoreAmbiguities===!0),To(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=gT(o,t,l,s),h=Ile(u,s,t,r),d=Dle(u,s,t,r);return h.concat(d)})}E(_le,"validateAmbiguousAlternationAlternatives");var DQe=(g1=class extends wg{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}},E(g1,"RepetitionCollector"),g1);function Rle(t,e){const r=new AM;t.accept(r);const n=r.alternations;return To(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:ss.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}E(Rle,"validateTooManyAlts");function Lle(t,e,r){const n=[];return kr(t,i=>{const a=new DQe;i.accept(a);const s=a.allProductions;kr(s,o=>{const l=Uk(o),u=o.maxLookahead||e,h=o.idx,f=mT(h,i,l,u)[0];if(An(Ho(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:ss.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}E(Lle,"validateSomeNonEmptyLookaheadPath");function Ile(t,e,r,n){const i=[],a=Zs(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||kr(l,h=>{const d=[u];kr(t,(f,p)=>{u!==p&&Yk(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!Yk(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return ur(a,o=>{const l=ur(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:ss.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}E(Ile,"checkAlternativesAmbiguities");function Dle(t,e,r,n){const i=Zs(t,(s,o,l)=>{const u=ur(o,h=>({idx:l,path:h}));return s.concat(u)},[]);return nT(To(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,h=xo(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:ss.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}E(Dle,"checkPrefixAlternativesAmbiguities");function Mle(t,e,r){const n=[],i=ur(e,a=>a.name);return kr(t,a=>{const s=a.name;if(ns(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:ss.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}E(Mle,"checkTerminalAndNoneTerminalsNameSpace");function Nle(t){const e=nM(t,{errMsgProvider:kQe}),r={};return kr(t.rules,n=>{r[n.name]=n}),ule(r,e.errMsgProvider)}E(Nle,"resolveGrammar");function Ole(t){return t=nM(t,{errMsgProvider:Af}),wle(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}E(Ole,"validateGrammar");var $le="MismatchedTokenException",Ple="NoViableAltException",Ble="EarlyExitException",Fle="NotAllInputParsedException",zle=[$le,Ple,Ble,Fle];Object.freeze(zle);function vT(t){return ns(zle,t.name)}E(vT,"isRecognitionException");var Xk=(m1=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},E(m1,"RecognitionException"),m1),Gle=(y1=class extends Xk{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=$le}},E(y1,"MismatchedTokenException"),y1),MQe=(v1=class extends Xk{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Ple}},E(v1,"NoViableAltException"),v1),NQe=(b1=class extends Xk{constructor(e,r){super(e,r),this.name=Fle}},E(b1,"NotAllInputParsedException"),b1),OQe=(x1=class extends Xk{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Ble}},E(x1,"EarlyExitException"),x1),_M={},qle="InRuleRecoveryException",$Qe=(T1=class extends Error{constructor(e){super(e),this.name=qle}},E(T1,"InRuleRecoveryException"),T1),PQe=(w1=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=br(e,"recoveryEnabled")?e.recoveryEnabled:tu.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Vle)}getTokenToInsert(e){const r=pT(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=E(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new Gle(p,u,this.LA(0));g.resyncedTokens=aT(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,a)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new $Qe("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||An(r))return!1;const n=this.LA(1);return xg(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return ns(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=xg(e,a=>bM(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return _M;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return ur(e,(n,i)=>i===0?_M:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=ur(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Ho(e)}getFollowSetFromFollowKey(e){if(e===_M)return[Ch];const r=e.ruleName+e.idxInCallingRule+yoe+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Ch)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return aT(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=ma(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return ur(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},E(w1,"Recoverable"),w1);function Vle(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new a(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=Ch,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,s)&&this.tryInRepetitionRecovery(t,e,r,u)}E(Vle,"attemptInRepetitionRecovery");var BQe=4,kh=8,Wle=1<SM(r,r,Af))}validateEmptyOrAlternatives(e){return To(e,r=>Ale(r,Af))}validateAmbiguousAlternationAlternatives(e,r){return To(e,n=>_le(n,r,Af))}validateSomeNonEmptyLookaheadPath(e,r){return Lle(e,r,Af)}buildLookaheadForAlternation(e){return ple(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,mle)}buildLookaheadForOptional(e){return gle(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Uk(e.prodType),yle)}},E(C1,"LLkLookaheadStrategy"),C1),FQe=(k1=class{initLooksAhead(e){this.dynamicTokensEnabled=br(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:tu.dynamicTokensEnabled,this.maxLookahead=br(e,"maxLookahead")?e.maxLookahead:tu.maxLookahead,this.lookaheadStrategy=br(e,"lookaheadStrategy")?e.lookaheadStrategy:new DM({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){kr(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=Hle(r);kr(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${jo(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=jk(this.fullRuleNameToShort[r.name],Wle,u.idx);this.setLaFuncCache(f,d)})}),kr(i,u=>{this.computeLookaheadFunc(r,u.idx,RM,"Repetition",u.maxLookahead,jo(u))}),kr(a,u=>{this.computeLookaheadFunc(r,u.idx,Ule,"Option",u.maxLookahead,jo(u))}),kr(s,u=>{this.computeLookaheadFunc(r,u.idx,LM,"RepetitionMandatory",u.maxLookahead,jo(u))}),kr(o,u=>{this.computeLookaheadFunc(r,u.idx,Kk,"RepetitionMandatoryWithSeparator",u.maxLookahead,jo(u))}),kr(l,u=>{this.computeLookaheadFunc(r,u.idx,IM,"RepetitionWithSeparator",u.maxLookahead,jo(u))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=jk(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return jk(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},E(k1,"LooksAhead"),k1),zQe=(E1=class extends wg{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},E(E1,"DslMethodsCollectorVisitor"),E1),Zk=new zQe;function Hle(t){Zk.reset(),t.accept(Zk);const e=Zk.dslMethods;return Zk.reset(),e}E(Hle,"collectMethods");function MM(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffsets.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: +see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof wg?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function mle(t,e){const r=new BQe(t,e);return r.resolveRefs(),r.errors}E(mle,"resolveGrammar");var BQe=(i1=class extends Cg{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){kr(Vi(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:ss.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},E(i1,"GastRefResolverVisitor"),i1),FQe=(a1=class extends Pk{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=ma(this.path.ruleStack).reverse(),this.occurrenceStack=ma(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){An(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},E(a1,"AbstractNextPossibleTokensWalker"),a1),zQe=(s1=class extends FQe{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),a=new As({definition:i});this.possibleTokTypes=kg(a),this.found=!0}}},E(s1,"NextAfterTokenWalker"),s1),Hk=(o1=class extends Pk{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},E(o1,"AbstractNextTerminalAfterProductionWalker"),o1),GQe=(l1=class extends Hk{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Xo(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Pn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},E(l1,"NextTerminalAfterManyWalker"),l1),yle=(c1=class extends Hk{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Xo(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Pn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},E(c1,"NextTerminalAfterManySepWalker"),c1),qQe=(u1=class extends Hk{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Xo(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Pn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},E(u1,"NextTerminalAfterAtLeastOneWalker"),u1),vle=(h1=class extends Hk{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Xo(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Pn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},E(h1,"NextTerminalAfterAtLeastOneSepWalker"),h1);function Yk(t,e,r=[]){r=ma(r);let n=[],i=0;function a(o){return o.concat(ya(t,i+1))}E(a,"remainingPathWith");function s(o){const l=Yk(a(o),e,r);return n.concat(l)}for(E(s,"getAlternativesForProd");r.length{An(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof Pn)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:ya(t,i)}),n}E(Yk,"possiblePathsFrom");function EM(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!An(d);){const f=d.pop();if(f===s){o&&kf(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(An(p))continue;const v=p[0];if(v===i){const x={idx:g,def:ya(p),ruleStack:oT(m),occurrenceStack:oT(y)};d.push(x)}else if(v instanceof Pn)if(g=0;x--){const b=v.definition[x],w={idx:g,def:b.definition.concat(ya(p)),ruleStack:m,occurrenceStack:y};d.push(w),d.push(s)}else if(v instanceof As)d.push({idx:g,def:v.definition.concat(ya(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof wg)d.push(ble(v,g,m,y));else throw Error("non exhaustive match")}return h}E(EM,"nextPossibleTokensAfter");function ble(t,e,r,n){const i=ma(r);i.push(t.name);const a=ma(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}E(ble,"expandTopLevelRule");var Qn;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(Qn||(Qn={}));function Xk(t){if(t instanceof va||t==="Option")return Qn.OPTION;if(t instanceof ai||t==="Repetition")return Qn.REPETITION;if(t instanceof Qs||t==="RepetitionMandatory")return Qn.REPETITION_MANDATORY;if(t instanceof Js||t==="RepetitionMandatoryWithSeparator")return Qn.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof _s||t==="RepetitionWithSeparator")return Qn.REPETITION_WITH_SEPARATOR;if(t instanceof Rs||t==="Alternation")return Qn.ALTERNATION;throw Error("non exhaustive match")}E(Xk,"getProdType");function SM(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=Xk(n);return a===Qn.ALTERNATION?yT(e,r,i):vT(e,r,a,i)}E(SM,"getLookaheadPaths");function xle(t,e,r,n,i,a){const s=yT(t,e,r),o=RM(s)?pT:Eg;return a(s,n,o,i)}E(xle,"buildLookaheadFuncForOr");function Tle(t,e,r,n,i,a){const s=vT(t,e,i,r),o=RM(s)?pT:Eg;return a(s[0],o,n)}E(Tle,"buildLookaheadFuncForOptionalProd");function wle(t,e,r,n){const i=t.length,a=Yo(t,s=>Yo(s,o=>o.length===1));if(e)return function(s){const o=ur(s,l=>l.GATE);for(let l=0;lHo(l)),o=Zs(s,(l,u,h)=>(kr(u,d=>{br(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),kr(d.categoryMatches,f=>{br(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let s=0;sa.length===1),i=t.length;if(n&&!r){const a=Ho(t);if(a.length===1&&An(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=Zs(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,kr(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;aYk([s],1)),n=AM(r.length),i=ur(r,s=>{const o={};return kr(s,l=>{const u=Kk(l.partialPath);kr(u,h=>{o[h]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=AM(o.length);for(let l=0;l{const v=Kk(y.partialPath);kr(v,x=>{i[l][x]=!0})})}}}}return n}E(_M,"lookAheadSequenceFromAlternatives");function yT(t,e,r,n){const i=new kle(t,Qn.ALTERNATION,n);return e.accept(i),_M(i.result,r)}E(yT,"getLookaheadPathsForOr");function vT(t,e,r,n){const i=new kle(t,r);e.accept(i);const a=i.result,o=new VQe(e,t,r).startWalking(),l=new As({definition:a}),u=new As({definition:o});return _M([l,u],n)}E(vT,"getLookaheadPathsForOptionalProd");function jk(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}E(Sle,"isStrictPrefixOfPath");function RM(t){return Yo(t,e=>Yo(e,r=>Yo(r,n=>An(n.categoryMatches))))}E(RM,"areTokenCategoriesNotUsed");function Ale(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return ur(e,r=>Object.assign({type:ss.CUSTOM_LOOKAHEAD_VALIDATION},r))}E(Ale,"validateLookahead");function _le(t,e,r,n){const i=To(t,l=>Rle(l,r)),a=Fle(t,e,r),s=To(t,l=>Ole(l,r)),o=To(t,l=>Ile(l,t,n,r));return i.concat(a,s,o)}E(_le,"validateGrammar");function Rle(t,e){const r=new WQe;t.accept(r);const n=r.allProductions,i=iQe(n,Lle),a=Ko(i,o=>o.length>1);return ur(Vi(a),o=>{const l=Xo(o),u=e.buildDuplicateFoundError(t,o),h=jo(l),d={message:u,type:ss.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=LM(l);return f&&(d.parameter=f),d})}E(Rle,"validateDuplicateProductions");function Lle(t){return`${jo(t)}_#_${t.idx}_#_${LM(t)}`}E(Lle,"identifyProductionForDuplicates");function LM(t){return t instanceof Pn?t.terminalType.name:t instanceof is?t.nonTerminalName:""}E(LM,"getExtraProductionArgument");var WQe=(p1=class extends Cg{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}},E(p1,"OccurrenceValidationCollector"),p1);function Ile(t,e,r,n){const i=[];if(Zs(e,(s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:ss.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}E(Ile,"validateRuleDoesNotAlreadyExist");function Dle(t,e,r){const n=[];let i;return ns(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:ss.INVALID_RULE_OVERRIDE,ruleName:t})),n}E(Dle,"validateRuleIsOverridden");function IM(t,e,r,n=[]){const i=[],a=bT(e.definition);if(An(a))return[];{const s=t.name;ns(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:ss.LEFT_RECURSION,ruleName:s});const l=Nk(a,n.concat([t])),u=To(l,h=>{const d=ma(n);return d.push(h),IM(t,h,r,d)});return i.concat(u)}}E(IM,"validateNoLeftRecursion");function bT(t){let e=[];if(An(t))return e;const r=Xo(t);if(r instanceof is)e.push(r.referencedRule);else if(r instanceof As||r instanceof va||r instanceof Qs||r instanceof Js||r instanceof _s||r instanceof ai)e=e.concat(bT(r.definition));else if(r instanceof Rs)e=Ho(ur(r.definition,a=>bT(a.definition)));else if(!(r instanceof Pn))throw Error("non exhaustive match");const n=cT(r),i=t.length>1;if(n&&i){const a=ya(t);return e.concat(bT(a))}else return e}E(bT,"getFirstNoneTerminal");var DM=(g1=class extends Cg{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},E(g1,"OrCollector"),g1);function Mle(t,e){const r=new DM;t.accept(r);const n=r.alternations;return To(n,a=>{const s=oT(a.definition);return To(s,(o,l)=>{const u=EM([o],[],Eg,1);return An(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:ss.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}E(Mle,"validateEmptyOrAlternative");function Nle(t,e,r){const n=new DM;t.accept(n);let i=n.alternations;return i=Ok(i,s=>s.ignoreAmbiguities===!0),To(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=yT(o,t,l,s),h=Ple(u,s,t,r),d=Ble(u,s,t,r);return h.concat(d)})}E(Nle,"validateAmbiguousAlternationAlternatives");var UQe=(m1=class extends Cg{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}},E(m1,"RepetitionCollector"),m1);function Ole(t,e){const r=new DM;t.accept(r);const n=r.alternations;return To(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:ss.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}E(Ole,"validateTooManyAlts");function $le(t,e,r){const n=[];return kr(t,i=>{const a=new UQe;i.accept(a);const s=a.allProductions;kr(s,o=>{const l=Xk(o),u=o.maxLookahead||e,h=o.idx,f=vT(h,i,l,u)[0];if(An(Ho(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:ss.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}E($le,"validateSomeNonEmptyLookaheadPath");function Ple(t,e,r,n){const i=[],a=Zs(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||kr(l,h=>{const d=[u];kr(t,(f,p)=>{u!==p&&jk(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!jk(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return ur(a,o=>{const l=ur(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:ss.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}E(Ple,"checkAlternativesAmbiguities");function Ble(t,e,r,n){const i=Zs(t,(s,o,l)=>{const u=ur(o,h=>({idx:l,path:h}));return s.concat(u)},[]);return aT(To(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,h=xo(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:ss.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}E(Ble,"checkPrefixAlternativesAmbiguities");function Fle(t,e,r){const n=[],i=ur(e,a=>a.name);return kr(t,a=>{const s=a.name;if(ns(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:ss.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}E(Fle,"checkTerminalAndNoneTerminalsNameSpace");function zle(t){const e=lM(t,{errMsgProvider:PQe}),r={};return kr(t.rules,n=>{r[n.name]=n}),mle(r,e.errMsgProvider)}E(zle,"resolveGrammar");function Gle(t){return t=lM(t,{errMsgProvider:Af}),_le(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}E(Gle,"validateGrammar");var qle="MismatchedTokenException",Vle="NoViableAltException",Wle="EarlyExitException",Ule="NotAllInputParsedException",Hle=[qle,Vle,Wle,Ule];Object.freeze(Hle);function xT(t){return ns(Hle,t.name)}E(xT,"isRecognitionException");var Zk=(y1=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},E(y1,"RecognitionException"),y1),Yle=(v1=class extends Zk{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=qle}},E(v1,"MismatchedTokenException"),v1),HQe=(b1=class extends Zk{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Vle}},E(b1,"NoViableAltException"),b1),YQe=(x1=class extends Zk{constructor(e,r){super(e,r),this.name=Ule}},E(x1,"NotAllInputParsedException"),x1),XQe=(T1=class extends Zk{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Wle}},E(T1,"EarlyExitException"),T1),MM={},Xle="InRuleRecoveryException",KQe=(w1=class extends Error{constructor(e){super(e),this.name=Xle}},E(w1,"InRuleRecoveryException"),w1),jQe=(C1=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=br(e,"recoveryEnabled")?e.recoveryEnabled:tu.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Kle)}getTokenToInsert(e){const r=mT(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=E(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new Yle(p,u,this.LA(0));g.resyncedTokens=oT(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,a)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new KQe("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||An(r))return!1;const n=this.LA(1);return Tg(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return ns(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=Tg(e,a=>kM(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return MM;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return ur(e,(n,i)=>i===0?MM:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=ur(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Ho(e)}getFollowSetFromFollowKey(e){if(e===MM)return[Ch];const r=e.ruleName+e.idxInCallingRule+Coe+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Ch)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return oT(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=ma(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return ur(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},E(C1,"Recoverable"),C1);function Kle(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new a(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=Ch,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,s)&&this.tryInRepetitionRecovery(t,e,r,u)}E(Kle,"attemptInRepetitionRecovery");var ZQe=4,kh=8,jle=1<IM(r,r,Af))}validateEmptyOrAlternatives(e){return To(e,r=>Mle(r,Af))}validateAmbiguousAlternationAlternatives(e,r){return To(e,n=>Nle(n,r,Af))}validateSomeNonEmptyLookaheadPath(e,r){return $le(e,r,Af)}buildLookaheadForAlternation(e){return xle(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,wle)}buildLookaheadForOptional(e){return Tle(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Xk(e.prodType),Cle)}},E(k1,"LLkLookaheadStrategy"),k1),QQe=(E1=class{initLooksAhead(e){this.dynamicTokensEnabled=br(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:tu.dynamicTokensEnabled,this.maxLookahead=br(e,"maxLookahead")?e.maxLookahead:tu.maxLookahead,this.lookaheadStrategy=br(e,"lookaheadStrategy")?e.lookaheadStrategy:new PM({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){kr(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=Qle(r);kr(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${jo(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=Jk(this.fullRuleNameToShort[r.name],jle,u.idx);this.setLaFuncCache(f,d)})}),kr(i,u=>{this.computeLookaheadFunc(r,u.idx,NM,"Repetition",u.maxLookahead,jo(u))}),kr(a,u=>{this.computeLookaheadFunc(r,u.idx,Zle,"Option",u.maxLookahead,jo(u))}),kr(s,u=>{this.computeLookaheadFunc(r,u.idx,OM,"RepetitionMandatory",u.maxLookahead,jo(u))}),kr(o,u=>{this.computeLookaheadFunc(r,u.idx,Qk,"RepetitionMandatoryWithSeparator",u.maxLookahead,jo(u))}),kr(l,u=>{this.computeLookaheadFunc(r,u.idx,$M,"RepetitionWithSeparator",u.maxLookahead,jo(u))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=Jk(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return Jk(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},E(E1,"LooksAhead"),E1),JQe=(S1=class extends Cg{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},E(S1,"DslMethodsCollectorVisitor"),S1),eE=new JQe;function Qle(t){eE.reset(),t.accept(eE);const e=eE.dslMethods;return eE.reset(),e}E(Qle,"collectMethods");function BM(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffsets.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: ${a.join(` `).replace(/\n/g,` - `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}E(jle,"createBaseSemanticVisitorConstructor");function Zle(t,e,r){const n=E(function(){},"derivedConstructor");OM(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return kr(e,a=>{i[a]=Kle}),n.prototype=i,n.prototype.constructor=n,n}E(Zle,"createBaseVisitorConstructorWithDefaults");var $M;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})($M||($M={}));function Qle(t,e){return Jle(t,e)}E(Qle,"validateVisitor");function Jle(t,e){const r=xo(e,i=>Zc(t[i])===!1),n=ur(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:$M.MISSING_METHOD,methodName:i}));return nT(n)}E(Jle,"validateMissingCstMethods");var qQe=(S1=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=br(e,"nodeLocationTracking")?e.nodeLocationTracking:tu.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ta,this.cstFinallyStateUpdate=ta,this.cstPostTerminal=ta,this.cstPostNonTerminal=ta,this.cstPostRule=ta;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=NM,this.setNodeLocationFromNode=NM,this.cstPostRule=ta,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ta,this.setNodeLocationFromNode=ta,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=MM,this.setNodeLocationFromNode=MM,this.cstPostRule=ta,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ta,this.setNodeLocationFromNode=ta,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ta,this.setNodeLocationFromNode=ta,this.cstPostRule=ta,this.setInitialNodeLocation=ta;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];Yle(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];Xle(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Jc(this.baseCstVisitorConstructor)){const e=jle(this.className,Ks(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Jc(this.baseCstVisitorWithDefaultsConstructor)){const e=Zle(this.className,Ks(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},E(S1,"TreeBuilder"),S1),VQe=(A1=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Jk}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Jk:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},E(A1,"LexerAdapter"),A1),WQe=(_1=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=eE){if(ns(this.definedRulesNames,e)){const s={message:Af.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:ss.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=eE){const i=Sle(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(vT(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return hoe(Vi(this.gastProductionsCache))}},E(_1,"RecognizerApi"),_1),UQe=(R1=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=dT,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},br(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. + `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}E(rce,"createBaseSemanticVisitorConstructor");function nce(t,e,r){const n=E(function(){},"derivedConstructor");zM(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return kr(e,a=>{i[a]=tce}),n.prototype=i,n.prototype.constructor=n,n}E(nce,"createBaseVisitorConstructorWithDefaults");var GM;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(GM||(GM={}));function ice(t,e){return ace(t,e)}E(ice,"validateVisitor");function ace(t,e){const r=xo(e,i=>Zc(t[i])===!1),n=ur(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:GM.MISSING_METHOD,methodName:i}));return aT(n)}E(ace,"validateMissingCstMethods");var tJe=(A1=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=br(e,"nodeLocationTracking")?e.nodeLocationTracking:tu.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ta,this.cstFinallyStateUpdate=ta,this.cstPostTerminal=ta,this.cstPostNonTerminal=ta,this.cstPostRule=ta;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=FM,this.setNodeLocationFromNode=FM,this.cstPostRule=ta,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ta,this.setNodeLocationFromNode=ta,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=BM,this.setNodeLocationFromNode=BM,this.cstPostRule=ta,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ta,this.setNodeLocationFromNode=ta,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ta,this.setNodeLocationFromNode=ta,this.cstPostRule=ta,this.setInitialNodeLocation=ta;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];Jle(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];ece(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Jc(this.baseCstVisitorConstructor)){const e=rce(this.className,Ks(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Jc(this.baseCstVisitorWithDefaultsConstructor)){const e=nce(this.className,Ks(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},E(A1,"TreeBuilder"),A1),rJe=(_1=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):rE}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?rE:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},E(_1,"LexerAdapter"),_1),nJe=(R1=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=nE){if(ns(this.definedRulesNames,e)){const s={message:Af.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:ss.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=nE){const i=Dle(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(xT(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return yoe(Vi(this.gastProductionsCache))}},E(R1,"RecognizerApi"),R1),iJe=(L1=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=pT,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},br(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 For Further details.`);if(Zr(e)){if(An(e))throw Error(`A Token Vocabulary cannot be empty. Note that the first argument for the parser constructor is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 - For Further details.`)}if(Zr(e))this.tokensMap=Zs(e,(a,s)=>(a[s.name]=s,a),{});else if(br(e,"modes")&&Yo(Ho(Vi(e.modes)),ele)){const a=Ho(Vi(e.modes)),s=iM(a);this.tokensMap=Zs(s,(o,l)=>(o[l.name]=l,o),{})}else if(bo(e))this.tokensMap=ma(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Ch;const n=br(e,"modes")?Ho(Vi(e.modes)):Vi(e),i=Yo(n,a=>An(a.categoryMatches));this.tokenMatcher=i?dT:kg,Eg(Vi(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' -Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=br(n,"resyncEnabled")?n.resyncEnabled:eE.resyncEnabled,a=br(n,"recoveryValueFunc")?n.recoveryValueFunc:eE.recoveryValueFunc,s=this.ruleShortNameIdx<s.call(this)&&o.call(this),"lookAheadFunc")}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(LM,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const s=r.GATE;if(s!==void 0){const o=i;i=E(()=>s.call(this)&&o.call(this),"lookAheadFunc")}}else a=r;if(i.call(this)===!0){let s=this.doSingleRepetition(a);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,Qn.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,LM,e,RQe)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Kk,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=E(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,dle],o,Kk,e,dle)}else throw this.raiseEarlyExitException(e,Qn.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(RM,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=E(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else a=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,RM,e,_Qe,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(IM,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=E(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,hle],o,IM,e,hle)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,Kk,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(Wle,r),i=Zr(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new NQe(r,e))}}subruleInternal(e,r,n){let i;try{const a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,r,n){throw vT(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),i=a):this.consumeInternalError(e,a,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Gle(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===qle?n:a}}else throw n}saveRecogState(){const e=this.errors,r=ma(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ch)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},E(R1,"RecognizerEngine"),R1),HQe=(L1=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=br(e,"errorMessageProvider")?e.errorMessageProvider:tu.errorMessageProvider}SAVE_ERROR(e){if(vT(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:ma(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return ma(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=mT(e,a,r,this.maxLookahead)[0],l=[];for(let h=1;h<=this.maxLookahead;h++)l.push(this.LA(h));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new OQe(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=gT(e,i,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new MQe(l,this.LA(1),o))}},E(L1,"ErrorHandler"),L1),YQe=(I1=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(Jc(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return xM([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Xo(e.ruleStack),i=this.getGAstProductions()[r];return new AQe(i,e).startWalking()}},E(I1,"ContentAssist"),I1),Qk={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Qk);var ece=!0,tce=Math.pow(2,kh)-1,rce=Sg({name:"RECORDING_PHASE_TOKEN",pattern:as.NA});Eg([rce]);var nce=pT(rce,`This IToken indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(nce);var XQe={name:`This CSTNode indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},KQe=(D1=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return Jk}topLevelRuleRecord(e,r){try{const n=new Tg({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` + For Further details.`)}if(Zr(e))this.tokensMap=Zs(e,(a,s)=>(a[s.name]=s,a),{});else if(br(e,"modes")&&Yo(Ho(Vi(e.modes)),sle)){const a=Ho(Vi(e.modes)),s=cM(a);this.tokensMap=Zs(s,(o,l)=>(o[l.name]=l,o),{})}else if(bo(e))this.tokensMap=ma(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Ch;const n=br(e,"modes")?Ho(Vi(e.modes)):Vi(e),i=Yo(n,a=>An(a.categoryMatches));this.tokenMatcher=i?pT:Eg,Sg(Vi(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' +Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=br(n,"resyncEnabled")?n.resyncEnabled:nE.resyncEnabled,a=br(n,"recoveryValueFunc")?n.recoveryValueFunc:nE.recoveryValueFunc,s=this.ruleShortNameIdx<s.call(this)&&o.call(this),"lookAheadFunc")}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(OM,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const s=r.GATE;if(s!==void 0){const o=i;i=E(()=>s.call(this)&&o.call(this),"lookAheadFunc")}}else a=r;if(i.call(this)===!0){let s=this.doSingleRepetition(a);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,Qn.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,OM,e,qQe)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Qk,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=E(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,vle],o,Qk,e,vle)}else throw this.raiseEarlyExitException(e,Qn.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(NM,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=E(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else a=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,NM,e,GQe,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead($M,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=E(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,yle],o,$M,e,yle)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,Qk,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(jle,r),i=Zr(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new YQe(r,e))}}subruleInternal(e,r,n){let i;try{const a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,r,n){throw xT(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),i=a):this.consumeInternalError(e,a,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Yle(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===Xle?n:a}}else throw n}saveRecogState(){const e=this.errors,r=ma(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ch)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},E(L1,"RecognizerEngine"),L1),aJe=(I1=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=br(e,"errorMessageProvider")?e.errorMessageProvider:tu.errorMessageProvider}SAVE_ERROR(e){if(xT(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:ma(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return ma(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=vT(e,a,r,this.maxLookahead)[0],l=[];for(let h=1;h<=this.maxLookahead;h++)l.push(this.LA(h));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new XQe(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=yT(e,i,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new HQe(l,this.LA(1),o))}},E(I1,"ErrorHandler"),I1),sJe=(D1=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(Jc(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return EM([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Xo(e.ruleStack),i=this.getGAstProductions()[r];return new zQe(i,e).startWalking()}},E(D1,"ContentAssist"),D1),tE={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(tE);var sce=!0,oce=Math.pow(2,kh)-1,lce=Ag({name:"RECORDING_PHASE_TOKEN",pattern:as.NA});Sg([lce]);var cce=mT(lce,`This IToken indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(cce);var oJe={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},lJe=(M1=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return rE}topLevelRuleRecord(e,r){try{const n=new wg({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` This error was thrown during the "grammar recording phase" For more info see: - https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return _g.call(this,va,e,r)}atLeastOneInternalRecord(e,r){_g.call(this,Qs,r,e)}atLeastOneSepFirstInternalRecord(e,r){_g.call(this,Js,r,e,ece)}manyInternalRecord(e,r){_g.call(this,ai,r,e)}manySepFirstInternalRecord(e,r){_g.call(this,_s,r,e,ece)}orInternalRecord(e,r){return ice.call(this,e,r)}subruleInternalRecord(e,r,n){if(bT(r),!e||br(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=kf(this.recordingProdStack),a=e.ruleName,s=new is({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?XQe:Qk}consumeInternalRecord(e,r,n){if(bT(r),!gM(e)){const s=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=kf(this.recordingProdStack),a=new Pn({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),nce}},E(D1,"GastRecorder"),D1);function _g(t,e,r,n=!1){bT(r);const i=kf(this.recordingProdStack),a=Zc(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),br(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),Qk}E(_g,"recordProd");function ice(t,e){bT(e);const r=kf(this.recordingProdStack),n=Zr(t)===!1,i=n===!1?t:t.DEF,a=new Rs({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});br(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=soe(i,o=>Zc(o.GATE));return a.hasPredicates=s,r.definition.push(a),kr(i,o=>{const l=new As({definition:[]});a.definition.push(l),br(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:br(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),Qk}E(ice,"recordOrProd");function PM(t){return t===0?"":`${t}`}E(PM,"getIdxSuffix");function bT(t){if(t<0||t>tce){const e=new Error(`Invalid DSL Method idx value: <${t}> - Idx value must be a none negative value smaller than ${tce+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}E(bT,"assertMethodIdxIsValid");var jQe=(M1=class{initPerformanceTracer(e){if(br(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=tu.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:i,value:a}=sM(r),s=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,a}else return r()}},E(M1,"PerformanceTracer"),M1);function ace(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}E(ace,"applyMixins");var Jk=pT(Ch,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Jk);var tu=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Ag,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),eE=Object.freeze({recoveryValueFunc:E(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),ss;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(ss||(ss={}));function BM(t=void 0){return function(){return t}}E(BM,"EMPTY_ALT");var FM=(l0=class{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{oM(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),kr(this.definedRulesNames,i=>{const s=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=Nle({rules:Vi(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(An(n)&&this.skipValidations===!1){const i=Ole({rules:Vi(this.gastProductionsCache),tokenTypes:Vi(this.tokensMap),errMsgProvider:Af,grammarName:r}),a=Tle({lookaheadStrategy:this.lookaheadStrategy,rules:Vi(this.gastProductionsCache),tokenTypes:Vi(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),An(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=voe(Vi(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:Vi(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Vi(this.gastProductionsCache))})),!l0.DEFER_DEFINITION_ERRORS_HANDLING&&!An(this.definitionErrors))throw e=ur(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected: + https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Rg.call(this,va,e,r)}atLeastOneInternalRecord(e,r){Rg.call(this,Qs,r,e)}atLeastOneSepFirstInternalRecord(e,r){Rg.call(this,Js,r,e,sce)}manyInternalRecord(e,r){Rg.call(this,ai,r,e)}manySepFirstInternalRecord(e,r){Rg.call(this,_s,r,e,sce)}orInternalRecord(e,r){return uce.call(this,e,r)}subruleInternalRecord(e,r,n){if(TT(r),!e||br(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=kf(this.recordingProdStack),a=e.ruleName,s=new is({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?oJe:tE}consumeInternalRecord(e,r,n){if(TT(r),!xM(e)){const s=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=kf(this.recordingProdStack),a=new Pn({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),cce}},E(M1,"GastRecorder"),M1);function Rg(t,e,r,n=!1){TT(r);const i=kf(this.recordingProdStack),a=Zc(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),br(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),tE}E(Rg,"recordProd");function uce(t,e){TT(e);const r=kf(this.recordingProdStack),n=Zr(t)===!1,i=n===!1?t:t.DEF,a=new Rs({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});br(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=doe(i,o=>Zc(o.GATE));return a.hasPredicates=s,r.definition.push(a),kr(i,o=>{const l=new As({definition:[]});a.definition.push(l),br(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:br(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),tE}E(uce,"recordOrProd");function qM(t){return t===0?"":`${t}`}E(qM,"getIdxSuffix");function TT(t){if(t<0||t>oce){const e=new Error(`Invalid DSL Method idx value: <${t}> + Idx value must be a none negative value smaller than ${oce+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}E(TT,"assertMethodIdxIsValid");var cJe=(N1=class{initPerformanceTracer(e){if(br(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=tu.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:i,value:a}=hM(r),s=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,a}else return r()}},E(N1,"PerformanceTracer"),N1);function hce(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}E(hce,"applyMixins");var rE=mT(Ch,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(rE);var tu=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:_g,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),nE=Object.freeze({recoveryValueFunc:E(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),ss;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(ss||(ss={}));function VM(t=void 0){return function(){return t}}E(VM,"EMPTY_ALT");var WM=(lp=class{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{dM(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),kr(this.definedRulesNames,i=>{const s=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=zle({rules:Vi(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(An(n)&&this.skipValidations===!1){const i=Gle({rules:Vi(this.gastProductionsCache),tokenTypes:Vi(this.tokensMap),errMsgProvider:Af,grammarName:r}),a=Ale({lookaheadStrategy:this.lookaheadStrategy,rules:Vi(this.gastProductionsCache),tokenTypes:Vi(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),An(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=koe(Vi(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:Vi(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Vi(this.gastProductionsCache))})),!lp.DEFER_DEFINITION_ERRORS_HANDLING&&!An(this.definitionErrors))throw e=ur(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected: ${e.join(` ------------------------------- `)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),br(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. Please use the flag on the relevant DSL method instead. See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES - For further details.`);this.skipValidations=br(r,"skipValidations")?r.skipValidations:tu.skipValidations}},E(l0,"Parser"),l0);FM.DEFER_DEFINITION_ERRORS_HANDLING=!1,ace(FM,[PQe,FQe,qQe,VQe,UQe,WQe,HQe,YQe,KQe,jQe]);var ZQe=(N1=class extends FM{constructor(e,r=tu){const n=ma(r);n.outputCst=!1,super(e,n)}},E(N1,"EmbeddedActionsParser"),N1);function sce(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}E(pce,"listCacheHas");var nJe=pce;function gce(t,e){var r=this.__data__,n=tE(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}E(gce,"listCacheSet");var iJe=gce;function _f(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&het?new Zce:void 0;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=Yet}E(Sue,"isLength");var WM=Sue,Xet="[object Arguments]",Ket="[object Array]",jet="[object Boolean]",Zet="[object Date]",Qet="[object Error]",Jet="[object Function]",ett="[object Map]",ttt="[object Number]",rtt="[object Object]",ntt="[object RegExp]",itt="[object Set]",att="[object String]",stt="[object WeakMap]",ott="[object ArrayBuffer]",ltt="[object DataView]",ctt="[object Float32Array]",utt="[object Float64Array]",htt="[object Int8Array]",dtt="[object Int16Array]",ftt="[object Int32Array]",ptt="[object Uint8Array]",gtt="[object Uint8ClampedArray]",mtt="[object Uint16Array]",ytt="[object Uint32Array]",Bn={};Bn[ctt]=Bn[utt]=Bn[htt]=Bn[dtt]=Bn[ftt]=Bn[ptt]=Bn[gtt]=Bn[mtt]=Bn[ytt]=!0,Bn[Xet]=Bn[Ket]=Bn[ott]=Bn[jet]=Bn[ltt]=Bn[Zet]=Bn[Qet]=Bn[Jet]=Bn[ett]=Bn[ttt]=Bn[rtt]=Bn[ntt]=Bn[itt]=Bn[att]=Bn[stt]=!1;function Aue(t){return Ig(t)&&WM(t.length)&&!!Bn[Rg(t)]}E(Aue,"baseIsTypedArray");var vtt=Aue;function _ue(t){return function(e){return t(e)}}E(_ue,"baseUnary");var btt=_ue,Rue=typeof exports=="object"&&exports&&!exports.nodeType&&exports,kT=Rue&&typeof module=="object"&&module&&!module.nodeType&&module,xtt=kT&&kT.exports===Rue,UM=xtt&&xce.process,Ttt=(function(){try{var t=kT&&kT.require&&kT.require("util").types;return t||UM&&UM.binding&&UM.binding("util")}catch{}})(),Lue=Ttt,Iue=Lue&&Lue.isTypedArray,wtt=Iue?btt(Iue):vtt,HM=wtt,Ctt=Object.prototype,ktt=Ctt.hasOwnProperty;function Due(t,e){var r=os(t),n=!r&&sE(t),i=!r&&!n&&oE(t),a=!r&&!n&&!i&&HM(t),s=r||n||i||a,o=s?$et(t.length,String):[],l=o.length;for(var u in t)(e||ktt.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Eue(u,l)))&&o.push(u);return o}E(Due,"arrayLikeKeys");var Ett=Due,Stt=Object.prototype;function Mue(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Stt;return t===r}E(Mue,"isPrototype");var Nue=Mue;function Oue(t,e){return function(r){return t(e(r))}}E(Oue,"overArg");var Att=Oue,_tt=Att(Object.keys,Object),Rtt=_tt,Ltt=Object.prototype,Itt=Ltt.hasOwnProperty;function $ue(t){if(!Nue(t))return Rtt(t);var e=[];for(var r in Object(t))Itt.call(t,r)&&r!="constructor"&&e.push(r);return e}E($ue,"baseKeys");var Pue=$ue;function Bue(t){return t!=null&&WM(t.length)&&!_ce(t)}E(Bue,"isArrayLike");var lE=Bue;function Fue(t){return lE(t)?Ett(t):Pue(t)}E(Fue,"keys");var YM=Fue;function zue(t){return Let(t,YM,Oet)}E(zue,"getAllKeys");var Gue=zue,Dtt=1,Mtt=Object.prototype,Ntt=Mtt.hasOwnProperty;function que(t,e,r,n,i,a){var s=r&Dtt,o=Gue(t),l=o.length,u=Gue(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:Ntt.call(e,f)))return!1}var p=a.get(t),g=a.get(e);if(p&&g)return p==e&&g==t;var m=!0;a.set(t,e),a.set(e,t);for(var y=s;++daN(t,e,s));return Of(t,e,n,r,...i)}E(Whe,"alternation");function Uhe(t,e,r){const n=Wi(t,e,r,{type:Eh});iu(t,n);const i=Of(t,e,n,r,Sh(t,e,r));return Hhe(t,e,r,i)}E(Uhe,"option");function Sh(t,e,r){const n=Irt(nu(r.definition,i=>aN(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:Xhe(t,n)}E(Sh,"block");function sN(t,e,r,n,i){const a=n.left,s=n.right,o=Wi(t,e,r,{type:$rt});iu(t,o);const l=Wi(t,e,r,{type:$he});return a.loopback=o,l.loopback=o,t.decisionMap[Nf(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,pi(s,o),i===void 0?(pi(o,a),pi(o,l)):(pi(o,l),pi(o,i.left),pi(i.right,a)),{left:a,right:l}}E(sN,"plus");function oN(t,e,r,n,i){const a=n.left,s=n.right,o=Wi(t,e,r,{type:Ort});iu(t,o);const l=Wi(t,e,r,{type:$he}),u=Wi(t,e,r,{type:Nrt});return o.loopback=u,l.loopback=u,pi(o,a),pi(o,l),pi(s,u),i!==void 0?(pi(u,l),pi(u,i.left),pi(i.right,a)):pi(u,o),t.decisionMap[Nf(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}E(oN,"star");function Hhe(t,e,r,n){const i=n.left,a=n.right;return pi(i,a),t.decisionMap[Nf(e,"Option",r.idx)]=i,n}E(Hhe,"optional");function iu(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}E(iu,"defineDecisionState");function Of(t,e,r,n,...i){const a=Wi(t,e,n,{type:Mrt,start:r});r.end=a;for(const o of i)o!==void 0?(pi(r,o.left),pi(o.right,a)):pi(r,a);const s={left:r,right:a};return t.decisionMap[Nf(e,Yhe(n),n.idx)]=r,s}E(Of,"makeAlts");function Yhe(t){if(t instanceof Rs)return"Alternation";if(t instanceof va)return"Option";if(t instanceof ai)return"Repetition";if(t instanceof _s)return"RepetitionWithSeparator";if(t instanceof Qs)return"RepetitionMandatory";if(t instanceof Js)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}E(Yhe,"getProdType");function Xhe(t,e){const r=e.length;for(let a=0;ae.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}},E(F1,"ATNConfigSet"),F1);function cN(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}E(cN,"getATNConfigKey");function Qhe(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?uN(o,e-1,r,n,i):cue(i,o):n||(i[i.length]=o)}return i}E(uN,"baseFlatten");var nde=uN;function ide(t,e){return nde(nu(t,e),1)}E(ide,"flatMap");var Grt=ide;function ade(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}E(cde,"arrayIncludes");var Hrt=cde;function ude(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=Qrt){var u=e?null:Zrt(t);if(u)return qM(u);s=!1,i=eue,l=new Zce}else l=e?[]:o;e:for(;++n{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}E(Cde,"createDFACache");var kde=(z1=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;nconsole.log(n))}initialize(e){this.atn=Bhe(e.rules),this.dfas=Sde(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=Nf(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=nu(TM({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>nu(f,p=>p[0]));if(dN(d,!1)&&!a){const f=wde(d,(p,g,m)=>(hN(g,y=>{y&&(p[y.tokenTypeIdx]=m,hN(y.categoryMatches,v=>{p[v]=m}))}),p),{});return i?function(p){var g;const m=this.LA(1),y=f[m.tokenTypeIdx];if(p!==void 0&&y!==void 0){const v=(g=p[y])===null||g===void 0?void 0:g.GATE;if(v!==void 0&&v.call(this)===!1)return}return y}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new kde,g=f===void 0?0:f.length;for(let y=0;ynu(f,p=>p[0]));if(dN(d)&&d[0][0]&&!a){const f=d[0],p=tnt(f);if(p.length===1&&lnt(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=wde(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,hN(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=vE.call(this,s,h,Ede,o);return typeof f=="object"?!1:f===0}}},E(G1,"LLStarLookaheadStrategy"),G1);function dN(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}E(dN,"isLL1Sequence");function Sde(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;nSf(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${Ide(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, + For further details.`);this.skipValidations=br(r,"skipValidations")?r.skipValidations:tu.skipValidations}},E(lp,"Parser"),lp);WM.DEFER_DEFINITION_ERRORS_HANDLING=!1,hce(WM,[jQe,QQe,tJe,rJe,iJe,nJe,aJe,sJe,lJe,cJe]);var uJe=(O1=class extends WM{constructor(e,r=tu){const n=ma(r);n.outputCst=!1,super(e,n)}},E(O1,"EmbeddedActionsParser"),O1);function dce(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}E(xce,"listCacheHas");var mJe=xce;function Tce(t,e){var r=this.__data__,n=iE(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}E(Tce,"listCacheSet");var yJe=Tce;function _f(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&ket?new nue:void 0;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=stt}E(Due,"isLength");var KM=Due,ott="[object Arguments]",ltt="[object Array]",ctt="[object Boolean]",utt="[object Date]",htt="[object Error]",dtt="[object Function]",ftt="[object Map]",ptt="[object Number]",gtt="[object Object]",mtt="[object RegExp]",ytt="[object Set]",vtt="[object String]",btt="[object WeakMap]",xtt="[object ArrayBuffer]",Ttt="[object DataView]",wtt="[object Float32Array]",Ctt="[object Float64Array]",ktt="[object Int8Array]",Ett="[object Int16Array]",Stt="[object Int32Array]",Att="[object Uint8Array]",_tt="[object Uint8ClampedArray]",Rtt="[object Uint16Array]",Ltt="[object Uint32Array]",Bn={};Bn[wtt]=Bn[Ctt]=Bn[ktt]=Bn[Ett]=Bn[Stt]=Bn[Att]=Bn[_tt]=Bn[Rtt]=Bn[Ltt]=!0,Bn[ott]=Bn[ltt]=Bn[xtt]=Bn[ctt]=Bn[Ttt]=Bn[utt]=Bn[htt]=Bn[dtt]=Bn[ftt]=Bn[ptt]=Bn[gtt]=Bn[mtt]=Bn[ytt]=Bn[vtt]=Bn[btt]=!1;function Mue(t){return Dg(t)&&KM(t.length)&&!!Bn[Lg(t)]}E(Mue,"baseIsTypedArray");var Itt=Mue;function Nue(t){return function(e){return t(e)}}E(Nue,"baseUnary");var Dtt=Nue,Oue=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ST=Oue&&typeof module=="object"&&module&&!module.nodeType&&module,Mtt=ST&&ST.exports===Oue,jM=Mtt&&Sce.process,Ntt=(function(){try{var t=ST&&ST.require&&ST.require("util").types;return t||jM&&jM.binding&&jM.binding("util")}catch{}})(),$ue=Ntt,Pue=$ue&&$ue.isTypedArray,Ott=Pue?Dtt(Pue):Itt,ZM=Ott,$tt=Object.prototype,Ptt=$tt.hasOwnProperty;function Bue(t,e){var r=os(t),n=!r&&cE(t),i=!r&&!n&&uE(t),a=!r&&!n&&!i&&ZM(t),s=r||n||i||a,o=s?Ket(t.length,String):[],l=o.length;for(var u in t)(e||Ptt.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Iue(u,l)))&&o.push(u);return o}E(Bue,"arrayLikeKeys");var Btt=Bue,Ftt=Object.prototype;function Fue(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ftt;return t===r}E(Fue,"isPrototype");var zue=Fue;function Gue(t,e){return function(r){return t(e(r))}}E(Gue,"overArg");var ztt=Gue,Gtt=ztt(Object.keys,Object),qtt=Gtt,Vtt=Object.prototype,Wtt=Vtt.hasOwnProperty;function que(t){if(!zue(t))return qtt(t);var e=[];for(var r in Object(t))Wtt.call(t,r)&&r!="constructor"&&e.push(r);return e}E(que,"baseKeys");var Vue=que;function Wue(t){return t!=null&&KM(t.length)&&!Nce(t)}E(Wue,"isArrayLike");var hE=Wue;function Uue(t){return hE(t)?Btt(t):Vue(t)}E(Uue,"keys");var QM=Uue;function Hue(t){return Vet(t,QM,Xet)}E(Hue,"getAllKeys");var Yue=Hue,Utt=1,Htt=Object.prototype,Ytt=Htt.hasOwnProperty;function Xue(t,e,r,n,i,a){var s=r&Utt,o=Yue(t),l=o.length,u=Yue(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:Ytt.call(e,f)))return!1}var p=a.get(t),g=a.get(e);if(p&&g)return p==e&&g==t;var m=!0;a.set(t,e),a.set(e,t);for(var y=s;++duN(t,e,s));return Of(t,e,n,r,...i)}E(jhe,"alternation");function Zhe(t,e,r){const n=Wi(t,e,r,{type:Eh});iu(t,n);const i=Of(t,e,n,r,Sh(t,e,r));return Qhe(t,e,r,i)}E(Zhe,"option");function Sh(t,e,r){const n=Wrt(nu(r.definition,i=>uN(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:ede(t,n)}E(Sh,"block");function hN(t,e,r,n,i){const a=n.left,s=n.right,o=Wi(t,e,r,{type:Krt});iu(t,o);const l=Wi(t,e,r,{type:qhe});return a.loopback=o,l.loopback=o,t.decisionMap[Nf(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,pi(s,o),i===void 0?(pi(o,a),pi(o,l)):(pi(o,l),pi(o,i.left),pi(i.right,a)),{left:a,right:l}}E(hN,"plus");function dN(t,e,r,n,i){const a=n.left,s=n.right,o=Wi(t,e,r,{type:Xrt});iu(t,o);const l=Wi(t,e,r,{type:qhe}),u=Wi(t,e,r,{type:Yrt});return o.loopback=u,l.loopback=u,pi(o,a),pi(o,l),pi(s,u),i!==void 0?(pi(u,l),pi(u,i.left),pi(i.right,a)):pi(u,o),t.decisionMap[Nf(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}E(dN,"star");function Qhe(t,e,r,n){const i=n.left,a=n.right;return pi(i,a),t.decisionMap[Nf(e,"Option",r.idx)]=i,n}E(Qhe,"optional");function iu(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}E(iu,"defineDecisionState");function Of(t,e,r,n,...i){const a=Wi(t,e,n,{type:Hrt,start:r});r.end=a;for(const o of i)o!==void 0?(pi(r,o.left),pi(o.right,a)):pi(r,a);const s={left:r,right:a};return t.decisionMap[Nf(e,Jhe(n),n.idx)]=r,s}E(Of,"makeAlts");function Jhe(t){if(t instanceof Rs)return"Alternation";if(t instanceof va)return"Option";if(t instanceof ai)return"Repetition";if(t instanceof _s)return"RepetitionWithSeparator";if(t instanceof Qs)return"RepetitionMandatory";if(t instanceof Js)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}E(Jhe,"getProdType");function ede(t,e){const r=e.length;for(let a=0;ae.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}},E(z1,"ATNConfigSet"),z1);function pN(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}E(pN,"getATNConfigKey");function ide(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?gN(o,e-1,r,n,i):gue(i,o):n||(i[i.length]=o)}return i}E(gN,"baseFlatten");var cde=gN;function ude(t,e){return cde(nu(t,e),1)}E(ude,"flatMap");var ent=ude;function hde(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}E(gde,"arrayIncludes");var ant=gde;function mde(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=hnt){var u=e?null:unt(t);if(u)return YM(u);s=!1,i=sue,l=new nue}else l=e?[]:o;e:for(;++n{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}E(Rde,"createDFACache");var Lde=(G1=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;nconsole.log(n))}initialize(e){this.atn=Whe(e.rules),this.dfas=Dde(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=Nf(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=nu(SM({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>nu(f,p=>p[0]));if(yN(d,!1)&&!a){const f=_de(d,(p,g,m)=>(mN(g,y=>{y&&(p[y.tokenTypeIdx]=m,mN(y.categoryMatches,v=>{p[v]=m}))}),p),{});return i?function(p){var g;const m=this.LA(1),y=f[m.tokenTypeIdx];if(p!==void 0&&y!==void 0){const v=(g=p[y])===null||g===void 0?void 0:g.GATE;if(v!==void 0&&v.call(this)===!1)return}return y}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new Lde,g=f===void 0?0:f.length;for(let y=0;ynu(f,p=>p[0]));if(yN(d)&&d[0][0]&&!a){const f=d[0],p=pnt(f);if(p.length===1&&Tnt(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=_de(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,mN(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=TE.call(this,s,h,Ide,o);return typeof f=="object"?!1:f===0}}},E(q1,"LLStarLookaheadStrategy"),q1);function yN(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}E(yN,"isLL1Sequence");function Dde(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;nSf(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${Pde(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, <${e}> may appears as a prefix path in all these alternatives. `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES -For Further details.`,n}E(Lde,"buildAmbiguityError");function Ide(t){if(t instanceof is)return"SUBRULE";if(t instanceof va)return"OPTION";if(t instanceof Rs)return"OR";if(t instanceof Qs)return"AT_LEAST_ONE";if(t instanceof Js)return"AT_LEAST_ONE_SEP";if(t instanceof _s)return"MANY_SEP";if(t instanceof ai)return"MANY";if(t instanceof Pn)return"CONSUME";throw Error("non exhaustive match")}E(Ide,"getProductionDslName");function Dde(t,e,r){const n=Grt(e.configs.elements,a=>a.state.transitions),i=ent(n.filter(a=>a instanceof nN).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}E(Dde,"buildAdaptivePredictError");function Mde(t,e){return t.edges[e.tokenTypeIdx]}E(Mde,"getExistingTargetState");function Nde(t,e,r){const n=new lN,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===ET){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l0&&!Fde(a))for(const s of i)a.add(s);return a}E(Nde,"computeReachSet");function Ode(t,e){if(t instanceof nN&&bM(e,t.tokenType))return t.target}E(Ode,"getReachableTarget");function $de(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}E($de,"getUniqueAlt");function fN(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}E(fN,"newDFAState");function pN(t,e,r,n){return n=gN(t,n),e.edges[r.tokenTypeIdx]=n,n}E(pN,"addDFAEdge");function gN(t,e){if(e===yE)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}E(gN,"addDFAState");function Pde(t){const e=new lN,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};ST(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i1)return!0;return!1}E(Vde,"hasConflictingAltSet");function Wde(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}E(Wde,"hasStateAssociatedWithOneAlt"),kx();var Ude=(q1=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new yN(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new xE;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new bE(e.startOffset,e.image.length,Bx(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new bE(a.startOffset,a.image.length,Bx(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infix&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},E(q1,"CstNodeBuilder"),q1),mN=(V1=class{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},E(V1,"AbstractCstNode"),V1),bE=(W1=class extends mN{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},E(W1,"LeafCstNodeImpl"),W1),xE=(U1=class extends mN{constructor(){super(...arguments),this.content=new dnt(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},E(U1,"CompositeCstNodeImpl"),U1),dnt=(c0=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,c0.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}},E(c0,"CstNodeContainer"),c0),yN=(H1=class extends xE{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},E(H1,"RootCstNodeImpl"),H1),TE=Symbol("Datatype");function wE(t){return t.$type===TE}E(wE,"isDataTypeNode");var Hde="​",Yde=E(t=>t.endsWith(Hde)?t:t+Hde,"withRuleSuffix"),vN=(Y1=class{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new pnt(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Zde(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},E(Y1,"AbstractLangiumParser"),Y1),Xde=(X1=class extends vN{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Ude,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e);let i;og(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(Yde(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),rs(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===TE?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),a?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;in)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=Xc(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(wE(u)){let h=i.image;Xc(n)||(h=this.converter.convert(h,s).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,i,s))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(wE(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):wE(e)?this.converter.convert(e.value,e.$cstNode):(N9(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let a=0,s=-1;for(let m=0;ms?(s=v.precedence,a=m):v.precedence===s&&(v.rightAssoc||(a=m))}const o=i.slice(0,a),l=i.slice(a+1),u=n.slice(0,a+1),h=n.slice(a+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:h,operators:l},p=this.constructInfix(d,r),g=this.constructInfix(f,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[a],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=jd(e,Hc);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Qd(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a==="single"&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):a==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},E(X1,"LangiumParser"),X1),Kde=(K1=class{buildMismatchTokenMessage(e){return Ag.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Ag.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Ag.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Ag.buildEarlyExitMessage(e)}},E(K1,"AbstractParserErrorMessageProvider"),K1),bN=(j1=class extends Kde{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},E(j1,"LangiumParserErrorMessageProvider"),j1),jde=(Z1=class extends vN{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(Yde(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},E(Z1,"LangiumCompletionParser"),Z1),fnt={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new bN},Zde=(Q1=class extends ZQe{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...fnt,lookaheadStrategy:n?new DM({maxLookahead:r.maxLookahead}):new hnt({logging:r.skipValidations?()=>{}:void 0}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},E(Q1,"ChevrotainWrapper"),Q1),pnt=(J1=class extends Zde{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}},E(J1,"ProfilerWrapper"),J1);function CE(t,e,r){return Qde({parser:e,tokens:r,ruleNames:new Map},t),e}E(CE,"createParser");function Qde(t,e){const r=ck(e,!1),n=pn(e.rules).filter(rs).filter(a=>r.has(a));for(const a of n){const s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,Ah(s,a.definition))}const i=pn(e.rules).filter(og).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,Jde(t,a))}E(Qde,"buildRules");function Jde(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(yo(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},a={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,s);const l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:s};s.elements.push(l,u);const d=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:E(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=kE(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:E(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}E(Jde,"buildInfixRule");function Ah(t,e,r=!1){let n;if(Xc(e))n=sfe(t,e);else if(gh(e))n=efe(t,e);else if(Hc(e))n=Ah(t,e.terminal);else if(Qd(e))n=xN(t,e);else if(Kc(e))n=tfe(t,e);else if($3(e))n=nfe(t,e);else if(J3(e))n=ife(t,e);else if(ef(e))n=afe(t,e);else if(G9(e)){const i=t.consume++;n=E(()=>t.parser.consume(i,Ch,e),"method")}else throw new rk(e.$cstNode,`Unexpected element type: ${e.$type}`);return TN(t,r?void 0:AT(e),n,e.cardinality)}E(Ah,"buildElement");function efe(t,e){const r=pf(e);return()=>t.parser.action(r,e)}E(efe,"buildAction");function tfe(t,e){const r=e.rule.ref;if(Zd(r)){const n=t.subrule++,i=rs(r)&&r.fragment,a=e.arguments.length>0?rfe(r,e.arguments):()=>({});let s;return o=>{s??(s=kE(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(yo(r)){const n=t.consume++,i=EE(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)xh();else throw new rk(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}E(tfe,"buildRuleCall");function rfe(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,s;return{parameterName:(s=(a=i.parameter)==null?void 0:a.ref)==null?void 0:s.name,predicate:Zo(i.value)}});return i=>{const a={};for(const{parameterName:s,predicate:o}of n)s&&(a[s]=o(i));return a}}else{const n=e.map(i=>Zo(i.value));return i=>{const a={};for(let s=0;se(n)||r(n)}else if(F9(t)){const e=Zo(t.left),r=Zo(t.right);return n=>e(n)&&r(n)}else if(W9(t)){const e=Zo(t.value);return r=>!e(r)}else if(U9(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(P9(t)){const e=!!t.true;return()=>e}xh()}E(Zo,"buildPredicate");function nfe(t,e){if(e.elements.length===1)return Ah(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:Ah(t,i,!0)},s=AT(i);s&&(a.GATE=Zo(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:E(()=>a.ALT(i),"ALT")},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}E(nfe,"buildAlternatives");function ife(t,e){if(e.elements.length===1)return Ah(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:Ah(t,o,!0)},u=AT(o);u&&(l.GATE=Zo(u)),r.push(l)}const n=t.or++,i=E((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),a=E(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:E(()=>!0,"ALT")},d=t.parser;h.ALT=()=>{if(l.ALT(o),!d.isRecording()){const p=i(n,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const g=d.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?h.GATE=()=>f(o):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),"alternatives"),s=TN(t,AT(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}E(ife,"buildUnorderedGroup");function afe(t,e){const r=e.elements.map(n=>Ah(t,n));return n=>r.forEach(i=>i(n))}E(afe,"buildGroup");function AT(t){if(ef(t))return t.guardCondition}E(AT,"getGuardCondition");function xN(t,e,r=e.terminal){if(r)if(Kc(r)&&rs(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=kE(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(Kc(r)&&yo(r.rule.ref)){const n=t.consume++,i=EE(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Xc(r)){const n=t.consume++,i=EE(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=fk(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+pf(e.type.ref));return xN(t,e,i)}}E(xN,"buildCrossReference");function sfe(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}E(sfe,"buildKeyword");function TN(t,e,r,n){const i=e&&Zo(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:E(()=>r(s),"ALT"),GATE:E(()=>i(s),"GATE")},{ALT:BM(),GATE:E(()=>!i(s),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:E(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:E(()=>t.parser.atLeastOne(a,{DEF:E(()=>r(o),"DEF")}),"ALT"),GATE:E(()=>i(o),"GATE")},{ALT:BM(),GATE:E(()=>!i(o),"GATE")}])}else return s=>t.parser.atLeastOne(a,{DEF:E(()=>r(s),"DEF")})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:E(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else xh()}E(TN,"wrap");function kE(t,e){const r=ofe(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}E(kE,"getRule");function ofe(t,e){if(Zd(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!rs(n);)(ef(n)||$3(n)||J3(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}E(ofe,"getRuleName");function EE(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}E(EE,"getToken");function wN(t){const e=t.Grammar,r=t.parser.Lexer,n=new jde(t);return CE(e,n,r.definition),n.finalize(),n}E(wN,"createCompletionParser");function CN(t){const e=kN(t);return e.finalize(),e}E(CN,"createLangiumParser");function kN(t){const e=t.Grammar,r=t.parser.Lexer,n=new Xde(t);return CE(e,n,r.definition)}E(kN,"prepareLangiumParser");var SE=(ey=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=pn(ck(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return a.push(...i),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(yo).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=Gx(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=lk(r)?as.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Zd).flatMap(i=>Uc(i).filter(Xc)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(yg(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&gD("^"+a.source+"$",e.value)&&n.push(i),n},[])}},E(ey,"DefaultTokenBuilder"),ey),EN=(ty=class{convert(e,r){let n=r.grammarSource;if(Qd(n)&&(n=xD(n)),Kc(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return Ql.convertInt(r);case"STRING":return Ql.convertString(r);case"ID":return Ql.convertID(r)}switch((i=RD(e))==null?void 0:i.toLowerCase()){case"number":return Ql.convertNumber(r);case"boolean":return Ql.convertBoolean(r);case"bigint":return Ql.convertBigint(r);case"date":return Ql.convertDate(r);default:return r}}},E(ty,"DefaultValueConverter"),ty),Ql;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}E(AE,"delayNextTick");var _E=0,lfe=10;function RE(){return _E=performance.now(),new _n.CancellationTokenSource}E(RE,"startCancelableOperation");function SN(t){lfe=t}E(SN,"setInterruptionPeriod");var Jl=Symbol("OperationCancelled");function $f(t){return t===Jl}E($f,"isOperationCancelled");async function ra(t){if(t===_n.CancellationToken.None)return;const e=performance.now();if(e-_E>=lfe&&(_E=e,await AE(),_E=performance.now()),t.isCancellationRequested)throw Jl}E(ra,"interruptAndCheck");var au=(ry=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},E(ry,"Deferred"),ry),cfe=(Ph=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(Ph.isIncremental(n)){const i=RN(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=AN(n.text,!1,a);if(l-o===h.length)for(let f=0,p=h.length;fe?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1r&&_N(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},E(Ph,"FullTextDocument"),Ph),LE;(function(t){function e(i,a,s,o){return new cfe(i,a,s,o)}E(e,"create"),t.create=e;function r(i,a,s){if(i instanceof cfe)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}E(r,"update"),t.update=r;function n(i,a){const s=i.getText(),o=IE(a.map(ufe),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(dl&&u.push(s.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(s.substr(l)),u.join("")}E(n,"applyEdits"),t.applyEdits=n})(LE||(LE={}));function IE(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);IE(n,e),IE(i,e);let a=0,s=0,o=0;for(;ar.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}E(RN,"getWellformedRange");function ufe(t){const e=RN(t.range);return e!==t.range?{newText:t.newText,range:e}:t}E(ufe,"getWellformedEdit");var hfe;(()=>{var t={975:F=>{function S(D){if(typeof D!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(D))}E(S,"e");function R(D,I){for(var $,B="",P=0,G=-1,V=0,Y=0;Y<=D.length;++Y){if(Y2){var W=B.lastIndexOf("/");if(W!==B.length-1){W===-1?(B="",P=0):P=(B=B.slice(0,W)).length-1-B.lastIndexOf("/"),G=Y,V=0;continue}}else if(B.length===2||B.length===1){B="",P=0,G=Y,V=0;continue}}I&&(B.length>0?B+="/..":B="..",P=2)}else B.length>0?B+="/"+D.slice(G+1,Y):B=D.slice(G+1,Y),P=Y-G-1;G=Y,V=0}else $===46&&V!==-1?++V:V=-1}return B}E(R,"r");var N={resolve:E(function(){for(var D,I="",$=!1,B=arguments.length-1;B>=-1&&!$;B--){var P;B>=0?P=arguments[B]:(D===void 0&&(D=process.cwd()),P=D),S(P),P.length!==0&&(I=P+"/"+I,$=P.charCodeAt(0)===47)}return I=R(I,!$),$?I.length>0?"/"+I:"/":I.length>0?I:"."},"resolve"),normalize:E(function(D){if(S(D),D.length===0)return".";var I=D.charCodeAt(0)===47,$=D.charCodeAt(D.length-1)===47;return(D=R(D,!I)).length!==0||I||(D="."),D.length>0&&$&&(D+="/"),I?"/"+D:D},"normalize"),isAbsolute:E(function(D){return S(D),D.length>0&&D.charCodeAt(0)===47},"isAbsolute"),join:E(function(){if(arguments.length===0)return".";for(var D,I=0;I0&&(D===void 0?D=$:D+="/"+$)}return D===void 0?".":N.normalize(D)},"join"),relative:E(function(D,I){if(S(D),S(I),D===I||(D=N.resolve(D))===(I=N.resolve(I)))return"";for(var $=1;$Y){if(I.charCodeAt(G+ie)===47)return I.slice(G+ie+1);if(ie===0)return I.slice(G+ie)}else P>Y&&(D.charCodeAt($+ie)===47?W=ie:ie===0&&(W=0));break}var K=D.charCodeAt($+ie);if(K!==I.charCodeAt(G+ie))break;K===47&&(W=ie)}var se="";for(ie=$+W+1;ie<=B;++ie)ie!==B&&D.charCodeAt(ie)!==47||(se.length===0?se+="..":se+="/..");return se.length>0?se+I.slice(G+W):(G+=W,I.charCodeAt(G)===47&&++G,I.slice(G))},"relative"),_makeLong:E(function(D){return D},"_makeLong"),dirname:E(function(D){if(S(D),D.length===0)return".";for(var I=D.charCodeAt(0),$=I===47,B=-1,P=!0,G=D.length-1;G>=1;--G)if((I=D.charCodeAt(G))===47){if(!P){B=G;break}}else P=!1;return B===-1?$?"/":".":$&&B===1?"//":D.slice(0,B)},"dirname"),basename:E(function(D,I){if(I!==void 0&&typeof I!="string")throw new TypeError('"ext" argument must be a string');S(D);var $,B=0,P=-1,G=!0;if(I!==void 0&&I.length>0&&I.length<=D.length){if(I.length===D.length&&I===D)return"";var V=I.length-1,Y=-1;for($=D.length-1;$>=0;--$){var W=D.charCodeAt($);if(W===47){if(!G){B=$+1;break}}else Y===-1&&(G=!1,Y=$+1),V>=0&&(W===I.charCodeAt(V)?--V==-1&&(P=$):(V=-1,P=Y))}return B===P?P=Y:P===-1&&(P=D.length),D.slice(B,P)}for($=D.length-1;$>=0;--$)if(D.charCodeAt($)===47){if(!G){B=$+1;break}}else P===-1&&(G=!1,P=$+1);return P===-1?"":D.slice(B,P)},"basename"),extname:E(function(D){S(D);for(var I=-1,$=0,B=-1,P=!0,G=0,V=D.length-1;V>=0;--V){var Y=D.charCodeAt(V);if(Y!==47)B===-1&&(P=!1,B=V+1),Y===46?I===-1?I=V:G!==1&&(G=1):I!==-1&&(G=-1);else if(!P){$=V+1;break}}return I===-1||B===-1||G===0||G===1&&I===B-1&&I===$+1?"":D.slice(I,B)},"extname"),format:E(function(D){if(D===null||typeof D!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof D);return(function(I,$){var B=$.dir||$.root,P=$.base||($.name||"")+($.ext||"");return B?B===$.root?B+P:B+"/"+P:P})(0,D)},"format"),parse:E(function(D){S(D);var I={root:"",dir:"",base:"",ext:"",name:""};if(D.length===0)return I;var $,B=D.charCodeAt(0),P=B===47;P?(I.root="/",$=1):$=0;for(var G=-1,V=0,Y=-1,W=!0,ie=D.length-1,K=0;ie>=$;--ie)if((B=D.charCodeAt(ie))!==47)Y===-1&&(W=!1,Y=ie+1),B===46?G===-1?G=ie:K!==1&&(K=1):G!==-1&&(K=-1);else if(!W){V=ie+1;break}return G===-1||Y===-1||K===0||K===1&&G===Y-1&&G===V+1?Y!==-1&&(I.base=I.name=V===0&&P?D.slice(1,Y):D.slice(V,Y)):(V===0&&P?(I.name=D.slice(1,G),I.base=D.slice(1,Y)):(I.name=D.slice(V,G),I.base=D.slice(V,Y)),I.ext=D.slice(G,Y)),V>0?I.dir=D.slice(0,V-1):P&&(I.dir="/"),I},"parse"),sep:"/",delimiter:":",win32:null,posix:null};N.posix=N,F.exports=N}},e={};function r(F){var S=e[F];if(S!==void 0)return S.exports;var R=e[F]={exports:{}};return t[F](R,R.exports,r),R.exports}E(r,"r"),r.d=(F,S)=>{for(var R in S)r.o(S,R)&&!r.o(F,R)&&Object.defineProperty(F,R,{enumerable:!0,get:S[R]})},r.o=(F,S)=>Object.prototype.hasOwnProperty.call(F,S),r.r=F=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(F,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:E(()=>f,"URI"),Utils:E(()=>O,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l(F,S){if(!F.scheme&&S)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${F.authority}", path: "${F.path}", query: "${F.query}", fragment: "${F.fragment}"}`);if(F.scheme&&!a.test(F.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(F.path){if(F.authority){if(!s.test(F.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(F.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}E(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,M=class M{constructor(S,R,N,D,I,$=!1){Hr(this,"scheme");Hr(this,"authority");Hr(this,"path");Hr(this,"query");Hr(this,"fragment");typeof S=="object"?(this.scheme=S.scheme||u,this.authority=S.authority||u,this.path=S.path||u,this.query=S.query||u,this.fragment=S.fragment||u):(this.scheme=(function(B,P){return B||P?B:"file"})(S,$),this.authority=R||u,this.path=(function(B,P){switch(B){case"https":case"http":case"file":P?P[0]!==h&&(P=h+P):P=h}return P})(this.scheme,N||u),this.query=D||u,this.fragment=I||u,l(this,$))}static isUri(S){return S instanceof M||!!S&&typeof S.authority=="string"&&typeof S.fragment=="string"&&typeof S.path=="string"&&typeof S.query=="string"&&typeof S.scheme=="string"&&typeof S.fsPath=="string"&&typeof S.with=="function"&&typeof S.toString=="function"}get fsPath(){return T(this,!1)}with(S){if(!S)return this;let{scheme:R,authority:N,path:D,query:I,fragment:$}=S;return R===void 0?R=this.scheme:R===null&&(R=u),N===void 0?N=this.authority:N===null&&(N=u),D===void 0?D=this.path:D===null&&(D=u),I===void 0?I=this.query:I===null&&(I=u),$===void 0?$=this.fragment:$===null&&($=u),R===this.scheme&&N===this.authority&&D===this.path&&I===this.query&&$===this.fragment?this:new g(R,N,D,I,$)}static parse(S,R=!1){const N=d.exec(S);return N?new g(N[2]||u,A(N[4]||u),A(N[5]||u),A(N[7]||u),A(N[9]||u),R):new g(u,u,u,u,u)}static file(S){let R=u;if(i&&(S=S.replace(/\\/g,h)),S[0]===h&&S[1]===h){const N=S.indexOf(h,2);N===-1?(R=S.substring(2),S=h):(R=S.substring(2,N),S=S.substring(N)||h)}return new g("file",R,S,u,u)}static from(S){const R=new g(S.scheme,S.authority,S.path,S.query,S.fragment);return l(R,!0),R}toString(S=!1){return b(this,S)}toJSON(){return this}static revive(S){if(S){if(S instanceof M)return S;{const R=new g(S);return R._formatted=S.external,R._fsPath=S._sep===p?S.fsPath:null,R}}return S}};E(M,"l");let f=M;const p=i?1:void 0,z=class z extends f{constructor(){super(...arguments);Hr(this,"_formatted",null);Hr(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=T(this,!1)),this._fsPath}toString(R=!1){return R?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){const R={$mid:1};return this._fsPath&&(R.fsPath=this._fsPath,R._sep=p),this._formatted&&(R.external=this._formatted),this.path&&(R.path=this.path),this.scheme&&(R.scheme=this.scheme),this.authority&&(R.authority=this.authority),this.query&&(R.query=this.query),this.fragment&&(R.fragment=this.fragment),R}};E(z,"d");let g=z;const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function y(F,S,R){let N,D=-1;for(let I=0;I=97&&$<=122||$>=65&&$<=90||$>=48&&$<=57||$===45||$===46||$===95||$===126||S&&$===47||R&&$===91||R&&$===93||R&&$===58)D!==-1&&(N+=encodeURIComponent(F.substring(D,I)),D=-1),N!==void 0&&(N+=F.charAt(I));else{N===void 0&&(N=F.substr(0,I));const B=m[$];B!==void 0?(D!==-1&&(N+=encodeURIComponent(F.substring(D,I)),D=-1),N+=B):D===-1&&(D=I)}}return D!==-1&&(N+=encodeURIComponent(F.substring(D))),N!==void 0?N:F}E(y,"m");function v(F){let S;for(let R=0;R1&&F.scheme==="file"?`//${F.authority}${F.path}`:F.path.charCodeAt(0)===47&&(F.path.charCodeAt(1)>=65&&F.path.charCodeAt(1)<=90||F.path.charCodeAt(1)>=97&&F.path.charCodeAt(1)<=122)&&F.path.charCodeAt(2)===58?S?F.path.substr(1):F.path[1].toLowerCase()+F.path.substr(2):F.path,i&&(R=R.replace(/\//g,"\\")),R}E(T,"v");function b(F,S){const R=S?v:y;let N="",{scheme:D,authority:I,path:$,query:B,fragment:P}=F;if(D&&(N+=D,N+=":"),(I||D==="file")&&(N+=h,N+=h),I){let G=I.indexOf("@");if(G!==-1){const V=I.substr(0,G);I=I.substr(G+1),G=V.lastIndexOf(":"),G===-1?N+=R(V,!1,!1):(N+=R(V.substr(0,G),!1,!1),N+=":",N+=R(V.substr(G+1),!1,!0)),N+="@"}I=I.toLowerCase(),G=I.lastIndexOf(":"),G===-1?N+=R(I,!1,!0):(N+=R(I.substr(0,G),!1,!0),N+=I.substr(G))}if($){if($.length>=3&&$.charCodeAt(0)===47&&$.charCodeAt(2)===58){const G=$.charCodeAt(1);G>=65&&G<=90&&($=`/${String.fromCharCode(G+32)}:${$.substr(3)}`)}else if($.length>=2&&$.charCodeAt(1)===58){const G=$.charCodeAt(0);G>=65&&G<=90&&($=`${String.fromCharCode(G+32)}:${$.substr(2)}`)}N+=R($,!0,!1)}return B&&(N+="?",N+=R(B,!1,!1)),P&&(N+="#",N+=S?P:y(P,!1,!1)),N}E(b,"b");function w(F){try{return decodeURIComponent(F)}catch{return F.length>3?F.substr(0,3)+w(F.substr(3)):F}}E(w,"C");const k=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function A(F){return F.match(k)?F.replace(k,(S=>w(S))):F}E(A,"w");var C=r(975);const _=C.posix||C,L="/";var O;(function(F){F.joinPath=function(S,...R){return S.with({path:_.join(S.path,...R)})},F.resolvePath=function(S,...R){let N=S.path,D=!1;N[0]!==L&&(N=L+N,D=!0);let I=_.resolve(N,...R);return D&&I[0]===L&&!S.authority&&(I=I.substring(1)),S.with({path:I})},F.dirname=function(S){if(S.path.length===0||S.path===L)return S;let R=_.dirname(S.path);return R.length===1&&R.charCodeAt(0)===46&&(R=""),S.with({path:R})},F.basename=function(S){return _.basename(S.path)},F.extname=function(S){return _.extname(S.path)}})(O||(O={})),hfe=n})();var{URI:eo,Utils:_T}=hfe,ls;(function(t){t.basename=_T.basename,t.dirname=_T.dirname,t.extname=_T.extname,t.joinPath=_T.joinPath,t.resolvePath=_T.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(s,o){return(s==null?void 0:s.toString())===(o==null?void 0:o.toString())}E(r,"equals"),t.equals=r;function n(s,o){const l=typeof s=="string"?eo.parse(s).path:s.path,u=typeof o=="string"?eo.parse(o).path:o.path,h=l.split("/").filter(m=>m.length>0),d=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(h[0]&&m.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]&&m.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]!==d[0])return u.substring(1)}let f=0;for(;f({name:i.name,uri:ls.joinPath(eo.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(ls.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const a of n){let s=i.children.get(a);if(!s)if(r)s={name:a,children:new Map,parent:i},i.children.set(a,s);else return;i=s}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}},E(ny,"UriTrie"),ny),zr;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(zr||(zr={}));var dfe=(iy=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=_n.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??eo.parse(e.uri),_n.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return _n.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:zr.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:zr.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var s,o;const n=(s=e.parseResult.value.$cstNode)==null?void 0:s.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),a=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:l})}return n!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=zr.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=LE.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},E(iy,"DefaultLangiumDocumentFactory"),iy),ffe=(ay=class{constructor(e){this.documentTrie=new LN,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return pn(this.documentTrie.all())}addDocument(e){const r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,zr.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=zr.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=zr.Changed;return this.documentTrie.delete(r),n}},E(ay,"DefaultLangiumDocuments"),ay),Pf=Symbol("RefResolving"),pfe=(sy=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=_n.CancellationToken.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const a of Vo(e.parseResult.value))await ra(r),ag(a).forEach(s=>{const o=`${a.$type}:${s.property}`;i.startSubTask(o);try{this.doLink(s,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of Vo(e.parseResult.value))await ra(r),ag(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=Pf;try{const i=this.getCandidate(e);if(Xd(i))n._ref=i;else{n._nodeDescription=i;const a=this.loadAstNode(i);n._ref=a??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const a=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${a}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=Pf;try{const i=this.getCandidates(e),a=[];if(Xd(i))n._linkingError=i;else for(const s of i){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}n._items=a}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(const r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(Ii(this._ref))return this._ref;if(I9(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=Pf;const o=ig(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if(Xd(r))return{error:r};const n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=ig(e.container).$document;n&&n.stateQd(r)&&r.isMulti)}findDeclarations(e){if(e){const r=kD(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(es(i)||ql(i))return D3(i);if(Array.isArray(i)){for(const a of i)if((es(a)||ql(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return D3(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||tD(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of ag(n))if(ql(i.reference)&&i.reference.items.some(a=>a.ref===e))return i.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i)??i.$cstNode;a&&n.push(a)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>ls.equals(a.sourceUri,r.documentUri))),n.push(...i),pn(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=qo(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:gg(a),local:!0})}}return n}},E(ly,"DefaultReferences"),ly),su=(cy=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return Ax.sum(pn(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const r=this.map.get(e);return r?pn(r):tg}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return pn(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return pn(this.map.keys())}values(){return pn(this.map.values()).flat()}entriesGroupedByKey(){return pn(this.map.entries())}},E(cy,"MultiMap"),cy),DE=(uy=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}},E(uy,"BiMap"),uy),yfe=(hy=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=_n.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=_x,i=_n.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await ra(i),this.addExportedSymbol(s,a,r);return a}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=_n.CancellationToken.None){const n=e.parseResult.value,i=new su;for(const a of Uc(n))await ra(r),this.addLocalSymbol(a,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}},E(hy,"DefaultScopeComputation"),hy),DN=(dy=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},E(dy,"StreamScope"),dy),gnt=(fy=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?pn(i).concat(this.outerScope.getElements(e)):pn(i)}getAllElements(){let e=pn(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},E(fy,"MapScope"),fy),vfe=(py=class{constructor(e,r,n){this.elements=new su,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?pn(n).concat(this.outerScope.getElements(e)):pn(n)}getAllElements(){let e=pn(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},E(py,"MultiMapScope"),py),mnt={getElement(){},getElements(){return tg},getAllElements(){return tg}},ME=(gy=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},E(gy,"DisposableCache"),gy),MN=(my=class extends ME{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},E(my,"SimpleCache"),my),NE=(yy=class extends ME{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},E(yy,"ContextCache"),yy),bfe=(vy=class extends NE{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(const a of i)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{const a=n.concat(i);for(const s of a)this.clear(s)}))}},E(vy,"DocumentCache"),vy),NN=(by=class extends MN{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},E(by,"WorkspaceCache"),by),xfe=(xy=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new NN(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=qo(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(o=>this.reflection.isSubtype(o.type,n))),s=s.$container;while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new DN(pn(e),r,n)}createScopeForNodes(e,r,n){const i=pn(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new DN(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new vfe(this.indexManager.allElements(e)))}},E(xy,"DefaultScopeProvider"),xy);function ON(t){return typeof t.$comment=="string"}E(ON,"isAstNodeWithComment");function $N(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}E($N,"isIntermediateReference");var Tfe=(Ty=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,a=E((o,l)=>this.replacer(o,l,n),"defaultReplacer"),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=qo(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,u,h;if(!this.ignoreProperties.has(e))if(es(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=qo(d);let g="";this.currentDocument&&this.currentDocument!==p&&(o?g=o(p.uri,d):g=p.uri.toString());const m=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${m}`,$refText:f}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:f}}else if(ql(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=qo(p.ref);let y="";this.currentDocument&&this.currentDocument!==m&&(o?y=o(m.uri,g):y=m.uri.toString());const v=this.astNodeLocator.getAstNodePath(g);f.push(`${y}#${v}`)}return{$refs:f,$refText:d}}else if(Ii(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(h=r.$cstNode)==null?void 0:h.text),s){d??(d={...r});const f=this.commentProvider.getComment(r);f&&(d.$comment=f.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=E(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=wD(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if($f(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=pn(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},E(Cy,"ValidationRegistry"),Cy),kfe=Object.freeze({validateNode:!0,validateChildren:!0}),Efe=(ky=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=_n.CancellationToken.None){const i=e.parseResult,a=[];if(await ra(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===wo.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===wo.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===wo.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if($f(s))throw s;console.error("An error occurred during validation:",s)}return await ra(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const s of i){const o=s.severity??"error",l={severity:RT(o),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:BN(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=Bx(i.token);if(a){const s={severity:RT("error"),range:a,message:i.message,data:Bf(wo.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const s=a.error;if(s){const o={node:s.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:s.info.property,index:s.info.index,data:{code:wo.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};r.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,r,n=_n.CancellationToken.None){const i=[],a=E((s,o,l)=>{i.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=_n.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await ra(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=_n.CancellationToken.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const o=Vo(e).iterator();for(const l of o){s.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const h=this.validationRegistry.getChecks(l.$type,r.categories);for(const d of h)await d(l,n,i)}finally{s.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{s.stop()}}else{const s=Vo(e).iterator();for(const o of s){await ra(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const h of u)await h(o,n,i)}l.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return kfe}async validateAstAfter(e,r,n,i=_n.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await ra(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:PN(n),severity:RT(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},E(ky,"DefaultDocumentValidator"),ky);function PN(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=uk(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=CD(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}E(PN,"getDiagnosticRange");function RT(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}E(RT,"toDiagnosticSeverity");function BN(t){switch(t){case"error":return Bf(wo.LexingError);case"warning":return Bf(wo.LexingWarning);case"info":return Bf(wo.LexingInfo);case"hint":return Bf(wo.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}E(BN,"toDiagnosticData");var wo;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(wo||(wo={}));var Sfe=(Ey=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??qo(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=E(()=>s??(s=gg(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:gg(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},E(Ey,"DefaultAstNodeDescriptionProvider"),Ey),Afe=(Sy=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=_n.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of Vo(i))await ra(r),ag(a).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];es(r)&&r.$nodeDescription?n=[r.$nodeDescription]:ql(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=qo(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=gg(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:ls.equals(l.documentUri,i)});return s}},E(Sy,"DefaultReferenceDescriptionProvider"),Sy),_fe=(Ay=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),u=i[o];return u==null?void 0:u[l]}return i[a]},e)}},E(Ay,"DefaultAstNodeLocator"),Ay),$E={};T3($E,EI(Jp()));var Rfe=(_y=class{constructor(e){this._ready=new au,this.onConfigurationSectionUpdateEmitter=new $E.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},E(_y,"DefaultConfigurationProvider"),_y),PE=EI(XUe()),Ff;(function(t){function e(r){return{dispose:E(async()=>await r(),"dispose")}}E(e,"create"),t.create=e})(Ff||(Ff={}));var Lfe=(Ry=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new su,this.documentPhaseListeners=new su,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=zr.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=_n.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===zr.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,zr.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(a,r);o.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(s))==null?void 0:i.result}),a.state=zr.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=zr.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=_n.CancellationToken.None){this.currentState=zr.Changed;const i=[];for(const l of r){const u=this.langiumDocuments.deleteDocuments(l);for(const h of u)i.push(h.uri),this.cleanUpDeleted(h)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=zr.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,zr.Changed)}const s=pn(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,zr.ComputedScopes)),await this.emitUpdate(a,i),await ra(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state=1}findMissingValidationCategories(e,r){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return pn(s).filter(u=>!a.has(u)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r=0&&!this.hasTextDocument(e[n]);)n--;rn.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),Ff.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case zr.Changed:case zr.Parsed:this.indexManager.removeContent(e.uri);case zr.IndexedContent:e.localSymbols=void 0;case zr.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case zr.Linked:this.indexManager.removeReferences(e.uri);case zr.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case zr.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=zr.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,zr.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,zr.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,zr.ComputedScopes,n,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,n)});const i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,zr.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,zr.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,zr.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){for(const s of e)s.states.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),Ff.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),Ff.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=_n.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(Jl);if(this.currentState>=e&&e>i.state)return Promise.reject(new PE.ResponseError(PE.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${zr[i.state]}, requiring ${zr[e]}, but workspace state is already ${zr[this.currentState]}. Returning undefined.`))}else return Promise.reject(new PE.ResponseError(PE.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{ls.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(Jl)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(Jl):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(Jl)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await ra(n),await s(e,n)}catch(o){if(!$f(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await ra(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),a=typeof i.validation=="object"?{...i.validation}:{};a.categories=this.findMissingValidationCategories(e,i);const s=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=pn(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},E(Ry,"DefaultDocumentBuilder"),Ry),Ife=(Ly=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new NE,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=qo(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{ls.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),pn(i)}allElements(e,r){let n=pn(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=_n.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=_n.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}},E(Ly,"DefaultIndexManager"),Ly),Dfe=(Iy=class{constructor(e){this.initialBuildOptions={},this._ready=new au,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=_n.CancellationToken.None){const n=await this.performStartup(e);await ra(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=E(s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));const a=pn(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return eo.parse(e.uri)}async traverseFolder(e,r){try{const n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=ls.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},E(Iy,"DefaultWorkspaceManager"),Iy),Mfe=(Dy=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return yM.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return yM.buildUnableToPopLexerModeMessage(e)}},E(Dy,"DefaultLexerErrorMessageProvider"),Dy),FN={mode:"full"},zN=(My=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=zE(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new as(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=FN){var i,a;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(a=(i=this.tokenBuilder).flushLexingReport)==null?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(zE(e))return e;const r=FE(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},E(My,"DefaultLexer"),My);function BE(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}E(BE,"isTokenTypeArray");function FE(t){return t&&"modes"in t&&"defaultMode"in t}E(FE,"isIMultiModeLexerDefinition");function zE(t){return!BE(t)&&!FE(t)}E(zE,"isTokenTypeDictionary"),kx();function GN(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=sn.create(0,0));const a=VN(t),s=qE(n),o=Ofe({lines:a,position:i,options:s});return Bfe({index:0,tokens:o,position:i})}E(GN,"parseJSDoc");function qN(t,e){const r=qE(e),n=VN(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}E(qN,"isJSDoc");function VN(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(vre)}E(VN,"getLines");var Nfe=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,ynt=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Ofe(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o=h.length){if(e.length>0){const p=sn.create(r,n);e.push({type:"break",content:"",range:Ur.create(p,p)})}}else{Nfe.lastIndex=d;const p=Nfe.exec(h);if(p){const g=p[0],m=p[1],y=sn.create(r,n+d),v=sn.create(r,n+d+g.length);e.push({type:"tag",content:m,range:Ur.create(y,v)}),d+=g.length,d=GE(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}E(Ofe,"tokenize");function $fe(t,e,r,n){const i=[];if(t.length===0){const a=sn.create(r,n),s=sn.create(r,n+e.length);i.push({type:"text",content:e,range:Ur.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:Ur.create(sn.create(r,a+n),sn.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:Ur.create(sn.create(r,a+h+n),sn.create(r,a+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:Ur.create(sn.create(r,a+h+n),sn.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:Ur.create(sn.create(r,a+h+n),sn.create(r,a+h+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:Ur.create(sn.create(r,a+n),sn.create(r,a+n+s.length))})}return i}E($fe,"buildInlineTokens");var vnt=/\S/,bnt=/\s*$/;function GE(t,e){const r=t.substring(e).match(vnt);return r?e+r.index:t.length}E(GE,"skipWhitespace");function Pfe(t){const e=t.match(bnt);if(e&&typeof e.index=="number")return e.index}E(Pfe,"lastCharacter");function Bfe(t){var a,s;const e=sn.create(t.position.line,t.position.character);if(t.tokens.length===0)return new qfe([],Ur.create(e,e));const r=[];for(;t.indexr.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=KN(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=KN(r)+i}return r.trim()}},E(Ny,"JSDocCommentImpl"),Ny),YN=(Oy=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e} -${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r;return((r=e==null?void 0:e.renderTag)==null?void 0:r.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=Vfe(this.name,r,e??{});if(typeof a=="string")return a}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i} -${r}`),this.inline?`{${i}}`:i}},E(Oy,"JSDocTagImpl"),Oy);function Vfe(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=GE(e,i);a=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),((n=r.renderLink)==null?void 0:n.call(r,e,a))??Wfe(e,a)}}E(Vfe,"renderInlineTag");function Wfe(t,e){try{return eo.parse(t,!0),`[${e}](${t})`}catch{return t}}E(Wfe,"renderLinkDefault");var XN=($y=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;rn.range.start.line&&(e+=` +For Further details.`,n}E($de,"buildAmbiguityError");function Pde(t){if(t instanceof is)return"SUBRULE";if(t instanceof va)return"OPTION";if(t instanceof Rs)return"OR";if(t instanceof Qs)return"AT_LEAST_ONE";if(t instanceof Js)return"AT_LEAST_ONE_SEP";if(t instanceof _s)return"MANY_SEP";if(t instanceof ai)return"MANY";if(t instanceof Pn)return"CONSUME";throw Error("non exhaustive match")}E(Pde,"getProductionDslName");function Bde(t,e,r){const n=ent(e.configs.elements,a=>a.state.transitions),i=fnt(n.filter(a=>a instanceof lN).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}E(Bde,"buildAdaptivePredictError");function Fde(t,e){return t.edges[e.tokenTypeIdx]}E(Fde,"getExistingTargetState");function zde(t,e,r){const n=new fN,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===AT){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l0&&!Ude(a))for(const s of i)a.add(s);return a}E(zde,"computeReachSet");function Gde(t,e){if(t instanceof lN&&kM(e,t.tokenType))return t.target}E(Gde,"getReachableTarget");function qde(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}E(qde,"getUniqueAlt");function vN(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}E(vN,"newDFAState");function bN(t,e,r,n){return n=xN(t,n),e.edges[r.tokenTypeIdx]=n,n}E(bN,"addDFAEdge");function xN(t,e){if(e===xE)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}E(xN,"addDFAState");function Vde(t){const e=new fN,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};_T(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i1)return!0;return!1}E(Kde,"hasConflictingAltSet");function jde(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}E(jde,"hasStateAssociatedWithOneAlt"),Sx();var Zde=(V1=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new wN(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new CE;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new wE(e.startOffset,e.image.length,zx(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new wE(a.startOffset,a.image.length,zx(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infix&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},E(V1,"CstNodeBuilder"),V1),TN=(W1=class{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},E(W1,"AbstractCstNode"),W1),wE=(U1=class extends TN{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},E(U1,"LeafCstNodeImpl"),U1),CE=(H1=class extends TN{constructor(){super(...arguments),this.content=new Ent(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},E(H1,"CompositeCstNodeImpl"),H1),Ent=(cp=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,cp.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}},E(cp,"CstNodeContainer"),cp),wN=(Y1=class extends CE{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},E(Y1,"RootCstNodeImpl"),Y1),kE=Symbol("Datatype");function EE(t){return t.$type===kE}E(EE,"isDataTypeNode");var Qde="​",Jde=E(t=>t.endsWith(Qde)?t:t+Qde,"withRuleSuffix"),CN=(X1=class{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new Ant(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new nfe(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},E(X1,"AbstractLangiumParser"),X1),efe=(K1=class extends CN{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Zde,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e);let i;lg(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(Jde(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),rs(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===kE?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),a?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;in)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=Xc(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(EE(u)){let h=i.image;Xc(n)||(h=this.converter.convert(h,s).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,i,s))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(EE(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):EE(e)?this.converter.convert(e.value,e.$cstNode):(F9(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let a=0,s=-1;for(let m=0;ms?(s=v.precedence,a=m):v.precedence===s&&(v.rightAssoc||(a=m))}const o=i.slice(0,a),l=i.slice(a+1),u=n.slice(0,a+1),h=n.slice(a+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:h,operators:l},p=this.constructInfix(d,r),g=this.constructInfix(f,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[a],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=jd(e,Hc);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Qd(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a==="single"&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):a==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},E(K1,"LangiumParser"),K1),tfe=(j1=class{buildMismatchTokenMessage(e){return _g.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return _g.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return _g.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return _g.buildEarlyExitMessage(e)}},E(j1,"AbstractParserErrorMessageProvider"),j1),kN=(Z1=class extends tfe{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},E(Z1,"LangiumParserErrorMessageProvider"),Z1),rfe=(Q1=class extends CN{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(Jde(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},E(Q1,"LangiumCompletionParser"),Q1),Snt={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new kN},nfe=(J1=class extends uJe{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...Snt,lookaheadStrategy:n?new PM({maxLookahead:r.maxLookahead}):new knt({logging:r.skipValidations?()=>{}:void 0}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},E(J1,"ChevrotainWrapper"),J1),Ant=(ey=class extends nfe{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}},E(ey,"ProfilerWrapper"),ey);function SE(t,e,r){return ife({parser:e,tokens:r,ruleNames:new Map},t),e}E(SE,"createParser");function ife(t,e){const r=dk(e,!1),n=pn(e.rules).filter(rs).filter(a=>r.has(a));for(const a of n){const s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,Ah(s,a.definition))}const i=pn(e.rules).filter(lg).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,afe(t,a))}E(ife,"buildRules");function afe(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(yo(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},a={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,s);const l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:s};s.elements.push(l,u);const d=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:E(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=AE(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:E(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}E(afe,"buildInfixRule");function Ah(t,e,r=!1){let n;if(Xc(e))n=dfe(t,e);else if(gh(e))n=sfe(t,e);else if(Hc(e))n=Ah(t,e.terminal);else if(Qd(e))n=EN(t,e);else if(Kc(e))n=ofe(t,e);else if(F3(e))n=cfe(t,e);else if(rk(e))n=ufe(t,e);else if(ef(e))n=hfe(t,e);else if(H9(e)){const i=t.consume++;n=E(()=>t.parser.consume(i,Ch,e),"method")}else throw new ak(e.$cstNode,`Unexpected element type: ${e.$type}`);return SN(t,r?void 0:RT(e),n,e.cardinality)}E(Ah,"buildElement");function sfe(t,e){const r=pf(e);return()=>t.parser.action(r,e)}E(sfe,"buildAction");function ofe(t,e){const r=e.rule.ref;if(Zd(r)){const n=t.subrule++,i=rs(r)&&r.fragment,a=e.arguments.length>0?lfe(r,e.arguments):()=>({});let s;return o=>{s??(s=AE(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(yo(r)){const n=t.consume++,i=_E(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)xh();else throw new ak(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}E(ofe,"buildRuleCall");function lfe(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,s;return{parameterName:(s=(a=i.parameter)==null?void 0:a.ref)==null?void 0:s.name,predicate:Zo(i.value)}});return i=>{const a={};for(const{parameterName:s,predicate:o}of n)s&&(a[s]=o(i));return a}}else{const n=e.map(i=>Zo(i.value));return i=>{const a={};for(let s=0;se(n)||r(n)}else if(W9(t)){const e=Zo(t.left),r=Zo(t.right);return n=>e(n)&&r(n)}else if(K9(t)){const e=Zo(t.value);return r=>!e(r)}else if(j9(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(q9(t)){const e=!!t.true;return()=>e}xh()}E(Zo,"buildPredicate");function cfe(t,e){if(e.elements.length===1)return Ah(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:Ah(t,i,!0)},s=RT(i);s&&(a.GATE=Zo(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:E(()=>a.ALT(i),"ALT")},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}E(cfe,"buildAlternatives");function ufe(t,e){if(e.elements.length===1)return Ah(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:Ah(t,o,!0)},u=RT(o);u&&(l.GATE=Zo(u)),r.push(l)}const n=t.or++,i=E((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),a=E(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:E(()=>!0,"ALT")},d=t.parser;h.ALT=()=>{if(l.ALT(o),!d.isRecording()){const p=i(n,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const g=d.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?h.GATE=()=>f(o):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),"alternatives"),s=SN(t,RT(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}E(ufe,"buildUnorderedGroup");function hfe(t,e){const r=e.elements.map(n=>Ah(t,n));return n=>r.forEach(i=>i(n))}E(hfe,"buildGroup");function RT(t){if(ef(t))return t.guardCondition}E(RT,"getGuardCondition");function EN(t,e,r=e.terminal){if(r)if(Kc(r)&&rs(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=AE(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(Kc(r)&&yo(r.rule.ref)){const n=t.consume++,i=_E(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Xc(r)){const n=t.consume++,i=_E(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=mk(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+pf(e.type.ref));return EN(t,e,i)}}E(EN,"buildCrossReference");function dfe(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}E(dfe,"buildKeyword");function SN(t,e,r,n){const i=e&&Zo(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:E(()=>r(s),"ALT"),GATE:E(()=>i(s),"GATE")},{ALT:VM(),GATE:E(()=>!i(s),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:E(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:E(()=>t.parser.atLeastOne(a,{DEF:E(()=>r(o),"DEF")}),"ALT"),GATE:E(()=>i(o),"GATE")},{ALT:VM(),GATE:E(()=>!i(o),"GATE")}])}else return s=>t.parser.atLeastOne(a,{DEF:E(()=>r(s),"DEF")})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:E(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else xh()}E(SN,"wrap");function AE(t,e){const r=ffe(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}E(AE,"getRule");function ffe(t,e){if(Zd(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!rs(n);)(ef(n)||F3(n)||rk(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}E(ffe,"getRuleName");function _E(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}E(_E,"getToken");function AN(t){const e=t.Grammar,r=t.parser.Lexer,n=new rfe(t);return SE(e,n,r.definition),n.finalize(),n}E(AN,"createCompletionParser");function _N(t){const e=RN(t);return e.finalize(),e}E(_N,"createLangiumParser");function RN(t){const e=t.Grammar,r=t.parser.Lexer,n=new efe(t);return SE(e,n,r.definition)}E(RN,"prepareLangiumParser");var RE=(ty=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=pn(dk(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return a.push(...i),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(yo).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=Vx(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=hk(r)?as.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Zd).flatMap(i=>Uc(i).filter(Xc)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(vg(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&xD("^"+a.source+"$",e.value)&&n.push(i),n},[])}},E(ty,"DefaultTokenBuilder"),ty),LN=(ry=class{convert(e,r){let n=r.grammarSource;if(Qd(n)&&(n=ED(n)),Kc(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return Ql.convertInt(r);case"STRING":return Ql.convertString(r);case"ID":return Ql.convertID(r)}switch((i=ND(e))==null?void 0:i.toLowerCase()){case"number":return Ql.convertNumber(r);case"boolean":return Ql.convertBoolean(r);case"bigint":return Ql.convertBigint(r);case"date":return Ql.convertDate(r);default:return r}}},E(ry,"DefaultValueConverter"),ry),Ql;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}E(LE,"delayNextTick");var IE=0,pfe=10;function DE(){return IE=performance.now(),new _n.CancellationTokenSource}E(DE,"startCancelableOperation");function IN(t){pfe=t}E(IN,"setInterruptionPeriod");var Jl=Symbol("OperationCancelled");function $f(t){return t===Jl}E($f,"isOperationCancelled");async function ra(t){if(t===_n.CancellationToken.None)return;const e=performance.now();if(e-IE>=pfe&&(IE=e,await LE(),IE=performance.now()),t.isCancellationRequested)throw Jl}E(ra,"interruptAndCheck");var au=(ny=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},E(ny,"Deferred"),ny),gfe=(Ph=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(Ph.isIncremental(n)){const i=NN(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=DN(n.text,!1,a);if(l-o===h.length)for(let f=0,p=h.length;fe?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1r&&MN(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},E(Ph,"FullTextDocument"),Ph),ME;(function(t){function e(i,a,s,o){return new gfe(i,a,s,o)}E(e,"create"),t.create=e;function r(i,a,s){if(i instanceof gfe)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}E(r,"update"),t.update=r;function n(i,a){const s=i.getText(),o=NE(a.map(mfe),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(dl&&u.push(s.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(s.substr(l)),u.join("")}E(n,"applyEdits"),t.applyEdits=n})(ME||(ME={}));function NE(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);NE(n,e),NE(i,e);let a=0,s=0,o=0;for(;ar.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}E(NN,"getWellformedRange");function mfe(t){const e=NN(t.range);return e!==t.range?{newText:t.newText,range:e}:t}E(mfe,"getWellformedEdit");var yfe;(()=>{var t={975:F=>{function A(D){if(typeof D!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(D))}E(A,"e");function R(D,I){for(var $,B="",P=0,G=-1,V=0,X=0;X<=D.length;++X){if(X2){var W=B.lastIndexOf("/");if(W!==B.length-1){W===-1?(B="",P=0):P=(B=B.slice(0,W)).length-1-B.lastIndexOf("/"),G=X,V=0;continue}}else if(B.length===2||B.length===1){B="",P=0,G=X,V=0;continue}}I&&(B.length>0?B+="/..":B="..",P=2)}else B.length>0?B+="/"+D.slice(G+1,X):B=D.slice(G+1,X),P=X-G-1;G=X,V=0}else $===46&&V!==-1?++V:V=-1}return B}E(R,"r");var N={resolve:E(function(){for(var D,I="",$=!1,B=arguments.length-1;B>=-1&&!$;B--){var P;B>=0?P=arguments[B]:(D===void 0&&(D=process.cwd()),P=D),A(P),P.length!==0&&(I=P+"/"+I,$=P.charCodeAt(0)===47)}return I=R(I,!$),$?I.length>0?"/"+I:"/":I.length>0?I:"."},"resolve"),normalize:E(function(D){if(A(D),D.length===0)return".";var I=D.charCodeAt(0)===47,$=D.charCodeAt(D.length-1)===47;return(D=R(D,!I)).length!==0||I||(D="."),D.length>0&&$&&(D+="/"),I?"/"+D:D},"normalize"),isAbsolute:E(function(D){return A(D),D.length>0&&D.charCodeAt(0)===47},"isAbsolute"),join:E(function(){if(arguments.length===0)return".";for(var D,I=0;I0&&(D===void 0?D=$:D+="/"+$)}return D===void 0?".":N.normalize(D)},"join"),relative:E(function(D,I){if(A(D),A(I),D===I||(D=N.resolve(D))===(I=N.resolve(I)))return"";for(var $=1;$X){if(I.charCodeAt(G+ie)===47)return I.slice(G+ie+1);if(ie===0)return I.slice(G+ie)}else P>X&&(D.charCodeAt($+ie)===47?W=ie:ie===0&&(W=0));break}var K=D.charCodeAt($+ie);if(K!==I.charCodeAt(G+ie))break;K===47&&(W=ie)}var se="";for(ie=$+W+1;ie<=B;++ie)ie!==B&&D.charCodeAt(ie)!==47||(se.length===0?se+="..":se+="/..");return se.length>0?se+I.slice(G+W):(G+=W,I.charCodeAt(G)===47&&++G,I.slice(G))},"relative"),_makeLong:E(function(D){return D},"_makeLong"),dirname:E(function(D){if(A(D),D.length===0)return".";for(var I=D.charCodeAt(0),$=I===47,B=-1,P=!0,G=D.length-1;G>=1;--G)if((I=D.charCodeAt(G))===47){if(!P){B=G;break}}else P=!1;return B===-1?$?"/":".":$&&B===1?"//":D.slice(0,B)},"dirname"),basename:E(function(D,I){if(I!==void 0&&typeof I!="string")throw new TypeError('"ext" argument must be a string');A(D);var $,B=0,P=-1,G=!0;if(I!==void 0&&I.length>0&&I.length<=D.length){if(I.length===D.length&&I===D)return"";var V=I.length-1,X=-1;for($=D.length-1;$>=0;--$){var W=D.charCodeAt($);if(W===47){if(!G){B=$+1;break}}else X===-1&&(G=!1,X=$+1),V>=0&&(W===I.charCodeAt(V)?--V==-1&&(P=$):(V=-1,P=X))}return B===P?P=X:P===-1&&(P=D.length),D.slice(B,P)}for($=D.length-1;$>=0;--$)if(D.charCodeAt($)===47){if(!G){B=$+1;break}}else P===-1&&(G=!1,P=$+1);return P===-1?"":D.slice(B,P)},"basename"),extname:E(function(D){A(D);for(var I=-1,$=0,B=-1,P=!0,G=0,V=D.length-1;V>=0;--V){var X=D.charCodeAt(V);if(X!==47)B===-1&&(P=!1,B=V+1),X===46?I===-1?I=V:G!==1&&(G=1):I!==-1&&(G=-1);else if(!P){$=V+1;break}}return I===-1||B===-1||G===0||G===1&&I===B-1&&I===$+1?"":D.slice(I,B)},"extname"),format:E(function(D){if(D===null||typeof D!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof D);return(function(I,$){var B=$.dir||$.root,P=$.base||($.name||"")+($.ext||"");return B?B===$.root?B+P:B+"/"+P:P})(0,D)},"format"),parse:E(function(D){A(D);var I={root:"",dir:"",base:"",ext:"",name:""};if(D.length===0)return I;var $,B=D.charCodeAt(0),P=B===47;P?(I.root="/",$=1):$=0;for(var G=-1,V=0,X=-1,W=!0,ie=D.length-1,K=0;ie>=$;--ie)if((B=D.charCodeAt(ie))!==47)X===-1&&(W=!1,X=ie+1),B===46?G===-1?G=ie:K!==1&&(K=1):G!==-1&&(K=-1);else if(!W){V=ie+1;break}return G===-1||X===-1||K===0||K===1&&G===X-1&&G===V+1?X!==-1&&(I.base=I.name=V===0&&P?D.slice(1,X):D.slice(V,X)):(V===0&&P?(I.name=D.slice(1,G),I.base=D.slice(1,X)):(I.name=D.slice(V,G),I.base=D.slice(V,X)),I.ext=D.slice(G,X)),V>0?I.dir=D.slice(0,V-1):P&&(I.dir="/"),I},"parse"),sep:"/",delimiter:":",win32:null,posix:null};N.posix=N,F.exports=N}},e={};function r(F){var A=e[F];if(A!==void 0)return A.exports;var R=e[F]={exports:{}};return t[F](R,R.exports,r),R.exports}E(r,"r"),r.d=(F,A)=>{for(var R in A)r.o(A,R)&&!r.o(F,R)&&Object.defineProperty(F,R,{enumerable:!0,get:A[R]})},r.o=(F,A)=>Object.prototype.hasOwnProperty.call(F,A),r.r=F=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(F,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:E(()=>f,"URI"),Utils:E(()=>O,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l(F,A){if(!F.scheme&&A)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${F.authority}", path: "${F.path}", query: "${F.query}", fragment: "${F.fragment}"}`);if(F.scheme&&!a.test(F.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(F.path){if(F.authority){if(!s.test(F.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(F.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}E(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,M=class M{constructor(A,R,N,D,I,$=!1){Hr(this,"scheme");Hr(this,"authority");Hr(this,"path");Hr(this,"query");Hr(this,"fragment");typeof A=="object"?(this.scheme=A.scheme||u,this.authority=A.authority||u,this.path=A.path||u,this.query=A.query||u,this.fragment=A.fragment||u):(this.scheme=(function(B,P){return B||P?B:"file"})(A,$),this.authority=R||u,this.path=(function(B,P){switch(B){case"https":case"http":case"file":P?P[0]!==h&&(P=h+P):P=h}return P})(this.scheme,N||u),this.query=D||u,this.fragment=I||u,l(this,$))}static isUri(A){return A instanceof M||!!A&&typeof A.authority=="string"&&typeof A.fragment=="string"&&typeof A.path=="string"&&typeof A.query=="string"&&typeof A.scheme=="string"&&typeof A.fsPath=="string"&&typeof A.with=="function"&&typeof A.toString=="function"}get fsPath(){return x(this,!1)}with(A){if(!A)return this;let{scheme:R,authority:N,path:D,query:I,fragment:$}=A;return R===void 0?R=this.scheme:R===null&&(R=u),N===void 0?N=this.authority:N===null&&(N=u),D===void 0?D=this.path:D===null&&(D=u),I===void 0?I=this.query:I===null&&(I=u),$===void 0?$=this.fragment:$===null&&($=u),R===this.scheme&&N===this.authority&&D===this.path&&I===this.query&&$===this.fragment?this:new g(R,N,D,I,$)}static parse(A,R=!1){const N=d.exec(A);return N?new g(N[2]||u,S(N[4]||u),S(N[5]||u),S(N[7]||u),S(N[9]||u),R):new g(u,u,u,u,u)}static file(A){let R=u;if(i&&(A=A.replace(/\\/g,h)),A[0]===h&&A[1]===h){const N=A.indexOf(h,2);N===-1?(R=A.substring(2),A=h):(R=A.substring(2,N),A=A.substring(N)||h)}return new g("file",R,A,u,u)}static from(A){const R=new g(A.scheme,A.authority,A.path,A.query,A.fragment);return l(R,!0),R}toString(A=!1){return b(this,A)}toJSON(){return this}static revive(A){if(A){if(A instanceof M)return A;{const R=new g(A);return R._formatted=A.external,R._fsPath=A._sep===p?A.fsPath:null,R}}return A}};E(M,"l");let f=M;const p=i?1:void 0,z=class z extends f{constructor(){super(...arguments);Hr(this,"_formatted",null);Hr(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=x(this,!1)),this._fsPath}toString(R=!1){return R?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){const R={$mid:1};return this._fsPath&&(R.fsPath=this._fsPath,R._sep=p),this._formatted&&(R.external=this._formatted),this.path&&(R.path=this.path),this.scheme&&(R.scheme=this.scheme),this.authority&&(R.authority=this.authority),this.query&&(R.query=this.query),this.fragment&&(R.fragment=this.fragment),R}};E(z,"d");let g=z;const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function y(F,A,R){let N,D=-1;for(let I=0;I=97&&$<=122||$>=65&&$<=90||$>=48&&$<=57||$===45||$===46||$===95||$===126||A&&$===47||R&&$===91||R&&$===93||R&&$===58)D!==-1&&(N+=encodeURIComponent(F.substring(D,I)),D=-1),N!==void 0&&(N+=F.charAt(I));else{N===void 0&&(N=F.substr(0,I));const B=m[$];B!==void 0?(D!==-1&&(N+=encodeURIComponent(F.substring(D,I)),D=-1),N+=B):D===-1&&(D=I)}}return D!==-1&&(N+=encodeURIComponent(F.substring(D))),N!==void 0?N:F}E(y,"m");function v(F){let A;for(let R=0;R1&&F.scheme==="file"?`//${F.authority}${F.path}`:F.path.charCodeAt(0)===47&&(F.path.charCodeAt(1)>=65&&F.path.charCodeAt(1)<=90||F.path.charCodeAt(1)>=97&&F.path.charCodeAt(1)<=122)&&F.path.charCodeAt(2)===58?A?F.path.substr(1):F.path[1].toLowerCase()+F.path.substr(2):F.path,i&&(R=R.replace(/\//g,"\\")),R}E(x,"v");function b(F,A){const R=A?v:y;let N="",{scheme:D,authority:I,path:$,query:B,fragment:P}=F;if(D&&(N+=D,N+=":"),(I||D==="file")&&(N+=h,N+=h),I){let G=I.indexOf("@");if(G!==-1){const V=I.substr(0,G);I=I.substr(G+1),G=V.lastIndexOf(":"),G===-1?N+=R(V,!1,!1):(N+=R(V.substr(0,G),!1,!1),N+=":",N+=R(V.substr(G+1),!1,!0)),N+="@"}I=I.toLowerCase(),G=I.lastIndexOf(":"),G===-1?N+=R(I,!1,!0):(N+=R(I.substr(0,G),!1,!0),N+=I.substr(G))}if($){if($.length>=3&&$.charCodeAt(0)===47&&$.charCodeAt(2)===58){const G=$.charCodeAt(1);G>=65&&G<=90&&($=`/${String.fromCharCode(G+32)}:${$.substr(3)}`)}else if($.length>=2&&$.charCodeAt(1)===58){const G=$.charCodeAt(0);G>=65&&G<=90&&($=`${String.fromCharCode(G+32)}:${$.substr(2)}`)}N+=R($,!0,!1)}return B&&(N+="?",N+=R(B,!1,!1)),P&&(N+="#",N+=A?P:y(P,!1,!1)),N}E(b,"b");function w(F){try{return decodeURIComponent(F)}catch{return F.length>3?F.substr(0,3)+w(F.substr(3)):F}}E(w,"C");const k=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function S(F){return F.match(k)?F.replace(k,(A=>w(A))):F}E(S,"w");var C=r(975);const _=C.posix||C,L="/";var O;(function(F){F.joinPath=function(A,...R){return A.with({path:_.join(A.path,...R)})},F.resolvePath=function(A,...R){let N=A.path,D=!1;N[0]!==L&&(N=L+N,D=!0);let I=_.resolve(N,...R);return D&&I[0]===L&&!A.authority&&(I=I.substring(1)),A.with({path:I})},F.dirname=function(A){if(A.path.length===0||A.path===L)return A;let R=_.dirname(A.path);return R.length===1&&R.charCodeAt(0)===46&&(R=""),A.with({path:R})},F.basename=function(A){return _.basename(A.path)},F.extname=function(A){return _.extname(A.path)}})(O||(O={})),yfe=n})();var{URI:eo,Utils:LT}=yfe,ls;(function(t){t.basename=LT.basename,t.dirname=LT.dirname,t.extname=LT.extname,t.joinPath=LT.joinPath,t.resolvePath=LT.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(s,o){return(s==null?void 0:s.toString())===(o==null?void 0:o.toString())}E(r,"equals"),t.equals=r;function n(s,o){const l=typeof s=="string"?eo.parse(s).path:s.path,u=typeof o=="string"?eo.parse(o).path:o.path,h=l.split("/").filter(m=>m.length>0),d=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(h[0]&&m.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]&&m.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]!==d[0])return u.substring(1)}let f=0;for(;f({name:i.name,uri:ls.joinPath(eo.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(ls.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const a of n){let s=i.children.get(a);if(!s)if(r)s={name:a,children:new Map,parent:i},i.children.set(a,s);else return;i=s}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}},E(iy,"UriTrie"),iy),zr;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(zr||(zr={}));var vfe=(ay=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=_n.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??eo.parse(e.uri),_n.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return _n.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:zr.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:zr.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var s,o;const n=(s=e.parseResult.value.$cstNode)==null?void 0:s.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),a=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:l})}return n!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=zr.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=ME.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},E(ay,"DefaultLangiumDocumentFactory"),ay),bfe=(sy=class{constructor(e){this.documentTrie=new ON,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return pn(this.documentTrie.all())}addDocument(e){const r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,zr.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=zr.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=zr.Changed;return this.documentTrie.delete(r),n}},E(sy,"DefaultLangiumDocuments"),sy),Pf=Symbol("RefResolving"),xfe=(oy=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=_n.CancellationToken.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const a of Vo(e.parseResult.value))await ra(r),sg(a).forEach(s=>{const o=`${a.$type}:${s.property}`;i.startSubTask(o);try{this.doLink(s,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of Vo(e.parseResult.value))await ra(r),sg(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=Pf;try{const i=this.getCandidate(e);if(Xd(i))n._ref=i;else{n._nodeDescription=i;const a=this.loadAstNode(i);n._ref=a??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const a=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${a}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=Pf;try{const i=this.getCandidates(e),a=[];if(Xd(i))n._linkingError=i;else for(const s of i){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}n._items=a}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(const r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(Ii(this._ref))return this._ref;if($9(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=Pf;const o=ag(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if(Xd(r))return{error:r};const n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=ag(e.container).$document;n&&n.stateQd(r)&&r.isMulti)}findDeclarations(e){if(e){const r=RD(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(es(i)||ql(i))return O3(i);if(Array.isArray(i)){for(const a of i)if((es(a)||ql(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return O3(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||sD(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of sg(n))if(ql(i.reference)&&i.reference.items.some(a=>a.ref===e))return i.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i)??i.$cstNode;a&&n.push(a)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>ls.equals(a.sourceUri,r.documentUri))),n.push(...i),pn(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=qo(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:mg(a),local:!0})}}return n}},E(cy,"DefaultReferences"),cy),su=(uy=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return Rx.sum(pn(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const r=this.map.get(e);return r?pn(r):rg}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return pn(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return pn(this.map.keys())}values(){return pn(this.map.values()).flat()}entriesGroupedByKey(){return pn(this.map.entries())}},E(uy,"MultiMap"),uy),OE=(hy=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}},E(hy,"BiMap"),hy),Cfe=(dy=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=_n.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=Lx,i=_n.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await ra(i),this.addExportedSymbol(s,a,r);return a}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=_n.CancellationToken.None){const n=e.parseResult.value,i=new su;for(const a of Uc(n))await ra(r),this.addLocalSymbol(a,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}},E(dy,"DefaultScopeComputation"),dy),PN=(fy=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},E(fy,"StreamScope"),fy),_nt=(py=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?pn(i).concat(this.outerScope.getElements(e)):pn(i)}getAllElements(){let e=pn(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},E(py,"MapScope"),py),kfe=(gy=class{constructor(e,r,n){this.elements=new su,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?pn(n).concat(this.outerScope.getElements(e)):pn(n)}getAllElements(){let e=pn(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},E(gy,"MultiMapScope"),gy),Rnt={getElement(){},getElements(){return rg},getAllElements(){return rg}},$E=(my=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},E(my,"DisposableCache"),my),BN=(yy=class extends $E{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},E(yy,"SimpleCache"),yy),PE=(vy=class extends $E{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},E(vy,"ContextCache"),vy),Efe=(by=class extends PE{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(const a of i)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{const a=n.concat(i);for(const s of a)this.clear(s)}))}},E(by,"DocumentCache"),by),FN=(xy=class extends BN{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},E(xy,"WorkspaceCache"),xy),Sfe=(Ty=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new FN(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=qo(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(o=>this.reflection.isSubtype(o.type,n))),s=s.$container;while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new PN(pn(e),r,n)}createScopeForNodes(e,r,n){const i=pn(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new PN(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new kfe(this.indexManager.allElements(e)))}},E(Ty,"DefaultScopeProvider"),Ty);function zN(t){return typeof t.$comment=="string"}E(zN,"isAstNodeWithComment");function GN(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}E(GN,"isIntermediateReference");var Afe=(wy=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,a=E((o,l)=>this.replacer(o,l,n),"defaultReplacer"),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=qo(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,u,h;if(!this.ignoreProperties.has(e))if(es(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=qo(d);let g="";this.currentDocument&&this.currentDocument!==p&&(o?g=o(p.uri,d):g=p.uri.toString());const m=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${m}`,$refText:f}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:f}}else if(ql(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=qo(p.ref);let y="";this.currentDocument&&this.currentDocument!==m&&(o?y=o(m.uri,g):y=m.uri.toString());const v=this.astNodeLocator.getAstNodePath(g);f.push(`${y}#${v}`)}return{$refs:f,$refText:d}}else if(Ii(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(h=r.$cstNode)==null?void 0:h.text),s){d??(d={...r});const f=this.commentProvider.getComment(r);f&&(d.$comment=f.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=E(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=AD(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if($f(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=pn(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},E(ky,"ValidationRegistry"),ky),Lfe=Object.freeze({validateNode:!0,validateChildren:!0}),Ife=(Ey=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=_n.CancellationToken.None){const i=e.parseResult,a=[];if(await ra(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===wo.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===wo.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===wo.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if($f(s))throw s;console.error("An error occurred during validation:",s)}return await ra(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const s of i){const o=s.severity??"error",l={severity:IT(o),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:VN(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=zx(i.token);if(a){const s={severity:IT("error"),range:a,message:i.message,data:Bf(wo.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const s=a.error;if(s){const o={node:s.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:s.info.property,index:s.info.index,data:{code:wo.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};r.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,r,n=_n.CancellationToken.None){const i=[],a=E((s,o,l)=>{i.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=_n.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await ra(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=_n.CancellationToken.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const o=Vo(e).iterator();for(const l of o){s.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const h=this.validationRegistry.getChecks(l.$type,r.categories);for(const d of h)await d(l,n,i)}finally{s.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{s.stop()}}else{const s=Vo(e).iterator();for(const o of s){await ra(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const h of u)await h(o,n,i)}l.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return Lfe}async validateAstAfter(e,r,n,i=_n.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await ra(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:qN(n),severity:IT(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},E(Ey,"DefaultDocumentValidator"),Ey);function qN(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=fk(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=_D(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}E(qN,"getDiagnosticRange");function IT(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}E(IT,"toDiagnosticSeverity");function VN(t){switch(t){case"error":return Bf(wo.LexingError);case"warning":return Bf(wo.LexingWarning);case"info":return Bf(wo.LexingInfo);case"hint":return Bf(wo.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}E(VN,"toDiagnosticData");var wo;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(wo||(wo={}));var Dfe=(Sy=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??qo(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=E(()=>s??(s=mg(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:mg(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},E(Sy,"DefaultAstNodeDescriptionProvider"),Sy),Mfe=(Ay=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=_n.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of Vo(i))await ra(r),sg(a).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];es(r)&&r.$nodeDescription?n=[r.$nodeDescription]:ql(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=qo(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=mg(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:ls.equals(l.documentUri,i)});return s}},E(Ay,"DefaultReferenceDescriptionProvider"),Ay),Nfe=(_y=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),u=i[o];return u==null?void 0:u[l]}return i[a]},e)}},E(_y,"DefaultAstNodeLocator"),_y),FE={};k3(FE,LI(eg()));var Ofe=(Ry=class{constructor(e){this._ready=new au,this.onConfigurationSectionUpdateEmitter=new FE.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},E(Ry,"DefaultConfigurationProvider"),Ry),zE=LI(oHe()),Ff;(function(t){function e(r){return{dispose:E(async()=>await r(),"dispose")}}E(e,"create"),t.create=e})(Ff||(Ff={}));var $fe=(Ly=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new su,this.documentPhaseListeners=new su,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=zr.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=_n.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===zr.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,zr.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(a,r);o.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(s))==null?void 0:i.result}),a.state=zr.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=zr.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=_n.CancellationToken.None){this.currentState=zr.Changed;const i=[];for(const l of r){const u=this.langiumDocuments.deleteDocuments(l);for(const h of u)i.push(h.uri),this.cleanUpDeleted(h)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=zr.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,zr.Changed)}const s=pn(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,zr.ComputedScopes)),await this.emitUpdate(a,i),await ra(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state=1}findMissingValidationCategories(e,r){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return pn(s).filter(u=>!a.has(u)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r=0&&!this.hasTextDocument(e[n]);)n--;rn.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),Ff.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case zr.Changed:case zr.Parsed:this.indexManager.removeContent(e.uri);case zr.IndexedContent:e.localSymbols=void 0;case zr.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case zr.Linked:this.indexManager.removeReferences(e.uri);case zr.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case zr.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=zr.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,zr.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,zr.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,zr.ComputedScopes,n,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,n)});const i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,zr.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,zr.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,zr.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){for(const s of e)s.states.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),Ff.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),Ff.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=_n.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(Jl);if(this.currentState>=e&&e>i.state)return Promise.reject(new zE.ResponseError(zE.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${zr[i.state]}, requiring ${zr[e]}, but workspace state is already ${zr[this.currentState]}. Returning undefined.`))}else return Promise.reject(new zE.ResponseError(zE.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{ls.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(Jl)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(Jl):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(Jl)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await ra(n),await s(e,n)}catch(o){if(!$f(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await ra(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),a=typeof i.validation=="object"?{...i.validation}:{};a.categories=this.findMissingValidationCategories(e,i);const s=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=pn(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},E(Ly,"DefaultDocumentBuilder"),Ly),Pfe=(Iy=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new PE,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=qo(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{ls.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),pn(i)}allElements(e,r){let n=pn(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=_n.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=_n.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}},E(Iy,"DefaultIndexManager"),Iy),Bfe=(Dy=class{constructor(e){this.initialBuildOptions={},this._ready=new au,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=_n.CancellationToken.None){const n=await this.performStartup(e);await ra(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=E(s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));const a=pn(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return eo.parse(e.uri)}async traverseFolder(e,r){try{const n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=ls.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},E(Dy,"DefaultWorkspaceManager"),Dy),Ffe=(My=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return wM.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return wM.buildUnableToPopLexerModeMessage(e)}},E(My,"DefaultLexerErrorMessageProvider"),My),WN={mode:"full"},UN=(Ny=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=VE(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new as(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=WN){var i,a;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(a=(i=this.tokenBuilder).flushLexingReport)==null?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(VE(e))return e;const r=qE(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},E(Ny,"DefaultLexer"),Ny);function GE(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}E(GE,"isTokenTypeArray");function qE(t){return t&&"modes"in t&&"defaultMode"in t}E(qE,"isIMultiModeLexerDefinition");function VE(t){return!GE(t)&&!qE(t)}E(VE,"isTokenTypeDictionary"),Sx();function HN(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=sn.create(0,0));const a=XN(t),s=UE(n),o=Gfe({lines:a,position:i,options:s});return Wfe({index:0,tokens:o,position:i})}E(HN,"parseJSDoc");function YN(t,e){const r=UE(e),n=XN(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}E(YN,"isJSDoc");function XN(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(kre)}E(XN,"getLines");var zfe=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,Lnt=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Gfe(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o=h.length){if(e.length>0){const p=sn.create(r,n);e.push({type:"break",content:"",range:Ur.create(p,p)})}}else{zfe.lastIndex=d;const p=zfe.exec(h);if(p){const g=p[0],m=p[1],y=sn.create(r,n+d),v=sn.create(r,n+d+g.length);e.push({type:"tag",content:m,range:Ur.create(y,v)}),d+=g.length,d=WE(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}E(Gfe,"tokenize");function qfe(t,e,r,n){const i=[];if(t.length===0){const a=sn.create(r,n),s=sn.create(r,n+e.length);i.push({type:"text",content:e,range:Ur.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:Ur.create(sn.create(r,a+n),sn.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:Ur.create(sn.create(r,a+h+n),sn.create(r,a+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:Ur.create(sn.create(r,a+h+n),sn.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:Ur.create(sn.create(r,a+h+n),sn.create(r,a+h+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:Ur.create(sn.create(r,a+n),sn.create(r,a+n+s.length))})}return i}E(qfe,"buildInlineTokens");var Int=/\S/,Dnt=/\s*$/;function WE(t,e){const r=t.substring(e).match(Int);return r?e+r.index:t.length}E(WE,"skipWhitespace");function Vfe(t){const e=t.match(Dnt);if(e&&typeof e.index=="number")return e.index}E(Vfe,"lastCharacter");function Wfe(t){var a,s;const e=sn.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Xfe([],Ur.create(e,e));const r=[];for(;t.indexr.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=eO(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=eO(r)+i}return r.trim()}},E(Oy,"JSDocCommentImpl"),Oy),QN=($y=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e} +${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r;return((r=e==null?void 0:e.renderTag)==null?void 0:r.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=Kfe(this.name,r,e??{});if(typeof a=="string")return a}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i} +${r}`),this.inline?`{${i}}`:i}},E($y,"JSDocTagImpl"),$y);function Kfe(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=WE(e,i);a=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),((n=r.renderLink)==null?void 0:n.call(r,e,a))??jfe(e,a)}}E(Kfe,"renderInlineTag");function jfe(t,e){try{return eo.parse(t,!0),`[${e}](${t})`}catch{return t}}E(jfe,"renderLinkDefault");var JN=(Py=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;rn.range.start.line&&(e+=` `)}return e}toMarkdown(e){let r="";for(let n=0;ni.range.start.line&&(r+=` -`)}return r}},E($y,"JSDocTextImpl"),$y),Ufe=(Py=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},E(Py,"JSDocLineImpl"),Py);function KN(t){return t.endsWith(` +`)}return r}},E(Py,"JSDocTextImpl"),Py),Zfe=(By=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},E(By,"JSDocLineImpl"),By);function eO(t){return t.endsWith(` `)?` `:` -`}E(KN,"fillNewlines");var Hfe=(By=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&qN(r))return GN(r).toMarkdown({renderLink:E((i,a)=>this.documentationLinkRenderer(e,i,a),"renderLink"),renderTag:E(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const a=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${a},${s}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=qo(e).localSymbols;if(!i)return;let a=e;do{const o=i.getStream(a).find(l=>l.name===r);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},E(By,"JSDocDocumentationProvider"),By),Yfe=(Fy=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return ON(e)?e.$comment:(r=aD(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},E(Fy,"DefaultCommentProvider"),Fy),Xfe=(zy=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},E(zy,"DefaultAsyncParser"),zy),xnt=(Gy=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){const n=await this.acquireParserWorker(r),i=new au;let a;const s=r.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(o=>{const l=this.hydrator.hydrate(o);i.resolve(l)}).catch(o=>{i.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),i.promise}terminateWorker(e){e.terminate();const r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool)if(n.ready)return n.lock(),n;const r=new au;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(Jl)}),this.queue.push(r),r.promise}},E(Gy,"AbstractThreadedAsyncParser"),Gy),Tnt=(qy=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new $E.Emitter,this.deferred=new au,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),n(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(Jl),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new au,this.sendMessage(e),this.deferred.promise}},E(qy,"ParserWorker"),qy),Kfe=(Vy=class{constructor(){this.previousTokenSource=new _n.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=RE();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=_n.CancellationToken.None){const i=new au,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){$f(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},E(Vy,"DefaultWorkspaceLock"),Vy),jfe=(Wy=class{constructor(e){this.grammarElementIdMap=new DE,this.tokenTypeIdMap=new DE,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of Vo(e))r.set(i,{});if(e.$cstNode)for(const i of pg(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Ii(o)?s.push(this.dehydrateAstNode(o,r)):es(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Ii(a)?n[i]=this.dehydrateAstNode(a,r):es(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return I3(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Wc(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):Kd(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const a of Vo(e))r.set(a,{});let i;if(e.$cstNode)for(const a of pg(e.$cstNode)){let s;"fullText"in a?(s=new yN(a.fullText),i=s):"content"in a?s=new xE:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Ii(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):es(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Ii(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):es(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),Wc(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new bE(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of Vo(this.grammar))O3(r)&&this.grammarElementIdMap.set(r,e++)}},E(Wy,"DefaultHydrator"),Wy);function na(t){return{documentation:{CommentProvider:E(e=>new Yfe(e),"CommentProvider"),DocumentationProvider:E(e=>new Hfe(e),"DocumentationProvider")},parser:{AsyncParser:E(e=>new Xfe(e),"AsyncParser"),GrammarConfig:E(e=>ID(e),"GrammarConfig"),LangiumParser:E(e=>CN(e),"LangiumParser"),CompletionParser:E(e=>wN(e),"CompletionParser"),ValueConverter:E(()=>new EN,"ValueConverter"),TokenBuilder:E(()=>new SE,"TokenBuilder"),Lexer:E(e=>new zN(e),"Lexer"),ParserErrorMessageProvider:E(()=>new bN,"ParserErrorMessageProvider"),LexerErrorMessageProvider:E(()=>new Mfe,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:E(()=>new _fe,"AstNodeLocator"),AstNodeDescriptionProvider:E(e=>new Sfe(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:E(e=>new Afe(e),"ReferenceDescriptionProvider")},references:{Linker:E(e=>new pfe(e),"Linker"),NameProvider:E(()=>new gfe,"NameProvider"),ScopeProvider:E(e=>new xfe(e),"ScopeProvider"),ScopeComputation:E(e=>new yfe(e),"ScopeComputation"),References:E(e=>new mfe(e),"References")},serializer:{Hydrator:E(e=>new jfe(e),"Hydrator"),JsonSerializer:E(e=>new Tfe(e),"JsonSerializer")},validation:{DocumentValidator:E(e=>new Efe(e),"DocumentValidator"),ValidationRegistry:E(e=>new Cfe(e),"ValidationRegistry")},shared:E(()=>t.shared,"shared")}}E(na,"createDefaultCoreModule");function ia(t){return{ServiceRegistry:E(e=>new wfe(e),"ServiceRegistry"),workspace:{LangiumDocuments:E(e=>new ffe(e),"LangiumDocuments"),LangiumDocumentFactory:E(e=>new dfe(e),"LangiumDocumentFactory"),DocumentBuilder:E(e=>new Lfe(e),"DocumentBuilder"),IndexManager:E(e=>new Ife(e),"IndexManager"),WorkspaceManager:E(e=>new Dfe(e),"WorkspaceManager"),FileSystemProvider:E(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:E(()=>new Kfe,"WorkspaceLock"),ConfigurationProvider:E(e=>new Rfe(e),"ConfigurationProvider")},profilers:{}}}E(ia,"createDefaultSharedCoreModule");var jN;(function(t){t.merge=(e,r)=>Mg(Mg({},e),r)})(jN||(jN={}));function Xr(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(Mg,{});return QN(u)}E(Xr,"inject");var Zfe=Symbol("isProxy");function ZN(t){if(t&&t[Zfe])for(const e of Object.values(t))ZN(e);return t}E(ZN,"eagerLoad");function QN(t,e){const r=new Proxy({},{deleteProperty:E(()=>!1,"deleteProperty"),set:E(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:E((n,i)=>i===Zfe?!0:JN(n,i,t,e||r),"get"),getOwnPropertyDescriptor:E((n,i)=>(JN(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:E((n,i)=>i in t,"has"),ownKeys:E(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}E(QN,"_inject");var Qfe=Symbol();function JN(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===Qfe)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=Qfe;try{t[e]=typeof i=="function"?i(n):QN(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}E(JN,"_resolve");function Mg(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=Mg(i,n):t[r]=Mg({},n)}else t[r]=n}return t}E(Mg,"_merge");var eO={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},zf;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(zf||(zf={}));var Jfe=(Uy=class extends SE{constructor(e=eO){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...eO,...e},this.indentTokenType=Sg({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=Sg({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!BE(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,u,h;const d=[];for(const f of n){for(const[p,g]of o)f.name===p?f.PUSH_MODE=zf.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===a?l=f:f.name===i?u=f:f.name===s?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[zf.REGULAR]:[l,u,...d,h],[zf.IGNORE_INDENTATION]:[...d,h]},defaultMode:zf.REGULAR}:[l,u,h,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r -`.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:(a==null?void 0:a[0].length)??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,r,n,i){const a=this.getLineNumber(r,i);return pT(e,n,i,i+n.length,a,a,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:((d=o==null?void 0:o[0])==null?void 0:d.length)??0,line:this.getLineNumber(e,r),column:1}),null;const u=this.indentationStack.length-l-1,h=((f=e.substring(0,r).match(/[\r\n]+$/))==null?void 0:f[0].length)??1;for(let p=0;p1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},E(Uy,"IndentationAwareTokenBuilder"),Uy),wnt=(Hy=class extends zN{constructor(e){if(super(e),e.parser.TokenBuilder instanceof Jfe)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=FN){const n=super.tokenize(e),i=n.report;(r==null?void 0:r.mode)==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d=0&&u.push(n.tokens[h]),n.tokens=u,n}},E(Hy,"IndentationAwareLexer"),Hy),tO={};fh(tO,{AstUtils:()=>M9,BiMap:()=>DE,Cancellation:()=>_n,ContextCache:()=>NE,CstUtils:()=>L9,DONE_RESULT:()=>ts,Deferred:()=>au,Disposable:()=>Ff,DisposableCache:()=>ME,DocumentCache:()=>bfe,EMPTY_STREAM:()=>tg,ErrorWithLocation:()=>rk,GrammarUtils:()=>uD,MultiMap:()=>su,OperationCancelled:()=>Jl,Reduction:()=>Ax,RegExpUtils:()=>dD,SimpleCache:()=>MN,StreamImpl:()=>Vl,TreeStreamImpl:()=>rg,URI:()=>eo,UriTrie:()=>LN,UriUtils:()=>ls,WorkspaceCache:()=>NN,assertCondition:()=>hD,assertUnreachable:()=>xh,delayNextTick:()=>AE,interruptAndCheck:()=>ra,isOperationCancelled:()=>$f,loadGrammarFromJson:()=>aa,setInterruptionPeriod:()=>SN,startCancelableOperation:()=>RE,stream:()=>pn}),T3(tO,$E);var e0e=(Yy=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},E(Yy,"EmptyFileSystemProvider"),Yy),ba={fileSystemProvider:E(()=>new e0e,"fileSystemProvider")},Cnt={Grammar:E(()=>{},"Grammar"),LanguageMetaData:E(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},knt={AstReflection:E(()=>new eD,"AstReflection")};function t0e(){const t=Xr(ia(ba),knt),e=Xr(na({shared:t}),Cnt);return t.ServiceRegistry.register(e),e}E(t0e,"createMinimalGrammarServices");function aa(t){const e=t0e(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,eo.parse(`memory:/${r.name??"grammar"}.langium`)),r}E(aa,"loadGrammarFromJson"),T3(qte,tO);var Ent=(Xy=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new su}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new r0e(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);const n=[];for(const s of r.entries.keys()){const o=r.entries.get(s),l=o.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${s}`,count:o.length,duration:l})}const i=r.duration-n.map(s=>s.duration).reduce((s,o)=>s+o,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return E(a,"Round"),console.table(n.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/r.duration),"Time (ms)":a(s.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},E(Xy,"DefaultLangiumProfiler"),Xy),r0e=(Ky=class{constructor(e,r){this.stack=[],this.entries=new su,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);const n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);const i=n-r.content;this.entries.add(e,i)}},E(Ky,"ProfilingTask"),Ky),rO;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(rO||(rO={}));var nO;(t=>{t.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(nO||(nO={}));var iO;(t=>{t.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(iO||(iO={}));var aO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(aO||(aO={}));var sO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(sO||(sO={}));var oO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(oO||(oO={}));var lO;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(lO||(lO={}));var cO;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(cO||(cO={}));var uO;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(uO||(uO={}));var hO;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(hO||(hO={}));var dO;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(dO||(dO={}));var fO;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(fO||(fO={}));var pO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(pO||(pO={}));var gO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(gO||(gO={}));var mO;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(mO||(mO={})),{...rO.Terminals,...nO.Terminals,...iO.Terminals,...aO.Terminals,...sO.Terminals,...oO.Terminals,...lO.Terminals,...cO.Terminals,...uO.Terminals,...hO.Terminals,...dO.Terminals,...fO.Terminals,...gO.Terminals,...pO.Terminals,...mO.Terminals};var n0e={$type:"AbnfAlternation",alternatives:"alternatives"},i0e={$type:"AbnfConcatenation",elements:"elements"},yO={$type:"AbnfElement",primary:"primary",repeat:"repeat"},a0e={$type:"AbnfGroup",element:"element"},s0e={$type:"AbnfNumVal",value:"value"},o0e={$type:"AbnfOptionalGroup",element:"element"},Ng={$type:"AbnfPrimary"},vO={$type:"AbnfRule",definition:"definition",name:"name"},l0e={$type:"AbnfRuleName",name:"name"},c0e={$type:"AbnfStringLiteral",value:"value"},WE={$type:"Accelerator",name:"name",x:"x",y:"y"},bO={$type:"Alignment",direction:"direction",members:"members"},UE={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},LT={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},xO={$type:"Annotations",x:"x",y:"y"},ec={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function Snt(t){return gi.isInstance(t,ec.$type)}E(Snt,"isArchitecture");var HE={$type:"Axis",label:"label",name:"name"},YE={$type:"Branch",name:"name",order:"order"};function Ant(t){return gi.isInstance(t,YE.$type)}E(Ant,"isBranch");var u0e={$type:"Checkout",branch:"branch"},XE={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},TO={$type:"ClassDefStatement",className:"className",styleText:"styleText"},Og={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function _nt(t){return gi.isInstance(t,Og.$type)}E(_nt,"isCommit");var KE={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},Gf={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},jE={$type:"Curve",entries:"entries",label:"label",name:"name"},qf={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function Rnt(t){return gi.isInstance(t,qf.$type)}E(Rnt,"isCynefin");var ZE={$type:"Deaccelerator",name:"name",x:"x",y:"y"},h0e={$type:"Decorator",strategy:"strategy"},$g={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},QE={$type:"DomainBlock",domain:"domain",items:"items"};function Lnt(t){return gi.isInstance(t,QE.$type)}E(Lnt,"isDomainBlock");var wO={$type:"DomainItem",label:"label"};function Int(t){return gi.isInstance(t,wO.$type)}E(Int,"isDomainItem");var d0e={$type:"EbnfChoice",alternatives:"alternatives"},f0e={$type:"EbnfExceptionPostfix",except:"except"},p0e={$type:"EbnfGroup",element:"element"},g0e={$type:"EbnfNonTerminal",name:"name"},m0e={$type:"EbnfOneOrMorePostfix",operator:"operator"},y0e={$type:"EbnfOptional",element:"element"},v0e={$type:"EbnfOptionalPostfix",operator:"operator"},IT={$type:"EbnfPostfix"},Vf={$type:"EbnfPrimary"},b0e={$type:"EbnfRepetition",element:"element"},CO={$type:"EbnfRule",definition:"definition",name:"name"},x0e={$type:"EbnfSequence",elements:"elements"},T0e={$type:"EbnfSpecial",text:"text"},kO={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},w0e={$type:"EbnfTerminal",value:"value"},C0e={$type:"EbnfZeroOrMorePostfix",operator:"operator"},tc={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},Pg={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},Wf={$type:"EmFrame"},DT={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},k0e={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},EO={$type:"EmModelEntity",name:"name"};function Dnt(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}E(Dnt,"isEmModelEntityType");var JE={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},ou={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function E0e(t){return gi.isInstance(t,ou.$type)}E(E0e,"isEmResetFrame");var _h={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},SO={$type:"Entry",axis:"axis",value:"value"},lu={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},S0e={$type:"Evolution",stages:"stages"},eS={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},AO={$type:"Evolve",component:"component",target:"target"},Uf={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function Mnt(t){return gi.isInstance(t,Uf.$type)}E(Mnt,"isGitGraph");var MT={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},NT={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function Nnt(t){return gi.isInstance(t,NT.$type)}E(Nnt,"isInfo");var OT={$type:"Item",classSelector:"classSelector",name:"name"},_O={$type:"Junction",id:"id",in:"in"},$T={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},tS={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},Hf={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},Bg={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function Ont(t){return gi.isInstance(t,Bg.$type)}E(Ont,"isMerge");var rS={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},RO={$type:"Option",name:"name",value:"value"},Fg={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function $nt(t){return gi.isInstance(t,Fg.$type)}E($nt,"isPacket");var zg={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function Pnt(t){return gi.isInstance(t,zg.$type)}E(Pnt,"isPacketBlock");var A0e={$type:"PegAny",dot:"dot"},_0e={$type:"PegGroup",element:"element"},R0e={$type:"PegIdentifier",name:"name"},L0e={$type:"PegLiteral",value:"value"},I0e={$type:"PegOrderedChoice",alternatives:"alternatives"},LO={$type:"PegPrefix",operator:"operator",suffix:"suffix"},PT={$type:"PegPrimary"},IO={$type:"PegRule",definition:"definition",name:"name"},D0e={$type:"PegSequence",elements:"elements"},DO={$type:"PegSuffix",operator:"operator",primary:"primary"},Yf={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function Bnt(t){return gi.isInstance(t,Yf.$type)}E(Bnt,"isPie");var nS={$type:"PieSection",label:"label",value:"value"};function Fnt(t){return gi.isInstance(t,nS.$type)}E(Fnt,"isPieSection");var MO={$type:"Pipeline",components:"components",parent:"parent"},iS={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},Xf={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},Gg={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function znt(t){return gi.isInstance(t,Gg.$type)}E(znt,"isRailroad");var qg={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Gnt(t){return gi.isInstance(t,qg.$type)}E(Gnt,"isRailroadAbnf");var M0e={$type:"RailroadChoiceExpr",alternatives:"alternatives"},Vg={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function qnt(t){return gi.isInstance(t,Vg.$type)}E(qnt,"isRailroadEbnf");var cu={$type:"RailroadExpression"},N0e={$type:"RailroadNonTerminalExpr",name:"name"},O0e={$type:"RailroadOneOrMoreExpr",element:"element"},$0e={$type:"RailroadOptionalExpr",element:"element"},Wg={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Vnt(t){return gi.isInstance(t,Wg.$type)}E(Vnt,"isRailroadPeg");var NO={$type:"RailroadRule",definition:"definition",name:"name"},P0e={$type:"RailroadSequenceExpr",elements:"elements"},B0e={$type:"RailroadSpecialExpr",text:"text"},F0e={$type:"RailroadTerminalExpr",value:"value"},z0e={$type:"RailroadZeroOrMoreExpr",element:"element"},OO={$type:"Section",classSelector:"classSelector",name:"name"},Ug={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},$O={$type:"Size",height:"height",width:"width"},Hg={$type:"Statement"},BT={$type:"Transition",from:"from",label:"label",to:"to"};function Wnt(t){return gi.isInstance(t,BT.$type)}E(Wnt,"isTransition");var Yg={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function Unt(t){return gi.isInstance(t,Yg.$type)}E(Unt,"isTreemap");var PO={$type:"TreemapRow",indent:"indent",item:"item"},Xg={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},FT={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},xa={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function Hnt(t){return gi.isInstance(t,xa.$type)}E(Hnt,"isWardley");var G0e=(jy=class extends D9{constructor(){super(...arguments),this.types={AbnfAlternation:{name:n0e.$type,properties:{alternatives:{name:n0e.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:i0e.$type,properties:{elements:{name:i0e.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:yO.$type,properties:{primary:{name:yO.primary},repeat:{name:yO.repeat}},superTypes:[]},AbnfGroup:{name:a0e.$type,properties:{element:{name:a0e.element}},superTypes:[Ng.$type]},AbnfNumVal:{name:s0e.$type,properties:{value:{name:s0e.value}},superTypes:[Ng.$type]},AbnfOptionalGroup:{name:o0e.$type,properties:{element:{name:o0e.element}},superTypes:[Ng.$type]},AbnfPrimary:{name:Ng.$type,properties:{},superTypes:[]},AbnfRule:{name:vO.$type,properties:{definition:{name:vO.definition},name:{name:vO.name}},superTypes:[]},AbnfRuleName:{name:l0e.$type,properties:{name:{name:l0e.name}},superTypes:[Ng.$type]},AbnfStringLiteral:{name:c0e.$type,properties:{value:{name:c0e.value}},superTypes:[Ng.$type]},Accelerator:{name:WE.$type,properties:{name:{name:WE.name},x:{name:WE.x},y:{name:WE.y}},superTypes:[]},Alignment:{name:bO.$type,properties:{direction:{name:bO.direction},members:{name:bO.members,defaultValue:[]}},superTypes:[]},Anchor:{name:UE.$type,properties:{evolution:{name:UE.evolution},name:{name:UE.name},visibility:{name:UE.visibility}},superTypes:[]},Annotation:{name:LT.$type,properties:{number:{name:LT.number},text:{name:LT.text},x:{name:LT.x},y:{name:LT.y}},superTypes:[]},Annotations:{name:xO.$type,properties:{x:{name:xO.x},y:{name:xO.y}},superTypes:[]},Architecture:{name:ec.$type,properties:{accDescr:{name:ec.accDescr},accTitle:{name:ec.accTitle},alignments:{name:ec.alignments,defaultValue:[]},edges:{name:ec.edges,defaultValue:[]},groups:{name:ec.groups,defaultValue:[]},junctions:{name:ec.junctions,defaultValue:[]},services:{name:ec.services,defaultValue:[]},title:{name:ec.title}},superTypes:[]},Axis:{name:HE.$type,properties:{label:{name:HE.label},name:{name:HE.name}},superTypes:[]},Branch:{name:YE.$type,properties:{name:{name:YE.name},order:{name:YE.order}},superTypes:[Hg.$type]},Checkout:{name:u0e.$type,properties:{branch:{name:u0e.branch}},superTypes:[Hg.$type]},CherryPicking:{name:XE.$type,properties:{id:{name:XE.id},parent:{name:XE.parent},tags:{name:XE.tags,defaultValue:[]}},superTypes:[Hg.$type]},ClassDefStatement:{name:TO.$type,properties:{className:{name:TO.className},styleText:{name:TO.styleText}},superTypes:[]},Commit:{name:Og.$type,properties:{id:{name:Og.id},message:{name:Og.message},tags:{name:Og.tags,defaultValue:[]},type:{name:Og.type}},superTypes:[Hg.$type]},Common:{name:KE.$type,properties:{accDescr:{name:KE.accDescr},accTitle:{name:KE.accTitle},title:{name:KE.title}},superTypes:[]},Component:{name:Gf.$type,properties:{decorator:{name:Gf.decorator},evolution:{name:Gf.evolution},inertia:{name:Gf.inertia,defaultValue:!1},label:{name:Gf.label},name:{name:Gf.name},visibility:{name:Gf.visibility}},superTypes:[]},Curve:{name:jE.$type,properties:{entries:{name:jE.entries,defaultValue:[]},label:{name:jE.label},name:{name:jE.name}},superTypes:[]},Cynefin:{name:qf.$type,properties:{accDescr:{name:qf.accDescr},accTitle:{name:qf.accTitle},domains:{name:qf.domains,defaultValue:[]},title:{name:qf.title},transitions:{name:qf.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:ZE.$type,properties:{name:{name:ZE.name},x:{name:ZE.x},y:{name:ZE.y}},superTypes:[]},Decorator:{name:h0e.$type,properties:{strategy:{name:h0e.strategy}},superTypes:[]},Direction:{name:$g.$type,properties:{accDescr:{name:$g.accDescr},accTitle:{name:$g.accTitle},dir:{name:$g.dir},statements:{name:$g.statements,defaultValue:[]},title:{name:$g.title}},superTypes:[Uf.$type]},DomainBlock:{name:QE.$type,properties:{domain:{name:QE.domain},items:{name:QE.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:wO.$type,properties:{label:{name:wO.label}},superTypes:[]},EbnfChoice:{name:d0e.$type,properties:{alternatives:{name:d0e.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:f0e.$type,properties:{except:{name:f0e.except}},superTypes:[IT.$type]},EbnfGroup:{name:p0e.$type,properties:{element:{name:p0e.element}},superTypes:[Vf.$type]},EbnfNonTerminal:{name:g0e.$type,properties:{name:{name:g0e.name}},superTypes:[Vf.$type]},EbnfOneOrMorePostfix:{name:m0e.$type,properties:{operator:{name:m0e.operator}},superTypes:[IT.$type]},EbnfOptional:{name:y0e.$type,properties:{element:{name:y0e.element}},superTypes:[Vf.$type]},EbnfOptionalPostfix:{name:v0e.$type,properties:{operator:{name:v0e.operator}},superTypes:[IT.$type]},EbnfPostfix:{name:IT.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Vf.$type,properties:{},superTypes:[]},EbnfRepetition:{name:b0e.$type,properties:{element:{name:b0e.element}},superTypes:[Vf.$type]},EbnfRule:{name:CO.$type,properties:{definition:{name:CO.definition},name:{name:CO.name}},superTypes:[]},EbnfSequence:{name:x0e.$type,properties:{elements:{name:x0e.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:T0e.$type,properties:{text:{name:T0e.text}},superTypes:[Vf.$type]},EbnfTerm:{name:kO.$type,properties:{base:{name:kO.base},postfixes:{name:kO.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:w0e.$type,properties:{value:{name:w0e.value}},superTypes:[Vf.$type]},EbnfZeroOrMorePostfix:{name:C0e.$type,properties:{operator:{name:C0e.operator}},superTypes:[IT.$type]},Edge:{name:tc.$type,properties:{lhsDir:{name:tc.lhsDir},lhsGroup:{name:tc.lhsGroup,defaultValue:!1},lhsId:{name:tc.lhsId},lhsInto:{name:tc.lhsInto,defaultValue:!1},rhsDir:{name:tc.rhsDir},rhsGroup:{name:tc.rhsGroup,defaultValue:!1},rhsId:{name:tc.rhsId},rhsInto:{name:tc.rhsInto,defaultValue:!1},title:{name:tc.title}},superTypes:[]},EmDataEntity:{name:Pg.$type,properties:{dataBlockValue:{name:Pg.dataBlockValue},dataType:{name:Pg.dataType},name:{name:Pg.name}},superTypes:[]},EmFrame:{name:Wf.$type,properties:{},superTypes:[]},EmGwt:{name:DT.$type,properties:{givenStatements:{name:DT.givenStatements,defaultValue:[]},sourceFrame:{name:DT.sourceFrame,referenceType:Wf.$type},thenStatements:{name:DT.thenStatements,defaultValue:[]},whenStatements:{name:DT.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:k0e.$type,properties:{entityIdentifier:{name:k0e.entityIdentifier,referenceType:EO.$type}},superTypes:[]},EmModelEntity:{name:EO.$type,properties:{name:{name:EO.name}},superTypes:[]},EmNoteEntity:{name:JE.$type,properties:{dataBlockValue:{name:JE.dataBlockValue},dataType:{name:JE.dataType},sourceFrame:{name:JE.sourceFrame,referenceType:Wf.$type}},superTypes:[]},EmResetFrame:{name:ou.$type,properties:{dataInlineValue:{name:ou.dataInlineValue},dataReference:{name:ou.dataReference,referenceType:Pg.$type},dataType:{name:ou.dataType},entityIdentifier:{name:ou.entityIdentifier},modelEntityType:{name:ou.modelEntityType},name:{name:ou.name},sourceFrames:{name:ou.sourceFrames,defaultValue:[],referenceType:Wf.$type}},superTypes:[Wf.$type]},EmTimeFrame:{name:_h.$type,properties:{dataInlineValue:{name:_h.dataInlineValue},dataReference:{name:_h.dataReference,referenceType:Pg.$type},dataType:{name:_h.dataType},entityIdentifier:{name:_h.entityIdentifier},modelEntityType:{name:_h.modelEntityType},name:{name:_h.name},sourceFrames:{name:_h.sourceFrames,defaultValue:[],referenceType:Wf.$type}},superTypes:[Wf.$type]},Entry:{name:SO.$type,properties:{axis:{name:SO.axis,referenceType:HE.$type},value:{name:SO.value}},superTypes:[]},EventModel:{name:lu.$type,properties:{accDescr:{name:lu.accDescr},accTitle:{name:lu.accTitle},dataEntities:{name:lu.dataEntities,defaultValue:[]},frames:{name:lu.frames,defaultValue:[]},gwtEntities:{name:lu.gwtEntities,defaultValue:[]},modelEntities:{name:lu.modelEntities,defaultValue:[]},noteEntities:{name:lu.noteEntities,defaultValue:[]},title:{name:lu.title}},superTypes:[]},Evolution:{name:S0e.$type,properties:{stages:{name:S0e.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:eS.$type,properties:{boundary:{name:eS.boundary},name:{name:eS.name},secondName:{name:eS.secondName}},superTypes:[]},Evolve:{name:AO.$type,properties:{component:{name:AO.component},target:{name:AO.target}},superTypes:[]},GitGraph:{name:Uf.$type,properties:{accDescr:{name:Uf.accDescr},accTitle:{name:Uf.accTitle},statements:{name:Uf.statements,defaultValue:[]},title:{name:Uf.title}},superTypes:[]},Group:{name:MT.$type,properties:{icon:{name:MT.icon},id:{name:MT.id},in:{name:MT.in},title:{name:MT.title}},superTypes:[]},Info:{name:NT.$type,properties:{accDescr:{name:NT.accDescr},accTitle:{name:NT.accTitle},title:{name:NT.title}},superTypes:[]},Item:{name:OT.$type,properties:{classSelector:{name:OT.classSelector},name:{name:OT.name}},superTypes:[]},Junction:{name:_O.$type,properties:{id:{name:_O.id},in:{name:_O.in}},superTypes:[]},Label:{name:$T.$type,properties:{negX:{name:$T.negX,defaultValue:!1},negY:{name:$T.negY,defaultValue:!1},offsetX:{name:$T.offsetX},offsetY:{name:$T.offsetY}},superTypes:[]},Leaf:{name:tS.$type,properties:{classSelector:{name:tS.classSelector},name:{name:tS.name},value:{name:tS.value}},superTypes:[OT.$type]},Link:{name:Hf.$type,properties:{arrow:{name:Hf.arrow},from:{name:Hf.from},fromPort:{name:Hf.fromPort},linkLabel:{name:Hf.linkLabel},to:{name:Hf.to},toPort:{name:Hf.toPort}},superTypes:[]},Merge:{name:Bg.$type,properties:{branch:{name:Bg.branch},id:{name:Bg.id},tags:{name:Bg.tags,defaultValue:[]},type:{name:Bg.type}},superTypes:[Hg.$type]},Note:{name:rS.$type,properties:{evolution:{name:rS.evolution},text:{name:rS.text},visibility:{name:rS.visibility}},superTypes:[]},Option:{name:RO.$type,properties:{name:{name:RO.name},value:{name:RO.value,defaultValue:!1}},superTypes:[]},Packet:{name:Fg.$type,properties:{accDescr:{name:Fg.accDescr},accTitle:{name:Fg.accTitle},blocks:{name:Fg.blocks,defaultValue:[]},title:{name:Fg.title}},superTypes:[]},PacketBlock:{name:zg.$type,properties:{bits:{name:zg.bits},end:{name:zg.end},label:{name:zg.label},start:{name:zg.start}},superTypes:[]},PegAny:{name:A0e.$type,properties:{dot:{name:A0e.dot}},superTypes:[PT.$type]},PegGroup:{name:_0e.$type,properties:{element:{name:_0e.element}},superTypes:[PT.$type]},PegIdentifier:{name:R0e.$type,properties:{name:{name:R0e.name}},superTypes:[PT.$type]},PegLiteral:{name:L0e.$type,properties:{value:{name:L0e.value}},superTypes:[PT.$type]},PegOrderedChoice:{name:I0e.$type,properties:{alternatives:{name:I0e.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:LO.$type,properties:{operator:{name:LO.operator},suffix:{name:LO.suffix}},superTypes:[]},PegPrimary:{name:PT.$type,properties:{},superTypes:[]},PegRule:{name:IO.$type,properties:{definition:{name:IO.definition},name:{name:IO.name}},superTypes:[]},PegSequence:{name:D0e.$type,properties:{elements:{name:D0e.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:DO.$type,properties:{operator:{name:DO.operator},primary:{name:DO.primary}},superTypes:[]},Pie:{name:Yf.$type,properties:{accDescr:{name:Yf.accDescr},accTitle:{name:Yf.accTitle},sections:{name:Yf.sections,defaultValue:[]},showData:{name:Yf.showData,defaultValue:!1},title:{name:Yf.title}},superTypes:[]},PieSection:{name:nS.$type,properties:{label:{name:nS.label},value:{name:nS.value}},superTypes:[]},Pipeline:{name:MO.$type,properties:{components:{name:MO.components,defaultValue:[]},parent:{name:MO.parent}},superTypes:[]},PipelineComponent:{name:iS.$type,properties:{evolution:{name:iS.evolution},label:{name:iS.label},name:{name:iS.name}},superTypes:[]},Radar:{name:Xf.$type,properties:{accDescr:{name:Xf.accDescr},accTitle:{name:Xf.accTitle},axes:{name:Xf.axes,defaultValue:[]},curves:{name:Xf.curves,defaultValue:[]},options:{name:Xf.options,defaultValue:[]},title:{name:Xf.title}},superTypes:[]},Railroad:{name:Gg.$type,properties:{accDescr:{name:Gg.accDescr},accTitle:{name:Gg.accTitle},rules:{name:Gg.rules,defaultValue:[]},title:{name:Gg.title}},superTypes:[]},RailroadAbnf:{name:qg.$type,properties:{accDescr:{name:qg.accDescr},accTitle:{name:qg.accTitle},rules:{name:qg.rules,defaultValue:[]},title:{name:qg.title}},superTypes:[]},RailroadChoiceExpr:{name:M0e.$type,properties:{alternatives:{name:M0e.alternatives,defaultValue:[]}},superTypes:[cu.$type]},RailroadEbnf:{name:Vg.$type,properties:{accDescr:{name:Vg.accDescr},accTitle:{name:Vg.accTitle},rules:{name:Vg.rules,defaultValue:[]},title:{name:Vg.title}},superTypes:[]},RailroadExpression:{name:cu.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:N0e.$type,properties:{name:{name:N0e.name}},superTypes:[cu.$type]},RailroadOneOrMoreExpr:{name:O0e.$type,properties:{element:{name:O0e.element}},superTypes:[cu.$type]},RailroadOptionalExpr:{name:$0e.$type,properties:{element:{name:$0e.element}},superTypes:[cu.$type]},RailroadPeg:{name:Wg.$type,properties:{accDescr:{name:Wg.accDescr},accTitle:{name:Wg.accTitle},rules:{name:Wg.rules,defaultValue:[]},title:{name:Wg.title}},superTypes:[]},RailroadRule:{name:NO.$type,properties:{definition:{name:NO.definition},name:{name:NO.name}},superTypes:[]},RailroadSequenceExpr:{name:P0e.$type,properties:{elements:{name:P0e.elements,defaultValue:[]}},superTypes:[cu.$type]},RailroadSpecialExpr:{name:B0e.$type,properties:{text:{name:B0e.text}},superTypes:[cu.$type]},RailroadTerminalExpr:{name:F0e.$type,properties:{value:{name:F0e.value}},superTypes:[cu.$type]},RailroadZeroOrMoreExpr:{name:z0e.$type,properties:{element:{name:z0e.element}},superTypes:[cu.$type]},Section:{name:OO.$type,properties:{classSelector:{name:OO.classSelector},name:{name:OO.name}},superTypes:[OT.$type]},Service:{name:Ug.$type,properties:{icon:{name:Ug.icon},iconText:{name:Ug.iconText},id:{name:Ug.id},in:{name:Ug.in},title:{name:Ug.title}},superTypes:[]},Size:{name:$O.$type,properties:{height:{name:$O.height},width:{name:$O.width}},superTypes:[]},Statement:{name:Hg.$type,properties:{},superTypes:[]},Transition:{name:BT.$type,properties:{from:{name:BT.from},label:{name:BT.label},to:{name:BT.to}},superTypes:[]},TreeNode:{name:Xg.$type,properties:{classAnnotation:{name:Xg.classAnnotation},descAnnotation:{name:Xg.descAnnotation},iconAnnotation:{name:Xg.iconAnnotation},indent:{name:Xg.indent},name:{name:Xg.name}},superTypes:[]},TreeView:{name:FT.$type,properties:{accDescr:{name:FT.accDescr},accTitle:{name:FT.accTitle},nodes:{name:FT.nodes,defaultValue:[]},title:{name:FT.title}},superTypes:[]},Treemap:{name:Yg.$type,properties:{accDescr:{name:Yg.accDescr},accTitle:{name:Yg.accTitle},title:{name:Yg.title},TreemapRows:{name:Yg.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:PO.$type,properties:{indent:{name:PO.indent},item:{name:PO.item}},superTypes:[]},Wardley:{name:xa.$type,properties:{accDescr:{name:xa.accDescr},accelerators:{name:xa.accelerators,defaultValue:[]},accTitle:{name:xa.accTitle},anchors:{name:xa.anchors,defaultValue:[]},annotation:{name:xa.annotation,defaultValue:[]},annotations:{name:xa.annotations,defaultValue:[]},components:{name:xa.components,defaultValue:[]},deaccelerators:{name:xa.deaccelerators,defaultValue:[]},evolution:{name:xa.evolution},evolves:{name:xa.evolves,defaultValue:[]},links:{name:xa.links,defaultValue:[]},notes:{name:xa.notes,defaultValue:[]},pipelines:{name:xa.pipelines,defaultValue:[]},size:{name:xa.size},title:{name:xa.title}},superTypes:[]}}}},E(jy,"MermaidAstReflection"),jy),gi=new G0e,q0e,Ynt=E(()=>q0e??(q0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),V0e,Xnt=E(()=>V0e??(V0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),W0e,Knt=E(()=>W0e??(W0e=aa('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),U0e,jnt=E(()=>U0e??(U0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),H0e,Znt=E(()=>H0e??(H0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),Y0e,Qnt=E(()=>Y0e??(Y0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),X0e,Jnt=E(()=>X0e??(X0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),K0e,eit=E(()=>K0e??(K0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),j0e,tit=E(()=>j0e??(j0e=aa('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),Z0e,rit=E(()=>Z0e??(Z0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),Q0e,nit=E(()=>Q0e??(Q0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),J0e,iit=E(()=>J0e??(J0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),epe,ait=E(()=>epe??(epe=aa(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),tpe,sit=E(()=>tpe??(tpe=aa(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),rpe,oit=E(()=>rpe??(rpe=aa(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),lit={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},cit={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},uit={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},hit={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},dit={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},fit={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},pit={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},git={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},mit={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},yit={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},vit={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},bit={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},xit={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Tit={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},wit={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},cs={AstReflection:E(()=>new G0e,"AstReflection")},Cit={Grammar:E(()=>Ynt(),"Grammar"),LanguageMetaData:E(()=>lit,"LanguageMetaData"),parser:{}},kit={Grammar:E(()=>Xnt(),"Grammar"),LanguageMetaData:E(()=>cit,"LanguageMetaData"),parser:{}},Eit={Grammar:E(()=>Knt(),"Grammar"),LanguageMetaData:E(()=>uit,"LanguageMetaData"),parser:{}},Sit={Grammar:E(()=>jnt(),"Grammar"),LanguageMetaData:E(()=>hit,"LanguageMetaData"),parser:{}},Ait={Grammar:E(()=>Znt(),"Grammar"),LanguageMetaData:E(()=>dit,"LanguageMetaData"),parser:{}},_it={Grammar:E(()=>Qnt(),"Grammar"),LanguageMetaData:E(()=>fit,"LanguageMetaData"),parser:{}},Rit={Grammar:E(()=>Jnt(),"Grammar"),LanguageMetaData:E(()=>pit,"LanguageMetaData"),parser:{}},Lit={Grammar:E(()=>eit(),"Grammar"),LanguageMetaData:E(()=>git,"LanguageMetaData"),parser:{}},Iit={Grammar:E(()=>tit(),"Grammar"),LanguageMetaData:E(()=>mit,"LanguageMetaData"),parser:{}},Dit={Grammar:E(()=>rit(),"Grammar"),LanguageMetaData:E(()=>yit,"LanguageMetaData"),parser:{}},Mit={Grammar:E(()=>nit(),"Grammar"),LanguageMetaData:E(()=>vit,"LanguageMetaData"),parser:{}},Nit={Grammar:E(()=>iit(),"Grammar"),LanguageMetaData:E(()=>bit,"LanguageMetaData"),parser:{}},Oit={Grammar:E(()=>ait(),"Grammar"),LanguageMetaData:E(()=>xit,"LanguageMetaData"),parser:{}},$it={Grammar:E(()=>sit(),"Grammar"),LanguageMetaData:E(()=>Tit,"LanguageMetaData"),parser:{}},Pit={Grammar:E(()=>oit(),"Grammar"),LanguageMetaData:E(()=>wit,"LanguageMetaData"),parser:{}},Bit=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,Fit=/accTitle[\t ]*:([^\n\r]*)/,zit=/title([\t ][^\n\r]*|)/,Git={ACC_DESCR:Bit,ACC_TITLE:Fit,TITLE:zit},rc=(Zy=class extends EN{runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){const i=Git[e.name];if(i===void 0)return;const a=i.exec(r);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` -`)}}},E(Zy,"AbstractMermaidValueConverter"),Zy),Kg=(Qy=class extends rc{runCustomConverter(e,r,n){}},E(Qy,"CommonValueConverter"),Qy),us=(Jy=class extends SE{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const i=super.buildKeywordTokens(e,r,n);return i.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},E(Jy,"AbstractMermaidTokenBuilder"),Jy);ev=class extends us{},E(ev,"CommonTokenBuilder");/*! Bundled license information: +`}E(eO,"fillNewlines");var Qfe=(Fy=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&YN(r))return HN(r).toMarkdown({renderLink:E((i,a)=>this.documentationLinkRenderer(e,i,a),"renderLink"),renderTag:E(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const a=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${a},${s}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=qo(e).localSymbols;if(!i)return;let a=e;do{const o=i.getStream(a).find(l=>l.name===r);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},E(Fy,"JSDocDocumentationProvider"),Fy),Jfe=(zy=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return zN(e)?e.$comment:(r=uD(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},E(zy,"DefaultCommentProvider"),zy),epe=(Gy=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},E(Gy,"DefaultAsyncParser"),Gy),Mnt=(qy=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){const n=await this.acquireParserWorker(r),i=new au;let a;const s=r.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(o=>{const l=this.hydrator.hydrate(o);i.resolve(l)}).catch(o=>{i.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),i.promise}terminateWorker(e){e.terminate();const r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool)if(n.ready)return n.lock(),n;const r=new au;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(Jl)}),this.queue.push(r),r.promise}},E(qy,"AbstractThreadedAsyncParser"),qy),Nnt=(Vy=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new FE.Emitter,this.deferred=new au,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),n(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(Jl),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new au,this.sendMessage(e),this.deferred.promise}},E(Vy,"ParserWorker"),Vy),tpe=(Wy=class{constructor(){this.previousTokenSource=new _n.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=DE();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=_n.CancellationToken.None){const i=new au,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){$f(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},E(Wy,"DefaultWorkspaceLock"),Wy),rpe=(Uy=class{constructor(e){this.grammarElementIdMap=new OE,this.tokenTypeIdMap=new OE,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of Vo(e))r.set(i,{});if(e.$cstNode)for(const i of gg(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Ii(o)?s.push(this.dehydrateAstNode(o,r)):es(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Ii(a)?n[i]=this.dehydrateAstNode(a,r):es(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return N3(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Wc(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):Kd(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const a of Vo(e))r.set(a,{});let i;if(e.$cstNode)for(const a of gg(e.$cstNode)){let s;"fullText"in a?(s=new wN(a.fullText),i=s):"content"in a?s=new CE:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Ii(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):es(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Ii(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):es(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),Wc(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new wE(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of Vo(this.grammar))B3(r)&&this.grammarElementIdMap.set(r,e++)}},E(Uy,"DefaultHydrator"),Uy);function na(t){return{documentation:{CommentProvider:E(e=>new Jfe(e),"CommentProvider"),DocumentationProvider:E(e=>new Qfe(e),"DocumentationProvider")},parser:{AsyncParser:E(e=>new epe(e),"AsyncParser"),GrammarConfig:E(e=>$D(e),"GrammarConfig"),LangiumParser:E(e=>_N(e),"LangiumParser"),CompletionParser:E(e=>AN(e),"CompletionParser"),ValueConverter:E(()=>new LN,"ValueConverter"),TokenBuilder:E(()=>new RE,"TokenBuilder"),Lexer:E(e=>new UN(e),"Lexer"),ParserErrorMessageProvider:E(()=>new kN,"ParserErrorMessageProvider"),LexerErrorMessageProvider:E(()=>new Ffe,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:E(()=>new Nfe,"AstNodeLocator"),AstNodeDescriptionProvider:E(e=>new Dfe(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:E(e=>new Mfe(e),"ReferenceDescriptionProvider")},references:{Linker:E(e=>new xfe(e),"Linker"),NameProvider:E(()=>new Tfe,"NameProvider"),ScopeProvider:E(e=>new Sfe(e),"ScopeProvider"),ScopeComputation:E(e=>new Cfe(e),"ScopeComputation"),References:E(e=>new wfe(e),"References")},serializer:{Hydrator:E(e=>new rpe(e),"Hydrator"),JsonSerializer:E(e=>new Afe(e),"JsonSerializer")},validation:{DocumentValidator:E(e=>new Ife(e),"DocumentValidator"),ValidationRegistry:E(e=>new Rfe(e),"ValidationRegistry")},shared:E(()=>t.shared,"shared")}}E(na,"createDefaultCoreModule");function ia(t){return{ServiceRegistry:E(e=>new _fe(e),"ServiceRegistry"),workspace:{LangiumDocuments:E(e=>new bfe(e),"LangiumDocuments"),LangiumDocumentFactory:E(e=>new vfe(e),"LangiumDocumentFactory"),DocumentBuilder:E(e=>new $fe(e),"DocumentBuilder"),IndexManager:E(e=>new Pfe(e),"IndexManager"),WorkspaceManager:E(e=>new Bfe(e),"WorkspaceManager"),FileSystemProvider:E(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:E(()=>new tpe,"WorkspaceLock"),ConfigurationProvider:E(e=>new Ofe(e),"ConfigurationProvider")},profilers:{}}}E(ia,"createDefaultSharedCoreModule");var tO;(function(t){t.merge=(e,r)=>Ng(Ng({},e),r)})(tO||(tO={}));function Xr(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(Ng,{});return nO(u)}E(Xr,"inject");var npe=Symbol("isProxy");function rO(t){if(t&&t[npe])for(const e of Object.values(t))rO(e);return t}E(rO,"eagerLoad");function nO(t,e){const r=new Proxy({},{deleteProperty:E(()=>!1,"deleteProperty"),set:E(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:E((n,i)=>i===npe?!0:iO(n,i,t,e||r),"get"),getOwnPropertyDescriptor:E((n,i)=>(iO(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:E((n,i)=>i in t,"has"),ownKeys:E(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}E(nO,"_inject");var ipe=Symbol();function iO(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===ipe)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=ipe;try{t[e]=typeof i=="function"?i(n):nO(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}E(iO,"_resolve");function Ng(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=Ng(i,n):t[r]=Ng({},n)}else t[r]=n}return t}E(Ng,"_merge");var aO={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},zf;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(zf||(zf={}));var ape=(Hy=class extends RE{constructor(e=aO){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...aO,...e},this.indentTokenType=Ag({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=Ag({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!GE(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,u,h;const d=[];for(const f of n){for(const[p,g]of o)f.name===p?f.PUSH_MODE=zf.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===a?l=f:f.name===i?u=f:f.name===s?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[zf.REGULAR]:[l,u,...d,h],[zf.IGNORE_INDENTATION]:[...d,h]},defaultMode:zf.REGULAR}:[l,u,h,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r +`.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:(a==null?void 0:a[0].length)??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,r,n,i){const a=this.getLineNumber(r,i);return mT(e,n,i,i+n.length,a,a,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:((d=o==null?void 0:o[0])==null?void 0:d.length)??0,line:this.getLineNumber(e,r),column:1}),null;const u=this.indentationStack.length-l-1,h=((f=e.substring(0,r).match(/[\r\n]+$/))==null?void 0:f[0].length)??1;for(let p=0;p1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},E(Hy,"IndentationAwareTokenBuilder"),Hy),Ont=(Yy=class extends UN{constructor(e){if(super(e),e.parser.TokenBuilder instanceof ape)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=WN){const n=super.tokenize(e),i=n.report;(r==null?void 0:r.mode)==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d=0&&u.push(n.tokens[h]),n.tokens=u,n}},E(Yy,"IndentationAwareLexer"),Yy),sO={};fh(sO,{AstUtils:()=>B9,BiMap:()=>OE,Cancellation:()=>_n,ContextCache:()=>PE,CstUtils:()=>O9,DONE_RESULT:()=>ts,Deferred:()=>au,Disposable:()=>Ff,DisposableCache:()=>$E,DocumentCache:()=>Efe,EMPTY_STREAM:()=>rg,ErrorWithLocation:()=>ak,GrammarUtils:()=>gD,MultiMap:()=>su,OperationCancelled:()=>Jl,Reduction:()=>Rx,RegExpUtils:()=>yD,SimpleCache:()=>BN,StreamImpl:()=>Vl,TreeStreamImpl:()=>ng,URI:()=>eo,UriTrie:()=>ON,UriUtils:()=>ls,WorkspaceCache:()=>FN,assertCondition:()=>mD,assertUnreachable:()=>xh,delayNextTick:()=>LE,interruptAndCheck:()=>ra,isOperationCancelled:()=>$f,loadGrammarFromJson:()=>aa,setInterruptionPeriod:()=>IN,startCancelableOperation:()=>DE,stream:()=>pn}),k3(sO,FE);var spe=(Xy=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},E(Xy,"EmptyFileSystemProvider"),Xy),ba={fileSystemProvider:E(()=>new spe,"fileSystemProvider")},$nt={Grammar:E(()=>{},"Grammar"),LanguageMetaData:E(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},Pnt={AstReflection:E(()=>new aD,"AstReflection")};function ope(){const t=Xr(ia(ba),Pnt),e=Xr(na({shared:t}),$nt);return t.ServiceRegistry.register(e),e}E(ope,"createMinimalGrammarServices");function aa(t){const e=ope(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,eo.parse(`memory:/${r.name??"grammar"}.langium`)),r}E(aa,"loadGrammarFromJson"),k3(Xte,sO);var Bnt=(Ky=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new su}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new lpe(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);const n=[];for(const s of r.entries.keys()){const o=r.entries.get(s),l=o.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${s}`,count:o.length,duration:l})}const i=r.duration-n.map(s=>s.duration).reduce((s,o)=>s+o,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return E(a,"Round"),console.table(n.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/r.duration),"Time (ms)":a(s.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},E(Ky,"DefaultLangiumProfiler"),Ky),lpe=(jy=class{constructor(e,r){this.stack=[],this.entries=new su,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);const n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);const i=n-r.content;this.entries.add(e,i)}},E(jy,"ProfilingTask"),jy),oO;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(oO||(oO={}));var lO;(t=>{t.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(lO||(lO={}));var cO;(t=>{t.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(cO||(cO={}));var uO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(uO||(uO={}));var hO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(hO||(hO={}));var dO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(dO||(dO={}));var fO;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(fO||(fO={}));var pO;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(pO||(pO={}));var gO;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(gO||(gO={}));var mO;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(mO||(mO={}));var yO;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(yO||(yO={}));var vO;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(vO||(vO={}));var bO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(bO||(bO={}));var xO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(xO||(xO={}));var TO;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(TO||(TO={})),{...oO.Terminals,...lO.Terminals,...cO.Terminals,...uO.Terminals,...hO.Terminals,...dO.Terminals,...fO.Terminals,...pO.Terminals,...gO.Terminals,...mO.Terminals,...yO.Terminals,...vO.Terminals,...xO.Terminals,...bO.Terminals,...TO.Terminals};var cpe={$type:"AbnfAlternation",alternatives:"alternatives"},upe={$type:"AbnfConcatenation",elements:"elements"},wO={$type:"AbnfElement",primary:"primary",repeat:"repeat"},hpe={$type:"AbnfGroup",element:"element"},dpe={$type:"AbnfNumVal",value:"value"},fpe={$type:"AbnfOptionalGroup",element:"element"},Og={$type:"AbnfPrimary"},CO={$type:"AbnfRule",definition:"definition",name:"name"},ppe={$type:"AbnfRuleName",name:"name"},gpe={$type:"AbnfStringLiteral",value:"value"},YE={$type:"Accelerator",name:"name",x:"x",y:"y"},kO={$type:"Alignment",direction:"direction",members:"members"},XE={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},DT={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},EO={$type:"Annotations",x:"x",y:"y"},ec={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function Fnt(t){return gi.isInstance(t,ec.$type)}E(Fnt,"isArchitecture");var KE={$type:"Axis",label:"label",name:"name"},jE={$type:"Branch",name:"name",order:"order"};function znt(t){return gi.isInstance(t,jE.$type)}E(znt,"isBranch");var mpe={$type:"Checkout",branch:"branch"},ZE={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},SO={$type:"ClassDefStatement",className:"className",styleText:"styleText"},$g={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function Gnt(t){return gi.isInstance(t,$g.$type)}E(Gnt,"isCommit");var QE={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},Gf={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},JE={$type:"Curve",entries:"entries",label:"label",name:"name"},qf={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function qnt(t){return gi.isInstance(t,qf.$type)}E(qnt,"isCynefin");var eS={$type:"Deaccelerator",name:"name",x:"x",y:"y"},ype={$type:"Decorator",strategy:"strategy"},Pg={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},tS={$type:"DomainBlock",domain:"domain",items:"items"};function Vnt(t){return gi.isInstance(t,tS.$type)}E(Vnt,"isDomainBlock");var AO={$type:"DomainItem",label:"label"};function Wnt(t){return gi.isInstance(t,AO.$type)}E(Wnt,"isDomainItem");var vpe={$type:"EbnfChoice",alternatives:"alternatives"},bpe={$type:"EbnfExceptionPostfix",except:"except"},xpe={$type:"EbnfGroup",element:"element"},Tpe={$type:"EbnfNonTerminal",name:"name"},wpe={$type:"EbnfOneOrMorePostfix",operator:"operator"},Cpe={$type:"EbnfOptional",element:"element"},kpe={$type:"EbnfOptionalPostfix",operator:"operator"},MT={$type:"EbnfPostfix"},Vf={$type:"EbnfPrimary"},Epe={$type:"EbnfRepetition",element:"element"},_O={$type:"EbnfRule",definition:"definition",name:"name"},Spe={$type:"EbnfSequence",elements:"elements"},Ape={$type:"EbnfSpecial",text:"text"},RO={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},_pe={$type:"EbnfTerminal",value:"value"},Rpe={$type:"EbnfZeroOrMorePostfix",operator:"operator"},tc={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},Bg={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},Wf={$type:"EmFrame"},NT={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},Lpe={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},LO={$type:"EmModelEntity",name:"name"};function Unt(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}E(Unt,"isEmModelEntityType");var rS={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},ou={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function Ipe(t){return gi.isInstance(t,ou.$type)}E(Ipe,"isEmResetFrame");var _h={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},IO={$type:"Entry",axis:"axis",value:"value"},lu={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},Dpe={$type:"Evolution",stages:"stages"},nS={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},DO={$type:"Evolve",component:"component",target:"target"},Uf={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function Hnt(t){return gi.isInstance(t,Uf.$type)}E(Hnt,"isGitGraph");var OT={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},$T={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function Ynt(t){return gi.isInstance(t,$T.$type)}E(Ynt,"isInfo");var PT={$type:"Item",classSelector:"classSelector",name:"name"},MO={$type:"Junction",id:"id",in:"in"},BT={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},iS={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},Hf={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},Fg={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function Xnt(t){return gi.isInstance(t,Fg.$type)}E(Xnt,"isMerge");var aS={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},NO={$type:"Option",name:"name",value:"value"},zg={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function Knt(t){return gi.isInstance(t,zg.$type)}E(Knt,"isPacket");var Gg={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function jnt(t){return gi.isInstance(t,Gg.$type)}E(jnt,"isPacketBlock");var Mpe={$type:"PegAny",dot:"dot"},Npe={$type:"PegGroup",element:"element"},Ope={$type:"PegIdentifier",name:"name"},$pe={$type:"PegLiteral",value:"value"},Ppe={$type:"PegOrderedChoice",alternatives:"alternatives"},OO={$type:"PegPrefix",operator:"operator",suffix:"suffix"},FT={$type:"PegPrimary"},$O={$type:"PegRule",definition:"definition",name:"name"},Bpe={$type:"PegSequence",elements:"elements"},PO={$type:"PegSuffix",operator:"operator",primary:"primary"},Yf={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function Znt(t){return gi.isInstance(t,Yf.$type)}E(Znt,"isPie");var sS={$type:"PieSection",label:"label",value:"value"};function Qnt(t){return gi.isInstance(t,sS.$type)}E(Qnt,"isPieSection");var BO={$type:"Pipeline",components:"components",parent:"parent"},oS={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},Xf={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},qg={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Jnt(t){return gi.isInstance(t,qg.$type)}E(Jnt,"isRailroad");var Vg={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function eit(t){return gi.isInstance(t,Vg.$type)}E(eit,"isRailroadAbnf");var Fpe={$type:"RailroadChoiceExpr",alternatives:"alternatives"},Wg={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function tit(t){return gi.isInstance(t,Wg.$type)}E(tit,"isRailroadEbnf");var cu={$type:"RailroadExpression"},zpe={$type:"RailroadNonTerminalExpr",name:"name"},Gpe={$type:"RailroadOneOrMoreExpr",element:"element"},qpe={$type:"RailroadOptionalExpr",element:"element"},Ug={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function rit(t){return gi.isInstance(t,Ug.$type)}E(rit,"isRailroadPeg");var FO={$type:"RailroadRule",definition:"definition",name:"name"},Vpe={$type:"RailroadSequenceExpr",elements:"elements"},Wpe={$type:"RailroadSpecialExpr",text:"text"},Upe={$type:"RailroadTerminalExpr",value:"value"},Hpe={$type:"RailroadZeroOrMoreExpr",element:"element"},zO={$type:"Section",classSelector:"classSelector",name:"name"},Hg={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},GO={$type:"Size",height:"height",width:"width"},Yg={$type:"Statement"},zT={$type:"Transition",from:"from",label:"label",to:"to"};function nit(t){return gi.isInstance(t,zT.$type)}E(nit,"isTransition");var Xg={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function iit(t){return gi.isInstance(t,Xg.$type)}E(iit,"isTreemap");var qO={$type:"TreemapRow",indent:"indent",item:"item"},Kg={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},GT={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},xa={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function ait(t){return gi.isInstance(t,xa.$type)}E(ait,"isWardley");var Ype=(Zy=class extends P9{constructor(){super(...arguments),this.types={AbnfAlternation:{name:cpe.$type,properties:{alternatives:{name:cpe.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:upe.$type,properties:{elements:{name:upe.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:wO.$type,properties:{primary:{name:wO.primary},repeat:{name:wO.repeat}},superTypes:[]},AbnfGroup:{name:hpe.$type,properties:{element:{name:hpe.element}},superTypes:[Og.$type]},AbnfNumVal:{name:dpe.$type,properties:{value:{name:dpe.value}},superTypes:[Og.$type]},AbnfOptionalGroup:{name:fpe.$type,properties:{element:{name:fpe.element}},superTypes:[Og.$type]},AbnfPrimary:{name:Og.$type,properties:{},superTypes:[]},AbnfRule:{name:CO.$type,properties:{definition:{name:CO.definition},name:{name:CO.name}},superTypes:[]},AbnfRuleName:{name:ppe.$type,properties:{name:{name:ppe.name}},superTypes:[Og.$type]},AbnfStringLiteral:{name:gpe.$type,properties:{value:{name:gpe.value}},superTypes:[Og.$type]},Accelerator:{name:YE.$type,properties:{name:{name:YE.name},x:{name:YE.x},y:{name:YE.y}},superTypes:[]},Alignment:{name:kO.$type,properties:{direction:{name:kO.direction},members:{name:kO.members,defaultValue:[]}},superTypes:[]},Anchor:{name:XE.$type,properties:{evolution:{name:XE.evolution},name:{name:XE.name},visibility:{name:XE.visibility}},superTypes:[]},Annotation:{name:DT.$type,properties:{number:{name:DT.number},text:{name:DT.text},x:{name:DT.x},y:{name:DT.y}},superTypes:[]},Annotations:{name:EO.$type,properties:{x:{name:EO.x},y:{name:EO.y}},superTypes:[]},Architecture:{name:ec.$type,properties:{accDescr:{name:ec.accDescr},accTitle:{name:ec.accTitle},alignments:{name:ec.alignments,defaultValue:[]},edges:{name:ec.edges,defaultValue:[]},groups:{name:ec.groups,defaultValue:[]},junctions:{name:ec.junctions,defaultValue:[]},services:{name:ec.services,defaultValue:[]},title:{name:ec.title}},superTypes:[]},Axis:{name:KE.$type,properties:{label:{name:KE.label},name:{name:KE.name}},superTypes:[]},Branch:{name:jE.$type,properties:{name:{name:jE.name},order:{name:jE.order}},superTypes:[Yg.$type]},Checkout:{name:mpe.$type,properties:{branch:{name:mpe.branch}},superTypes:[Yg.$type]},CherryPicking:{name:ZE.$type,properties:{id:{name:ZE.id},parent:{name:ZE.parent},tags:{name:ZE.tags,defaultValue:[]}},superTypes:[Yg.$type]},ClassDefStatement:{name:SO.$type,properties:{className:{name:SO.className},styleText:{name:SO.styleText}},superTypes:[]},Commit:{name:$g.$type,properties:{id:{name:$g.id},message:{name:$g.message},tags:{name:$g.tags,defaultValue:[]},type:{name:$g.type}},superTypes:[Yg.$type]},Common:{name:QE.$type,properties:{accDescr:{name:QE.accDescr},accTitle:{name:QE.accTitle},title:{name:QE.title}},superTypes:[]},Component:{name:Gf.$type,properties:{decorator:{name:Gf.decorator},evolution:{name:Gf.evolution},inertia:{name:Gf.inertia,defaultValue:!1},label:{name:Gf.label},name:{name:Gf.name},visibility:{name:Gf.visibility}},superTypes:[]},Curve:{name:JE.$type,properties:{entries:{name:JE.entries,defaultValue:[]},label:{name:JE.label},name:{name:JE.name}},superTypes:[]},Cynefin:{name:qf.$type,properties:{accDescr:{name:qf.accDescr},accTitle:{name:qf.accTitle},domains:{name:qf.domains,defaultValue:[]},title:{name:qf.title},transitions:{name:qf.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:eS.$type,properties:{name:{name:eS.name},x:{name:eS.x},y:{name:eS.y}},superTypes:[]},Decorator:{name:ype.$type,properties:{strategy:{name:ype.strategy}},superTypes:[]},Direction:{name:Pg.$type,properties:{accDescr:{name:Pg.accDescr},accTitle:{name:Pg.accTitle},dir:{name:Pg.dir},statements:{name:Pg.statements,defaultValue:[]},title:{name:Pg.title}},superTypes:[Uf.$type]},DomainBlock:{name:tS.$type,properties:{domain:{name:tS.domain},items:{name:tS.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:AO.$type,properties:{label:{name:AO.label}},superTypes:[]},EbnfChoice:{name:vpe.$type,properties:{alternatives:{name:vpe.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:bpe.$type,properties:{except:{name:bpe.except}},superTypes:[MT.$type]},EbnfGroup:{name:xpe.$type,properties:{element:{name:xpe.element}},superTypes:[Vf.$type]},EbnfNonTerminal:{name:Tpe.$type,properties:{name:{name:Tpe.name}},superTypes:[Vf.$type]},EbnfOneOrMorePostfix:{name:wpe.$type,properties:{operator:{name:wpe.operator}},superTypes:[MT.$type]},EbnfOptional:{name:Cpe.$type,properties:{element:{name:Cpe.element}},superTypes:[Vf.$type]},EbnfOptionalPostfix:{name:kpe.$type,properties:{operator:{name:kpe.operator}},superTypes:[MT.$type]},EbnfPostfix:{name:MT.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Vf.$type,properties:{},superTypes:[]},EbnfRepetition:{name:Epe.$type,properties:{element:{name:Epe.element}},superTypes:[Vf.$type]},EbnfRule:{name:_O.$type,properties:{definition:{name:_O.definition},name:{name:_O.name}},superTypes:[]},EbnfSequence:{name:Spe.$type,properties:{elements:{name:Spe.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:Ape.$type,properties:{text:{name:Ape.text}},superTypes:[Vf.$type]},EbnfTerm:{name:RO.$type,properties:{base:{name:RO.base},postfixes:{name:RO.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:_pe.$type,properties:{value:{name:_pe.value}},superTypes:[Vf.$type]},EbnfZeroOrMorePostfix:{name:Rpe.$type,properties:{operator:{name:Rpe.operator}},superTypes:[MT.$type]},Edge:{name:tc.$type,properties:{lhsDir:{name:tc.lhsDir},lhsGroup:{name:tc.lhsGroup,defaultValue:!1},lhsId:{name:tc.lhsId},lhsInto:{name:tc.lhsInto,defaultValue:!1},rhsDir:{name:tc.rhsDir},rhsGroup:{name:tc.rhsGroup,defaultValue:!1},rhsId:{name:tc.rhsId},rhsInto:{name:tc.rhsInto,defaultValue:!1},title:{name:tc.title}},superTypes:[]},EmDataEntity:{name:Bg.$type,properties:{dataBlockValue:{name:Bg.dataBlockValue},dataType:{name:Bg.dataType},name:{name:Bg.name}},superTypes:[]},EmFrame:{name:Wf.$type,properties:{},superTypes:[]},EmGwt:{name:NT.$type,properties:{givenStatements:{name:NT.givenStatements,defaultValue:[]},sourceFrame:{name:NT.sourceFrame,referenceType:Wf.$type},thenStatements:{name:NT.thenStatements,defaultValue:[]},whenStatements:{name:NT.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:Lpe.$type,properties:{entityIdentifier:{name:Lpe.entityIdentifier,referenceType:LO.$type}},superTypes:[]},EmModelEntity:{name:LO.$type,properties:{name:{name:LO.name}},superTypes:[]},EmNoteEntity:{name:rS.$type,properties:{dataBlockValue:{name:rS.dataBlockValue},dataType:{name:rS.dataType},sourceFrame:{name:rS.sourceFrame,referenceType:Wf.$type}},superTypes:[]},EmResetFrame:{name:ou.$type,properties:{dataInlineValue:{name:ou.dataInlineValue},dataReference:{name:ou.dataReference,referenceType:Bg.$type},dataType:{name:ou.dataType},entityIdentifier:{name:ou.entityIdentifier},modelEntityType:{name:ou.modelEntityType},name:{name:ou.name},sourceFrames:{name:ou.sourceFrames,defaultValue:[],referenceType:Wf.$type}},superTypes:[Wf.$type]},EmTimeFrame:{name:_h.$type,properties:{dataInlineValue:{name:_h.dataInlineValue},dataReference:{name:_h.dataReference,referenceType:Bg.$type},dataType:{name:_h.dataType},entityIdentifier:{name:_h.entityIdentifier},modelEntityType:{name:_h.modelEntityType},name:{name:_h.name},sourceFrames:{name:_h.sourceFrames,defaultValue:[],referenceType:Wf.$type}},superTypes:[Wf.$type]},Entry:{name:IO.$type,properties:{axis:{name:IO.axis,referenceType:KE.$type},value:{name:IO.value}},superTypes:[]},EventModel:{name:lu.$type,properties:{accDescr:{name:lu.accDescr},accTitle:{name:lu.accTitle},dataEntities:{name:lu.dataEntities,defaultValue:[]},frames:{name:lu.frames,defaultValue:[]},gwtEntities:{name:lu.gwtEntities,defaultValue:[]},modelEntities:{name:lu.modelEntities,defaultValue:[]},noteEntities:{name:lu.noteEntities,defaultValue:[]},title:{name:lu.title}},superTypes:[]},Evolution:{name:Dpe.$type,properties:{stages:{name:Dpe.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:nS.$type,properties:{boundary:{name:nS.boundary},name:{name:nS.name},secondName:{name:nS.secondName}},superTypes:[]},Evolve:{name:DO.$type,properties:{component:{name:DO.component},target:{name:DO.target}},superTypes:[]},GitGraph:{name:Uf.$type,properties:{accDescr:{name:Uf.accDescr},accTitle:{name:Uf.accTitle},statements:{name:Uf.statements,defaultValue:[]},title:{name:Uf.title}},superTypes:[]},Group:{name:OT.$type,properties:{icon:{name:OT.icon},id:{name:OT.id},in:{name:OT.in},title:{name:OT.title}},superTypes:[]},Info:{name:$T.$type,properties:{accDescr:{name:$T.accDescr},accTitle:{name:$T.accTitle},title:{name:$T.title}},superTypes:[]},Item:{name:PT.$type,properties:{classSelector:{name:PT.classSelector},name:{name:PT.name}},superTypes:[]},Junction:{name:MO.$type,properties:{id:{name:MO.id},in:{name:MO.in}},superTypes:[]},Label:{name:BT.$type,properties:{negX:{name:BT.negX,defaultValue:!1},negY:{name:BT.negY,defaultValue:!1},offsetX:{name:BT.offsetX},offsetY:{name:BT.offsetY}},superTypes:[]},Leaf:{name:iS.$type,properties:{classSelector:{name:iS.classSelector},name:{name:iS.name},value:{name:iS.value}},superTypes:[PT.$type]},Link:{name:Hf.$type,properties:{arrow:{name:Hf.arrow},from:{name:Hf.from},fromPort:{name:Hf.fromPort},linkLabel:{name:Hf.linkLabel},to:{name:Hf.to},toPort:{name:Hf.toPort}},superTypes:[]},Merge:{name:Fg.$type,properties:{branch:{name:Fg.branch},id:{name:Fg.id},tags:{name:Fg.tags,defaultValue:[]},type:{name:Fg.type}},superTypes:[Yg.$type]},Note:{name:aS.$type,properties:{evolution:{name:aS.evolution},text:{name:aS.text},visibility:{name:aS.visibility}},superTypes:[]},Option:{name:NO.$type,properties:{name:{name:NO.name},value:{name:NO.value,defaultValue:!1}},superTypes:[]},Packet:{name:zg.$type,properties:{accDescr:{name:zg.accDescr},accTitle:{name:zg.accTitle},blocks:{name:zg.blocks,defaultValue:[]},title:{name:zg.title}},superTypes:[]},PacketBlock:{name:Gg.$type,properties:{bits:{name:Gg.bits},end:{name:Gg.end},label:{name:Gg.label},start:{name:Gg.start}},superTypes:[]},PegAny:{name:Mpe.$type,properties:{dot:{name:Mpe.dot}},superTypes:[FT.$type]},PegGroup:{name:Npe.$type,properties:{element:{name:Npe.element}},superTypes:[FT.$type]},PegIdentifier:{name:Ope.$type,properties:{name:{name:Ope.name}},superTypes:[FT.$type]},PegLiteral:{name:$pe.$type,properties:{value:{name:$pe.value}},superTypes:[FT.$type]},PegOrderedChoice:{name:Ppe.$type,properties:{alternatives:{name:Ppe.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:OO.$type,properties:{operator:{name:OO.operator},suffix:{name:OO.suffix}},superTypes:[]},PegPrimary:{name:FT.$type,properties:{},superTypes:[]},PegRule:{name:$O.$type,properties:{definition:{name:$O.definition},name:{name:$O.name}},superTypes:[]},PegSequence:{name:Bpe.$type,properties:{elements:{name:Bpe.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:PO.$type,properties:{operator:{name:PO.operator},primary:{name:PO.primary}},superTypes:[]},Pie:{name:Yf.$type,properties:{accDescr:{name:Yf.accDescr},accTitle:{name:Yf.accTitle},sections:{name:Yf.sections,defaultValue:[]},showData:{name:Yf.showData,defaultValue:!1},title:{name:Yf.title}},superTypes:[]},PieSection:{name:sS.$type,properties:{label:{name:sS.label},value:{name:sS.value}},superTypes:[]},Pipeline:{name:BO.$type,properties:{components:{name:BO.components,defaultValue:[]},parent:{name:BO.parent}},superTypes:[]},PipelineComponent:{name:oS.$type,properties:{evolution:{name:oS.evolution},label:{name:oS.label},name:{name:oS.name}},superTypes:[]},Radar:{name:Xf.$type,properties:{accDescr:{name:Xf.accDescr},accTitle:{name:Xf.accTitle},axes:{name:Xf.axes,defaultValue:[]},curves:{name:Xf.curves,defaultValue:[]},options:{name:Xf.options,defaultValue:[]},title:{name:Xf.title}},superTypes:[]},Railroad:{name:qg.$type,properties:{accDescr:{name:qg.accDescr},accTitle:{name:qg.accTitle},rules:{name:qg.rules,defaultValue:[]},title:{name:qg.title}},superTypes:[]},RailroadAbnf:{name:Vg.$type,properties:{accDescr:{name:Vg.accDescr},accTitle:{name:Vg.accTitle},rules:{name:Vg.rules,defaultValue:[]},title:{name:Vg.title}},superTypes:[]},RailroadChoiceExpr:{name:Fpe.$type,properties:{alternatives:{name:Fpe.alternatives,defaultValue:[]}},superTypes:[cu.$type]},RailroadEbnf:{name:Wg.$type,properties:{accDescr:{name:Wg.accDescr},accTitle:{name:Wg.accTitle},rules:{name:Wg.rules,defaultValue:[]},title:{name:Wg.title}},superTypes:[]},RailroadExpression:{name:cu.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:zpe.$type,properties:{name:{name:zpe.name}},superTypes:[cu.$type]},RailroadOneOrMoreExpr:{name:Gpe.$type,properties:{element:{name:Gpe.element}},superTypes:[cu.$type]},RailroadOptionalExpr:{name:qpe.$type,properties:{element:{name:qpe.element}},superTypes:[cu.$type]},RailroadPeg:{name:Ug.$type,properties:{accDescr:{name:Ug.accDescr},accTitle:{name:Ug.accTitle},rules:{name:Ug.rules,defaultValue:[]},title:{name:Ug.title}},superTypes:[]},RailroadRule:{name:FO.$type,properties:{definition:{name:FO.definition},name:{name:FO.name}},superTypes:[]},RailroadSequenceExpr:{name:Vpe.$type,properties:{elements:{name:Vpe.elements,defaultValue:[]}},superTypes:[cu.$type]},RailroadSpecialExpr:{name:Wpe.$type,properties:{text:{name:Wpe.text}},superTypes:[cu.$type]},RailroadTerminalExpr:{name:Upe.$type,properties:{value:{name:Upe.value}},superTypes:[cu.$type]},RailroadZeroOrMoreExpr:{name:Hpe.$type,properties:{element:{name:Hpe.element}},superTypes:[cu.$type]},Section:{name:zO.$type,properties:{classSelector:{name:zO.classSelector},name:{name:zO.name}},superTypes:[PT.$type]},Service:{name:Hg.$type,properties:{icon:{name:Hg.icon},iconText:{name:Hg.iconText},id:{name:Hg.id},in:{name:Hg.in},title:{name:Hg.title}},superTypes:[]},Size:{name:GO.$type,properties:{height:{name:GO.height},width:{name:GO.width}},superTypes:[]},Statement:{name:Yg.$type,properties:{},superTypes:[]},Transition:{name:zT.$type,properties:{from:{name:zT.from},label:{name:zT.label},to:{name:zT.to}},superTypes:[]},TreeNode:{name:Kg.$type,properties:{classAnnotation:{name:Kg.classAnnotation},descAnnotation:{name:Kg.descAnnotation},iconAnnotation:{name:Kg.iconAnnotation},indent:{name:Kg.indent},name:{name:Kg.name}},superTypes:[]},TreeView:{name:GT.$type,properties:{accDescr:{name:GT.accDescr},accTitle:{name:GT.accTitle},nodes:{name:GT.nodes,defaultValue:[]},title:{name:GT.title}},superTypes:[]},Treemap:{name:Xg.$type,properties:{accDescr:{name:Xg.accDescr},accTitle:{name:Xg.accTitle},title:{name:Xg.title},TreemapRows:{name:Xg.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:qO.$type,properties:{indent:{name:qO.indent},item:{name:qO.item}},superTypes:[]},Wardley:{name:xa.$type,properties:{accDescr:{name:xa.accDescr},accelerators:{name:xa.accelerators,defaultValue:[]},accTitle:{name:xa.accTitle},anchors:{name:xa.anchors,defaultValue:[]},annotation:{name:xa.annotation,defaultValue:[]},annotations:{name:xa.annotations,defaultValue:[]},components:{name:xa.components,defaultValue:[]},deaccelerators:{name:xa.deaccelerators,defaultValue:[]},evolution:{name:xa.evolution},evolves:{name:xa.evolves,defaultValue:[]},links:{name:xa.links,defaultValue:[]},notes:{name:xa.notes,defaultValue:[]},pipelines:{name:xa.pipelines,defaultValue:[]},size:{name:xa.size},title:{name:xa.title}},superTypes:[]}}}},E(Zy,"MermaidAstReflection"),Zy),gi=new Ype,Xpe,sit=E(()=>Xpe??(Xpe=aa(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),Kpe,oit=E(()=>Kpe??(Kpe=aa(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),jpe,lit=E(()=>jpe??(jpe=aa('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),Zpe,cit=E(()=>Zpe??(Zpe=aa(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),Qpe,uit=E(()=>Qpe??(Qpe=aa(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),Jpe,hit=E(()=>Jpe??(Jpe=aa(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),e0e,dit=E(()=>e0e??(e0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),t0e,fit=E(()=>t0e??(t0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),r0e,pit=E(()=>r0e??(r0e=aa('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),n0e,git=E(()=>n0e??(n0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),i0e,mit=E(()=>i0e??(i0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),a0e,yit=E(()=>a0e??(a0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),s0e,vit=E(()=>s0e??(s0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),o0e,bit=E(()=>o0e??(o0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),l0e,xit=E(()=>l0e??(l0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),Tit={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},wit={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Cit={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},kit={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Eit={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Sit={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Ait={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},_it={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Rit={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Lit={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Iit={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Dit={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Mit={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Nit={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Oit={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},cs={AstReflection:E(()=>new Ype,"AstReflection")},$it={Grammar:E(()=>sit(),"Grammar"),LanguageMetaData:E(()=>Tit,"LanguageMetaData"),parser:{}},Pit={Grammar:E(()=>oit(),"Grammar"),LanguageMetaData:E(()=>wit,"LanguageMetaData"),parser:{}},Bit={Grammar:E(()=>lit(),"Grammar"),LanguageMetaData:E(()=>Cit,"LanguageMetaData"),parser:{}},Fit={Grammar:E(()=>cit(),"Grammar"),LanguageMetaData:E(()=>kit,"LanguageMetaData"),parser:{}},zit={Grammar:E(()=>uit(),"Grammar"),LanguageMetaData:E(()=>Eit,"LanguageMetaData"),parser:{}},Git={Grammar:E(()=>hit(),"Grammar"),LanguageMetaData:E(()=>Sit,"LanguageMetaData"),parser:{}},qit={Grammar:E(()=>dit(),"Grammar"),LanguageMetaData:E(()=>Ait,"LanguageMetaData"),parser:{}},Vit={Grammar:E(()=>fit(),"Grammar"),LanguageMetaData:E(()=>_it,"LanguageMetaData"),parser:{}},Wit={Grammar:E(()=>pit(),"Grammar"),LanguageMetaData:E(()=>Rit,"LanguageMetaData"),parser:{}},Uit={Grammar:E(()=>git(),"Grammar"),LanguageMetaData:E(()=>Lit,"LanguageMetaData"),parser:{}},Hit={Grammar:E(()=>mit(),"Grammar"),LanguageMetaData:E(()=>Iit,"LanguageMetaData"),parser:{}},Yit={Grammar:E(()=>yit(),"Grammar"),LanguageMetaData:E(()=>Dit,"LanguageMetaData"),parser:{}},Xit={Grammar:E(()=>vit(),"Grammar"),LanguageMetaData:E(()=>Mit,"LanguageMetaData"),parser:{}},Kit={Grammar:E(()=>bit(),"Grammar"),LanguageMetaData:E(()=>Nit,"LanguageMetaData"),parser:{}},jit={Grammar:E(()=>xit(),"Grammar"),LanguageMetaData:E(()=>Oit,"LanguageMetaData"),parser:{}},Zit=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,Qit=/accTitle[\t ]*:([^\n\r]*)/,Jit=/title([\t ][^\n\r]*|)/,eat={ACC_DESCR:Zit,ACC_TITLE:Qit,TITLE:Jit},rc=(Qy=class extends LN{runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){const i=eat[e.name];if(i===void 0)return;const a=i.exec(r);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` +`)}}},E(Qy,"AbstractMermaidValueConverter"),Qy),jg=(Jy=class extends rc{runCustomConverter(e,r,n){}},E(Jy,"CommonValueConverter"),Jy),us=(ev=class extends RE{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const i=super.buildKeywordTokens(e,r,n);return i.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},E(ev,"AbstractMermaidTokenBuilder"),ev);tv=class extends us{},E(tv,"CommonTokenBuilder");/*! Bundled license information: lodash-es/lodash.js: (** @@ -1334,13 +1334,13 @@ ${r}`),this.inline?`{${i}}`:i}},E(Oy,"JSDocTagImpl"),Oy);function Vfe(t,e,r){var * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors *) - */var qit=(tv=class extends us{constructor(){super(["radar-beta"])}},E(tv,"RadarTokenBuilder"),tv),npe={parser:{TokenBuilder:E(()=>new qit,"TokenBuilder"),ValueConverter:E(()=>new Kg,"ValueConverter")}};function ipe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Lit,npe);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}E(ipe,"createRadarServices");var Vit=(rv=class extends us{constructor(){super(["railroad-beta"])}},E(rv,"RailroadTokenBuilder"),rv),ape=E(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Vit,"TokenBuilder"),ValueConverter:E(()=>new Wit,"ValueConverter")}};function ope(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Mit,spe);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}E(ope,"createRailroadServices");var Uit=(iv=class extends us{constructor(){super(["railroad-ebnf-beta"])}},E(iv,"RailroadEbnfTokenBuilder"),iv),lpe=E(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Uit,"TokenBuilder"),ValueConverter:E(()=>new Hit,"ValueConverter")}};function upe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Dit,cpe);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}E(upe,"createRailroadEbnfServices");var Yit=(sv=class extends us{constructor(){super(["railroad-abnf-beta"])}},E(sv,"RailroadAbnfTokenBuilder"),sv),Xit=(ov=class extends rc{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const a=i.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return a.slice(1,-1)}return i}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},E(ov,"RailroadAbnfValueConverter"),ov),hpe={parser:{TokenBuilder:E(()=>new Yit,"TokenBuilder"),ValueConverter:E(()=>new Xit,"ValueConverter")}};function dpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Iit,hpe);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}E(dpe,"createRailroadAbnfServices");var Kit=(lv=class extends us{constructor(){super(["railroad-peg-beta"])}},E(lv,"RailroadPegTokenBuilder"),lv),fpe=E(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Kit,"TokenBuilder"),ValueConverter:E(()=>new jit,"ValueConverter")}};function gpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Nit,ppe);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}E(gpe,"createRailroadPegServices");var Zit=(uv=class extends us{constructor(){super(["treemap"])}},E(uv,"TreemapTokenBuilder"),uv),Qit=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,Jit=(hv=class extends rc{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=Qit.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},E(hv,"TreemapValueConverter"),hv);function mpe(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}E(mpe,"registerValidationChecks");var eat=(dv=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},E(dv,"TreemapValidator"),dv),ype={parser:{TokenBuilder:E(()=>new Zit,"TokenBuilder"),ValueConverter:E(()=>new Jit,"ValueConverter")},validation:{TreemapValidator:E(()=>new eat,"TreemapValidator")}};function vpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Oit,ype);return e.ServiceRegistry.register(r),mpe(r),{shared:e,Treemap:r}}E(vpe,"createTreemapServices");var tat=(fv=class extends rc{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},E(fv,"WardleyValueConverter"),fv),bpe={parser:{ValueConverter:E(()=>new tat,"ValueConverter")}};function xpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Pit,bpe);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}E(xpe,"createWardleyServices");var rat=(pv=class extends us{constructor(){super(["cynefin-beta"])}},E(pv,"CynefinTokenBuilder"),pv),Tpe={parser:{TokenBuilder:E(()=>new rat,"TokenBuilder"),ValueConverter:E(()=>new Kg,"ValueConverter")}};function wpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),kit,Tpe);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}E(wpe,"createCynefinServices");var nat=(gv=class extends us{constructor(){super(["gitGraph"])}},E(gv,"GitGraphTokenBuilder"),gv),Cpe={parser:{TokenBuilder:E(()=>new nat,"TokenBuilder"),ValueConverter:E(()=>new Kg,"ValueConverter")}};function kpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Sit,Cpe);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}E(kpe,"createGitGraphServices");var iat=(mv=class extends us{constructor(){super(["info","showInfo"])}},E(mv,"InfoTokenBuilder"),mv),Epe={parser:{TokenBuilder:E(()=>new iat,"TokenBuilder"),ValueConverter:E(()=>new Kg,"ValueConverter")}};function Spe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Ait,Epe);return e.ServiceRegistry.register(r),{shared:e,Info:r}}E(Spe,"createInfoServices");var aat=(yv=class extends us{constructor(){super(["packet"])}},E(yv,"PacketTokenBuilder"),yv),Ape={parser:{TokenBuilder:E(()=>new aat,"TokenBuilder"),ValueConverter:E(()=>new Kg,"ValueConverter")}};function _pe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),_it,Ape);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}E(_pe,"createPacketServices");var sat=(vv=class extends us{constructor(){super(["pie","showData"])}},E(vv,"PieTokenBuilder"),vv),oat=(bv=class extends rc{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},E(bv,"PieValueConverter"),bv),Rpe={parser:{TokenBuilder:E(()=>new sat,"TokenBuilder"),ValueConverter:E(()=>new oat,"ValueConverter")}};function Lpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Rit,Rpe);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}E(Lpe,"createPieServices");var lat=(xv=class extends rc{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const i=r.trim();return i.substring(5,i.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},E(xv,"TreeViewValueConverter"),xv),cat=(Tv=class extends us{constructor(){super(["treeView-beta"])}},E(Tv,"TreeViewTokenBuilder"),Tv),Ipe={parser:{TokenBuilder:E(()=>new cat,"TokenBuilder"),ValueConverter:E(()=>new lat,"ValueConverter")}};function Dpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),$it,Ipe);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}E(Dpe,"createTreeViewServices");var uat=(wv=class extends us{constructor(){super(["architecture"])}},E(wv,"ArchitectureTokenBuilder"),wv),hat=(Cv=class extends rc{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},E(Cv,"ArchitectureValueConverter"),Cv),Mpe={parser:{TokenBuilder:E(()=>new uat,"TokenBuilder"),ValueConverter:E(()=>new hat,"ValueConverter")}};function Npe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Cit,Mpe);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}E(Npe,"createArchitectureServices");var dat=(kv=class extends us{constructor(){super(["eventmodeling"])}},E(kv,"EventModelingTokenBuilder"),kv),Ope=new Set(["cmd","command"]),$pe=new Set(["evt","event"]),BO=new Set(["rmo","readmodel"]),Ppe=new Set(["pcr","processor"]),Bpe=new Set(["ui"]);function Fpe(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}E(Fpe,"registerValidationChecks");var fat=(Ev=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(Ope.has(e.modelEntityType)?this.validateSources(e,new Set([...Bpe,...Ppe]),"command","ui or processor",r):$pe.has(e.modelEntityType)?this.validateSources(e,Ope,"event","command",r):BO.has(e.modelEntityType)?this.validateSources(e,$pe,"read model","event",r):Ppe.has(e.modelEntityType)?this.validateSources(e,BO,"processor","read model",r):Bpe.has(e.modelEntityType)&&this.validateSources(e,BO,"ui","read model",r))}validateSources(e,r,n,i,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!r.has(o.modelEntityType)&&a("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},E(Ev,"EventModelingValidator"),Ev),zpe={parser:{TokenBuilder:E(()=>new dat,"TokenBuilder"),ValueConverter:E(()=>new Kg,"ValueConverter")},validation:{EventModelingValidator:E(()=>new fat,"EventModelingValidator")}};function Gpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Eit,zpe);return e.ServiceRegistry.register(r),Fpe(r),{shared:e,EventModel:r}}E(Gpe,"createEventModelingServices");var Ta={},pat={info:E(async()=>{const{createInfoServices:t}=await Promise.resolve().then(()=>Amt),e=t().Info.parser.LangiumParser;Ta.info=e},"info"),packet:E(async()=>{const{createPacketServices:t}=await Promise.resolve().then(()=>_mt),e=t().Packet.parser.LangiumParser;Ta.packet=e},"packet"),pie:E(async()=>{const{createPieServices:t}=await Promise.resolve().then(()=>Rmt),e=t().Pie.parser.LangiumParser;Ta.pie=e},"pie"),treeView:E(async()=>{const{createTreeViewServices:t}=await Promise.resolve().then(()=>Lmt),e=t().TreeView.parser.LangiumParser;Ta.treeView=e},"treeView"),architecture:E(async()=>{const{createArchitectureServices:t}=await Promise.resolve().then(()=>Imt),e=t().Architecture.parser.LangiumParser;Ta.architecture=e},"architecture"),gitGraph:E(async()=>{const{createGitGraphServices:t}=await Promise.resolve().then(()=>Dmt),e=t().GitGraph.parser.LangiumParser;Ta.gitGraph=e},"gitGraph"),eventmodeling:E(async()=>{const{createEventModelingServices:t}=await Promise.resolve().then(()=>Mmt),e=t().EventModel.parser.LangiumParser;Ta.eventmodeling=e},"eventmodeling"),radar:E(async()=>{const{createRadarServices:t}=await Promise.resolve().then(()=>Nmt),e=t().Radar.parser.LangiumParser;Ta.radar=e},"radar"),railroad:E(async()=>{const{createRailroadServices:t}=await Promise.resolve().then(()=>Omt),e=t().Railroad.parser.LangiumParser;Ta.railroad=e},"railroad"),railroadEbnf:E(async()=>{const{createRailroadEbnfServices:t}=await Promise.resolve().then(()=>$mt),e=t().RailroadEbnf.parser.LangiumParser;Ta.railroadEbnf=e},"railroadEbnf"),railroadAbnf:E(async()=>{const{createRailroadAbnfServices:t}=await Promise.resolve().then(()=>Pmt),e=t().RailroadAbnf.parser.LangiumParser;Ta.railroadAbnf=e},"railroadAbnf"),railroadPeg:E(async()=>{const{createRailroadPegServices:t}=await Promise.resolve().then(()=>Bmt),e=t().RailroadPeg.parser.LangiumParser;Ta.railroadPeg=e},"railroadPeg"),treemap:E(async()=>{const{createTreemapServices:t}=await Promise.resolve().then(()=>Fmt),e=t().Treemap.parser.LangiumParser;Ta.treemap=e},"treemap"),wardley:E(async()=>{const{createWardleyServices:t}=await Promise.resolve().then(()=>zmt),e=t().Wardley.parser.LangiumParser;Ta.wardley=e},"wardley"),cynefin:E(async()=>{const{createCynefinServices:t}=await Promise.resolve().then(()=>Gmt),e=t().Cynefin.parser.LangiumParser;Ta.cynefin=e},"cynefin")};async function Qo(t,e){const r=pat[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Ta[t]||await r();const i=Ta[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new gat(i);return i.value}E(Qo,"parse");var gat=(Sv=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",s=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${s}: ${i.message}`}).join(` + */var tat=(rv=class extends us{constructor(){super(["radar-beta"])}},E(rv,"RadarTokenBuilder"),rv),c0e={parser:{TokenBuilder:E(()=>new tat,"TokenBuilder"),ValueConverter:E(()=>new jg,"ValueConverter")}};function u0e(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Vit,c0e);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}E(u0e,"createRadarServices");var rat=(nv=class extends us{constructor(){super(["railroad-beta"])}},E(nv,"RailroadTokenBuilder"),nv),h0e=E(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew rat,"TokenBuilder"),ValueConverter:E(()=>new nat,"ValueConverter")}};function f0e(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Hit,d0e);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}E(f0e,"createRailroadServices");var iat=(av=class extends us{constructor(){super(["railroad-ebnf-beta"])}},E(av,"RailroadEbnfTokenBuilder"),av),p0e=E(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew iat,"TokenBuilder"),ValueConverter:E(()=>new aat,"ValueConverter")}};function m0e(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Uit,g0e);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}E(m0e,"createRailroadEbnfServices");var sat=(ov=class extends us{constructor(){super(["railroad-abnf-beta"])}},E(ov,"RailroadAbnfTokenBuilder"),ov),oat=(lv=class extends rc{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const a=i.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return a.slice(1,-1)}return i}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},E(lv,"RailroadAbnfValueConverter"),lv),y0e={parser:{TokenBuilder:E(()=>new sat,"TokenBuilder"),ValueConverter:E(()=>new oat,"ValueConverter")}};function v0e(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Wit,y0e);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}E(v0e,"createRailroadAbnfServices");var lat=(cv=class extends us{constructor(){super(["railroad-peg-beta"])}},E(cv,"RailroadPegTokenBuilder"),cv),b0e=E(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew lat,"TokenBuilder"),ValueConverter:E(()=>new cat,"ValueConverter")}};function T0e(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Yit,x0e);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}E(T0e,"createRailroadPegServices");var uat=(hv=class extends us{constructor(){super(["treemap"])}},E(hv,"TreemapTokenBuilder"),hv),hat=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,dat=(dv=class extends rc{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=hat.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},E(dv,"TreemapValueConverter"),dv);function w0e(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}E(w0e,"registerValidationChecks");var fat=(fv=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},E(fv,"TreemapValidator"),fv),C0e={parser:{TokenBuilder:E(()=>new uat,"TokenBuilder"),ValueConverter:E(()=>new dat,"ValueConverter")},validation:{TreemapValidator:E(()=>new fat,"TreemapValidator")}};function k0e(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Xit,C0e);return e.ServiceRegistry.register(r),w0e(r),{shared:e,Treemap:r}}E(k0e,"createTreemapServices");var pat=(pv=class extends rc{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},E(pv,"WardleyValueConverter"),pv),E0e={parser:{ValueConverter:E(()=>new pat,"ValueConverter")}};function S0e(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),jit,E0e);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}E(S0e,"createWardleyServices");var gat=(gv=class extends us{constructor(){super(["cynefin-beta"])}},E(gv,"CynefinTokenBuilder"),gv),A0e={parser:{TokenBuilder:E(()=>new gat,"TokenBuilder"),ValueConverter:E(()=>new jg,"ValueConverter")}};function _0e(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Pit,A0e);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}E(_0e,"createCynefinServices");var mat=(mv=class extends us{constructor(){super(["gitGraph"])}},E(mv,"GitGraphTokenBuilder"),mv),R0e={parser:{TokenBuilder:E(()=>new mat,"TokenBuilder"),ValueConverter:E(()=>new jg,"ValueConverter")}};function L0e(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Fit,R0e);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}E(L0e,"createGitGraphServices");var yat=(yv=class extends us{constructor(){super(["info","showInfo"])}},E(yv,"InfoTokenBuilder"),yv),I0e={parser:{TokenBuilder:E(()=>new yat,"TokenBuilder"),ValueConverter:E(()=>new jg,"ValueConverter")}};function D0e(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),zit,I0e);return e.ServiceRegistry.register(r),{shared:e,Info:r}}E(D0e,"createInfoServices");var vat=(vv=class extends us{constructor(){super(["packet"])}},E(vv,"PacketTokenBuilder"),vv),M0e={parser:{TokenBuilder:E(()=>new vat,"TokenBuilder"),ValueConverter:E(()=>new jg,"ValueConverter")}};function N0e(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Git,M0e);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}E(N0e,"createPacketServices");var bat=(bv=class extends us{constructor(){super(["pie","showData"])}},E(bv,"PieTokenBuilder"),bv),xat=(xv=class extends rc{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},E(xv,"PieValueConverter"),xv),O0e={parser:{TokenBuilder:E(()=>new bat,"TokenBuilder"),ValueConverter:E(()=>new xat,"ValueConverter")}};function $0e(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),qit,O0e);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}E($0e,"createPieServices");var Tat=(Tv=class extends rc{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const i=r.trim();return i.substring(5,i.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},E(Tv,"TreeViewValueConverter"),Tv),wat=(wv=class extends us{constructor(){super(["treeView-beta"])}},E(wv,"TreeViewTokenBuilder"),wv),P0e={parser:{TokenBuilder:E(()=>new wat,"TokenBuilder"),ValueConverter:E(()=>new Tat,"ValueConverter")}};function B0e(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Kit,P0e);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}E(B0e,"createTreeViewServices");var Cat=(Cv=class extends us{constructor(){super(["architecture"])}},E(Cv,"ArchitectureTokenBuilder"),Cv),kat=(kv=class extends rc{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},E(kv,"ArchitectureValueConverter"),kv),F0e={parser:{TokenBuilder:E(()=>new Cat,"TokenBuilder"),ValueConverter:E(()=>new kat,"ValueConverter")}};function z0e(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),$it,F0e);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}E(z0e,"createArchitectureServices");var Eat=(Ev=class extends us{constructor(){super(["eventmodeling"])}},E(Ev,"EventModelingTokenBuilder"),Ev),G0e=new Set(["cmd","command"]),q0e=new Set(["evt","event"]),VO=new Set(["rmo","readmodel"]),V0e=new Set(["pcr","processor"]),W0e=new Set(["ui"]);function U0e(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}E(U0e,"registerValidationChecks");var Sat=(Sv=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(G0e.has(e.modelEntityType)?this.validateSources(e,new Set([...W0e,...V0e]),"command","ui or processor",r):q0e.has(e.modelEntityType)?this.validateSources(e,G0e,"event","command",r):VO.has(e.modelEntityType)?this.validateSources(e,q0e,"read model","event",r):V0e.has(e.modelEntityType)?this.validateSources(e,VO,"processor","read model",r):W0e.has(e.modelEntityType)&&this.validateSources(e,VO,"ui","read model",r))}validateSources(e,r,n,i,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!r.has(o.modelEntityType)&&a("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},E(Sv,"EventModelingValidator"),Sv),H0e={parser:{TokenBuilder:E(()=>new Eat,"TokenBuilder"),ValueConverter:E(()=>new jg,"ValueConverter")},validation:{EventModelingValidator:E(()=>new Sat,"EventModelingValidator")}};function Y0e(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Bit,H0e);return e.ServiceRegistry.register(r),U0e(r),{shared:e,EventModel:r}}E(Y0e,"createEventModelingServices");var Ta={},Aat={info:E(async()=>{const{createInfoServices:t}=await Promise.resolve().then(()=>zmt),e=t().Info.parser.LangiumParser;Ta.info=e},"info"),packet:E(async()=>{const{createPacketServices:t}=await Promise.resolve().then(()=>Gmt),e=t().Packet.parser.LangiumParser;Ta.packet=e},"packet"),pie:E(async()=>{const{createPieServices:t}=await Promise.resolve().then(()=>qmt),e=t().Pie.parser.LangiumParser;Ta.pie=e},"pie"),treeView:E(async()=>{const{createTreeViewServices:t}=await Promise.resolve().then(()=>Vmt),e=t().TreeView.parser.LangiumParser;Ta.treeView=e},"treeView"),architecture:E(async()=>{const{createArchitectureServices:t}=await Promise.resolve().then(()=>Wmt),e=t().Architecture.parser.LangiumParser;Ta.architecture=e},"architecture"),gitGraph:E(async()=>{const{createGitGraphServices:t}=await Promise.resolve().then(()=>Umt),e=t().GitGraph.parser.LangiumParser;Ta.gitGraph=e},"gitGraph"),eventmodeling:E(async()=>{const{createEventModelingServices:t}=await Promise.resolve().then(()=>Hmt),e=t().EventModel.parser.LangiumParser;Ta.eventmodeling=e},"eventmodeling"),radar:E(async()=>{const{createRadarServices:t}=await Promise.resolve().then(()=>Ymt),e=t().Radar.parser.LangiumParser;Ta.radar=e},"radar"),railroad:E(async()=>{const{createRailroadServices:t}=await Promise.resolve().then(()=>Xmt),e=t().Railroad.parser.LangiumParser;Ta.railroad=e},"railroad"),railroadEbnf:E(async()=>{const{createRailroadEbnfServices:t}=await Promise.resolve().then(()=>Kmt),e=t().RailroadEbnf.parser.LangiumParser;Ta.railroadEbnf=e},"railroadEbnf"),railroadAbnf:E(async()=>{const{createRailroadAbnfServices:t}=await Promise.resolve().then(()=>jmt),e=t().RailroadAbnf.parser.LangiumParser;Ta.railroadAbnf=e},"railroadAbnf"),railroadPeg:E(async()=>{const{createRailroadPegServices:t}=await Promise.resolve().then(()=>Zmt),e=t().RailroadPeg.parser.LangiumParser;Ta.railroadPeg=e},"railroadPeg"),treemap:E(async()=>{const{createTreemapServices:t}=await Promise.resolve().then(()=>Qmt),e=t().Treemap.parser.LangiumParser;Ta.treemap=e},"treemap"),wardley:E(async()=>{const{createWardleyServices:t}=await Promise.resolve().then(()=>Jmt),e=t().Wardley.parser.LangiumParser;Ta.wardley=e},"wardley"),cynefin:E(async()=>{const{createCynefinServices:t}=await Promise.resolve().then(()=>e1t),e=t().Cynefin.parser.LangiumParser;Ta.cynefin=e},"cynefin")};async function Qo(t,e){const r=Aat[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Ta[t]||await r();const i=Ta[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new _at(i);return i.value}E(Qo,"parse");var _at=(Av=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",s=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${s}: ${i.message}`}).join(` `),n=e.parserErrors.map(i=>{const a=i.token.startLine!==void 0&&!isNaN(i.token.startLine)?i.token.startLine:"?",s=i.token.startColumn!==void 0&&!isNaN(i.token.startColumn)?i.token.startColumn:"?";return`Parse error on line ${a}, column ${s}: ${i.message}`}).join(` -`);super(`Parsing failed: ${r} ${n}`),this.result=e}},E(Sv,"MermaidParseError"),Sv),bn={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},mat=Fr.gitGraph,Kf=x(()=>ti({...mat,...lr().gitGraph}),"getConfig"),qt=new wI(()=>{const t=Kf(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function aS(){return cV({length:7})}x(aS,"getID");function qpe(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const a=e(i);return r[a]||(r[a]=!0,n.push(i)),n},[])}x(qpe,"uniqBy");var yat=x(function(t){qt.records.direction=t},"setDirection"),vat=x(function(t){ae.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{qt.records.options=JSON.parse(t)}catch(e){ae.error("error while parsing gitGraph options",e.message)}},"setOptions"),bat=x(function(){return qt.records.options},"getOptions"),xat=x(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;ae.info("commit",e,r,n,i),ae.debug("Entering commit:",e,r,n,i);const a=Kf();r=Lt.sanitizeText(r,a),e=Lt.sanitizeText(e,a),i=i==null?void 0:i.map(o=>Lt.sanitizeText(o,a));const s={id:r||qt.records.seq+"-"+aS(),message:e,seq:qt.records.seq++,type:n??bn.NORMAL,tags:i??[],parents:qt.records.head==null?[]:[qt.records.head.id],branch:qt.records.currBranch};qt.records.head=s,ae.info("main branch",a.mainBranchName),qt.records.commits.has(s.id)&&ae.warn(`Commit ID ${s.id} already exists`),qt.records.commits.set(s.id,s),qt.records.branches.set(qt.records.currBranch,s.id),ae.debug("in pushCommit "+s.id)},"commit"),Tat=x(function(t){let e=t.name;const r=t.order;if(e=Lt.sanitizeText(e,Kf()),qt.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);qt.records.branches.set(e,qt.records.head!=null?qt.records.head.id:null),qt.records.branchConfig.set(e,{name:e,order:r}),Vpe(e),ae.debug("in createBranch")},"branch"),wat=x(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=Kf();e=Lt.sanitizeText(e,a),r&&(r=Lt.sanitizeText(r,a));const s=qt.records.branches.get(qt.records.currBranch),o=qt.records.branches.get(e),l=s?qt.records.commits.get(s):void 0,u=o?qt.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(qt.records.currBranch===e){const f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(l===void 0||!l){const f=new Error(`Incorrect usage of "merge". Current branch (${qt.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!qt.records.branches.has(e)){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},f}if(u===void 0||!u){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},f}if(l===u){const f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(r&&qt.records.commits.has(r)){const f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,token:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i==null?void 0:i.join(" ")}`]},f}const h=o||"",d={id:r||`${qt.records.seq}-${aS()}`,message:`merged branch ${e} into ${qt.records.currBranch}`,seq:qt.records.seq++,parents:qt.records.head==null?[]:[qt.records.head.id,h],branch:qt.records.currBranch,type:bn.MERGE,customType:n,customId:!!r,tags:i??[]};qt.records.head=d,qt.records.commits.set(d.id,d),qt.records.branches.set(qt.records.currBranch,d.id),ae.debug(qt.records.branches),ae.debug("in mergeBranch")},"merge"),Cat=x(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;ae.debug("Entering cherryPick:",e,r,n);const a=Kf();if(e=Lt.sanitizeText(e,a),r=Lt.sanitizeText(r,a),n=n==null?void 0:n.map(l=>Lt.sanitizeText(l,a)),i=Lt.sanitizeText(i,a),!e||!qt.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},l}const s=qt.records.commits.get(e);if(s===void 0||!s)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(s.parents)&&s.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=s.branch;if(s.type===bn.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!qt.records.commits.has(r)){if(o===qt.records.currBranch){const d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const l=qt.records.branches.get(qt.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${qt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=qt.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${qt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:qt.records.seq+"-"+aS(),message:`cherry-picked ${s==null?void 0:s.message} into ${qt.records.currBranch}`,seq:qt.records.seq++,parents:qt.records.head==null?[]:[qt.records.head.id,s.id],branch:qt.records.currBranch,type:bn.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===bn.MERGE?`|parent:${i}`:""}`]};qt.records.head=h,qt.records.commits.set(h.id,h),qt.records.branches.set(qt.records.currBranch,h.id),ae.debug(qt.records.branches),ae.debug("in cherryPick")}},"cherryPick"),Vpe=x(function(t){if(t=Lt.sanitizeText(t,Kf()),qt.records.branches.has(t)){qt.records.currBranch=t;const e=qt.records.branches.get(qt.records.currBranch);e===void 0||!e?qt.records.head=null:qt.records.head=qt.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function FO(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}x(FO,"upsert");function zO(t){const e=t.reduce((i,a)=>i.seq>a.seq?i:a,t[0]);let r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(const i in qt.records.branches)qt.records.branches.get(i)===e.id&&n.push(i);if(ae.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=qt.records.commits.get(e.parents[0]);FO(t,e,i),e.parents[1]&&t.push(qt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=qt.records.commits.get(e.parents[0]);FO(t,e,i)}}t=qpe(t,i=>i.id),zO(t)}x(zO,"prettyPrintCommitHistory");var kat=x(function(){ae.debug(qt.records.commits);const t=Wpe()[0];zO([t])},"prettyPrint"),Eat=x(function(){qt.reset(),In()},"clear"),Sat=x(function(){return[...qt.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),Aat=x(function(){return qt.records.branches},"getBranches"),_at=x(function(){return qt.records.commits},"getCommits"),Wpe=x(function(){const t=[...qt.records.commits.values()];return t.forEach(function(e){ae.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),Rat=x(function(){return qt.records.currBranch},"getCurrentBranch"),Lat=x(function(){return qt.records.direction},"getDirection"),Iat=x(function(){return qt.records.head},"getHead"),Upe={commitType:bn,getConfig:Kf,setDirection:yat,setOptions:vat,getOptions:bat,commit:xat,branch:Tat,merge:wat,cherryPick:Cat,checkout:Vpe,prettyPrint:kat,clear:Eat,getBranchesAsObjArray:Sat,getBranches:Aat,getCommits:_at,getCommitsArray:Wpe,getCurrentBranch:Rat,getDirection:Lat,getHead:Iat,setAccTitle:Dn,getAccTitle:Fn,getAccDescription:Gn,setAccDescription:zn,setDiagramTitle:qn,getDiagramTitle:Mn},Dat=x((t,e)=>{zl(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)Mat(r,e)},"populate"),Mat=x((t,e)=>{const n={Commit:x(i=>e.commit(Nat(i)),"Commit"),Branch:x(i=>e.branch(Oat(i)),"Branch"),Merge:x(i=>e.merge($at(i)),"Merge"),Checkout:x(i=>e.checkout(Pat(i)),"Checkout"),CherryPicking:x(i=>e.cherryPick(Bat(i)),"CherryPicking")}[t.$type];n?n(t):ae.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Nat=x(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?bn[t.type]:bn.NORMAL,tags:t.tags??void 0}),"parseCommit"),Oat=x(t=>({name:t.name,order:t.order??0}),"parseBranch"),$at=x(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?bn[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Pat=x(t=>t.branch,"parseCheckout"),Bat=x(t=>{var r;return{id:t.id,targetId:"",tags:((r=t.tags)==null?void 0:r.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),Fat={parse:x(async t=>{const e=await Qo("gitGraph",t);ae.debug(e),Dat(e,Upe)},"parse")},Rh=10,Lh=40,nc=4,uu=2,jf=8,sS=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),GO=12,qO=new Set(["redux-color","redux-dark-color"]),zat=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Zf=x((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),Ls=new Map,Is=new Map,oS=30,zT=new Map,lS=[],hu=0,Gr="LR",Gat=x(()=>{Ls.clear(),Is.clear(),zT.clear(),hu=0,lS=[],Gr="LR"},"clear"),Hpe=x(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),Ype=x(t=>{let e,r,n;return Gr==="BT"?(r=x((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=x((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{var s,o;const a=Gr==="TB"||Gr=="BT"?(s=Is.get(i))==null?void 0:s.y:(o=Is.get(i))==null?void 0:o.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),qat=x(t=>{let e="",r=1/0;return t.forEach(n=>{const i=Is.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),Vat=x((t,e,r)=>{let n=r,i=r;const a=[];t.forEach(s=>{const o=e.get(s);if(!o)throw new Error(`Commit not found for key ${s}`);o.parents.length?(n=Uat(o),i=Math.max(n,i)):a.push(o),Hat(o,n)}),n=i,a.forEach(s=>{Yat(s,n,r)}),t.forEach(s=>{const o=e.get(s);if(o!=null&&o.parents.length){const l=qat(o.parents);n=Is.get(l).y-Lh,n<=i&&(i=n);const u=Ls.get(o.branch).pos,h=n-Rh;Is.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),Wat=x(t=>{var n;const e=Ype(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=Is.get(e))==null?void 0:n.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),Uat=x(t=>Wat(t)+Lh,"calculateCommitPosition"),Hat=x((t,e)=>{const r=Ls.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+Rh;return Is.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),Yat=x((t,e,r)=>{const n=Ls.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;Is.set(t.id,{x:a,y:i})},"setRootPosition"),Xat=x((t,e,r,n,i,a)=>{const{theme:s}=Pe(),o=sS.has(s??""),l=qO.has(s??""),u=zat.has(s??"");if(a===bn.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(o?3:0)).attr("y",r.y-10+(o?3:0)).attr("width",o?14:20).attr("height",o?14:20).attr("class",`commit ${e.id} commit-highlight${Zf(i,jf,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(o?2:0)).attr("y",r.y-6+(o?2:0)).attr("width",o?8:12).attr("height",o?8:12).attr("class",`commit ${e.id} commit${Zf(i,jf,l)} ${n}-inner`);else if(a===bn.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",o?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`);else{const h=t.append("circle");if(h.attr("cx",r.x),h.attr("cy",r.y),h.attr("r",o?7:10),h.attr("class",`commit ${e.id} commit${Zf(i,jf,l)}`),a===bn.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",o?5:6),d.attr("class",`commit ${n} ${e.id} commit${Zf(i,jf,l)}`)}if(a===bn.REVERSE){const d=t.append("path"),f=o?4:5;d.attr("d",`M ${r.x-f},${r.y-f}L${r.x+f},${r.y+f}M${r.x-f},${r.y+f}L${r.x+f},${r.y-f}`).attr("class",`commit ${n} ${e.id} commit${Zf(i,jf,l)}`)}}},"drawCommitBullet"),Kat=x((t,e,r,n,i)=>{var a;if(e.type!==bn.CHERRY_PICK&&(e.customId&&e.type===bn.MERGE||e.type!==bn.MERGE)&&i.showCommitLabel){const s=t.append("g"),o=s.insert("rect").attr("class","commit-label-bkg"),l=s.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),u=(a=l.node())==null?void 0:a.getBBox();if(u&&(o.attr("x",r.posWithOffset-u.width/2-uu).attr("y",r.y+13.5).attr("width",u.width+2*uu).attr("height",u.height+2*uu),Gr==="TB"||Gr==="BT"?(o.attr("x",r.x-(u.width+4*nc+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*nc)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(Gr==="TB"||Gr==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),o.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const h=-7.5-(u.width+10)/25*9.5,d=10+u.width/25*8.5;s.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),jat=x((t,e,r,n)=>{var i;if(e.tags.length>0){let a=0,s=0,o=0;const l=[];for(const u of e.tags.reverse()){const h=t.insert("polygon"),d=t.append("circle"),f=t.append("text").attr("y",r.y-16-a).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");s=Math.max(s,p.width),o=Math.max(o,p.height),f.attr("x",r.posWithOffset-p.width/2),l.push({tag:f,hole:d,rect:h,yOffset:a}),a+=20}for(const{tag:u,hole:h,rect:d,yOffset:f}of l){const p=o/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",` - ${n-s/2-nc/2},${g+uu} +`);super(`Parsing failed: ${r} ${n}`),this.result=e}},E(Av,"MermaidParseError"),Av),bn={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Rat=Fr.gitGraph,Kf=T(()=>ti({...Rat,...lr().gitGraph}),"getConfig"),qt=new AI(()=>{const t=Kf(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function lS(){return pV({length:7})}T(lS,"getID");function X0e(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const a=e(i);return r[a]||(r[a]=!0,n.push(i)),n},[])}T(X0e,"uniqBy");var Lat=T(function(t){qt.records.direction=t},"setDirection"),Iat=T(function(t){ae.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{qt.records.options=JSON.parse(t)}catch(e){ae.error("error while parsing gitGraph options",e.message)}},"setOptions"),Dat=T(function(){return qt.records.options},"getOptions"),Mat=T(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;ae.info("commit",e,r,n,i),ae.debug("Entering commit:",e,r,n,i);const a=Kf();r=Lt.sanitizeText(r,a),e=Lt.sanitizeText(e,a),i=i==null?void 0:i.map(o=>Lt.sanitizeText(o,a));const s={id:r||qt.records.seq+"-"+lS(),message:e,seq:qt.records.seq++,type:n??bn.NORMAL,tags:i??[],parents:qt.records.head==null?[]:[qt.records.head.id],branch:qt.records.currBranch};qt.records.head=s,ae.info("main branch",a.mainBranchName),qt.records.commits.has(s.id)&&ae.warn(`Commit ID ${s.id} already exists`),qt.records.commits.set(s.id,s),qt.records.branches.set(qt.records.currBranch,s.id),ae.debug("in pushCommit "+s.id)},"commit"),Nat=T(function(t){let e=t.name;const r=t.order;if(e=Lt.sanitizeText(e,Kf()),qt.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);qt.records.branches.set(e,qt.records.head!=null?qt.records.head.id:null),qt.records.branchConfig.set(e,{name:e,order:r}),K0e(e),ae.debug("in createBranch")},"branch"),Oat=T(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=Kf();e=Lt.sanitizeText(e,a),r&&(r=Lt.sanitizeText(r,a));const s=qt.records.branches.get(qt.records.currBranch),o=qt.records.branches.get(e),l=s?qt.records.commits.get(s):void 0,u=o?qt.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(qt.records.currBranch===e){const f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(l===void 0||!l){const f=new Error(`Incorrect usage of "merge". Current branch (${qt.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!qt.records.branches.has(e)){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},f}if(u===void 0||!u){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},f}if(l===u){const f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(r&&qt.records.commits.has(r)){const f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,token:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i==null?void 0:i.join(" ")}`]},f}const h=o||"",d={id:r||`${qt.records.seq}-${lS()}`,message:`merged branch ${e} into ${qt.records.currBranch}`,seq:qt.records.seq++,parents:qt.records.head==null?[]:[qt.records.head.id,h],branch:qt.records.currBranch,type:bn.MERGE,customType:n,customId:!!r,tags:i??[]};qt.records.head=d,qt.records.commits.set(d.id,d),qt.records.branches.set(qt.records.currBranch,d.id),ae.debug(qt.records.branches),ae.debug("in mergeBranch")},"merge"),$at=T(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;ae.debug("Entering cherryPick:",e,r,n);const a=Kf();if(e=Lt.sanitizeText(e,a),r=Lt.sanitizeText(r,a),n=n==null?void 0:n.map(l=>Lt.sanitizeText(l,a)),i=Lt.sanitizeText(i,a),!e||!qt.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},l}const s=qt.records.commits.get(e);if(s===void 0||!s)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(s.parents)&&s.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=s.branch;if(s.type===bn.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!qt.records.commits.has(r)){if(o===qt.records.currBranch){const d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const l=qt.records.branches.get(qt.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${qt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=qt.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${qt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:qt.records.seq+"-"+lS(),message:`cherry-picked ${s==null?void 0:s.message} into ${qt.records.currBranch}`,seq:qt.records.seq++,parents:qt.records.head==null?[]:[qt.records.head.id,s.id],branch:qt.records.currBranch,type:bn.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===bn.MERGE?`|parent:${i}`:""}`]};qt.records.head=h,qt.records.commits.set(h.id,h),qt.records.branches.set(qt.records.currBranch,h.id),ae.debug(qt.records.branches),ae.debug("in cherryPick")}},"cherryPick"),K0e=T(function(t){if(t=Lt.sanitizeText(t,Kf()),qt.records.branches.has(t)){qt.records.currBranch=t;const e=qt.records.branches.get(qt.records.currBranch);e===void 0||!e?qt.records.head=null:qt.records.head=qt.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function WO(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}T(WO,"upsert");function UO(t){const e=t.reduce((i,a)=>i.seq>a.seq?i:a,t[0]);let r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(const i in qt.records.branches)qt.records.branches.get(i)===e.id&&n.push(i);if(ae.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=qt.records.commits.get(e.parents[0]);WO(t,e,i),e.parents[1]&&t.push(qt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=qt.records.commits.get(e.parents[0]);WO(t,e,i)}}t=X0e(t,i=>i.id),UO(t)}T(UO,"prettyPrintCommitHistory");var Pat=T(function(){ae.debug(qt.records.commits);const t=j0e()[0];UO([t])},"prettyPrint"),Bat=T(function(){qt.reset(),In()},"clear"),Fat=T(function(){return[...qt.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),zat=T(function(){return qt.records.branches},"getBranches"),Gat=T(function(){return qt.records.commits},"getCommits"),j0e=T(function(){const t=[...qt.records.commits.values()];return t.forEach(function(e){ae.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),qat=T(function(){return qt.records.currBranch},"getCurrentBranch"),Vat=T(function(){return qt.records.direction},"getDirection"),Wat=T(function(){return qt.records.head},"getHead"),Z0e={commitType:bn,getConfig:Kf,setDirection:Lat,setOptions:Iat,getOptions:Dat,commit:Mat,branch:Nat,merge:Oat,cherryPick:$at,checkout:K0e,prettyPrint:Pat,clear:Bat,getBranchesAsObjArray:Fat,getBranches:zat,getCommits:Gat,getCommitsArray:j0e,getCurrentBranch:qat,getDirection:Vat,getHead:Wat,setAccTitle:Dn,getAccTitle:Fn,getAccDescription:Gn,setAccDescription:zn,setDiagramTitle:qn,getDiagramTitle:Mn},Uat=T((t,e)=>{zl(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)Hat(r,e)},"populate"),Hat=T((t,e)=>{const n={Commit:T(i=>e.commit(Yat(i)),"Commit"),Branch:T(i=>e.branch(Xat(i)),"Branch"),Merge:T(i=>e.merge(Kat(i)),"Merge"),Checkout:T(i=>e.checkout(jat(i)),"Checkout"),CherryPicking:T(i=>e.cherryPick(Zat(i)),"CherryPicking")}[t.$type];n?n(t):ae.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Yat=T(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?bn[t.type]:bn.NORMAL,tags:t.tags??void 0}),"parseCommit"),Xat=T(t=>({name:t.name,order:t.order??0}),"parseBranch"),Kat=T(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?bn[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),jat=T(t=>t.branch,"parseCheckout"),Zat=T(t=>{var r;return{id:t.id,targetId:"",tags:((r=t.tags)==null?void 0:r.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),Qat={parse:T(async t=>{const e=await Qo("gitGraph",t);ae.debug(e),Uat(e,Z0e)},"parse")},Rh=10,Lh=40,nc=4,uu=2,jf=8,cS=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),HO=12,YO=new Set(["redux-color","redux-dark-color"]),Jat=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Zf=T((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),Ls=new Map,Is=new Map,uS=30,qT=new Map,hS=[],hu=0,Gr="LR",est=T(()=>{Ls.clear(),Is.clear(),qT.clear(),hu=0,hS=[],Gr="LR"},"clear"),Q0e=T(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),J0e=T(t=>{let e,r,n;return Gr==="BT"?(r=T((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=T((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{var s,o;const a=Gr==="TB"||Gr=="BT"?(s=Is.get(i))==null?void 0:s.y:(o=Is.get(i))==null?void 0:o.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),tst=T(t=>{let e="",r=1/0;return t.forEach(n=>{const i=Is.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),rst=T((t,e,r)=>{let n=r,i=r;const a=[];t.forEach(s=>{const o=e.get(s);if(!o)throw new Error(`Commit not found for key ${s}`);o.parents.length?(n=ist(o),i=Math.max(n,i)):a.push(o),ast(o,n)}),n=i,a.forEach(s=>{sst(s,n,r)}),t.forEach(s=>{const o=e.get(s);if(o!=null&&o.parents.length){const l=tst(o.parents);n=Is.get(l).y-Lh,n<=i&&(i=n);const u=Ls.get(o.branch).pos,h=n-Rh;Is.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),nst=T(t=>{var n;const e=J0e(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=Is.get(e))==null?void 0:n.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),ist=T(t=>nst(t)+Lh,"calculateCommitPosition"),ast=T((t,e)=>{const r=Ls.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+Rh;return Is.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),sst=T((t,e,r)=>{const n=Ls.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;Is.set(t.id,{x:a,y:i})},"setRootPosition"),ost=T((t,e,r,n,i,a)=>{const{theme:s}=Pe(),o=cS.has(s??""),l=YO.has(s??""),u=Jat.has(s??"");if(a===bn.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(o?3:0)).attr("y",r.y-10+(o?3:0)).attr("width",o?14:20).attr("height",o?14:20).attr("class",`commit ${e.id} commit-highlight${Zf(i,jf,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(o?2:0)).attr("y",r.y-6+(o?2:0)).attr("width",o?8:12).attr("height",o?8:12).attr("class",`commit ${e.id} commit${Zf(i,jf,l)} ${n}-inner`);else if(a===bn.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",o?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`);else{const h=t.append("circle");if(h.attr("cx",r.x),h.attr("cy",r.y),h.attr("r",o?7:10),h.attr("class",`commit ${e.id} commit${Zf(i,jf,l)}`),a===bn.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",o?5:6),d.attr("class",`commit ${n} ${e.id} commit${Zf(i,jf,l)}`)}if(a===bn.REVERSE){const d=t.append("path"),f=o?4:5;d.attr("d",`M ${r.x-f},${r.y-f}L${r.x+f},${r.y+f}M${r.x-f},${r.y+f}L${r.x+f},${r.y-f}`).attr("class",`commit ${n} ${e.id} commit${Zf(i,jf,l)}`)}}},"drawCommitBullet"),lst=T((t,e,r,n,i)=>{var a;if(e.type!==bn.CHERRY_PICK&&(e.customId&&e.type===bn.MERGE||e.type!==bn.MERGE)&&i.showCommitLabel){const s=t.append("g"),o=s.insert("rect").attr("class","commit-label-bkg"),l=s.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),u=(a=l.node())==null?void 0:a.getBBox();if(u&&(o.attr("x",r.posWithOffset-u.width/2-uu).attr("y",r.y+13.5).attr("width",u.width+2*uu).attr("height",u.height+2*uu),Gr==="TB"||Gr==="BT"?(o.attr("x",r.x-(u.width+4*nc+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*nc)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(Gr==="TB"||Gr==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),o.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const h=-7.5-(u.width+10)/25*9.5,d=10+u.width/25*8.5;s.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),cst=T((t,e,r,n)=>{var i;if(e.tags.length>0){let a=0,s=0,o=0;const l=[];for(const u of e.tags.reverse()){const h=t.insert("polygon"),d=t.append("circle"),f=t.append("text").attr("y",r.y-16-a).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");s=Math.max(s,p.width),o=Math.max(o,p.height),f.attr("x",r.posWithOffset-p.width/2),l.push({tag:f,hole:d,rect:h,yOffset:a}),a+=20}for(const{tag:u,hole:h,rect:d,yOffset:f}of l){const p=o/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",` + ${n-s/2-nc/2},${g+uu} ${n-s/2-nc/2},${g-uu} ${r.posWithOffset-s/2-nc},${g-p-uu} ${r.posWithOffset+s/2+nc},${g-p-uu} @@ -1351,22 +1351,22 @@ ${r}`),this.inline?`{${i}}`:i}},E(Oy,"JSDocTagImpl"),Oy);function Vfe(t,e,r){var ${r.x+Rh},${m-p-2} ${r.x+Rh+s+4},${m-p-2} ${r.x+Rh+s+4},${m+p+2} - ${r.x+Rh},${m+p+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),h.attr("cx",r.x+nc/2).attr("cy",m).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),u.attr("x",r.x+5).attr("y",m+3).attr("transform","translate(14,14) rotate(45, "+r.x+","+n+")")}}}},"drawCommitTags"),Zat=x(t=>{switch(t.customType??t.type){case bn.NORMAL:return"commit-normal";case bn.REVERSE:return"commit-reverse";case bn.HIGHLIGHT:return"commit-highlight";case bn.MERGE:return"commit-merge";case bn.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),Qat=x((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=Ype(t.parents);if(a){const s=n.get(a)??i;return e==="TB"?s.y+Lh:e==="BT"?(n.get(t.id)??i).y-Lh:s.x+Lh}}else return e==="TB"?oS:e==="BT"?(n.get(t.id)??i).y-Lh:0;return 0},"calculatePosition"),Jat=x((t,e,r)=>{var l,u;const n=Gr==="BT"&&r?e:e+Rh,i=(l=Ls.get(t.branch))==null?void 0:l.pos,a=Gr==="TB"||Gr==="BT"?(u=Ls.get(t.branch))==null?void 0:u.pos:n;if(a===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);const s=sS.has(Pe().theme??""),o=Gr==="TB"||Gr==="BT"?n:i+(s?GO/2+1:-2);return{x:a,y:o,posWithOffset:n}},"getCommitPosition"),Xpe=x((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s=Gr==="TB"||Gr==="BT"?oS:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=x((d,f)=>{var m,y;const p=(m=e.get(d))==null?void 0:m.seq,g=(y=e.get(f))==null?void 0:y.seq;return p!==void 0&&g!==void 0?p-g:0},"sortKeys");let h=o.sort(u);Gr==="BT"&&(l&&Vat(h,e,s),h=h.reverse()),h.forEach(d=>{var g;const f=e.get(d);if(!f)throw new Error(`Commit not found for key ${d}`);l&&(s=Qat(f,Gr,s,Is));const p=Jat(f,s,l);if(r){const m=Zat(f),y=f.customType??f.type,v=((g=Ls.get(f.branch))==null?void 0:g.index)??0;Xat(i,f,p,m,v,y),Kat(a,f,p,s,n),jat(a,f,p,s)}Gr==="TB"||Gr==="BT"?Is.set(f.id,{x:p.x,y:p.posWithOffset}):Is.set(f.id,{x:p.posWithOffset,y:p.y}),s=Gr==="BT"&&l?s+Lh:s+Lh+Rh,s>hu&&(hu=s)})},"drawCommits"),est=x((t,e,r,n,i)=>{const s=(Gr==="TB"||Gr==="BT"?r.xu.branch===s,"isOnBranchToGetCurve"),l=x(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),GT=x((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(lS.every(s=>Math.abs(s-n)>=10))return lS.push(n),n;const a=Math.abs(t-e);return GT(t,e-a/5,r+1)},"findLane"),tst=x((t,e,r,n)=>{var m,y,v,T,b;const{theme:i}=Pe(),a=qO.has(i??""),s=Is.get(e.id),o=Is.get(r.id);if(s===void 0||o===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=est(e,r,s,o,n);let u="",h="",d=0,f=0,p=(m=Ls.get(r.branch))==null?void 0:m.index;r.type===bn.MERGE&&e.id!==r.parents[0]&&(p=(y=Ls.get(e.branch))==null?void 0:y.index);let g;if(l){u="A 10 10, 0, 0, 0,",h="A 10 10, 0, 0, 1,",d=10,f=10;const w=s.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===bn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y-d} ${h} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${u} ${o.x} ${s.y+f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):Gr==="BT"?(s.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===bn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${u} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${h} ${o.x} ${s.y-f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):(s.yo.y&&(r.type===bn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${o.x-d} ${s.y} ${u} ${o.x} ${s.y-f} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${h} ${s.x+f} ${o.y} L ${o.x} ${o.y}`),s.y===o.y&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`));if(g===void 0)throw new Error("Line definition not found");t.append("path").attr("d",g).attr("class","arrow arrow"+Zf(p,jf,a))},"drawArrow"),rst=x((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{const i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(a=>{tst(r,e.get(a),i,e)})})},"drawArrows"),nst=x((t,e,r,n)=>{const{look:i,theme:a,themeVariables:s}=Pe(),{dropShadow:o,THEME_COLOR_LIMIT:l}=s,u=sS.has(a??""),h=qO.has(a??""),d=t.append("g");e.forEach((f,p)=>{var M;const g=Zf(p,u?l:jf,h),m=(M=Ls.get(f.name))==null?void 0:M.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const y=Gr==="TB"||Gr==="BT"?m:u?m+GO/2+1:m-2,v=d.append("line");v.attr("x1",0),v.attr("y1",y),v.attr("x2",hu),v.attr("y2",y),v.attr("class","branch branch"+g),Gr==="TB"?(v.attr("y1",oS),v.attr("x1",m),v.attr("y2",hu),v.attr("x2",m)):Gr==="BT"&&(v.attr("y1",hu),v.attr("x1",m),v.attr("y2",oS),v.attr("x2",m)),lS.push(y);const T=f.name,b=Hpe(T),w=d.insert("rect"),A=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);A.node().appendChild(b);const C=b.getBBox(),_=u?0:4,L=u?16:0,O=u?GO:0;i==="neo"&&w.attr("data-look","neo"),w.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",_).attr("ry",_).attr("x",-C.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-C.height/2+10).attr("width",C.width+18+L).attr("height",C.height+4+O),A.attr("transform","translate("+(-C.width-14-(r.rotateCommitLabel===!0?30:0)+L/2)+", "+(y-C.height/2-2)+")"),Gr==="TB"?(w.attr("x",m-C.width/2-10).attr("y",0),A.attr("transform","translate("+(m-C.width/2-5)+", 0)"),u&&(w.attr("transform",`translate(${-L/2-3}, ${-O-10})`),A.attr("transform","translate("+(m-C.width/2-5)+", "+(-O*2+7)+")"))):Gr==="BT"?(w.attr("x",m-C.width/2-10).attr("y",hu),A.attr("transform","translate("+(m-C.width/2-5)+", "+hu+")"),u&&(w.attr("transform",`translate(${-L/2-3}, ${O+10})`),A.attr("transform","translate("+(m-C.width/2-5)+", "+(hu+O*2+4)+")"))):w.attr("transform","translate(-19, "+(y-12-O/2)+")")})},"drawBranches"),ist=x(function(t,e,r,n,i){return Ls.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(Gr==="TB"||Gr==="BT"?n.width/2:0),e},"setBranchPosition"),ast=x(function(t,e,r,n){Gat(),ae.debug("in gitgraph renderer",t+` -`,"id:",e,r);const i=n.db;if(!i.getConfig){ae.error("getConfig method is not available on db");return}const a=i.getConfig(),s=a.rotateCommitLabel??!1;zT=i.getCommits();const o=i.getBranchesAsObjArray();Gr=i.getDirection();const l=pt(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=Pe(),{useGradient:f,gradientStart:p,gradientStop:g,filterColor:m}=d;if(f){const v=l.append("defs").append("linearGradient").attr("id",e+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");v.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),v.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}u==="neo"&&sS.has(h??"")&&l.append("defs").append("filter").attr("id",e+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",m);let y=0;o.forEach((v,T)=>{var _;const b=Hpe(v.name),w=l.append("g"),k=w.insert("g").attr("class","branchLabel"),A=k.insert("g").attr("class","label branch-label");(_=A.node())==null||_.appendChild(b);const C=b.getBBox();y=ist(v.name,y,T,C,s),A.remove(),k.remove(),w.remove()}),Xpe(l,zT,!1,a),a.showBranches&&nst(l,o,a,e),rst(l,zT),Xpe(l,zT,!0,a),Lr.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),P6(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),sst={draw:ast},Kpe=8,jpe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),ost=new Set(["redux-color","redux-dark-color"]),lst=new Set(["neo","neo-dark"]),cst=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),ust=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),hst=x(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{switch(t.customType??t.type){case bn.NORMAL:return"commit-normal";case bn.REVERSE:return"commit-reverse";case bn.HIGHLIGHT:return"commit-highlight";case bn.MERGE:return"commit-merge";case bn.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),hst=T((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=J0e(t.parents);if(a){const s=n.get(a)??i;return e==="TB"?s.y+Lh:e==="BT"?(n.get(t.id)??i).y-Lh:s.x+Lh}}else return e==="TB"?uS:e==="BT"?(n.get(t.id)??i).y-Lh:0;return 0},"calculatePosition"),dst=T((t,e,r)=>{var l,u;const n=Gr==="BT"&&r?e:e+Rh,i=(l=Ls.get(t.branch))==null?void 0:l.pos,a=Gr==="TB"||Gr==="BT"?(u=Ls.get(t.branch))==null?void 0:u.pos:n;if(a===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);const s=cS.has(Pe().theme??""),o=Gr==="TB"||Gr==="BT"?n:i+(s?HO/2+1:-2);return{x:a,y:o,posWithOffset:n}},"getCommitPosition"),ege=T((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s=Gr==="TB"||Gr==="BT"?uS:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=T((d,f)=>{var m,y;const p=(m=e.get(d))==null?void 0:m.seq,g=(y=e.get(f))==null?void 0:y.seq;return p!==void 0&&g!==void 0?p-g:0},"sortKeys");let h=o.sort(u);Gr==="BT"&&(l&&rst(h,e,s),h=h.reverse()),h.forEach(d=>{var g;const f=e.get(d);if(!f)throw new Error(`Commit not found for key ${d}`);l&&(s=hst(f,Gr,s,Is));const p=dst(f,s,l);if(r){const m=ust(f),y=f.customType??f.type,v=((g=Ls.get(f.branch))==null?void 0:g.index)??0;ost(i,f,p,m,v,y),lst(a,f,p,s,n),cst(a,f,p,s)}Gr==="TB"||Gr==="BT"?Is.set(f.id,{x:p.x,y:p.posWithOffset}):Is.set(f.id,{x:p.posWithOffset,y:p.y}),s=Gr==="BT"&&l?s+Lh:s+Lh+Rh,s>hu&&(hu=s)})},"drawCommits"),fst=T((t,e,r,n,i)=>{const s=(Gr==="TB"||Gr==="BT"?r.xu.branch===s,"isOnBranchToGetCurve"),l=T(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),VT=T((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(hS.every(s=>Math.abs(s-n)>=10))return hS.push(n),n;const a=Math.abs(t-e);return VT(t,e-a/5,r+1)},"findLane"),pst=T((t,e,r,n)=>{var m,y,v,x,b;const{theme:i}=Pe(),a=YO.has(i??""),s=Is.get(e.id),o=Is.get(r.id);if(s===void 0||o===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=fst(e,r,s,o,n);let u="",h="",d=0,f=0,p=(m=Ls.get(r.branch))==null?void 0:m.index;r.type===bn.MERGE&&e.id!==r.parents[0]&&(p=(y=Ls.get(e.branch))==null?void 0:y.index);let g;if(l){u="A 10 10, 0, 0, 0,",h="A 10 10, 0, 0, 1,",d=10,f=10;const w=s.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===bn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y-d} ${h} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${u} ${o.x} ${s.y+f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):Gr==="BT"?(s.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===bn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${u} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${h} ${o.x} ${s.y-f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):(s.yo.y&&(r.type===bn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${o.x-d} ${s.y} ${u} ${o.x} ${s.y-f} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${h} ${s.x+f} ${o.y} L ${o.x} ${o.y}`),s.y===o.y&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`));if(g===void 0)throw new Error("Line definition not found");t.append("path").attr("d",g).attr("class","arrow arrow"+Zf(p,jf,a))},"drawArrow"),gst=T((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{const i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(a=>{pst(r,e.get(a),i,e)})})},"drawArrows"),mst=T((t,e,r,n)=>{const{look:i,theme:a,themeVariables:s}=Pe(),{dropShadow:o,THEME_COLOR_LIMIT:l}=s,u=cS.has(a??""),h=YO.has(a??""),d=t.append("g");e.forEach((f,p)=>{var M;const g=Zf(p,u?l:jf,h),m=(M=Ls.get(f.name))==null?void 0:M.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const y=Gr==="TB"||Gr==="BT"?m:u?m+HO/2+1:m-2,v=d.append("line");v.attr("x1",0),v.attr("y1",y),v.attr("x2",hu),v.attr("y2",y),v.attr("class","branch branch"+g),Gr==="TB"?(v.attr("y1",uS),v.attr("x1",m),v.attr("y2",hu),v.attr("x2",m)):Gr==="BT"&&(v.attr("y1",hu),v.attr("x1",m),v.attr("y2",uS),v.attr("x2",m)),hS.push(y);const x=f.name,b=Q0e(x),w=d.insert("rect"),S=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);S.node().appendChild(b);const C=b.getBBox(),_=u?0:4,L=u?16:0,O=u?HO:0;i==="neo"&&w.attr("data-look","neo"),w.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",_).attr("ry",_).attr("x",-C.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-C.height/2+10).attr("width",C.width+18+L).attr("height",C.height+4+O),S.attr("transform","translate("+(-C.width-14-(r.rotateCommitLabel===!0?30:0)+L/2)+", "+(y-C.height/2-2)+")"),Gr==="TB"?(w.attr("x",m-C.width/2-10).attr("y",0),S.attr("transform","translate("+(m-C.width/2-5)+", 0)"),u&&(w.attr("transform",`translate(${-L/2-3}, ${-O-10})`),S.attr("transform","translate("+(m-C.width/2-5)+", "+(-O*2+7)+")"))):Gr==="BT"?(w.attr("x",m-C.width/2-10).attr("y",hu),S.attr("transform","translate("+(m-C.width/2-5)+", "+hu+")"),u&&(w.attr("transform",`translate(${-L/2-3}, ${O+10})`),S.attr("transform","translate("+(m-C.width/2-5)+", "+(hu+O*2+4)+")"))):w.attr("transform","translate(-19, "+(y-12-O/2)+")")})},"drawBranches"),yst=T(function(t,e,r,n,i){return Ls.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(Gr==="TB"||Gr==="BT"?n.width/2:0),e},"setBranchPosition"),vst=T(function(t,e,r,n){est(),ae.debug("in gitgraph renderer",t+` +`,"id:",e,r);const i=n.db;if(!i.getConfig){ae.error("getConfig method is not available on db");return}const a=i.getConfig(),s=a.rotateCommitLabel??!1;qT=i.getCommits();const o=i.getBranchesAsObjArray();Gr=i.getDirection();const l=pt(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=Pe(),{useGradient:f,gradientStart:p,gradientStop:g,filterColor:m}=d;if(f){const v=l.append("defs").append("linearGradient").attr("id",e+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");v.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),v.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}u==="neo"&&cS.has(h??"")&&l.append("defs").append("filter").attr("id",e+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",m);let y=0;o.forEach((v,x)=>{var _;const b=Q0e(v.name),w=l.append("g"),k=w.insert("g").attr("class","branchLabel"),S=k.insert("g").attr("class","label branch-label");(_=S.node())==null||_.appendChild(b);const C=b.getBBox();y=yst(v.name,y,x,C,s),S.remove(),k.remove(),w.remove()}),ege(l,qT,!1,a),a.showBranches&&mst(l,o,a,e),gst(l,qT),ege(l,qT,!0,a),Lr.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),z6(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),bst={draw:vst},tge=8,rge=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),xst=new Set(["redux-color","redux-dark-color"]),Tst=new Set(["neo","neo-dark"]),wst=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Cst=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),kst=T(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{const e=lr(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,a=jpe.has(r);if(lst.has(r)){let s="";for(let o=0;o{const e=lr(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,a=rge.has(r);if(Tst.has(r)){let s="";for(let o=0;o`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%Kpe;return` + `;return s}},"genColor"),Sst=T(t=>`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%tge;return` .branch-label${e} { fill: ${t["gitBranchLabel"+r]}; } .commit${e} { stroke: ${t["git"+r]}; fill: ${t["git"+r]}; } .commit-highlight${e} { stroke: ${t["gitInv"+r]}; fill: ${t["gitInv"+r]}; } .label${e} { fill: ${t["git"+r]}; } .arrow${e} { stroke: ${t["git"+r]}; } `}).join(` -`)}`,"normalTheme"),pst=x(t=>{const e=lr(),{theme:r}=e,n=ust.has(r);return` +`)}`,"normalTheme"),Ast=T(t=>{const e=lr(),{theme:r}=e,n=Cst.has(r);return` .commit-id, .commit-msg, .branch-label { @@ -1403,8 +1403,8 @@ ${r}`),this.inline?`{${i}}`:i}},E(Oy,"JSDocTagImpl"),Oy);function Vfe(t,e,r){var font-family: 'trebuchet ms', verdana, arial, sans-serif; font-family: var(--mermaid-font-family); } - - ${n?dst(t):fst(t)} + + ${n?Est(t):Sst(t)} .branch { stroke-width: ${t.strokeWidth}; @@ -1435,7 +1435,7 @@ ${r}`),this.inline?`{${i}}`:i}},E(Oy,"JSDocTagImpl"),Oy);function Vfe(t,e,r){var .arrow { /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */ - stroke-width: ${jpe.has(r)?t.strokeWidth:8}; + stroke-width: ${rge.has(r)?t.strokeWidth:8}; stroke-linecap: round; fill: none } @@ -1444,12 +1444,12 @@ ${r}`),this.inline?`{${i}}`:i}},E(Oy,"JSDocTagImpl"),Oy);function Vfe(t,e,r){var font-size: 18px; fill: ${t.textColor}; } -`},"getStyles"),gst=pst,mst={parser:Fat,db:Upe,renderer:sst,styles:gst};const yst=Object.freeze(Object.defineProperty({__proto__:null,diagram:mst},Symbol.toStringTag,{value:"Module"}));var cS={exports:{}},vst=cS.exports,Zpe;function bst(){return Zpe||(Zpe=1,(function(t,e){(function(r,n){t.exports=n()})(vst,(function(){var r="day";return function(n,i,a){var s=function(u){return u.add(4-u.isoWeekday(),r)},o=i.prototype;o.isoWeekYear=function(){return s(this).year()},o.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var h,d,f,p,g=s(this),m=(h=this.isoWeekYear(),d=this.$u,f=(d?a.utc:a)().year(h).startOf("year"),p=4-f.isoWeekday(),f.isoWeekday()>4&&(p+=7),f.add(p,r));return g.diff(m,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,h){var d=this.$utils(),f=!!d.u(h)||h;return d.p(u)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,h)}}}))})(cS)),cS.exports}var xst=bst();const Tst=Os(xst);var uS={exports:{}},wst=uS.exports,Qpe;function Cst(){return Qpe||(Qpe=1,(function(t,e){(function(r,n){t.exports=n()})(wst,(function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,s=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,l={},u=function(y){return(y=+y)+(y>68?1900:2e3)},h=function(y){return function(v){this[y]=+v}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var T=v.match(/([+-]|\d\d)/g),b=60*T[1]+(+T[2]||0);return b===0?0:T[0]==="+"?-b:b})(y)}],f=function(y){var v=l[y];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(y,v){var T,b=l.meridiem;if(b){for(var w=1;w<=24;w+=1)if(y.indexOf(b(w,0,v))>-1){T=w>12;break}}else T=y===(v?"pm":"PM");return T},g={A:[o,function(y){this.afternoon=p(y,!1)}],a:[o,function(y){this.afternoon=p(y,!0)}],Q:[i,function(y){this.month=3*(y-1)+1}],S:[i,function(y){this.milliseconds=100*+y}],SS:[a,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[s,h("seconds")],ss:[s,h("seconds")],m:[s,h("minutes")],mm:[s,h("minutes")],H:[s,h("hours")],h:[s,h("hours")],HH:[s,h("hours")],hh:[s,h("hours")],D:[s,h("day")],DD:[a,h("day")],Do:[o,function(y){var v=l.ordinal,T=y.match(/\d+/);if(this.day=T[0],v)for(var b=1;b<=31;b+=1)v(b).replace(/\[|\]/g,"")===y&&(this.day=b)}],w:[s,h("week")],ww:[a,h("week")],M:[s,h("month")],MM:[a,h("month")],MMM:[o,function(y){var v=f("months"),T=(f("monthsShort")||v.map((function(b){return b.slice(0,3)}))).indexOf(y)+1;if(T<1)throw new Error;this.month=T%12||T}],MMMM:[o,function(y){var v=f("months").indexOf(y)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,h("year")],YY:[a,function(y){this.year=u(y)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(y){var v,T;v=y,T=l&&l.formats;for(var b=(y=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(O,M,z){var F=z&&z.toUpperCase();return M||T[z]||r[z]||T[F].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(S,R,N){return R||N.slice(1)}))}))).match(n),w=b.length,k=0;k-1)return new Date((I==="X"?1e3:1)*D);var P=m(I)(D),G=P.year,V=P.month,Y=P.day,W=P.hours,ie=P.minutes,K=P.seconds,se=P.milliseconds,J=P.zone,Z=P.week,ee=new Date,ne=Y||(G||V?1:ee.getDate()),ue=G||ee.getFullYear(),fe=0;G&&!V||(fe=V>0?V-1:ee.getMonth());var _e,Ae=W||0,Ne=ie||0,me=K||0,ve=se||0;return J?new Date(Date.UTC(ue,fe,ne,Ae,Ne,me,ve+60*J.offset*1e3)):$?new Date(Date.UTC(ue,fe,ne,Ae,Ne,me,ve)):(_e=new Date(ue,fe,ne,Ae,Ne,me,ve),Z&&(_e=B(_e).week(Z).toDate()),_e)}catch{return new Date("")}})(A,L,C,T),this.init(),F&&F!==!0&&(this.$L=this.locale(F).$L),z&&A!=this.format(L)&&(this.$d=new Date("")),l={}}else if(L instanceof Array)for(var S=L.length,R=1;R<=S;R+=1){_[1]=L[R-1];var N=T.apply(this,_);if(N.isValid()){this.$d=N.$d,this.$L=N.$L,this.init();break}R===S&&(this.$d=new Date(""))}else w.call(this,k)}}}))})(uS)),uS.exports}var kst=Cst();const Est=Os(kst);var hS={exports:{}},Sst=hS.exports,Jpe;function Ast(){return Jpe||(Jpe=1,(function(t,e){(function(r,n){t.exports=n()})(Sst,(function(){return function(r,n){var i=n.prototype,a=i.format;i.format=function(s){var o=this,l=this.$locale();if(!this.isValid())return a.bind(this)(s);var u=this.$utils(),h=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return u.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}}));return a.bind(this)(h)}}}))})(hS)),hS.exports}var _st=Ast();const Rst=Os(_st);var dS={exports:{}},Lst=dS.exports,ege;function Ist(){return ege||(ege=1,(function(t,e){(function(r,n){t.exports=n()})(Lst,(function(){var r,n,i=1e3,a=6e4,s=36e5,o=864e5,l=31536e6,u=2628e6,h=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,f={years:l,months:u,days:o,hours:s,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},p=function(A){return A instanceof w},g=function(A,C,_){return new w(A,_,C.$l)},m=function(A){return n.p(A)+"s"},y=function(A){return A<0},v=function(A){return y(A)?Math.ceil(A):Math.floor(A)},T=function(A){return Math.abs(A)},b=function(A,C){return A?y(A)?{negative:!0,format:""+T(A)+C}:{negative:!1,format:""+A+C}:{negative:!1,format:""}},w=(function(){function A(_,L,O){var M=this;if(this.$d={},this.$l=O,_===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return g(_*f[m(L)],this);if(typeof _=="number")return this.$ms=_,this.parseFromMilliseconds(),this;if(typeof _=="object")return Object.keys(_).forEach((function(S){M.$d[m(S)]=_[S]})),this.calMilliseconds(),this;if(typeof _=="string"){var z=_.match(h);if(z){var F=z.slice(2).map((function(S){return S!=null?Number(S):0}));return this.$d.years=F[0],this.$d.months=F[1],this.$d.weeks=F[2],this.$d.days=F[3],this.$d.hours=F[4],this.$d.minutes=F[5],this.$d.seconds=F[6],this.calMilliseconds(),this}}return this}var C=A.prototype;return C.calMilliseconds=function(){var _=this;this.$ms=Object.keys(this.$d).reduce((function(L,O){return L+(_.$d[O]||0)*f[O]}),0)},C.parseFromMilliseconds=function(){var _=this.$ms;this.$d.years=v(_/l),_%=l,this.$d.months=v(_/u),_%=u,this.$d.days=v(_/o),_%=o,this.$d.hours=v(_/s),_%=s,this.$d.minutes=v(_/a),_%=a,this.$d.seconds=v(_/i),_%=i,this.$d.milliseconds=_},C.toISOString=function(){var _=b(this.$d.years,"Y"),L=b(this.$d.months,"M"),O=+this.$d.days||0;this.$d.weeks&&(O+=7*this.$d.weeks);var M=b(O,"D"),z=b(this.$d.hours,"H"),F=b(this.$d.minutes,"M"),S=this.$d.seconds||0;this.$d.milliseconds&&(S+=this.$d.milliseconds/1e3,S=Math.round(1e3*S)/1e3);var R=b(S,"S"),N=_.negative||L.negative||M.negative||z.negative||F.negative||R.negative,D=z.format||F.format||R.format?"T":"",I=(N?"-":"")+"P"+_.format+L.format+M.format+D+z.format+F.format+R.format;return I==="P"||I==="-P"?"P0D":I},C.toJSON=function(){return this.toISOString()},C.format=function(_){var L=_||"YYYY-MM-DDTHH:mm:ss",O={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return L.replace(d,(function(M,z){return z||String(O[M])}))},C.as=function(_){return this.$ms/f[m(_)]},C.get=function(_){var L=this.$ms,O=m(_);return O==="milliseconds"?L%=1e3:L=O==="weeks"?v(L/f[O]):this.$d[O],L||0},C.add=function(_,L,O){var M;return M=L?_*f[m(L)]:p(_)?_.$ms:g(_,this).$ms,g(this.$ms+M*(O?-1:1),this)},C.subtract=function(_,L){return this.add(_,L,!0)},C.locale=function(_){var L=this.clone();return L.$l=_,L},C.clone=function(){return g(this.$ms,this)},C.humanize=function(_){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!_)},C.valueOf=function(){return this.asMilliseconds()},C.milliseconds=function(){return this.get("milliseconds")},C.asMilliseconds=function(){return this.as("milliseconds")},C.seconds=function(){return this.get("seconds")},C.asSeconds=function(){return this.as("seconds")},C.minutes=function(){return this.get("minutes")},C.asMinutes=function(){return this.as("minutes")},C.hours=function(){return this.get("hours")},C.asHours=function(){return this.as("hours")},C.days=function(){return this.get("days")},C.asDays=function(){return this.as("days")},C.weeks=function(){return this.get("weeks")},C.asWeeks=function(){return this.as("weeks")},C.months=function(){return this.get("months")},C.asMonths=function(){return this.as("months")},C.years=function(){return this.get("years")},C.asYears=function(){return this.as("years")},A})(),k=function(A,C,_){return A.add(C.years()*_,"y").add(C.months()*_,"M").add(C.days()*_,"d").add(C.hours()*_,"h").add(C.minutes()*_,"m").add(C.seconds()*_,"s").add(C.milliseconds()*_,"ms")};return function(A,C,_){r=_,n=_().$utils(),_.duration=function(M,z){var F=_.locale();return g(M,{$l:F},z)},_.isDuration=p;var L=C.prototype.add,O=C.prototype.subtract;C.prototype.add=function(M,z){return p(M)?k(this,M,1):L.bind(this)(M,z)},C.prototype.subtract=function(M,z){return p(M)?k(this,M,-1):O.bind(this)(M,z)}}}))})(dS)),dS.exports}var Dst=Ist();const Mst=Os(Dst);var VO=(function(){var t=x(function(F,S,R,N){for(R=R||{},N=F.length;N--;R[F[N]]=S);return R},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],a=[1,29],s=[1,30],o=[1,31],l=[1,32],u=[1,33],h=[1,34],d=[1,9],f=[1,10],p=[1,11],g=[1,12],m=[1,13],y=[1,14],v=[1,15],T=[1,16],b=[1,19],w=[1,20],k=[1,21],A=[1,22],C=[1,23],_=[1,25],L=[1,35],O={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:x(function(S,R,N,D,I,$,B){var P=$.length-1;switch(I){case 1:return $[P-1];case 2:this.$=[];break;case 3:$[P-1].push($[P]),this.$=$[P-1];break;case 4:case 5:this.$=$[P];break;case 6:case 7:this.$=[];break;case 8:D.setWeekday("monday");break;case 9:D.setWeekday("tuesday");break;case 10:D.setWeekday("wednesday");break;case 11:D.setWeekday("thursday");break;case 12:D.setWeekday("friday");break;case 13:D.setWeekday("saturday");break;case 14:D.setWeekday("sunday");break;case 15:D.setWeekend("friday");break;case 16:D.setWeekend("saturday");break;case 17:D.setDateFormat($[P].substr(11)),this.$=$[P].substr(11);break;case 18:D.enableInclusiveEndDates(),this.$=$[P].substr(18);break;case 19:D.TopAxis(),this.$=$[P].substr(8);break;case 20:D.setAxisFormat($[P].substr(11)),this.$=$[P].substr(11);break;case 21:D.setTickInterval($[P].substr(13)),this.$=$[P].substr(13);break;case 22:D.setExcludes($[P].substr(9)),this.$=$[P].substr(9);break;case 23:D.setIncludes($[P].substr(9)),this.$=$[P].substr(9);break;case 24:D.setTodayMarker($[P].substr(12)),this.$=$[P].substr(12);break;case 27:D.setDiagramTitle($[P].substr(6)),this.$=$[P].substr(6);break;case 28:this.$=$[P].trim(),D.setAccTitle(this.$);break;case 29:case 30:this.$=$[P].trim(),D.setAccDescription(this.$);break;case 31:D.addSection($[P].substr(8)),this.$=$[P].substr(8);break;case 33:D.addTask($[P-1],$[P]),this.$="task";break;case 34:this.$=$[P-1],D.setClickEvent($[P-1],$[P],null);break;case 35:this.$=$[P-2],D.setClickEvent($[P-2],$[P-1],$[P]);break;case 36:this.$=$[P-2],D.setClickEvent($[P-2],$[P-1],null),D.setLink($[P-2],$[P]);break;case 37:this.$=$[P-3],D.setClickEvent($[P-3],$[P-2],$[P-1]),D.setLink($[P-3],$[P]);break;case 38:this.$=$[P-2],D.setClickEvent($[P-2],$[P],null),D.setLink($[P-2],$[P-1]);break;case 39:this.$=$[P-3],D.setClickEvent($[P-3],$[P-1],$[P]),D.setLink($[P-3],$[P-2]);break;case 40:this.$=$[P-1],D.setLink($[P-1],$[P]);break;case 41:case 47:this.$=$[P-1]+" "+$[P];break;case 42:case 43:case 45:this.$=$[P-2]+" "+$[P-1]+" "+$[P];break;case 44:case 46:this.$=$[P-3]+" "+$[P-2]+" "+$[P-1]+" "+$[P];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:T,30:b,31:w,33:k,35:A,36:C,37:24,38:_,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:T,30:b,31:w,33:k,35:A,36:C,37:24,38:_,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:x(function(S,R){if(R.recoverable)this.trace(S);else{var N=new Error(S);throw N.hash=R,N}},"parseError"),parse:x(function(S){var R=this,N=[0],D=[],I=[null],$=[],B=this.table,P="",G=0,V=0,Y=2,W=1,ie=$.slice.call(arguments,1),K=Object.create(this.lexer),se={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(se.yy[J]=this.yy[J]);K.setInput(S,se.yy),se.yy.lexer=K,se.yy.parser=this,typeof K.yylloc>"u"&&(K.yylloc={});var Z=K.yylloc;$.push(Z);var ee=K.options&&K.options.ranges;typeof se.yy.parseError=="function"?this.parseError=se.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ne(Ve){N.length=N.length-2*Ve,I.length=I.length-Ve,$.length=$.length-Ve}x(ne,"popStack");function ue(){var Ve;return Ve=D.pop()||K.lex()||W,typeof Ve!="number"&&(Ve instanceof Array&&(D=Ve,Ve=D.pop()),Ve=R.symbols_[Ve]||Ve),Ve}x(ue,"lex");for(var fe,_e,Ae,Ne,me={},ve,Ge,Te,Ze;;){if(_e=N[N.length-1],this.defaultActions[_e]?Ae=this.defaultActions[_e]:((fe===null||typeof fe>"u")&&(fe=ue()),Ae=B[_e]&&B[_e][fe]),typeof Ae>"u"||!Ae.length||!Ae[0]){var ke="";Ze=[];for(ve in B[_e])this.terminals_[ve]&&ve>Y&&Ze.push("'"+this.terminals_[ve]+"'");K.showPosition?ke="Parse error on line "+(G+1)+`: +`},"getStyles"),_st=Ast,Rst={parser:Qat,db:Z0e,renderer:bst,styles:_st};const Lst=Object.freeze(Object.defineProperty({__proto__:null,diagram:Rst},Symbol.toStringTag,{value:"Module"}));var dS={exports:{}},Ist=dS.exports,nge;function Dst(){return nge||(nge=1,(function(t,e){(function(r,n){t.exports=n()})(Ist,(function(){var r="day";return function(n,i,a){var s=function(u){return u.add(4-u.isoWeekday(),r)},o=i.prototype;o.isoWeekYear=function(){return s(this).year()},o.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var h,d,f,p,g=s(this),m=(h=this.isoWeekYear(),d=this.$u,f=(d?a.utc:a)().year(h).startOf("year"),p=4-f.isoWeekday(),f.isoWeekday()>4&&(p+=7),f.add(p,r));return g.diff(m,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,h){var d=this.$utils(),f=!!d.u(h)||h;return d.p(u)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,h)}}}))})(dS)),dS.exports}var Mst=Dst();const Nst=Os(Mst);var fS={exports:{}},Ost=fS.exports,ige;function $st(){return ige||(ige=1,(function(t,e){(function(r,n){t.exports=n()})(Ost,(function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,s=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,l={},u=function(y){return(y=+y)+(y>68?1900:2e3)},h=function(y){return function(v){this[y]=+v}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var x=v.match(/([+-]|\d\d)/g),b=60*x[1]+(+x[2]||0);return b===0?0:x[0]==="+"?-b:b})(y)}],f=function(y){var v=l[y];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(y,v){var x,b=l.meridiem;if(b){for(var w=1;w<=24;w+=1)if(y.indexOf(b(w,0,v))>-1){x=w>12;break}}else x=y===(v?"pm":"PM");return x},g={A:[o,function(y){this.afternoon=p(y,!1)}],a:[o,function(y){this.afternoon=p(y,!0)}],Q:[i,function(y){this.month=3*(y-1)+1}],S:[i,function(y){this.milliseconds=100*+y}],SS:[a,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[s,h("seconds")],ss:[s,h("seconds")],m:[s,h("minutes")],mm:[s,h("minutes")],H:[s,h("hours")],h:[s,h("hours")],HH:[s,h("hours")],hh:[s,h("hours")],D:[s,h("day")],DD:[a,h("day")],Do:[o,function(y){var v=l.ordinal,x=y.match(/\d+/);if(this.day=x[0],v)for(var b=1;b<=31;b+=1)v(b).replace(/\[|\]/g,"")===y&&(this.day=b)}],w:[s,h("week")],ww:[a,h("week")],M:[s,h("month")],MM:[a,h("month")],MMM:[o,function(y){var v=f("months"),x=(f("monthsShort")||v.map((function(b){return b.slice(0,3)}))).indexOf(y)+1;if(x<1)throw new Error;this.month=x%12||x}],MMMM:[o,function(y){var v=f("months").indexOf(y)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,h("year")],YY:[a,function(y){this.year=u(y)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(y){var v,x;v=y,x=l&&l.formats;for(var b=(y=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(O,M,z){var F=z&&z.toUpperCase();return M||x[z]||r[z]||x[F].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(A,R,N){return R||N.slice(1)}))}))).match(n),w=b.length,k=0;k-1)return new Date((I==="X"?1e3:1)*D);var P=m(I)(D),G=P.year,V=P.month,X=P.day,W=P.hours,ie=P.minutes,K=P.seconds,se=P.milliseconds,J=P.zone,Z=P.week,ee=new Date,ne=X||(G||V?1:ee.getDate()),ue=G||ee.getFullYear(),fe=0;G&&!V||(fe=V>0?V-1:ee.getMonth());var _e,Ae=W||0,Ne=ie||0,me=K||0,ve=se||0;return J?new Date(Date.UTC(ue,fe,ne,Ae,Ne,me,ve+60*J.offset*1e3)):$?new Date(Date.UTC(ue,fe,ne,Ae,Ne,me,ve)):(_e=new Date(ue,fe,ne,Ae,Ne,me,ve),Z&&(_e=B(_e).week(Z).toDate()),_e)}catch{return new Date("")}})(S,L,C,x),this.init(),F&&F!==!0&&(this.$L=this.locale(F).$L),z&&S!=this.format(L)&&(this.$d=new Date("")),l={}}else if(L instanceof Array)for(var A=L.length,R=1;R<=A;R+=1){_[1]=L[R-1];var N=x.apply(this,_);if(N.isValid()){this.$d=N.$d,this.$L=N.$L,this.init();break}R===A&&(this.$d=new Date(""))}else w.call(this,k)}}}))})(fS)),fS.exports}var Pst=$st();const Bst=Os(Pst);var pS={exports:{}},Fst=pS.exports,age;function zst(){return age||(age=1,(function(t,e){(function(r,n){t.exports=n()})(Fst,(function(){return function(r,n){var i=n.prototype,a=i.format;i.format=function(s){var o=this,l=this.$locale();if(!this.isValid())return a.bind(this)(s);var u=this.$utils(),h=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return u.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}}));return a.bind(this)(h)}}}))})(pS)),pS.exports}var Gst=zst();const qst=Os(Gst);var gS={exports:{}},Vst=gS.exports,sge;function Wst(){return sge||(sge=1,(function(t,e){(function(r,n){t.exports=n()})(Vst,(function(){var r,n,i=1e3,a=6e4,s=36e5,o=864e5,l=31536e6,u=2628e6,h=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,f={years:l,months:u,days:o,hours:s,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},p=function(S){return S instanceof w},g=function(S,C,_){return new w(S,_,C.$l)},m=function(S){return n.p(S)+"s"},y=function(S){return S<0},v=function(S){return y(S)?Math.ceil(S):Math.floor(S)},x=function(S){return Math.abs(S)},b=function(S,C){return S?y(S)?{negative:!0,format:""+x(S)+C}:{negative:!1,format:""+S+C}:{negative:!1,format:""}},w=(function(){function S(_,L,O){var M=this;if(this.$d={},this.$l=O,_===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return g(_*f[m(L)],this);if(typeof _=="number")return this.$ms=_,this.parseFromMilliseconds(),this;if(typeof _=="object")return Object.keys(_).forEach((function(A){M.$d[m(A)]=_[A]})),this.calMilliseconds(),this;if(typeof _=="string"){var z=_.match(h);if(z){var F=z.slice(2).map((function(A){return A!=null?Number(A):0}));return this.$d.years=F[0],this.$d.months=F[1],this.$d.weeks=F[2],this.$d.days=F[3],this.$d.hours=F[4],this.$d.minutes=F[5],this.$d.seconds=F[6],this.calMilliseconds(),this}}return this}var C=S.prototype;return C.calMilliseconds=function(){var _=this;this.$ms=Object.keys(this.$d).reduce((function(L,O){return L+(_.$d[O]||0)*f[O]}),0)},C.parseFromMilliseconds=function(){var _=this.$ms;this.$d.years=v(_/l),_%=l,this.$d.months=v(_/u),_%=u,this.$d.days=v(_/o),_%=o,this.$d.hours=v(_/s),_%=s,this.$d.minutes=v(_/a),_%=a,this.$d.seconds=v(_/i),_%=i,this.$d.milliseconds=_},C.toISOString=function(){var _=b(this.$d.years,"Y"),L=b(this.$d.months,"M"),O=+this.$d.days||0;this.$d.weeks&&(O+=7*this.$d.weeks);var M=b(O,"D"),z=b(this.$d.hours,"H"),F=b(this.$d.minutes,"M"),A=this.$d.seconds||0;this.$d.milliseconds&&(A+=this.$d.milliseconds/1e3,A=Math.round(1e3*A)/1e3);var R=b(A,"S"),N=_.negative||L.negative||M.negative||z.negative||F.negative||R.negative,D=z.format||F.format||R.format?"T":"",I=(N?"-":"")+"P"+_.format+L.format+M.format+D+z.format+F.format+R.format;return I==="P"||I==="-P"?"P0D":I},C.toJSON=function(){return this.toISOString()},C.format=function(_){var L=_||"YYYY-MM-DDTHH:mm:ss",O={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return L.replace(d,(function(M,z){return z||String(O[M])}))},C.as=function(_){return this.$ms/f[m(_)]},C.get=function(_){var L=this.$ms,O=m(_);return O==="milliseconds"?L%=1e3:L=O==="weeks"?v(L/f[O]):this.$d[O],L||0},C.add=function(_,L,O){var M;return M=L?_*f[m(L)]:p(_)?_.$ms:g(_,this).$ms,g(this.$ms+M*(O?-1:1),this)},C.subtract=function(_,L){return this.add(_,L,!0)},C.locale=function(_){var L=this.clone();return L.$l=_,L},C.clone=function(){return g(this.$ms,this)},C.humanize=function(_){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!_)},C.valueOf=function(){return this.asMilliseconds()},C.milliseconds=function(){return this.get("milliseconds")},C.asMilliseconds=function(){return this.as("milliseconds")},C.seconds=function(){return this.get("seconds")},C.asSeconds=function(){return this.as("seconds")},C.minutes=function(){return this.get("minutes")},C.asMinutes=function(){return this.as("minutes")},C.hours=function(){return this.get("hours")},C.asHours=function(){return this.as("hours")},C.days=function(){return this.get("days")},C.asDays=function(){return this.as("days")},C.weeks=function(){return this.get("weeks")},C.asWeeks=function(){return this.as("weeks")},C.months=function(){return this.get("months")},C.asMonths=function(){return this.as("months")},C.years=function(){return this.get("years")},C.asYears=function(){return this.as("years")},S})(),k=function(S,C,_){return S.add(C.years()*_,"y").add(C.months()*_,"M").add(C.days()*_,"d").add(C.hours()*_,"h").add(C.minutes()*_,"m").add(C.seconds()*_,"s").add(C.milliseconds()*_,"ms")};return function(S,C,_){r=_,n=_().$utils(),_.duration=function(M,z){var F=_.locale();return g(M,{$l:F},z)},_.isDuration=p;var L=C.prototype.add,O=C.prototype.subtract;C.prototype.add=function(M,z){return p(M)?k(this,M,1):L.bind(this)(M,z)},C.prototype.subtract=function(M,z){return p(M)?k(this,M,-1):O.bind(this)(M,z)}}}))})(gS)),gS.exports}var Ust=Wst();const Hst=Os(Ust);var XO=(function(){var t=T(function(F,A,R,N){for(R=R||{},N=F.length;N--;R[F[N]]=A);return R},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],a=[1,29],s=[1,30],o=[1,31],l=[1,32],u=[1,33],h=[1,34],d=[1,9],f=[1,10],p=[1,11],g=[1,12],m=[1,13],y=[1,14],v=[1,15],x=[1,16],b=[1,19],w=[1,20],k=[1,21],S=[1,22],C=[1,23],_=[1,25],L=[1,35],O={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:T(function(A,R,N,D,I,$,B){var P=$.length-1;switch(I){case 1:return $[P-1];case 2:this.$=[];break;case 3:$[P-1].push($[P]),this.$=$[P-1];break;case 4:case 5:this.$=$[P];break;case 6:case 7:this.$=[];break;case 8:D.setWeekday("monday");break;case 9:D.setWeekday("tuesday");break;case 10:D.setWeekday("wednesday");break;case 11:D.setWeekday("thursday");break;case 12:D.setWeekday("friday");break;case 13:D.setWeekday("saturday");break;case 14:D.setWeekday("sunday");break;case 15:D.setWeekend("friday");break;case 16:D.setWeekend("saturday");break;case 17:D.setDateFormat($[P].substr(11)),this.$=$[P].substr(11);break;case 18:D.enableInclusiveEndDates(),this.$=$[P].substr(18);break;case 19:D.TopAxis(),this.$=$[P].substr(8);break;case 20:D.setAxisFormat($[P].substr(11)),this.$=$[P].substr(11);break;case 21:D.setTickInterval($[P].substr(13)),this.$=$[P].substr(13);break;case 22:D.setExcludes($[P].substr(9)),this.$=$[P].substr(9);break;case 23:D.setIncludes($[P].substr(9)),this.$=$[P].substr(9);break;case 24:D.setTodayMarker($[P].substr(12)),this.$=$[P].substr(12);break;case 27:D.setDiagramTitle($[P].substr(6)),this.$=$[P].substr(6);break;case 28:this.$=$[P].trim(),D.setAccTitle(this.$);break;case 29:case 30:this.$=$[P].trim(),D.setAccDescription(this.$);break;case 31:D.addSection($[P].substr(8)),this.$=$[P].substr(8);break;case 33:D.addTask($[P-1],$[P]),this.$="task";break;case 34:this.$=$[P-1],D.setClickEvent($[P-1],$[P],null);break;case 35:this.$=$[P-2],D.setClickEvent($[P-2],$[P-1],$[P]);break;case 36:this.$=$[P-2],D.setClickEvent($[P-2],$[P-1],null),D.setLink($[P-2],$[P]);break;case 37:this.$=$[P-3],D.setClickEvent($[P-3],$[P-2],$[P-1]),D.setLink($[P-3],$[P]);break;case 38:this.$=$[P-2],D.setClickEvent($[P-2],$[P],null),D.setLink($[P-2],$[P-1]);break;case 39:this.$=$[P-3],D.setClickEvent($[P-3],$[P-1],$[P]),D.setLink($[P-3],$[P-2]);break;case 40:this.$=$[P-1],D.setLink($[P-1],$[P]);break;case 41:case 47:this.$=$[P-1]+" "+$[P];break;case 42:case 43:case 45:this.$=$[P-2]+" "+$[P-1]+" "+$[P];break;case 44:case 46:this.$=$[P-3]+" "+$[P-2]+" "+$[P-1]+" "+$[P];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:x,30:b,31:w,33:k,35:S,36:C,37:24,38:_,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:x,30:b,31:w,33:k,35:S,36:C,37:24,38:_,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:T(function(A,R){if(R.recoverable)this.trace(A);else{var N=new Error(A);throw N.hash=R,N}},"parseError"),parse:T(function(A){var R=this,N=[0],D=[],I=[null],$=[],B=this.table,P="",G=0,V=0,X=2,W=1,ie=$.slice.call(arguments,1),K=Object.create(this.lexer),se={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(se.yy[J]=this.yy[J]);K.setInput(A,se.yy),se.yy.lexer=K,se.yy.parser=this,typeof K.yylloc>"u"&&(K.yylloc={});var Z=K.yylloc;$.push(Z);var ee=K.options&&K.options.ranges;typeof se.yy.parseError=="function"?this.parseError=se.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ne(Ve){N.length=N.length-2*Ve,I.length=I.length-Ve,$.length=$.length-Ve}T(ne,"popStack");function ue(){var Ve;return Ve=D.pop()||K.lex()||W,typeof Ve!="number"&&(Ve instanceof Array&&(D=Ve,Ve=D.pop()),Ve=R.symbols_[Ve]||Ve),Ve}T(ue,"lex");for(var fe,_e,Ae,Ne,me={},ve,Ge,Te,Ze;;){if(_e=N[N.length-1],this.defaultActions[_e]?Ae=this.defaultActions[_e]:((fe===null||typeof fe>"u")&&(fe=ue()),Ae=B[_e]&&B[_e][fe]),typeof Ae>"u"||!Ae.length||!Ae[0]){var ke="";Ze=[];for(ve in B[_e])this.terminals_[ve]&&ve>X&&Ze.push("'"+this.terminals_[ve]+"'");K.showPosition?ke="Parse error on line "+(G+1)+`: `+K.showPosition()+` -Expecting `+Ze.join(", ")+", got '"+(this.terminals_[fe]||fe)+"'":ke="Parse error on line "+(G+1)+": Unexpected "+(fe==W?"end of input":"'"+(this.terminals_[fe]||fe)+"'"),this.parseError(ke,{text:K.match,token:this.terminals_[fe]||fe,line:K.yylineno,loc:Z,expected:Ze})}if(Ae[0]instanceof Array&&Ae.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_e+", token: "+fe);switch(Ae[0]){case 1:N.push(fe),I.push(K.yytext),$.push(K.yylloc),N.push(Ae[1]),fe=null,V=K.yyleng,P=K.yytext,G=K.yylineno,Z=K.yylloc;break;case 2:if(Ge=this.productions_[Ae[1]][1],me.$=I[I.length-Ge],me._$={first_line:$[$.length-(Ge||1)].first_line,last_line:$[$.length-1].last_line,first_column:$[$.length-(Ge||1)].first_column,last_column:$[$.length-1].last_column},ee&&(me._$.range=[$[$.length-(Ge||1)].range[0],$[$.length-1].range[1]]),Ne=this.performAction.apply(me,[P,V,G,se.yy,Ae[1],I,$].concat(ie)),typeof Ne<"u")return Ne;Ge&&(N=N.slice(0,-1*Ge*2),I=I.slice(0,-1*Ge),$=$.slice(0,-1*Ge)),N.push(this.productions_[Ae[1]][0]),I.push(me.$),$.push(me._$),Te=B[N[N.length-2]][N[N.length-1]],N.push(Te);break;case 3:return!0}}return!0},"parse")},M=(function(){var F={EOF:1,parseError:x(function(R,N){if(this.yy.parser)this.yy.parser.parseError(R,N);else throw new Error(R)},"parseError"),setInput:x(function(S,R){return this.yy=R||this.yy||{},this._input=S,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var S=this._input[0];this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S;var R=S.match(/(?:\r\n?|\n).*/g);return R?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),S},"input"),unput:x(function(S){var R=S.length,N=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-R),this.offset-=R;var D=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),N.length-1&&(this.yylineno-=N.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:N?(N.length===D.length?this.yylloc.first_column:0)+D[D.length-N.length].length-N[0].length:this.yylloc.first_column-R},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-R]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(S){this.unput(this.match.slice(S))},"less"),pastInput:x(function(){var S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var S=this.match;return S.length<20&&(S+=this._input.substr(0,20-S.length)),(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var S=this.pastInput(),R=new Array(S.length+1).join("-");return S+this.upcomingInput()+` -`+R+"^"},"showPosition"),test_match:x(function(S,R){var N,D,I;if(this.options.backtrack_lexer&&(I={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(I.yylloc.range=this.yylloc.range.slice(0))),D=S[0].match(/(?:\r\n?|\n).*/g),D&&(this.yylineno+=D.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:D?D[D.length-1].length-D[D.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+S[0].length},this.yytext+=S[0],this.match+=S[0],this.matches=S,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(S[0].length),this.matched+=S[0],N=this.performAction.call(this,this.yy,this,R,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),N)return N;if(this._backtrack){for(var $ in I)this[$]=I[$];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var S,R,N,D;this._more||(this.yytext="",this.match="");for(var I=this._currentRules(),$=0;$R[0].length)){if(R=N,D=$,this.options.backtrack_lexer){if(S=this.test_match(N,I[$]),S!==!1)return S;if(this._backtrack){R=!1;continue}else return!1}else if(!this.options.flex)break}return R?(S=this.test_match(R,I[D]),S!==!1?S:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var R=this.next();return R||this.lex()},"lex"),begin:x(function(R){this.conditionStack.push(R)},"begin"),popState:x(function(){var R=this.conditionStack.length-1;return R>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(R){return R=this.conditionStack.length-1-Math.abs(R||0),R>=0?this.conditionStack[R]:"INITIAL"},"topState"),pushState:x(function(R){this.begin(R)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(R,N,D,I){switch(D){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return F})();O.lexer=M;function z(){this.yy={}}return x(z,"Parser"),z.prototype=O,O.Parser=z,new z})();VO.parser=VO;var Nst=VO;Yi.extend(Tst),Yi.extend(Est),Yi.extend(Rst);var tge={friday:5,saturday:6},ic="",WO="",UO=void 0,HO="",qT=[],VT=[],YO=new Map,XO=[],fS=[],jg="",KO="",rge=["active","done","crit","milestone","vert"],jO=[],Zg="",WT=!1,ZO=!1,QO="sunday",pS="saturday",JO=0,Ost=x(function(){XO=[],fS=[],jg="",jO=[],gS=0,t$=void 0,mS=void 0,Ui=[],ic="",WO="",KO="",UO=void 0,HO="",qT=[],VT=[],WT=!1,ZO=!1,JO=0,YO=new Map,Zg="",In(),QO="sunday",pS="saturday"},"clear"),$st=x(function(t){Zg=t},"setDiagramId"),Pst=x(function(t){WO=t},"setAxisFormat"),Bst=x(function(){return WO},"getAxisFormat"),Fst=x(function(t){UO=t},"setTickInterval"),zst=x(function(){return UO},"getTickInterval"),Gst=x(function(t){HO=t},"setTodayMarker"),qst=x(function(){return HO},"getTodayMarker"),Vst=x(function(t){ic=t},"setDateFormat"),Wst=x(function(){WT=!0},"enableInclusiveEndDates"),Ust=x(function(){return WT},"endDatesAreInclusive"),Hst=x(function(){ZO=!0},"enableTopAxis"),Yst=x(function(){return ZO},"topAxisEnabled"),Xst=x(function(t){KO=t},"setDisplayMode"),Kst=x(function(){return KO},"getDisplayMode"),jst=x(function(){return ic},"getDateFormat"),Zst=x(function(t){qT=t.toLowerCase().split(/[\s,]+/)},"setIncludes"),Qst=x(function(){return qT},"getIncludes"),Jst=x(function(t){VT=t.toLowerCase().split(/[\s,]+/)},"setExcludes"),eot=x(function(){return VT},"getExcludes"),tot=x(function(){return YO},"getLinks"),rot=x(function(t){jg=t,XO.push(t)},"addSection"),not=x(function(){return XO},"getSections"),iot=x(function(){let t=lge();const e=10;let r=0;for(;!t&&ro))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,s]},"fixTaskDates"),e$=x(function(t,e,r){if(r=r.trim(),x(o=>{const l=o.trim();return l==="x"||l==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(r))return new Date(Number(r));const a=/^after\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let o=null;for(const u of a.groups.ids.split(" ")){let h=Qf(u);h!==void 0&&(!o||h.endTime>o.endTime)&&(o=h)}if(o)return o.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let s=Yi(r,e.trim(),!0);if(s.isValid())return s.toDate();{ae.debug("Invalid date:"+r),ae.debug("With date format:"+e.trim());const o=new Date(r);if(o===void 0||isNaN(o.getTime())||o.getFullYear()<-1e4||o.getFullYear()>1e4)throw new Error("Invalid date:"+r);return o}},"getStartDate"),age=x(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),sge=x(function(t,e,r,n=!1){r=r.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let h=null;for(const f of a.groups.ids.split(" ")){let p=Qf(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),YO.set(n,r))}),cge(t,"clickable")},"setLink"),cge=x(function(t,e){t.split(",").forEach(function(r){let n=Qf(r);n!==void 0&&n.classes.push(e)})},"setClass"),pot=x(function(t,e,r){if(Pe().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{Lr.runFunc(e,...n)})},"setClickFun"),uge=x(function(t,e){jO.push(function(){const r=Zg?`${Zg}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=Zg?`${Zg}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),got=x(function(t,e,r){t.split(",").forEach(function(n){pot(n,e,r)}),cge(t,"clickable")},"setClickEvent"),mot=x(function(t){jO.forEach(function(e){e(t)})},"bindFunctions"),yot={getConfig:x(()=>Pe().gantt,"getConfig"),clear:Ost,setDateFormat:Vst,getDateFormat:jst,enableInclusiveEndDates:Wst,endDatesAreInclusive:Ust,enableTopAxis:Hst,topAxisEnabled:Yst,setAxisFormat:Pst,getAxisFormat:Bst,setTickInterval:Fst,getTickInterval:zst,setTodayMarker:Gst,getTodayMarker:qst,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,setDiagramId:$st,setDisplayMode:Xst,getDisplayMode:Kst,setAccDescription:zn,getAccDescription:Gn,addSection:rot,getSections:not,getTasks:iot,addTask:hot,findTaskById:Qf,addTaskOrg:dot,setIncludes:Zst,getIncludes:Qst,setExcludes:Jst,getExcludes:eot,setClickEvent:got,setLink:fot,getLinks:tot,bindFunctions:mot,parseDuration:age,isInvalidDate:nge,setWeekday:aot,getWeekday:sot,setWeekend:oot};function r$(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const a="^\\s*"+i+"\\s*$",s=new RegExp(a);t[0].match(s)&&(e[i]=!0,t.shift(1),n=!0)})}x(r$,"getTaskTags"),Yi.extend(Mst);var vot=x(function(){ae.debug("Something is calling, setConf, remove the call")},"setConf"),hge={monday:S2,tuesday:YF,wednesday:XF,thursday:td,friday:KF,saturday:jF,sunday:E2},bot=x((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,s)=>a.startTime-s.startTime||a.order-s.order),i=0;for(const a of n)for(let s=0;s=r[s]){r[s]=a.endTime,a.order=s+e,s>i&&(i=s);break}return i},"getMaxIntersections"),du,n$=1e4,xot=x(function(t,e,r,n){const i=Pe().gantt;n.db.setDiagramId(e);const a=Pe().securityLevel;let s;a==="sandbox"&&(s=pt("#i"+e));const o=pt(a==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document,u=l.getElementById(e);du=u.parentElement.offsetWidth,du===void 0&&(du=1200),i.useWidth!==void 0&&(du=i.useWidth);const h=n.db.getTasks();let d=[];for(const L of h)d.push(L.type);d=_(d);const f={};let p=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const L={};for(const M of h)L[M.section]===void 0?L[M.section]=[M]:L[M.section].push(M);let O=0;for(const M of Object.keys(L)){const z=bot(L[M],O)+1;O+=z,p+=z*(i.barHeight+i.barGap),f[M]=z}}else{p+=h.length*(i.barHeight+i.barGap);for(const L of d)f[L]=h.filter(O=>O.type===L).length}u.setAttribute("viewBox","0 0 "+du+" "+p);const g=o.select(`[id="${e}"]`),m=_3e().domain([Fxe(h,function(L){return L.startTime}),Bxe(h,function(L){return L.endTime})]).rangeRound([0,du-i.leftPadding-i.rightPadding]);function y(L,O){const M=L.startTime,z=O.startTime;let F=0;return M>z?F=1:MP.vert===G.vert?0:P.vert?1:-1);const D=[...new Set(L.map(P=>P.order))].map(P=>L.find(G=>G.order===P));g.append("g").selectAll("rect").data(D).enter().append("rect").attr("x",0).attr("y",function(P,G){return G=P.order,G*O+M-2}).attr("width",function(){return R-i.rightPadding/2}).attr("height",O).attr("class",function(P){for(const[G,V]of d.entries())if(P.type===V)return"section section"+G%i.numberSectionStyles;return"section section0"}).enter();const I=g.append("g").selectAll("rect").data(L).enter(),$=n.db.getLinks();if(I.append("rect").attr("id",function(P){return e+"-"+P.id}).attr("rx",3).attr("ry",3).attr("x",function(P){return P.milestone?m(P.startTime)+z+.5*(m(P.endTime)-m(P.startTime))-.5*F:m(P.startTime)+z}).attr("y",function(P,G){return G=P.order,P.vert?i.gridLineStartPadding:G*O+M}).attr("width",function(P){return P.milestone?F:P.vert?.08*F:m(P.renderEndTime||P.endTime)-m(P.startTime)}).attr("height",function(P){return P.vert?h.length*(i.barHeight+i.barGap)+i.barHeight*2:F}).attr("transform-origin",function(P,G){return G=P.order,(m(P.startTime)+z+.5*(m(P.endTime)-m(P.startTime))).toString()+"px "+(G*O+M+.5*F).toString()+"px"}).attr("class",function(P){const G="task";let V="";P.classes.length>0&&(V=P.classes.join(" "));let Y=0;for(const[ie,K]of d.entries())P.type===K&&(Y=ie%i.numberSectionStyles);let W="";return P.active?P.crit?W+=" activeCrit":W=" active":P.done?P.crit?W=" doneCrit":W=" done":P.crit&&(W+=" crit"),W.length===0&&(W=" task"),P.milestone&&(W=" milestone "+W),P.vert&&(W=" vert "+W),W+=Y,W+=" "+V,G+W}),I.append("text").attr("id",function(P){return e+"-"+P.id+"-text"}).text(function(P){return P.task}).attr("font-size",i.fontSize).attr("x",function(P){let G=m(P.startTime),V=m(P.renderEndTime||P.endTime);if(P.milestone&&(G+=.5*(m(P.endTime)-m(P.startTime))-.5*F,V=G+F),P.vert)return m(P.startTime)+z;const Y=this.getBBox().width;return Y>V-G?V+Y+1.5*i.leftPadding>R?G+z-5:V+z+5:(V-G)/2+G+z}).attr("y",function(P,G){return P.vert?i.gridLineStartPadding+h.length*(i.barHeight+i.barGap)+60:(G=P.order,G*O+i.barHeight/2+(i.fontSize/2-2)+M)}).attr("text-height",F).attr("class",function(P){const G=m(P.startTime);let V=m(P.endTime);P.milestone&&(V=G+F);const Y=this.getBBox().width;let W="";P.classes.length>0&&(W=P.classes.join(" "));let ie=0;for(const[se,J]of d.entries())P.type===J&&(ie=se%i.numberSectionStyles);let K="";return P.active&&(P.crit?K="activeCritText"+ie:K="activeText"+ie),P.done?P.crit?K=K+" doneCritText"+ie:K=K+" doneText"+ie:P.crit&&(K=K+" critText"+ie),P.milestone&&(K+=" milestoneText"),P.vert&&(K+=" vertText"),Y>V-G?V+Y+1.5*i.leftPadding>R?W+" taskTextOutsideLeft taskTextOutside"+ie+" "+K:W+" taskTextOutsideRight taskTextOutside"+ie+" "+K+" width-"+Y:W+" taskText taskText"+ie+" "+K+" width-"+Y}),Pe().securityLevel==="sandbox"){let P;P=pt("#i"+e);const G=P.nodes()[0].contentDocument;I.filter(function(V){return $.has(V.id)}).each(function(V){var Y=G.querySelector("#"+CSS.escape(e+"-"+V.id)),W=G.querySelector("#"+CSS.escape(e+"-"+V.id+"-text"));const ie=Y.parentNode;var K=G.createElement("a");K.setAttribute("xlink:href",$.get(V.id)),K.setAttribute("target","_top"),ie.appendChild(K),K.appendChild(Y),K.appendChild(W)})}}x(T,"drawRects");function b(L,O,M,z,F,S,R,N){if(R.length===0&&N.length===0)return;let D,I;for(const{startTime:Y,endTime:W}of S)(D===void 0||YI)&&(I=W);if(!D||!I)return;if(Yi(I).diff(Yi(D),"year")>5){ae.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const $=n.db.getDateFormat(),B=[];let P=null,G=Yi(D);for(;G.valueOf()<=I;)n.db.isInvalidDate(G,$,R,N)?P?P.end=G:P={start:G,end:G}:P&&(B.push(P),P=null),G=G.add(1,"d");g.append("g").selectAll("rect").data(B).enter().append("rect").attr("id",Y=>e+"-exclude-"+Y.start.format("YYYY-MM-DD")).attr("x",Y=>m(Y.start.startOf("day"))+M).attr("y",i.gridLineStartPadding).attr("width",Y=>m(Y.end.endOf("day"))-m(Y.start.startOf("day"))).attr("height",F-O-i.gridLineStartPadding).attr("transform-origin",function(Y,W){return(m(Y.start)+M+.5*(m(Y.end)-m(Y.start))).toString()+"px "+(W*L+.5*F).toString()+"px"}).attr("class","exclude-range")}x(b,"drawExcludeDays");function w(L,O,M,z){if(M<=0||L>O)return 1/0;const F=O-L,S=Yi.duration({[z??"day"]:M}).asMilliseconds();return S<=0?1/0:Math.ceil(F/S)}x(w,"getEstimatedTickCount");function k(L,O,M,z){const F=n.db.getDateFormat(),S=n.db.getAxisFormat();let R;S?R=S:F==="D"?R="%d":R=i.axisFormat??"%Y-%m-%d";let N=Xxe(m).tickSize(-z+O+i.gridLineStartPadding).tickFormat(l4(R));const I=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(I!==null){const $=parseInt(I[1],10);if(isNaN($)||$<=0)ae.warn(`Invalid tick interval value: "${I[1]}". Skipping custom tick interval.`);else{const B=I[2],P=n.db.getWeekday()||i.weekday,G=m.domain(),V=G[0],Y=G[1],W=w(V,Y,$,B);if(W>n$)ae.warn(`The tick interval "${$}${B}" would generate ${W} ticks, which exceeds the maximum allowed (${n$}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(B){case"millisecond":N.ticks(M0.every($));break;case"second":N.ticks(Su.every($));break;case"minute":N.ticks(C2.every($));break;case"hour":N.ticks(k2.every($));break;case"day":N.ticks(Jh.every($));break;case"week":N.ticks(hge[P].every($));break;case"month":N.ticks(A2.every($));break}}}if(g.append("g").attr("class","grid").attr("transform","translate("+L+", "+(z-50)+")").call(N).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let $=Yxe(m).tickSize(-z+O+i.gridLineStartPadding).tickFormat(l4(R));if(I!==null){const B=parseInt(I[1],10);if(isNaN(B)||B<=0)ae.warn(`Invalid tick interval value: "${I[1]}". Skipping custom tick interval.`);else{const P=I[2],G=n.db.getWeekday()||i.weekday,V=m.domain(),Y=V[0],W=V[1];if(w(Y,W,B,P)<=n$)switch(P){case"millisecond":$.ticks(M0.every(B));break;case"second":$.ticks(Su.every(B));break;case"minute":$.ticks(C2.every(B));break;case"hour":$.ticks(k2.every(B));break;case"day":$.ticks(Jh.every(B));break;case"week":$.ticks(hge[G].every(B));break;case"month":$.ticks(A2.every(B));break}}}g.append("g").attr("class","grid").attr("transform","translate("+L+", "+O+")").call($).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}x(k,"makeGrid");function A(L,O){let M=0;const z=Object.keys(f).map(F=>[F,f[F]]);g.append("g").selectAll("text").data(z).enter().append(function(F){const S=F[0].split(Lt.lineBreakRegex),R=-(S.length-1)/2,N=l.createElementNS("http://www.w3.org/2000/svg","text");N.setAttribute("dy",R+"em");for(const[D,I]of S.entries()){const $=l.createElementNS("http://www.w3.org/2000/svg","tspan");$.setAttribute("alignment-baseline","central"),$.setAttribute("x","10"),D>0&&$.setAttribute("dy","1em"),$.textContent=I,N.appendChild($)}return N}).attr("x",10).attr("y",function(F,S){if(S>0)for(let R=0;R` +Expecting `+Ze.join(", ")+", got '"+(this.terminals_[fe]||fe)+"'":ke="Parse error on line "+(G+1)+": Unexpected "+(fe==W?"end of input":"'"+(this.terminals_[fe]||fe)+"'"),this.parseError(ke,{text:K.match,token:this.terminals_[fe]||fe,line:K.yylineno,loc:Z,expected:Ze})}if(Ae[0]instanceof Array&&Ae.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_e+", token: "+fe);switch(Ae[0]){case 1:N.push(fe),I.push(K.yytext),$.push(K.yylloc),N.push(Ae[1]),fe=null,V=K.yyleng,P=K.yytext,G=K.yylineno,Z=K.yylloc;break;case 2:if(Ge=this.productions_[Ae[1]][1],me.$=I[I.length-Ge],me._$={first_line:$[$.length-(Ge||1)].first_line,last_line:$[$.length-1].last_line,first_column:$[$.length-(Ge||1)].first_column,last_column:$[$.length-1].last_column},ee&&(me._$.range=[$[$.length-(Ge||1)].range[0],$[$.length-1].range[1]]),Ne=this.performAction.apply(me,[P,V,G,se.yy,Ae[1],I,$].concat(ie)),typeof Ne<"u")return Ne;Ge&&(N=N.slice(0,-1*Ge*2),I=I.slice(0,-1*Ge),$=$.slice(0,-1*Ge)),N.push(this.productions_[Ae[1]][0]),I.push(me.$),$.push(me._$),Te=B[N[N.length-2]][N[N.length-1]],N.push(Te);break;case 3:return!0}}return!0},"parse")},M=(function(){var F={EOF:1,parseError:T(function(R,N){if(this.yy.parser)this.yy.parser.parseError(R,N);else throw new Error(R)},"parseError"),setInput:T(function(A,R){return this.yy=R||this.yy||{},this._input=A,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var A=this._input[0];this.yytext+=A,this.yyleng++,this.offset++,this.match+=A,this.matched+=A;var R=A.match(/(?:\r\n?|\n).*/g);return R?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),A},"input"),unput:T(function(A){var R=A.length,N=A.split(/(?:\r\n?|\n)/g);this._input=A+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-R),this.offset-=R;var D=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),N.length-1&&(this.yylineno-=N.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:N?(N.length===D.length?this.yylloc.first_column:0)+D[D.length-N.length].length-N[0].length:this.yylloc.first_column-R},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-R]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(A){this.unput(this.match.slice(A))},"less"),pastInput:T(function(){var A=this.matched.substr(0,this.matched.length-this.match.length);return(A.length>20?"...":"")+A.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var A=this.match;return A.length<20&&(A+=this._input.substr(0,20-A.length)),(A.substr(0,20)+(A.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var A=this.pastInput(),R=new Array(A.length+1).join("-");return A+this.upcomingInput()+` +`+R+"^"},"showPosition"),test_match:T(function(A,R){var N,D,I;if(this.options.backtrack_lexer&&(I={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(I.yylloc.range=this.yylloc.range.slice(0))),D=A[0].match(/(?:\r\n?|\n).*/g),D&&(this.yylineno+=D.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:D?D[D.length-1].length-D[D.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+A[0].length},this.yytext+=A[0],this.match+=A[0],this.matches=A,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(A[0].length),this.matched+=A[0],N=this.performAction.call(this,this.yy,this,R,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),N)return N;if(this._backtrack){for(var $ in I)this[$]=I[$];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var A,R,N,D;this._more||(this.yytext="",this.match="");for(var I=this._currentRules(),$=0;$R[0].length)){if(R=N,D=$,this.options.backtrack_lexer){if(A=this.test_match(N,I[$]),A!==!1)return A;if(this._backtrack){R=!1;continue}else return!1}else if(!this.options.flex)break}return R?(A=this.test_match(R,I[D]),A!==!1?A:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var R=this.next();return R||this.lex()},"lex"),begin:T(function(R){this.conditionStack.push(R)},"begin"),popState:T(function(){var R=this.conditionStack.length-1;return R>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(R){return R=this.conditionStack.length-1-Math.abs(R||0),R>=0?this.conditionStack[R]:"INITIAL"},"topState"),pushState:T(function(R){this.begin(R)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(R,N,D,I){switch(D){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return F})();O.lexer=M;function z(){this.yy={}}return T(z,"Parser"),z.prototype=O,O.Parser=z,new z})();XO.parser=XO;var Yst=XO;Yi.extend(Nst),Yi.extend(Bst),Yi.extend(qst);var oge={friday:5,saturday:6},ic="",KO="",jO=void 0,ZO="",WT=[],UT=[],QO=new Map,JO=[],mS=[],Zg="",e$="",lge=["active","done","crit","milestone","vert"],t$=[],Qg="",HT=!1,r$=!1,n$="sunday",yS="saturday",i$=0,Xst=T(function(){JO=[],mS=[],Zg="",t$=[],vS=0,s$=void 0,bS=void 0,Ui=[],ic="",KO="",e$="",jO=void 0,ZO="",WT=[],UT=[],HT=!1,r$=!1,i$=0,QO=new Map,Qg="",In(),n$="sunday",yS="saturday"},"clear"),Kst=T(function(t){Qg=t},"setDiagramId"),jst=T(function(t){KO=t},"setAxisFormat"),Zst=T(function(){return KO},"getAxisFormat"),Qst=T(function(t){jO=t},"setTickInterval"),Jst=T(function(){return jO},"getTickInterval"),eot=T(function(t){ZO=t},"setTodayMarker"),tot=T(function(){return ZO},"getTodayMarker"),rot=T(function(t){ic=t},"setDateFormat"),not=T(function(){HT=!0},"enableInclusiveEndDates"),iot=T(function(){return HT},"endDatesAreInclusive"),aot=T(function(){r$=!0},"enableTopAxis"),sot=T(function(){return r$},"topAxisEnabled"),oot=T(function(t){e$=t},"setDisplayMode"),lot=T(function(){return e$},"getDisplayMode"),cot=T(function(){return ic},"getDateFormat"),uot=T(function(t){WT=t.toLowerCase().split(/[\s,]+/)},"setIncludes"),hot=T(function(){return WT},"getIncludes"),dot=T(function(t){UT=t.toLowerCase().split(/[\s,]+/)},"setExcludes"),fot=T(function(){return UT},"getExcludes"),pot=T(function(){return QO},"getLinks"),got=T(function(t){Zg=t,JO.push(t)},"addSection"),mot=T(function(){return JO},"getSections"),yot=T(function(){let t=pge();const e=10;let r=0;for(;!t&&ro))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,s]},"fixTaskDates"),a$=T(function(t,e,r){if(r=r.trim(),T(o=>{const l=o.trim();return l==="x"||l==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(r))return new Date(Number(r));const a=/^after\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let o=null;for(const u of a.groups.ids.split(" ")){let h=Qf(u);h!==void 0&&(!o||h.endTime>o.endTime)&&(o=h)}if(o)return o.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let s=Yi(r,e.trim(),!0);if(s.isValid())return s.toDate();{ae.debug("Invalid date:"+r),ae.debug("With date format:"+e.trim());const o=new Date(r);if(o===void 0||isNaN(o.getTime())||o.getFullYear()<-1e4||o.getFullYear()>1e4)throw new Error("Invalid date:"+r);return o}},"getStartDate"),hge=T(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),dge=T(function(t,e,r,n=!1){r=r.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let h=null;for(const f of a.groups.ids.split(" ")){let p=Qf(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),QO.set(n,r))}),gge(t,"clickable")},"setLink"),gge=T(function(t,e){t.split(",").forEach(function(r){let n=Qf(r);n!==void 0&&n.classes.push(e)})},"setClass"),Aot=T(function(t,e,r){if(Pe().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{Lr.runFunc(e,...n)})},"setClickFun"),mge=T(function(t,e){t$.push(function(){const r=Qg?`${Qg}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=Qg?`${Qg}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),_ot=T(function(t,e,r){t.split(",").forEach(function(n){Aot(n,e,r)}),gge(t,"clickable")},"setClickEvent"),Rot=T(function(t){t$.forEach(function(e){e(t)})},"bindFunctions"),Lot={getConfig:T(()=>Pe().gantt,"getConfig"),clear:Xst,setDateFormat:rot,getDateFormat:cot,enableInclusiveEndDates:not,endDatesAreInclusive:iot,enableTopAxis:aot,topAxisEnabled:sot,setAxisFormat:jst,getAxisFormat:Zst,setTickInterval:Qst,getTickInterval:Jst,setTodayMarker:eot,getTodayMarker:tot,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,setDiagramId:Kst,setDisplayMode:oot,getDisplayMode:lot,setAccDescription:zn,getAccDescription:Gn,addSection:got,getSections:mot,getTasks:yot,addTask:kot,findTaskById:Qf,addTaskOrg:Eot,setIncludes:uot,getIncludes:hot,setExcludes:dot,getExcludes:fot,setClickEvent:_ot,setLink:Sot,getLinks:pot,bindFunctions:Rot,parseDuration:hge,isInvalidDate:cge,setWeekday:vot,getWeekday:bot,setWeekend:xot};function o$(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const a="^\\s*"+i+"\\s*$",s=new RegExp(a);t[0].match(s)&&(e[i]=!0,t.shift(1),n=!0)})}T(o$,"getTaskTags"),Yi.extend(Hst);var Iot=T(function(){ae.debug("Something is calling, setConf, remove the call")},"setConf"),yge={monday:A2,tuesday:QF,wednesday:JF,thursday:td,friday:ez,saturday:tz,sunday:S2},Dot=T((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,s)=>a.startTime-s.startTime||a.order-s.order),i=0;for(const a of n)for(let s=0;s=r[s]){r[s]=a.endTime,a.order=s+e,s>i&&(i=s);break}return i},"getMaxIntersections"),du,l$=1e4,Mot=T(function(t,e,r,n){const i=Pe().gantt;n.db.setDiagramId(e);const a=Pe().securityLevel;let s;a==="sandbox"&&(s=pt("#i"+e));const o=pt(a==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document,u=l.getElementById(e);du=u.parentElement.offsetWidth,du===void 0&&(du=1200),i.useWidth!==void 0&&(du=i.useWidth);const h=n.db.getTasks();let d=[];for(const L of h)d.push(L.type);d=_(d);const f={};let p=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const L={};for(const M of h)L[M.section]===void 0?L[M.section]=[M]:L[M.section].push(M);let O=0;for(const M of Object.keys(L)){const z=Dot(L[M],O)+1;O+=z,p+=z*(i.barHeight+i.barGap),f[M]=z}}else{p+=h.length*(i.barHeight+i.barGap);for(const L of d)f[L]=h.filter(O=>O.type===L).length}u.setAttribute("viewBox","0 0 "+du+" "+p);const g=o.select(`[id="${e}"]`),m=N3e().domain([Uxe(h,function(L){return L.startTime}),Wxe(h,function(L){return L.endTime})]).rangeRound([0,du-i.leftPadding-i.rightPadding]);function y(L,O){const M=L.startTime,z=O.startTime;let F=0;return M>z?F=1:MP.vert===G.vert?0:P.vert?1:-1);const D=[...new Set(L.map(P=>P.order))].map(P=>L.find(G=>G.order===P));g.append("g").selectAll("rect").data(D).enter().append("rect").attr("x",0).attr("y",function(P,G){return G=P.order,G*O+M-2}).attr("width",function(){return R-i.rightPadding/2}).attr("height",O).attr("class",function(P){for(const[G,V]of d.entries())if(P.type===V)return"section section"+G%i.numberSectionStyles;return"section section0"}).enter();const I=g.append("g").selectAll("rect").data(L).enter(),$=n.db.getLinks();if(I.append("rect").attr("id",function(P){return e+"-"+P.id}).attr("rx",3).attr("ry",3).attr("x",function(P){return P.milestone?m(P.startTime)+z+.5*(m(P.endTime)-m(P.startTime))-.5*F:m(P.startTime)+z}).attr("y",function(P,G){return G=P.order,P.vert?i.gridLineStartPadding:G*O+M}).attr("width",function(P){return P.milestone?F:P.vert?.08*F:m(P.renderEndTime||P.endTime)-m(P.startTime)}).attr("height",function(P){return P.vert?h.length*(i.barHeight+i.barGap)+i.barHeight*2:F}).attr("transform-origin",function(P,G){return G=P.order,(m(P.startTime)+z+.5*(m(P.endTime)-m(P.startTime))).toString()+"px "+(G*O+M+.5*F).toString()+"px"}).attr("class",function(P){const G="task";let V="";P.classes.length>0&&(V=P.classes.join(" "));let X=0;for(const[ie,K]of d.entries())P.type===K&&(X=ie%i.numberSectionStyles);let W="";return P.active?P.crit?W+=" activeCrit":W=" active":P.done?P.crit?W=" doneCrit":W=" done":P.crit&&(W+=" crit"),W.length===0&&(W=" task"),P.milestone&&(W=" milestone "+W),P.vert&&(W=" vert "+W),W+=X,W+=" "+V,G+W}),I.append("text").attr("id",function(P){return e+"-"+P.id+"-text"}).text(function(P){return P.task}).attr("font-size",i.fontSize).attr("x",function(P){let G=m(P.startTime),V=m(P.renderEndTime||P.endTime);if(P.milestone&&(G+=.5*(m(P.endTime)-m(P.startTime))-.5*F,V=G+F),P.vert)return m(P.startTime)+z;const X=this.getBBox().width;return X>V-G?V+X+1.5*i.leftPadding>R?G+z-5:V+z+5:(V-G)/2+G+z}).attr("y",function(P,G){return P.vert?i.gridLineStartPadding+h.length*(i.barHeight+i.barGap)+60:(G=P.order,G*O+i.barHeight/2+(i.fontSize/2-2)+M)}).attr("text-height",F).attr("class",function(P){const G=m(P.startTime);let V=m(P.endTime);P.milestone&&(V=G+F);const X=this.getBBox().width;let W="";P.classes.length>0&&(W=P.classes.join(" "));let ie=0;for(const[se,J]of d.entries())P.type===J&&(ie=se%i.numberSectionStyles);let K="";return P.active&&(P.crit?K="activeCritText"+ie:K="activeText"+ie),P.done?P.crit?K=K+" doneCritText"+ie:K=K+" doneText"+ie:P.crit&&(K=K+" critText"+ie),P.milestone&&(K+=" milestoneText"),P.vert&&(K+=" vertText"),X>V-G?V+X+1.5*i.leftPadding>R?W+" taskTextOutsideLeft taskTextOutside"+ie+" "+K:W+" taskTextOutsideRight taskTextOutside"+ie+" "+K+" width-"+X:W+" taskText taskText"+ie+" "+K+" width-"+X}),Pe().securityLevel==="sandbox"){let P;P=pt("#i"+e);const G=P.nodes()[0].contentDocument;I.filter(function(V){return $.has(V.id)}).each(function(V){var X=G.querySelector("#"+CSS.escape(e+"-"+V.id)),W=G.querySelector("#"+CSS.escape(e+"-"+V.id+"-text"));const ie=X.parentNode;var K=G.createElement("a");K.setAttribute("xlink:href",$.get(V.id)),K.setAttribute("target","_top"),ie.appendChild(K),K.appendChild(X),K.appendChild(W)})}}T(x,"drawRects");function b(L,O,M,z,F,A,R,N){if(R.length===0&&N.length===0)return;let D,I;for(const{startTime:X,endTime:W}of A)(D===void 0||XI)&&(I=W);if(!D||!I)return;if(Yi(I).diff(Yi(D),"year")>5){ae.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const $=n.db.getDateFormat(),B=[];let P=null,G=Yi(D);for(;G.valueOf()<=I;)n.db.isInvalidDate(G,$,R,N)?P?P.end=G:P={start:G,end:G}:P&&(B.push(P),P=null),G=G.add(1,"d");g.append("g").selectAll("rect").data(B).enter().append("rect").attr("id",X=>e+"-exclude-"+X.start.format("YYYY-MM-DD")).attr("x",X=>m(X.start.startOf("day"))+M).attr("y",i.gridLineStartPadding).attr("width",X=>m(X.end.endOf("day"))-m(X.start.startOf("day"))).attr("height",F-O-i.gridLineStartPadding).attr("transform-origin",function(X,W){return(m(X.start)+M+.5*(m(X.end)-m(X.start))).toString()+"px "+(W*L+.5*F).toString()+"px"}).attr("class","exclude-range")}T(b,"drawExcludeDays");function w(L,O,M,z){if(M<=0||L>O)return 1/0;const F=O-L,A=Yi.duration({[z??"day"]:M}).asMilliseconds();return A<=0?1/0:Math.ceil(F/A)}T(w,"getEstimatedTickCount");function k(L,O,M,z){const F=n.db.getDateFormat(),A=n.db.getAxisFormat();let R;A?R=A:F==="D"?R="%d":R=i.axisFormat??"%Y-%m-%d";let N=eTe(m).tickSize(-z+O+i.gridLineStartPadding).tickFormat(u4(R));const I=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(I!==null){const $=parseInt(I[1],10);if(isNaN($)||$<=0)ae.warn(`Invalid tick interval value: "${I[1]}". Skipping custom tick interval.`);else{const B=I[2],P=n.db.getWeekday()||i.weekday,G=m.domain(),V=G[0],X=G[1],W=w(V,X,$,B);if(W>l$)ae.warn(`The tick interval "${$}${B}" would generate ${W} ticks, which exceeds the maximum allowed (${l$}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(B){case"millisecond":N.ticks(Mp.every($));break;case"second":N.ticks(Su.every($));break;case"minute":N.ticks(k2.every($));break;case"hour":N.ticks(E2.every($));break;case"day":N.ticks(Jh.every($));break;case"week":N.ticks(yge[P].every($));break;case"month":N.ticks(_2.every($));break}}}if(g.append("g").attr("class","grid").attr("transform","translate("+L+", "+(z-50)+")").call(N).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let $=Jxe(m).tickSize(-z+O+i.gridLineStartPadding).tickFormat(u4(R));if(I!==null){const B=parseInt(I[1],10);if(isNaN(B)||B<=0)ae.warn(`Invalid tick interval value: "${I[1]}". Skipping custom tick interval.`);else{const P=I[2],G=n.db.getWeekday()||i.weekday,V=m.domain(),X=V[0],W=V[1];if(w(X,W,B,P)<=l$)switch(P){case"millisecond":$.ticks(Mp.every(B));break;case"second":$.ticks(Su.every(B));break;case"minute":$.ticks(k2.every(B));break;case"hour":$.ticks(E2.every(B));break;case"day":$.ticks(Jh.every(B));break;case"week":$.ticks(yge[G].every(B));break;case"month":$.ticks(_2.every(B));break}}}g.append("g").attr("class","grid").attr("transform","translate("+L+", "+O+")").call($).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}T(k,"makeGrid");function S(L,O){let M=0;const z=Object.keys(f).map(F=>[F,f[F]]);g.append("g").selectAll("text").data(z).enter().append(function(F){const A=F[0].split(Lt.lineBreakRegex),R=-(A.length-1)/2,N=l.createElementNS("http://www.w3.org/2000/svg","text");N.setAttribute("dy",R+"em");for(const[D,I]of A.entries()){const $=l.createElementNS("http://www.w3.org/2000/svg","tspan");$.setAttribute("alignment-baseline","central"),$.setAttribute("x","10"),D>0&&$.setAttribute("dy","1em"),$.textContent=I,N.appendChild($)}return N}).attr("x",10).attr("y",function(F,A){if(A>0)for(let R=0;R` .mermaid-main-font { font-family: ${t.fontFamily}; } @@ -1735,8 +1735,8 @@ Expecting `+Ze.join(", ")+", got '"+(this.terminals_[fe]||fe)+"'":ke="Parse erro fill: ${t.titleColor||t.textColor}; font-family: ${t.fontFamily}; } -`,"getStyles"),Cot=wot,kot={parser:Nst,db:yot,renderer:Tot,styles:Cot};const Eot=Object.freeze(Object.defineProperty({__proto__:null,diagram:kot},Symbol.toStringTag,{value:"Module"}));var Sot={parse:x(async t=>{const e=await Qo("info",t);ae.debug(e)},"parse")},Aot={version:"11.15.0"},_ot=x(()=>Aot.version,"getVersion"),Rot={getVersion:_ot},Lot=x((t,e,r)=>{ae.debug(`rendering info diagram -`+t);const n=ys(e);wi(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),Iot={draw:Lot},Dot={parser:Sot,db:Rot,renderer:Iot};const Mot=Object.freeze(Object.defineProperty({__proto__:null,diagram:Dot},Symbol.toStringTag,{value:"Module"}));var Not=Fr.pie,i$={sections:new Map,showData:!1},yS=i$.sections,a$=i$.showData,Oot=structuredClone(Not),$ot=x(()=>structuredClone(Oot),"getConfig"),Pot=x(()=>{yS=new Map,a$=i$.showData,In()},"clear"),Bot=x(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);yS.has(t)||(yS.set(t,e),ae.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),Fot=x(()=>yS,"getSections"),zot=x(t=>{a$=t},"setShowData"),Got=x(()=>a$,"getShowData"),dge={getConfig:$ot,clear:Pot,setDiagramTitle:qn,getDiagramTitle:Mn,setAccTitle:Dn,getAccTitle:Fn,setAccDescription:zn,getAccDescription:Gn,addSection:Bot,getSections:Fot,setShowData:zot,getShowData:Got},qot=x((t,e)=>{zl(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),Vot={parse:x(async t=>{const e=await Qo("pie",t);ae.debug(e),qot(e,dge)},"parse")},Wot=x(t=>` +`,"getStyles"),$ot=Oot,Pot={parser:Yst,db:Lot,renderer:Not,styles:$ot};const Bot=Object.freeze(Object.defineProperty({__proto__:null,diagram:Pot},Symbol.toStringTag,{value:"Module"}));var Fot={parse:T(async t=>{const e=await Qo("info",t);ae.debug(e)},"parse")},zot={version:"11.15.0"},Got=T(()=>zot.version,"getVersion"),qot={getVersion:Got},Vot=T((t,e,r)=>{ae.debug(`rendering info diagram +`+t);const n=ys(e);wi(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),Wot={draw:Vot},Uot={parser:Fot,db:qot,renderer:Wot};const Hot=Object.freeze(Object.defineProperty({__proto__:null,diagram:Uot},Symbol.toStringTag,{value:"Module"}));var Yot=Fr.pie,c$={sections:new Map,showData:!1},xS=c$.sections,u$=c$.showData,Xot=structuredClone(Yot),Kot=T(()=>structuredClone(Xot),"getConfig"),jot=T(()=>{xS=new Map,u$=c$.showData,In()},"clear"),Zot=T(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);xS.has(t)||(xS.set(t,e),ae.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),Qot=T(()=>xS,"getSections"),Jot=T(t=>{u$=t},"setShowData"),elt=T(()=>u$,"getShowData"),vge={getConfig:Kot,clear:jot,setDiagramTitle:qn,getDiagramTitle:Mn,setAccTitle:Dn,getAccTitle:Fn,setAccDescription:zn,getAccDescription:Gn,addSection:Zot,getSections:Qot,setShowData:Jot,getShowData:elt},tlt=T((t,e)=>{zl(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),rlt={parse:T(async t=>{const e=await Qo("pie",t);ae.debug(e),tlt(e,vge)},"parse")},nlt=T(t=>` .pieCircle{ stroke: ${t.pieStrokeColor}; stroke-width : ${t.pieStrokeWidth}; @@ -1764,25 +1764,25 @@ Expecting `+Ze.join(", ")+", got '"+(this.terminals_[fe]||fe)+"'":ke="Parse erro font-family: ${t.fontFamily}; font-size: ${t.pieLegendTextSize}; } -`,"getStyles"),Uot=Wot,Hot=x(t=>{const e=[...t.values()].reduce((i,a)=>i+a,0),r=[...t.entries()].map(([i,a])=>({label:i,value:a})).filter(i=>i.value/e*100>=1);return V3e().value(i=>i.value).sort(null)(r)},"createPieArcs"),Yot=x((t,e,r,n)=>{var P;ae.debug(`rendering pie chart -`+t);const i=n.db,a=Pe(),s=ti(i.getConfig(),a.pie),o=40,l=18,u=4,h=450,d=h,f=ys(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=xc(g.pieOuterStrokeWidth);m??(m=2);const y=s.textPosition,v=Math.min(d,h)/2-o,T=P0().innerRadius(0).outerRadius(v),b=P0().innerRadius(v*y).outerRadius(v*y);p.append("circle").attr("cx",0).attr("cy",0).attr("r",v+m/2).attr("class","pieOuterCircle");const w=i.getSections(),k=Hot(w),A=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12];let C=0;w.forEach(G=>{C+=G});const _=k.filter(G=>(G.data.value/C*100).toFixed(0)!=="0"),L=Qh(A).domain([...w.keys()]);p.selectAll("mySlices").data(_).enter().append("path").attr("d",T).attr("fill",G=>L(G.data.label)).attr("class","pieCircle"),p.selectAll("mySlices").data(_).enter().append("text").text(G=>(G.data.value/C*100).toFixed(0)+"%").attr("transform",G=>"translate("+b.centroid(G)+")").style("text-anchor","middle").attr("class","slice");const O=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),M=[...w.entries()].map(([G,V])=>({label:G,value:V})),z=p.selectAll(".legend").data(M).enter().append("g").attr("class","legend").attr("transform",(G,V)=>{const Y=l+u,W=Y*M.length/2,ie=12*l,K=V*Y-W;return"translate("+ie+","+K+")"});z.append("rect").attr("width",l).attr("height",l).style("fill",G=>L(G.label)).style("stroke",G=>L(G.label)),z.append("text").attr("x",l+u).attr("y",l-u).text(G=>i.getShowData()?`${G.label} [${G.value}]`:G.label);const F=Math.max(...z.selectAll("text").nodes().map(G=>(G==null?void 0:G.getBoundingClientRect().width)??0)),S=d+o+l+u+F,R=((P=O.node())==null?void 0:P.getBoundingClientRect().width)??0,N=d/2-R/2,D=d/2+R/2,I=Math.min(0,N),B=Math.max(S,D)-I;f.attr("viewBox",`${I} 0 ${B} ${h}`),wi(f,h,B,s.useMaxWidth)},"draw"),Xot={draw:Yot},Kot={parser:Vot,db:dge,renderer:Xot,styles:Uot};const jot=Object.freeze(Object.defineProperty({__proto__:null,diagram:Kot},Symbol.toStringTag,{value:"Module"}));var s$=(function(){var t=x(function(j,pe,re,Be){for(re=re||{},Be=j.length;Be--;re[j[Be]]=pe);return re},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],s=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],o=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],h=[1,37],d=[1,36],f=[1,38],p=[1,35],g=[1,43],m=[1,41],y=[1,45],v=[1,14],T=[1,23],b=[1,18],w=[1,19],k=[1,20],A=[1,21],C=[1,22],_=[1,24],L=[1,25],O=[1,26],M=[1,27],z=[1,28],F=[1,29],S=[1,32],R=[1,33],N=[1,34],D=[1,39],I=[1,40],$=[1,42],B=[1,44],P=[1,63],G=[1,62],V=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Y=[1,66],W=[1,67],ie=[1,68],K=[1,69],se=[1,70],J=[1,71],Z=[1,72],ee=[1,73],ne=[1,74],ue=[1,75],fe=[1,76],_e=[1,77],Ae=[4,5,6,7,8,9,10,11,12,13,14,15,18],Ne=[1,91],me=[1,92],ve=[1,93],Ge=[1,100],Te=[1,94],Ze=[1,97],ke=[1,95],Ve=[1,96],Qe=[1,98],nt=[1,99],tt=[1,103],je=[10,55,56,57],Ce=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],Se={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:x(function(pe,re,Be,xe,Ue,De,qe){var Le=De.length-1;switch(Ue){case 23:this.$=De[Le];break;case 24:this.$=De[Le-1]+""+De[Le];break;case 26:this.$=De[Le-1]+De[Le];break;case 27:this.$=[De[Le].trim()];break;case 28:De[Le-2].push(De[Le].trim()),this.$=De[Le-2];break;case 29:this.$=De[Le-4],xe.addClass(De[Le-2],De[Le]);break;case 37:this.$=[];break;case 42:this.$=De[Le].trim(),xe.setDiagramTitle(this.$);break;case 43:this.$=De[Le].trim(),xe.setAccTitle(this.$);break;case 44:case 45:this.$=De[Le].trim(),xe.setAccDescription(this.$);break;case 46:xe.addSection(De[Le].substr(8)),this.$=De[Le].substr(8);break;case 47:xe.addPoint(De[Le-3],"",De[Le-1],De[Le],[]);break;case 48:xe.addPoint(De[Le-4],De[Le-3],De[Le-1],De[Le],[]);break;case 49:xe.addPoint(De[Le-4],"",De[Le-2],De[Le-1],De[Le]);break;case 50:xe.addPoint(De[Le-5],De[Le-4],De[Le-2],De[Le-1],De[Le]);break;case 51:xe.setXAxisLeftText(De[Le-2]),xe.setXAxisRightText(De[Le]);break;case 52:De[Le-1].text+=" ⟶ ",xe.setXAxisLeftText(De[Le-1]);break;case 53:xe.setXAxisLeftText(De[Le]);break;case 54:xe.setYAxisBottomText(De[Le-2]),xe.setYAxisTopText(De[Le]);break;case 55:De[Le-1].text+=" ⟶ ",xe.setYAxisBottomText(De[Le-1]);break;case 56:xe.setYAxisBottomText(De[Le]);break;case 57:xe.setQuadrant1Text(De[Le]);break;case 58:xe.setQuadrant2Text(De[Le]);break;case 59:xe.setQuadrant3Text(De[Le]);break;case 60:xe.setQuadrant4Text(De[Le]);break;case 64:this.$={text:De[Le],type:"text"};break;case 65:this.$={text:De[Le-1].text+""+De[Le],type:De[Le-1].type};break;case 66:this.$={text:De[Le],type:"text"};break;case 67:this.$={text:De[Le],type:"markdown"};break;case 68:this.$=De[Le];break;case 69:this.$=De[Le-1]+""+De[Le];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:a},{18:e,26:9,27:2,28:r,55:n,56:i,57:a},t(s,[2,33],{29:10}),t(o,[2,61]),t(o,[2,62]),t(o,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:T,35:b,37:w,39:k,41:A,42:C,48:_,50:L,51:O,52:M,53:z,54:F,60:S,61:R,63:N,64:D,65:I,66:$,67:B}),t(s,[2,34]),{27:46,55:n,56:i,57:a},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:T,35:b,37:w,39:k,41:A,42:C,48:_,50:L,51:O,52:M,53:z,54:F,60:S,61:R,63:N,64:D,65:I,66:$,67:B}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:52,58:31,60:S,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:53,58:31,60:S,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:54,58:31,60:S,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:55,58:31,60:S,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:56,58:31,60:S,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:57,58:31,60:S,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,44:[1,58],47:[1,59],58:61,59:60,63:N,64:D,65:I,66:$,67:B},t(V,[2,64]),t(V,[2,66]),t(V,[2,67]),t(V,[2,70]),t(V,[2,71]),t(V,[2,72]),t(V,[2,73]),t(V,[2,74]),t(V,[2,75]),t(V,[2,76]),t(V,[2,77]),t(V,[2,78]),t(V,[2,79]),t(V,[2,80]),t(V,[2,81]),t(s,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:Y,5:W,6:ie,7:K,8:se,9:J,10:Z,11:ee,12:ne,13:ue,14:fe,15:_e,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,49:[1,78],63:N,64:D,65:I,66:$,67:B}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,49:[1,79],63:N,64:D,65:I,66:$,67:B}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),{45:[1,80]},{44:[1,81]},t(V,[2,65]),t(V,[2,82]),t(V,[2,83]),t(V,[2,84]),{3:83,4:Y,5:W,6:ie,7:K,8:se,9:J,10:Z,11:ee,12:ne,13:ue,14:fe,15:_e,18:[1,82]},t(Ae,[2,23]),t(Ae,[2,1]),t(Ae,[2,2]),t(Ae,[2,3]),t(Ae,[2,4]),t(Ae,[2,5]),t(Ae,[2,6]),t(Ae,[2,7]),t(Ae,[2,8]),t(Ae,[2,9]),t(Ae,[2,10]),t(Ae,[2,11]),t(Ae,[2,12]),t(l,[2,52],{58:31,43:84,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:S,61:R,63:N,64:D,65:I,66:$,67:B}),t(l,[2,55],{58:31,43:85,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:S,61:R,63:N,64:D,65:I,66:$,67:B}),{46:[1,86]},{45:[1,87]},{4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,16:90,17:ke,18:Ve,19:Qe,20:nt,22:89,23:88},t(Ae,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),t(l,[2,47],{22:89,16:90,23:101,4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,17:ke,18:Ve,19:Qe,20:nt}),{46:[1,102]},t(l,[2,29],{10:tt}),t(je,[2,27],{16:104,4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,17:ke,18:Ve,19:Qe,20:nt}),t(Ce,[2,25]),t(Ce,[2,13]),t(Ce,[2,14]),t(Ce,[2,15]),t(Ce,[2,16]),t(Ce,[2,17]),t(Ce,[2,18]),t(Ce,[2,19]),t(Ce,[2,20]),t(Ce,[2,21]),t(Ce,[2,22]),t(l,[2,49],{10:tt}),t(l,[2,48],{22:89,16:90,23:105,4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,17:ke,18:Ve,19:Qe,20:nt}),{4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,16:90,17:ke,18:Ve,19:Qe,20:nt,22:106},t(Ce,[2,26]),t(l,[2,50],{10:tt}),t(je,[2,28],{16:104,4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,17:ke,18:Ve,19:Qe,20:nt})],defaultActions:{8:[2,30],9:[2,31]},parseError:x(function(pe,re){if(re.recoverable)this.trace(pe);else{var Be=new Error(pe);throw Be.hash=re,Be}},"parseError"),parse:x(function(pe){var re=this,Be=[0],xe=[],Ue=[null],De=[],qe=this.table,Le="",Xe=0,Ie=0,it=2,we=1,lt=De.slice.call(arguments,1),be=Object.create(this.lexer),Et={yy:{}};for(var vt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,vt)&&(Et.yy[vt]=this.yy[vt]);be.setInput(pe,Et.yy),Et.yy.lexer=be,Et.yy.parser=this,typeof be.yylloc>"u"&&(be.yylloc={});var ot=be.yylloc;De.push(ot);var It=be.options&&be.options.ranges;typeof Et.yy.parseError=="function"?this.parseError=Et.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function xt(Ft){Be.length=Be.length-2*Ft,Ue.length=Ue.length-Ft,De.length=De.length-Ft}x(xt,"popStack");function ht(){var Ft;return Ft=xe.pop()||be.lex()||we,typeof Ft!="number"&&(Ft instanceof Array&&(xe=Ft,Ft=xe.pop()),Ft=re.symbols_[Ft]||Ft),Ft}x(ht,"lex");for(var oe,At,dt,ut,wt={},Mr,ye,et,ct;;){if(At=Be[Be.length-1],this.defaultActions[At]?dt=this.defaultActions[At]:((oe===null||typeof oe>"u")&&(oe=ht()),dt=qe[At]&&qe[At][oe]),typeof dt>"u"||!dt.length||!dt[0]){var _t="";ct=[];for(Mr in qe[At])this.terminals_[Mr]&&Mr>it&&ct.push("'"+this.terminals_[Mr]+"'");be.showPosition?_t="Parse error on line "+(Xe+1)+`: +`,"getStyles"),ilt=nlt,alt=T(t=>{const e=[...t.values()].reduce((i,a)=>i+a,0),r=[...t.entries()].map(([i,a])=>({label:i,value:a})).filter(i=>i.value/e*100>=1);return K3e().value(i=>i.value).sort(null)(r)},"createPieArcs"),slt=T((t,e,r,n)=>{var P;ae.debug(`rendering pie chart +`+t);const i=n.db,a=Pe(),s=ti(i.getConfig(),a.pie),o=40,l=18,u=4,h=450,d=h,f=ys(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=xc(g.pieOuterStrokeWidth);m??(m=2);const y=s.textPosition,v=Math.min(d,h)/2-o,x=Pp().innerRadius(0).outerRadius(v),b=Pp().innerRadius(v*y).outerRadius(v*y);p.append("circle").attr("cx",0).attr("cy",0).attr("r",v+m/2).attr("class","pieOuterCircle");const w=i.getSections(),k=alt(w),S=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12];let C=0;w.forEach(G=>{C+=G});const _=k.filter(G=>(G.data.value/C*100).toFixed(0)!=="0"),L=Qh(S).domain([...w.keys()]);p.selectAll("mySlices").data(_).enter().append("path").attr("d",x).attr("fill",G=>L(G.data.label)).attr("class","pieCircle"),p.selectAll("mySlices").data(_).enter().append("text").text(G=>(G.data.value/C*100).toFixed(0)+"%").attr("transform",G=>"translate("+b.centroid(G)+")").style("text-anchor","middle").attr("class","slice");const O=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),M=[...w.entries()].map(([G,V])=>({label:G,value:V})),z=p.selectAll(".legend").data(M).enter().append("g").attr("class","legend").attr("transform",(G,V)=>{const X=l+u,W=X*M.length/2,ie=12*l,K=V*X-W;return"translate("+ie+","+K+")"});z.append("rect").attr("width",l).attr("height",l).style("fill",G=>L(G.label)).style("stroke",G=>L(G.label)),z.append("text").attr("x",l+u).attr("y",l-u).text(G=>i.getShowData()?`${G.label} [${G.value}]`:G.label);const F=Math.max(...z.selectAll("text").nodes().map(G=>(G==null?void 0:G.getBoundingClientRect().width)??0)),A=d+o+l+u+F,R=((P=O.node())==null?void 0:P.getBoundingClientRect().width)??0,N=d/2-R/2,D=d/2+R/2,I=Math.min(0,N),B=Math.max(A,D)-I;f.attr("viewBox",`${I} 0 ${B} ${h}`),wi(f,h,B,s.useMaxWidth)},"draw"),olt={draw:slt},llt={parser:rlt,db:vge,renderer:olt,styles:ilt};const clt=Object.freeze(Object.defineProperty({__proto__:null,diagram:llt},Symbol.toStringTag,{value:"Module"}));var h$=(function(){var t=T(function(j,pe,re,Fe){for(re=re||{},Fe=j.length;Fe--;re[j[Fe]]=pe);return re},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],s=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],o=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],h=[1,37],d=[1,36],f=[1,38],p=[1,35],g=[1,43],m=[1,41],y=[1,45],v=[1,14],x=[1,23],b=[1,18],w=[1,19],k=[1,20],S=[1,21],C=[1,22],_=[1,24],L=[1,25],O=[1,26],M=[1,27],z=[1,28],F=[1,29],A=[1,32],R=[1,33],N=[1,34],D=[1,39],I=[1,40],$=[1,42],B=[1,44],P=[1,63],G=[1,62],V=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],X=[1,66],W=[1,67],ie=[1,68],K=[1,69],se=[1,70],J=[1,71],Z=[1,72],ee=[1,73],ne=[1,74],ue=[1,75],fe=[1,76],_e=[1,77],Ae=[4,5,6,7,8,9,10,11,12,13,14,15,18],Ne=[1,91],me=[1,92],ve=[1,93],Ge=[1,100],Te=[1,94],Ze=[1,97],ke=[1,95],Ve=[1,96],Qe=[1,98],nt=[1,99],tt=[1,103],je=[10,55,56,57],Ce=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],Se={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:T(function(pe,re,Fe,xe,Ue,Me,qe){var Le=Me.length-1;switch(Ue){case 23:this.$=Me[Le];break;case 24:this.$=Me[Le-1]+""+Me[Le];break;case 26:this.$=Me[Le-1]+Me[Le];break;case 27:this.$=[Me[Le].trim()];break;case 28:Me[Le-2].push(Me[Le].trim()),this.$=Me[Le-2];break;case 29:this.$=Me[Le-4],xe.addClass(Me[Le-2],Me[Le]);break;case 37:this.$=[];break;case 42:this.$=Me[Le].trim(),xe.setDiagramTitle(this.$);break;case 43:this.$=Me[Le].trim(),xe.setAccTitle(this.$);break;case 44:case 45:this.$=Me[Le].trim(),xe.setAccDescription(this.$);break;case 46:xe.addSection(Me[Le].substr(8)),this.$=Me[Le].substr(8);break;case 47:xe.addPoint(Me[Le-3],"",Me[Le-1],Me[Le],[]);break;case 48:xe.addPoint(Me[Le-4],Me[Le-3],Me[Le-1],Me[Le],[]);break;case 49:xe.addPoint(Me[Le-4],"",Me[Le-2],Me[Le-1],Me[Le]);break;case 50:xe.addPoint(Me[Le-5],Me[Le-4],Me[Le-2],Me[Le-1],Me[Le]);break;case 51:xe.setXAxisLeftText(Me[Le-2]),xe.setXAxisRightText(Me[Le]);break;case 52:Me[Le-1].text+=" ⟶ ",xe.setXAxisLeftText(Me[Le-1]);break;case 53:xe.setXAxisLeftText(Me[Le]);break;case 54:xe.setYAxisBottomText(Me[Le-2]),xe.setYAxisTopText(Me[Le]);break;case 55:Me[Le-1].text+=" ⟶ ",xe.setYAxisBottomText(Me[Le-1]);break;case 56:xe.setYAxisBottomText(Me[Le]);break;case 57:xe.setQuadrant1Text(Me[Le]);break;case 58:xe.setQuadrant2Text(Me[Le]);break;case 59:xe.setQuadrant3Text(Me[Le]);break;case 60:xe.setQuadrant4Text(Me[Le]);break;case 64:this.$={text:Me[Le],type:"text"};break;case 65:this.$={text:Me[Le-1].text+""+Me[Le],type:Me[Le-1].type};break;case 66:this.$={text:Me[Le],type:"text"};break;case 67:this.$={text:Me[Le],type:"markdown"};break;case 68:this.$=Me[Le];break;case 69:this.$=Me[Le-1]+""+Me[Le];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:a},{18:e,26:9,27:2,28:r,55:n,56:i,57:a},t(s,[2,33],{29:10}),t(o,[2,61]),t(o,[2,62]),t(o,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:x,35:b,37:w,39:k,41:S,42:C,48:_,50:L,51:O,52:M,53:z,54:F,60:A,61:R,63:N,64:D,65:I,66:$,67:B}),t(s,[2,34]),{27:46,55:n,56:i,57:a},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:x,35:b,37:w,39:k,41:S,42:C,48:_,50:L,51:O,52:M,53:z,54:F,60:A,61:R,63:N,64:D,65:I,66:$,67:B}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:52,58:31,60:A,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:53,58:31,60:A,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:54,58:31,60:A,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:55,58:31,60:A,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:56,58:31,60:A,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:57,58:31,60:A,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,44:[1,58],47:[1,59],58:61,59:60,63:N,64:D,65:I,66:$,67:B},t(V,[2,64]),t(V,[2,66]),t(V,[2,67]),t(V,[2,70]),t(V,[2,71]),t(V,[2,72]),t(V,[2,73]),t(V,[2,74]),t(V,[2,75]),t(V,[2,76]),t(V,[2,77]),t(V,[2,78]),t(V,[2,79]),t(V,[2,80]),t(V,[2,81]),t(s,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:X,5:W,6:ie,7:K,8:se,9:J,10:Z,11:ee,12:ne,13:ue,14:fe,15:_e,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,49:[1,78],63:N,64:D,65:I,66:$,67:B}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,49:[1,79],63:N,64:D,65:I,66:$,67:B}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),{45:[1,80]},{44:[1,81]},t(V,[2,65]),t(V,[2,82]),t(V,[2,83]),t(V,[2,84]),{3:83,4:X,5:W,6:ie,7:K,8:se,9:J,10:Z,11:ee,12:ne,13:ue,14:fe,15:_e,18:[1,82]},t(Ae,[2,23]),t(Ae,[2,1]),t(Ae,[2,2]),t(Ae,[2,3]),t(Ae,[2,4]),t(Ae,[2,5]),t(Ae,[2,6]),t(Ae,[2,7]),t(Ae,[2,8]),t(Ae,[2,9]),t(Ae,[2,10]),t(Ae,[2,11]),t(Ae,[2,12]),t(l,[2,52],{58:31,43:84,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:A,61:R,63:N,64:D,65:I,66:$,67:B}),t(l,[2,55],{58:31,43:85,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:A,61:R,63:N,64:D,65:I,66:$,67:B}),{46:[1,86]},{45:[1,87]},{4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,16:90,17:ke,18:Ve,19:Qe,20:nt,22:89,23:88},t(Ae,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),t(l,[2,47],{22:89,16:90,23:101,4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,17:ke,18:Ve,19:Qe,20:nt}),{46:[1,102]},t(l,[2,29],{10:tt}),t(je,[2,27],{16:104,4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,17:ke,18:Ve,19:Qe,20:nt}),t(Ce,[2,25]),t(Ce,[2,13]),t(Ce,[2,14]),t(Ce,[2,15]),t(Ce,[2,16]),t(Ce,[2,17]),t(Ce,[2,18]),t(Ce,[2,19]),t(Ce,[2,20]),t(Ce,[2,21]),t(Ce,[2,22]),t(l,[2,49],{10:tt}),t(l,[2,48],{22:89,16:90,23:105,4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,17:ke,18:Ve,19:Qe,20:nt}),{4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,16:90,17:ke,18:Ve,19:Qe,20:nt,22:106},t(Ce,[2,26]),t(l,[2,50],{10:tt}),t(je,[2,28],{16:104,4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,17:ke,18:Ve,19:Qe,20:nt})],defaultActions:{8:[2,30],9:[2,31]},parseError:T(function(pe,re){if(re.recoverable)this.trace(pe);else{var Fe=new Error(pe);throw Fe.hash=re,Fe}},"parseError"),parse:T(function(pe){var re=this,Fe=[0],xe=[],Ue=[null],Me=[],qe=this.table,Le="",Xe=0,De=0,it=2,we=1,lt=Me.slice.call(arguments,1),be=Object.create(this.lexer),Et={yy:{}};for(var vt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,vt)&&(Et.yy[vt]=this.yy[vt]);be.setInput(pe,Et.yy),Et.yy.lexer=be,Et.yy.parser=this,typeof be.yylloc>"u"&&(be.yylloc={});var ot=be.yylloc;Me.push(ot);var It=be.options&&be.options.ranges;typeof Et.yy.parseError=="function"?this.parseError=Et.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function xt(Ft){Fe.length=Fe.length-2*Ft,Ue.length=Ue.length-Ft,Me.length=Me.length-Ft}T(xt,"popStack");function ht(){var Ft;return Ft=xe.pop()||be.lex()||we,typeof Ft!="number"&&(Ft instanceof Array&&(xe=Ft,Ft=xe.pop()),Ft=re.symbols_[Ft]||Ft),Ft}T(ht,"lex");for(var oe,At,dt,ut,wt={},Mr,ye,et,ct;;){if(At=Fe[Fe.length-1],this.defaultActions[At]?dt=this.defaultActions[At]:((oe===null||typeof oe>"u")&&(oe=ht()),dt=qe[At]&&qe[At][oe]),typeof dt>"u"||!dt.length||!dt[0]){var _t="";ct=[];for(Mr in qe[At])this.terminals_[Mr]&&Mr>it&&ct.push("'"+this.terminals_[Mr]+"'");be.showPosition?_t="Parse error on line "+(Xe+1)+`: `+be.showPosition()+` -Expecting `+ct.join(", ")+", got '"+(this.terminals_[oe]||oe)+"'":_t="Parse error on line "+(Xe+1)+": Unexpected "+(oe==we?"end of input":"'"+(this.terminals_[oe]||oe)+"'"),this.parseError(_t,{text:be.match,token:this.terminals_[oe]||oe,line:be.yylineno,loc:ot,expected:ct})}if(dt[0]instanceof Array&&dt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+At+", token: "+oe);switch(dt[0]){case 1:Be.push(oe),Ue.push(be.yytext),De.push(be.yylloc),Be.push(dt[1]),oe=null,Ie=be.yyleng,Le=be.yytext,Xe=be.yylineno,ot=be.yylloc;break;case 2:if(ye=this.productions_[dt[1]][1],wt.$=Ue[Ue.length-ye],wt._$={first_line:De[De.length-(ye||1)].first_line,last_line:De[De.length-1].last_line,first_column:De[De.length-(ye||1)].first_column,last_column:De[De.length-1].last_column},It&&(wt._$.range=[De[De.length-(ye||1)].range[0],De[De.length-1].range[1]]),ut=this.performAction.apply(wt,[Le,Ie,Xe,Et.yy,dt[1],Ue,De].concat(lt)),typeof ut<"u")return ut;ye&&(Be=Be.slice(0,-1*ye*2),Ue=Ue.slice(0,-1*ye),De=De.slice(0,-1*ye)),Be.push(this.productions_[dt[1]][0]),Ue.push(wt.$),De.push(wt._$),et=qe[Be[Be.length-2]][Be[Be.length-1]],Be.push(et);break;case 3:return!0}}return!0},"parse")},H=(function(){var j={EOF:1,parseError:x(function(re,Be){if(this.yy.parser)this.yy.parser.parseError(re,Be);else throw new Error(re)},"parseError"),setInput:x(function(pe,re){return this.yy=re||this.yy||{},this._input=pe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var pe=this._input[0];this.yytext+=pe,this.yyleng++,this.offset++,this.match+=pe,this.matched+=pe;var re=pe.match(/(?:\r\n?|\n).*/g);return re?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),pe},"input"),unput:x(function(pe){var re=pe.length,Be=pe.split(/(?:\r\n?|\n)/g);this._input=pe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-re),this.offset-=re;var xe=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Be.length-1&&(this.yylineno-=Be.length-1);var Ue=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Be?(Be.length===xe.length?this.yylloc.first_column:0)+xe[xe.length-Be.length].length-Be[0].length:this.yylloc.first_column-re},this.options.ranges&&(this.yylloc.range=[Ue[0],Ue[0]+this.yyleng-re]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(pe){this.unput(this.match.slice(pe))},"less"),pastInput:x(function(){var pe=this.matched.substr(0,this.matched.length-this.match.length);return(pe.length>20?"...":"")+pe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var pe=this.match;return pe.length<20&&(pe+=this._input.substr(0,20-pe.length)),(pe.substr(0,20)+(pe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var pe=this.pastInput(),re=new Array(pe.length+1).join("-");return pe+this.upcomingInput()+` -`+re+"^"},"showPosition"),test_match:x(function(pe,re){var Be,xe,Ue;if(this.options.backtrack_lexer&&(Ue={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ue.yylloc.range=this.yylloc.range.slice(0))),xe=pe[0].match(/(?:\r\n?|\n).*/g),xe&&(this.yylineno+=xe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:xe?xe[xe.length-1].length-xe[xe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+pe[0].length},this.yytext+=pe[0],this.match+=pe[0],this.matches=pe,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(pe[0].length),this.matched+=pe[0],Be=this.performAction.call(this,this.yy,this,re,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Be)return Be;if(this._backtrack){for(var De in Ue)this[De]=Ue[De];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var pe,re,Be,xe;this._more||(this.yytext="",this.match="");for(var Ue=this._currentRules(),De=0;Dere[0].length)){if(re=Be,xe=De,this.options.backtrack_lexer){if(pe=this.test_match(Be,Ue[De]),pe!==!1)return pe;if(this._backtrack){re=!1;continue}else return!1}else if(!this.options.flex)break}return re?(pe=this.test_match(re,Ue[xe]),pe!==!1?pe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var re=this.next();return re||this.lex()},"lex"),begin:x(function(re){this.conditionStack.push(re)},"begin"),popState:x(function(){var re=this.conditionStack.length-1;return re>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(re){return re=this.conditionStack.length-1-Math.abs(re||0),re>=0?this.conditionStack[re]:"INITIAL"},"topState"),pushState:x(function(re){this.begin(re)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(re,Be,xe,Ue){switch(xe){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return j})();Se.lexer=H;function he(){this.yy={}}return x(he,"Parser"),he.prototype=Se,Se.Parser=he,new he})();s$.parser=s$;var Zot=s$,hs=w0(),Qot=(Av=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=Fr.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=Fr.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=Fr.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=Fr.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=Fr.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((s=Fr.quadrantChart)==null?void 0:s.xAxisLabelPadding)||5,yAxisLabelPadding:((o=Fr.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=Fr.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=Fr.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=Fr.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=Fr.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=Fr.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=Fr.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=Fr.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=Fr.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((y=Fr.quadrantChart)==null?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((v=Fr.quadrantChart)==null?void 0:v.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((T=Fr.quadrantChart)==null?void 0:T.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:hs.quadrant1Fill,quadrant2Fill:hs.quadrant2Fill,quadrant3Fill:hs.quadrant3Fill,quadrant4Fill:hs.quadrant4Fill,quadrant1TextFill:hs.quadrant1TextFill,quadrant2TextFill:hs.quadrant2TextFill,quadrant3TextFill:hs.quadrant3TextFill,quadrant4TextFill:hs.quadrant4TextFill,quadrantPointFill:hs.quadrantPointFill,quadrantPointTextFill:hs.quadrantPointTextFill,quadrantXAxisTextFill:hs.quadrantXAxisTextFill,quadrantYAxisTextFill:hs.quadrantYAxisTextFill,quadrantTitleFill:hs.quadrantTitleFill,quadrantInternalBorderStrokeFill:hs.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:hs.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,ae.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,r){this.classes.set(e,r)}setConfig(e){ae.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){ae.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const a=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,s={top:e==="top"&&r?a:0,bottom:e==="bottom"&&r?a:0},o=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,l={left:this.config.yAxisPosition==="left"&&n?o:0,right:this.config.yAxisPosition==="right"&&n?o:0},u=this.config.titleFontSize+this.config.titlePadding*2,h={top:i?u:0},d=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+s.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-s.top-s.bottom-h.top,m=p/2,y=g/2;return{xAxisSpace:s,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:m,quadrantHeight:g,quadrantHalfHeight:y}}}getAxisLabels(e,r,n,i){const{quadrantSpace:a,titleSpace:s}=i,{quadrantHalfHeight:o,quadrantHeight:l,quadrantLeft:u,quadrantHalfWidth:h,quadrantTop:d,quadrantWidth:f}=a,p=!!this.data.xAxisRightText,g=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&r&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&r&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+h+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+l-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+o-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(e){const{quadrantSpace:r}=e,{quadrantHalfHeight:n,quadrantLeft:i,quadrantHalfWidth:a,quadrantTop:s}=r,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s,width:a,height:n,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s,width:a,height:n,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant4Fill}];for(const l of o)l.text.x=l.x+l.width/2,this.data.points.length===0?(l.text.y=l.y+l.height/2,l.text.horizontalPos="middle"):(l.text.y=l.y+this.config.quadrantTextTopPadding,l.text.horizontalPos="top");return o}getQuadrantPoints(e){const{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:a,quadrantWidth:s}=r,o=D0().domain([0,1]).range([i,s+i]),l=D0().domain([0,1]).range([n+a,a]);return this.data.points.map(h=>{const d=this.classes.get(h.className);return d&&(h={...d,...h}),{x:o(h.x),y:l(h.y),fill:h.color??this.themeConfig.quadrantPointFill,radius:h.radius??this.config.pointRadius,text:{text:h.text,fill:this.themeConfig.quadrantPointTextFill,x:o(h.x),y:l(h.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:h.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:h.strokeWidth??"0px"}})}getBorders(e){const r=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:i,quadrantHeight:a,quadrantLeft:s,quadrantHalfWidth:o,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l,x2:s+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s+u,y1:l+r,x2:s+u,y2:l+a-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l+a,x2:s+u+r,y2:l+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s,y1:l+r,x2:s,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+o,y1:l+r,x2:s+o,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+r,y1:l+i,x2:s+u-r,y2:l+i}]}getTitle(e){if(e)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),r=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,i=this.data.points.length>0?"bottom":this.config.xAxisPosition,a=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(a),quadrants:this.getQuadrants(a),axisLabels:this.getAxisLabels(i,e,r,a),borderLines:this.getBorders(a),title:this.getTitle(n)}}},x(Av,"QuadrantBuilder"),Av),vS=(_v=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},x(_v,"InvalidStyleError"),_v);function o$(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}x(o$,"validateHexCode");function fge(t){return!/^\d+$/.test(t)}x(fge,"validateNumber");function pge(t){return!/^\d+px$/.test(t)}x(pge,"validateSizeInPixels");var Jot=Pe();function ac(t){return qr(t.trim(),Jot)}x(ac,"textSanitizer");var wa=new Qot;function gge(t){wa.setData({quadrant1Text:ac(t.text)})}x(gge,"setQuadrant1Text");function mge(t){wa.setData({quadrant2Text:ac(t.text)})}x(mge,"setQuadrant2Text");function yge(t){wa.setData({quadrant3Text:ac(t.text)})}x(yge,"setQuadrant3Text");function vge(t){wa.setData({quadrant4Text:ac(t.text)})}x(vge,"setQuadrant4Text");function bge(t){wa.setData({xAxisLeftText:ac(t.text)})}x(bge,"setXAxisLeftText");function xge(t){wa.setData({xAxisRightText:ac(t.text)})}x(xge,"setXAxisRightText");function Tge(t){wa.setData({yAxisTopText:ac(t.text)})}x(Tge,"setYAxisTopText");function wge(t){wa.setData({yAxisBottomText:ac(t.text)})}x(wge,"setYAxisBottomText");function bS(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(fge(i))throw new vS(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(o$(i))throw new vS(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(o$(i))throw new vS(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(pge(i))throw new vS(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}x(bS,"parseStyles");function Cge(t,e,r,n,i){const a=bS(i);wa.addPoints([{x:r,y:n,text:ac(t.text),className:e,...a}])}x(Cge,"addPoint");function kge(t,e){wa.addClass(t,bS(e))}x(kge,"addClass");function Ege(t){wa.setConfig({chartWidth:t})}x(Ege,"setWidth");function Sge(t){wa.setConfig({chartHeight:t})}x(Sge,"setHeight");function Age(){const t=Pe(),{themeVariables:e,quadrantChart:r}=t;return r&&wa.setConfig(r),wa.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),wa.setData({titleText:Mn()}),wa.build()}x(Age,"getQuadrantData");var elt=x(function(){wa.clear(),In()},"clear"),tlt={setWidth:Ege,setHeight:Sge,setQuadrant1Text:gge,setQuadrant2Text:mge,setQuadrant3Text:yge,setQuadrant4Text:vge,setXAxisLeftText:bge,setXAxisRightText:xge,setYAxisTopText:Tge,setYAxisBottomText:wge,parseStyles:bS,addPoint:Cge,addClass:kge,getQuadrantData:Age,clear:elt,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,getAccDescription:Gn,setAccDescription:zn},rlt=x((t,e,r,n)=>{var _,L,O;function i(M){return M==="top"?"hanging":"middle"}x(i,"getDominantBaseLine");function a(M){return M==="left"?"start":"middle"}x(a,"getTextAnchor");function s(M){return`translate(${M.x}, ${M.y}) rotate(${M.rotation||0})`}x(s,"getTransformation");const o=Pe();ae.debug(`Rendering quadrant chart -`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=pt("#i"+e));const d=pt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((_=o.quadrantChart)==null?void 0:_.chartWidth)??500,g=((L=o.quadrantChart)==null?void 0:L.chartHeight)??500;wi(d,g,p,((O=o.quadrantChart)==null?void 0:O.useMaxWidth)??!0),d.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const m=n.db.getQuadrantData(),y=f.append("g").attr("class","quadrants"),v=f.append("g").attr("class","border"),T=f.append("g").attr("class","data-points"),b=f.append("g").attr("class","labels"),w=f.append("g").attr("class","title");m.title&&w.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",i(m.title.horizontalPos)).attr("text-anchor",a(m.title.verticalPos)).attr("transform",s(m.title)).text(m.title.text),m.borderLines&&v.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",M=>M.x1).attr("y1",M=>M.y1).attr("x2",M=>M.x2).attr("y2",M=>M.y2).style("stroke",M=>M.strokeFill).style("stroke-width",M=>M.strokeWidth);const k=y.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");k.append("rect").attr("x",M=>M.x).attr("y",M=>M.y).attr("width",M=>M.width).attr("height",M=>M.height).attr("fill",M=>M.fill),k.append("text").attr("x",0).attr("y",0).attr("fill",M=>M.text.fill).attr("font-size",M=>M.text.fontSize).attr("dominant-baseline",M=>i(M.text.horizontalPos)).attr("text-anchor",M=>a(M.text.verticalPos)).attr("transform",M=>s(M.text)).text(M=>M.text.text),b.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(M=>M.text).attr("fill",M=>M.fill).attr("font-size",M=>M.fontSize).attr("dominant-baseline",M=>i(M.horizontalPos)).attr("text-anchor",M=>a(M.verticalPos)).attr("transform",M=>s(M));const C=T.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");C.append("circle").attr("cx",M=>M.x).attr("cy",M=>M.y).attr("r",M=>M.radius).attr("fill",M=>M.fill).attr("stroke",M=>M.strokeColor).attr("stroke-width",M=>M.strokeWidth),C.append("text").attr("x",0).attr("y",0).text(M=>M.text.text).attr("fill",M=>M.text.fill).attr("font-size",M=>M.text.fontSize).attr("dominant-baseline",M=>i(M.text.horizontalPos)).attr("text-anchor",M=>a(M.text.verticalPos)).attr("transform",M=>s(M.text))},"draw"),nlt={draw:rlt},ilt={parser:Zot,db:tlt,renderer:nlt,styles:x(()=>"","styles")};const alt=Object.freeze(Object.defineProperty({__proto__:null,diagram:ilt},Symbol.toStringTag,{value:"Module"}));var l$=(function(){var t=x(function(R,N,D,I){for(D=D||{},I=R.length;I--;D[R[I]]=N);return D},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],s=[1,7],o=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],u=[1,26],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[1,32],m=[1,33],y=[1,34],v=[1,35],T=[1,36],b=[1,37],w=[1,43],k=[1,42],A=[1,47],C=[1,50],_=[1,10,12,14,16,18,19,21,23,34,35,36],L=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],O=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],M=[1,64],z={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:x(function(N,D,I,$,B,P,G){var V=P.length-1;switch(B){case 5:$.setOrientation(P[V]);break;case 9:$.setDiagramTitle(P[V].text.trim());break;case 12:$.setLineData({text:"",type:"text"},P[V]);break;case 13:$.setLineData(P[V-1],P[V]);break;case 14:$.setBarData({text:"",type:"text"},P[V]);break;case 15:$.setBarData(P[V-1],P[V]);break;case 16:this.$=P[V].trim(),$.setAccTitle(this.$);break;case 17:case 18:this.$=P[V].trim(),$.setAccDescription(this.$);break;case 19:this.$=P[V-1];break;case 20:this.$=[Number(P[V-2]),...P[V]];break;case 21:this.$=[Number(P[V])];break;case 22:$.setXAxisTitle(P[V]);break;case 23:$.setXAxisTitle(P[V-1]);break;case 24:$.setXAxisTitle({type:"text",text:""});break;case 25:$.setXAxisBand(P[V]);break;case 26:$.setXAxisRangeData(Number(P[V-2]),Number(P[V]));break;case 27:this.$=P[V-1];break;case 28:this.$=[P[V-2],...P[V]];break;case 29:this.$=[P[V]];break;case 30:$.setYAxisTitle(P[V]);break;case 31:$.setYAxisTitle(P[V-1]);break;case 32:$.setYAxisTitle({type:"text",text:""});break;case 33:$.setYAxisRangeData(Number(P[V-2]),Number(P[V]));break;case 37:this.$={text:P[V],type:"text"};break;case 38:this.$={text:P[V],type:"text"};break;case 39:this.$={text:P[V],type:"markdown"};break;case 40:this.$=P[V];break;case 41:this.$=P[V-1]+""+P[V];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,34:i,35:a,36:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,34:i,35:a,36:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],34:i,35:a,36:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,34]),t(o,[2,35]),t(o,[2,36]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,34:i,35:a,36:s}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,34:i,35:a,36:s}),{11:23,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b},{11:39,13:38,24:w,27:k,29:40,30:41,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b},{11:45,15:44,27:A,33:46,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b},{11:49,17:48,24:C,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b},{11:52,17:51,24:C,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b},{20:[1,53]},{22:[1,54]},t(_,[2,18]),{1:[2,2]},t(_,[2,8]),t(_,[2,9]),t(L,[2,37],{40:55,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b}),t(L,[2,38]),t(L,[2,39]),t(O,[2,40]),t(O,[2,42]),t(O,[2,43]),t(O,[2,44]),t(O,[2,45]),t(O,[2,46]),t(O,[2,47]),t(O,[2,48]),t(O,[2,49]),t(O,[2,50]),t(O,[2,51]),t(_,[2,10]),t(_,[2,22],{30:41,29:56,24:w,27:k}),t(_,[2,24]),t(_,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b},t(_,[2,11]),t(_,[2,30],{33:60,27:A}),t(_,[2,32]),{31:[1,61]},t(_,[2,12]),{17:62,24:C},{25:63,27:M},t(_,[2,14]),{17:65,24:C},t(_,[2,16]),t(_,[2,17]),t(O,[2,41]),t(_,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(_,[2,31]),{27:[1,69]},t(_,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(_,[2,15]),t(_,[2,26]),t(_,[2,27]),{11:59,32:72,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b},t(_,[2,33]),t(_,[2,19]),{25:73,27:M},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:x(function(N,D){if(D.recoverable)this.trace(N);else{var I=new Error(N);throw I.hash=D,I}},"parseError"),parse:x(function(N){var D=this,I=[0],$=[],B=[null],P=[],G=this.table,V="",Y=0,W=0,ie=2,K=1,se=P.slice.call(arguments,1),J=Object.create(this.lexer),Z={yy:{}};for(var ee in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ee)&&(Z.yy[ee]=this.yy[ee]);J.setInput(N,Z.yy),Z.yy.lexer=J,Z.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var ne=J.yylloc;P.push(ne);var ue=J.options&&J.options.ranges;typeof Z.yy.parseError=="function"?this.parseError=Z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fe(nt){I.length=I.length-2*nt,B.length=B.length-nt,P.length=P.length-nt}x(fe,"popStack");function _e(){var nt;return nt=$.pop()||J.lex()||K,typeof nt!="number"&&(nt instanceof Array&&($=nt,nt=$.pop()),nt=D.symbols_[nt]||nt),nt}x(_e,"lex");for(var Ae,Ne,me,ve,Ge={},Te,Ze,ke,Ve;;){if(Ne=I[I.length-1],this.defaultActions[Ne]?me=this.defaultActions[Ne]:((Ae===null||typeof Ae>"u")&&(Ae=_e()),me=G[Ne]&&G[Ne][Ae]),typeof me>"u"||!me.length||!me[0]){var Qe="";Ve=[];for(Te in G[Ne])this.terminals_[Te]&&Te>ie&&Ve.push("'"+this.terminals_[Te]+"'");J.showPosition?Qe="Parse error on line "+(Y+1)+`: +Expecting `+ct.join(", ")+", got '"+(this.terminals_[oe]||oe)+"'":_t="Parse error on line "+(Xe+1)+": Unexpected "+(oe==we?"end of input":"'"+(this.terminals_[oe]||oe)+"'"),this.parseError(_t,{text:be.match,token:this.terminals_[oe]||oe,line:be.yylineno,loc:ot,expected:ct})}if(dt[0]instanceof Array&&dt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+At+", token: "+oe);switch(dt[0]){case 1:Fe.push(oe),Ue.push(be.yytext),Me.push(be.yylloc),Fe.push(dt[1]),oe=null,De=be.yyleng,Le=be.yytext,Xe=be.yylineno,ot=be.yylloc;break;case 2:if(ye=this.productions_[dt[1]][1],wt.$=Ue[Ue.length-ye],wt._$={first_line:Me[Me.length-(ye||1)].first_line,last_line:Me[Me.length-1].last_line,first_column:Me[Me.length-(ye||1)].first_column,last_column:Me[Me.length-1].last_column},It&&(wt._$.range=[Me[Me.length-(ye||1)].range[0],Me[Me.length-1].range[1]]),ut=this.performAction.apply(wt,[Le,De,Xe,Et.yy,dt[1],Ue,Me].concat(lt)),typeof ut<"u")return ut;ye&&(Fe=Fe.slice(0,-1*ye*2),Ue=Ue.slice(0,-1*ye),Me=Me.slice(0,-1*ye)),Fe.push(this.productions_[dt[1]][0]),Ue.push(wt.$),Me.push(wt._$),et=qe[Fe[Fe.length-2]][Fe[Fe.length-1]],Fe.push(et);break;case 3:return!0}}return!0},"parse")},H=(function(){var j={EOF:1,parseError:T(function(re,Fe){if(this.yy.parser)this.yy.parser.parseError(re,Fe);else throw new Error(re)},"parseError"),setInput:T(function(pe,re){return this.yy=re||this.yy||{},this._input=pe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var pe=this._input[0];this.yytext+=pe,this.yyleng++,this.offset++,this.match+=pe,this.matched+=pe;var re=pe.match(/(?:\r\n?|\n).*/g);return re?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),pe},"input"),unput:T(function(pe){var re=pe.length,Fe=pe.split(/(?:\r\n?|\n)/g);this._input=pe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-re),this.offset-=re;var xe=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Fe.length-1&&(this.yylineno-=Fe.length-1);var Ue=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Fe?(Fe.length===xe.length?this.yylloc.first_column:0)+xe[xe.length-Fe.length].length-Fe[0].length:this.yylloc.first_column-re},this.options.ranges&&(this.yylloc.range=[Ue[0],Ue[0]+this.yyleng-re]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(pe){this.unput(this.match.slice(pe))},"less"),pastInput:T(function(){var pe=this.matched.substr(0,this.matched.length-this.match.length);return(pe.length>20?"...":"")+pe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var pe=this.match;return pe.length<20&&(pe+=this._input.substr(0,20-pe.length)),(pe.substr(0,20)+(pe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var pe=this.pastInput(),re=new Array(pe.length+1).join("-");return pe+this.upcomingInput()+` +`+re+"^"},"showPosition"),test_match:T(function(pe,re){var Fe,xe,Ue;if(this.options.backtrack_lexer&&(Ue={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ue.yylloc.range=this.yylloc.range.slice(0))),xe=pe[0].match(/(?:\r\n?|\n).*/g),xe&&(this.yylineno+=xe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:xe?xe[xe.length-1].length-xe[xe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+pe[0].length},this.yytext+=pe[0],this.match+=pe[0],this.matches=pe,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(pe[0].length),this.matched+=pe[0],Fe=this.performAction.call(this,this.yy,this,re,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Fe)return Fe;if(this._backtrack){for(var Me in Ue)this[Me]=Ue[Me];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var pe,re,Fe,xe;this._more||(this.yytext="",this.match="");for(var Ue=this._currentRules(),Me=0;Mere[0].length)){if(re=Fe,xe=Me,this.options.backtrack_lexer){if(pe=this.test_match(Fe,Ue[Me]),pe!==!1)return pe;if(this._backtrack){re=!1;continue}else return!1}else if(!this.options.flex)break}return re?(pe=this.test_match(re,Ue[xe]),pe!==!1?pe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var re=this.next();return re||this.lex()},"lex"),begin:T(function(re){this.conditionStack.push(re)},"begin"),popState:T(function(){var re=this.conditionStack.length-1;return re>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(re){return re=this.conditionStack.length-1-Math.abs(re||0),re>=0?this.conditionStack[re]:"INITIAL"},"topState"),pushState:T(function(re){this.begin(re)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(re,Fe,xe,Ue){switch(xe){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return j})();Se.lexer=H;function he(){this.yy={}}return T(he,"Parser"),he.prototype=Se,Se.Parser=he,new he})();h$.parser=h$;var ult=h$,hs=wp(),hlt=(_v=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=Fr.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=Fr.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=Fr.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=Fr.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=Fr.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((s=Fr.quadrantChart)==null?void 0:s.xAxisLabelPadding)||5,yAxisLabelPadding:((o=Fr.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=Fr.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=Fr.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=Fr.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=Fr.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=Fr.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=Fr.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=Fr.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=Fr.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((y=Fr.quadrantChart)==null?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((v=Fr.quadrantChart)==null?void 0:v.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((x=Fr.quadrantChart)==null?void 0:x.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:hs.quadrant1Fill,quadrant2Fill:hs.quadrant2Fill,quadrant3Fill:hs.quadrant3Fill,quadrant4Fill:hs.quadrant4Fill,quadrant1TextFill:hs.quadrant1TextFill,quadrant2TextFill:hs.quadrant2TextFill,quadrant3TextFill:hs.quadrant3TextFill,quadrant4TextFill:hs.quadrant4TextFill,quadrantPointFill:hs.quadrantPointFill,quadrantPointTextFill:hs.quadrantPointTextFill,quadrantXAxisTextFill:hs.quadrantXAxisTextFill,quadrantYAxisTextFill:hs.quadrantYAxisTextFill,quadrantTitleFill:hs.quadrantTitleFill,quadrantInternalBorderStrokeFill:hs.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:hs.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,ae.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,r){this.classes.set(e,r)}setConfig(e){ae.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){ae.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const a=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,s={top:e==="top"&&r?a:0,bottom:e==="bottom"&&r?a:0},o=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,l={left:this.config.yAxisPosition==="left"&&n?o:0,right:this.config.yAxisPosition==="right"&&n?o:0},u=this.config.titleFontSize+this.config.titlePadding*2,h={top:i?u:0},d=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+s.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-s.top-s.bottom-h.top,m=p/2,y=g/2;return{xAxisSpace:s,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:m,quadrantHeight:g,quadrantHalfHeight:y}}}getAxisLabels(e,r,n,i){const{quadrantSpace:a,titleSpace:s}=i,{quadrantHalfHeight:o,quadrantHeight:l,quadrantLeft:u,quadrantHalfWidth:h,quadrantTop:d,quadrantWidth:f}=a,p=!!this.data.xAxisRightText,g=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&r&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&r&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+h+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+l-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+o-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(e){const{quadrantSpace:r}=e,{quadrantHalfHeight:n,quadrantLeft:i,quadrantHalfWidth:a,quadrantTop:s}=r,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s,width:a,height:n,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s,width:a,height:n,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant4Fill}];for(const l of o)l.text.x=l.x+l.width/2,this.data.points.length===0?(l.text.y=l.y+l.height/2,l.text.horizontalPos="middle"):(l.text.y=l.y+this.config.quadrantTextTopPadding,l.text.horizontalPos="top");return o}getQuadrantPoints(e){const{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:a,quadrantWidth:s}=r,o=Dp().domain([0,1]).range([i,s+i]),l=Dp().domain([0,1]).range([n+a,a]);return this.data.points.map(h=>{const d=this.classes.get(h.className);return d&&(h={...d,...h}),{x:o(h.x),y:l(h.y),fill:h.color??this.themeConfig.quadrantPointFill,radius:h.radius??this.config.pointRadius,text:{text:h.text,fill:this.themeConfig.quadrantPointTextFill,x:o(h.x),y:l(h.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:h.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:h.strokeWidth??"0px"}})}getBorders(e){const r=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:i,quadrantHeight:a,quadrantLeft:s,quadrantHalfWidth:o,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l,x2:s+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s+u,y1:l+r,x2:s+u,y2:l+a-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l+a,x2:s+u+r,y2:l+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s,y1:l+r,x2:s,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+o,y1:l+r,x2:s+o,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+r,y1:l+i,x2:s+u-r,y2:l+i}]}getTitle(e){if(e)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),r=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,i=this.data.points.length>0?"bottom":this.config.xAxisPosition,a=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(a),quadrants:this.getQuadrants(a),axisLabels:this.getAxisLabels(i,e,r,a),borderLines:this.getBorders(a),title:this.getTitle(n)}}},T(_v,"QuadrantBuilder"),_v),TS=(Rv=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},T(Rv,"InvalidStyleError"),Rv);function d$(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}T(d$,"validateHexCode");function bge(t){return!/^\d+$/.test(t)}T(bge,"validateNumber");function xge(t){return!/^\d+px$/.test(t)}T(xge,"validateSizeInPixels");var dlt=Pe();function ac(t){return qr(t.trim(),dlt)}T(ac,"textSanitizer");var wa=new hlt;function Tge(t){wa.setData({quadrant1Text:ac(t.text)})}T(Tge,"setQuadrant1Text");function wge(t){wa.setData({quadrant2Text:ac(t.text)})}T(wge,"setQuadrant2Text");function Cge(t){wa.setData({quadrant3Text:ac(t.text)})}T(Cge,"setQuadrant3Text");function kge(t){wa.setData({quadrant4Text:ac(t.text)})}T(kge,"setQuadrant4Text");function Ege(t){wa.setData({xAxisLeftText:ac(t.text)})}T(Ege,"setXAxisLeftText");function Sge(t){wa.setData({xAxisRightText:ac(t.text)})}T(Sge,"setXAxisRightText");function Age(t){wa.setData({yAxisTopText:ac(t.text)})}T(Age,"setYAxisTopText");function _ge(t){wa.setData({yAxisBottomText:ac(t.text)})}T(_ge,"setYAxisBottomText");function wS(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(bge(i))throw new TS(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(d$(i))throw new TS(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(d$(i))throw new TS(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(xge(i))throw new TS(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}T(wS,"parseStyles");function Rge(t,e,r,n,i){const a=wS(i);wa.addPoints([{x:r,y:n,text:ac(t.text),className:e,...a}])}T(Rge,"addPoint");function Lge(t,e){wa.addClass(t,wS(e))}T(Lge,"addClass");function Ige(t){wa.setConfig({chartWidth:t})}T(Ige,"setWidth");function Dge(t){wa.setConfig({chartHeight:t})}T(Dge,"setHeight");function Mge(){const t=Pe(),{themeVariables:e,quadrantChart:r}=t;return r&&wa.setConfig(r),wa.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),wa.setData({titleText:Mn()}),wa.build()}T(Mge,"getQuadrantData");var flt=T(function(){wa.clear(),In()},"clear"),plt={setWidth:Ige,setHeight:Dge,setQuadrant1Text:Tge,setQuadrant2Text:wge,setQuadrant3Text:Cge,setQuadrant4Text:kge,setXAxisLeftText:Ege,setXAxisRightText:Sge,setYAxisTopText:Age,setYAxisBottomText:_ge,parseStyles:wS,addPoint:Rge,addClass:Lge,getQuadrantData:Mge,clear:flt,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,getAccDescription:Gn,setAccDescription:zn},glt=T((t,e,r,n)=>{var _,L,O;function i(M){return M==="top"?"hanging":"middle"}T(i,"getDominantBaseLine");function a(M){return M==="left"?"start":"middle"}T(a,"getTextAnchor");function s(M){return`translate(${M.x}, ${M.y}) rotate(${M.rotation||0})`}T(s,"getTransformation");const o=Pe();ae.debug(`Rendering quadrant chart +`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=pt("#i"+e));const d=pt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((_=o.quadrantChart)==null?void 0:_.chartWidth)??500,g=((L=o.quadrantChart)==null?void 0:L.chartHeight)??500;wi(d,g,p,((O=o.quadrantChart)==null?void 0:O.useMaxWidth)??!0),d.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const m=n.db.getQuadrantData(),y=f.append("g").attr("class","quadrants"),v=f.append("g").attr("class","border"),x=f.append("g").attr("class","data-points"),b=f.append("g").attr("class","labels"),w=f.append("g").attr("class","title");m.title&&w.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",i(m.title.horizontalPos)).attr("text-anchor",a(m.title.verticalPos)).attr("transform",s(m.title)).text(m.title.text),m.borderLines&&v.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",M=>M.x1).attr("y1",M=>M.y1).attr("x2",M=>M.x2).attr("y2",M=>M.y2).style("stroke",M=>M.strokeFill).style("stroke-width",M=>M.strokeWidth);const k=y.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");k.append("rect").attr("x",M=>M.x).attr("y",M=>M.y).attr("width",M=>M.width).attr("height",M=>M.height).attr("fill",M=>M.fill),k.append("text").attr("x",0).attr("y",0).attr("fill",M=>M.text.fill).attr("font-size",M=>M.text.fontSize).attr("dominant-baseline",M=>i(M.text.horizontalPos)).attr("text-anchor",M=>a(M.text.verticalPos)).attr("transform",M=>s(M.text)).text(M=>M.text.text),b.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(M=>M.text).attr("fill",M=>M.fill).attr("font-size",M=>M.fontSize).attr("dominant-baseline",M=>i(M.horizontalPos)).attr("text-anchor",M=>a(M.verticalPos)).attr("transform",M=>s(M));const C=x.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");C.append("circle").attr("cx",M=>M.x).attr("cy",M=>M.y).attr("r",M=>M.radius).attr("fill",M=>M.fill).attr("stroke",M=>M.strokeColor).attr("stroke-width",M=>M.strokeWidth),C.append("text").attr("x",0).attr("y",0).text(M=>M.text.text).attr("fill",M=>M.text.fill).attr("font-size",M=>M.text.fontSize).attr("dominant-baseline",M=>i(M.text.horizontalPos)).attr("text-anchor",M=>a(M.text.verticalPos)).attr("transform",M=>s(M.text))},"draw"),mlt={draw:glt},ylt={parser:ult,db:plt,renderer:mlt,styles:T(()=>"","styles")};const vlt=Object.freeze(Object.defineProperty({__proto__:null,diagram:ylt},Symbol.toStringTag,{value:"Module"}));var f$=(function(){var t=T(function(R,N,D,I){for(D=D||{},I=R.length;I--;D[R[I]]=N);return D},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],s=[1,7],o=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],u=[1,26],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[1,32],m=[1,33],y=[1,34],v=[1,35],x=[1,36],b=[1,37],w=[1,43],k=[1,42],S=[1,47],C=[1,50],_=[1,10,12,14,16,18,19,21,23,34,35,36],L=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],O=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],M=[1,64],z={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:T(function(N,D,I,$,B,P,G){var V=P.length-1;switch(B){case 5:$.setOrientation(P[V]);break;case 9:$.setDiagramTitle(P[V].text.trim());break;case 12:$.setLineData({text:"",type:"text"},P[V]);break;case 13:$.setLineData(P[V-1],P[V]);break;case 14:$.setBarData({text:"",type:"text"},P[V]);break;case 15:$.setBarData(P[V-1],P[V]);break;case 16:this.$=P[V].trim(),$.setAccTitle(this.$);break;case 17:case 18:this.$=P[V].trim(),$.setAccDescription(this.$);break;case 19:this.$=P[V-1];break;case 20:this.$=[Number(P[V-2]),...P[V]];break;case 21:this.$=[Number(P[V])];break;case 22:$.setXAxisTitle(P[V]);break;case 23:$.setXAxisTitle(P[V-1]);break;case 24:$.setXAxisTitle({type:"text",text:""});break;case 25:$.setXAxisBand(P[V]);break;case 26:$.setXAxisRangeData(Number(P[V-2]),Number(P[V]));break;case 27:this.$=P[V-1];break;case 28:this.$=[P[V-2],...P[V]];break;case 29:this.$=[P[V]];break;case 30:$.setYAxisTitle(P[V]);break;case 31:$.setYAxisTitle(P[V-1]);break;case 32:$.setYAxisTitle({type:"text",text:""});break;case 33:$.setYAxisRangeData(Number(P[V-2]),Number(P[V]));break;case 37:this.$={text:P[V],type:"text"};break;case 38:this.$={text:P[V],type:"text"};break;case 39:this.$={text:P[V],type:"markdown"};break;case 40:this.$=P[V];break;case 41:this.$=P[V-1]+""+P[V];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,34:i,35:a,36:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,34:i,35:a,36:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],34:i,35:a,36:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,34]),t(o,[2,35]),t(o,[2,36]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,34:i,35:a,36:s}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,34:i,35:a,36:s}),{11:23,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},{11:39,13:38,24:w,27:k,29:40,30:41,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},{11:45,15:44,27:S,33:46,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},{11:49,17:48,24:C,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},{11:52,17:51,24:C,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},{20:[1,53]},{22:[1,54]},t(_,[2,18]),{1:[2,2]},t(_,[2,8]),t(_,[2,9]),t(L,[2,37],{40:55,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b}),t(L,[2,38]),t(L,[2,39]),t(O,[2,40]),t(O,[2,42]),t(O,[2,43]),t(O,[2,44]),t(O,[2,45]),t(O,[2,46]),t(O,[2,47]),t(O,[2,48]),t(O,[2,49]),t(O,[2,50]),t(O,[2,51]),t(_,[2,10]),t(_,[2,22],{30:41,29:56,24:w,27:k}),t(_,[2,24]),t(_,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},t(_,[2,11]),t(_,[2,30],{33:60,27:S}),t(_,[2,32]),{31:[1,61]},t(_,[2,12]),{17:62,24:C},{25:63,27:M},t(_,[2,14]),{17:65,24:C},t(_,[2,16]),t(_,[2,17]),t(O,[2,41]),t(_,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(_,[2,31]),{27:[1,69]},t(_,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(_,[2,15]),t(_,[2,26]),t(_,[2,27]),{11:59,32:72,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},t(_,[2,33]),t(_,[2,19]),{25:73,27:M},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:T(function(N,D){if(D.recoverable)this.trace(N);else{var I=new Error(N);throw I.hash=D,I}},"parseError"),parse:T(function(N){var D=this,I=[0],$=[],B=[null],P=[],G=this.table,V="",X=0,W=0,ie=2,K=1,se=P.slice.call(arguments,1),J=Object.create(this.lexer),Z={yy:{}};for(var ee in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ee)&&(Z.yy[ee]=this.yy[ee]);J.setInput(N,Z.yy),Z.yy.lexer=J,Z.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var ne=J.yylloc;P.push(ne);var ue=J.options&&J.options.ranges;typeof Z.yy.parseError=="function"?this.parseError=Z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fe(nt){I.length=I.length-2*nt,B.length=B.length-nt,P.length=P.length-nt}T(fe,"popStack");function _e(){var nt;return nt=$.pop()||J.lex()||K,typeof nt!="number"&&(nt instanceof Array&&($=nt,nt=$.pop()),nt=D.symbols_[nt]||nt),nt}T(_e,"lex");for(var Ae,Ne,me,ve,Ge={},Te,Ze,ke,Ve;;){if(Ne=I[I.length-1],this.defaultActions[Ne]?me=this.defaultActions[Ne]:((Ae===null||typeof Ae>"u")&&(Ae=_e()),me=G[Ne]&&G[Ne][Ae]),typeof me>"u"||!me.length||!me[0]){var Qe="";Ve=[];for(Te in G[Ne])this.terminals_[Te]&&Te>ie&&Ve.push("'"+this.terminals_[Te]+"'");J.showPosition?Qe="Parse error on line "+(X+1)+`: `+J.showPosition()+` -Expecting `+Ve.join(", ")+", got '"+(this.terminals_[Ae]||Ae)+"'":Qe="Parse error on line "+(Y+1)+": Unexpected "+(Ae==K?"end of input":"'"+(this.terminals_[Ae]||Ae)+"'"),this.parseError(Qe,{text:J.match,token:this.terminals_[Ae]||Ae,line:J.yylineno,loc:ne,expected:Ve})}if(me[0]instanceof Array&&me.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ne+", token: "+Ae);switch(me[0]){case 1:I.push(Ae),B.push(J.yytext),P.push(J.yylloc),I.push(me[1]),Ae=null,W=J.yyleng,V=J.yytext,Y=J.yylineno,ne=J.yylloc;break;case 2:if(Ze=this.productions_[me[1]][1],Ge.$=B[B.length-Ze],Ge._$={first_line:P[P.length-(Ze||1)].first_line,last_line:P[P.length-1].last_line,first_column:P[P.length-(Ze||1)].first_column,last_column:P[P.length-1].last_column},ue&&(Ge._$.range=[P[P.length-(Ze||1)].range[0],P[P.length-1].range[1]]),ve=this.performAction.apply(Ge,[V,W,Y,Z.yy,me[1],B,P].concat(se)),typeof ve<"u")return ve;Ze&&(I=I.slice(0,-1*Ze*2),B=B.slice(0,-1*Ze),P=P.slice(0,-1*Ze)),I.push(this.productions_[me[1]][0]),B.push(Ge.$),P.push(Ge._$),ke=G[I[I.length-2]][I[I.length-1]],I.push(ke);break;case 3:return!0}}return!0},"parse")},F=(function(){var R={EOF:1,parseError:x(function(D,I){if(this.yy.parser)this.yy.parser.parseError(D,I);else throw new Error(D)},"parseError"),setInput:x(function(N,D){return this.yy=D||this.yy||{},this._input=N,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var N=this._input[0];this.yytext+=N,this.yyleng++,this.offset++,this.match+=N,this.matched+=N;var D=N.match(/(?:\r\n?|\n).*/g);return D?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),N},"input"),unput:x(function(N){var D=N.length,I=N.split(/(?:\r\n?|\n)/g);this._input=N+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-D),this.offset-=D;var $=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),I.length-1&&(this.yylineno-=I.length-1);var B=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:I?(I.length===$.length?this.yylloc.first_column:0)+$[$.length-I.length].length-I[0].length:this.yylloc.first_column-D},this.options.ranges&&(this.yylloc.range=[B[0],B[0]+this.yyleng-D]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(N){this.unput(this.match.slice(N))},"less"),pastInput:x(function(){var N=this.matched.substr(0,this.matched.length-this.match.length);return(N.length>20?"...":"")+N.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var N=this.match;return N.length<20&&(N+=this._input.substr(0,20-N.length)),(N.substr(0,20)+(N.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var N=this.pastInput(),D=new Array(N.length+1).join("-");return N+this.upcomingInput()+` -`+D+"^"},"showPosition"),test_match:x(function(N,D){var I,$,B;if(this.options.backtrack_lexer&&(B={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(B.yylloc.range=this.yylloc.range.slice(0))),$=N[0].match(/(?:\r\n?|\n).*/g),$&&(this.yylineno+=$.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:$?$[$.length-1].length-$[$.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+N[0].length},this.yytext+=N[0],this.match+=N[0],this.matches=N,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(N[0].length),this.matched+=N[0],I=this.performAction.call(this,this.yy,this,D,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),I)return I;if(this._backtrack){for(var P in B)this[P]=B[P];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var N,D,I,$;this._more||(this.yytext="",this.match="");for(var B=this._currentRules(),P=0;PD[0].length)){if(D=I,$=P,this.options.backtrack_lexer){if(N=this.test_match(I,B[P]),N!==!1)return N;if(this._backtrack){D=!1;continue}else return!1}else if(!this.options.flex)break}return D?(N=this.test_match(D,B[$]),N!==!1?N:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var D=this.next();return D||this.lex()},"lex"),begin:x(function(D){this.conditionStack.push(D)},"begin"),popState:x(function(){var D=this.conditionStack.length-1;return D>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(D){return D=this.conditionStack.length-1-Math.abs(D||0),D>=0?this.conditionStack[D]:"INITIAL"},"topState"),pushState:x(function(D){this.begin(D)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(D,I,$,B){switch($){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return R})();z.lexer=F;function S(){this.yy={}}return x(S,"Parser"),S.prototype=z,z.Parser=S,new S})();l$.parser=l$;var slt=l$;function c$(t){return t.type==="bar"}x(c$,"isBarPlot");function u$(t){return t.type==="band"}x(u$,"isBandAxisData");function Jg(t){return t.type==="linear"}x(Jg,"isLinearAxisData");var _ge=(Rv=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((a,s)=>Math.max(s.length,a),0)*r,height:r};const n={width:0,height:0},i=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",r);for(const a of e){const s=KV(i,1,a),o=s?s.width:a.length*r,l=s?s.height:r;n.width=Math.max(n.width,o),n.height=Math.max(n.height,l)}return i.remove(),n}},x(Rv,"TextDimensionCalculatorWithFont"),Rv),Rge=.7,Lge=.2,Ige=(Lv=class{constructor(e,r,n,i){this.axisConfig=e,this.title=r,this.textDimensionCalculator=n,this.axisThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(e){this.range=e,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){Rge*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Rge*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let r=e.height;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=Lge*e.width;this.outerPadding=Math.min(n.width/2,i);const a=n.height+this.axisConfig.labelPadding*2;this.labelTextHeight=n.height,a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-r}calculateSpaceIfDrawnVertical(e){let r=e.width;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=Lge*e.height;this.outerPadding=Math.min(n.height/2,i);const a=n.width+this.axisConfig.labelPadding*2;a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width-r,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${r},${this.boundingRect.y} L ${r},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(r),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const r=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${r},${this.getScaleValue(n)} L ${r-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r} L ${this.getScaleValue(n)},${r+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${r+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},x(Lv,"BaseAxis"),Lv),olt=(Iv=class extends Ige{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=pA().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=pA().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),ae.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},x(Iv,"BandAxis"),Iv),llt=(Dv=class extends Ige{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=D0().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=D0().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},x(Dv,"LinearAxis"),Dv);function h$(t,e,r,n){const i=new _ge(n);return u$(t)?new olt(e,r,t.categories,t.title,i):new llt(e,r,[t.min,t.max],t.title,i)}x(h$,"getAxis");var clt=(Mv=class{constructor(e,r,n,i){this.textDimensionCalculator=e,this.chartConfig=r,this.chartData=n,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const r=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(r.width,e.width),i=r.height+2*this.chartConfig.titlePadding;return r.width<=n&&r.height<=i&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=i,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}},x(Mv,"ChartTitle"),Mv);function Dge(t,e,r,n){const i=new _ge(n);return new clt(i,t,e,r)}x(Dge,"getChartTitleComponent");var ult=(Nv=class{constructor(e,r,n,i,a){this.plotData=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=a}getDrawableElement(){const e=this.plotData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]);let r;return this.orientation==="horizontal"?r=M2().y(n=>n[0]).x(n=>n[1])(e):r=M2().x(n=>n[0]).y(n=>n[1])(e),r?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:r,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},x(Nv,"LinePlot"),Nv),hlt=(Ov=class{constructor(e,r,n,i,a,s){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=a,this.plotIndex=s}getDrawableElement(){const e=this.barData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),i=n/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:this.boundingRect.x,y:a[0]-i,height:n,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:a[0]-i,y:a[1],width:n,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},x(Ov,"BarPlot"),Ov),dlt=($v=class{constructor(e,r,n){this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(e,r){this.xAxis=e,this.yAxis=r}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const e=[];for(const[r,n]of this.chartData.plots.entries())switch(n.type){case"line":{const i=new ult(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new hlt(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},x($v,"BasePlot"),$v);function Mge(t,e,r){return new dlt(t,e,r)}x(Mge,"getPlotComponent");var flt=(Pv=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:Dge(e,r,n,i),plot:Mge(e,r,n),xAxis:h$(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:h$(r.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},i)}}calculateVerticalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:a,height:s});e-=o.width,r-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=o.height,r-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=o.width,e-=o.width,e>0&&(a+=e,e=0),r>0&&(s+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:s}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+s}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>c$(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=0,s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:s,height:o});e-=l.width,r-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),n=l.height,r-=l.height,this.componentStore.xAxis.setAxisPosition("left"),l=this.componentStore.xAxis.calculateSpace({width:e,height:r}),e-=l.width,i=l.width,this.componentStore.yAxis.setAxisPosition("top"),l=this.componentStore.yAxis.calculateSpace({width:e,height:r}),r-=l.height,a=n+l.height,e>0&&(s+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:s,height:o}),this.componentStore.plot.setBoundingBoxXY({x:i,y:a}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([a,a+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(u=>c$(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const r of Object.values(this.componentStore))e.push(...r.getDrawableElements());return e}},x(Pv,"Orchestrator"),Pv),plt=(Bv=class{static build(e,r,n,i){return new flt(e,r,n,i).getDrawableElement()}},x(Bv,"XYChartBuilder"),Bv),UT=0,Nge,HT=g$(),YT=p$(),hn=m$(),d$=YT.plotColorPalette.split(",").map(t=>t.trim()),xS=!1,f$=!1;function p$(){const t=w0(),e=lr();return ti(t.xyChart,e.themeVariables.xyChart)}x(p$,"getChartDefaultThemeConfig");function g$(){const t=lr();return ti(Fr.xyChart,t.xyChart)}x(g$,"getChartDefaultConfig");function m$(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}x(m$,"getChartDefaultData");function TS(t){const e=lr();return qr(t.trim(),e)}x(TS,"textSanitizer");function Oge(t){Nge=t}x(Oge,"setTmpSVGG");function $ge(t){t==="horizontal"?HT.chartOrientation="horizontal":HT.chartOrientation="vertical"}x($ge,"setOrientation");function Pge(t){hn.xAxis.title=TS(t.text)}x(Pge,"setXAxisTitle");function y$(t,e){hn.xAxis={type:"linear",title:hn.xAxis.title,min:t,max:e},xS=!0}x(y$,"setXAxisRangeData");function Bge(t){hn.xAxis={type:"band",title:hn.xAxis.title,categories:t.map(e=>TS(e.text))},xS=!0}x(Bge,"setXAxisBand");function Fge(t){hn.yAxis.title=TS(t.text)}x(Fge,"setYAxisTitle");function zge(t,e){hn.yAxis={type:"linear",title:hn.yAxis.title,min:t,max:e},f$=!0}x(zge,"setYAxisRangeData");function Gge(t){const e=Math.min(...t),r=Math.max(...t),n=Jg(hn.yAxis)?hn.yAxis.min:1/0,i=Jg(hn.yAxis)?hn.yAxis.max:-1/0;hn.yAxis={type:"linear",title:hn.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}x(Gge,"setYAxisRangeFromPlotData");function v$(t){let e=[];if(t.length===0)return e;if(!xS){const r=Jg(hn.xAxis)?hn.xAxis.min:1/0,n=Jg(hn.xAxis)?hn.xAxis.max:-1/0;y$(Math.min(r,1),Math.max(n,t.length))}if(f$||Gge(t),u$(hn.xAxis)&&(e=hn.xAxis.categories.map((r,n)=>[r,t[n]])),Jg(hn.xAxis)){const r=hn.xAxis.min,n=hn.xAxis.max,i=(n-r)/(t.length-1),a=[];for(let s=r;s<=n;s+=i)a.push(`${s}`);e=a.map((s,o)=>[s,t[o]])}return e}x(v$,"transformDataWithoutCategory");function b$(t){return d$[t===0?0:t%d$.length]}x(b$,"getPlotColorFromPalette");function qge(t,e){const r=v$(e);hn.plots.push({type:"line",strokeFill:b$(UT),strokeWidth:2,data:r}),UT++}x(qge,"setLineData");function Vge(t,e){const r=v$(e);hn.plots.push({type:"bar",fill:b$(UT),data:r}),UT++}x(Vge,"setBarData");function Wge(){if(hn.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return hn.title=Mn(),plt.build(HT,hn,YT,Nge)}x(Wge,"getDrawableElem");function Uge(){return YT}x(Uge,"getChartThemeConfig");function Hge(){return HT}x(Hge,"getChartConfig");function Yge(){return hn}x(Yge,"getXYChartData");var glt=x(function(){In(),UT=0,HT=g$(),hn=m$(),YT=p$(),d$=YT.plotColorPalette.split(",").map(t=>t.trim()),xS=!1,f$=!1},"clear"),mlt={getDrawableElem:Wge,clear:glt,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,getAccDescription:Gn,setAccDescription:zn,setOrientation:$ge,setXAxisTitle:Pge,setXAxisRangeData:y$,setXAxisBand:Bge,setYAxisTitle:Fge,setYAxisRangeData:zge,setLineData:qge,setBarData:Vge,setTmpSVGG:Oge,getChartThemeConfig:Uge,getChartConfig:Hge,getXYChartData:Yge},ylt=x((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),s=i.getChartConfig(),o=i.getXYChartData().plots[0].data.map(v=>v[1]);function l(v){return v==="top"?"text-before-edge":"middle"}x(l,"getDominantBaseLine");function u(v){return v==="left"?"start":v==="right"?"end":"middle"}x(u,"getTextAnchor");function h(v){return`translate(${v.x}, ${v.y}) rotate(${v.rotation||0})`}x(h,"getTextTransformation"),ae.debug(`Rendering xychart chart -`+t);const d=ys(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");wi(d,s.height,s.width,!0),d.attr("viewBox",`0 0 ${s.width} ${s.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),m={};function y(v){let T=f,b="";for(const[w]of v.entries()){let k=f;w>0&&m[b]&&(k=m[b]),b+=v[w],T=m[b],T||(T=m[b]=k.append("g").attr("class",v[w]))}return T}x(y,"getGroup");for(const v of g){if(v.data.length===0)continue;const T=y(v.groupTexts);switch(v.type){case"rect":if(T.selectAll("rect").data(v.data).enter().append("rect").attr("x",b=>b.x).attr("y",b=>b.y).attr("width",b=>b.width).attr("height",b=>b.height).attr("fill",b=>b.fill).attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth),s.showDataLabel){const b=s.showDataLabelOutsideBar;if(s.chartOrientation==="horizontal"){let w=function(M,z){const{data:F,label:S}=M;return z*S.length*k<=F.width-A};x(w,"fitsHorizontally");const k=.7,A=10,C=v.data.map((M,z)=>({data:M,label:o[z].toString()})).filter(M=>M.data.width>0&&M.data.height>0),_=C.map(M=>{const{data:z}=M;let F=z.height*.7;for(;!w(M,F)&&F>0;)F-=1;return F}),L=Math.floor(Math.min(..._)),O=x(M=>b?M.data.x+M.data.width+A:M.data.x+M.data.width-A,"determineLabelXPosition");T.selectAll("text").data(C).enter().append("text").attr("x",O).attr("y",M=>M.data.y+M.data.height/2).attr("text-anchor",b?"start":"end").attr("dominant-baseline","middle").attr("fill",a.dataLabelColor).attr("font-size",`${L}px`).text(M=>M.label)}else{let w=function(O,M,z){const{data:F,label:S}=O,N=M*S.length*.7,D=F.x+F.width/2,I=D-N/2,$=D+N/2,B=I>=F.x&&$<=F.x+F.width,P=F.y+z+M<=F.y+F.height;return B&&P};x(w,"fitsInBar");const k=10,A=v.data.map((O,M)=>({data:O,label:o[M].toString()})).filter(O=>O.data.width>0&&O.data.height>0),C=A.map(O=>{const{data:M,label:z}=O;let F=M.width/(z.length*.7);for(;!w(O,F,k)&&F>0;)F-=1;return F}),_=Math.floor(Math.min(...C)),L=x(O=>b?O.data.y-k:O.data.y+k,"determineLabelYPosition");T.selectAll("text").data(A).enter().append("text").attr("x",O=>O.data.x+O.data.width/2).attr("y",L).attr("text-anchor","middle").attr("dominant-baseline",b?"auto":"hanging").attr("fill",a.dataLabelColor).attr("font-size",`${_}px`).text(O=>O.label)}}break;case"text":T.selectAll("text").data(v.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",b=>b.fill).attr("font-size",b=>b.fontSize).attr("dominant-baseline",b=>l(b.verticalPos)).attr("text-anchor",b=>u(b.horizontalPos)).attr("transform",b=>h(b)).text(b=>b.text);break;case"path":T.selectAll("path").data(v.data).enter().append("path").attr("d",b=>b.path).attr("fill",b=>b.fill?b.fill:"none").attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth);break}}},"draw"),vlt={draw:ylt},blt={parser:slt,db:mlt,renderer:vlt};const xlt=Object.freeze(Object.defineProperty({__proto__:null,diagram:blt},Symbol.toStringTag,{value:"Module"}));var x$=(function(){var t=x(function(Ce,Se,H,he){for(H=H||{},he=Ce.length;he--;H[Ce[he]]=Se);return H},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],o=[2,7],l=[1,26],u=[1,27],h=[1,28],d=[1,29],f=[1,33],p=[1,34],g=[1,35],m=[1,36],y=[1,37],v=[1,38],T=[1,24],b=[1,31],w=[1,32],k=[1,30],A=[1,39],C=[1,40],_=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],L=[1,61],O=[89,90],M=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],z=[27,29],F=[1,70],S=[1,71],R=[1,72],N=[1,73],D=[1,74],I=[1,75],$=[1,76],B=[1,83],P=[1,80],G=[1,84],V=[1,85],Y=[1,86],W=[1,87],ie=[1,88],K=[1,89],se=[1,90],J=[1,91],Z=[1,92],ee=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],ne=[63,64],ue=[1,101],fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],_e=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Ae=[1,110],Ne=[1,106],me=[1,107],ve=[1,108],Ge=[1,109],Te=[1,111],Ze=[1,116],ke=[1,117],Ve=[1,114],Qe=[1,115],nt={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:x(function(Se,H,he,j,pe,re,Be){var xe=re.length-1;switch(pe){case 4:this.$=re[xe].trim(),j.setAccTitle(this.$);break;case 5:case 6:this.$=re[xe].trim(),j.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:j.setDirection("TB");break;case 18:j.setDirection("BT");break;case 19:j.setDirection("RL");break;case 20:j.setDirection("LR");break;case 21:j.addRequirement(re[xe-3],re[xe-4]);break;case 22:j.addRequirement(re[xe-5],re[xe-6]),j.setClass([re[xe-5]],re[xe-3]);break;case 23:j.setNewReqId(re[xe-2]);break;case 24:j.setNewReqText(re[xe-2]);break;case 25:j.setNewReqRisk(re[xe-2]);break;case 26:j.setNewReqVerifyMethod(re[xe-2]);break;case 29:this.$=j.RequirementType.REQUIREMENT;break;case 30:this.$=j.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=j.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=j.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=j.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=j.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=j.RiskLevel.LOW_RISK;break;case 36:this.$=j.RiskLevel.MED_RISK;break;case 37:this.$=j.RiskLevel.HIGH_RISK;break;case 38:this.$=j.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=j.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=j.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=j.VerifyType.VERIFY_TEST;break;case 42:j.addElement(re[xe-3]);break;case 43:j.addElement(re[xe-5]),j.setClass([re[xe-5]],re[xe-3]);break;case 44:j.setNewElementType(re[xe-2]);break;case 45:j.setNewElementDocRef(re[xe-2]);break;case 48:j.addRelationship(re[xe-2],re[xe],re[xe-4]);break;case 49:j.addRelationship(re[xe-2],re[xe-4],re[xe]);break;case 50:this.$=j.Relationships.CONTAINS;break;case 51:this.$=j.Relationships.COPIES;break;case 52:this.$=j.Relationships.DERIVES;break;case 53:this.$=j.Relationships.SATISFIES;break;case 54:this.$=j.Relationships.VERIFIES;break;case 55:this.$=j.Relationships.REFINES;break;case 56:this.$=j.Relationships.TRACES;break;case 57:this.$=re[xe-2],j.defineClass(re[xe-1],re[xe]);break;case 58:j.setClass(re[xe-1],re[xe]);break;case 59:j.setClass([re[xe-2]],re[xe]);break;case 60:case 62:this.$=[re[xe]];break;case 61:case 63:this.$=re[xe-2].concat([re[xe]]);break;case 64:this.$=re[xe-2],j.setCssStyle(re[xe-1],re[xe]);break;case 65:this.$=[re[xe]];break;case 66:re[xe-2].push(re[xe]),this.$=re[xe-2];break;case 68:this.$=re[xe-1]+re[xe];break}},"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:s,7:13,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{4:17,5:s,7:43,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{4:17,5:s,7:44,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{4:17,5:s,7:45,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{4:17,5:s,7:46,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{4:17,5:s,7:47,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{4:17,5:s,7:48,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{4:17,5:s,7:49,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{4:17,5:s,7:50,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(_,[2,17]),t(_,[2,18]),t(_,[2,19]),t(_,[2,20]),{30:60,33:62,75:L,89:A,90:C},{30:63,33:62,75:L,89:A,90:C},{30:64,33:62,75:L,89:A,90:C},t(O,[2,29]),t(O,[2,30]),t(O,[2,31]),t(O,[2,32]),t(O,[2,33]),t(O,[2,34]),t(M,[2,81]),t(M,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(z,[2,79]),t(z,[2,80]),{27:[1,67],29:[1,68]},t(z,[2,85]),t(z,[2,86]),{62:69,65:F,66:S,67:R,68:N,69:D,70:I,71:$},{62:77,65:F,66:S,67:R,68:N,69:D,70:I,71:$},{30:78,33:62,75:L,89:A,90:C},{73:79,75:B,76:P,78:81,79:82,80:G,81:V,82:Y,83:W,84:ie,85:K,86:se,87:J,88:Z},t(ee,[2,60]),t(ee,[2,62]),{73:93,75:B,76:P,78:81,79:82,80:G,81:V,82:Y,83:W,84:ie,85:K,86:se,87:J,88:Z},{30:94,33:62,75:L,76:P,89:A,90:C},{5:[1,95]},{30:96,33:62,75:L,89:A,90:C},{5:[1,97]},{30:98,33:62,75:L,89:A,90:C},{63:[1,99]},t(ne,[2,50]),t(ne,[2,51]),t(ne,[2,52]),t(ne,[2,53]),t(ne,[2,54]),t(ne,[2,55]),t(ne,[2,56]),{64:[1,100]},t(_,[2,59],{76:P}),t(_,[2,64],{76:ue}),{33:103,75:[1,102],89:A,90:C},t(fe,[2,65],{79:104,75:B,80:G,81:V,82:Y,83:W,84:ie,85:K,86:se,87:J,88:Z}),t(_e,[2,67]),t(_e,[2,69]),t(_e,[2,70]),t(_e,[2,71]),t(_e,[2,72]),t(_e,[2,73]),t(_e,[2,74]),t(_e,[2,75]),t(_e,[2,76]),t(_e,[2,77]),t(_e,[2,78]),t(_,[2,57],{76:ue}),t(_,[2,58],{76:P}),{5:Ae,28:105,31:Ne,34:me,36:ve,38:Ge,40:Te},{27:[1,112],76:P},{5:Ze,40:ke,56:113,57:Ve,59:Qe},{27:[1,118],76:P},{33:119,89:A,90:C},{33:120,89:A,90:C},{75:B,78:121,79:82,80:G,81:V,82:Y,83:W,84:ie,85:K,86:se,87:J,88:Z},t(ee,[2,61]),t(ee,[2,63]),t(_e,[2,68]),t(_,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Ae,28:126,31:Ne,34:me,36:ve,38:Ge,40:Te},t(_,[2,28]),{5:[1,127]},t(_,[2,42]),{32:[1,128]},{32:[1,129]},{5:Ze,40:ke,56:130,57:Ve,59:Qe},t(_,[2,47]),{5:[1,131]},t(_,[2,48]),t(_,[2,49]),t(fe,[2,66],{79:104,75:B,80:G,81:V,82:Y,83:W,84:ie,85:K,86:se,87:J,88:Z}),{33:132,89:A,90:C},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(_,[2,27]),{5:Ae,28:145,31:Ne,34:me,36:ve,38:Ge,40:Te},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(_,[2,46]),{5:Ze,40:ke,56:152,57:Ve,59:Qe},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(_,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(_,[2,43]),{5:Ae,28:159,31:Ne,34:me,36:ve,38:Ge,40:Te},{5:Ae,28:160,31:Ne,34:me,36:ve,38:Ge,40:Te},{5:Ae,28:161,31:Ne,34:me,36:ve,38:Ge,40:Te},{5:Ae,28:162,31:Ne,34:me,36:ve,38:Ge,40:Te},{5:Ze,40:ke,56:163,57:Ve,59:Qe},{5:Ze,40:ke,56:164,57:Ve,59:Qe},t(_,[2,23]),t(_,[2,24]),t(_,[2,25]),t(_,[2,26]),t(_,[2,44]),t(_,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:x(function(Se,H){if(H.recoverable)this.trace(Se);else{var he=new Error(Se);throw he.hash=H,he}},"parseError"),parse:x(function(Se){var H=this,he=[0],j=[],pe=[null],re=[],Be=this.table,xe="",Ue=0,De=0,qe=2,Le=1,Xe=re.slice.call(arguments,1),Ie=Object.create(this.lexer),it={yy:{}};for(var we in this.yy)Object.prototype.hasOwnProperty.call(this.yy,we)&&(it.yy[we]=this.yy[we]);Ie.setInput(Se,it.yy),it.yy.lexer=Ie,it.yy.parser=this,typeof Ie.yylloc>"u"&&(Ie.yylloc={});var lt=Ie.yylloc;re.push(lt);var be=Ie.options&&Ie.options.ranges;typeof it.yy.parseError=="function"?this.parseError=it.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Et(ye){he.length=he.length-2*ye,pe.length=pe.length-ye,re.length=re.length-ye}x(Et,"popStack");function vt(){var ye;return ye=j.pop()||Ie.lex()||Le,typeof ye!="number"&&(ye instanceof Array&&(j=ye,ye=j.pop()),ye=H.symbols_[ye]||ye),ye}x(vt,"lex");for(var ot,It,xt,ht,oe={},At,dt,ut,wt;;){if(It=he[he.length-1],this.defaultActions[It]?xt=this.defaultActions[It]:((ot===null||typeof ot>"u")&&(ot=vt()),xt=Be[It]&&Be[It][ot]),typeof xt>"u"||!xt.length||!xt[0]){var Mr="";wt=[];for(At in Be[It])this.terminals_[At]&&At>qe&&wt.push("'"+this.terminals_[At]+"'");Ie.showPosition?Mr="Parse error on line "+(Ue+1)+`: -`+Ie.showPosition()+` -Expecting `+wt.join(", ")+", got '"+(this.terminals_[ot]||ot)+"'":Mr="Parse error on line "+(Ue+1)+": Unexpected "+(ot==Le?"end of input":"'"+(this.terminals_[ot]||ot)+"'"),this.parseError(Mr,{text:Ie.match,token:this.terminals_[ot]||ot,line:Ie.yylineno,loc:lt,expected:wt})}if(xt[0]instanceof Array&&xt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+It+", token: "+ot);switch(xt[0]){case 1:he.push(ot),pe.push(Ie.yytext),re.push(Ie.yylloc),he.push(xt[1]),ot=null,De=Ie.yyleng,xe=Ie.yytext,Ue=Ie.yylineno,lt=Ie.yylloc;break;case 2:if(dt=this.productions_[xt[1]][1],oe.$=pe[pe.length-dt],oe._$={first_line:re[re.length-(dt||1)].first_line,last_line:re[re.length-1].last_line,first_column:re[re.length-(dt||1)].first_column,last_column:re[re.length-1].last_column},be&&(oe._$.range=[re[re.length-(dt||1)].range[0],re[re.length-1].range[1]]),ht=this.performAction.apply(oe,[xe,De,Ue,it.yy,xt[1],pe,re].concat(Xe)),typeof ht<"u")return ht;dt&&(he=he.slice(0,-1*dt*2),pe=pe.slice(0,-1*dt),re=re.slice(0,-1*dt)),he.push(this.productions_[xt[1]][0]),pe.push(oe.$),re.push(oe._$),ut=Be[he[he.length-2]][he[he.length-1]],he.push(ut);break;case 3:return!0}}return!0},"parse")},tt=(function(){var Ce={EOF:1,parseError:x(function(H,he){if(this.yy.parser)this.yy.parser.parseError(H,he);else throw new Error(H)},"parseError"),setInput:x(function(Se,H){return this.yy=H||this.yy||{},this._input=Se,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Se=this._input[0];this.yytext+=Se,this.yyleng++,this.offset++,this.match+=Se,this.matched+=Se;var H=Se.match(/(?:\r\n?|\n).*/g);return H?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Se},"input"),unput:x(function(Se){var H=Se.length,he=Se.split(/(?:\r\n?|\n)/g);this._input=Se+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-H),this.offset-=H;var j=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),he.length-1&&(this.yylineno-=he.length-1);var pe=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:he?(he.length===j.length?this.yylloc.first_column:0)+j[j.length-he.length].length-he[0].length:this.yylloc.first_column-H},this.options.ranges&&(this.yylloc.range=[pe[0],pe[0]+this.yyleng-H]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Se){this.unput(this.match.slice(Se))},"less"),pastInput:x(function(){var Se=this.matched.substr(0,this.matched.length-this.match.length);return(Se.length>20?"...":"")+Se.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Se=this.match;return Se.length<20&&(Se+=this._input.substr(0,20-Se.length)),(Se.substr(0,20)+(Se.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Se=this.pastInput(),H=new Array(Se.length+1).join("-");return Se+this.upcomingInput()+` -`+H+"^"},"showPosition"),test_match:x(function(Se,H){var he,j,pe;if(this.options.backtrack_lexer&&(pe={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(pe.yylloc.range=this.yylloc.range.slice(0))),j=Se[0].match(/(?:\r\n?|\n).*/g),j&&(this.yylineno+=j.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:j?j[j.length-1].length-j[j.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Se[0].length},this.yytext+=Se[0],this.match+=Se[0],this.matches=Se,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Se[0].length),this.matched+=Se[0],he=this.performAction.call(this,this.yy,this,H,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),he)return he;if(this._backtrack){for(var re in pe)this[re]=pe[re];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Se,H,he,j;this._more||(this.yytext="",this.match="");for(var pe=this._currentRules(),re=0;reH[0].length)){if(H=he,j=re,this.options.backtrack_lexer){if(Se=this.test_match(he,pe[re]),Se!==!1)return Se;if(this._backtrack){H=!1;continue}else return!1}else if(!this.options.flex)break}return H?(Se=this.test_match(H,pe[j]),Se!==!1?Se:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var H=this.next();return H||this.lex()},"lex"),begin:x(function(H){this.conditionStack.push(H)},"begin"),popState:x(function(){var H=this.conditionStack.length-1;return H>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(H){return H=this.conditionStack.length-1-Math.abs(H||0),H>=0?this.conditionStack[H]:"INITIAL"},"topState"),pushState:x(function(H){this.begin(H)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(H,he,j,pe){switch(j){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return he.yytext=he.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return Ce})();nt.lexer=tt;function je(){this.yy={}}return x(je,"Parser"),je.prototype=nt,nt.Parser=je,new je})();x$.parser=x$;var Tlt=x$,wlt=(Fv=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Dn,this.getAccTitle=Fn,this.setAccDescription=zn,this.getAccDescription=Gn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getConfig=x(()=>Pe().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,r){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:r,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),ae.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,r,n){this.relations.push({type:e,src:r,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,In()}setCssStyle(e,r){for(const n of e){const i=this.requirements.get(n)??this.elements.get(n);if(!r||!i)return;for(const a of r)a.includes(",")?i.cssStyles.push(...a.split(",")):i.cssStyles.push(a)}}setClass(e,r){var n;for(const i of e){const a=this.requirements.get(i)??this.elements.get(i);if(a)for(const s of r){a.classes.push(s);const o=(n=this.classes.get(s))==null?void 0:n.styles;o&&a.cssStyles.push(...o)}}}defineClass(e,r){for(const n of e){let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.requirements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))}),this.elements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))})}}getClasses(){return this.classes}getData(){var i,a,s,o;const e=Pe(),r=[],n=[];for(const l of this.requirements.values()){const u=l;u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.shape="requirementBox",u.look=e.look,u.colorIndex=r.length,r.push(u)}for(const l of this.elements.values()){const u=l;u.shape="requirementBox",u.look=e.look,u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.colorIndex=r.length,r.push(u)}for(const l of this.relations){let u=0;const h=l.type===this.Relationships.CONTAINS,d={id:`${l.src}-${l.dst}-${u}`,start:((i=this.requirements.get(l.src))==null?void 0:i.name)??((a=this.elements.get(l.src))==null?void 0:a.name),end:((s=this.requirements.get(l.dst))==null?void 0:s.name)??((o=this.elements.get(l.dst))==null?void 0:o.name),label:`<<${l.type}>>`,classes:"relationshipLine",style:["fill:none",h?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:h?"normal":"dashed",arrowTypeStart:h?"requirement_contains":"",arrowTypeEnd:h?"":"requirement_arrow",look:e.look,labelType:"markdown"};n.push(d),u++}return{nodes:r,edges:n,other:{},config:e,direction:this.getDirection()}}},x(Fv,"RequirementDB"),Fv),Clt=x(t=>{const e=lr(),{themeVariables:r,look:n}=e,{bkgColorArray:i,borderColorArray:a}=r;if(!(a!=null&&a.length))return"";let s="";for(let o=0;o1)throw new Error("Parse Error: multiple actions possible at state: "+Ne+", token: "+Ae);switch(me[0]){case 1:I.push(Ae),B.push(J.yytext),P.push(J.yylloc),I.push(me[1]),Ae=null,W=J.yyleng,V=J.yytext,X=J.yylineno,ne=J.yylloc;break;case 2:if(Ze=this.productions_[me[1]][1],Ge.$=B[B.length-Ze],Ge._$={first_line:P[P.length-(Ze||1)].first_line,last_line:P[P.length-1].last_line,first_column:P[P.length-(Ze||1)].first_column,last_column:P[P.length-1].last_column},ue&&(Ge._$.range=[P[P.length-(Ze||1)].range[0],P[P.length-1].range[1]]),ve=this.performAction.apply(Ge,[V,W,X,Z.yy,me[1],B,P].concat(se)),typeof ve<"u")return ve;Ze&&(I=I.slice(0,-1*Ze*2),B=B.slice(0,-1*Ze),P=P.slice(0,-1*Ze)),I.push(this.productions_[me[1]][0]),B.push(Ge.$),P.push(Ge._$),ke=G[I[I.length-2]][I[I.length-1]],I.push(ke);break;case 3:return!0}}return!0},"parse")},F=(function(){var R={EOF:1,parseError:T(function(D,I){if(this.yy.parser)this.yy.parser.parseError(D,I);else throw new Error(D)},"parseError"),setInput:T(function(N,D){return this.yy=D||this.yy||{},this._input=N,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var N=this._input[0];this.yytext+=N,this.yyleng++,this.offset++,this.match+=N,this.matched+=N;var D=N.match(/(?:\r\n?|\n).*/g);return D?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),N},"input"),unput:T(function(N){var D=N.length,I=N.split(/(?:\r\n?|\n)/g);this._input=N+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-D),this.offset-=D;var $=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),I.length-1&&(this.yylineno-=I.length-1);var B=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:I?(I.length===$.length?this.yylloc.first_column:0)+$[$.length-I.length].length-I[0].length:this.yylloc.first_column-D},this.options.ranges&&(this.yylloc.range=[B[0],B[0]+this.yyleng-D]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(N){this.unput(this.match.slice(N))},"less"),pastInput:T(function(){var N=this.matched.substr(0,this.matched.length-this.match.length);return(N.length>20?"...":"")+N.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var N=this.match;return N.length<20&&(N+=this._input.substr(0,20-N.length)),(N.substr(0,20)+(N.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var N=this.pastInput(),D=new Array(N.length+1).join("-");return N+this.upcomingInput()+` +`+D+"^"},"showPosition"),test_match:T(function(N,D){var I,$,B;if(this.options.backtrack_lexer&&(B={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(B.yylloc.range=this.yylloc.range.slice(0))),$=N[0].match(/(?:\r\n?|\n).*/g),$&&(this.yylineno+=$.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:$?$[$.length-1].length-$[$.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+N[0].length},this.yytext+=N[0],this.match+=N[0],this.matches=N,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(N[0].length),this.matched+=N[0],I=this.performAction.call(this,this.yy,this,D,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),I)return I;if(this._backtrack){for(var P in B)this[P]=B[P];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var N,D,I,$;this._more||(this.yytext="",this.match="");for(var B=this._currentRules(),P=0;PD[0].length)){if(D=I,$=P,this.options.backtrack_lexer){if(N=this.test_match(I,B[P]),N!==!1)return N;if(this._backtrack){D=!1;continue}else return!1}else if(!this.options.flex)break}return D?(N=this.test_match(D,B[$]),N!==!1?N:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var D=this.next();return D||this.lex()},"lex"),begin:T(function(D){this.conditionStack.push(D)},"begin"),popState:T(function(){var D=this.conditionStack.length-1;return D>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(D){return D=this.conditionStack.length-1-Math.abs(D||0),D>=0?this.conditionStack[D]:"INITIAL"},"topState"),pushState:T(function(D){this.begin(D)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(D,I,$,B){switch($){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return R})();z.lexer=F;function A(){this.yy={}}return T(A,"Parser"),A.prototype=z,z.Parser=A,new A})();f$.parser=f$;var blt=f$;function p$(t){return t.type==="bar"}T(p$,"isBarPlot");function g$(t){return t.type==="band"}T(g$,"isBandAxisData");function em(t){return t.type==="linear"}T(em,"isLinearAxisData");var Nge=(Lv=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((a,s)=>Math.max(s.length,a),0)*r,height:r};const n={width:0,height:0},i=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",r);for(const a of e){const s=eW(i,1,a),o=s?s.width:a.length*r,l=s?s.height:r;n.width=Math.max(n.width,o),n.height=Math.max(n.height,l)}return i.remove(),n}},T(Lv,"TextDimensionCalculatorWithFont"),Lv),Oge=.7,$ge=.2,Pge=(Iv=class{constructor(e,r,n,i){this.axisConfig=e,this.title=r,this.textDimensionCalculator=n,this.axisThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(e){this.range=e,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){Oge*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Oge*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let r=e.height;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=$ge*e.width;this.outerPadding=Math.min(n.width/2,i);const a=n.height+this.axisConfig.labelPadding*2;this.labelTextHeight=n.height,a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-r}calculateSpaceIfDrawnVertical(e){let r=e.width;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=$ge*e.height;this.outerPadding=Math.min(n.height/2,i);const a=n.width+this.axisConfig.labelPadding*2;a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width-r,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${r},${this.boundingRect.y} L ${r},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(r),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const r=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${r},${this.getScaleValue(n)} L ${r-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r} L ${this.getScaleValue(n)},${r+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${r+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},T(Iv,"BaseAxis"),Iv),xlt=(Dv=class extends Pge{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=yA().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=yA().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),ae.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},T(Dv,"BandAxis"),Dv),Tlt=(Mv=class extends Pge{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=Dp().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=Dp().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},T(Mv,"LinearAxis"),Mv);function m$(t,e,r,n){const i=new Nge(n);return g$(t)?new xlt(e,r,t.categories,t.title,i):new Tlt(e,r,[t.min,t.max],t.title,i)}T(m$,"getAxis");var wlt=(Nv=class{constructor(e,r,n,i){this.textDimensionCalculator=e,this.chartConfig=r,this.chartData=n,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const r=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(r.width,e.width),i=r.height+2*this.chartConfig.titlePadding;return r.width<=n&&r.height<=i&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=i,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}},T(Nv,"ChartTitle"),Nv);function Bge(t,e,r,n){const i=new Nge(n);return new wlt(i,t,e,r)}T(Bge,"getChartTitleComponent");var Clt=(Ov=class{constructor(e,r,n,i,a){this.plotData=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=a}getDrawableElement(){const e=this.plotData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]);let r;return this.orientation==="horizontal"?r=N2().y(n=>n[0]).x(n=>n[1])(e):r=N2().x(n=>n[0]).y(n=>n[1])(e),r?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:r,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},T(Ov,"LinePlot"),Ov),klt=($v=class{constructor(e,r,n,i,a,s){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=a,this.plotIndex=s}getDrawableElement(){const e=this.barData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),i=n/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:this.boundingRect.x,y:a[0]-i,height:n,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:a[0]-i,y:a[1],width:n,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},T($v,"BarPlot"),$v),Elt=(Pv=class{constructor(e,r,n){this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(e,r){this.xAxis=e,this.yAxis=r}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const e=[];for(const[r,n]of this.chartData.plots.entries())switch(n.type){case"line":{const i=new Clt(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new klt(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},T(Pv,"BasePlot"),Pv);function Fge(t,e,r){return new Elt(t,e,r)}T(Fge,"getPlotComponent");var Slt=(Bv=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:Bge(e,r,n,i),plot:Fge(e,r,n),xAxis:m$(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:m$(r.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},i)}}calculateVerticalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:a,height:s});e-=o.width,r-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=o.height,r-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=o.width,e-=o.width,e>0&&(a+=e,e=0),r>0&&(s+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:s}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+s}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>p$(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=0,s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:s,height:o});e-=l.width,r-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),n=l.height,r-=l.height,this.componentStore.xAxis.setAxisPosition("left"),l=this.componentStore.xAxis.calculateSpace({width:e,height:r}),e-=l.width,i=l.width,this.componentStore.yAxis.setAxisPosition("top"),l=this.componentStore.yAxis.calculateSpace({width:e,height:r}),r-=l.height,a=n+l.height,e>0&&(s+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:s,height:o}),this.componentStore.plot.setBoundingBoxXY({x:i,y:a}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([a,a+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(u=>p$(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const r of Object.values(this.componentStore))e.push(...r.getDrawableElements());return e}},T(Bv,"Orchestrator"),Bv),Alt=(Fv=class{static build(e,r,n,i){return new Slt(e,r,n,i).getDrawableElement()}},T(Fv,"XYChartBuilder"),Fv),YT=0,zge,XT=x$(),KT=b$(),hn=T$(),y$=KT.plotColorPalette.split(",").map(t=>t.trim()),CS=!1,v$=!1;function b$(){const t=wp(),e=lr();return ti(t.xyChart,e.themeVariables.xyChart)}T(b$,"getChartDefaultThemeConfig");function x$(){const t=lr();return ti(Fr.xyChart,t.xyChart)}T(x$,"getChartDefaultConfig");function T$(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}T(T$,"getChartDefaultData");function kS(t){const e=lr();return qr(t.trim(),e)}T(kS,"textSanitizer");function Gge(t){zge=t}T(Gge,"setTmpSVGG");function qge(t){t==="horizontal"?XT.chartOrientation="horizontal":XT.chartOrientation="vertical"}T(qge,"setOrientation");function Vge(t){hn.xAxis.title=kS(t.text)}T(Vge,"setXAxisTitle");function w$(t,e){hn.xAxis={type:"linear",title:hn.xAxis.title,min:t,max:e},CS=!0}T(w$,"setXAxisRangeData");function Wge(t){hn.xAxis={type:"band",title:hn.xAxis.title,categories:t.map(e=>kS(e.text))},CS=!0}T(Wge,"setXAxisBand");function Uge(t){hn.yAxis.title=kS(t.text)}T(Uge,"setYAxisTitle");function Hge(t,e){hn.yAxis={type:"linear",title:hn.yAxis.title,min:t,max:e},v$=!0}T(Hge,"setYAxisRangeData");function Yge(t){const e=Math.min(...t),r=Math.max(...t),n=em(hn.yAxis)?hn.yAxis.min:1/0,i=em(hn.yAxis)?hn.yAxis.max:-1/0;hn.yAxis={type:"linear",title:hn.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}T(Yge,"setYAxisRangeFromPlotData");function C$(t){let e=[];if(t.length===0)return e;if(!CS){const r=em(hn.xAxis)?hn.xAxis.min:1/0,n=em(hn.xAxis)?hn.xAxis.max:-1/0;w$(Math.min(r,1),Math.max(n,t.length))}if(v$||Yge(t),g$(hn.xAxis)&&(e=hn.xAxis.categories.map((r,n)=>[r,t[n]])),em(hn.xAxis)){const r=hn.xAxis.min,n=hn.xAxis.max,i=(n-r)/(t.length-1),a=[];for(let s=r;s<=n;s+=i)a.push(`${s}`);e=a.map((s,o)=>[s,t[o]])}return e}T(C$,"transformDataWithoutCategory");function k$(t){return y$[t===0?0:t%y$.length]}T(k$,"getPlotColorFromPalette");function Xge(t,e){const r=C$(e);hn.plots.push({type:"line",strokeFill:k$(YT),strokeWidth:2,data:r}),YT++}T(Xge,"setLineData");function Kge(t,e){const r=C$(e);hn.plots.push({type:"bar",fill:k$(YT),data:r}),YT++}T(Kge,"setBarData");function jge(){if(hn.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return hn.title=Mn(),Alt.build(XT,hn,KT,zge)}T(jge,"getDrawableElem");function Zge(){return KT}T(Zge,"getChartThemeConfig");function Qge(){return XT}T(Qge,"getChartConfig");function Jge(){return hn}T(Jge,"getXYChartData");var _lt=T(function(){In(),YT=0,XT=x$(),hn=T$(),KT=b$(),y$=KT.plotColorPalette.split(",").map(t=>t.trim()),CS=!1,v$=!1},"clear"),Rlt={getDrawableElem:jge,clear:_lt,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,getAccDescription:Gn,setAccDescription:zn,setOrientation:qge,setXAxisTitle:Vge,setXAxisRangeData:w$,setXAxisBand:Wge,setYAxisTitle:Uge,setYAxisRangeData:Hge,setLineData:Xge,setBarData:Kge,setTmpSVGG:Gge,getChartThemeConfig:Zge,getChartConfig:Qge,getXYChartData:Jge},Llt=T((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),s=i.getChartConfig(),o=i.getXYChartData().plots[0].data.map(v=>v[1]);function l(v){return v==="top"?"text-before-edge":"middle"}T(l,"getDominantBaseLine");function u(v){return v==="left"?"start":v==="right"?"end":"middle"}T(u,"getTextAnchor");function h(v){return`translate(${v.x}, ${v.y}) rotate(${v.rotation||0})`}T(h,"getTextTransformation"),ae.debug(`Rendering xychart chart +`+t);const d=ys(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");wi(d,s.height,s.width,!0),d.attr("viewBox",`0 0 ${s.width} ${s.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),m={};function y(v){let x=f,b="";for(const[w]of v.entries()){let k=f;w>0&&m[b]&&(k=m[b]),b+=v[w],x=m[b],x||(x=m[b]=k.append("g").attr("class",v[w]))}return x}T(y,"getGroup");for(const v of g){if(v.data.length===0)continue;const x=y(v.groupTexts);switch(v.type){case"rect":if(x.selectAll("rect").data(v.data).enter().append("rect").attr("x",b=>b.x).attr("y",b=>b.y).attr("width",b=>b.width).attr("height",b=>b.height).attr("fill",b=>b.fill).attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth),s.showDataLabel){const b=s.showDataLabelOutsideBar;if(s.chartOrientation==="horizontal"){let w=function(M,z){const{data:F,label:A}=M;return z*A.length*k<=F.width-S};T(w,"fitsHorizontally");const k=.7,S=10,C=v.data.map((M,z)=>({data:M,label:o[z].toString()})).filter(M=>M.data.width>0&&M.data.height>0),_=C.map(M=>{const{data:z}=M;let F=z.height*.7;for(;!w(M,F)&&F>0;)F-=1;return F}),L=Math.floor(Math.min(..._)),O=T(M=>b?M.data.x+M.data.width+S:M.data.x+M.data.width-S,"determineLabelXPosition");x.selectAll("text").data(C).enter().append("text").attr("x",O).attr("y",M=>M.data.y+M.data.height/2).attr("text-anchor",b?"start":"end").attr("dominant-baseline","middle").attr("fill",a.dataLabelColor).attr("font-size",`${L}px`).text(M=>M.label)}else{let w=function(O,M,z){const{data:F,label:A}=O,N=M*A.length*.7,D=F.x+F.width/2,I=D-N/2,$=D+N/2,B=I>=F.x&&$<=F.x+F.width,P=F.y+z+M<=F.y+F.height;return B&&P};T(w,"fitsInBar");const k=10,S=v.data.map((O,M)=>({data:O,label:o[M].toString()})).filter(O=>O.data.width>0&&O.data.height>0),C=S.map(O=>{const{data:M,label:z}=O;let F=M.width/(z.length*.7);for(;!w(O,F,k)&&F>0;)F-=1;return F}),_=Math.floor(Math.min(...C)),L=T(O=>b?O.data.y-k:O.data.y+k,"determineLabelYPosition");x.selectAll("text").data(S).enter().append("text").attr("x",O=>O.data.x+O.data.width/2).attr("y",L).attr("text-anchor","middle").attr("dominant-baseline",b?"auto":"hanging").attr("fill",a.dataLabelColor).attr("font-size",`${_}px`).text(O=>O.label)}}break;case"text":x.selectAll("text").data(v.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",b=>b.fill).attr("font-size",b=>b.fontSize).attr("dominant-baseline",b=>l(b.verticalPos)).attr("text-anchor",b=>u(b.horizontalPos)).attr("transform",b=>h(b)).text(b=>b.text);break;case"path":x.selectAll("path").data(v.data).enter().append("path").attr("d",b=>b.path).attr("fill",b=>b.fill?b.fill:"none").attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth);break}}},"draw"),Ilt={draw:Llt},Dlt={parser:blt,db:Rlt,renderer:Ilt};const Mlt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Dlt},Symbol.toStringTag,{value:"Module"}));var E$=(function(){var t=T(function(Ce,Se,H,he){for(H=H||{},he=Ce.length;he--;H[Ce[he]]=Se);return H},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],o=[2,7],l=[1,26],u=[1,27],h=[1,28],d=[1,29],f=[1,33],p=[1,34],g=[1,35],m=[1,36],y=[1,37],v=[1,38],x=[1,24],b=[1,31],w=[1,32],k=[1,30],S=[1,39],C=[1,40],_=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],L=[1,61],O=[89,90],M=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],z=[27,29],F=[1,70],A=[1,71],R=[1,72],N=[1,73],D=[1,74],I=[1,75],$=[1,76],B=[1,83],P=[1,80],G=[1,84],V=[1,85],X=[1,86],W=[1,87],ie=[1,88],K=[1,89],se=[1,90],J=[1,91],Z=[1,92],ee=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],ne=[63,64],ue=[1,101],fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],_e=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Ae=[1,110],Ne=[1,106],me=[1,107],ve=[1,108],Ge=[1,109],Te=[1,111],Ze=[1,116],ke=[1,117],Ve=[1,114],Qe=[1,115],nt={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:T(function(Se,H,he,j,pe,re,Fe){var xe=re.length-1;switch(pe){case 4:this.$=re[xe].trim(),j.setAccTitle(this.$);break;case 5:case 6:this.$=re[xe].trim(),j.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:j.setDirection("TB");break;case 18:j.setDirection("BT");break;case 19:j.setDirection("RL");break;case 20:j.setDirection("LR");break;case 21:j.addRequirement(re[xe-3],re[xe-4]);break;case 22:j.addRequirement(re[xe-5],re[xe-6]),j.setClass([re[xe-5]],re[xe-3]);break;case 23:j.setNewReqId(re[xe-2]);break;case 24:j.setNewReqText(re[xe-2]);break;case 25:j.setNewReqRisk(re[xe-2]);break;case 26:j.setNewReqVerifyMethod(re[xe-2]);break;case 29:this.$=j.RequirementType.REQUIREMENT;break;case 30:this.$=j.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=j.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=j.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=j.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=j.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=j.RiskLevel.LOW_RISK;break;case 36:this.$=j.RiskLevel.MED_RISK;break;case 37:this.$=j.RiskLevel.HIGH_RISK;break;case 38:this.$=j.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=j.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=j.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=j.VerifyType.VERIFY_TEST;break;case 42:j.addElement(re[xe-3]);break;case 43:j.addElement(re[xe-5]),j.setClass([re[xe-5]],re[xe-3]);break;case 44:j.setNewElementType(re[xe-2]);break;case 45:j.setNewElementDocRef(re[xe-2]);break;case 48:j.addRelationship(re[xe-2],re[xe],re[xe-4]);break;case 49:j.addRelationship(re[xe-2],re[xe-4],re[xe]);break;case 50:this.$=j.Relationships.CONTAINS;break;case 51:this.$=j.Relationships.COPIES;break;case 52:this.$=j.Relationships.DERIVES;break;case 53:this.$=j.Relationships.SATISFIES;break;case 54:this.$=j.Relationships.VERIFIES;break;case 55:this.$=j.Relationships.REFINES;break;case 56:this.$=j.Relationships.TRACES;break;case 57:this.$=re[xe-2],j.defineClass(re[xe-1],re[xe]);break;case 58:j.setClass(re[xe-1],re[xe]);break;case 59:j.setClass([re[xe-2]],re[xe]);break;case 60:case 62:this.$=[re[xe]];break;case 61:case 63:this.$=re[xe-2].concat([re[xe]]);break;case 64:this.$=re[xe-2],j.setCssStyle(re[xe-1],re[xe]);break;case 65:this.$=[re[xe]];break;case 66:re[xe-2].push(re[xe]),this.$=re[xe-2];break;case 68:this.$=re[xe-1]+re[xe];break}},"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:s,7:13,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{4:17,5:s,7:43,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{4:17,5:s,7:44,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{4:17,5:s,7:45,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{4:17,5:s,7:46,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{4:17,5:s,7:47,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{4:17,5:s,7:48,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{4:17,5:s,7:49,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{4:17,5:s,7:50,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:S,90:C},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(_,[2,17]),t(_,[2,18]),t(_,[2,19]),t(_,[2,20]),{30:60,33:62,75:L,89:S,90:C},{30:63,33:62,75:L,89:S,90:C},{30:64,33:62,75:L,89:S,90:C},t(O,[2,29]),t(O,[2,30]),t(O,[2,31]),t(O,[2,32]),t(O,[2,33]),t(O,[2,34]),t(M,[2,81]),t(M,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(z,[2,79]),t(z,[2,80]),{27:[1,67],29:[1,68]},t(z,[2,85]),t(z,[2,86]),{62:69,65:F,66:A,67:R,68:N,69:D,70:I,71:$},{62:77,65:F,66:A,67:R,68:N,69:D,70:I,71:$},{30:78,33:62,75:L,89:S,90:C},{73:79,75:B,76:P,78:81,79:82,80:G,81:V,82:X,83:W,84:ie,85:K,86:se,87:J,88:Z},t(ee,[2,60]),t(ee,[2,62]),{73:93,75:B,76:P,78:81,79:82,80:G,81:V,82:X,83:W,84:ie,85:K,86:se,87:J,88:Z},{30:94,33:62,75:L,76:P,89:S,90:C},{5:[1,95]},{30:96,33:62,75:L,89:S,90:C},{5:[1,97]},{30:98,33:62,75:L,89:S,90:C},{63:[1,99]},t(ne,[2,50]),t(ne,[2,51]),t(ne,[2,52]),t(ne,[2,53]),t(ne,[2,54]),t(ne,[2,55]),t(ne,[2,56]),{64:[1,100]},t(_,[2,59],{76:P}),t(_,[2,64],{76:ue}),{33:103,75:[1,102],89:S,90:C},t(fe,[2,65],{79:104,75:B,80:G,81:V,82:X,83:W,84:ie,85:K,86:se,87:J,88:Z}),t(_e,[2,67]),t(_e,[2,69]),t(_e,[2,70]),t(_e,[2,71]),t(_e,[2,72]),t(_e,[2,73]),t(_e,[2,74]),t(_e,[2,75]),t(_e,[2,76]),t(_e,[2,77]),t(_e,[2,78]),t(_,[2,57],{76:ue}),t(_,[2,58],{76:P}),{5:Ae,28:105,31:Ne,34:me,36:ve,38:Ge,40:Te},{27:[1,112],76:P},{5:Ze,40:ke,56:113,57:Ve,59:Qe},{27:[1,118],76:P},{33:119,89:S,90:C},{33:120,89:S,90:C},{75:B,78:121,79:82,80:G,81:V,82:X,83:W,84:ie,85:K,86:se,87:J,88:Z},t(ee,[2,61]),t(ee,[2,63]),t(_e,[2,68]),t(_,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Ae,28:126,31:Ne,34:me,36:ve,38:Ge,40:Te},t(_,[2,28]),{5:[1,127]},t(_,[2,42]),{32:[1,128]},{32:[1,129]},{5:Ze,40:ke,56:130,57:Ve,59:Qe},t(_,[2,47]),{5:[1,131]},t(_,[2,48]),t(_,[2,49]),t(fe,[2,66],{79:104,75:B,80:G,81:V,82:X,83:W,84:ie,85:K,86:se,87:J,88:Z}),{33:132,89:S,90:C},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(_,[2,27]),{5:Ae,28:145,31:Ne,34:me,36:ve,38:Ge,40:Te},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(_,[2,46]),{5:Ze,40:ke,56:152,57:Ve,59:Qe},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(_,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(_,[2,43]),{5:Ae,28:159,31:Ne,34:me,36:ve,38:Ge,40:Te},{5:Ae,28:160,31:Ne,34:me,36:ve,38:Ge,40:Te},{5:Ae,28:161,31:Ne,34:me,36:ve,38:Ge,40:Te},{5:Ae,28:162,31:Ne,34:me,36:ve,38:Ge,40:Te},{5:Ze,40:ke,56:163,57:Ve,59:Qe},{5:Ze,40:ke,56:164,57:Ve,59:Qe},t(_,[2,23]),t(_,[2,24]),t(_,[2,25]),t(_,[2,26]),t(_,[2,44]),t(_,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:T(function(Se,H){if(H.recoverable)this.trace(Se);else{var he=new Error(Se);throw he.hash=H,he}},"parseError"),parse:T(function(Se){var H=this,he=[0],j=[],pe=[null],re=[],Fe=this.table,xe="",Ue=0,Me=0,qe=2,Le=1,Xe=re.slice.call(arguments,1),De=Object.create(this.lexer),it={yy:{}};for(var we in this.yy)Object.prototype.hasOwnProperty.call(this.yy,we)&&(it.yy[we]=this.yy[we]);De.setInput(Se,it.yy),it.yy.lexer=De,it.yy.parser=this,typeof De.yylloc>"u"&&(De.yylloc={});var lt=De.yylloc;re.push(lt);var be=De.options&&De.options.ranges;typeof it.yy.parseError=="function"?this.parseError=it.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Et(ye){he.length=he.length-2*ye,pe.length=pe.length-ye,re.length=re.length-ye}T(Et,"popStack");function vt(){var ye;return ye=j.pop()||De.lex()||Le,typeof ye!="number"&&(ye instanceof Array&&(j=ye,ye=j.pop()),ye=H.symbols_[ye]||ye),ye}T(vt,"lex");for(var ot,It,xt,ht,oe={},At,dt,ut,wt;;){if(It=he[he.length-1],this.defaultActions[It]?xt=this.defaultActions[It]:((ot===null||typeof ot>"u")&&(ot=vt()),xt=Fe[It]&&Fe[It][ot]),typeof xt>"u"||!xt.length||!xt[0]){var Mr="";wt=[];for(At in Fe[It])this.terminals_[At]&&At>qe&&wt.push("'"+this.terminals_[At]+"'");De.showPosition?Mr="Parse error on line "+(Ue+1)+`: +`+De.showPosition()+` +Expecting `+wt.join(", ")+", got '"+(this.terminals_[ot]||ot)+"'":Mr="Parse error on line "+(Ue+1)+": Unexpected "+(ot==Le?"end of input":"'"+(this.terminals_[ot]||ot)+"'"),this.parseError(Mr,{text:De.match,token:this.terminals_[ot]||ot,line:De.yylineno,loc:lt,expected:wt})}if(xt[0]instanceof Array&&xt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+It+", token: "+ot);switch(xt[0]){case 1:he.push(ot),pe.push(De.yytext),re.push(De.yylloc),he.push(xt[1]),ot=null,Me=De.yyleng,xe=De.yytext,Ue=De.yylineno,lt=De.yylloc;break;case 2:if(dt=this.productions_[xt[1]][1],oe.$=pe[pe.length-dt],oe._$={first_line:re[re.length-(dt||1)].first_line,last_line:re[re.length-1].last_line,first_column:re[re.length-(dt||1)].first_column,last_column:re[re.length-1].last_column},be&&(oe._$.range=[re[re.length-(dt||1)].range[0],re[re.length-1].range[1]]),ht=this.performAction.apply(oe,[xe,Me,Ue,it.yy,xt[1],pe,re].concat(Xe)),typeof ht<"u")return ht;dt&&(he=he.slice(0,-1*dt*2),pe=pe.slice(0,-1*dt),re=re.slice(0,-1*dt)),he.push(this.productions_[xt[1]][0]),pe.push(oe.$),re.push(oe._$),ut=Fe[he[he.length-2]][he[he.length-1]],he.push(ut);break;case 3:return!0}}return!0},"parse")},tt=(function(){var Ce={EOF:1,parseError:T(function(H,he){if(this.yy.parser)this.yy.parser.parseError(H,he);else throw new Error(H)},"parseError"),setInput:T(function(Se,H){return this.yy=H||this.yy||{},this._input=Se,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var Se=this._input[0];this.yytext+=Se,this.yyleng++,this.offset++,this.match+=Se,this.matched+=Se;var H=Se.match(/(?:\r\n?|\n).*/g);return H?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Se},"input"),unput:T(function(Se){var H=Se.length,he=Se.split(/(?:\r\n?|\n)/g);this._input=Se+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-H),this.offset-=H;var j=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),he.length-1&&(this.yylineno-=he.length-1);var pe=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:he?(he.length===j.length?this.yylloc.first_column:0)+j[j.length-he.length].length-he[0].length:this.yylloc.first_column-H},this.options.ranges&&(this.yylloc.range=[pe[0],pe[0]+this.yyleng-H]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(Se){this.unput(this.match.slice(Se))},"less"),pastInput:T(function(){var Se=this.matched.substr(0,this.matched.length-this.match.length);return(Se.length>20?"...":"")+Se.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var Se=this.match;return Se.length<20&&(Se+=this._input.substr(0,20-Se.length)),(Se.substr(0,20)+(Se.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var Se=this.pastInput(),H=new Array(Se.length+1).join("-");return Se+this.upcomingInput()+` +`+H+"^"},"showPosition"),test_match:T(function(Se,H){var he,j,pe;if(this.options.backtrack_lexer&&(pe={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(pe.yylloc.range=this.yylloc.range.slice(0))),j=Se[0].match(/(?:\r\n?|\n).*/g),j&&(this.yylineno+=j.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:j?j[j.length-1].length-j[j.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Se[0].length},this.yytext+=Se[0],this.match+=Se[0],this.matches=Se,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Se[0].length),this.matched+=Se[0],he=this.performAction.call(this,this.yy,this,H,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),he)return he;if(this._backtrack){for(var re in pe)this[re]=pe[re];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Se,H,he,j;this._more||(this.yytext="",this.match="");for(var pe=this._currentRules(),re=0;reH[0].length)){if(H=he,j=re,this.options.backtrack_lexer){if(Se=this.test_match(he,pe[re]),Se!==!1)return Se;if(this._backtrack){H=!1;continue}else return!1}else if(!this.options.flex)break}return H?(Se=this.test_match(H,pe[j]),Se!==!1?Se:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var H=this.next();return H||this.lex()},"lex"),begin:T(function(H){this.conditionStack.push(H)},"begin"),popState:T(function(){var H=this.conditionStack.length-1;return H>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(H){return H=this.conditionStack.length-1-Math.abs(H||0),H>=0?this.conditionStack[H]:"INITIAL"},"topState"),pushState:T(function(H){this.begin(H)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(H,he,j,pe){switch(j){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return he.yytext=he.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return Ce})();nt.lexer=tt;function je(){this.yy={}}return T(je,"Parser"),je.prototype=nt,nt.Parser=je,new je})();E$.parser=E$;var Nlt=E$,Olt=(zv=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Dn,this.getAccTitle=Fn,this.setAccDescription=zn,this.getAccDescription=Gn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getConfig=T(()=>Pe().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,r){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:r,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),ae.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,r,n){this.relations.push({type:e,src:r,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,In()}setCssStyle(e,r){for(const n of e){const i=this.requirements.get(n)??this.elements.get(n);if(!r||!i)return;for(const a of r)a.includes(",")?i.cssStyles.push(...a.split(",")):i.cssStyles.push(a)}}setClass(e,r){var n;for(const i of e){const a=this.requirements.get(i)??this.elements.get(i);if(a)for(const s of r){a.classes.push(s);const o=(n=this.classes.get(s))==null?void 0:n.styles;o&&a.cssStyles.push(...o)}}}defineClass(e,r){for(const n of e){let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.requirements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))}),this.elements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))})}}getClasses(){return this.classes}getData(){var i,a,s,o;const e=Pe(),r=[],n=[];for(const l of this.requirements.values()){const u=l;u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.shape="requirementBox",u.look=e.look,u.colorIndex=r.length,r.push(u)}for(const l of this.elements.values()){const u=l;u.shape="requirementBox",u.look=e.look,u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.colorIndex=r.length,r.push(u)}for(const l of this.relations){let u=0;const h=l.type===this.Relationships.CONTAINS,d={id:`${l.src}-${l.dst}-${u}`,start:((i=this.requirements.get(l.src))==null?void 0:i.name)??((a=this.elements.get(l.src))==null?void 0:a.name),end:((s=this.requirements.get(l.dst))==null?void 0:s.name)??((o=this.elements.get(l.dst))==null?void 0:o.name),label:`<<${l.type}>>`,classes:"relationshipLine",style:["fill:none",h?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:h?"normal":"dashed",arrowTypeStart:h?"requirement_contains":"",arrowTypeEnd:h?"":"requirement_arrow",look:e.look,labelType:"markdown"};n.push(d),u++}return{nodes:r,edges:n,other:{},config:e,direction:this.getDirection()}}},T(zv,"RequirementDB"),zv),$lt=T(t=>{const e=lr(),{themeVariables:r,look:n}=e,{bkgColorArray:i,borderColorArray:a}=r;if(!(a!=null&&a.length))return"";let s="";for(let o=0;o{const e=lr(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` - ${Clt(t)} + `;return s},"genColor"),Plt=T(t=>{const e=lr(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` + ${$lt(t)} marker { fill: ${t.relationColor}; stroke: ${t.relationColor}; @@ -1815,7 +1815,7 @@ Expecting `+wt.join(", ")+", got '"+(this.terminals_[ot]||ot)+"'":Mr="Parse erro stroke: ${t.requirementBorderColor}; stroke-width: ${t.requirementBorderSize}; } - + .reqTitle, .reqLabel{ fill: ${t.requirementTextColor}; } @@ -1860,16 +1860,16 @@ Expecting `+wt.join(", ")+", got '"+(this.terminals_[ot]||ot)+"'":Mr="Parse erro background-color: ${i??t.edgeLabelBackground}; } -`},"getStyles"),Elt=klt,Xge={};bw(Xge,{draw:()=>Slt});var Slt=x(async function(t,e,r,n){ae.info("REF0:"),ae.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s,look:o}=Pe(),l=n.db.getData(),u=Xp(e,i);l.type=n.type,l.layoutAlgorithm=sb(s),l.nodeSpacing=(a==null?void 0:a.nodeSpacing)??50,l.rankSpacing=(a==null?void 0:a.rankSpacing)??50,l.markers=o==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await Z0(l,u);const h=8;Lr.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Wd(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Alt={parser:Tlt,get db(){return new wlt},renderer:Xge,styles:Elt};const _lt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Alt},Symbol.toStringTag,{value:"Module"}));var T$=(function(){var t=x(function(De,qe,Le,Xe){for(Le=Le||{},Xe=De.length;Xe--;Le[De[Xe]]=qe);return Le},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,12],l=[1,14],u=[1,15],h=[1,17],d=[1,18],f=[1,19],p=[1,25],g=[1,26],m=[1,27],y=[1,28],v=[1,29],T=[1,30],b=[1,31],w=[1,32],k=[1,33],A=[1,34],C=[1,35],_=[1,36],L=[1,37],O=[1,38],M=[1,39],z=[1,40],F=[1,42],S=[1,43],R=[1,44],N=[1,45],D=[1,46],I=[1,47],$=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],B=[1,74],P=[1,80],G=[1,81],V=[1,82],Y=[1,83],W=[1,84],ie=[1,85],K=[1,86],se=[1,87],J=[1,88],Z=[1,89],ee=[1,90],ne=[1,91],ue=[1,92],fe=[1,93],_e=[1,94],Ae=[1,95],Ne=[1,96],me=[1,97],ve=[1,98],Ge=[1,99],Te=[1,100],Ze=[1,101],ke=[1,102],Ve=[1,103],Qe=[1,104],nt=[1,105],tt=[2,78],je=[4,5,17,51,53,54],Ce=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],H=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],he=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],j=[5,52],pe=[70,71,72,73],re=[1,151],Be={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:x(function(qe,Le,Xe,Ie,it,we,lt){var be=we.length-1;switch(it){case 3:return Ie.apply(we[be]),we[be];case 4:case 10:this.$=[];break;case 5:case 11:we[be-1].push(we[be]),this.$=we[be-1];break;case 6:case 7:case 12:case 13:this.$=we[be];break;case 8:case 9:case 14:this.$=[];break;case 16:we[be].type="createParticipant",this.$=we[be];break;case 17:we[be-1].unshift({type:"boxStart",boxData:Ie.parseBoxData(we[be-2])}),we[be-1].push({type:"boxEnd",boxText:we[be-2]}),this.$=we[be-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(we[be-2]),sequenceIndexStep:Number(we[be-1]),sequenceVisible:!0,signalType:Ie.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(we[be-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:Ie.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:Ie.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:Ie.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:Ie.LINETYPE.ACTIVE_START,actor:we[be-1].actor};break;case 24:this.$={type:"activeEnd",signalType:Ie.LINETYPE.ACTIVE_END,actor:we[be-1].actor};break;case 30:Ie.setDiagramTitle(we[be].substring(6)),this.$=we[be].substring(6);break;case 31:Ie.setDiagramTitle(we[be].substring(7)),this.$=we[be].substring(7);break;case 32:this.$=we[be].trim(),Ie.setAccTitle(this.$);break;case 33:case 34:this.$=we[be].trim(),Ie.setAccDescription(this.$);break;case 35:we[be-1].unshift({type:"loopStart",loopText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.LOOP_START}),we[be-1].push({type:"loopEnd",loopText:we[be-2],signalType:Ie.LINETYPE.LOOP_END}),this.$=we[be-1];break;case 36:we[be-1].unshift({type:"rectStart",color:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.RECT_START}),we[be-1].push({type:"rectEnd",color:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.RECT_END}),this.$=we[be-1];break;case 37:we[be-1].unshift({type:"optStart",optText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.OPT_START}),we[be-1].push({type:"optEnd",optText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.OPT_END}),this.$=we[be-1];break;case 38:we[be-1].unshift({type:"altStart",altText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.ALT_START}),we[be-1].push({type:"altEnd",signalType:Ie.LINETYPE.ALT_END}),this.$=we[be-1];break;case 39:we[be-1].unshift({type:"parStart",parText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.PAR_START}),we[be-1].push({type:"parEnd",signalType:Ie.LINETYPE.PAR_END}),this.$=we[be-1];break;case 40:we[be-1].unshift({type:"parStart",parText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.PAR_OVER_START}),we[be-1].push({type:"parEnd",signalType:Ie.LINETYPE.PAR_END}),this.$=we[be-1];break;case 41:we[be-1].unshift({type:"criticalStart",criticalText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.CRITICAL_START}),we[be-1].push({type:"criticalEnd",signalType:Ie.LINETYPE.CRITICAL_END}),this.$=we[be-1];break;case 42:we[be-1].unshift({type:"breakStart",breakText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.BREAK_START}),we[be-1].push({type:"breakEnd",optText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.BREAK_END}),this.$=we[be-1];break;case 44:this.$=we[be-3].concat([{type:"option",optionText:Ie.parseMessage(we[be-1]),signalType:Ie.LINETYPE.CRITICAL_OPTION},we[be]]);break;case 46:this.$=we[be-3].concat([{type:"and",parText:Ie.parseMessage(we[be-1]),signalType:Ie.LINETYPE.PAR_AND},we[be]]);break;case 48:this.$=we[be-3].concat([{type:"else",altText:Ie.parseMessage(we[be-1]),signalType:Ie.LINETYPE.ALT_ELSE},we[be]]);break;case 49:we[be-3].draw="participant",we[be-3].type="addParticipant",we[be-3].description=Ie.parseMessage(we[be-1]),this.$=we[be-3];break;case 50:we[be-1].draw="participant",we[be-1].type="addParticipant",this.$=we[be-1];break;case 51:we[be-3].draw="actor",we[be-3].type="addParticipant",we[be-3].description=Ie.parseMessage(we[be-1]),this.$=we[be-3];break;case 52:case 57:we[be-1].draw="actor",we[be-1].type="addParticipant",this.$=we[be-1];break;case 53:we[be-1].type="destroyParticipant",this.$=we[be-1];break;case 54:we[be-3].draw="participant",we[be-3].type="addParticipant",we[be-3].description=Ie.parseMessage(we[be-1]),this.$=we[be-3];break;case 55:we[be-1].draw="participant",we[be-1].type="addParticipant",this.$=we[be-1];break;case 56:we[be-3].draw="actor",we[be-3].type="addParticipant",we[be-3].description=Ie.parseMessage(we[be-1]),this.$=we[be-3];break;case 58:this.$=[we[be-1],{type:"addNote",placement:we[be-2],actor:we[be-1].actor,text:we[be]}];break;case 59:we[be-2]=[].concat(we[be-1],we[be-1]).slice(0,2),we[be-2][0]=we[be-2][0].actor,we[be-2][1]=we[be-2][1].actor,this.$=[we[be-1],{type:"addNote",placement:Ie.PLACEMENT.OVER,actor:we[be-2].slice(0,2),text:we[be]}];break;case 60:this.$=[we[be-1],{type:"addLinks",actor:we[be-1].actor,text:we[be]}];break;case 61:this.$=[we[be-1],{type:"addALink",actor:we[be-1].actor,text:we[be]}];break;case 62:this.$=[we[be-1],{type:"addProperties",actor:we[be-1].actor,text:we[be]}];break;case 63:this.$=[we[be-1],{type:"addDetails",actor:we[be-1].actor,text:we[be]}];break;case 66:this.$=[we[be-2],we[be]];break;case 67:this.$=we[be];break;case 68:this.$=Ie.PLACEMENT.LEFTOF;break;case 69:this.$=Ie.PLACEMENT.RIGHTOF;break;case 70:this.$=[we[be-4],we[be-1],{type:"addMessage",from:we[be-4].actor,to:we[be-1].actor,signalType:we[be-3],msg:we[be],activate:!0},{type:"activeStart",signalType:Ie.LINETYPE.ACTIVE_START,actor:we[be-1].actor}];break;case 71:this.$=[we[be-4],we[be-1],{type:"addMessage",from:we[be-4].actor,to:we[be-1].actor,signalType:we[be-3],msg:we[be]},{type:"activeEnd",signalType:Ie.LINETYPE.ACTIVE_END,actor:we[be-4].actor}];break;case 72:this.$=[we[be-4],we[be-1],{type:"addMessage",from:we[be-4].actor,to:we[be-1].actor,signalType:we[be-3],msg:we[be],activate:!0,centralConnection:Ie.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:Ie.LINETYPE.CENTRAL_CONNECTION,actor:we[be-1].actor}];break;case 73:this.$=[we[be-4],we[be-1],{type:"addMessage",from:we[be-4].actor,to:we[be-1].actor,signalType:we[be-2],msg:we[be],activate:!1,centralConnection:Ie.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:Ie.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:we[be-4].actor}];break;case 74:this.$=[we[be-5],we[be-1],{type:"addMessage",from:we[be-5].actor,to:we[be-1].actor,signalType:we[be-3],msg:we[be],activate:!0,centralConnection:Ie.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:Ie.LINETYPE.CENTRAL_CONNECTION,actor:we[be-1].actor},{type:"centralConnectionReverse",signalType:Ie.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:we[be-5].actor}];break;case 75:this.$=[we[be-3],we[be-1],{type:"addMessage",from:we[be-3].actor,to:we[be-1].actor,signalType:we[be-2],msg:we[be]}];break;case 76:this.$={type:"addParticipant",actor:we[be-1],config:we[be]};break;case 77:this.$=we[be-1].trim();break;case 78:this.$={type:"addParticipant",actor:we[be]};break;case 79:this.$=Ie.LINETYPE.SOLID_OPEN;break;case 80:this.$=Ie.LINETYPE.DOTTED_OPEN;break;case 81:this.$=Ie.LINETYPE.SOLID;break;case 82:this.$=Ie.LINETYPE.SOLID_TOP;break;case 83:this.$=Ie.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=Ie.LINETYPE.STICK_TOP;break;case 85:this.$=Ie.LINETYPE.STICK_BOTTOM;break;case 86:this.$=Ie.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=Ie.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=Ie.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=Ie.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=Ie.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=Ie.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=Ie.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=Ie.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=Ie.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=Ie.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=Ie.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=Ie.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=Ie.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=Ie.LINETYPE.DOTTED;break;case 100:this.$=Ie.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=Ie.LINETYPE.SOLID_CROSS;break;case 102:this.$=Ie.LINETYPE.DOTTED_CROSS;break;case 103:this.$=Ie.LINETYPE.SOLID_POINT;break;case 104:this.$=Ie.LINETYPE.DOTTED_POINT;break;case 105:this.$=Ie.parseMessage(we[be].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},t($,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},t($,[2,7]),t($,[2,8]),t($,[2,9]),t($,[2,15]),{13:49,51:O,53:M,54:z},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:I},{23:56,73:I},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t($,[2,30]),t($,[2,31]),{33:[1,62]},{35:[1,63]},t($,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:B},{23:75,55:76,73:B},{23:77,73:I},{69:78,72:[1,79],78:P,79:G,80:V,81:Y,82:W,83:ie,84:K,85:se,86:J,87:Z,88:ee,89:ne,90:ue,91:fe,92:_e,93:Ae,94:Ne,95:me,96:ve,97:Ge,98:Te,99:Ze,100:ke,101:Ve,102:Qe,103:nt},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:I},{23:111,73:I},{23:112,73:I},{23:113,73:I},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],tt),t($,[2,6]),t($,[2,16]),t(je,[2,10],{11:114}),t($,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t($,[2,22]),{5:[1,118]},{5:[1,119]},t($,[2,25]),t($,[2,26]),t($,[2,27]),t($,[2,28]),t($,[2,29]),t($,[2,32]),t($,[2,33]),t(Ce,i,{7:120}),t(Ce,i,{7:121}),t(Ce,i,{7:122}),t(Se,i,{41:123,7:124}),t(H,i,{43:125,7:126}),t(H,i,{7:126,43:127}),t(he,i,{46:128,7:129}),t(Ce,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(j,tt,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:I},{69:146,78:P,79:G,80:V,81:Y,82:W,83:ie,84:K,85:se,86:J,87:Z,88:ee,89:ne,90:ue,91:fe,92:_e,93:Ae,94:Ne,95:me,96:ve,97:Ge,98:Te,99:Ze,100:ke,101:Ve,102:Qe,103:nt},t(pe,[2,79]),t(pe,[2,80]),t(pe,[2,81]),t(pe,[2,82]),t(pe,[2,83]),t(pe,[2,84]),t(pe,[2,85]),t(pe,[2,86]),t(pe,[2,87]),t(pe,[2,88]),t(pe,[2,89]),t(pe,[2,90]),t(pe,[2,91]),t(pe,[2,92]),t(pe,[2,93]),t(pe,[2,94]),t(pe,[2,95]),t(pe,[2,96]),t(pe,[2,97]),t(pe,[2,98]),t(pe,[2,99]),t(pe,[2,100]),t(pe,[2,101]),t(pe,[2,102]),t(pe,[2,103]),t(pe,[2,104]),{23:147,73:I},{23:149,60:148,73:I},{73:[2,68]},{73:[2,69]},{58:150,104:re},{58:152,104:re},{58:153,104:re},{58:154,104:re},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:O,53:M,54:z},{5:[1,160]},t($,[2,20]),t($,[2,21]),t($,[2,23]),t($,[2,24]),{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,161],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,162],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,163],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},{17:[1,164]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,47],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,50:[1,165],51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},{17:[1,166]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,45],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,49:[1,167],51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},{17:[1,168]},{17:[1,169]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,43],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,48:[1,170],51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,171],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},{16:[1,172]},t($,[2,50]),{16:[1,173]},t($,[2,55]),t(j,[2,76]),{76:[1,174]},{16:[1,175]},t($,[2,52]),{16:[1,176]},t($,[2,57]),t($,[2,53]),{23:177,73:I},{23:178,73:I},{23:179,73:I},{58:180,104:re},{23:181,72:[1,182],73:I},{58:183,104:re},{58:184,104:re},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t($,[2,17]),t(je,[2,11]),{13:186,51:O,53:M,54:z},t(je,[2,13]),t(je,[2,14]),t($,[2,19]),t($,[2,35]),t($,[2,36]),t($,[2,37]),t($,[2,38]),{16:[1,187]},t($,[2,39]),{16:[1,188]},t($,[2,40]),t($,[2,41]),{16:[1,189]},t($,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:re},{58:196,104:re},{58:197,104:re},{5:[2,75]},{58:198,104:re},{23:199,73:I},{5:[2,58]},{5:[2,59]},{23:200,73:I},t(je,[2,12]),t(Se,i,{7:124,41:201}),t(H,i,{7:126,43:202}),t(he,i,{7:129,46:203}),t($,[2,49]),t($,[2,54]),t(j,[2,77]),t($,[2,51]),t($,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:re},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:x(function(qe,Le){if(Le.recoverable)this.trace(qe);else{var Xe=new Error(qe);throw Xe.hash=Le,Xe}},"parseError"),parse:x(function(qe){var Le=this,Xe=[0],Ie=[],it=[null],we=[],lt=this.table,be="",Et=0,vt=0,ot=2,It=1,xt=we.slice.call(arguments,1),ht=Object.create(this.lexer),oe={yy:{}};for(var At in this.yy)Object.prototype.hasOwnProperty.call(this.yy,At)&&(oe.yy[At]=this.yy[At]);ht.setInput(qe,oe.yy),oe.yy.lexer=ht,oe.yy.parser=this,typeof ht.yylloc>"u"&&(ht.yylloc={});var dt=ht.yylloc;we.push(dt);var ut=ht.options&&ht.options.ranges;typeof oe.yy.parseError=="function"?this.parseError=oe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function wt(Jt){Xe.length=Xe.length-2*Jt,it.length=it.length-Jt,we.length=we.length-Jt}x(wt,"popStack");function Mr(){var Jt;return Jt=Ie.pop()||ht.lex()||It,typeof Jt!="number"&&(Jt instanceof Array&&(Ie=Jt,Jt=Ie.pop()),Jt=Le.symbols_[Jt]||Jt),Jt}x(Mr,"lex");for(var ye,et,ct,_t,Ft={},nr,ir,_r,or;;){if(et=Xe[Xe.length-1],this.defaultActions[et]?ct=this.defaultActions[et]:((ye===null||typeof ye>"u")&&(ye=Mr()),ct=lt[et]&<[et][ye]),typeof ct>"u"||!ct.length||!ct[0]){var Rr="";or=[];for(nr in lt[et])this.terminals_[nr]&&nr>ot&&or.push("'"+this.terminals_[nr]+"'");ht.showPosition?Rr="Parse error on line "+(Et+1)+`: +`},"getStyles"),Blt=Plt,eme={};Tw(eme,{draw:()=>Flt});var Flt=T(async function(t,e,r,n){ae.info("REF0:"),ae.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s,look:o}=Pe(),l=n.db.getData(),u=K0(e,i);l.type=n.type,l.layoutAlgorithm=ob(s),l.nodeSpacing=(a==null?void 0:a.nodeSpacing)??50,l.rankSpacing=(a==null?void 0:a.rankSpacing)??50,l.markers=o==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await Zp(l,u);const h=8;Lr.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Wd(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),zlt={parser:Nlt,get db(){return new Olt},renderer:eme,styles:Blt};const Glt=Object.freeze(Object.defineProperty({__proto__:null,diagram:zlt},Symbol.toStringTag,{value:"Module"}));var S$=(function(){var t=T(function(Me,qe,Le,Xe){for(Le=Le||{},Xe=Me.length;Xe--;Le[Me[Xe]]=qe);return Le},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,12],l=[1,14],u=[1,15],h=[1,17],d=[1,18],f=[1,19],p=[1,25],g=[1,26],m=[1,27],y=[1,28],v=[1,29],x=[1,30],b=[1,31],w=[1,32],k=[1,33],S=[1,34],C=[1,35],_=[1,36],L=[1,37],O=[1,38],M=[1,39],z=[1,40],F=[1,42],A=[1,43],R=[1,44],N=[1,45],D=[1,46],I=[1,47],$=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],B=[1,74],P=[1,80],G=[1,81],V=[1,82],X=[1,83],W=[1,84],ie=[1,85],K=[1,86],se=[1,87],J=[1,88],Z=[1,89],ee=[1,90],ne=[1,91],ue=[1,92],fe=[1,93],_e=[1,94],Ae=[1,95],Ne=[1,96],me=[1,97],ve=[1,98],Ge=[1,99],Te=[1,100],Ze=[1,101],ke=[1,102],Ve=[1,103],Qe=[1,104],nt=[1,105],tt=[2,78],je=[4,5,17,51,53,54],Ce=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],H=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],he=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],j=[5,52],pe=[70,71,72,73],re=[1,151],Fe={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:T(function(qe,Le,Xe,De,it,we,lt){var be=we.length-1;switch(it){case 3:return De.apply(we[be]),we[be];case 4:case 10:this.$=[];break;case 5:case 11:we[be-1].push(we[be]),this.$=we[be-1];break;case 6:case 7:case 12:case 13:this.$=we[be];break;case 8:case 9:case 14:this.$=[];break;case 16:we[be].type="createParticipant",this.$=we[be];break;case 17:we[be-1].unshift({type:"boxStart",boxData:De.parseBoxData(we[be-2])}),we[be-1].push({type:"boxEnd",boxText:we[be-2]}),this.$=we[be-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(we[be-2]),sequenceIndexStep:Number(we[be-1]),sequenceVisible:!0,signalType:De.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(we[be-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:De.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:De.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:De.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:De.LINETYPE.ACTIVE_START,actor:we[be-1].actor};break;case 24:this.$={type:"activeEnd",signalType:De.LINETYPE.ACTIVE_END,actor:we[be-1].actor};break;case 30:De.setDiagramTitle(we[be].substring(6)),this.$=we[be].substring(6);break;case 31:De.setDiagramTitle(we[be].substring(7)),this.$=we[be].substring(7);break;case 32:this.$=we[be].trim(),De.setAccTitle(this.$);break;case 33:case 34:this.$=we[be].trim(),De.setAccDescription(this.$);break;case 35:we[be-1].unshift({type:"loopStart",loopText:De.parseMessage(we[be-2]),signalType:De.LINETYPE.LOOP_START}),we[be-1].push({type:"loopEnd",loopText:we[be-2],signalType:De.LINETYPE.LOOP_END}),this.$=we[be-1];break;case 36:we[be-1].unshift({type:"rectStart",color:De.parseMessage(we[be-2]),signalType:De.LINETYPE.RECT_START}),we[be-1].push({type:"rectEnd",color:De.parseMessage(we[be-2]),signalType:De.LINETYPE.RECT_END}),this.$=we[be-1];break;case 37:we[be-1].unshift({type:"optStart",optText:De.parseMessage(we[be-2]),signalType:De.LINETYPE.OPT_START}),we[be-1].push({type:"optEnd",optText:De.parseMessage(we[be-2]),signalType:De.LINETYPE.OPT_END}),this.$=we[be-1];break;case 38:we[be-1].unshift({type:"altStart",altText:De.parseMessage(we[be-2]),signalType:De.LINETYPE.ALT_START}),we[be-1].push({type:"altEnd",signalType:De.LINETYPE.ALT_END}),this.$=we[be-1];break;case 39:we[be-1].unshift({type:"parStart",parText:De.parseMessage(we[be-2]),signalType:De.LINETYPE.PAR_START}),we[be-1].push({type:"parEnd",signalType:De.LINETYPE.PAR_END}),this.$=we[be-1];break;case 40:we[be-1].unshift({type:"parStart",parText:De.parseMessage(we[be-2]),signalType:De.LINETYPE.PAR_OVER_START}),we[be-1].push({type:"parEnd",signalType:De.LINETYPE.PAR_END}),this.$=we[be-1];break;case 41:we[be-1].unshift({type:"criticalStart",criticalText:De.parseMessage(we[be-2]),signalType:De.LINETYPE.CRITICAL_START}),we[be-1].push({type:"criticalEnd",signalType:De.LINETYPE.CRITICAL_END}),this.$=we[be-1];break;case 42:we[be-1].unshift({type:"breakStart",breakText:De.parseMessage(we[be-2]),signalType:De.LINETYPE.BREAK_START}),we[be-1].push({type:"breakEnd",optText:De.parseMessage(we[be-2]),signalType:De.LINETYPE.BREAK_END}),this.$=we[be-1];break;case 44:this.$=we[be-3].concat([{type:"option",optionText:De.parseMessage(we[be-1]),signalType:De.LINETYPE.CRITICAL_OPTION},we[be]]);break;case 46:this.$=we[be-3].concat([{type:"and",parText:De.parseMessage(we[be-1]),signalType:De.LINETYPE.PAR_AND},we[be]]);break;case 48:this.$=we[be-3].concat([{type:"else",altText:De.parseMessage(we[be-1]),signalType:De.LINETYPE.ALT_ELSE},we[be]]);break;case 49:we[be-3].draw="participant",we[be-3].type="addParticipant",we[be-3].description=De.parseMessage(we[be-1]),this.$=we[be-3];break;case 50:we[be-1].draw="participant",we[be-1].type="addParticipant",this.$=we[be-1];break;case 51:we[be-3].draw="actor",we[be-3].type="addParticipant",we[be-3].description=De.parseMessage(we[be-1]),this.$=we[be-3];break;case 52:case 57:we[be-1].draw="actor",we[be-1].type="addParticipant",this.$=we[be-1];break;case 53:we[be-1].type="destroyParticipant",this.$=we[be-1];break;case 54:we[be-3].draw="participant",we[be-3].type="addParticipant",we[be-3].description=De.parseMessage(we[be-1]),this.$=we[be-3];break;case 55:we[be-1].draw="participant",we[be-1].type="addParticipant",this.$=we[be-1];break;case 56:we[be-3].draw="actor",we[be-3].type="addParticipant",we[be-3].description=De.parseMessage(we[be-1]),this.$=we[be-3];break;case 58:this.$=[we[be-1],{type:"addNote",placement:we[be-2],actor:we[be-1].actor,text:we[be]}];break;case 59:we[be-2]=[].concat(we[be-1],we[be-1]).slice(0,2),we[be-2][0]=we[be-2][0].actor,we[be-2][1]=we[be-2][1].actor,this.$=[we[be-1],{type:"addNote",placement:De.PLACEMENT.OVER,actor:we[be-2].slice(0,2),text:we[be]}];break;case 60:this.$=[we[be-1],{type:"addLinks",actor:we[be-1].actor,text:we[be]}];break;case 61:this.$=[we[be-1],{type:"addALink",actor:we[be-1].actor,text:we[be]}];break;case 62:this.$=[we[be-1],{type:"addProperties",actor:we[be-1].actor,text:we[be]}];break;case 63:this.$=[we[be-1],{type:"addDetails",actor:we[be-1].actor,text:we[be]}];break;case 66:this.$=[we[be-2],we[be]];break;case 67:this.$=we[be];break;case 68:this.$=De.PLACEMENT.LEFTOF;break;case 69:this.$=De.PLACEMENT.RIGHTOF;break;case 70:this.$=[we[be-4],we[be-1],{type:"addMessage",from:we[be-4].actor,to:we[be-1].actor,signalType:we[be-3],msg:we[be],activate:!0},{type:"activeStart",signalType:De.LINETYPE.ACTIVE_START,actor:we[be-1].actor}];break;case 71:this.$=[we[be-4],we[be-1],{type:"addMessage",from:we[be-4].actor,to:we[be-1].actor,signalType:we[be-3],msg:we[be]},{type:"activeEnd",signalType:De.LINETYPE.ACTIVE_END,actor:we[be-4].actor}];break;case 72:this.$=[we[be-4],we[be-1],{type:"addMessage",from:we[be-4].actor,to:we[be-1].actor,signalType:we[be-3],msg:we[be],activate:!0,centralConnection:De.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:De.LINETYPE.CENTRAL_CONNECTION,actor:we[be-1].actor}];break;case 73:this.$=[we[be-4],we[be-1],{type:"addMessage",from:we[be-4].actor,to:we[be-1].actor,signalType:we[be-2],msg:we[be],activate:!1,centralConnection:De.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:De.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:we[be-4].actor}];break;case 74:this.$=[we[be-5],we[be-1],{type:"addMessage",from:we[be-5].actor,to:we[be-1].actor,signalType:we[be-3],msg:we[be],activate:!0,centralConnection:De.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:De.LINETYPE.CENTRAL_CONNECTION,actor:we[be-1].actor},{type:"centralConnectionReverse",signalType:De.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:we[be-5].actor}];break;case 75:this.$=[we[be-3],we[be-1],{type:"addMessage",from:we[be-3].actor,to:we[be-1].actor,signalType:we[be-2],msg:we[be]}];break;case 76:this.$={type:"addParticipant",actor:we[be-1],config:we[be]};break;case 77:this.$=we[be-1].trim();break;case 78:this.$={type:"addParticipant",actor:we[be]};break;case 79:this.$=De.LINETYPE.SOLID_OPEN;break;case 80:this.$=De.LINETYPE.DOTTED_OPEN;break;case 81:this.$=De.LINETYPE.SOLID;break;case 82:this.$=De.LINETYPE.SOLID_TOP;break;case 83:this.$=De.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=De.LINETYPE.STICK_TOP;break;case 85:this.$=De.LINETYPE.STICK_BOTTOM;break;case 86:this.$=De.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=De.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=De.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=De.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=De.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=De.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=De.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=De.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=De.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=De.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=De.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=De.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=De.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=De.LINETYPE.DOTTED;break;case 100:this.$=De.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=De.LINETYPE.SOLID_CROSS;break;case 102:this.$=De.LINETYPE.DOTTED_CROSS;break;case 103:this.$=De.LINETYPE.SOLID_POINT;break;case 104:this.$=De.LINETYPE.DOTTED_POINT;break;case 105:this.$=De.parseMessage(we[be].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:A,62:R,63:N,64:D,73:I},t($,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:A,62:R,63:N,64:D,73:I},t($,[2,7]),t($,[2,8]),t($,[2,9]),t($,[2,15]),{13:49,51:O,53:M,54:z},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:I},{23:56,73:I},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t($,[2,30]),t($,[2,31]),{33:[1,62]},{35:[1,63]},t($,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:B},{23:75,55:76,73:B},{23:77,73:I},{69:78,72:[1,79],78:P,79:G,80:V,81:X,82:W,83:ie,84:K,85:se,86:J,87:Z,88:ee,89:ne,90:ue,91:fe,92:_e,93:Ae,94:Ne,95:me,96:ve,97:Ge,98:Te,99:Ze,100:ke,101:Ve,102:Qe,103:nt},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:I},{23:111,73:I},{23:112,73:I},{23:113,73:I},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],tt),t($,[2,6]),t($,[2,16]),t(je,[2,10],{11:114}),t($,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t($,[2,22]),{5:[1,118]},{5:[1,119]},t($,[2,25]),t($,[2,26]),t($,[2,27]),t($,[2,28]),t($,[2,29]),t($,[2,32]),t($,[2,33]),t(Ce,i,{7:120}),t(Ce,i,{7:121}),t(Ce,i,{7:122}),t(Se,i,{41:123,7:124}),t(H,i,{43:125,7:126}),t(H,i,{7:126,43:127}),t(he,i,{46:128,7:129}),t(Ce,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(j,tt,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:I},{69:146,78:P,79:G,80:V,81:X,82:W,83:ie,84:K,85:se,86:J,87:Z,88:ee,89:ne,90:ue,91:fe,92:_e,93:Ae,94:Ne,95:me,96:ve,97:Ge,98:Te,99:Ze,100:ke,101:Ve,102:Qe,103:nt},t(pe,[2,79]),t(pe,[2,80]),t(pe,[2,81]),t(pe,[2,82]),t(pe,[2,83]),t(pe,[2,84]),t(pe,[2,85]),t(pe,[2,86]),t(pe,[2,87]),t(pe,[2,88]),t(pe,[2,89]),t(pe,[2,90]),t(pe,[2,91]),t(pe,[2,92]),t(pe,[2,93]),t(pe,[2,94]),t(pe,[2,95]),t(pe,[2,96]),t(pe,[2,97]),t(pe,[2,98]),t(pe,[2,99]),t(pe,[2,100]),t(pe,[2,101]),t(pe,[2,102]),t(pe,[2,103]),t(pe,[2,104]),{23:147,73:I},{23:149,60:148,73:I},{73:[2,68]},{73:[2,69]},{58:150,104:re},{58:152,104:re},{58:153,104:re},{58:154,104:re},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:O,53:M,54:z},{5:[1,160]},t($,[2,20]),t($,[2,21]),t($,[2,23]),t($,[2,24]),{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,161],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:A,62:R,63:N,64:D,73:I},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,162],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:A,62:R,63:N,64:D,73:I},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,163],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:A,62:R,63:N,64:D,73:I},{17:[1,164]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,47],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,50:[1,165],51:O,53:M,54:z,56:F,61:A,62:R,63:N,64:D,73:I},{17:[1,166]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,45],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,49:[1,167],51:O,53:M,54:z,56:F,61:A,62:R,63:N,64:D,73:I},{17:[1,168]},{17:[1,169]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,43],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,48:[1,170],51:O,53:M,54:z,56:F,61:A,62:R,63:N,64:D,73:I},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,171],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:k,42:S,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:A,62:R,63:N,64:D,73:I},{16:[1,172]},t($,[2,50]),{16:[1,173]},t($,[2,55]),t(j,[2,76]),{76:[1,174]},{16:[1,175]},t($,[2,52]),{16:[1,176]},t($,[2,57]),t($,[2,53]),{23:177,73:I},{23:178,73:I},{23:179,73:I},{58:180,104:re},{23:181,72:[1,182],73:I},{58:183,104:re},{58:184,104:re},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t($,[2,17]),t(je,[2,11]),{13:186,51:O,53:M,54:z},t(je,[2,13]),t(je,[2,14]),t($,[2,19]),t($,[2,35]),t($,[2,36]),t($,[2,37]),t($,[2,38]),{16:[1,187]},t($,[2,39]),{16:[1,188]},t($,[2,40]),t($,[2,41]),{16:[1,189]},t($,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:re},{58:196,104:re},{58:197,104:re},{5:[2,75]},{58:198,104:re},{23:199,73:I},{5:[2,58]},{5:[2,59]},{23:200,73:I},t(je,[2,12]),t(Se,i,{7:124,41:201}),t(H,i,{7:126,43:202}),t(he,i,{7:129,46:203}),t($,[2,49]),t($,[2,54]),t(j,[2,77]),t($,[2,51]),t($,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:re},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:T(function(qe,Le){if(Le.recoverable)this.trace(qe);else{var Xe=new Error(qe);throw Xe.hash=Le,Xe}},"parseError"),parse:T(function(qe){var Le=this,Xe=[0],De=[],it=[null],we=[],lt=this.table,be="",Et=0,vt=0,ot=2,It=1,xt=we.slice.call(arguments,1),ht=Object.create(this.lexer),oe={yy:{}};for(var At in this.yy)Object.prototype.hasOwnProperty.call(this.yy,At)&&(oe.yy[At]=this.yy[At]);ht.setInput(qe,oe.yy),oe.yy.lexer=ht,oe.yy.parser=this,typeof ht.yylloc>"u"&&(ht.yylloc={});var dt=ht.yylloc;we.push(dt);var ut=ht.options&&ht.options.ranges;typeof oe.yy.parseError=="function"?this.parseError=oe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function wt(Jt){Xe.length=Xe.length-2*Jt,it.length=it.length-Jt,we.length=we.length-Jt}T(wt,"popStack");function Mr(){var Jt;return Jt=De.pop()||ht.lex()||It,typeof Jt!="number"&&(Jt instanceof Array&&(De=Jt,Jt=De.pop()),Jt=Le.symbols_[Jt]||Jt),Jt}T(Mr,"lex");for(var ye,et,ct,_t,Ft={},nr,ir,_r,or;;){if(et=Xe[Xe.length-1],this.defaultActions[et]?ct=this.defaultActions[et]:((ye===null||typeof ye>"u")&&(ye=Mr()),ct=lt[et]&<[et][ye]),typeof ct>"u"||!ct.length||!ct[0]){var Rr="";or=[];for(nr in lt[et])this.terminals_[nr]&&nr>ot&&or.push("'"+this.terminals_[nr]+"'");ht.showPosition?Rr="Parse error on line "+(Et+1)+`: `+ht.showPosition()+` -Expecting `+or.join(", ")+", got '"+(this.terminals_[ye]||ye)+"'":Rr="Parse error on line "+(Et+1)+": Unexpected "+(ye==It?"end of input":"'"+(this.terminals_[ye]||ye)+"'"),this.parseError(Rr,{text:ht.match,token:this.terminals_[ye]||ye,line:ht.yylineno,loc:dt,expected:or})}if(ct[0]instanceof Array&&ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+et+", token: "+ye);switch(ct[0]){case 1:Xe.push(ye),it.push(ht.yytext),we.push(ht.yylloc),Xe.push(ct[1]),ye=null,vt=ht.yyleng,be=ht.yytext,Et=ht.yylineno,dt=ht.yylloc;break;case 2:if(ir=this.productions_[ct[1]][1],Ft.$=it[it.length-ir],Ft._$={first_line:we[we.length-(ir||1)].first_line,last_line:we[we.length-1].last_line,first_column:we[we.length-(ir||1)].first_column,last_column:we[we.length-1].last_column},ut&&(Ft._$.range=[we[we.length-(ir||1)].range[0],we[we.length-1].range[1]]),_t=this.performAction.apply(Ft,[be,vt,Et,oe.yy,ct[1],it,we].concat(xt)),typeof _t<"u")return _t;ir&&(Xe=Xe.slice(0,-1*ir*2),it=it.slice(0,-1*ir),we=we.slice(0,-1*ir)),Xe.push(this.productions_[ct[1]][0]),it.push(Ft.$),we.push(Ft._$),_r=lt[Xe[Xe.length-2]][Xe[Xe.length-1]],Xe.push(_r);break;case 3:return!0}}return!0},"parse")},xe=(function(){var De={EOF:1,parseError:x(function(Le,Xe){if(this.yy.parser)this.yy.parser.parseError(Le,Xe);else throw new Error(Le)},"parseError"),setInput:x(function(qe,Le){return this.yy=Le||this.yy||{},this._input=qe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var qe=this._input[0];this.yytext+=qe,this.yyleng++,this.offset++,this.match+=qe,this.matched+=qe;var Le=qe.match(/(?:\r\n?|\n).*/g);return Le?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),qe},"input"),unput:x(function(qe){var Le=qe.length,Xe=qe.split(/(?:\r\n?|\n)/g);this._input=qe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Le),this.offset-=Le;var Ie=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Xe.length-1&&(this.yylineno-=Xe.length-1);var it=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Xe?(Xe.length===Ie.length?this.yylloc.first_column:0)+Ie[Ie.length-Xe.length].length-Xe[0].length:this.yylloc.first_column-Le},this.options.ranges&&(this.yylloc.range=[it[0],it[0]+this.yyleng-Le]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(qe){this.unput(this.match.slice(qe))},"less"),pastInput:x(function(){var qe=this.matched.substr(0,this.matched.length-this.match.length);return(qe.length>20?"...":"")+qe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var qe=this.match;return qe.length<20&&(qe+=this._input.substr(0,20-qe.length)),(qe.substr(0,20)+(qe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var qe=this.pastInput(),Le=new Array(qe.length+1).join("-");return qe+this.upcomingInput()+` -`+Le+"^"},"showPosition"),test_match:x(function(qe,Le){var Xe,Ie,it;if(this.options.backtrack_lexer&&(it={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(it.yylloc.range=this.yylloc.range.slice(0))),Ie=qe[0].match(/(?:\r\n?|\n).*/g),Ie&&(this.yylineno+=Ie.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Ie?Ie[Ie.length-1].length-Ie[Ie.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+qe[0].length},this.yytext+=qe[0],this.match+=qe[0],this.matches=qe,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(qe[0].length),this.matched+=qe[0],Xe=this.performAction.call(this,this.yy,this,Le,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Xe)return Xe;if(this._backtrack){for(var we in it)this[we]=it[we];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var qe,Le,Xe,Ie;this._more||(this.yytext="",this.match="");for(var it=this._currentRules(),we=0;weLe[0].length)){if(Le=Xe,Ie=we,this.options.backtrack_lexer){if(qe=this.test_match(Xe,it[we]),qe!==!1)return qe;if(this._backtrack){Le=!1;continue}else return!1}else if(!this.options.flex)break}return Le?(qe=this.test_match(Le,it[Ie]),qe!==!1?qe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Le=this.next();return Le||this.lex()},"lex"),begin:x(function(Le){this.conditionStack.push(Le)},"begin"),popState:x(function(){var Le=this.conditionStack.length-1;return Le>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Le){return Le=this.conditionStack.length-1-Math.abs(Le||0),Le>=0?this.conditionStack[Le]:"INITIAL"},"topState"),pushState:x(function(Le){this.begin(Le)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Le,Xe,Ie,it){switch(Ie){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return Xe.yytext=Xe.yytext.trim(),73;case 12:return Xe.yytext=Xe.yytext.trim(),this.begin("ALIAS"),73;case 13:return Xe.yytext=Xe.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return Xe.yytext=Xe.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return Xe.yytext=Xe.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return De})();Be.lexer=xe;function Ue(){this.yy={}}return x(Ue,"Parser"),Ue.prototype=Be,Be.Parser=Ue,new Ue})();T$.parser=T$;var Rlt=T$,Llt={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},Ilt={FILLED:0,OPEN:1},Dlt={LEFTOF:0,RIGHTOF:1,OVER:2},wS={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},Mlt=(zv=class{constructor(){this.state=new wI(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=Dn,this.setAccDescription=zn,this.setDiagramTitle=qn,this.getAccTitle=Fn,this.getAccDescription=Gn,this.getDiagramTitle=Mn,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Pe().wrap),this.LINETYPE=Llt,this.ARROWTYPE=Ilt,this.PLACEMENT=Dlt}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,r,n,i,a){let s=this.state.records.currentBox,o;if(a!==void 0){let u;a.includes(` +Expecting `+or.join(", ")+", got '"+(this.terminals_[ye]||ye)+"'":Rr="Parse error on line "+(Et+1)+": Unexpected "+(ye==It?"end of input":"'"+(this.terminals_[ye]||ye)+"'"),this.parseError(Rr,{text:ht.match,token:this.terminals_[ye]||ye,line:ht.yylineno,loc:dt,expected:or})}if(ct[0]instanceof Array&&ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+et+", token: "+ye);switch(ct[0]){case 1:Xe.push(ye),it.push(ht.yytext),we.push(ht.yylloc),Xe.push(ct[1]),ye=null,vt=ht.yyleng,be=ht.yytext,Et=ht.yylineno,dt=ht.yylloc;break;case 2:if(ir=this.productions_[ct[1]][1],Ft.$=it[it.length-ir],Ft._$={first_line:we[we.length-(ir||1)].first_line,last_line:we[we.length-1].last_line,first_column:we[we.length-(ir||1)].first_column,last_column:we[we.length-1].last_column},ut&&(Ft._$.range=[we[we.length-(ir||1)].range[0],we[we.length-1].range[1]]),_t=this.performAction.apply(Ft,[be,vt,Et,oe.yy,ct[1],it,we].concat(xt)),typeof _t<"u")return _t;ir&&(Xe=Xe.slice(0,-1*ir*2),it=it.slice(0,-1*ir),we=we.slice(0,-1*ir)),Xe.push(this.productions_[ct[1]][0]),it.push(Ft.$),we.push(Ft._$),_r=lt[Xe[Xe.length-2]][Xe[Xe.length-1]],Xe.push(_r);break;case 3:return!0}}return!0},"parse")},xe=(function(){var Me={EOF:1,parseError:T(function(Le,Xe){if(this.yy.parser)this.yy.parser.parseError(Le,Xe);else throw new Error(Le)},"parseError"),setInput:T(function(qe,Le){return this.yy=Le||this.yy||{},this._input=qe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var qe=this._input[0];this.yytext+=qe,this.yyleng++,this.offset++,this.match+=qe,this.matched+=qe;var Le=qe.match(/(?:\r\n?|\n).*/g);return Le?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),qe},"input"),unput:T(function(qe){var Le=qe.length,Xe=qe.split(/(?:\r\n?|\n)/g);this._input=qe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Le),this.offset-=Le;var De=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Xe.length-1&&(this.yylineno-=Xe.length-1);var it=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Xe?(Xe.length===De.length?this.yylloc.first_column:0)+De[De.length-Xe.length].length-Xe[0].length:this.yylloc.first_column-Le},this.options.ranges&&(this.yylloc.range=[it[0],it[0]+this.yyleng-Le]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(qe){this.unput(this.match.slice(qe))},"less"),pastInput:T(function(){var qe=this.matched.substr(0,this.matched.length-this.match.length);return(qe.length>20?"...":"")+qe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var qe=this.match;return qe.length<20&&(qe+=this._input.substr(0,20-qe.length)),(qe.substr(0,20)+(qe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var qe=this.pastInput(),Le=new Array(qe.length+1).join("-");return qe+this.upcomingInput()+` +`+Le+"^"},"showPosition"),test_match:T(function(qe,Le){var Xe,De,it;if(this.options.backtrack_lexer&&(it={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(it.yylloc.range=this.yylloc.range.slice(0))),De=qe[0].match(/(?:\r\n?|\n).*/g),De&&(this.yylineno+=De.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:De?De[De.length-1].length-De[De.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+qe[0].length},this.yytext+=qe[0],this.match+=qe[0],this.matches=qe,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(qe[0].length),this.matched+=qe[0],Xe=this.performAction.call(this,this.yy,this,Le,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Xe)return Xe;if(this._backtrack){for(var we in it)this[we]=it[we];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var qe,Le,Xe,De;this._more||(this.yytext="",this.match="");for(var it=this._currentRules(),we=0;weLe[0].length)){if(Le=Xe,De=we,this.options.backtrack_lexer){if(qe=this.test_match(Xe,it[we]),qe!==!1)return qe;if(this._backtrack){Le=!1;continue}else return!1}else if(!this.options.flex)break}return Le?(qe=this.test_match(Le,it[De]),qe!==!1?qe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var Le=this.next();return Le||this.lex()},"lex"),begin:T(function(Le){this.conditionStack.push(Le)},"begin"),popState:T(function(){var Le=this.conditionStack.length-1;return Le>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(Le){return Le=this.conditionStack.length-1-Math.abs(Le||0),Le>=0?this.conditionStack[Le]:"INITIAL"},"topState"),pushState:T(function(Le){this.begin(Le)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(Le,Xe,De,it){switch(De){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return Xe.yytext=Xe.yytext.trim(),73;case 12:return Xe.yytext=Xe.yytext.trim(),this.begin("ALIAS"),73;case 13:return Xe.yytext=Xe.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return Xe.yytext=Xe.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return Xe.yytext=Xe.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return Me})();Fe.lexer=xe;function Ue(){this.yy={}}return T(Ue,"Parser"),Ue.prototype=Fe,Fe.Parser=Ue,new Ue})();S$.parser=S$;var qlt=S$,Vlt={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},Wlt={FILLED:0,OPEN:1},Ult={LEFTOF:0,RIGHTOF:1,OVER:2},ES={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},Hlt=(Gv=class{constructor(){this.state=new AI(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=Dn,this.setAccDescription=zn,this.setDiagramTitle=qn,this.getAccTitle=Fn,this.getAccDescription=Gn,this.getDiagramTitle=Mn,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Pe().wrap),this.LINETYPE=Vlt,this.ARROWTYPE=Wlt,this.PLACEMENT=Ult}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,r,n,i,a){let s=this.state.records.currentBox,o;if(a!==void 0){let u;a.includes(` `)?u=a+` `:u=`{ `+a+` -}`,o=_4(u,{schema:A4})}i=(o==null?void 0:o.type)??i,o!=null&&o.alias&&(!n||n.text===r)&&(n={text:o.alias,wrap:n==null?void 0:n.wrap,type:i});const l=this.state.records.actors.get(e);if(l){if(this.state.records.currentBox&&l.box&&this.state.records.currentBox!==l.box)throw new Error(`A same participant should only be defined in one Box: ${l.name} can't be in '${l.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(s=l.box?l.box:this.state.records.currentBox,l.box=s,l&&r===l.name&&n==null)return}if((n==null?void 0:n.text)==null&&(n={text:r,type:i}),(i==null||n.text==null)&&(n={text:r,type:i}),this.state.records.actors.set(e,{box:s,name:r,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const u=this.state.records.actors.get(this.state.records.prevActor);u&&(u.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let r,n=0;if(!e)return 0;for(r=0;r>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:r,message:(n==null?void 0:n.text)??"",wrap:(n==null?void 0:n.wrap)??this.autoWrap(),type:i,activate:a,centralConnection:s??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const r=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(r===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:r}}autoWrap(){var e;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((e=Pe().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),In()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),a={text:i,wrap:n};return ae.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){const r=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=r!=null&&r[1]?r[1].trim():"transparent",i=r!=null&&r[2]?r[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",n)||(n="transparent",i=e.trim());else{const o=new Option().style;o.color=n,o.color!==n&&(n="transparent",i=e.trim())}const{wrap:a,cleanedText:s}=this.extractWrap(i);return{text:s?qr(s,Pe()):void 0,color:n,wrap:a}}addNote(e,r,n){const i={actor:e,placement:r,message:n.text,wrap:n.wrap??this.autoWrap()},a=[].concat(e,e);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:a[0],to:a[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:r})}addLinks(e,r){const n=this.getActor(e);try{let i=qr(r.text,Pe());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const a=JSON.parse(i);this.insertLinks(n,a)}catch(i){ae.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let a=qr(r.text,Pe());const s=a.indexOf("@");a=a.replace(/=/g,"="),a=a.replace(/&/g,"&");const o=a.slice(0,s-1).trim(),l=a.slice(s+1).trim();i[o]=l,this.insertLinks(n,i)}catch(i){ae.error("error while parsing actor link text",i)}}insertLinks(e,r){if(e.links==null)e.links=r;else for(const n in r)e.links[n]=r[n]}addProperties(e,r){const n=this.getActor(e);try{const i=qr(r.text,Pe()),a=JSON.parse(i);this.insertProperties(n,a)}catch(i){ae.error("error while parsing actor properties text",i)}}insertProperties(e,r){if(e.properties==null)e.properties=r;else for(const n in r)e.properties[n]=r[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,r){const n=this.getActor(e),i=document.getElementById(r.text);try{const a=i.innerHTML,s=JSON.parse(a);s.properties&&this.insertProperties(n,s.properties),s.links&&this.insertLinks(n,s.links)}catch(a){ae.error("error while parsing actor details text",a)}}getActorProperty(e,r){if((e==null?void 0:e.properties)!==void 0)return e.properties[r]}apply(e){if(Array.isArray(e))e.forEach(r=>{this.apply(r)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":Dn(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return Pe().sequence}},x(zv,"SequenceDB"),zv),Nlt=x(t=>{const e=t.dropShadow??"none",{look:r}=Pe();return`.actor { +}`,o=L4(u,{schema:R4})}i=(o==null?void 0:o.type)??i,o!=null&&o.alias&&(!n||n.text===r)&&(n={text:o.alias,wrap:n==null?void 0:n.wrap,type:i});const l=this.state.records.actors.get(e);if(l){if(this.state.records.currentBox&&l.box&&this.state.records.currentBox!==l.box)throw new Error(`A same participant should only be defined in one Box: ${l.name} can't be in '${l.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(s=l.box?l.box:this.state.records.currentBox,l.box=s,l&&r===l.name&&n==null)return}if((n==null?void 0:n.text)==null&&(n={text:r,type:i}),(i==null||n.text==null)&&(n={text:r,type:i}),this.state.records.actors.set(e,{box:s,name:r,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const u=this.state.records.actors.get(this.state.records.prevActor);u&&(u.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let r,n=0;if(!e)return 0;for(r=0;r>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:r,message:(n==null?void 0:n.text)??"",wrap:(n==null?void 0:n.wrap)??this.autoWrap(),type:i,activate:a,centralConnection:s??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const r=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(r===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:r}}autoWrap(){var e;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((e=Pe().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),In()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),a={text:i,wrap:n};return ae.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){const r=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=r!=null&&r[1]?r[1].trim():"transparent",i=r!=null&&r[2]?r[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",n)||(n="transparent",i=e.trim());else{const o=new Option().style;o.color=n,o.color!==n&&(n="transparent",i=e.trim())}const{wrap:a,cleanedText:s}=this.extractWrap(i);return{text:s?qr(s,Pe()):void 0,color:n,wrap:a}}addNote(e,r,n){const i={actor:e,placement:r,message:n.text,wrap:n.wrap??this.autoWrap()},a=[].concat(e,e);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:a[0],to:a[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:r})}addLinks(e,r){const n=this.getActor(e);try{let i=qr(r.text,Pe());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const a=JSON.parse(i);this.insertLinks(n,a)}catch(i){ae.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let a=qr(r.text,Pe());const s=a.indexOf("@");a=a.replace(/=/g,"="),a=a.replace(/&/g,"&");const o=a.slice(0,s-1).trim(),l=a.slice(s+1).trim();i[o]=l,this.insertLinks(n,i)}catch(i){ae.error("error while parsing actor link text",i)}}insertLinks(e,r){if(e.links==null)e.links=r;else for(const n in r)e.links[n]=r[n]}addProperties(e,r){const n=this.getActor(e);try{const i=qr(r.text,Pe()),a=JSON.parse(i);this.insertProperties(n,a)}catch(i){ae.error("error while parsing actor properties text",i)}}insertProperties(e,r){if(e.properties==null)e.properties=r;else for(const n in r)e.properties[n]=r[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,r){const n=this.getActor(e),i=document.getElementById(r.text);try{const a=i.innerHTML,s=JSON.parse(a);s.properties&&this.insertProperties(n,s.properties),s.links&&this.insertLinks(n,s.links)}catch(a){ae.error("error while parsing actor details text",a)}}getActorProperty(e,r){if((e==null?void 0:e.properties)!==void 0)return e.properties[r]}apply(e){if(Array.isArray(e))e.forEach(r=>{this.apply(r)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":Dn(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return Pe().sequence}},T(Gv,"SequenceDB"),Gv),Ylt=T(t=>{const e=t.dropShadow??"none",{look:r}=Pe();return`.actor { stroke: ${t.actorBorder}; fill: ${t.actorBkg}; stroke-width: ${t.strokeWidth??1}; @@ -2008,25 +2008,25 @@ Expecting `+or.join(", ")+", got '"+(this.terminals_[ye]||ye)+"'":Rr="Parse erro filter: ${e}; stroke: ${t.nodeBorder}; } -`},"getStyles"),Olt=Nlt,Jf=36,Ih="actor-top",Dh="actor-bottom",CS="actor-box",e0="actor-man",fu=new Set(["redux-color","redux-dark-color"]),XT=x(function(t,e){const r=f3(t,e);return lr().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),$lt=x(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+s+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";o.class!==void 0&&(h=" "+o.class);let d=o.width>r?o.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",o.x),f.attr("y",o.height),f.attr("fill",o.fill),f.attr("stroke",o.stroke),f.attr("width",d),f.attr("height",o.height),f.attr("rx",o.rx),f.attr("ry",o.ry),a!=null){var p=20;for(let y in a){var g=u.append("a"),m=cd.sanitizeUrl(a[y]);g.attr("xlink:href",m),g.attr("target","_blank"),act(n)(y,g,o.x+10,o.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:o.height+p,width:d}},"drawPopup"),kS=x(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),ES=x(async function(t,e,r=null){let n=t.append("foreignObject");const i=await _w(e.text,lr()),s=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),e.class==="noteText"){const o=t.node().firstChild;o.setAttribute("height",s.height+2*e.textMargin);const l=o.getBBox();n.attr("x",Math.round(l.x+l.width/2-s.width/2)).attr("y",Math.round(l.y+l.height/2-s.height/2))}else if(r){let{startx:o,stopx:l,starty:u}=r;if(o>l){const h=o;o=l,l=h}n.attr("x",Math.round(o+Math.abs(o-l)/2-s.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-s.height))}return[n]},"drawKatex"),em=x(function(t,e){let r=0,n=0;const i=e.text.split(Lt.lineBreakRegex),[a,s]=xc(e.fontSize);let o=[],l=0,u=x(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=x(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=x(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=x(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[h,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&a!==void 0&&(l=h*a);const f=t.append("text");f.attr("x",e.x),f.attr("y",u()),e.anchor!==void 0&&f.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&f.style("font-family",e.fontFamily),s!==void 0&&f.style("font-size",s),e.fontWeight!==void 0&&f.style("font-weight",e.fontWeight),e.fill!==void 0&&f.attr("fill",e.fill),e.class!==void 0&&f.attr("class",e.class),e.dy!==void 0?f.attr("dy",e.dy):l!==0&&f.attr("dy",l);const p=d||Jq;if(e.tspan){const g=f.append("tspan");g.attr("x",e.x),e.fill!==void 0&&g.attr("fill",e.fill),g.text(p)}else f.text(p);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(f._groups||f)[0][0].getBBox().height,r=n),o.push(f)}return o},"drawText"),Kge=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,em(t,e),n},"drawLabel"),Vr=-1,jge=x((t,e,r,n)=>{t.select&&r.forEach(i=>{const a=e.get(i),s=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):n.mirrorActors&&s.attr("y2",a.stopy)})},"fixLifeLineHeights"),Plt=x(function(t,e,r,n,i){var w,k;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Vr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",kS(`actor${Vr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Vr,e.links!=null&&g.attr("id","root-"+Vr),l==="neo"&&g.attr("data-look","neo"));const m=Ys();var y="actor";(w=e.properties)!=null&&w.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Dh}`:y+=` ${Ih}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.rx=3,m.ry=3,m.name=e.name,l==="neo"&&(m.rx=6,m.ry=6);const v=XT(g,m),T=i.get(e.name)??0;if(fu.has(u)&&(v.style("stroke",f[T%f.length]),v.style("fill",d[T%f.length])),l==="neo"&&v.attr("filter","url(#drop-shadow)"),e.rectData=m,(k=e.properties)!=null&&k.icon){const A=e.properties.icon.trim();A.charAt(0)==="@"?uI(g,m.x+m.width-20,m.y+10,A.substr(1)):cI(g,m.x+m.width-20,m.y+10,A)}n||(g.attr("data-et","participant"),g.attr("data-type","participant"),g.attr("data-id",e.name)),pu(r,ui(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${CS}`},r);let b=e.height;if(v.node){const A=v.node().getBBox();e.height=A.height,b=A.height}return b},"drawActorTypeParticipant"),Blt=x(function(t,e,r,n,i){var C,_;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Vr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",kS(`actor${Vr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Vr,e.links!=null&&g.attr("id","root-"+Vr),l==="neo"&&g.attr("data-look","neo"));const m=Ys();var y="actor";(C=e.properties)!=null&&C.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Dh}`:y+=` ${Ih}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.name=e.name;const v=6,T={...m,x:m.x+-v,y:m.y+ +v,class:"actor"},b=XT(g,m),w=XT(g,T);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const k=i.get(e.name)??0;if(fu.has(u)&&(b.style("stroke",f[k%f.length]),b.style("fill",d[k%f.length]),w.style("stroke",f[k%f.length]),w.style("fill",d[k%f.length])),(_=e.properties)!=null&&_.icon){const L=e.properties.icon.trim();L.charAt(0)==="@"?uI(g,m.x+m.width-20,m.y+10,L.substr(1)):cI(g,m.x+m.width-20,m.y+10,L)}pu(r,ui(e.description))(e.description,g,m.x-v,m.y+v,m.width,m.height,{class:`actor ${CS}`},r);let A=e.height;if(b.node){const L=b.node().getBBox();e.height=L.height,A=L.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),A},"drawActorTypeCollections"),Flt=x(function(t,e,r,n,i){var L,O;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(Vr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",kS(`actor${Vr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Vr,e.links!=null&&g.attr("id","root-"+Vr),l==="neo"&&g.attr("data-look","neo"));const m=Ys();let y="actor";(L=e.properties)!=null&&L.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Dh}`:y+=` ${Ih}`,g.attr("class",y),m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.name=e.name;const v=m.height/2,T=v/(2.5+m.height/50),b=g.append("g"),w=g.append("g"),k=`M ${m.x},${m.y+v} - a ${T},${v} 0 0 0 0,${m.height} - h ${m.width-2*T} - a ${T},${v} 0 0 0 0,-${m.height} +`},"getStyles"),Xlt=Ylt,Jf=36,Ih="actor-top",Dh="actor-bottom",SS="actor-box",ep="actor-man",fu=new Set(["redux-color","redux-dark-color"]),jT=T(function(t,e){const r=m3(t,e);return lr().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),Klt=T(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+s+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";o.class!==void 0&&(h=" "+o.class);let d=o.width>r?o.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",o.x),f.attr("y",o.height),f.attr("fill",o.fill),f.attr("stroke",o.stroke),f.attr("width",d),f.attr("height",o.height),f.attr("rx",o.rx),f.attr("ry",o.ry),a!=null){var p=20;for(let y in a){var g=u.append("a"),m=cd.sanitizeUrl(a[y]);g.attr("xlink:href",m),g.attr("target","_blank"),vct(n)(y,g,o.x+10,o.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:o.height+p,width:d}},"drawPopup"),AS=T(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),_S=T(async function(t,e,r=null){let n=t.append("foreignObject");const i=await Lw(e.text,lr()),s=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),e.class==="noteText"){const o=t.node().firstChild;o.setAttribute("height",s.height+2*e.textMargin);const l=o.getBBox();n.attr("x",Math.round(l.x+l.width/2-s.width/2)).attr("y",Math.round(l.y+l.height/2-s.height/2))}else if(r){let{startx:o,stopx:l,starty:u}=r;if(o>l){const h=o;o=l,l=h}n.attr("x",Math.round(o+Math.abs(o-l)/2-s.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-s.height))}return[n]},"drawKatex"),tm=T(function(t,e){let r=0,n=0;const i=e.text.split(Lt.lineBreakRegex),[a,s]=xc(e.fontSize);let o=[],l=0,u=T(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=T(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=T(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=T(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[h,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&a!==void 0&&(l=h*a);const f=t.append("text");f.attr("x",e.x),f.attr("y",u()),e.anchor!==void 0&&f.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&f.style("font-family",e.fontFamily),s!==void 0&&f.style("font-size",s),e.fontWeight!==void 0&&f.style("font-weight",e.fontWeight),e.fill!==void 0&&f.attr("fill",e.fill),e.class!==void 0&&f.attr("class",e.class),e.dy!==void 0?f.attr("dy",e.dy):l!==0&&f.attr("dy",l);const p=d||iV;if(e.tspan){const g=f.append("tspan");g.attr("x",e.x),e.fill!==void 0&&g.attr("fill",e.fill),g.text(p)}else f.text(p);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(f._groups||f)[0][0].getBBox().height,r=n),o.push(f)}return o},"drawText"),tme=T(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}T(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,tm(t,e),n},"drawLabel"),Vr=-1,rme=T((t,e,r,n)=>{t.select&&r.forEach(i=>{const a=e.get(i),s=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):n.mirrorActors&&s.attr("y2",a.stopy)})},"fixLifeLineHeights"),jlt=T(function(t,e,r,n,i){var w,k;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Vr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",AS(`actor${Vr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Vr,e.links!=null&&g.attr("id","root-"+Vr),l==="neo"&&g.attr("data-look","neo"));const m=Ys();var y="actor";(w=e.properties)!=null&&w.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Dh}`:y+=` ${Ih}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.rx=3,m.ry=3,m.name=e.name,l==="neo"&&(m.rx=6,m.ry=6);const v=jT(g,m),x=i.get(e.name)??0;if(fu.has(u)&&(v.style("stroke",f[x%f.length]),v.style("fill",d[x%f.length])),l==="neo"&&v.attr("filter","url(#drop-shadow)"),e.rectData=m,(k=e.properties)!=null&&k.icon){const S=e.properties.icon.trim();S.charAt(0)==="@"?gI(g,m.x+m.width-20,m.y+10,S.substr(1)):pI(g,m.x+m.width-20,m.y+10,S)}n||(g.attr("data-et","participant"),g.attr("data-type","participant"),g.attr("data-id",e.name)),pu(r,ui(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${SS}`},r);let b=e.height;if(v.node){const S=v.node().getBBox();e.height=S.height,b=S.height}return b},"drawActorTypeParticipant"),Zlt=T(function(t,e,r,n,i){var C,_;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Vr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",AS(`actor${Vr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Vr,e.links!=null&&g.attr("id","root-"+Vr),l==="neo"&&g.attr("data-look","neo"));const m=Ys();var y="actor";(C=e.properties)!=null&&C.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Dh}`:y+=` ${Ih}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.name=e.name;const v=6,x={...m,x:m.x+-v,y:m.y+ +v,class:"actor"},b=jT(g,m),w=jT(g,x);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const k=i.get(e.name)??0;if(fu.has(u)&&(b.style("stroke",f[k%f.length]),b.style("fill",d[k%f.length]),w.style("stroke",f[k%f.length]),w.style("fill",d[k%f.length])),(_=e.properties)!=null&&_.icon){const L=e.properties.icon.trim();L.charAt(0)==="@"?gI(g,m.x+m.width-20,m.y+10,L.substr(1)):pI(g,m.x+m.width-20,m.y+10,L)}pu(r,ui(e.description))(e.description,g,m.x-v,m.y+v,m.width,m.height,{class:`actor ${SS}`},r);let S=e.height;if(b.node){const L=b.node().getBBox();e.height=L.height,S=L.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),S},"drawActorTypeCollections"),Qlt=T(function(t,e,r,n,i){var L,O;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(Vr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",AS(`actor${Vr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Vr,e.links!=null&&g.attr("id","root-"+Vr),l==="neo"&&g.attr("data-look","neo"));const m=Ys();let y="actor";(L=e.properties)!=null&&L.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Dh}`:y+=` ${Ih}`,g.attr("class",y),m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.name=e.name;const v=m.height/2,x=v/(2.5+m.height/50),b=g.append("g"),w=g.append("g"),k=`M ${m.x},${m.y+v} + a ${x},${v} 0 0 0 0,${m.height} + h ${m.width-2*x} + a ${x},${v} 0 0 0 0,-${m.height} Z `;b.append("path").attr("d",k),w.append("path").attr("d",`M ${m.x},${m.y+v} - a ${T},${v} 0 0 0 0,${m.height}`),b.attr("transform",`translate(${T}, ${-(m.height/2)})`),w.attr("transform",`translate(${m.width-T}, ${-m.height/2})`),e.rectData=m,l==="neo"&&b.attr("filter","url(#drop-shadow)");const A=i.get(e.name)??0;if(fu.has(u)&&(b.style("stroke",f[A%f.length]),b.style("fill",d[A%f.length]),w.style("stroke",f[A%f.length]),w.style("fill",d[A%f.length])),(O=e.properties)!=null&&O.icon){const M=e.properties.icon.trim(),z=m.x+m.width-20,F=m.y+10;M.charAt(0)==="@"?uI(g,z,F,M.substr(1)):cI(g,z,F,M)}pu(r,ui(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${CS}`},r);let C=e.height;const _=b.select("path:last-child");if(_.node()){const M=_.node().getBBox();e.height=M.height,C=M.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),C},"drawActorTypeQueue"),zlt=x(function(t,e,r,n,i,a){var L;const s=n?e.stopy:e.starty,o=e.x+e.width/2,l=s+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,y=t.append("g").lower();n||(Vr++,y.append("line").attr("id","actor"+Vr).attr("x1",o).attr("y1",l).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Vr);const v=t.append("g");let T=e0;n?T+=` ${Dh}`:T+=` ${Ih}`,v.attr("class",T),v.attr("name",e.name);const b=Ys();b.x=e.x,b.y=s,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor";const w=e.x+e.width/2,k=s+32,A=22;v.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),v.append("circle").attr("cx",w).attr("cy",k).attr("r",A).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),v.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${w}, ${k-A})`);const C=a.get(e.name)??0;fu.has(h)?(v.style("stroke",p[C%p.length]),v.style("fill",f[C%p.length])):(v.style("stroke",g),v.style("fill",m));const _=v.node().getBBox();return e.height=_.height+2*(((L=r==null?void 0:r.sequence)==null?void 0:L.labelBoxHeight)??0),pu(r,ui(e.description))(e.description,v,b.x,b.y+A+(n?5:12),b.width,b.height,{class:`actor ${e0}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),Glt=x(function(t,e,r,n,i){var A;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+75,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower(),g=t.append("g");let m="actor";n?m+=` ${Dh}`:m+=` ${Ih}`,g.attr("class",m),g.attr("name",e.name);const y=Ys();y.x=e.x,y.y=a,y.fill="#eaeaea",y.width=e.width,y.height=e.height,y.class="actor";const v=e.x+e.width/2,T=a+(n?10:25),b=22;g.append("circle").attr("cx",v).attr("cy",T).attr("r",b).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",v-b).attr("x2",v+b).attr("y1",T+b).attr("y2",T+b).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const w=i.get(e.name)??0;fu.has(u)&&(g.style("stroke",f[w%f.length]),g.style("fill",d[w%f.length]));const k=g.node().getBBox();return e.height=k.height+(((A=r==null?void 0:r.sequence)==null?void 0:A.labelBoxHeight)??0),n||(Vr++,p.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Vr),pu(r,ui(e.description))(e.description,g,y.x,y.y+(n?15:30),y.width,y.height,{class:`actor ${e0}`},r),n?g.attr("transform",`translate(0, ${b})`):(g.attr("transform",`translate(0, ${b/2-5})`),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),qlt=x(function(t,e,r,n,i){var O;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height+2*r.boxTextMargin,{theme:l,themeVariables:u,look:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=u,g=t.append("g").lower();let m=g;n||(Vr++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",kS(`actor${Vr}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),m=g.append("g"),e.actorCnt=Vr,e.links!=null&&m.attr("id","root-"+Vr),h==="neo"&&m.attr("data-look","neo"));const y=Ys();let v="actor";(O=e.properties)!=null&&O.class?v=e.properties.class:y.fill="#eaeaea",n?v+=` ${Dh}`:v+=` ${Ih}`,y.x=e.x,y.y=a,y.width=e.width,y.height=e.height,y.class=v,y.name=e.name,y.x=e.x,y.y=a;const T=y.width/3,b=y.width/3,w=T/2,k=w/(2.5+T/50),A=m.append("g");A.attr("class",v);const C=` + a ${x},${v} 0 0 0 0,${m.height}`),b.attr("transform",`translate(${x}, ${-(m.height/2)})`),w.attr("transform",`translate(${m.width-x}, ${-m.height/2})`),e.rectData=m,l==="neo"&&b.attr("filter","url(#drop-shadow)");const S=i.get(e.name)??0;if(fu.has(u)&&(b.style("stroke",f[S%f.length]),b.style("fill",d[S%f.length]),w.style("stroke",f[S%f.length]),w.style("fill",d[S%f.length])),(O=e.properties)!=null&&O.icon){const M=e.properties.icon.trim(),z=m.x+m.width-20,F=m.y+10;M.charAt(0)==="@"?gI(g,z,F,M.substr(1)):pI(g,z,F,M)}pu(r,ui(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${SS}`},r);let C=e.height;const _=b.select("path:last-child");if(_.node()){const M=_.node().getBBox();e.height=M.height,C=M.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),C},"drawActorTypeQueue"),Jlt=T(function(t,e,r,n,i,a){var L;const s=n?e.stopy:e.starty,o=e.x+e.width/2,l=s+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,y=t.append("g").lower();n||(Vr++,y.append("line").attr("id","actor"+Vr).attr("x1",o).attr("y1",l).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Vr);const v=t.append("g");let x=ep;n?x+=` ${Dh}`:x+=` ${Ih}`,v.attr("class",x),v.attr("name",e.name);const b=Ys();b.x=e.x,b.y=s,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor";const w=e.x+e.width/2,k=s+32,S=22;v.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),v.append("circle").attr("cx",w).attr("cy",k).attr("r",S).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),v.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${w}, ${k-S})`);const C=a.get(e.name)??0;fu.has(h)?(v.style("stroke",p[C%p.length]),v.style("fill",f[C%p.length])):(v.style("stroke",g),v.style("fill",m));const _=v.node().getBBox();return e.height=_.height+2*(((L=r==null?void 0:r.sequence)==null?void 0:L.labelBoxHeight)??0),pu(r,ui(e.description))(e.description,v,b.x,b.y+S+(n?5:12),b.width,b.height,{class:`actor ${ep}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),ect=T(function(t,e,r,n,i){var S;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+75,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower(),g=t.append("g");let m="actor";n?m+=` ${Dh}`:m+=` ${Ih}`,g.attr("class",m),g.attr("name",e.name);const y=Ys();y.x=e.x,y.y=a,y.fill="#eaeaea",y.width=e.width,y.height=e.height,y.class="actor";const v=e.x+e.width/2,x=a+(n?10:25),b=22;g.append("circle").attr("cx",v).attr("cy",x).attr("r",b).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",v-b).attr("x2",v+b).attr("y1",x+b).attr("y2",x+b).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const w=i.get(e.name)??0;fu.has(u)&&(g.style("stroke",f[w%f.length]),g.style("fill",d[w%f.length]));const k=g.node().getBBox();return e.height=k.height+(((S=r==null?void 0:r.sequence)==null?void 0:S.labelBoxHeight)??0),n||(Vr++,p.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Vr),pu(r,ui(e.description))(e.description,g,y.x,y.y+(n?15:30),y.width,y.height,{class:`actor ${ep}`},r),n?g.attr("transform",`translate(0, ${b})`):(g.attr("transform",`translate(0, ${b/2-5})`),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),tct=T(function(t,e,r,n,i){var O;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height+2*r.boxTextMargin,{theme:l,themeVariables:u,look:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=u,g=t.append("g").lower();let m=g;n||(Vr++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",AS(`actor${Vr}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),m=g.append("g"),e.actorCnt=Vr,e.links!=null&&m.attr("id","root-"+Vr),h==="neo"&&m.attr("data-look","neo"));const y=Ys();let v="actor";(O=e.properties)!=null&&O.class?v=e.properties.class:y.fill="#eaeaea",n?v+=` ${Dh}`:v+=` ${Ih}`,y.x=e.x,y.y=a,y.width=e.width,y.height=e.height,y.class=v,y.name=e.name,y.x=e.x,y.y=a;const x=y.width/3,b=y.width/3,w=x/2,k=w/(2.5+x/50),S=m.append("g");S.attr("class",v);const C=` M ${y.x},${y.y+k} - a ${w},${k} 0 0 0 ${T},0 - a ${w},${k} 0 0 0 -${T},0 + a ${w},${k} 0 0 0 ${x},0 + a ${w},${k} 0 0 0 -${x},0 l 0,${b-2*k} - a ${w},${k} 0 0 0 ${T},0 + a ${w},${k} 0 0 0 ${x},0 l 0,-${b-2*k} -`;A.append("path").attr("d",C),h==="neo"&&A.attr("filter","url(#drop-shadow)");const _=i.get(e.name)??0;fu.has(l)?(A.style("stroke",f[_%f.length]),A.style("fill",d[_%f.length])):A.style("stroke",p),A.attr("transform",`translate(${T}, ${k})`),e.rectData=y,pu(r,ui(e.description))(e.description,m,y.x,y.y+35,y.width,y.height,{class:`actor ${CS}`},r);const L=A.select("path:last-child");if(L.node()){const M=L.node().getBBox();e.height=M.height+(r.sequence.labelBoxHeight??0)}return n||(m.attr("data-et","participant"),m.attr("data-type","database"),m.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),Vlt=x(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(Vr++,u.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Vr);const y=t.append("g");let v=e0;n?v+=` ${Dh}`:v+=` ${Ih}`,y.attr("class",v),y.attr("name",e.name);const T=Ys();T.x=e.x,T.y=a,T.fill="#eaeaea",T.width=e.width,T.height=e.height,T.class="actor",y.append("line").attr("id","actor-man-torso"+Vr).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+12).attr("x2",e.x+e.width/2-15).attr("y2",a+12),y.append("line").attr("id","actor-man-arms"+Vr).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+2).attr("x2",e.x+e.width/2-l*2.5).attr("y2",a+22),y.append("circle").attr("cx",e.x+e.width/2).attr("cy",a+12).attr("r",l),h==="neo"&&y.attr("filter","url(#drop-shadow)");const b=i.get(e.name)??0;fu.has(d)?(y.style("stroke",g[b%g.length]),y.style("fill",p[b%g.length])):y.style("stroke",m);const w=y.node().getBBox();return e.height=w.height+(r.sequence.labelBoxHeight??0),pu(r,ui(e.description))(e.description,y,T.x,T.y+15,T.width,T.height,{class:`actor ${e0}`},r),y.attr("transform",`translate(0,${l/2+10})`),n||(y.attr("data-et","participant"),y.attr("data-type","boundary"),y.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),Wlt=x(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(Vr++,g.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Vr);const m=t.append("g");let y=e0;n?y+=` ${Dh}`:y+=` ${Ih}`,m.attr("class",y),m.attr("name",e.name),n||m.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const v=l==="neo"?.5:1,T=l==="neo"?a+(1-v)*30:a;m.append("line").attr("id","actor-man-torso"+Vr).attr("x1",s).attr("y1",T+25*v).attr("x2",s).attr("y2",T+45*v),m.append("line").attr("id","actor-man-arms"+Vr).attr("x1",s-Jf/2*v).attr("y1",T+33*v).attr("x2",s+Jf/2*v).attr("y2",T+33*v),m.append("line").attr("x1",s-Jf/2*v).attr("y1",T+60*v).attr("x2",s).attr("y2",T+45*v),m.append("line").attr("x1",s).attr("y1",T+45*v).attr("x2",s+(Jf/2-2)*v).attr("y2",T+60*v);const b=m.append("circle");b.attr("cx",e.x+e.width/2),b.attr("cy",T+10*v),b.attr("r",15*v),b.attr("width",e.width*v),b.attr("height",e.height*v);const w=m.node().getBBox();e.height=w.height;const k=Ys();k.x=e.x,k.y=T,k.fill="#eaeaea",k.width=e.width,k.height=e.height/v,k.class="actor",k.rx=3,k.ry=3;const A=i.get(e.name)??0;return fu.has(u)?(m.style("stroke",f[A%f.length]),m.style("fill",d[A%f.length])):m.style("stroke",p),pu(r,ui(e.description))(e.description,m,k.x,T+35*v-(l==="neo"?10:0),k.width,k.height,{class:`actor ${e0}`},r),e.height},"drawActorTypeActor"),Ult=x(async function(t,e,r,n,i,a,s){const o=s??new Map([...a.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await Wlt(t,e,r,n,o);case"participant":return await Plt(t,e,r,n,o);case"boundary":return await Vlt(t,e,r,n,o);case"control":return await zlt(t,e,r,n,i,o);case"entity":return await Glt(t,e,r,n,o);case"database":return await qlt(t,e,r,n,o);case"collections":return await Blt(t,e,r,n,o);case"queue":return await Flt(t,e,r,n,o)}},"drawActor"),Hlt=x(function(t,e,r){const i=t.append("g");Zge(i,e),e.name&&pu(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),Ylt=x(function(t){return t.append("g")},"anchorElement"),Xlt=x(function(t,e,r,n,i,a,s){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=Ys(),p=e.anchored,g=e.actor;f.x=e.startx,f.y=e.starty,f.class="activation"+i%3,f.width=e.stopx-e.startx,f.height=r-e.starty;const m=XT(p,f),v=(s??new Map([...a.db.getActors().values()].map((T,b)=>[T.name,b]))).get(g)??0;fu.has(o)&&(m.style("stroke",h[v%h.length]),m.style("fill",u[v%h.length]??d))},"drawActivation"),Klt=x(async function(t,e,r,n,i){const{boxMargin:a,boxTextMargin:s,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:d}=n,f=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),p=x(function(y,v,T,b){return f.append("line").attr("x1",y).attr("y1",v).attr("x2",T).attr("y2",b).attr("class","loopLine")},"drawLoopLine");p(e.startx,e.starty,e.stopx,e.starty),p(e.stopx,e.starty,e.stopx,e.stopy),p(e.startx,e.stopy,e.stopx,e.stopy),p(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(y){p(e.startx,y.y,e.stopx,y.y).style("stroke-dasharray","3, 3")});let g=hI();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(l??0,50),g.height=o+(n.look==="neo"?15:0)||20,g.textMargin=s,g.class="labelText",Kge(f,g),g=Qge(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+a+s,g.anchor="middle",g.valign="middle",g.textMargin=s,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=ui(g.text)?await ES(f,g,e):em(f,g);if(e.sectionTitles!==void 0){for(const[y,v]of Object.entries(e.sectionTitles))if(v.message){g.text=v.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[y].y+a+s,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=e.wrap,ui(g.text)?(e.starty=e.sections[y].y,await ES(f,g,e)):em(f,g);let T=Math.round(m.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,w)=>b+w));e.sections[y].height+=T-(a+s)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),Zge=x(function(t,e){bte(t,e)},"drawBackgroundRect"),jlt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Zlt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),Qlt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Jlt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),ect=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),tct=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),rct=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),nct=x(function(t,e){const{theme:r}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),Qge=x(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),ict=x(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),pu=(function(){function t(a,s,o,l,u,h,d){const f=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);i(f,d)}x(t,"byText");function e(a,s,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[y,v]=xc(p),T=a.split(Lt.lineBreakRegex);for(let b=0;bt.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:x(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:x(function(t){this.boxes.push(t)},"addBox"),addActor:x(function(t){this.actors.push(t)},"addActor"),addLoop:x(function(t){this.loops.push(t)},"addLoop"),addMessage:x(function(t){this.messages.push(t)},"addMessage"),addNote:x(function(t){this.notes.push(t)},"addNote"),lastActor:x(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:x(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:x(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:x(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:x(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,rme(Pe())},"init"),updateVal:x(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:x(function(t,e,r,n){const i=this;let a=0;function s(o){return x(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*Ye.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*Ye.boxMargin,Math.max),i.updateVal(Tt.data,"startx",t-h*Ye.boxMargin,Math.min),i.updateVal(Tt.data,"stopx",r+h*Ye.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*Ye.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*Ye.boxMargin,Math.max),i.updateVal(Tt.data,"starty",e-h*Ye.boxMargin,Math.min),i.updateVal(Tt.data,"stopy",n+h*Ye.boxMargin,Math.max))},"updateItemBounds")}x(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:x(function(t,e,r,n){const i=Lt.getMin(t,r),a=Lt.getMax(t,r),s=Lt.getMin(e,n),o=Lt.getMax(e,n);this.updateVal(Tt.data,"startx",i,Math.min),this.updateVal(Tt.data,"starty",s,Math.min),this.updateVal(Tt.data,"stopx",a,Math.max),this.updateVal(Tt.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),newActivation:x(function(t,e,r){const n=r.get(t.from),i=SS(t.from).length||0,a=n.x+n.width/2+(i-1)*Ye.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Ye.activationWidth,stopy:void 0,actor:t.from,anchored:Rn.anchorElement(e)})},"newActivation"),endActivation:x(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:x(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:x(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:x(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:x(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:x(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Tt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:x(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:x(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:x(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=Lt.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return{bounds:this.data,models:this.models}},"getBounds")},uct=x(async function(t,e,r){Tt.bumpVerticalPos(Ye.boxMargin),e.height=Ye.boxMargin,e.starty=Tt.getVerticalPos();const n=Ys();n.x=e.startx,n.y=e.starty,n.width=e.width||Ye.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=Rn.drawRect(i,n),s=hI();s.x=e.startx,s.y=e.starty,s.width=n.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=Ye.noteFontFamily,s.fontSize=Ye.noteFontSize,s.fontWeight=Ye.noteFontWeight,s.anchor=Ye.noteAlign,s.textMargin=Ye.noteMargin,s.valign="center";const o=ui(s.text)?await ES(i,s):em(i,s),l=Math.round(o.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));a.attr("height",l+2*Ye.noteMargin),e.height+=l+2*Ye.noteMargin,Tt.bumpVerticalPos(l+2*Ye.noteMargin),e.stopy=e.starty+l+2*Ye.noteMargin,e.stopx=e.startx+n.width,Tt.insert(e.startx,e.starty,e.stopx,e.stopy),Tt.models.addNote(e)},"drawNote"),Jge=x(function(t,e,r,n,i,a,s){const o=n.db.getActors(),l=o.get(e.from),u=o.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=ome(e,n),m=t.append("g"),y=16.5,v=x((A,C)=>{const _=A?y:-y;return C?-_:_},"getCircleOffset"),T=x(A=>{m.append("circle").attr("cx",A).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:w,CENTRAL_CONNECTION_DUAL:k}=n.db.LINETYPE;if(h)switch(e.centralConnection){case b:g&&(f+=v(p,!0));break;case w:g||(d+=v(p,!1));break;case k:g?f+=v(p,!0):d+=v(p,!1);break}switch(e.centralConnection){case b:T(f);break;case w:T(d);break;case k:T(d),T(f);break}},"drawCentralConnection"),t0=x(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),tm=x(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),w$=x(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function eme(t,e){Tt.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=Lt.splitBreaks(i).length,s=ui(i),o=s?await h2(i,Pe()):Lr.calculateTextDimensions(i,t0(Ye));if(!s){const d=o.height/a;e.height+=d,Tt.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=Tt.getVerticalPos()+u,Ye.rightAngles||(u+=Ye.boxMargin,l=Tt.getVerticalPos()+u),u+=30;const d=Lt.getMax(h/2,Ye.width/2);Tt.insert(r-d,Tt.getVerticalPos()-10+u,n+d,Tt.getVerticalPos()+30+u)}else u+=Ye.boxMargin,l=Tt.getVerticalPos()+u,Tt.insert(r,l-10,n,l);return Tt.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,Tt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}x(eme,"boundMessage");var hct=x(async function(t,e,r,n,i,a){const{startx:s,stopx:o,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=Lr.calculateTextDimensions(u,t0(Ye)),g=hI();g.x=Math.min(s,o),g.y=l+10,g.width=Math.abs(o-s),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=Ye.messageFontFamily,g.fontSize=Ye.messageFontSize,g.fontWeight=Ye.messageFontWeight,g.anchor=Ye.messageAlign,g.valign="center",g.textMargin=Ye.wrapPadding,g.tspan=!1,ui(g.text)?await ES(t,g,{startx:s,stopx:o,starty:r}):em(t,g);const m=p.width;let y;if(s===o){const T=f||Ye.showSequenceNumbers,b=ome(i,n),w=vct(i,n),k=s+(T&&(b||w)?10:0);Ye.rightAngles?y=t.append("path").attr("d",`M ${k},${r} H ${s+Lt.getMax(Ye.width/2,m/2)} V ${r+25} H ${s}`):y=t.append("path").attr("d","M "+k+","+r+" C "+(k+60)+","+(r-10)+" "+(s+60)+","+(r+30)+" "+s+","+(r+20)),k$(i,n)&&Jge(t,i,e,n,s,o,r)}else y=t.append("line"),y.attr("x1",s),y.attr("y1",r),y.attr("x2",o),y.attr("y2",r),k$(i,n)&&Jge(t,i,e,n,s,o,r);h===n.db.LINETYPE.DOTTED||h===n.db.LINETYPE.DOTTED_CROSS||h===n.db.LINETYPE.DOTTED_POINT||h===n.db.LINETYPE.DOTTED_OPEN||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===n.db.LINETYPE.SOLID_TOP_DOTTED||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===n.db.LINETYPE.STICK_TOP_DOTTED||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style("stroke-dasharray","3, 3"),y.attr("class","messageLine1")):y.attr("class","messageLine0"),y.attr("data-et","message"),y.attr("data-id","i"+e.id),y.attr("data-from",e.from),y.attr("data-to",e.to);let v="";if(Ye.arrowMarkerAbsolute&&(v=Aw(!0)),y.attr("stroke-width",2),y.attr("stroke","none"),y.style("fill","none"),(h===n.db.LINETYPE.SOLID_TOP||h===n.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.SOLID_BOTTOM||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.STICK_TOP||h===n.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.STICK_BOTTOM||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.SOLID||h===n.db.LINETYPE.DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-arrowhead)"),(h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr("marker-start","url("+v+"#"+a+"-arrowhead)"),y.attr("marker-end","url("+v+"#"+a+"-arrowhead)")),(h===n.db.LINETYPE.SOLID_POINT||h===n.db.LINETYPE.DOTTED_POINT)&&y.attr("marker-end","url("+v+"#"+a+"-filled-head)"),(h===n.db.LINETYPE.SOLID_CROSS||h===n.db.LINETYPE.DOTTED_CROSS)&&y.attr("marker-end","url("+v+"#"+a+"-crosshead)"),f||Ye.showSequenceNumbers){const T=h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,b=h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,w=6,k=k$(i,n);let A=s,C=o;T?(ss?C=o-2*w:(C=o-w,A+=(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),C+=k?15:0,y.attr("x2",C),y.attr("x1",A)):y.attr("x1",s+w);let _=0;const L=s===o,O=s<=o;L?_=e.fromBounds+1:b?_=O?e.toBounds-1:e.fromBounds+1:_=O?e.fromBounds+1:e.toBounds-1;let M="12px";const z=d.toString().length;z>5?M="7px":z>3&&(M="9px"),t.append("line").attr("x1",_).attr("y1",r).attr("x2",_).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+v+"#"+a+"-sequencenumber)"),t.append("text").attr("x",_).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",M).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),dct=x(function(t,e,r,n,i,a,s){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(s||Tt.models.addBox(u),l+=Ye.boxMargin+u.margin),p&&p!=u&&(s||(p.x=o+l,p.y=i),l+=p.margin),f.width=Lt.getMax(f.width||Ye.width,Ye.width),f.height=Lt.getMax(f.height||Ye.height,Ye.height),f.margin=f.margin||Ye.actorMargin,h=Lt.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=Tt.getVerticalPos(),Tt.insert(f.x,i,f.x+f.width,f.height),o+=f.width+l,f.box&&(f.box.width=o+p.margin-f.box.x),l=f.margin,u=f.box,Tt.models.addActor(f)}u&&!s&&Tt.models.addBox(u),Tt.bumpVerticalPos(h)},"addActorRenderingData"),C$=x(async function(t,e,r,n,i,a,s){if(n){let o=0;Tt.bumpVerticalPos(Ye.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=Tt.getVerticalPos());const h=await Rn.drawActor(t,u,Ye,!0,i,a,s);o=Lt.getMax(o,h)}Tt.bumpVerticalPos(o+Ye.boxMargin)}else for(const o of r){const l=e.get(o);await Rn.drawActor(t,l,Ye,!1,i,a,s)}},"drawActors"),tme=x(function(t,e,r,n){let i=0,a=0;for(const s of r){const o=e.get(s),l=pct(o),u=Rn.drawPopup(t,o,l,Ye,Ye.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>a&&(a=u.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),rme=x(function(t){ci(Ye,t),t.fontFamily&&(Ye.actorFontFamily=Ye.noteFontFamily=Ye.messageFontFamily=t.fontFamily),t.fontSize&&(Ye.actorFontSize=Ye.noteFontSize=Ye.messageFontSize=t.fontSize),t.fontWeight&&(Ye.actorFontWeight=Ye.noteFontWeight=Ye.messageFontWeight=t.fontWeight)},"setConf"),SS=x(function(t){return Tt.activations.filter(function(e){return e.actor===t})},"actorActivations"),nme=x(function(t,e){const r=e.get(t),n=SS(t),i=n.reduce(function(s,o){return Lt.getMin(s,o.startx)},r.x+r.width/2-1),a=n.reduce(function(s,o){return Lt.getMax(s,o.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function Jo(t,e,r,n,i){Tt.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,o=t0(Ye);e.message=Lr.wrapLabel(`[${e.message}]`,s-2*Ye.wrapPadding,o),e.width=s,e.wrap=!0;const l=Lr.calculateTextDimensions(e.message,o),u=Lt.getMax(l.height,Ye.labelBoxHeight);a=n+u,ae.debug(`${u} - ${e.message}`)}i(e),Tt.bumpVerticalPos(a)}x(Jo,"adjustLoopHeightForWrap");function ime(t,e,r,n,i,a,s){function o(h,d){h.x{P.add(G.from),P.add(G.to)}),m=m.filter(G=>P.has(G))}const k=new Map(m.map((P,G)=>{var V;return[((V=d.get(P))==null?void 0:V.name)??P,G]}));dct(h,d,f,m,0,y,!1);const A=await xct(y,d,w,n);Rn.insertArrowHead(h,e),Rn.insertArrowCrossHead(h,e),Rn.insertArrowFilledHead(h,e),Rn.insertSequenceNumber(h,e),Rn.insertSolidTopArrowHead(h,e),Rn.insertSolidBottomArrowHead(h,e),Rn.insertStickTopArrowHead(h,e),Rn.insertStickBottomArrowHead(h,e),s==="neo"&&Rn.insertDropShadow(h,Ye);function C(P,G){const V=Tt.endActivation(P);V.starty+18>G&&(V.starty=G-6,G+=12),Rn.drawActivation(h,V,G,Ye,SS(P.from).length,n,k),Tt.insert(V.startx,G-10,V.stopx,G)}x(C,"activeEnd");let _=1,L=1;const O=[],M=[];let z=0;for(const P of y){let G,V,Y;switch(P.type){case n.db.LINETYPE.NOTE:Tt.resetVerticalPos(),V=P.noteModel,await uct(h,V,P.id);break;case n.db.LINETYPE.ACTIVE_START:Tt.newActivation(P,h,d);break;case n.db.LINETYPE.CENTRAL_CONNECTION:Tt.newActivation(P,h,d);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Tt.newActivation(P,h,d);break;case n.db.LINETYPE.ACTIVE_END:C(P,Tt.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:Jo(A,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W));break;case n.db.LINETYPE.LOOP_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"loop",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;case n.db.LINETYPE.RECT_START:Jo(A,P,Ye.boxMargin,Ye.boxMargin,W=>Tt.newLoop(void 0,W.message));break;case n.db.LINETYPE.RECT_END:G=Tt.endLoop(),M.push(G),Tt.models.addLoop(G),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos());break;case n.db.LINETYPE.OPT_START:Jo(A,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W));break;case n.db.LINETYPE.OPT_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"opt",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;case n.db.LINETYPE.ALT_START:Jo(A,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W));break;case n.db.LINETYPE.ALT_ELSE:Jo(A,P,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,W=>Tt.addSectionToLoop(W));break;case n.db.LINETYPE.ALT_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"alt",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:Jo(A,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W)),Tt.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:Jo(A,P,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,W=>Tt.addSectionToLoop(W));break;case n.db.LINETYPE.PAR_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"par",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;case n.db.LINETYPE.AUTONUMBER:_=P.message.start||_,L=P.message.step||L,P.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:Jo(A,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W));break;case n.db.LINETYPE.CRITICAL_OPTION:Jo(A,P,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,W=>Tt.addSectionToLoop(W));break;case n.db.LINETYPE.CRITICAL_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"critical",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;case n.db.LINETYPE.BREAK_START:Jo(A,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W));break;case n.db.LINETYPE.BREAK_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"break",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;default:try{Y=P.msgModel,Y.starty=Tt.getVerticalPos(),Y.sequenceIndex=_,Y.sequenceVisible=n.db.showSequenceNumbers(),Y.id=P.id,Y.from=P.from,Y.to=P.to;const W=await eme(h,Y);ime(P,Y,W,z,d,f,p),O.push({messageModel:Y,lineStartY:W,msg:P}),Tt.models.addMessage(Y)}catch(W){ae.error("error while drawing message",W)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(P.type)&&(_=Math.round((_+L)*100)/100),z++}ae.debug("createdActors",f),ae.debug("destroyedActors",p),await C$(h,d,m,!1,e,n,k);for(const P of O)await hct(h,P.messageModel,P.lineStartY,n,P.msg,e);Ye.mirrorActors&&await C$(h,d,m,!0,e,n,k),M.forEach(P=>Rn.drawBackgroundRect(h,P)),jge(h,d,m,Ye);for(const P of Tt.models.boxes){P.height=Tt.getVerticalPos()-P.y,Tt.insert(P.x,P.y,P.x+P.width,P.height);const G=Ye.boxMargin*2;P.startx=P.x-G,P.starty=P.y-G*.25,P.stopx=P.startx+P.width+2*G,P.stopy=P.starty+P.height+G*.75,P.stroke="rgb(0,0,0, 0.5)",Rn.drawBox(h,P,Ye)}T&&Tt.bumpVerticalPos(Ye.boxMargin);const F=tme(h,d,m,u),{bounds:S}=Tt.getBounds();S.startx===void 0&&(S.startx=0),S.starty===void 0&&(S.starty=0),S.stopx===void 0&&(S.stopx=0),S.stopy===void 0&&(S.stopy=0);let R=S.stopy-S.starty;R{const s=t0(Ye);let o=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=Ye.boxMargin*8;o+=l,o-=2*Ye.boxTextMargin,a.wrap&&(a.name=Lr.wrapLabel(a.name,o-2*Ye.wrapPadding,s));const u=Lr.calculateTextDimensions(a.name,s);i=Lt.getMax(u.height,i);const h=Lt.getMax(o,u.width+2*Ye.wrapPadding);if(a.margin=Ye.boxTextMargin,oa.textMaxHeight=i),Lt.getMax(n,Ye.height)}x(sme,"calculateActorMargins");var gct=x(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,s=i.x,o=t.wrap&&t.message;let l=ui(t.message)?await h2(t.message,Pe()):Lr.calculateTextDimensions(o?Lr.wrapLabel(t.message,Ye.width,tm(Ye)):t.message,tm(Ye));const u={width:o?Ye.width:Lt.getMax(Ye.width,l.width+2*Ye.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=o?Lt.getMax(Ye.width,l.width):Lt.getMax(n.width/2+i.width/2,l.width+2*Ye.noteMargin),u.startx=a+(n.width+Ye.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?Lt.getMax(Ye.width,l.width+2*Ye.noteMargin):Lt.getMax(n.width/2+i.width/2,l.width+2*Ye.noteMargin),u.startx=a-u.width+(n.width-Ye.actorMargin)/2):t.to===t.from?(l=Lr.calculateTextDimensions(o?Lr.wrapLabel(t.message,Lt.getMax(Ye.width,n.width),tm(Ye)):t.message,tm(Ye)),u.width=o?Lt.getMax(Ye.width,n.width):Lt.getMax(n.width,Ye.width,l.width+2*Ye.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(s+i.width/2))+Ye.actorMargin,u.startx=a2,f=x(y=>l?-y:y,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(Ye.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(h+=f(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=f(3)));const p=[i,a,s,o],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=Lr.wrapLabel(t.message,Lt.getMax(g+2*Ye.wrapPadding,Ye.width),t0(Ye)));const m=Lr.calculateTextDimensions(t.message,t0(Ye));return{width:Lt.getMax(t.wrap?0:m.width+2*Ye.wrapPadding,g+2*Ye.wrapPadding,Ye.width),height:0,startx:u,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),xct=x(async function(t,e,r,n){const i={},a=[];let s,o,l;for(const u of t){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(s=a.pop(),i[s.id]=s,i[u.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=SS(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*Ye.activationWidth/2,g={startx:p,stopx:p+Ye.activationWidth,actor:u.from,enabled:!0};Tt.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=Tt.activations.map(f=>f.actor).lastIndexOf(u.from);Tt.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await gct(u,e,n),u.noteModel=o,a.forEach(d=>{s=d,s.from=Lt.getMin(s.from,o.startx),s.to=Lt.getMax(s.to,o.startx+o.width),s.width=Lt.getMax(s.width,Math.abs(s.from-s.to))-Ye.labelBoxWidth})):(l=bct(u,e,n),u.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(d=>{if(s=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);s.from=Lt.getMin(f.x-l.width/2,f.x-f.width/2,s.from),s.to=Lt.getMax(p.x+l.width/2,p.x+f.width/2,s.to),s.width=Lt.getMax(s.width,Math.abs(s.to-s.from))-Ye.labelBoxWidth}else s.from=Lt.getMin(l.startx,s.from),s.to=Lt.getMax(l.stopx,s.to),s.width=Lt.getMax(s.width,l.width)-Ye.labelBoxWidth}))}return Tt.activations=[],ae.debug("Loop type widths:",i),i},"calculateLoopBounds"),Tct={bounds:Tt,drawActors:C$,drawActorsPopup:tme,setConf:rme,draw:fct},wct={parser:Rlt,get db(){return new Mlt},renderer:Tct,styles:Olt,init:x(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,O6({sequence:{wrap:t.wrap}}))},"init")};const Cct=Object.freeze(Object.defineProperty({__proto__:null,diagram:wct},Symbol.toStringTag,{value:"Module"}));var E$=(function(){var t=x(function(tt,je,Ce,Se){for(Ce=Ce||{},Se=tt.length;Se--;Ce[tt[Se]]=je);return Ce},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,26],s=[1,42],o=[1,24],l=[1,25],u=[1,32],h=[1,33],d=[1,34],f=[1,45],p=[1,35],g=[1,36],m=[1,37],y=[1,38],v=[1,27],T=[1,28],b=[1,29],w=[1,30],k=[1,31],A=[1,44],C=[1,46],_=[1,43],L=[1,47],O=[1,9],M=[1,8,9],z=[1,58],F=[1,59],S=[1,60],R=[1,61],N=[1,62],D=[1,63],I=[1,64],$=[1,8,9,41],B=[1,77],P=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],G=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],V=[13,60,86,100,102,103],Y=[13,60,73,74,86,100,102,103],W=[13,60,68,69,70,71,72,86,100,102,103],ie=[1,103],K=[1,121],se=[1,117],J=[1,113],Z=[1,119],ee=[1,114],ne=[1,115],ue=[1,116],fe=[1,118],_e=[1,120],Ae=[22,50,60,61,82,86,87,88,89,90],Ne=[1,128],me=[12,39],ve=[1,8,9,39,41,44,46],Ge=[1,8,9,22],Te=[1,153],Ze=[1,8,9,61],ke=[1,8,9,22,50,60,61,82,86,87,88,89,90],Ve={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:x(function(je,Ce,Se,H,he,j,pe){var re=j.length-1;switch(he){case 8:this.$=j[re-1];break;case 9:case 10:case 13:case 15:this.$=j[re];break;case 11:case 14:this.$=j[re-2]+"."+j[re];break;case 12:case 16:this.$=j[re-1]+j[re];break;case 17:case 18:this.$=j[re-1]+"~"+j[re]+"~";break;case 19:H.addRelation(j[re]);break;case 20:j[re-1].title=H.cleanupLabel(j[re]),H.addRelation(j[re-1]);break;case 31:this.$=j[re].trim(),H.setAccTitle(this.$);break;case 32:case 33:this.$=j[re].trim(),H.setAccDescription(this.$);break;case 34:H.addClassesToNamespace(j[re-3],j[re-1][0],j[re-1][1]),H.popNamespace();break;case 35:H.addClassesToNamespace(j[re-4],j[re-1][0],j[re-1][1]),H.popNamespace();break;case 36:this.$=H.addNamespace(j[re]);break;case 37:this.$=H.addNamespace(j[re-1],j[re]);break;case 38:this.$=[[j[re]],[]];break;case 39:this.$=[[j[re-1]],[]];break;case 40:j[re][0].unshift(j[re-2]),this.$=j[re];break;case 41:this.$=[[],[j[re]]];break;case 42:this.$=[[],[j[re-1]]];break;case 43:j[re][1].unshift(j[re-2]),this.$=j[re];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=j[re];break;case 48:H.setCssClass(j[re-2],j[re]);break;case 49:H.addMembers(j[re-3],j[re-1]);break;case 51:H.setCssClass(j[re-5],j[re-3]),H.addMembers(j[re-5],j[re-1]);break;case 52:H.addAnnotation(j[re-3],j[re-1]);break;case 53:H.addAnnotation(j[re-6],j[re-4]),H.addMembers(j[re-6],j[re-1]);break;case 54:H.addAnnotation(j[re-5],j[re-3]);break;case 55:this.$=j[re],H.addClass(j[re]);break;case 56:this.$=j[re-1],H.addClass(j[re-1]),H.setClassLabel(j[re-1],j[re]);break;case 60:H.addAnnotation(j[re],j[re-2]);break;case 61:case 74:this.$=[j[re]];break;case 62:j[re].push(j[re-1]),this.$=j[re];break;case 63:break;case 64:H.addMember(j[re-1],H.cleanupLabel(j[re]));break;case 65:break;case 66:break;case 67:this.$={id1:j[re-2],id2:j[re],relation:j[re-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:j[re-3],id2:j[re],relation:j[re-1],relationTitle1:j[re-2],relationTitle2:"none"};break;case 69:this.$={id1:j[re-3],id2:j[re],relation:j[re-2],relationTitle1:"none",relationTitle2:j[re-1]};break;case 70:this.$={id1:j[re-4],id2:j[re],relation:j[re-2],relationTitle1:j[re-3],relationTitle2:j[re-1]};break;case 71:this.$=H.addNote(j[re],j[re-1]);break;case 72:this.$=H.addNote(j[re]);break;case 73:this.$=j[re-2],H.defineClass(j[re-1],j[re]);break;case 75:this.$=j[re-2].concat([j[re]]);break;case 76:H.setDirection("TB");break;case 77:H.setDirection("BT");break;case 78:H.setDirection("RL");break;case 79:H.setDirection("LR");break;case 80:this.$={type1:j[re-2],type2:j[re],lineType:j[re-1]};break;case 81:this.$={type1:"none",type2:j[re],lineType:j[re-1]};break;case 82:this.$={type1:j[re-1],type2:"none",lineType:j[re]};break;case 83:this.$={type1:"none",type2:"none",lineType:j[re]};break;case 84:this.$=H.relationType.AGGREGATION;break;case 85:this.$=H.relationType.EXTENSION;break;case 86:this.$=H.relationType.COMPOSITION;break;case 87:this.$=H.relationType.DEPENDENCY;break;case 88:this.$=H.relationType.LOLLIPOP;break;case 89:this.$=H.lineType.LINE;break;case 90:this.$=H.lineType.DOTTED_LINE;break;case 91:case 97:this.$=j[re-2],H.setClickEvent(j[re-1],j[re]);break;case 92:case 98:this.$=j[re-3],H.setClickEvent(j[re-2],j[re-1]),H.setTooltip(j[re-2],j[re]);break;case 93:this.$=j[re-2],H.setLink(j[re-1],j[re]);break;case 94:this.$=j[re-3],H.setLink(j[re-2],j[re-1],j[re]);break;case 95:this.$=j[re-3],H.setLink(j[re-2],j[re-1]),H.setTooltip(j[re-2],j[re]);break;case 96:this.$=j[re-4],H.setLink(j[re-3],j[re-2],j[re]),H.setTooltip(j[re-3],j[re-1]);break;case 99:this.$=j[re-3],H.setClickEvent(j[re-2],j[re-1],j[re]);break;case 100:this.$=j[re-4],H.setClickEvent(j[re-3],j[re-2],j[re-1]),H.setTooltip(j[re-3],j[re]);break;case 101:this.$=j[re-3],H.setLink(j[re-2],j[re]);break;case 102:this.$=j[re-4],H.setLink(j[re-3],j[re-1],j[re]);break;case 103:this.$=j[re-4],H.setLink(j[re-3],j[re-1]),H.setTooltip(j[re-3],j[re]);break;case 104:this.$=j[re-5],H.setLink(j[re-4],j[re-2],j[re]),H.setTooltip(j[re-4],j[re-1]);break;case 105:this.$=j[re-2],H.setCssStyle(j[re-1],j[re]);break;case 106:H.setCssClass(j[re-1],j[re]);break;case 107:this.$=[j[re]];break;case 108:j[re-2].push(j[re]),this.$=j[re-2];break;case 110:this.$=j[re-1]+j[re];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:w,83:k,86:A,100:C,102:_,103:L},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(O,[2,5],{8:[1,48]}),{8:[1,49]},t(M,[2,19],{22:[1,50]}),t(M,[2,21]),t(M,[2,22]),t(M,[2,23]),t(M,[2,24]),t(M,[2,25]),t(M,[2,26]),t(M,[2,27]),t(M,[2,28]),t(M,[2,29]),t(M,[2,30]),{34:[1,51]},{36:[1,52]},t(M,[2,33]),t(M,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:z,69:F,70:S,71:R,72:N,73:D,74:I}),{39:[1,65]},t($,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(M,[2,65]),t(M,[2,66]),{16:69,60:f,86:A,100:C,102:_},{16:39,17:40,19:70,60:f,86:A,100:C,102:_,103:L},{16:39,17:40,19:71,60:f,86:A,100:C,102:_,103:L},{16:39,17:40,19:72,60:f,86:A,100:C,102:_,103:L},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:A,100:C,102:_,103:L},{13:B,55:76},{58:78,60:[1,79]},t(M,[2,76]),t(M,[2,77]),t(M,[2,78]),t(M,[2,79]),t(P,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:A,100:C,102:_,103:L}),t(P,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:A,100:C,102:_,103:L},{16:39,17:40,19:87,60:f,86:A,100:C,102:_,103:L},t(G,[2,133]),t(G,[2,134]),t(G,[2,135]),t(G,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(O,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:e,35:r,37:n,42:i,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:w,83:k,86:A,100:C,102:_,103:L}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:w,83:k,86:A,100:C,102:_,103:L},t(M,[2,20]),t(M,[2,31]),t(M,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:A,100:C,102:_,103:L},{53:92,66:56,67:57,68:z,69:F,70:S,71:R,72:N,73:D,74:I},t(M,[2,64]),{67:93,73:D,74:I},t(V,[2,83],{66:94,68:z,69:F,70:S,71:R,72:N}),t(Y,[2,84]),t(Y,[2,85]),t(Y,[2,86]),t(Y,[2,87]),t(Y,[2,88]),t(W,[2,89]),t(W,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:s,54:u,56:h},{16:100,60:f,86:A,100:C,102:_},{41:[1,102],45:101,51:ie},{16:104,60:f,86:A,100:C,102:_},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:K,50:se,59:110,60:J,82:Z,84:111,85:112,86:ee,87:ne,88:ue,89:fe,90:_e},{60:[1,122]},{13:B,55:123},t($,[2,72]),t($,[2,138]),{22:K,50:se,59:124,60:J,61:[1,125],82:Z,84:111,85:112,86:ee,87:ne,88:ue,89:fe,90:_e},t(Ae,[2,74]),{16:39,17:40,19:126,60:f,86:A,100:C,102:_,103:L},t(P,[2,16]),t(P,[2,17]),t(P,[2,18]),{11:127,12:Ne,39:[2,36]},t(me,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:A,100:C,102:_,103:L}),t(me,[2,10]),t(ve,[2,55],{11:131,12:Ne}),t(O,[2,7]),{9:[1,132]},t(Ge,[2,67]),{16:39,17:40,19:133,60:f,86:A,100:C,102:_,103:L},{13:[1,135],16:39,17:40,19:134,60:f,86:A,100:C,102:_,103:L},t(V,[2,82],{66:136,68:z,69:F,70:S,71:R,72:N}),t(V,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:s,54:u,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t($,[2,48],{39:[1,142]}),{41:[1,143]},t($,[2,50]),{41:[2,61],45:144,51:ie},{47:[1,145]},{16:39,17:40,19:146,60:f,86:A,100:C,102:_,103:L},t(M,[2,91],{13:[1,147]}),t(M,[2,93],{13:[1,149],77:[1,148]}),t(M,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(M,[2,105],{61:Te}),t(Ze,[2,107],{85:154,22:K,50:se,60:J,82:Z,86:ee,87:ne,88:ue,89:fe,90:_e}),t(ke,[2,109]),t(ke,[2,111]),t(ke,[2,112]),t(ke,[2,113]),t(ke,[2,114]),t(ke,[2,115]),t(ke,[2,116]),t(ke,[2,117]),t(ke,[2,118]),t(ke,[2,119]),t(M,[2,106]),t($,[2,71]),t(M,[2,73],{61:Te}),{60:[1,155]},t(P,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:A,100:C,102:_,103:L},t(me,[2,12]),t(ve,[2,56]),{1:[2,4]},t(Ge,[2,69]),t(Ge,[2,68]),{16:39,17:40,19:158,60:f,86:A,100:C,102:_,103:L},t(V,[2,80]),t($,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:s,54:u,56:h},{45:163,51:ie},t($,[2,49]),{41:[2,62]},t($,[2,52],{39:[1,164]}),t(M,[2,60]),t(M,[2,92]),t(M,[2,94]),t(M,[2,95],{77:[1,165]}),t(M,[2,98]),t(M,[2,99],{13:[1,166]}),t(M,[2,101],{13:[1,168],77:[1,167]}),{22:K,50:se,60:J,82:Z,84:169,85:112,86:ee,87:ne,88:ue,89:fe,90:_e},t(ke,[2,110]),t(Ae,[2,75]),{14:[1,170]},t(me,[2,11]),t(Ge,[2,70]),t($,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ie},t(M,[2,96]),t(M,[2,100]),t(M,[2,102]),t(M,[2,103],{77:[1,174]}),t(Ze,[2,108],{85:154,22:K,50:se,60:J,82:Z,86:ee,87:ne,88:ue,89:fe,90:_e}),t(ve,[2,8]),t($,[2,51]),{41:[1,175]},t($,[2,54]),t(M,[2,104]),t($,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:x(function(je,Ce){if(Ce.recoverable)this.trace(je);else{var Se=new Error(je);throw Se.hash=Ce,Se}},"parseError"),parse:x(function(je){var Ce=this,Se=[0],H=[],he=[null],j=[],pe=this.table,re="",Be=0,xe=0,Ue=2,De=1,qe=j.slice.call(arguments,1),Le=Object.create(this.lexer),Xe={yy:{}};for(var Ie in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ie)&&(Xe.yy[Ie]=this.yy[Ie]);Le.setInput(je,Xe.yy),Xe.yy.lexer=Le,Xe.yy.parser=this,typeof Le.yylloc>"u"&&(Le.yylloc={});var it=Le.yylloc;j.push(it);var we=Le.options&&Le.options.ranges;typeof Xe.yy.parseError=="function"?this.parseError=Xe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function lt(wt){Se.length=Se.length-2*wt,he.length=he.length-wt,j.length=j.length-wt}x(lt,"popStack");function be(){var wt;return wt=H.pop()||Le.lex()||De,typeof wt!="number"&&(wt instanceof Array&&(H=wt,wt=H.pop()),wt=Ce.symbols_[wt]||wt),wt}x(be,"lex");for(var Et,vt,ot,It,xt={},ht,oe,At,dt;;){if(vt=Se[Se.length-1],this.defaultActions[vt]?ot=this.defaultActions[vt]:((Et===null||typeof Et>"u")&&(Et=be()),ot=pe[vt]&&pe[vt][Et]),typeof ot>"u"||!ot.length||!ot[0]){var ut="";dt=[];for(ht in pe[vt])this.terminals_[ht]&&ht>Ue&&dt.push("'"+this.terminals_[ht]+"'");Le.showPosition?ut="Parse error on line "+(Be+1)+`: +`;S.append("path").attr("d",C),h==="neo"&&S.attr("filter","url(#drop-shadow)");const _=i.get(e.name)??0;fu.has(l)?(S.style("stroke",f[_%f.length]),S.style("fill",d[_%f.length])):S.style("stroke",p),S.attr("transform",`translate(${x}, ${k})`),e.rectData=y,pu(r,ui(e.description))(e.description,m,y.x,y.y+35,y.width,y.height,{class:`actor ${SS}`},r);const L=S.select("path:last-child");if(L.node()){const M=L.node().getBBox();e.height=M.height+(r.sequence.labelBoxHeight??0)}return n||(m.attr("data-et","participant"),m.attr("data-type","database"),m.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),rct=T(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(Vr++,u.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Vr);const y=t.append("g");let v=ep;n?v+=` ${Dh}`:v+=` ${Ih}`,y.attr("class",v),y.attr("name",e.name);const x=Ys();x.x=e.x,x.y=a,x.fill="#eaeaea",x.width=e.width,x.height=e.height,x.class="actor",y.append("line").attr("id","actor-man-torso"+Vr).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+12).attr("x2",e.x+e.width/2-15).attr("y2",a+12),y.append("line").attr("id","actor-man-arms"+Vr).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+2).attr("x2",e.x+e.width/2-l*2.5).attr("y2",a+22),y.append("circle").attr("cx",e.x+e.width/2).attr("cy",a+12).attr("r",l),h==="neo"&&y.attr("filter","url(#drop-shadow)");const b=i.get(e.name)??0;fu.has(d)?(y.style("stroke",g[b%g.length]),y.style("fill",p[b%g.length])):y.style("stroke",m);const w=y.node().getBBox();return e.height=w.height+(r.sequence.labelBoxHeight??0),pu(r,ui(e.description))(e.description,y,x.x,x.y+15,x.width,x.height,{class:`actor ${ep}`},r),y.attr("transform",`translate(0,${l/2+10})`),n||(y.attr("data-et","participant"),y.attr("data-type","boundary"),y.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),nct=T(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(Vr++,g.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Vr);const m=t.append("g");let y=ep;n?y+=` ${Dh}`:y+=` ${Ih}`,m.attr("class",y),m.attr("name",e.name),n||m.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const v=l==="neo"?.5:1,x=l==="neo"?a+(1-v)*30:a;m.append("line").attr("id","actor-man-torso"+Vr).attr("x1",s).attr("y1",x+25*v).attr("x2",s).attr("y2",x+45*v),m.append("line").attr("id","actor-man-arms"+Vr).attr("x1",s-Jf/2*v).attr("y1",x+33*v).attr("x2",s+Jf/2*v).attr("y2",x+33*v),m.append("line").attr("x1",s-Jf/2*v).attr("y1",x+60*v).attr("x2",s).attr("y2",x+45*v),m.append("line").attr("x1",s).attr("y1",x+45*v).attr("x2",s+(Jf/2-2)*v).attr("y2",x+60*v);const b=m.append("circle");b.attr("cx",e.x+e.width/2),b.attr("cy",x+10*v),b.attr("r",15*v),b.attr("width",e.width*v),b.attr("height",e.height*v);const w=m.node().getBBox();e.height=w.height;const k=Ys();k.x=e.x,k.y=x,k.fill="#eaeaea",k.width=e.width,k.height=e.height/v,k.class="actor",k.rx=3,k.ry=3;const S=i.get(e.name)??0;return fu.has(u)?(m.style("stroke",f[S%f.length]),m.style("fill",d[S%f.length])):m.style("stroke",p),pu(r,ui(e.description))(e.description,m,k.x,x+35*v-(l==="neo"?10:0),k.width,k.height,{class:`actor ${ep}`},r),e.height},"drawActorTypeActor"),ict=T(async function(t,e,r,n,i,a,s){const o=s??new Map([...a.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await nct(t,e,r,n,o);case"participant":return await jlt(t,e,r,n,o);case"boundary":return await rct(t,e,r,n,o);case"control":return await Jlt(t,e,r,n,i,o);case"entity":return await ect(t,e,r,n,o);case"database":return await tct(t,e,r,n,o);case"collections":return await Zlt(t,e,r,n,o);case"queue":return await Qlt(t,e,r,n,o)}},"drawActor"),act=T(function(t,e,r){const i=t.append("g");nme(i,e),e.name&&pu(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),sct=T(function(t){return t.append("g")},"anchorElement"),oct=T(function(t,e,r,n,i,a,s){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=Ys(),p=e.anchored,g=e.actor;f.x=e.startx,f.y=e.starty,f.class="activation"+i%3,f.width=e.stopx-e.startx,f.height=r-e.starty;const m=jT(p,f),v=(s??new Map([...a.db.getActors().values()].map((x,b)=>[x.name,b]))).get(g)??0;fu.has(o)&&(m.style("stroke",h[v%h.length]),m.style("fill",u[v%h.length]??d))},"drawActivation"),lct=T(async function(t,e,r,n,i){const{boxMargin:a,boxTextMargin:s,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:d}=n,f=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),p=T(function(y,v,x,b){return f.append("line").attr("x1",y).attr("y1",v).attr("x2",x).attr("y2",b).attr("class","loopLine")},"drawLoopLine");p(e.startx,e.starty,e.stopx,e.starty),p(e.stopx,e.starty,e.stopx,e.stopy),p(e.startx,e.stopy,e.stopx,e.stopy),p(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(y){p(e.startx,y.y,e.stopx,y.y).style("stroke-dasharray","3, 3")});let g=mI();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(l??0,50),g.height=o+(n.look==="neo"?15:0)||20,g.textMargin=s,g.class="labelText",tme(f,g),g=ime(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+a+s,g.anchor="middle",g.valign="middle",g.textMargin=s,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=ui(g.text)?await _S(f,g,e):tm(f,g);if(e.sectionTitles!==void 0){for(const[y,v]of Object.entries(e.sectionTitles))if(v.message){g.text=v.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[y].y+a+s,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=e.wrap,ui(g.text)?(e.starty=e.sections[y].y,await _S(f,g,e)):tm(f,g);let x=Math.round(m.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,w)=>b+w));e.sections[y].height+=x-(a+s)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),nme=T(function(t,e){Ete(t,e)},"drawBackgroundRect"),cct=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),uct=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),hct=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),dct=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),fct=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),pct=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),gct=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),mct=T(function(t,e){const{theme:r}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),ime=T(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),yct=T(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),pu=(function(){function t(a,s,o,l,u,h,d){const f=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);i(f,d)}T(t,"byText");function e(a,s,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[y,v]=xc(p),x=a.split(Lt.lineBreakRegex);for(let b=0;bt.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:T(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:T(function(t){this.boxes.push(t)},"addBox"),addActor:T(function(t){this.actors.push(t)},"addActor"),addLoop:T(function(t){this.loops.push(t)},"addLoop"),addMessage:T(function(t){this.messages.push(t)},"addMessage"),addNote:T(function(t){this.notes.push(t)},"addNote"),lastActor:T(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:T(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:T(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:T(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:T(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,lme(Pe())},"init"),updateVal:T(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:T(function(t,e,r,n){const i=this;let a=0;function s(o){return T(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*Ye.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*Ye.boxMargin,Math.max),i.updateVal(Tt.data,"startx",t-h*Ye.boxMargin,Math.min),i.updateVal(Tt.data,"stopx",r+h*Ye.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*Ye.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*Ye.boxMargin,Math.max),i.updateVal(Tt.data,"starty",e-h*Ye.boxMargin,Math.min),i.updateVal(Tt.data,"stopy",n+h*Ye.boxMargin,Math.max))},"updateItemBounds")}T(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:T(function(t,e,r,n){const i=Lt.getMin(t,r),a=Lt.getMax(t,r),s=Lt.getMin(e,n),o=Lt.getMax(e,n);this.updateVal(Tt.data,"startx",i,Math.min),this.updateVal(Tt.data,"starty",s,Math.min),this.updateVal(Tt.data,"stopx",a,Math.max),this.updateVal(Tt.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),newActivation:T(function(t,e,r){const n=r.get(t.from),i=RS(t.from).length||0,a=n.x+n.width/2+(i-1)*Ye.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Ye.activationWidth,stopy:void 0,actor:t.from,anchored:Rn.anchorElement(e)})},"newActivation"),endActivation:T(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:T(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:T(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:T(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:T(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:T(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Tt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:T(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:T(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:T(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=Lt.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:T(function(){return this.verticalPos},"getVerticalPos"),getBounds:T(function(){return{bounds:this.data,models:this.models}},"getBounds")},Cct=T(async function(t,e,r){Tt.bumpVerticalPos(Ye.boxMargin),e.height=Ye.boxMargin,e.starty=Tt.getVerticalPos();const n=Ys();n.x=e.startx,n.y=e.starty,n.width=e.width||Ye.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=Rn.drawRect(i,n),s=mI();s.x=e.startx,s.y=e.starty,s.width=n.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=Ye.noteFontFamily,s.fontSize=Ye.noteFontSize,s.fontWeight=Ye.noteFontWeight,s.anchor=Ye.noteAlign,s.textMargin=Ye.noteMargin,s.valign="center";const o=ui(s.text)?await _S(i,s):tm(i,s),l=Math.round(o.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));a.attr("height",l+2*Ye.noteMargin),e.height+=l+2*Ye.noteMargin,Tt.bumpVerticalPos(l+2*Ye.noteMargin),e.stopy=e.starty+l+2*Ye.noteMargin,e.stopx=e.startx+n.width,Tt.insert(e.startx,e.starty,e.stopx,e.stopy),Tt.models.addNote(e)},"drawNote"),ame=T(function(t,e,r,n,i,a,s){const o=n.db.getActors(),l=o.get(e.from),u=o.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=fme(e,n),m=t.append("g"),y=16.5,v=T((S,C)=>{const _=S?y:-y;return C?-_:_},"getCircleOffset"),x=T(S=>{m.append("circle").attr("cx",S).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:w,CENTRAL_CONNECTION_DUAL:k}=n.db.LINETYPE;if(h)switch(e.centralConnection){case b:g&&(f+=v(p,!0));break;case w:g||(d+=v(p,!1));break;case k:g?f+=v(p,!0):d+=v(p,!1);break}switch(e.centralConnection){case b:x(f);break;case w:x(d);break;case k:x(d),x(f);break}},"drawCentralConnection"),tp=T(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),rm=T(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),A$=T(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function sme(t,e){Tt.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=Lt.splitBreaks(i).length,s=ui(i),o=s?await d2(i,Pe()):Lr.calculateTextDimensions(i,tp(Ye));if(!s){const d=o.height/a;e.height+=d,Tt.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=Tt.getVerticalPos()+u,Ye.rightAngles||(u+=Ye.boxMargin,l=Tt.getVerticalPos()+u),u+=30;const d=Lt.getMax(h/2,Ye.width/2);Tt.insert(r-d,Tt.getVerticalPos()-10+u,n+d,Tt.getVerticalPos()+30+u)}else u+=Ye.boxMargin,l=Tt.getVerticalPos()+u,Tt.insert(r,l-10,n,l);return Tt.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,Tt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}T(sme,"boundMessage");var kct=T(async function(t,e,r,n,i,a){const{startx:s,stopx:o,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=Lr.calculateTextDimensions(u,tp(Ye)),g=mI();g.x=Math.min(s,o),g.y=l+10,g.width=Math.abs(o-s),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=Ye.messageFontFamily,g.fontSize=Ye.messageFontSize,g.fontWeight=Ye.messageFontWeight,g.anchor=Ye.messageAlign,g.valign="center",g.textMargin=Ye.wrapPadding,g.tspan=!1,ui(g.text)?await _S(t,g,{startx:s,stopx:o,starty:r}):tm(t,g);const m=p.width;let y;if(s===o){const x=f||Ye.showSequenceNumbers,b=fme(i,n),w=Ict(i,n),k=s+(x&&(b||w)?10:0);Ye.rightAngles?y=t.append("path").attr("d",`M ${k},${r} H ${s+Lt.getMax(Ye.width/2,m/2)} V ${r+25} H ${s}`):y=t.append("path").attr("d","M "+k+","+r+" C "+(k+60)+","+(r-10)+" "+(s+60)+","+(r+30)+" "+s+","+(r+20)),R$(i,n)&&ame(t,i,e,n,s,o,r)}else y=t.append("line"),y.attr("x1",s),y.attr("y1",r),y.attr("x2",o),y.attr("y2",r),R$(i,n)&&ame(t,i,e,n,s,o,r);h===n.db.LINETYPE.DOTTED||h===n.db.LINETYPE.DOTTED_CROSS||h===n.db.LINETYPE.DOTTED_POINT||h===n.db.LINETYPE.DOTTED_OPEN||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===n.db.LINETYPE.SOLID_TOP_DOTTED||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===n.db.LINETYPE.STICK_TOP_DOTTED||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style("stroke-dasharray","3, 3"),y.attr("class","messageLine1")):y.attr("class","messageLine0"),y.attr("data-et","message"),y.attr("data-id","i"+e.id),y.attr("data-from",e.from),y.attr("data-to",e.to);let v="";if(Ye.arrowMarkerAbsolute&&(v=Rw(!0)),y.attr("stroke-width",2),y.attr("stroke","none"),y.style("fill","none"),(h===n.db.LINETYPE.SOLID_TOP||h===n.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.SOLID_BOTTOM||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.STICK_TOP||h===n.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.STICK_BOTTOM||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.SOLID||h===n.db.LINETYPE.DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-arrowhead)"),(h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr("marker-start","url("+v+"#"+a+"-arrowhead)"),y.attr("marker-end","url("+v+"#"+a+"-arrowhead)")),(h===n.db.LINETYPE.SOLID_POINT||h===n.db.LINETYPE.DOTTED_POINT)&&y.attr("marker-end","url("+v+"#"+a+"-filled-head)"),(h===n.db.LINETYPE.SOLID_CROSS||h===n.db.LINETYPE.DOTTED_CROSS)&&y.attr("marker-end","url("+v+"#"+a+"-crosshead)"),f||Ye.showSequenceNumbers){const x=h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,b=h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,w=6,k=R$(i,n);let S=s,C=o;x?(ss?C=o-2*w:(C=o-w,S+=(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),C+=k?15:0,y.attr("x2",C),y.attr("x1",S)):y.attr("x1",s+w);let _=0;const L=s===o,O=s<=o;L?_=e.fromBounds+1:b?_=O?e.toBounds-1:e.fromBounds+1:_=O?e.fromBounds+1:e.toBounds-1;let M="12px";const z=d.toString().length;z>5?M="7px":z>3&&(M="9px"),t.append("line").attr("x1",_).attr("y1",r).attr("x2",_).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+v+"#"+a+"-sequencenumber)"),t.append("text").attr("x",_).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",M).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),Ect=T(function(t,e,r,n,i,a,s){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(s||Tt.models.addBox(u),l+=Ye.boxMargin+u.margin),p&&p!=u&&(s||(p.x=o+l,p.y=i),l+=p.margin),f.width=Lt.getMax(f.width||Ye.width,Ye.width),f.height=Lt.getMax(f.height||Ye.height,Ye.height),f.margin=f.margin||Ye.actorMargin,h=Lt.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=Tt.getVerticalPos(),Tt.insert(f.x,i,f.x+f.width,f.height),o+=f.width+l,f.box&&(f.box.width=o+p.margin-f.box.x),l=f.margin,u=f.box,Tt.models.addActor(f)}u&&!s&&Tt.models.addBox(u),Tt.bumpVerticalPos(h)},"addActorRenderingData"),_$=T(async function(t,e,r,n,i,a,s){if(n){let o=0;Tt.bumpVerticalPos(Ye.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=Tt.getVerticalPos());const h=await Rn.drawActor(t,u,Ye,!0,i,a,s);o=Lt.getMax(o,h)}Tt.bumpVerticalPos(o+Ye.boxMargin)}else for(const o of r){const l=e.get(o);await Rn.drawActor(t,l,Ye,!1,i,a,s)}},"drawActors"),ome=T(function(t,e,r,n){let i=0,a=0;for(const s of r){const o=e.get(s),l=Act(o),u=Rn.drawPopup(t,o,l,Ye,Ye.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>a&&(a=u.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),lme=T(function(t){ci(Ye,t),t.fontFamily&&(Ye.actorFontFamily=Ye.noteFontFamily=Ye.messageFontFamily=t.fontFamily),t.fontSize&&(Ye.actorFontSize=Ye.noteFontSize=Ye.messageFontSize=t.fontSize),t.fontWeight&&(Ye.actorFontWeight=Ye.noteFontWeight=Ye.messageFontWeight=t.fontWeight)},"setConf"),RS=T(function(t){return Tt.activations.filter(function(e){return e.actor===t})},"actorActivations"),cme=T(function(t,e){const r=e.get(t),n=RS(t),i=n.reduce(function(s,o){return Lt.getMin(s,o.startx)},r.x+r.width/2-1),a=n.reduce(function(s,o){return Lt.getMax(s,o.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function Jo(t,e,r,n,i){Tt.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,o=tp(Ye);e.message=Lr.wrapLabel(`[${e.message}]`,s-2*Ye.wrapPadding,o),e.width=s,e.wrap=!0;const l=Lr.calculateTextDimensions(e.message,o),u=Lt.getMax(l.height,Ye.labelBoxHeight);a=n+u,ae.debug(`${u} - ${e.message}`)}i(e),Tt.bumpVerticalPos(a)}T(Jo,"adjustLoopHeightForWrap");function ume(t,e,r,n,i,a,s){function o(h,d){h.x{P.add(G.from),P.add(G.to)}),m=m.filter(G=>P.has(G))}const k=new Map(m.map((P,G)=>{var V;return[((V=d.get(P))==null?void 0:V.name)??P,G]}));Ect(h,d,f,m,0,y,!1);const S=await Mct(y,d,w,n);Rn.insertArrowHead(h,e),Rn.insertArrowCrossHead(h,e),Rn.insertArrowFilledHead(h,e),Rn.insertSequenceNumber(h,e),Rn.insertSolidTopArrowHead(h,e),Rn.insertSolidBottomArrowHead(h,e),Rn.insertStickTopArrowHead(h,e),Rn.insertStickBottomArrowHead(h,e),s==="neo"&&Rn.insertDropShadow(h,Ye);function C(P,G){const V=Tt.endActivation(P);V.starty+18>G&&(V.starty=G-6,G+=12),Rn.drawActivation(h,V,G,Ye,RS(P.from).length,n,k),Tt.insert(V.startx,G-10,V.stopx,G)}T(C,"activeEnd");let _=1,L=1;const O=[],M=[];let z=0;for(const P of y){let G,V,X;switch(P.type){case n.db.LINETYPE.NOTE:Tt.resetVerticalPos(),V=P.noteModel,await Cct(h,V,P.id);break;case n.db.LINETYPE.ACTIVE_START:Tt.newActivation(P,h,d);break;case n.db.LINETYPE.CENTRAL_CONNECTION:Tt.newActivation(P,h,d);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Tt.newActivation(P,h,d);break;case n.db.LINETYPE.ACTIVE_END:C(P,Tt.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:Jo(S,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W));break;case n.db.LINETYPE.LOOP_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"loop",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;case n.db.LINETYPE.RECT_START:Jo(S,P,Ye.boxMargin,Ye.boxMargin,W=>Tt.newLoop(void 0,W.message));break;case n.db.LINETYPE.RECT_END:G=Tt.endLoop(),M.push(G),Tt.models.addLoop(G),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos());break;case n.db.LINETYPE.OPT_START:Jo(S,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W));break;case n.db.LINETYPE.OPT_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"opt",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;case n.db.LINETYPE.ALT_START:Jo(S,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W));break;case n.db.LINETYPE.ALT_ELSE:Jo(S,P,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,W=>Tt.addSectionToLoop(W));break;case n.db.LINETYPE.ALT_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"alt",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:Jo(S,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W)),Tt.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:Jo(S,P,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,W=>Tt.addSectionToLoop(W));break;case n.db.LINETYPE.PAR_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"par",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;case n.db.LINETYPE.AUTONUMBER:_=P.message.start||_,L=P.message.step||L,P.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:Jo(S,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W));break;case n.db.LINETYPE.CRITICAL_OPTION:Jo(S,P,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,W=>Tt.addSectionToLoop(W));break;case n.db.LINETYPE.CRITICAL_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"critical",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;case n.db.LINETYPE.BREAK_START:Jo(S,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W));break;case n.db.LINETYPE.BREAK_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"break",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;default:try{X=P.msgModel,X.starty=Tt.getVerticalPos(),X.sequenceIndex=_,X.sequenceVisible=n.db.showSequenceNumbers(),X.id=P.id,X.from=P.from,X.to=P.to;const W=await sme(h,X);ume(P,X,W,z,d,f,p),O.push({messageModel:X,lineStartY:W,msg:P}),Tt.models.addMessage(X)}catch(W){ae.error("error while drawing message",W)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(P.type)&&(_=Math.round((_+L)*100)/100),z++}ae.debug("createdActors",f),ae.debug("destroyedActors",p),await _$(h,d,m,!1,e,n,k);for(const P of O)await kct(h,P.messageModel,P.lineStartY,n,P.msg,e);Ye.mirrorActors&&await _$(h,d,m,!0,e,n,k),M.forEach(P=>Rn.drawBackgroundRect(h,P)),rme(h,d,m,Ye);for(const P of Tt.models.boxes){P.height=Tt.getVerticalPos()-P.y,Tt.insert(P.x,P.y,P.x+P.width,P.height);const G=Ye.boxMargin*2;P.startx=P.x-G,P.starty=P.y-G*.25,P.stopx=P.startx+P.width+2*G,P.stopy=P.starty+P.height+G*.75,P.stroke="rgb(0,0,0, 0.5)",Rn.drawBox(h,P,Ye)}x&&Tt.bumpVerticalPos(Ye.boxMargin);const F=ome(h,d,m,u),{bounds:A}=Tt.getBounds();A.startx===void 0&&(A.startx=0),A.starty===void 0&&(A.starty=0),A.stopx===void 0&&(A.stopx=0),A.stopy===void 0&&(A.stopy=0);let R=A.stopy-A.starty;R{const s=tp(Ye);let o=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=Ye.boxMargin*8;o+=l,o-=2*Ye.boxTextMargin,a.wrap&&(a.name=Lr.wrapLabel(a.name,o-2*Ye.wrapPadding,s));const u=Lr.calculateTextDimensions(a.name,s);i=Lt.getMax(u.height,i);const h=Lt.getMax(o,u.width+2*Ye.wrapPadding);if(a.margin=Ye.boxTextMargin,oa.textMaxHeight=i),Lt.getMax(n,Ye.height)}T(dme,"calculateActorMargins");var _ct=T(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,s=i.x,o=t.wrap&&t.message;let l=ui(t.message)?await d2(t.message,Pe()):Lr.calculateTextDimensions(o?Lr.wrapLabel(t.message,Ye.width,rm(Ye)):t.message,rm(Ye));const u={width:o?Ye.width:Lt.getMax(Ye.width,l.width+2*Ye.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=o?Lt.getMax(Ye.width,l.width):Lt.getMax(n.width/2+i.width/2,l.width+2*Ye.noteMargin),u.startx=a+(n.width+Ye.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?Lt.getMax(Ye.width,l.width+2*Ye.noteMargin):Lt.getMax(n.width/2+i.width/2,l.width+2*Ye.noteMargin),u.startx=a-u.width+(n.width-Ye.actorMargin)/2):t.to===t.from?(l=Lr.calculateTextDimensions(o?Lr.wrapLabel(t.message,Lt.getMax(Ye.width,n.width),rm(Ye)):t.message,rm(Ye)),u.width=o?Lt.getMax(Ye.width,n.width):Lt.getMax(n.width,Ye.width,l.width+2*Ye.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(s+i.width/2))+Ye.actorMargin,u.startx=a2,f=T(y=>l?-y:y,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(Ye.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(h+=f(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=f(3)));const p=[i,a,s,o],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=Lr.wrapLabel(t.message,Lt.getMax(g+2*Ye.wrapPadding,Ye.width),tp(Ye)));const m=Lr.calculateTextDimensions(t.message,tp(Ye));return{width:Lt.getMax(t.wrap?0:m.width+2*Ye.wrapPadding,g+2*Ye.wrapPadding,Ye.width),height:0,startx:u,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),Mct=T(async function(t,e,r,n){const i={},a=[];let s,o,l;for(const u of t){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(s=a.pop(),i[s.id]=s,i[u.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=RS(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*Ye.activationWidth/2,g={startx:p,stopx:p+Ye.activationWidth,actor:u.from,enabled:!0};Tt.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=Tt.activations.map(f=>f.actor).lastIndexOf(u.from);Tt.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await _ct(u,e,n),u.noteModel=o,a.forEach(d=>{s=d,s.from=Lt.getMin(s.from,o.startx),s.to=Lt.getMax(s.to,o.startx+o.width),s.width=Lt.getMax(s.width,Math.abs(s.from-s.to))-Ye.labelBoxWidth})):(l=Dct(u,e,n),u.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(d=>{if(s=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);s.from=Lt.getMin(f.x-l.width/2,f.x-f.width/2,s.from),s.to=Lt.getMax(p.x+l.width/2,p.x+f.width/2,s.to),s.width=Lt.getMax(s.width,Math.abs(s.to-s.from))-Ye.labelBoxWidth}else s.from=Lt.getMin(l.startx,s.from),s.to=Lt.getMax(l.stopx,s.to),s.width=Lt.getMax(s.width,l.width)-Ye.labelBoxWidth}))}return Tt.activations=[],ae.debug("Loop type widths:",i),i},"calculateLoopBounds"),Nct={bounds:Tt,drawActors:_$,drawActorsPopup:ome,setConf:lme,draw:Sct},Oct={parser:qlt,get db(){return new Hlt},renderer:Nct,styles:Xlt,init:T(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,B6({sequence:{wrap:t.wrap}}))},"init")};const $ct=Object.freeze(Object.defineProperty({__proto__:null,diagram:Oct},Symbol.toStringTag,{value:"Module"}));var L$=(function(){var t=T(function(tt,je,Ce,Se){for(Ce=Ce||{},Se=tt.length;Se--;Ce[tt[Se]]=je);return Ce},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,26],s=[1,42],o=[1,24],l=[1,25],u=[1,32],h=[1,33],d=[1,34],f=[1,45],p=[1,35],g=[1,36],m=[1,37],y=[1,38],v=[1,27],x=[1,28],b=[1,29],w=[1,30],k=[1,31],S=[1,44],C=[1,46],_=[1,43],L=[1,47],O=[1,9],M=[1,8,9],z=[1,58],F=[1,59],A=[1,60],R=[1,61],N=[1,62],D=[1,63],I=[1,64],$=[1,8,9,41],B=[1,77],P=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],G=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],V=[13,60,86,100,102,103],X=[13,60,73,74,86,100,102,103],W=[13,60,68,69,70,71,72,86,100,102,103],ie=[1,103],K=[1,121],se=[1,117],J=[1,113],Z=[1,119],ee=[1,114],ne=[1,115],ue=[1,116],fe=[1,118],_e=[1,120],Ae=[22,50,60,61,82,86,87,88,89,90],Ne=[1,128],me=[12,39],ve=[1,8,9,39,41,44,46],Ge=[1,8,9,22],Te=[1,153],Ze=[1,8,9,61],ke=[1,8,9,22,50,60,61,82,86,87,88,89,90],Ve={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:T(function(je,Ce,Se,H,he,j,pe){var re=j.length-1;switch(he){case 8:this.$=j[re-1];break;case 9:case 10:case 13:case 15:this.$=j[re];break;case 11:case 14:this.$=j[re-2]+"."+j[re];break;case 12:case 16:this.$=j[re-1]+j[re];break;case 17:case 18:this.$=j[re-1]+"~"+j[re]+"~";break;case 19:H.addRelation(j[re]);break;case 20:j[re-1].title=H.cleanupLabel(j[re]),H.addRelation(j[re-1]);break;case 31:this.$=j[re].trim(),H.setAccTitle(this.$);break;case 32:case 33:this.$=j[re].trim(),H.setAccDescription(this.$);break;case 34:H.addClassesToNamespace(j[re-3],j[re-1][0],j[re-1][1]),H.popNamespace();break;case 35:H.addClassesToNamespace(j[re-4],j[re-1][0],j[re-1][1]),H.popNamespace();break;case 36:this.$=H.addNamespace(j[re]);break;case 37:this.$=H.addNamespace(j[re-1],j[re]);break;case 38:this.$=[[j[re]],[]];break;case 39:this.$=[[j[re-1]],[]];break;case 40:j[re][0].unshift(j[re-2]),this.$=j[re];break;case 41:this.$=[[],[j[re]]];break;case 42:this.$=[[],[j[re-1]]];break;case 43:j[re][1].unshift(j[re-2]),this.$=j[re];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=j[re];break;case 48:H.setCssClass(j[re-2],j[re]);break;case 49:H.addMembers(j[re-3],j[re-1]);break;case 51:H.setCssClass(j[re-5],j[re-3]),H.addMembers(j[re-5],j[re-1]);break;case 52:H.addAnnotation(j[re-3],j[re-1]);break;case 53:H.addAnnotation(j[re-6],j[re-4]),H.addMembers(j[re-6],j[re-1]);break;case 54:H.addAnnotation(j[re-5],j[re-3]);break;case 55:this.$=j[re],H.addClass(j[re]);break;case 56:this.$=j[re-1],H.addClass(j[re-1]),H.setClassLabel(j[re-1],j[re]);break;case 60:H.addAnnotation(j[re],j[re-2]);break;case 61:case 74:this.$=[j[re]];break;case 62:j[re].push(j[re-1]),this.$=j[re];break;case 63:break;case 64:H.addMember(j[re-1],H.cleanupLabel(j[re]));break;case 65:break;case 66:break;case 67:this.$={id1:j[re-2],id2:j[re],relation:j[re-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:j[re-3],id2:j[re],relation:j[re-1],relationTitle1:j[re-2],relationTitle2:"none"};break;case 69:this.$={id1:j[re-3],id2:j[re],relation:j[re-2],relationTitle1:"none",relationTitle2:j[re-1]};break;case 70:this.$={id1:j[re-4],id2:j[re],relation:j[re-2],relationTitle1:j[re-3],relationTitle2:j[re-1]};break;case 71:this.$=H.addNote(j[re],j[re-1]);break;case 72:this.$=H.addNote(j[re]);break;case 73:this.$=j[re-2],H.defineClass(j[re-1],j[re]);break;case 75:this.$=j[re-2].concat([j[re]]);break;case 76:H.setDirection("TB");break;case 77:H.setDirection("BT");break;case 78:H.setDirection("RL");break;case 79:H.setDirection("LR");break;case 80:this.$={type1:j[re-2],type2:j[re],lineType:j[re-1]};break;case 81:this.$={type1:"none",type2:j[re],lineType:j[re-1]};break;case 82:this.$={type1:j[re-1],type2:"none",lineType:j[re]};break;case 83:this.$={type1:"none",type2:"none",lineType:j[re]};break;case 84:this.$=H.relationType.AGGREGATION;break;case 85:this.$=H.relationType.EXTENSION;break;case 86:this.$=H.relationType.COMPOSITION;break;case 87:this.$=H.relationType.DEPENDENCY;break;case 88:this.$=H.relationType.LOLLIPOP;break;case 89:this.$=H.lineType.LINE;break;case 90:this.$=H.lineType.DOTTED_LINE;break;case 91:case 97:this.$=j[re-2],H.setClickEvent(j[re-1],j[re]);break;case 92:case 98:this.$=j[re-3],H.setClickEvent(j[re-2],j[re-1]),H.setTooltip(j[re-2],j[re]);break;case 93:this.$=j[re-2],H.setLink(j[re-1],j[re]);break;case 94:this.$=j[re-3],H.setLink(j[re-2],j[re-1],j[re]);break;case 95:this.$=j[re-3],H.setLink(j[re-2],j[re-1]),H.setTooltip(j[re-2],j[re]);break;case 96:this.$=j[re-4],H.setLink(j[re-3],j[re-2],j[re]),H.setTooltip(j[re-3],j[re-1]);break;case 99:this.$=j[re-3],H.setClickEvent(j[re-2],j[re-1],j[re]);break;case 100:this.$=j[re-4],H.setClickEvent(j[re-3],j[re-2],j[re-1]),H.setTooltip(j[re-3],j[re]);break;case 101:this.$=j[re-3],H.setLink(j[re-2],j[re]);break;case 102:this.$=j[re-4],H.setLink(j[re-3],j[re-1],j[re]);break;case 103:this.$=j[re-4],H.setLink(j[re-3],j[re-1]),H.setTooltip(j[re-3],j[re]);break;case 104:this.$=j[re-5],H.setLink(j[re-4],j[re-2],j[re]),H.setTooltip(j[re-4],j[re-1]);break;case 105:this.$=j[re-2],H.setCssStyle(j[re-1],j[re]);break;case 106:H.setCssClass(j[re-1],j[re]);break;case 107:this.$=[j[re]];break;case 108:j[re-2].push(j[re]),this.$=j[re-2];break;case 110:this.$=j[re-1]+j[re];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:x,78:b,82:w,83:k,86:S,100:C,102:_,103:L},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(O,[2,5],{8:[1,48]}),{8:[1,49]},t(M,[2,19],{22:[1,50]}),t(M,[2,21]),t(M,[2,22]),t(M,[2,23]),t(M,[2,24]),t(M,[2,25]),t(M,[2,26]),t(M,[2,27]),t(M,[2,28]),t(M,[2,29]),t(M,[2,30]),{34:[1,51]},{36:[1,52]},t(M,[2,33]),t(M,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:z,69:F,70:A,71:R,72:N,73:D,74:I}),{39:[1,65]},t($,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(M,[2,65]),t(M,[2,66]),{16:69,60:f,86:S,100:C,102:_},{16:39,17:40,19:70,60:f,86:S,100:C,102:_,103:L},{16:39,17:40,19:71,60:f,86:S,100:C,102:_,103:L},{16:39,17:40,19:72,60:f,86:S,100:C,102:_,103:L},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:S,100:C,102:_,103:L},{13:B,55:76},{58:78,60:[1,79]},t(M,[2,76]),t(M,[2,77]),t(M,[2,78]),t(M,[2,79]),t(P,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:S,100:C,102:_,103:L}),t(P,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:S,100:C,102:_,103:L},{16:39,17:40,19:87,60:f,86:S,100:C,102:_,103:L},t(G,[2,133]),t(G,[2,134]),t(G,[2,135]),t(G,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(O,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:e,35:r,37:n,42:i,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:x,78:b,82:w,83:k,86:S,100:C,102:_,103:L}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:x,78:b,82:w,83:k,86:S,100:C,102:_,103:L},t(M,[2,20]),t(M,[2,31]),t(M,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:S,100:C,102:_,103:L},{53:92,66:56,67:57,68:z,69:F,70:A,71:R,72:N,73:D,74:I},t(M,[2,64]),{67:93,73:D,74:I},t(V,[2,83],{66:94,68:z,69:F,70:A,71:R,72:N}),t(X,[2,84]),t(X,[2,85]),t(X,[2,86]),t(X,[2,87]),t(X,[2,88]),t(W,[2,89]),t(W,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:s,54:u,56:h},{16:100,60:f,86:S,100:C,102:_},{41:[1,102],45:101,51:ie},{16:104,60:f,86:S,100:C,102:_},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:K,50:se,59:110,60:J,82:Z,84:111,85:112,86:ee,87:ne,88:ue,89:fe,90:_e},{60:[1,122]},{13:B,55:123},t($,[2,72]),t($,[2,138]),{22:K,50:se,59:124,60:J,61:[1,125],82:Z,84:111,85:112,86:ee,87:ne,88:ue,89:fe,90:_e},t(Ae,[2,74]),{16:39,17:40,19:126,60:f,86:S,100:C,102:_,103:L},t(P,[2,16]),t(P,[2,17]),t(P,[2,18]),{11:127,12:Ne,39:[2,36]},t(me,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:S,100:C,102:_,103:L}),t(me,[2,10]),t(ve,[2,55],{11:131,12:Ne}),t(O,[2,7]),{9:[1,132]},t(Ge,[2,67]),{16:39,17:40,19:133,60:f,86:S,100:C,102:_,103:L},{13:[1,135],16:39,17:40,19:134,60:f,86:S,100:C,102:_,103:L},t(V,[2,82],{66:136,68:z,69:F,70:A,71:R,72:N}),t(V,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:s,54:u,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t($,[2,48],{39:[1,142]}),{41:[1,143]},t($,[2,50]),{41:[2,61],45:144,51:ie},{47:[1,145]},{16:39,17:40,19:146,60:f,86:S,100:C,102:_,103:L},t(M,[2,91],{13:[1,147]}),t(M,[2,93],{13:[1,149],77:[1,148]}),t(M,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(M,[2,105],{61:Te}),t(Ze,[2,107],{85:154,22:K,50:se,60:J,82:Z,86:ee,87:ne,88:ue,89:fe,90:_e}),t(ke,[2,109]),t(ke,[2,111]),t(ke,[2,112]),t(ke,[2,113]),t(ke,[2,114]),t(ke,[2,115]),t(ke,[2,116]),t(ke,[2,117]),t(ke,[2,118]),t(ke,[2,119]),t(M,[2,106]),t($,[2,71]),t(M,[2,73],{61:Te}),{60:[1,155]},t(P,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:S,100:C,102:_,103:L},t(me,[2,12]),t(ve,[2,56]),{1:[2,4]},t(Ge,[2,69]),t(Ge,[2,68]),{16:39,17:40,19:158,60:f,86:S,100:C,102:_,103:L},t(V,[2,80]),t($,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:s,54:u,56:h},{45:163,51:ie},t($,[2,49]),{41:[2,62]},t($,[2,52],{39:[1,164]}),t(M,[2,60]),t(M,[2,92]),t(M,[2,94]),t(M,[2,95],{77:[1,165]}),t(M,[2,98]),t(M,[2,99],{13:[1,166]}),t(M,[2,101],{13:[1,168],77:[1,167]}),{22:K,50:se,60:J,82:Z,84:169,85:112,86:ee,87:ne,88:ue,89:fe,90:_e},t(ke,[2,110]),t(Ae,[2,75]),{14:[1,170]},t(me,[2,11]),t(Ge,[2,70]),t($,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ie},t(M,[2,96]),t(M,[2,100]),t(M,[2,102]),t(M,[2,103],{77:[1,174]}),t(Ze,[2,108],{85:154,22:K,50:se,60:J,82:Z,86:ee,87:ne,88:ue,89:fe,90:_e}),t(ve,[2,8]),t($,[2,51]),{41:[1,175]},t($,[2,54]),t(M,[2,104]),t($,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:T(function(je,Ce){if(Ce.recoverable)this.trace(je);else{var Se=new Error(je);throw Se.hash=Ce,Se}},"parseError"),parse:T(function(je){var Ce=this,Se=[0],H=[],he=[null],j=[],pe=this.table,re="",Fe=0,xe=0,Ue=2,Me=1,qe=j.slice.call(arguments,1),Le=Object.create(this.lexer),Xe={yy:{}};for(var De in this.yy)Object.prototype.hasOwnProperty.call(this.yy,De)&&(Xe.yy[De]=this.yy[De]);Le.setInput(je,Xe.yy),Xe.yy.lexer=Le,Xe.yy.parser=this,typeof Le.yylloc>"u"&&(Le.yylloc={});var it=Le.yylloc;j.push(it);var we=Le.options&&Le.options.ranges;typeof Xe.yy.parseError=="function"?this.parseError=Xe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function lt(wt){Se.length=Se.length-2*wt,he.length=he.length-wt,j.length=j.length-wt}T(lt,"popStack");function be(){var wt;return wt=H.pop()||Le.lex()||Me,typeof wt!="number"&&(wt instanceof Array&&(H=wt,wt=H.pop()),wt=Ce.symbols_[wt]||wt),wt}T(be,"lex");for(var Et,vt,ot,It,xt={},ht,oe,At,dt;;){if(vt=Se[Se.length-1],this.defaultActions[vt]?ot=this.defaultActions[vt]:((Et===null||typeof Et>"u")&&(Et=be()),ot=pe[vt]&&pe[vt][Et]),typeof ot>"u"||!ot.length||!ot[0]){var ut="";dt=[];for(ht in pe[vt])this.terminals_[ht]&&ht>Ue&&dt.push("'"+this.terminals_[ht]+"'");Le.showPosition?ut="Parse error on line "+(Fe+1)+`: `+Le.showPosition()+` -Expecting `+dt.join(", ")+", got '"+(this.terminals_[Et]||Et)+"'":ut="Parse error on line "+(Be+1)+": Unexpected "+(Et==De?"end of input":"'"+(this.terminals_[Et]||Et)+"'"),this.parseError(ut,{text:Le.match,token:this.terminals_[Et]||Et,line:Le.yylineno,loc:it,expected:dt})}if(ot[0]instanceof Array&&ot.length>1)throw new Error("Parse Error: multiple actions possible at state: "+vt+", token: "+Et);switch(ot[0]){case 1:Se.push(Et),he.push(Le.yytext),j.push(Le.yylloc),Se.push(ot[1]),Et=null,xe=Le.yyleng,re=Le.yytext,Be=Le.yylineno,it=Le.yylloc;break;case 2:if(oe=this.productions_[ot[1]][1],xt.$=he[he.length-oe],xt._$={first_line:j[j.length-(oe||1)].first_line,last_line:j[j.length-1].last_line,first_column:j[j.length-(oe||1)].first_column,last_column:j[j.length-1].last_column},we&&(xt._$.range=[j[j.length-(oe||1)].range[0],j[j.length-1].range[1]]),It=this.performAction.apply(xt,[re,xe,Be,Xe.yy,ot[1],he,j].concat(qe)),typeof It<"u")return It;oe&&(Se=Se.slice(0,-1*oe*2),he=he.slice(0,-1*oe),j=j.slice(0,-1*oe)),Se.push(this.productions_[ot[1]][0]),he.push(xt.$),j.push(xt._$),At=pe[Se[Se.length-2]][Se[Se.length-1]],Se.push(At);break;case 3:return!0}}return!0},"parse")},Qe=(function(){var tt={EOF:1,parseError:x(function(Ce,Se){if(this.yy.parser)this.yy.parser.parseError(Ce,Se);else throw new Error(Ce)},"parseError"),setInput:x(function(je,Ce){return this.yy=Ce||this.yy||{},this._input=je,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var je=this._input[0];this.yytext+=je,this.yyleng++,this.offset++,this.match+=je,this.matched+=je;var Ce=je.match(/(?:\r\n?|\n).*/g);return Ce?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),je},"input"),unput:x(function(je){var Ce=je.length,Se=je.split(/(?:\r\n?|\n)/g);this._input=je+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ce),this.offset-=Ce;var H=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Se.length-1&&(this.yylineno-=Se.length-1);var he=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Se?(Se.length===H.length?this.yylloc.first_column:0)+H[H.length-Se.length].length-Se[0].length:this.yylloc.first_column-Ce},this.options.ranges&&(this.yylloc.range=[he[0],he[0]+this.yyleng-Ce]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(je){this.unput(this.match.slice(je))},"less"),pastInput:x(function(){var je=this.matched.substr(0,this.matched.length-this.match.length);return(je.length>20?"...":"")+je.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var je=this.match;return je.length<20&&(je+=this._input.substr(0,20-je.length)),(je.substr(0,20)+(je.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var je=this.pastInput(),Ce=new Array(je.length+1).join("-");return je+this.upcomingInput()+` -`+Ce+"^"},"showPosition"),test_match:x(function(je,Ce){var Se,H,he;if(this.options.backtrack_lexer&&(he={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(he.yylloc.range=this.yylloc.range.slice(0))),H=je[0].match(/(?:\r\n?|\n).*/g),H&&(this.yylineno+=H.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:H?H[H.length-1].length-H[H.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+je[0].length},this.yytext+=je[0],this.match+=je[0],this.matches=je,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(je[0].length),this.matched+=je[0],Se=this.performAction.call(this,this.yy,this,Ce,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Se)return Se;if(this._backtrack){for(var j in he)this[j]=he[j];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var je,Ce,Se,H;this._more||(this.yytext="",this.match="");for(var he=this._currentRules(),j=0;jCe[0].length)){if(Ce=Se,H=j,this.options.backtrack_lexer){if(je=this.test_match(Se,he[j]),je!==!1)return je;if(this._backtrack){Ce=!1;continue}else return!1}else if(!this.options.flex)break}return Ce?(je=this.test_match(Ce,he[H]),je!==!1?je:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Ce=this.next();return Ce||this.lex()},"lex"),begin:x(function(Ce){this.conditionStack.push(Ce)},"begin"),popState:x(function(){var Ce=this.conditionStack.length-1;return Ce>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Ce){return Ce=this.conditionStack.length-1-Math.abs(Ce||0),Ce>=0?this.conditionStack[Ce]:"INITIAL"},"topState"),pushState:x(function(Ce){this.begin(Ce)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(Ce,Se,H,he){switch(H){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return tt})();Ve.lexer=Qe;function nt(){this.yy={}}return x(nt,"Parser"),nt.prototype=Ve,Ve.Parser=nt,new nt})();E$.parser=E$;var lme=E$,cme=["#","+","~","-",""],ume=(Gv=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=qr(e,Pe());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+Eu(this.id);this.memberType==="method"&&(e+=`(${Eu(this.parameters.trim())})`,this.returnType&&(e+=" : "+Eu(this.returnType))),e=e.trim();const r=this.parseClassifier();return{displayText:e,cssStyle:r}}parseMember(e){let r="";if(this.memberType==="method"){const a=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(a){const s=a[1]?a[1].trim():"";if(cme.includes(s)&&(this.visibility=s),this.id=a[2],this.parameters=a[3]?a[3].trim():"",r=a[4]?a[4].trim():"",this.returnType=a[5]?a[5].trim():"",r===""){const o=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(o)&&(r=o,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const i=e.length,a=e.substring(0,1),s=e.substring(i-1);cme.includes(a)&&(this.visibility=a),/[$*]/.exec(s)&&(r=s),this.id=e.substring(this.visibility===""?0:1,r===""?i:i-1)}this.classifier=r,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${Eu(this.id)}${this.memberType==="method"?`(${Eu(this.parameters)})${this.returnType?" : "+Eu(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},x(Gv,"ClassMember"),Gv),AS="classId-",hme=0,r0=x(t=>Lt.sanitizeText(t,Pe()),"sanitizeText"),dme=(Bh=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=x(e=>{const r=xte();pt(e).select("svg").selectAll("g").filter(function(){return pt(this).attr("title")!==null}).on("mouseover",a=>{const s=pt(a.currentTarget),o=s.attr("title");if(!o)return;const l=a.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(ku.sanitize(o)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),pt(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=Dn,this.getAccTitle=Fn,this.setAccDescription=zn,this.getAccDescription=Gn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getConfig=x(()=>Pe().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(e){const r=Lt.sanitizeText(e,Pe());let n="",i=r;if(r.indexOf("~")>0){const a=r.split("~");i=r0(a[0]),n=r0(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=Lt.sanitizeText(e,Pe());r&&(r=r0(r));const{className:i}=this.splitClassNameAndType(n);this.classes.get(i).label=r,this.classes.get(i).text=`${r}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(e){const r=Lt.sanitizeText(e,Pe()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const a=Lt.sanitizeText(n,Pe());this.classes.set(a,{id:a,type:i,label:a,text:`${a}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:AS+a+"-"+hme}),hme++}addInterface(e,r){const n={id:`interface${this.interfaces.length}`,label:e,classId:r};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){const r=Lt.sanitizeText(e,Pe());if(this.classes.has(r)){const n=this.classes.get(r).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+r)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",In()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){const r=typeof e=="number"?`note${e}`:e;return this.notes.get(r)}getNotes(){return this.notes}addRelation(e){ae.debug("Adding relation: "+JSON.stringify(e));const r=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!r.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!r.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=Lt.sanitizeText(e.relationTitle1.trim(),Pe()),e.relationTitle2=Lt.sanitizeText(e.relationTitle2.trim(),Pe()),this.relations.push(e)}addAnnotation(e,r){const n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(r)}addMember(e,r){this.addClass(e);const n=this.splitClassNameAndType(e).className,i=this.classes.get(n);if(typeof r=="string"){const a=r.trim();a.startsWith("<<")&&a.endsWith(">>")?i.annotations.push(r0(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new ume(a,"method")):a&&i.members.push(new ume(a,"attribute"))}}addMembers(e,r){Array.isArray(r)&&(r.reverse(),r.forEach(n=>this.addMember(e,n)))}addNote(e,r){const n=this.notes.size,i={id:`note${n}`,class:r,text:e,index:n};return this.notes.set(i.id,i),i.id}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),r0(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=AS+i);const a=this.classes.get(i);a&&(a.cssClasses+=" "+r)})}defineClass(e,r){for(const n of e){let i=this.styleClasses.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,i)),r&&r.forEach(a=>{if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.classes.forEach(a=>{a.cssClasses.includes(n)&&a.styles.push(...r.flatMap(s=>s.split(",")))})}}setTooltip(e,r){e.split(",").forEach(n=>{r!==void 0&&(this.classes.get(n).tooltip=r0(r))})}getTooltip(e,r){return r&&this.namespaces.has(r)?this.namespaces.get(r).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,r,n){const i=Pe();e.split(",").forEach(a=>{let s=a;/\d/.exec(a[0])&&(s=AS+s);const o=this.classes.get(s);o&&(o.link=Lr.formatUrl(r,i),i.securityLevel==="sandbox"?o.linkTarget="_top":typeof n=="string"?o.linkTarget=r0(n):o.linkTarget="_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFunc(i,r,n),this.classes.get(i).haveCallback=!0}),this.setCssClass(e,"clickable")}setClickFunc(e,r,n){const i=Lt.sanitizeText(e,Pe());if(Pe().securityLevel!=="loose"||r===void 0)return;const s=i;if(this.classes.has(s)){let o=[];if(typeof n=="string"){o=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{const l=this.lookUpDomId(s),u=document.querySelector(`[id="${l}"]`);u!==null&&u.addEventListener("click",()=>{Lr.runFunc(r,...o)},!1)})}}bindFunctions(e){this.functions.forEach(r=>{r(e)})}escapeHtml(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,r){const n=r.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){const r=e.split("."),n=new Array(r.length);n[0]=r[0];for(let i=1;i0?a[s-1]:void 0,u=s===a.length-1,h=u&&r?r:i[s];this.namespaces.has(o)?u&&(this.namespaces.get(o).explicit=!0):this.namespaces.set(o,this.createNamespaceNode(o,h,l,u)),l&&this.linkParentChild(l,o)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,r,n){if(this.namespaces.has(e)){for(const i of r){const{className:a}=this.splitClassNameAndType(i),s=this.getClass(a);s.parent=e,this.namespaces.get(e).classes.set(a,s)}for(const i of n){const a=this.getNote(i);a.parent=e,this.namespaces.get(e).notes.set(i,a)}}}setCssStyle(e,r){const n=this.classes.get(e);if(!(!r||!n))for(const i of r)i.includes(",")?n.styles.push(...i.split(",")):n.styles.push(i)}getArrowMarker(e){let r;switch(e){case 0:r="aggregation";break;case 1:r="extension";break;case 2:r="composition";break;case 3:r="dependency";break;case 4:r="lollipop";break;default:r="none"}return r}resolveExplicitAncestor(e){let r=e;for(;r;){const n=this.namespaces.get(r);if(!n)return;if(n.explicit)return r;r=n.parent}}getData(){var s,o;const e=[],r=[],n=Pe(),i=((s=n.class)==null?void 0:s.hierarchicalNamespaces)??!0;for(const l of this.namespaces.values()){if(!i&&!l.explicit)continue;const u={id:l.id,label:i?l.label:l.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:i?l.parent:void 0};e.push(u)}for(const l of this.classes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={...l,type:void 0,isGroup:!1,parentId:u,look:n.look};e.push(h)}for(const l of this.notes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={id:l.id,label:l.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:u,labelType:"markdown"};e.push(h);const d=(o=this.classes.get(l.class))==null?void 0:o.id;if(d){const f={id:`edgeNote${l.index}`,start:l.id,end:d,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};r.push(f)}}for(const l of this.interfaces){const u={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};e.push(u)}let a=0;for(const l of this.relations){a++;const u={id:V0(l.id1,l.id2,{prefix:"id",counter:a}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};r.push(u)}return{nodes:e,edges:r,other:{},config:n,direction:this.getDirection()}}},x(Bh,"ClassDB"),Bh),kct=x(t=>`g.classGroup text { +Expecting `+dt.join(", ")+", got '"+(this.terminals_[Et]||Et)+"'":ut="Parse error on line "+(Fe+1)+": Unexpected "+(Et==Me?"end of input":"'"+(this.terminals_[Et]||Et)+"'"),this.parseError(ut,{text:Le.match,token:this.terminals_[Et]||Et,line:Le.yylineno,loc:it,expected:dt})}if(ot[0]instanceof Array&&ot.length>1)throw new Error("Parse Error: multiple actions possible at state: "+vt+", token: "+Et);switch(ot[0]){case 1:Se.push(Et),he.push(Le.yytext),j.push(Le.yylloc),Se.push(ot[1]),Et=null,xe=Le.yyleng,re=Le.yytext,Fe=Le.yylineno,it=Le.yylloc;break;case 2:if(oe=this.productions_[ot[1]][1],xt.$=he[he.length-oe],xt._$={first_line:j[j.length-(oe||1)].first_line,last_line:j[j.length-1].last_line,first_column:j[j.length-(oe||1)].first_column,last_column:j[j.length-1].last_column},we&&(xt._$.range=[j[j.length-(oe||1)].range[0],j[j.length-1].range[1]]),It=this.performAction.apply(xt,[re,xe,Fe,Xe.yy,ot[1],he,j].concat(qe)),typeof It<"u")return It;oe&&(Se=Se.slice(0,-1*oe*2),he=he.slice(0,-1*oe),j=j.slice(0,-1*oe)),Se.push(this.productions_[ot[1]][0]),he.push(xt.$),j.push(xt._$),At=pe[Se[Se.length-2]][Se[Se.length-1]],Se.push(At);break;case 3:return!0}}return!0},"parse")},Qe=(function(){var tt={EOF:1,parseError:T(function(Ce,Se){if(this.yy.parser)this.yy.parser.parseError(Ce,Se);else throw new Error(Ce)},"parseError"),setInput:T(function(je,Ce){return this.yy=Ce||this.yy||{},this._input=je,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var je=this._input[0];this.yytext+=je,this.yyleng++,this.offset++,this.match+=je,this.matched+=je;var Ce=je.match(/(?:\r\n?|\n).*/g);return Ce?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),je},"input"),unput:T(function(je){var Ce=je.length,Se=je.split(/(?:\r\n?|\n)/g);this._input=je+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ce),this.offset-=Ce;var H=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Se.length-1&&(this.yylineno-=Se.length-1);var he=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Se?(Se.length===H.length?this.yylloc.first_column:0)+H[H.length-Se.length].length-Se[0].length:this.yylloc.first_column-Ce},this.options.ranges&&(this.yylloc.range=[he[0],he[0]+this.yyleng-Ce]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(je){this.unput(this.match.slice(je))},"less"),pastInput:T(function(){var je=this.matched.substr(0,this.matched.length-this.match.length);return(je.length>20?"...":"")+je.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var je=this.match;return je.length<20&&(je+=this._input.substr(0,20-je.length)),(je.substr(0,20)+(je.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var je=this.pastInput(),Ce=new Array(je.length+1).join("-");return je+this.upcomingInput()+` +`+Ce+"^"},"showPosition"),test_match:T(function(je,Ce){var Se,H,he;if(this.options.backtrack_lexer&&(he={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(he.yylloc.range=this.yylloc.range.slice(0))),H=je[0].match(/(?:\r\n?|\n).*/g),H&&(this.yylineno+=H.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:H?H[H.length-1].length-H[H.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+je[0].length},this.yytext+=je[0],this.match+=je[0],this.matches=je,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(je[0].length),this.matched+=je[0],Se=this.performAction.call(this,this.yy,this,Ce,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Se)return Se;if(this._backtrack){for(var j in he)this[j]=he[j];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var je,Ce,Se,H;this._more||(this.yytext="",this.match="");for(var he=this._currentRules(),j=0;jCe[0].length)){if(Ce=Se,H=j,this.options.backtrack_lexer){if(je=this.test_match(Se,he[j]),je!==!1)return je;if(this._backtrack){Ce=!1;continue}else return!1}else if(!this.options.flex)break}return Ce?(je=this.test_match(Ce,he[H]),je!==!1?je:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var Ce=this.next();return Ce||this.lex()},"lex"),begin:T(function(Ce){this.conditionStack.push(Ce)},"begin"),popState:T(function(){var Ce=this.conditionStack.length-1;return Ce>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(Ce){return Ce=this.conditionStack.length-1-Math.abs(Ce||0),Ce>=0?this.conditionStack[Ce]:"INITIAL"},"topState"),pushState:T(function(Ce){this.begin(Ce)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:T(function(Ce,Se,H,he){switch(H){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return tt})();Ve.lexer=Qe;function nt(){this.yy={}}return T(nt,"Parser"),nt.prototype=Ve,Ve.Parser=nt,new nt})();L$.parser=L$;var pme=L$,gme=["#","+","~","-",""],mme=(qv=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=qr(e,Pe());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+Eu(this.id);this.memberType==="method"&&(e+=`(${Eu(this.parameters.trim())})`,this.returnType&&(e+=" : "+Eu(this.returnType))),e=e.trim();const r=this.parseClassifier();return{displayText:e,cssStyle:r}}parseMember(e){let r="";if(this.memberType==="method"){const a=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(a){const s=a[1]?a[1].trim():"";if(gme.includes(s)&&(this.visibility=s),this.id=a[2],this.parameters=a[3]?a[3].trim():"",r=a[4]?a[4].trim():"",this.returnType=a[5]?a[5].trim():"",r===""){const o=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(o)&&(r=o,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const i=e.length,a=e.substring(0,1),s=e.substring(i-1);gme.includes(a)&&(this.visibility=a),/[$*]/.exec(s)&&(r=s),this.id=e.substring(this.visibility===""?0:1,r===""?i:i-1)}this.classifier=r,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${Eu(this.id)}${this.memberType==="method"?`(${Eu(this.parameters)})${this.returnType?" : "+Eu(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},T(qv,"ClassMember"),qv),LS="classId-",yme=0,rp=T(t=>Lt.sanitizeText(t,Pe()),"sanitizeText"),vme=(Bh=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=T(e=>{const r=Ste();pt(e).select("svg").selectAll("g").filter(function(){return pt(this).attr("title")!==null}).on("mouseover",a=>{const s=pt(a.currentTarget),o=s.attr("title");if(!o)return;const l=a.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(ku.sanitize(o)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),pt(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=Dn,this.getAccTitle=Fn,this.setAccDescription=zn,this.getAccDescription=Gn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getConfig=T(()=>Pe().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(e){const r=Lt.sanitizeText(e,Pe());let n="",i=r;if(r.indexOf("~")>0){const a=r.split("~");i=rp(a[0]),n=rp(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=Lt.sanitizeText(e,Pe());r&&(r=rp(r));const{className:i}=this.splitClassNameAndType(n);this.classes.get(i).label=r,this.classes.get(i).text=`${r}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(e){const r=Lt.sanitizeText(e,Pe()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const a=Lt.sanitizeText(n,Pe());this.classes.set(a,{id:a,type:i,label:a,text:`${a}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:LS+a+"-"+yme}),yme++}addInterface(e,r){const n={id:`interface${this.interfaces.length}`,label:e,classId:r};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){const r=Lt.sanitizeText(e,Pe());if(this.classes.has(r)){const n=this.classes.get(r).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+r)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",In()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){const r=typeof e=="number"?`note${e}`:e;return this.notes.get(r)}getNotes(){return this.notes}addRelation(e){ae.debug("Adding relation: "+JSON.stringify(e));const r=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!r.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!r.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=Lt.sanitizeText(e.relationTitle1.trim(),Pe()),e.relationTitle2=Lt.sanitizeText(e.relationTitle2.trim(),Pe()),this.relations.push(e)}addAnnotation(e,r){const n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(r)}addMember(e,r){this.addClass(e);const n=this.splitClassNameAndType(e).className,i=this.classes.get(n);if(typeof r=="string"){const a=r.trim();a.startsWith("<<")&&a.endsWith(">>")?i.annotations.push(rp(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new mme(a,"method")):a&&i.members.push(new mme(a,"attribute"))}}addMembers(e,r){Array.isArray(r)&&(r.reverse(),r.forEach(n=>this.addMember(e,n)))}addNote(e,r){const n=this.notes.size,i={id:`note${n}`,class:r,text:e,index:n};return this.notes.set(i.id,i),i.id}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),rp(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=LS+i);const a=this.classes.get(i);a&&(a.cssClasses+=" "+r)})}defineClass(e,r){for(const n of e){let i=this.styleClasses.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,i)),r&&r.forEach(a=>{if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.classes.forEach(a=>{a.cssClasses.includes(n)&&a.styles.push(...r.flatMap(s=>s.split(",")))})}}setTooltip(e,r){e.split(",").forEach(n=>{r!==void 0&&(this.classes.get(n).tooltip=rp(r))})}getTooltip(e,r){return r&&this.namespaces.has(r)?this.namespaces.get(r).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,r,n){const i=Pe();e.split(",").forEach(a=>{let s=a;/\d/.exec(a[0])&&(s=LS+s);const o=this.classes.get(s);o&&(o.link=Lr.formatUrl(r,i),i.securityLevel==="sandbox"?o.linkTarget="_top":typeof n=="string"?o.linkTarget=rp(n):o.linkTarget="_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFunc(i,r,n),this.classes.get(i).haveCallback=!0}),this.setCssClass(e,"clickable")}setClickFunc(e,r,n){const i=Lt.sanitizeText(e,Pe());if(Pe().securityLevel!=="loose"||r===void 0)return;const s=i;if(this.classes.has(s)){let o=[];if(typeof n=="string"){o=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{const l=this.lookUpDomId(s),u=document.querySelector(`[id="${l}"]`);u!==null&&u.addEventListener("click",()=>{Lr.runFunc(r,...o)},!1)})}}bindFunctions(e){this.functions.forEach(r=>{r(e)})}escapeHtml(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,r){const n=r.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){const r=e.split("."),n=new Array(r.length);n[0]=r[0];for(let i=1;i0?a[s-1]:void 0,u=s===a.length-1,h=u&&r?r:i[s];this.namespaces.has(o)?u&&(this.namespaces.get(o).explicit=!0):this.namespaces.set(o,this.createNamespaceNode(o,h,l,u)),l&&this.linkParentChild(l,o)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,r,n){if(this.namespaces.has(e)){for(const i of r){const{className:a}=this.splitClassNameAndType(i),s=this.getClass(a);s.parent=e,this.namespaces.get(e).classes.set(a,s)}for(const i of n){const a=this.getNote(i);a.parent=e,this.namespaces.get(e).notes.set(i,a)}}}setCssStyle(e,r){const n=this.classes.get(e);if(!(!r||!n))for(const i of r)i.includes(",")?n.styles.push(...i.split(",")):n.styles.push(i)}getArrowMarker(e){let r;switch(e){case 0:r="aggregation";break;case 1:r="extension";break;case 2:r="composition";break;case 3:r="dependency";break;case 4:r="lollipop";break;default:r="none"}return r}resolveExplicitAncestor(e){let r=e;for(;r;){const n=this.namespaces.get(r);if(!n)return;if(n.explicit)return r;r=n.parent}}getData(){var s,o;const e=[],r=[],n=Pe(),i=((s=n.class)==null?void 0:s.hierarchicalNamespaces)??!0;for(const l of this.namespaces.values()){if(!i&&!l.explicit)continue;const u={id:l.id,label:i?l.label:l.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:i?l.parent:void 0};e.push(u)}for(const l of this.classes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={...l,type:void 0,isGroup:!1,parentId:u,look:n.look};e.push(h)}for(const l of this.notes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={id:l.id,label:l.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:u,labelType:"markdown"};e.push(h);const d=(o=this.classes.get(l.class))==null?void 0:o.id;if(d){const f={id:`edgeNote${l.index}`,start:l.id,end:d,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};r.push(f)}}for(const l of this.interfaces){const u={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};e.push(u)}let a=0;for(const l of this.relations){a++;const u={id:Vp(l.id1,l.id2,{prefix:"id",counter:a}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};r.push(u)}return{nodes:e,edges:r,other:{},config:n,direction:this.getDirection()}}},T(Bh,"ClassDB"),Bh),Pct=T(t=>`g.classGroup text { fill: ${t.nodeBorder||t.classText}; stroke: none; font-family: ${t.fontFamily}; @@ -2225,13 +2225,13 @@ g.classGroup line { } text-align: center; } - ${px()} -`,"getStyles"),fme=kct,Ect=x((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),Sct=x(function(t,e){return e.db.getClasses()},"getClasses"),Act=x(async function(t,e,r,n){ae.info("REF0:"),ae.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=Pe();n.db.setDiagramId(e);const o=n.db.getData(),l=Xp(e,i);o.type=n.type,o.layoutAlgorithm=sb(s),o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await Z0(o,l);const u=8;Lr.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Wd(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),pme={getClasses:Sct,draw:Act,getDir:Ect},_ct={parser:lme,get db(){return new dme},renderer:pme,styles:fme,init:x(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Rct=Object.freeze(Object.defineProperty({__proto__:null,diagram:_ct},Symbol.toStringTag,{value:"Module"}));var Lct={parser:lme,get db(){return new dme},renderer:pme,styles:fme,init:x(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Ict=Object.freeze(Object.defineProperty({__proto__:null,diagram:Lct},Symbol.toStringTag,{value:"Module"}));var S$=(function(){var t=x(function($,B,P,G){for(P=P||{},G=$.length;G--;P[$[G]]=B);return P},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,16],l=[1,17],u=[1,18],h=[1,19],d=[1,33],f=[1,20],p=[1,21],g=[1,22],m=[1,23],y=[1,24],v=[1,26],T=[1,27],b=[1,28],w=[1,29],k=[1,30],A=[1,31],C=[1,32],_=[1,35],L=[1,36],O=[1,37],M=[1,38],z=[1,34],F=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],S=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],R=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],N={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:x(function(B,P,G,V,Y,W,ie){var K=W.length-1;switch(Y){case 3:return V.setRootDoc(W[K]),W[K];case 4:this.$=[];break;case 5:W[K]!="nl"&&(W[K-1].push(W[K]),this.$=W[K-1]);break;case 6:case 7:this.$=W[K];break;case 8:this.$="nl";break;case 12:this.$=W[K];break;case 13:const ee=W[K-1];ee.description=V.trimColon(W[K]),this.$=ee;break;case 14:this.$={stmt:"relation",state1:W[K-2],state2:W[K]};break;case 15:const ne=V.trimColon(W[K]);this.$={stmt:"relation",state1:W[K-3],state2:W[K-1],description:ne};break;case 19:this.$={stmt:"state",id:W[K-3],type:"default",description:"",doc:W[K-1]};break;case 20:var se=W[K],J=W[K-2].trim();if(W[K].match(":")){var Z=W[K].split(":");se=Z[0],J=[J,Z[1]]}this.$={stmt:"state",id:se,type:"default",description:J};break;case 21:this.$={stmt:"state",id:W[K-3],type:"default",description:W[K-5],doc:W[K-1]};break;case 22:this.$={stmt:"state",id:W[K],type:"fork"};break;case 23:this.$={stmt:"state",id:W[K],type:"join"};break;case 24:this.$={stmt:"state",id:W[K],type:"choice"};break;case 25:this.$={stmt:"state",id:V.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:W[K-1].trim(),note:{position:W[K-2].trim(),text:W[K].trim()}};break;case 29:this.$=W[K].trim(),V.setAccTitle(this.$);break;case 30:case 31:this.$=W[K].trim(),V.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:W[K-3],url:W[K-2],tooltip:W[K-1]};break;case 33:this.$={stmt:"click",id:W[K-3],url:W[K-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:W[K-1].trim(),classes:W[K].trim()};break;case 36:this.$={stmt:"style",id:W[K-1].trim(),styleClass:W[K].trim()};break;case 37:this.$={stmt:"applyClass",id:W[K-1].trim(),styleClass:W[K].trim()};break;case 38:V.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:V.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:V.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:V.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:W[K].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:W[K-2].trim(),classes:[W[K].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:W[K-2].trim(),classes:[W[K].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:k,45:A,48:C,51:_,52:L,53:O,54:M,57:z},t(F,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:k,45:A,48:C,51:_,52:L,53:O,54:M,57:z},t(F,[2,7]),t(F,[2,8]),t(F,[2,9]),t(F,[2,10]),t(F,[2,11]),t(F,[2,12],{14:[1,40],15:[1,41]}),t(F,[2,16]),{18:[1,42]},t(F,[2,18],{20:[1,43]}),{23:[1,44]},t(F,[2,22]),t(F,[2,23]),t(F,[2,24]),t(F,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(F,[2,28]),{34:[1,49]},{36:[1,50]},t(F,[2,31]),{13:51,24:d,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(S,[2,44],{58:[1,56]}),t(S,[2,45],{58:[1,57]}),t(F,[2,38]),t(F,[2,39]),t(F,[2,40]),t(F,[2,41]),t(F,[2,6]),t(F,[2,13]),{13:58,24:d,57:z},t(F,[2,17]),t(R,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(F,[2,29]),t(F,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(F,[2,14],{14:[1,71]}),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,72],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:k,45:A,48:C,51:_,52:L,53:O,54:M,57:z},t(F,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(F,[2,34]),t(F,[2,35]),t(F,[2,36]),t(F,[2,37]),t(S,[2,46]),t(S,[2,47]),t(F,[2,15]),t(F,[2,19]),t(R,i,{7:78}),t(F,[2,26]),t(F,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,81],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:k,45:A,48:C,51:_,52:L,53:O,54:M,57:z},t(F,[2,32]),t(F,[2,33]),t(F,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:x(function(B,P){if(P.recoverable)this.trace(B);else{var G=new Error(B);throw G.hash=P,G}},"parseError"),parse:x(function(B){var P=this,G=[0],V=[],Y=[null],W=[],ie=this.table,K="",se=0,J=0,Z=2,ee=1,ne=W.slice.call(arguments,1),ue=Object.create(this.lexer),fe={yy:{}};for(var _e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_e)&&(fe.yy[_e]=this.yy[_e]);ue.setInput(B,fe.yy),fe.yy.lexer=ue,fe.yy.parser=this,typeof ue.yylloc>"u"&&(ue.yylloc={});var Ae=ue.yylloc;W.push(Ae);var Ne=ue.options&&ue.options.ranges;typeof fe.yy.parseError=="function"?this.parseError=fe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function me(Se){G.length=G.length-2*Se,Y.length=Y.length-Se,W.length=W.length-Se}x(me,"popStack");function ve(){var Se;return Se=V.pop()||ue.lex()||ee,typeof Se!="number"&&(Se instanceof Array&&(V=Se,Se=V.pop()),Se=P.symbols_[Se]||Se),Se}x(ve,"lex");for(var Ge,Te,Ze,ke,Ve={},Qe,nt,tt,je;;){if(Te=G[G.length-1],this.defaultActions[Te]?Ze=this.defaultActions[Te]:((Ge===null||typeof Ge>"u")&&(Ge=ve()),Ze=ie[Te]&&ie[Te][Ge]),typeof Ze>"u"||!Ze.length||!Ze[0]){var Ce="";je=[];for(Qe in ie[Te])this.terminals_[Qe]&&Qe>Z&&je.push("'"+this.terminals_[Qe]+"'");ue.showPosition?Ce="Parse error on line "+(se+1)+`: + ${mx()} +`,"getStyles"),bme=Pct,Bct=T((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),Fct=T(function(t,e){return e.db.getClasses()},"getClasses"),zct=T(async function(t,e,r,n){ae.info("REF0:"),ae.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=Pe();n.db.setDiagramId(e);const o=n.db.getData(),l=K0(e,i);o.type=n.type,o.layoutAlgorithm=ob(s),o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await Zp(o,l);const u=8;Lr.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Wd(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),xme={getClasses:Fct,draw:zct,getDir:Bct},Gct={parser:pme,get db(){return new vme},renderer:xme,styles:bme,init:T(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const qct=Object.freeze(Object.defineProperty({__proto__:null,diagram:Gct},Symbol.toStringTag,{value:"Module"}));var Vct={parser:pme,get db(){return new vme},renderer:xme,styles:bme,init:T(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Wct=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vct},Symbol.toStringTag,{value:"Module"}));var I$=(function(){var t=T(function($,B,P,G){for(P=P||{},G=$.length;G--;P[$[G]]=B);return P},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,16],l=[1,17],u=[1,18],h=[1,19],d=[1,33],f=[1,20],p=[1,21],g=[1,22],m=[1,23],y=[1,24],v=[1,26],x=[1,27],b=[1,28],w=[1,29],k=[1,30],S=[1,31],C=[1,32],_=[1,35],L=[1,36],O=[1,37],M=[1,38],z=[1,34],F=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],A=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],R=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],N={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:T(function(B,P,G,V,X,W,ie){var K=W.length-1;switch(X){case 3:return V.setRootDoc(W[K]),W[K];case 4:this.$=[];break;case 5:W[K]!="nl"&&(W[K-1].push(W[K]),this.$=W[K-1]);break;case 6:case 7:this.$=W[K];break;case 8:this.$="nl";break;case 12:this.$=W[K];break;case 13:const ee=W[K-1];ee.description=V.trimColon(W[K]),this.$=ee;break;case 14:this.$={stmt:"relation",state1:W[K-2],state2:W[K]};break;case 15:const ne=V.trimColon(W[K]);this.$={stmt:"relation",state1:W[K-3],state2:W[K-1],description:ne};break;case 19:this.$={stmt:"state",id:W[K-3],type:"default",description:"",doc:W[K-1]};break;case 20:var se=W[K],J=W[K-2].trim();if(W[K].match(":")){var Z=W[K].split(":");se=Z[0],J=[J,Z[1]]}this.$={stmt:"state",id:se,type:"default",description:J};break;case 21:this.$={stmt:"state",id:W[K-3],type:"default",description:W[K-5],doc:W[K-1]};break;case 22:this.$={stmt:"state",id:W[K],type:"fork"};break;case 23:this.$={stmt:"state",id:W[K],type:"join"};break;case 24:this.$={stmt:"state",id:W[K],type:"choice"};break;case 25:this.$={stmt:"state",id:V.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:W[K-1].trim(),note:{position:W[K-2].trim(),text:W[K].trim()}};break;case 29:this.$=W[K].trim(),V.setAccTitle(this.$);break;case 30:case 31:this.$=W[K].trim(),V.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:W[K-3],url:W[K-2],tooltip:W[K-1]};break;case 33:this.$={stmt:"click",id:W[K-3],url:W[K-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:W[K-1].trim(),classes:W[K].trim()};break;case 36:this.$={stmt:"style",id:W[K-1].trim(),styleClass:W[K].trim()};break;case 37:this.$={stmt:"applyClass",id:W[K-1].trim(),styleClass:W[K].trim()};break;case 38:V.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:V.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:V.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:V.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:W[K].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:W[K-2].trim(),classes:[W[K].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:W[K-2].trim(),classes:[W[K].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:w,41:k,45:S,48:C,51:_,52:L,53:O,54:M,57:z},t(F,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:w,41:k,45:S,48:C,51:_,52:L,53:O,54:M,57:z},t(F,[2,7]),t(F,[2,8]),t(F,[2,9]),t(F,[2,10]),t(F,[2,11]),t(F,[2,12],{14:[1,40],15:[1,41]}),t(F,[2,16]),{18:[1,42]},t(F,[2,18],{20:[1,43]}),{23:[1,44]},t(F,[2,22]),t(F,[2,23]),t(F,[2,24]),t(F,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(F,[2,28]),{34:[1,49]},{36:[1,50]},t(F,[2,31]),{13:51,24:d,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(A,[2,44],{58:[1,56]}),t(A,[2,45],{58:[1,57]}),t(F,[2,38]),t(F,[2,39]),t(F,[2,40]),t(F,[2,41]),t(F,[2,6]),t(F,[2,13]),{13:58,24:d,57:z},t(F,[2,17]),t(R,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(F,[2,29]),t(F,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(F,[2,14],{14:[1,71]}),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,72],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:w,41:k,45:S,48:C,51:_,52:L,53:O,54:M,57:z},t(F,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(F,[2,34]),t(F,[2,35]),t(F,[2,36]),t(F,[2,37]),t(A,[2,46]),t(A,[2,47]),t(F,[2,15]),t(F,[2,19]),t(R,i,{7:78}),t(F,[2,26]),t(F,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,81],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:w,41:k,45:S,48:C,51:_,52:L,53:O,54:M,57:z},t(F,[2,32]),t(F,[2,33]),t(F,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:T(function(B,P){if(P.recoverable)this.trace(B);else{var G=new Error(B);throw G.hash=P,G}},"parseError"),parse:T(function(B){var P=this,G=[0],V=[],X=[null],W=[],ie=this.table,K="",se=0,J=0,Z=2,ee=1,ne=W.slice.call(arguments,1),ue=Object.create(this.lexer),fe={yy:{}};for(var _e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_e)&&(fe.yy[_e]=this.yy[_e]);ue.setInput(B,fe.yy),fe.yy.lexer=ue,fe.yy.parser=this,typeof ue.yylloc>"u"&&(ue.yylloc={});var Ae=ue.yylloc;W.push(Ae);var Ne=ue.options&&ue.options.ranges;typeof fe.yy.parseError=="function"?this.parseError=fe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function me(Se){G.length=G.length-2*Se,X.length=X.length-Se,W.length=W.length-Se}T(me,"popStack");function ve(){var Se;return Se=V.pop()||ue.lex()||ee,typeof Se!="number"&&(Se instanceof Array&&(V=Se,Se=V.pop()),Se=P.symbols_[Se]||Se),Se}T(ve,"lex");for(var Ge,Te,Ze,ke,Ve={},Qe,nt,tt,je;;){if(Te=G[G.length-1],this.defaultActions[Te]?Ze=this.defaultActions[Te]:((Ge===null||typeof Ge>"u")&&(Ge=ve()),Ze=ie[Te]&&ie[Te][Ge]),typeof Ze>"u"||!Ze.length||!Ze[0]){var Ce="";je=[];for(Qe in ie[Te])this.terminals_[Qe]&&Qe>Z&&je.push("'"+this.terminals_[Qe]+"'");ue.showPosition?Ce="Parse error on line "+(se+1)+`: `+ue.showPosition()+` -Expecting `+je.join(", ")+", got '"+(this.terminals_[Ge]||Ge)+"'":Ce="Parse error on line "+(se+1)+": Unexpected "+(Ge==ee?"end of input":"'"+(this.terminals_[Ge]||Ge)+"'"),this.parseError(Ce,{text:ue.match,token:this.terminals_[Ge]||Ge,line:ue.yylineno,loc:Ae,expected:je})}if(Ze[0]instanceof Array&&Ze.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Te+", token: "+Ge);switch(Ze[0]){case 1:G.push(Ge),Y.push(ue.yytext),W.push(ue.yylloc),G.push(Ze[1]),Ge=null,J=ue.yyleng,K=ue.yytext,se=ue.yylineno,Ae=ue.yylloc;break;case 2:if(nt=this.productions_[Ze[1]][1],Ve.$=Y[Y.length-nt],Ve._$={first_line:W[W.length-(nt||1)].first_line,last_line:W[W.length-1].last_line,first_column:W[W.length-(nt||1)].first_column,last_column:W[W.length-1].last_column},Ne&&(Ve._$.range=[W[W.length-(nt||1)].range[0],W[W.length-1].range[1]]),ke=this.performAction.apply(Ve,[K,J,se,fe.yy,Ze[1],Y,W].concat(ne)),typeof ke<"u")return ke;nt&&(G=G.slice(0,-1*nt*2),Y=Y.slice(0,-1*nt),W=W.slice(0,-1*nt)),G.push(this.productions_[Ze[1]][0]),Y.push(Ve.$),W.push(Ve._$),tt=ie[G[G.length-2]][G[G.length-1]],G.push(tt);break;case 3:return!0}}return!0},"parse")},D=(function(){var $={EOF:1,parseError:x(function(P,G){if(this.yy.parser)this.yy.parser.parseError(P,G);else throw new Error(P)},"parseError"),setInput:x(function(B,P){return this.yy=P||this.yy||{},this._input=B,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var B=this._input[0];this.yytext+=B,this.yyleng++,this.offset++,this.match+=B,this.matched+=B;var P=B.match(/(?:\r\n?|\n).*/g);return P?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),B},"input"),unput:x(function(B){var P=B.length,G=B.split(/(?:\r\n?|\n)/g);this._input=B+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-P),this.offset-=P;var V=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),G.length-1&&(this.yylineno-=G.length-1);var Y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:G?(G.length===V.length?this.yylloc.first_column:0)+V[V.length-G.length].length-G[0].length:this.yylloc.first_column-P},this.options.ranges&&(this.yylloc.range=[Y[0],Y[0]+this.yyleng-P]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(B){this.unput(this.match.slice(B))},"less"),pastInput:x(function(){var B=this.matched.substr(0,this.matched.length-this.match.length);return(B.length>20?"...":"")+B.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var B=this.match;return B.length<20&&(B+=this._input.substr(0,20-B.length)),(B.substr(0,20)+(B.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var B=this.pastInput(),P=new Array(B.length+1).join("-");return B+this.upcomingInput()+` -`+P+"^"},"showPosition"),test_match:x(function(B,P){var G,V,Y;if(this.options.backtrack_lexer&&(Y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Y.yylloc.range=this.yylloc.range.slice(0))),V=B[0].match(/(?:\r\n?|\n).*/g),V&&(this.yylineno+=V.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:V?V[V.length-1].length-V[V.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+B[0].length},this.yytext+=B[0],this.match+=B[0],this.matches=B,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(B[0].length),this.matched+=B[0],G=this.performAction.call(this,this.yy,this,P,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),G)return G;if(this._backtrack){for(var W in Y)this[W]=Y[W];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var B,P,G,V;this._more||(this.yytext="",this.match="");for(var Y=this._currentRules(),W=0;WP[0].length)){if(P=G,V=W,this.options.backtrack_lexer){if(B=this.test_match(G,Y[W]),B!==!1)return B;if(this._backtrack){P=!1;continue}else return!1}else if(!this.options.flex)break}return P?(B=this.test_match(P,Y[V]),B!==!1?B:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var P=this.next();return P||this.lex()},"lex"),begin:x(function(P){this.conditionStack.push(P)},"begin"),popState:x(function(){var P=this.conditionStack.length-1;return P>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(P){return P=this.conditionStack.length-1-Math.abs(P||0),P>=0?this.conditionStack[P]:"INITIAL"},"topState"),pushState:x(function(P){this.begin(P)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(P,G,V,Y){function W(){const ie=G.yytext.indexOf("%%");if(ie===0)return!1;if(ie>0){const K=G.yytext.slice(0,ie),se=G.yytext.slice(ie);se&&P.lexer.unput(se),G.yytext=K}return!0}switch(x(W,"processId"),V){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),G.yytext=G.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),G.yytext=G.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return W()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:return 19;case 53:this.popState();break;case 54:return this.popState(),this.pushState("struct"),20;case 55:return this.popState(),21;case 56:break;case 57:return this.begin("NOTE"),29;case 58:return this.popState(),this.pushState("NOTE_ID"),59;case 59:return this.popState(),this.pushState("NOTE_ID"),60;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 62:break;case 63:return"NOTE_TEXT";case 64:return W()?(this.popState(),"ID"):void 0;case 65:return W()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 66:return this.popState(),G.yytext=G.yytext.substr(2).trim(),31;case 67:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),31;case 68:return 6;case 69:return 6;case 70:return 16;case 71:return 57;case 72:return W()?24:void 0;case 73:return G.yytext=G.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 58;case 77:return 5;case 78:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,55,56,57,71,72,73,74,75,76],inclusive:!1},FLOATING_NOTE_ID:{rules:[64],inclusive:!1},FLOATING_NOTE:{rules:[61,62,63],inclusive:!1},NOTE_TEXT:{rules:[66,67],inclusive:!1},NOTE_ID:{rules:[65],inclusive:!1},NOTE:{rules:[58,59,60],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,54,57,68,69,70,71,72,73,74,76,77,78],inclusive:!0}}};return $})();N.lexer=D;function I(){this.yy={}}return x(I,"Parser"),I.prototype=N,N.Parser=I,new I})();S$.parser=S$;var gme=S$,Dct="TB",mme="TB",yme="dir",rm="state",nm="root",A$="relation",Mct="classDef",Nct="style",Oct="applyClass",KT="default",vme="divider",bme="fill:none",xme="fill: #333",Tme="c",wme="markdown",Cme="normal",_$="rect",R$="rectWithTitle",$ct="stateStart",Pct="stateEnd",kme="divider",Eme="roundedWithTitle",Bct="note",Fct="noteGroup",jT="statediagram",zct="state",Gct=`${jT}-${zct}`,Sme="transition",qct="note",Vct="note-edge",Wct=`${Sme} ${Vct}`,Uct=`${jT}-${qct}`,Hct="cluster",Yct=`${jT}-${Hct}`,Xct="cluster-alt",Kct=`${jT}-${Xct}`,Ame="parent",_me="note",jct="state",L$="----",Zct=`${L$}${_me}`,Rme=`${L$}${Ame}`,Lme=x((t,e=mme)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),Qct=x(function(t,e){return e.db.getClasses()},"getClasses"),Jct=x(async function(t,e,r,n){ae.info("REF0:"),ae.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=Pe();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=Xp(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,Pe().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await Z0(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var w;const g=typeof p=="string"?p:typeof(p==null?void 0:p.id)=="string"?p.id:"";if(!g){ae.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const m=(w=l.node())==null?void 0:w.querySelectorAll("g");let y;if(m==null||m.forEach(k=>{var C;((C=k.textContent)==null?void 0:C.trim())===g&&(y=k)}),!y){ae.warn("⚠️ Could not find node matching text:",g);return}const v=y.parentNode;if(!v){ae.warn("⚠️ Node has no parent, cannot wrap:",g);return}const T=document.createElementNS("http://www.w3.org/2000/svg","a"),b=f.url.replace(/^"+|"+$/g,"");if(T.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",b),T.setAttribute("target","_blank"),f.tooltip){const k=f.tooltip.replace(/^"+|"+$/g,"");T.setAttribute("title",k)}v.replaceChild(T,y),T.appendChild(y),ae.info("🔗 Wrapped node in
tag for:",g,f.url)})}catch(d){ae.error("❌ Error injecting clickable links:",d)}Lr.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Wd(l,h,jT,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),eut={getClasses:Qct,draw:Jct,getDir:Lme},_S=new Map,Mh=0;function RS(t="",e=0,r="",n=L$){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${jct}-${t}${i}-${e}`}x(RS,"stateDomId");var tut=x((t,e,r,n,i,a,s,o)=>{ae.trace("items",e),e.forEach(l=>{switch(l.stmt){case rm:QT(t,l,r,n,i,a,s,o);break;case KT:QT(t,l,r,n,i,a,s,o);break;case A$:{QT(t,l.state1,r,n,i,a,s,o),QT(t,l.state2,r,n,i,a,s,o);const u=s==="neo",h={id:"edge"+Mh,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:bme,labelStyle:"",label:Lt.sanitizeText(l.description??"",Pe()),arrowheadStyle:xme,labelpos:Tme,labelType:wme,thickness:Cme,classes:Sme,look:s};i.push(h),Mh++}break}})},"setupDoc"),Ime=x((t,e=mme)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function ZT(t,e,r){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const a=r.get(i);a&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...a.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}x(ZT,"insertOrUpdateNode");function Dme(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}x(Dme,"getClassesFromDbInfo");function Mme(t){return(t==null?void 0:t.styles)??[]}x(Mme,"getStylesFromDbInfo");var QT=x((t,e,r,n,i,a,s,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=Dme(u),d=Mme(u),f=Pe();if(ae.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=_$;e.start===!0?y=$ct:e.start===!1&&(y=Pct),e.type!==KT&&(y=e.type),_S.get(l)||_S.set(l,{id:l,shape:y,description:Lt.sanitizeText(l,f),cssClasses:`${h} ${Gct}`,cssStyles:d});const v=_S.get(l);e.description&&(Array.isArray(v.description)?(v.shape=R$,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=R$,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=_$,v.description=e.description),v.description=Lt.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===R$&&(v.type==="group"?v.shape=Eme:v.shape=_$),!v.type&&e.doc&&(ae.info("Setting cluster for XCX",l,Ime(e)),v.type="group",v.isGroup=!0,v.dir=Ime(e),v.shape=e.type===vme?kme:Eme,v.cssClasses=`${v.cssClasses} ${Yct} ${a?Kct:""}`);const T={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:RS(l,Mh),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:s,labelType:"markdown"};if(T.shape===kme&&(T.label=""),t&&t.id!=="root"&&(ae.trace("Setting node ",l," to be child of its parent ",t.id),T.parentId=t.id),T.centerLabel=!0,e.note){const b={labelStyle:"",shape:Bct,label:e.note.text,labelType:"markdown",cssClasses:Uct,cssStyles:[],cssCompiledStyles:[],id:l+Zct+"-"+Mh,domId:RS(l,Mh,_me),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:s,position:e.note.position},w=l+Rme,k={labelStyle:"",shape:Fct,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+Rme,domId:RS(l,Mh,Ame),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};Mh++,k.id=w,b.parentId=w,ZT(n,k,o),ZT(n,b,o),ZT(n,T,o);let A=l,C=b.id;e.note.position==="left of"&&(A=b.id,C=l),i.push({id:A+"-"+C,start:A,end:C,arrowhead:"none",arrowTypeEnd:"",style:bme,labelStyle:"",classes:Wct,arrowheadStyle:xme,labelpos:Tme,labelType:wme,thickness:Cme,look:s})}else ZT(n,T,o)}e.doc&&(ae.trace("Adding nodes children "),tut(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),rut=x(()=>{_S.clear(),Mh=0},"reset"),ds={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Nme=x(()=>new Map,"newClassesList"),Ome=x(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),LS=x(t=>JSON.parse(JSON.stringify(t)),"clone"),n0=(u0=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Nme(),this.documents={root:Ome()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=Fn,this.setAccTitle=Dn,this.getAccDescription=Gn,this.setAccDescription=zn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case rm:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case A$:this.addRelation(i.state1,i.state2,i.description);break;case Mct:this.addStyleClass(i.id.trim(),i.classes);break;case Nct:this.handleStyleDef(i);break;case Oct:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=Pe();rut(),QT(void 0,this.getRootDocV2(),r,this.nodes,this.edges,!0,n.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const r=e.id.trim().split(","),n=e.styleClass.split(",");for(const i of r){let a=this.getState(i);if(!a){const s=i.trim();this.addState(s),a=this.getState(s)}a&&(a.styles=n.map(s=>{var o;return(o=s.replace(/;/g,""))==null?void 0:o.trim()}))}}setRootDoc(e){ae.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,r,n){if(r.stmt===A$){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===rm&&(r.id===ds.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==nm&&r.stmt!==rm||!r.doc)return;const i=[];let a=[];for(const s of r.doc)if(s.type===vme){const o=LS(s);o.doc=LS(a),i.push(o),a=[]}else a.push(s);if(i.length>0&&a.length>0){const s={stmt:rm,id:oV(),type:"divider",doc:LS(a)};i.push(LS(s)),r.doc=i}r.doc.forEach(s=>this.docTranslator(r,s,!0))}getRootDocV2(){return this.docTranslator({id:nm,stmt:nm},{id:nm,stmt:nm,doc:this.rootDoc},!0),{id:nm,doc:this.rootDoc}}addState(e,r=KT,n=void 0,i=void 0,a=void 0,s=void 0,o=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))ae.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:rm,id:u,descriptions:[],type:r,doc:n,note:a,classes:[],styles:[],textStyles:[]});else{const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.doc||(h.doc=n),h.type||(h.type=r)}if(i&&(ae.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(d=>this.addDescription(u,d.trim()))),a){const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.note=a,h.note.text=Lt.sanitizeText(h.note.text,Pe())}s&&(ae.info("Setting state classes",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(ae.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(ae.info("Setting state styles",u,o),(Array.isArray(l)?l:[l]).forEach(d=>this.setTextStyle(u,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.documents={root:Ome()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Nme(),e||(this.links=new Map,In())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){ae.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),ae.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===ds.START_NODE?(this.startEndCount++,`${ds.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=KT){return e===ds.START_NODE?ds.START_TYPE:r}endIdIfNeeded(e=""){return e===ds.END_NODE?(this.startEndCount++,`${ds.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=KT){return e===ds.END_NODE?ds.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),s=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(s,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:Lt.sanitizeText(n,Pe())})}addRelation(e,r,n){if(typeof e=="object"&&typeof r=="object")this.addRelationObjs(e,r,n);else if(typeof e=="string"&&typeof r=="string"){const i=this.startIdIfNeeded(e.trim()),a=this.startTypeIfNeeded(e),s=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,a),this.addState(s,o),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:n?Lt.sanitizeText(n,Pe()):void 0})}}addDescription(e,r){var a;const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;(a=n==null?void 0:n.descriptions)==null||a.push(Lt.sanitizeText(i,Pe()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,r=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);r&&n&&r.split(ds.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(ds.COLOR_KEYWORD).exec(i)){const o=a.replace(ds.FILL_KEYWORD,ds.BG_FILL).replace(ds.COLOR_KEYWORD,ds.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setCssClass(e,r){e.split(",").forEach(n=>{var a;let i=this.getState(n);if(!i){const s=n.trim();this.addState(s),i=this.getState(s)}(a=i==null?void 0:i.classes)==null||a.push(r)})}setStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.styles)==null||i.push(r)}setTextStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.textStyles)==null||i.push(r)}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===yme)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??Dct}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:yme,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=Pe();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Lme(this.getRootDocV2())}}getConfig(){return Pe().state}},x(u0,"StateDB"),u0.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},u0),nut=x(t=>` +Expecting `+je.join(", ")+", got '"+(this.terminals_[Ge]||Ge)+"'":Ce="Parse error on line "+(se+1)+": Unexpected "+(Ge==ee?"end of input":"'"+(this.terminals_[Ge]||Ge)+"'"),this.parseError(Ce,{text:ue.match,token:this.terminals_[Ge]||Ge,line:ue.yylineno,loc:Ae,expected:je})}if(Ze[0]instanceof Array&&Ze.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Te+", token: "+Ge);switch(Ze[0]){case 1:G.push(Ge),X.push(ue.yytext),W.push(ue.yylloc),G.push(Ze[1]),Ge=null,J=ue.yyleng,K=ue.yytext,se=ue.yylineno,Ae=ue.yylloc;break;case 2:if(nt=this.productions_[Ze[1]][1],Ve.$=X[X.length-nt],Ve._$={first_line:W[W.length-(nt||1)].first_line,last_line:W[W.length-1].last_line,first_column:W[W.length-(nt||1)].first_column,last_column:W[W.length-1].last_column},Ne&&(Ve._$.range=[W[W.length-(nt||1)].range[0],W[W.length-1].range[1]]),ke=this.performAction.apply(Ve,[K,J,se,fe.yy,Ze[1],X,W].concat(ne)),typeof ke<"u")return ke;nt&&(G=G.slice(0,-1*nt*2),X=X.slice(0,-1*nt),W=W.slice(0,-1*nt)),G.push(this.productions_[Ze[1]][0]),X.push(Ve.$),W.push(Ve._$),tt=ie[G[G.length-2]][G[G.length-1]],G.push(tt);break;case 3:return!0}}return!0},"parse")},D=(function(){var $={EOF:1,parseError:T(function(P,G){if(this.yy.parser)this.yy.parser.parseError(P,G);else throw new Error(P)},"parseError"),setInput:T(function(B,P){return this.yy=P||this.yy||{},this._input=B,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var B=this._input[0];this.yytext+=B,this.yyleng++,this.offset++,this.match+=B,this.matched+=B;var P=B.match(/(?:\r\n?|\n).*/g);return P?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),B},"input"),unput:T(function(B){var P=B.length,G=B.split(/(?:\r\n?|\n)/g);this._input=B+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-P),this.offset-=P;var V=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),G.length-1&&(this.yylineno-=G.length-1);var X=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:G?(G.length===V.length?this.yylloc.first_column:0)+V[V.length-G.length].length-G[0].length:this.yylloc.first_column-P},this.options.ranges&&(this.yylloc.range=[X[0],X[0]+this.yyleng-P]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(B){this.unput(this.match.slice(B))},"less"),pastInput:T(function(){var B=this.matched.substr(0,this.matched.length-this.match.length);return(B.length>20?"...":"")+B.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var B=this.match;return B.length<20&&(B+=this._input.substr(0,20-B.length)),(B.substr(0,20)+(B.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var B=this.pastInput(),P=new Array(B.length+1).join("-");return B+this.upcomingInput()+` +`+P+"^"},"showPosition"),test_match:T(function(B,P){var G,V,X;if(this.options.backtrack_lexer&&(X={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(X.yylloc.range=this.yylloc.range.slice(0))),V=B[0].match(/(?:\r\n?|\n).*/g),V&&(this.yylineno+=V.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:V?V[V.length-1].length-V[V.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+B[0].length},this.yytext+=B[0],this.match+=B[0],this.matches=B,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(B[0].length),this.matched+=B[0],G=this.performAction.call(this,this.yy,this,P,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),G)return G;if(this._backtrack){for(var W in X)this[W]=X[W];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var B,P,G,V;this._more||(this.yytext="",this.match="");for(var X=this._currentRules(),W=0;WP[0].length)){if(P=G,V=W,this.options.backtrack_lexer){if(B=this.test_match(G,X[W]),B!==!1)return B;if(this._backtrack){P=!1;continue}else return!1}else if(!this.options.flex)break}return P?(B=this.test_match(P,X[V]),B!==!1?B:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var P=this.next();return P||this.lex()},"lex"),begin:T(function(P){this.conditionStack.push(P)},"begin"),popState:T(function(){var P=this.conditionStack.length-1;return P>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(P){return P=this.conditionStack.length-1-Math.abs(P||0),P>=0?this.conditionStack[P]:"INITIAL"},"topState"),pushState:T(function(P){this.begin(P)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(P,G,V,X){function W(){const ie=G.yytext.indexOf("%%");if(ie===0)return!1;if(ie>0){const K=G.yytext.slice(0,ie),se=G.yytext.slice(ie);se&&P.lexer.unput(se),G.yytext=K}return!0}switch(T(W,"processId"),V){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),G.yytext=G.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),G.yytext=G.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return W()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:return 19;case 53:this.popState();break;case 54:return this.popState(),this.pushState("struct"),20;case 55:return this.popState(),21;case 56:break;case 57:return this.begin("NOTE"),29;case 58:return this.popState(),this.pushState("NOTE_ID"),59;case 59:return this.popState(),this.pushState("NOTE_ID"),60;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 62:break;case 63:return"NOTE_TEXT";case 64:return W()?(this.popState(),"ID"):void 0;case 65:return W()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 66:return this.popState(),G.yytext=G.yytext.substr(2).trim(),31;case 67:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),31;case 68:return 6;case 69:return 6;case 70:return 16;case 71:return 57;case 72:return W()?24:void 0;case 73:return G.yytext=G.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 58;case 77:return 5;case 78:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,55,56,57,71,72,73,74,75,76],inclusive:!1},FLOATING_NOTE_ID:{rules:[64],inclusive:!1},FLOATING_NOTE:{rules:[61,62,63],inclusive:!1},NOTE_TEXT:{rules:[66,67],inclusive:!1},NOTE_ID:{rules:[65],inclusive:!1},NOTE:{rules:[58,59,60],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,54,57,68,69,70,71,72,73,74,76,77,78],inclusive:!0}}};return $})();N.lexer=D;function I(){this.yy={}}return T(I,"Parser"),I.prototype=N,N.Parser=I,new I})();I$.parser=I$;var Tme=I$,Uct="TB",wme="TB",Cme="dir",nm="state",im="root",D$="relation",Hct="classDef",Yct="style",Xct="applyClass",ZT="default",kme="divider",Eme="fill:none",Sme="fill: #333",Ame="c",_me="markdown",Rme="normal",M$="rect",N$="rectWithTitle",Kct="stateStart",jct="stateEnd",Lme="divider",Ime="roundedWithTitle",Zct="note",Qct="noteGroup",QT="statediagram",Jct="state",eut=`${QT}-${Jct}`,Dme="transition",tut="note",rut="note-edge",nut=`${Dme} ${rut}`,iut=`${QT}-${tut}`,aut="cluster",sut=`${QT}-${aut}`,out="cluster-alt",lut=`${QT}-${out}`,Mme="parent",Nme="note",cut="state",O$="----",uut=`${O$}${Nme}`,Ome=`${O$}${Mme}`,$me=T((t,e=wme)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),hut=T(function(t,e){return e.db.getClasses()},"getClasses"),dut=T(async function(t,e,r,n){ae.info("REF0:"),ae.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=Pe();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=K0(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,Pe().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await Zp(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var w;const g=typeof p=="string"?p:typeof(p==null?void 0:p.id)=="string"?p.id:"";if(!g){ae.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const m=(w=l.node())==null?void 0:w.querySelectorAll("g");let y;if(m==null||m.forEach(k=>{var C;((C=k.textContent)==null?void 0:C.trim())===g&&(y=k)}),!y){ae.warn("⚠️ Could not find node matching text:",g);return}const v=y.parentNode;if(!v){ae.warn("⚠️ Node has no parent, cannot wrap:",g);return}const x=document.createElementNS("http://www.w3.org/2000/svg","a"),b=f.url.replace(/^"+|"+$/g,"");if(x.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",b),x.setAttribute("target","_blank"),f.tooltip){const k=f.tooltip.replace(/^"+|"+$/g,"");x.setAttribute("title",k)}v.replaceChild(x,y),x.appendChild(y),ae.info("🔗 Wrapped node in tag for:",g,f.url)})}catch(d){ae.error("❌ Error injecting clickable links:",d)}Lr.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Wd(l,h,QT,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),fut={getClasses:hut,draw:dut,getDir:$me},IS=new Map,Mh=0;function DS(t="",e=0,r="",n=O$){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${cut}-${t}${i}-${e}`}T(DS,"stateDomId");var put=T((t,e,r,n,i,a,s,o)=>{ae.trace("items",e),e.forEach(l=>{switch(l.stmt){case nm:ew(t,l,r,n,i,a,s,o);break;case ZT:ew(t,l,r,n,i,a,s,o);break;case D$:{ew(t,l.state1,r,n,i,a,s,o),ew(t,l.state2,r,n,i,a,s,o);const u=s==="neo",h={id:"edge"+Mh,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:Eme,labelStyle:"",label:Lt.sanitizeText(l.description??"",Pe()),arrowheadStyle:Sme,labelpos:Ame,labelType:_me,thickness:Rme,classes:Dme,look:s};i.push(h),Mh++}break}})},"setupDoc"),Pme=T((t,e=wme)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function JT(t,e,r){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const a=r.get(i);a&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...a.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}T(JT,"insertOrUpdateNode");function Bme(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}T(Bme,"getClassesFromDbInfo");function Fme(t){return(t==null?void 0:t.styles)??[]}T(Fme,"getStylesFromDbInfo");var ew=T((t,e,r,n,i,a,s,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=Bme(u),d=Fme(u),f=Pe();if(ae.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=M$;e.start===!0?y=Kct:e.start===!1&&(y=jct),e.type!==ZT&&(y=e.type),IS.get(l)||IS.set(l,{id:l,shape:y,description:Lt.sanitizeText(l,f),cssClasses:`${h} ${eut}`,cssStyles:d});const v=IS.get(l);e.description&&(Array.isArray(v.description)?(v.shape=N$,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=N$,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=M$,v.description=e.description),v.description=Lt.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===N$&&(v.type==="group"?v.shape=Ime:v.shape=M$),!v.type&&e.doc&&(ae.info("Setting cluster for XCX",l,Pme(e)),v.type="group",v.isGroup=!0,v.dir=Pme(e),v.shape=e.type===kme?Lme:Ime,v.cssClasses=`${v.cssClasses} ${sut} ${a?lut:""}`);const x={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:DS(l,Mh),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:s,labelType:"markdown"};if(x.shape===Lme&&(x.label=""),t&&t.id!=="root"&&(ae.trace("Setting node ",l," to be child of its parent ",t.id),x.parentId=t.id),x.centerLabel=!0,e.note){const b={labelStyle:"",shape:Zct,label:e.note.text,labelType:"markdown",cssClasses:iut,cssStyles:[],cssCompiledStyles:[],id:l+uut+"-"+Mh,domId:DS(l,Mh,Nme),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:s,position:e.note.position},w=l+Ome,k={labelStyle:"",shape:Qct,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+Ome,domId:DS(l,Mh,Mme),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};Mh++,k.id=w,b.parentId=w,JT(n,k,o),JT(n,b,o),JT(n,x,o);let S=l,C=b.id;e.note.position==="left of"&&(S=b.id,C=l),i.push({id:S+"-"+C,start:S,end:C,arrowhead:"none",arrowTypeEnd:"",style:Eme,labelStyle:"",classes:nut,arrowheadStyle:Sme,labelpos:Ame,labelType:_me,thickness:Rme,look:s})}else JT(n,x,o)}e.doc&&(ae.trace("Adding nodes children "),put(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),gut=T(()=>{IS.clear(),Mh=0},"reset"),ds={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},zme=T(()=>new Map,"newClassesList"),Gme=T(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),MS=T(t=>JSON.parse(JSON.stringify(t)),"clone"),np=(up=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=zme(),this.documents={root:Gme()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=Fn,this.setAccTitle=Dn,this.getAccDescription=Gn,this.setAccDescription=zn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case nm:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case D$:this.addRelation(i.state1,i.state2,i.description);break;case Hct:this.addStyleClass(i.id.trim(),i.classes);break;case Yct:this.handleStyleDef(i);break;case Xct:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=Pe();gut(),ew(void 0,this.getRootDocV2(),r,this.nodes,this.edges,!0,n.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const r=e.id.trim().split(","),n=e.styleClass.split(",");for(const i of r){let a=this.getState(i);if(!a){const s=i.trim();this.addState(s),a=this.getState(s)}a&&(a.styles=n.map(s=>{var o;return(o=s.replace(/;/g,""))==null?void 0:o.trim()}))}}setRootDoc(e){ae.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,r,n){if(r.stmt===D$){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===nm&&(r.id===ds.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==im&&r.stmt!==nm||!r.doc)return;const i=[];let a=[];for(const s of r.doc)if(s.type===kme){const o=MS(s);o.doc=MS(a),i.push(o),a=[]}else a.push(s);if(i.length>0&&a.length>0){const s={stmt:nm,id:dV(),type:"divider",doc:MS(a)};i.push(MS(s)),r.doc=i}r.doc.forEach(s=>this.docTranslator(r,s,!0))}getRootDocV2(){return this.docTranslator({id:im,stmt:im},{id:im,stmt:im,doc:this.rootDoc},!0),{id:im,doc:this.rootDoc}}addState(e,r=ZT,n=void 0,i=void 0,a=void 0,s=void 0,o=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))ae.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:nm,id:u,descriptions:[],type:r,doc:n,note:a,classes:[],styles:[],textStyles:[]});else{const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.doc||(h.doc=n),h.type||(h.type=r)}if(i&&(ae.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(d=>this.addDescription(u,d.trim()))),a){const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.note=a,h.note.text=Lt.sanitizeText(h.note.text,Pe())}s&&(ae.info("Setting state classes",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(ae.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(ae.info("Setting state styles",u,o),(Array.isArray(l)?l:[l]).forEach(d=>this.setTextStyle(u,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.documents={root:Gme()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=zme(),e||(this.links=new Map,In())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){ae.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),ae.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===ds.START_NODE?(this.startEndCount++,`${ds.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=ZT){return e===ds.START_NODE?ds.START_TYPE:r}endIdIfNeeded(e=""){return e===ds.END_NODE?(this.startEndCount++,`${ds.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=ZT){return e===ds.END_NODE?ds.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),s=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(s,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:Lt.sanitizeText(n,Pe())})}addRelation(e,r,n){if(typeof e=="object"&&typeof r=="object")this.addRelationObjs(e,r,n);else if(typeof e=="string"&&typeof r=="string"){const i=this.startIdIfNeeded(e.trim()),a=this.startTypeIfNeeded(e),s=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,a),this.addState(s,o),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:n?Lt.sanitizeText(n,Pe()):void 0})}}addDescription(e,r){var a;const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;(a=n==null?void 0:n.descriptions)==null||a.push(Lt.sanitizeText(i,Pe()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,r=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);r&&n&&r.split(ds.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(ds.COLOR_KEYWORD).exec(i)){const o=a.replace(ds.FILL_KEYWORD,ds.BG_FILL).replace(ds.COLOR_KEYWORD,ds.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setCssClass(e,r){e.split(",").forEach(n=>{var a;let i=this.getState(n);if(!i){const s=n.trim();this.addState(s),i=this.getState(s)}(a=i==null?void 0:i.classes)==null||a.push(r)})}setStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.styles)==null||i.push(r)}setTextStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.textStyles)==null||i.push(r)}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===Cme)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??Uct}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:Cme,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=Pe();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:$me(this.getRootDocV2())}}getConfig(){return Pe().state}},T(up,"StateDB"),up.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},up),mut=T(t=>` defs [id$="-barbEnd"] { fill: ${t.transitionColor}; stroke: ${t.transitionColor}; @@ -2456,12 +2456,12 @@ g.stateGroup line { ry: ${t.radius}px; filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} } -`,"getStyles"),$me=nut,iut=x(t=>t.append("circle").attr("class","start-state").attr("r",Pe().state.sizeUnit).attr("cx",Pe().state.padding+Pe().state.sizeUnit).attr("cy",Pe().state.padding+Pe().state.sizeUnit),"drawStartState"),aut=x(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Pe().state.textHeight).attr("class","divider").attr("x2",Pe().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),sut=x((t,e)=>{const r=t.append("text").attr("x",2*Pe().state.padding).attr("y",Pe().state.textHeight+2*Pe().state.padding).attr("font-size",Pe().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",Pe().state.padding).attr("y",Pe().state.padding).attr("width",n.width+2*Pe().state.padding).attr("height",n.height+2*Pe().state.padding).attr("rx",Pe().state.radius),r},"drawSimpleState"),out=x((t,e)=>{const r=x(function(f,p,g){const m=f.append("tspan").attr("x",2*Pe().state.padding).text(p);g||m.attr("dy",Pe().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*Pe().state.padding).attr("y",Pe().state.textHeight+1.3*Pe().state.padding).attr("font-size",Pe().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",Pe().state.padding).attr("y",a+Pe().state.padding*.4+Pe().state.dividerMargin+Pe().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach(function(f){o||(r(s,f,l),l=!1),o=!1});const u=t.append("line").attr("x1",Pe().state.padding).attr("y1",Pe().state.padding+a+Pe().state.dividerMargin/2).attr("y2",Pe().state.padding+a+Pe().state.dividerMargin/2).attr("class","descr-divider"),h=s.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*Pe().state.padding),t.insert("rect",":first-child").attr("x",Pe().state.padding).attr("y",Pe().state.padding).attr("width",d+2*Pe().state.padding).attr("height",h.height+a+2*Pe().state.padding).attr("rx",Pe().state.radius),t},"drawDescrState"),lut=x((t,e,r)=>{const n=Pe().state.padding,i=2*Pe().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",Pe().state.titleShift).attr("font-size",Pe().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,s);d===s&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=o-n,h>s&&(f=(s-d)/2+n),Math.abs(o-p.x)s&&(f=o-(h-s)/2);const g=1-Pe().state.textHeight;return t.insert("rect",":first-child").attr("x",f).attr("y",g).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",p.height+Pe().state.textHeight+Pe().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=s&&l.attr("x",o+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",Pe().state.titleShift-Pe().state.textHeight-Pe().state.padding).attr("width",d).attr("height",Pe().state.textHeight*3).attr("rx",Pe().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",Pe().state.titleShift-Pe().state.textHeight-Pe().state.padding).attr("width",d).attr("height",p.height+3+2*Pe().state.textHeight).attr("rx",Pe().state.radius),t},"addTitleAndBox"),cut=x(t=>(t.append("circle").attr("class","end-state-outer").attr("r",Pe().state.sizeUnit+Pe().state.miniPadding).attr("cx",Pe().state.padding+Pe().state.sizeUnit+Pe().state.miniPadding).attr("cy",Pe().state.padding+Pe().state.sizeUnit+Pe().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Pe().state.sizeUnit).attr("cx",Pe().state.padding+Pe().state.sizeUnit+2).attr("cy",Pe().state.padding+Pe().state.sizeUnit+2)),"drawEndState"),uut=x((t,e)=>{let r=Pe().state.forkWidth,n=Pe().state.forkHeight;if(e.parentId){let i=r;r=n,n=i}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",Pe().state.padding).attr("y",Pe().state.padding)},"drawForkJoinState"),hut=x((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"
");s=s.replace(/\n/g,"
");const o=s.split(Lt.lineBreakRegex);let l=1.25*Pe().state.noteMargin;for(const u of o){const h=u.trim();if(h.length>0){const d=a.append("tspan");if(d.text(h),l===0){const f=d.node().getBBox();l+=f.height}i+=l,d.attr("x",e+Pe().state.noteMargin),d.attr("y",r+i+1.25*Pe().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),dut=x((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",Pe().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=hut(t,0,0,n);return r.attr("height",a+2*Pe().state.noteMargin),r.attr("width",i+Pe().state.noteMargin*2),r},"drawNote"),Pme=x(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&iut(i),e.type==="end"&&cut(i),(e.type==="fork"||e.type==="join")&&uut(i,e),e.type==="note"&&dut(e.note.text,i),e.type==="divider"&&aut(i),e.type==="default"&&e.descriptions.length===0&&sut(i,e),e.type==="default"&&e.descriptions.length>0&&out(i,e);const a=i.node().getBBox();return n.width=a.width+2*Pe().state.padding,n.height=a.height+2*Pe().state.padding,n},"drawState"),Bme=0,fut=x(function(t,e,r){const n=x(function(l){switch(l){case n0.relationType.AGGREGATION:return"aggregation";case n0.relationType.EXTENSION:return"extension";case n0.relationType.COMPOSITION:return"composition";case n0.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=M2().x(function(l){return l.x}).y(function(l){return l.y}).curve(N2),s=t.append("path").attr("d",a(i)).attr("id","edge"+Bme).attr("class","transition");let o="";if(Pe().state.arrowMarkerAbsolute&&(o=Aw(!0)),s.attr("marker-end","url("+o+"#"+n(n0.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=Lr.calcLabelPosition(e.points),d=Lt.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let T=0;T<=d.length;T++){const b=l.append("text").attr("text-anchor","middle").text(d[T]).attr("x",u).attr("y",h+f),w=b.node().getBBox();g=Math.max(g,w.width),m=Math.min(m,w.x),ae.info(w.x,u,h+f),f===0&&(f=b.node().getBBox().height,ae.info("Title height",f,h)),p.push(b)}let y=f*d.length;if(d.length>1){const T=(d.length-1)*f*.5;p.forEach((b,w)=>b.attr("y",h+w*f-T)),y=f*d.length}const v=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-Pe().state.padding/2).attr("y",h-y/2-Pe().state.padding/2-3.5).attr("width",g+Pe().state.padding).attr("height",y+Pe().state.padding),ae.info(v)}Bme++},"drawEdge"),to,I$={},put=x(function(){},"setConf"),gut=x(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),mut=x(function(t,e,r,n){to=Pe().state;const i=Pe().securityLevel;let a;i==="sandbox"&&(a=pt("#i"+e));const s=pt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?a.nodes()[0].contentDocument:document;ae.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);gut(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");Fme(u,h,void 0,!1,s,o,n);const d=to.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;wi(l,g,m,to.useMaxWidth),l.attr("viewBox",`${f.x-to.padding} ${f.y-to.padding} `+p+" "+g)},"draw"),yut=x(t=>t?t.length*to.fontSizeFactor:1,"getLabelWidth"),Fme=x((t,e,r,n,i,a,s)=>{const o=new Ts({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const w=b.parentElement;let k=0,A=0;w&&(w.parentElement&&(k=w.parentElement.getBBox().width),A=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(A)&&(A=0)),b.setAttribute("x1",0-A+8),b.setAttribute("x2",k-A-8)})):ae.debug("No Node "+v+": "+JSON.stringify(o.node(v)))});let m=g.getBBox();o.edges().forEach(function(v){v!==void 0&&o.edge(v)!==void 0&&(ae.debug("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(o.edge(v))),fut(e,o.edge(v),o.edge(v).relation))}),m=g.getBBox();const y={id:r||"root",label:r||"root",width:0,height:0};return y.width=m.width+2*to.padding,y.height=m.height+2*to.padding,ae.debug("Doc rendered",y,o),y},"renderDoc"),vut={setConf:put,draw:mut},but={parser:gme,get db(){return new n0(1)},renderer:vut,styles:$me,init:x(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const xut=Object.freeze(Object.defineProperty({__proto__:null,diagram:but},Symbol.toStringTag,{value:"Module"}));var Tut={parser:gme,get db(){return new n0(2)},renderer:eut,styles:$me,init:x(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const wut=Object.freeze(Object.defineProperty({__proto__:null,diagram:Tut},Symbol.toStringTag,{value:"Module"}));var D$=(function(){var t=x(function(d,f,p,g){for(p=p||{},g=d.length;g--;p[d[g]]=f);return p},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],o=[1,14],l={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:x(function(f,p,g,m,y,v,T){var b=v.length-1;switch(y){case 1:return v[b-1];case 2:this.$=[];break;case 3:v[b-1].push(v[b]),this.$=v[b-1];break;case 4:case 5:this.$=v[b];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(v[b].substr(6)),this.$=v[b].substr(6);break;case 9:this.$=v[b].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=v[b].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(v[b].substr(8)),this.$=v[b].substr(8);break;case 13:m.addTask(v[b-1],v[b]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:x(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:x(function(f){var p=this,g=[0],m=[],y=[null],v=[],T=this.table,b="",w=0,k=0,A=2,C=1,_=v.slice.call(arguments,1),L=Object.create(this.lexer),O={yy:{}};for(var M in this.yy)Object.prototype.hasOwnProperty.call(this.yy,M)&&(O.yy[M]=this.yy[M]);L.setInput(f,O.yy),O.yy.lexer=L,O.yy.parser=this,typeof L.yylloc>"u"&&(L.yylloc={});var z=L.yylloc;v.push(z);var F=L.options&&L.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function S(ie){g.length=g.length-2*ie,y.length=y.length-ie,v.length=v.length-ie}x(S,"popStack");function R(){var ie;return ie=m.pop()||L.lex()||C,typeof ie!="number"&&(ie instanceof Array&&(m=ie,ie=m.pop()),ie=p.symbols_[ie]||ie),ie}x(R,"lex");for(var N,D,I,$,B={},P,G,V,Y;;){if(D=g[g.length-1],this.defaultActions[D]?I=this.defaultActions[D]:((N===null||typeof N>"u")&&(N=R()),I=T[D]&&T[D][N]),typeof I>"u"||!I.length||!I[0]){var W="";Y=[];for(P in T[D])this.terminals_[P]&&P>A&&Y.push("'"+this.terminals_[P]+"'");L.showPosition?W="Parse error on line "+(w+1)+`: +`,"getStyles"),qme=mut,yut=T(t=>t.append("circle").attr("class","start-state").attr("r",Pe().state.sizeUnit).attr("cx",Pe().state.padding+Pe().state.sizeUnit).attr("cy",Pe().state.padding+Pe().state.sizeUnit),"drawStartState"),vut=T(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Pe().state.textHeight).attr("class","divider").attr("x2",Pe().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),but=T((t,e)=>{const r=t.append("text").attr("x",2*Pe().state.padding).attr("y",Pe().state.textHeight+2*Pe().state.padding).attr("font-size",Pe().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",Pe().state.padding).attr("y",Pe().state.padding).attr("width",n.width+2*Pe().state.padding).attr("height",n.height+2*Pe().state.padding).attr("rx",Pe().state.radius),r},"drawSimpleState"),xut=T((t,e)=>{const r=T(function(f,p,g){const m=f.append("tspan").attr("x",2*Pe().state.padding).text(p);g||m.attr("dy",Pe().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*Pe().state.padding).attr("y",Pe().state.textHeight+1.3*Pe().state.padding).attr("font-size",Pe().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",Pe().state.padding).attr("y",a+Pe().state.padding*.4+Pe().state.dividerMargin+Pe().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach(function(f){o||(r(s,f,l),l=!1),o=!1});const u=t.append("line").attr("x1",Pe().state.padding).attr("y1",Pe().state.padding+a+Pe().state.dividerMargin/2).attr("y2",Pe().state.padding+a+Pe().state.dividerMargin/2).attr("class","descr-divider"),h=s.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*Pe().state.padding),t.insert("rect",":first-child").attr("x",Pe().state.padding).attr("y",Pe().state.padding).attr("width",d+2*Pe().state.padding).attr("height",h.height+a+2*Pe().state.padding).attr("rx",Pe().state.radius),t},"drawDescrState"),Tut=T((t,e,r)=>{const n=Pe().state.padding,i=2*Pe().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",Pe().state.titleShift).attr("font-size",Pe().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,s);d===s&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=o-n,h>s&&(f=(s-d)/2+n),Math.abs(o-p.x)s&&(f=o-(h-s)/2);const g=1-Pe().state.textHeight;return t.insert("rect",":first-child").attr("x",f).attr("y",g).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",p.height+Pe().state.textHeight+Pe().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=s&&l.attr("x",o+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",Pe().state.titleShift-Pe().state.textHeight-Pe().state.padding).attr("width",d).attr("height",Pe().state.textHeight*3).attr("rx",Pe().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",Pe().state.titleShift-Pe().state.textHeight-Pe().state.padding).attr("width",d).attr("height",p.height+3+2*Pe().state.textHeight).attr("rx",Pe().state.radius),t},"addTitleAndBox"),wut=T(t=>(t.append("circle").attr("class","end-state-outer").attr("r",Pe().state.sizeUnit+Pe().state.miniPadding).attr("cx",Pe().state.padding+Pe().state.sizeUnit+Pe().state.miniPadding).attr("cy",Pe().state.padding+Pe().state.sizeUnit+Pe().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Pe().state.sizeUnit).attr("cx",Pe().state.padding+Pe().state.sizeUnit+2).attr("cy",Pe().state.padding+Pe().state.sizeUnit+2)),"drawEndState"),Cut=T((t,e)=>{let r=Pe().state.forkWidth,n=Pe().state.forkHeight;if(e.parentId){let i=r;r=n,n=i}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",Pe().state.padding).attr("y",Pe().state.padding)},"drawForkJoinState"),kut=T((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"
");s=s.replace(/\n/g,"
");const o=s.split(Lt.lineBreakRegex);let l=1.25*Pe().state.noteMargin;for(const u of o){const h=u.trim();if(h.length>0){const d=a.append("tspan");if(d.text(h),l===0){const f=d.node().getBBox();l+=f.height}i+=l,d.attr("x",e+Pe().state.noteMargin),d.attr("y",r+i+1.25*Pe().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),Eut=T((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",Pe().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=kut(t,0,0,n);return r.attr("height",a+2*Pe().state.noteMargin),r.attr("width",i+Pe().state.noteMargin*2),r},"drawNote"),Vme=T(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&yut(i),e.type==="end"&&wut(i),(e.type==="fork"||e.type==="join")&&Cut(i,e),e.type==="note"&&Eut(e.note.text,i),e.type==="divider"&&vut(i),e.type==="default"&&e.descriptions.length===0&&but(i,e),e.type==="default"&&e.descriptions.length>0&&xut(i,e);const a=i.node().getBBox();return n.width=a.width+2*Pe().state.padding,n.height=a.height+2*Pe().state.padding,n},"drawState"),Wme=0,Sut=T(function(t,e,r){const n=T(function(l){switch(l){case np.relationType.AGGREGATION:return"aggregation";case np.relationType.EXTENSION:return"extension";case np.relationType.COMPOSITION:return"composition";case np.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=N2().x(function(l){return l.x}).y(function(l){return l.y}).curve(O2),s=t.append("path").attr("d",a(i)).attr("id","edge"+Wme).attr("class","transition");let o="";if(Pe().state.arrowMarkerAbsolute&&(o=Rw(!0)),s.attr("marker-end","url("+o+"#"+n(np.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=Lr.calcLabelPosition(e.points),d=Lt.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let x=0;x<=d.length;x++){const b=l.append("text").attr("text-anchor","middle").text(d[x]).attr("x",u).attr("y",h+f),w=b.node().getBBox();g=Math.max(g,w.width),m=Math.min(m,w.x),ae.info(w.x,u,h+f),f===0&&(f=b.node().getBBox().height,ae.info("Title height",f,h)),p.push(b)}let y=f*d.length;if(d.length>1){const x=(d.length-1)*f*.5;p.forEach((b,w)=>b.attr("y",h+w*f-x)),y=f*d.length}const v=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-Pe().state.padding/2).attr("y",h-y/2-Pe().state.padding/2-3.5).attr("width",g+Pe().state.padding).attr("height",y+Pe().state.padding),ae.info(v)}Wme++},"drawEdge"),to,$$={},Aut=T(function(){},"setConf"),_ut=T(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),Rut=T(function(t,e,r,n){to=Pe().state;const i=Pe().securityLevel;let a;i==="sandbox"&&(a=pt("#i"+e));const s=pt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?a.nodes()[0].contentDocument:document;ae.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);_ut(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");Ume(u,h,void 0,!1,s,o,n);const d=to.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;wi(l,g,m,to.useMaxWidth),l.attr("viewBox",`${f.x-to.padding} ${f.y-to.padding} `+p+" "+g)},"draw"),Lut=T(t=>t?t.length*to.fontSizeFactor:1,"getLabelWidth"),Ume=T((t,e,r,n,i,a,s)=>{const o=new Ts({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const w=b.parentElement;let k=0,S=0;w&&(w.parentElement&&(k=w.parentElement.getBBox().width),S=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(S)&&(S=0)),b.setAttribute("x1",0-S+8),b.setAttribute("x2",k-S-8)})):ae.debug("No Node "+v+": "+JSON.stringify(o.node(v)))});let m=g.getBBox();o.edges().forEach(function(v){v!==void 0&&o.edge(v)!==void 0&&(ae.debug("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(o.edge(v))),Sut(e,o.edge(v),o.edge(v).relation))}),m=g.getBBox();const y={id:r||"root",label:r||"root",width:0,height:0};return y.width=m.width+2*to.padding,y.height=m.height+2*to.padding,ae.debug("Doc rendered",y,o),y},"renderDoc"),Iut={setConf:Aut,draw:Rut},Dut={parser:Tme,get db(){return new np(1)},renderer:Iut,styles:qme,init:T(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Mut=Object.freeze(Object.defineProperty({__proto__:null,diagram:Dut},Symbol.toStringTag,{value:"Module"}));var Nut={parser:Tme,get db(){return new np(2)},renderer:fut,styles:qme,init:T(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Out=Object.freeze(Object.defineProperty({__proto__:null,diagram:Nut},Symbol.toStringTag,{value:"Module"}));var P$=(function(){var t=T(function(d,f,p,g){for(p=p||{},g=d.length;g--;p[d[g]]=f);return p},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],o=[1,14],l={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:T(function(f,p,g,m,y,v,x){var b=v.length-1;switch(y){case 1:return v[b-1];case 2:this.$=[];break;case 3:v[b-1].push(v[b]),this.$=v[b-1];break;case 4:case 5:this.$=v[b];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(v[b].substr(6)),this.$=v[b].substr(6);break;case 9:this.$=v[b].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=v[b].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(v[b].substr(8)),this.$=v[b].substr(8);break;case 13:m.addTask(v[b-1],v[b]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:T(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:T(function(f){var p=this,g=[0],m=[],y=[null],v=[],x=this.table,b="",w=0,k=0,S=2,C=1,_=v.slice.call(arguments,1),L=Object.create(this.lexer),O={yy:{}};for(var M in this.yy)Object.prototype.hasOwnProperty.call(this.yy,M)&&(O.yy[M]=this.yy[M]);L.setInput(f,O.yy),O.yy.lexer=L,O.yy.parser=this,typeof L.yylloc>"u"&&(L.yylloc={});var z=L.yylloc;v.push(z);var F=L.options&&L.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function A(ie){g.length=g.length-2*ie,y.length=y.length-ie,v.length=v.length-ie}T(A,"popStack");function R(){var ie;return ie=m.pop()||L.lex()||C,typeof ie!="number"&&(ie instanceof Array&&(m=ie,ie=m.pop()),ie=p.symbols_[ie]||ie),ie}T(R,"lex");for(var N,D,I,$,B={},P,G,V,X;;){if(D=g[g.length-1],this.defaultActions[D]?I=this.defaultActions[D]:((N===null||typeof N>"u")&&(N=R()),I=x[D]&&x[D][N]),typeof I>"u"||!I.length||!I[0]){var W="";X=[];for(P in x[D])this.terminals_[P]&&P>S&&X.push("'"+this.terminals_[P]+"'");L.showPosition?W="Parse error on line "+(w+1)+`: `+L.showPosition()+` -Expecting `+Y.join(", ")+", got '"+(this.terminals_[N]||N)+"'":W="Parse error on line "+(w+1)+": Unexpected "+(N==C?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(W,{text:L.match,token:this.terminals_[N]||N,line:L.yylineno,loc:z,expected:Y})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+D+", token: "+N);switch(I[0]){case 1:g.push(N),y.push(L.yytext),v.push(L.yylloc),g.push(I[1]),N=null,k=L.yyleng,b=L.yytext,w=L.yylineno,z=L.yylloc;break;case 2:if(G=this.productions_[I[1]][1],B.$=y[y.length-G],B._$={first_line:v[v.length-(G||1)].first_line,last_line:v[v.length-1].last_line,first_column:v[v.length-(G||1)].first_column,last_column:v[v.length-1].last_column},F&&(B._$.range=[v[v.length-(G||1)].range[0],v[v.length-1].range[1]]),$=this.performAction.apply(B,[b,k,w,O.yy,I[1],y,v].concat(_)),typeof $<"u")return $;G&&(g=g.slice(0,-1*G*2),y=y.slice(0,-1*G),v=v.slice(0,-1*G)),g.push(this.productions_[I[1]][0]),y.push(B.$),v.push(B._$),V=T[g[g.length-2]][g[g.length-1]],g.push(V);break;case 3:return!0}}return!0},"parse")},u=(function(){var d={EOF:1,parseError:x(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:x(function(f,p){return this.yy=p||this.yy||{},this._input=f,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var p=f.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),f},"input"),unput:x(function(f){var p=f.length,g=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===m.length?this.yylloc.first_column:0)+m[m.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(f){this.unput(this.match.slice(f))},"less"),pastInput:x(function(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var f=this.match;return f.length<20&&(f+=this._input.substr(0,20-f.length)),(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var f=this.pastInput(),p=new Array(f.length+1).join("-");return f+this.upcomingInput()+` -`+p+"^"},"showPosition"),test_match:x(function(f,p){var g,m,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),m=f[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+f[0].length},this.yytext+=f[0],this.match+=f[0],this.matches=f,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(f[0].length),this.matched+=f[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var v in y)this[v]=y[v];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var f,p,g,m;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),v=0;vp[0].length)){if(p=g,m=v,this.options.backtrack_lexer){if(f=this.test_match(g,y[v]),f!==!1)return f;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(f=this.test_match(p,y[m]),f!==!1?f:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var p=this.next();return p||this.lex()},"lex"),begin:x(function(p){this.conditionStack.push(p)},"begin"),popState:x(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:x(function(p){this.begin(p)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(p,g,m,y){switch(m){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return d})();l.lexer=u;function h(){this.yy={}}return x(h,"Parser"),h.prototype=l,l.Parser=h,new h})();D$.parser=D$;var Cut=D$,im="",M$=[],JT=[],ew=[],kut=x(function(){M$.length=0,JT.length=0,im="",ew.length=0,In()},"clear"),Eut=x(function(t){im=t,M$.push(t)},"addSection"),Sut=x(function(){return M$},"getSections"),Aut=x(function(){let t=zme();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),Rut=x(function(t,e){const r=e.substr(1).split(":");let n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const a=i.map(o=>o.trim()),s={section:im,type:im,people:a,task:t,score:n};ew.push(s)},"addTask"),Lut=x(function(t){const e={section:im,type:im,description:t,task:t,classes:[]};JT.push(e)},"addTaskOrg"),zme=x(function(){const t=x(function(r){return ew[r].processed},"compileTask");let e=!0;for(const[r,n]of ew.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Iut=x(function(){return _ut()},"getActors"),Gme={getConfig:x(()=>Pe().journey,"getConfig"),clear:kut,setDiagramTitle:qn,getDiagramTitle:Mn,setAccTitle:Dn,getAccTitle:Fn,setAccDescription:zn,getAccDescription:Gn,addSection:Eut,getSections:Sut,getTasks:Aut,addTask:Rut,addTaskOrg:Lut,getActors:Iut},Dut=x(t=>`.label { +Expecting `+X.join(", ")+", got '"+(this.terminals_[N]||N)+"'":W="Parse error on line "+(w+1)+": Unexpected "+(N==C?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(W,{text:L.match,token:this.terminals_[N]||N,line:L.yylineno,loc:z,expected:X})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+D+", token: "+N);switch(I[0]){case 1:g.push(N),y.push(L.yytext),v.push(L.yylloc),g.push(I[1]),N=null,k=L.yyleng,b=L.yytext,w=L.yylineno,z=L.yylloc;break;case 2:if(G=this.productions_[I[1]][1],B.$=y[y.length-G],B._$={first_line:v[v.length-(G||1)].first_line,last_line:v[v.length-1].last_line,first_column:v[v.length-(G||1)].first_column,last_column:v[v.length-1].last_column},F&&(B._$.range=[v[v.length-(G||1)].range[0],v[v.length-1].range[1]]),$=this.performAction.apply(B,[b,k,w,O.yy,I[1],y,v].concat(_)),typeof $<"u")return $;G&&(g=g.slice(0,-1*G*2),y=y.slice(0,-1*G),v=v.slice(0,-1*G)),g.push(this.productions_[I[1]][0]),y.push(B.$),v.push(B._$),V=x[g[g.length-2]][g[g.length-1]],g.push(V);break;case 3:return!0}}return!0},"parse")},u=(function(){var d={EOF:1,parseError:T(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:T(function(f,p){return this.yy=p||this.yy||{},this._input=f,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var p=f.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),f},"input"),unput:T(function(f){var p=f.length,g=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===m.length?this.yylloc.first_column:0)+m[m.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(f){this.unput(this.match.slice(f))},"less"),pastInput:T(function(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var f=this.match;return f.length<20&&(f+=this._input.substr(0,20-f.length)),(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var f=this.pastInput(),p=new Array(f.length+1).join("-");return f+this.upcomingInput()+` +`+p+"^"},"showPosition"),test_match:T(function(f,p){var g,m,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),m=f[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+f[0].length},this.yytext+=f[0],this.match+=f[0],this.matches=f,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(f[0].length),this.matched+=f[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var v in y)this[v]=y[v];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var f,p,g,m;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),v=0;vp[0].length)){if(p=g,m=v,this.options.backtrack_lexer){if(f=this.test_match(g,y[v]),f!==!1)return f;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(f=this.test_match(p,y[m]),f!==!1?f:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var p=this.next();return p||this.lex()},"lex"),begin:T(function(p){this.conditionStack.push(p)},"begin"),popState:T(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:T(function(p){this.begin(p)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(p,g,m,y){switch(m){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return d})();l.lexer=u;function h(){this.yy={}}return T(h,"Parser"),h.prototype=l,l.Parser=h,new h})();P$.parser=P$;var $ut=P$,am="",B$=[],tw=[],rw=[],Put=T(function(){B$.length=0,tw.length=0,am="",rw.length=0,In()},"clear"),But=T(function(t){am=t,B$.push(t)},"addSection"),Fut=T(function(){return B$},"getSections"),zut=T(function(){let t=Hme();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),qut=T(function(t,e){const r=e.substr(1).split(":");let n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const a=i.map(o=>o.trim()),s={section:am,type:am,people:a,task:t,score:n};rw.push(s)},"addTask"),Vut=T(function(t){const e={section:am,type:am,description:t,task:t,classes:[]};tw.push(e)},"addTaskOrg"),Hme=T(function(){const t=T(function(r){return rw[r].processed},"compileTask");let e=!0;for(const[r,n]of rw.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Wut=T(function(){return Gut()},"getActors"),Yme={getConfig:T(()=>Pe().journey,"getConfig"),clear:Put,setDiagramTitle:qn,getDiagramTitle:Mn,setAccTitle:Dn,getAccTitle:Fn,setAccDescription:zn,getAccDescription:Gn,addSection:But,getSections:Fut,getTasks:zut,addTask:qut,addTaskOrg:Vut,getActors:Wut},Uut=T(t=>`.label { font-family: ${t.fontFamily}; color: ${t.textColor}; } @@ -2593,13 +2593,13 @@ Expecting `+Y.join(", ")+", got '"+(this.terminals_[N]||N)+"'":W="Parse error on .actor-5 { ${t.actor5?`fill: ${t.actor5}`:""}; } - ${px()} -`,"getStyles"),Mut=Dut,N$=x(function(t,e){return f3(t,e)},"drawRect"),Nut=x(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=P0().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}x(a,"smile");function s(l){const u=P0().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}x(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return x(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),qme=x(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),Vme=x(function(t,e){return ZVe(t,e)},"drawText"),Out=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Vme(t,e)},"drawLabel"),$ut=x(function(t,e,r){const n=t.append("g"),i=Ys();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,N$(n,i),Wme(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),O$=-1,Put=x(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");O$++,a.append("line").attr("id",n+"-task"+O$).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Nut(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=Ys();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,N$(a,o);let l=e.x+14;e.people.forEach(u=>{const h=e.actors[u].color,d={cx:l,cy:e.y,r:7,fill:h,stroke:"#000",title:u,pos:e.actors[u].position};qme(a,d),l+=10}),Wme(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),But=x(function(t,e){bte(t,e)},"drawBackgroundRect"),Wme=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y{const a=gu[i].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:gu[i].position};tw.drawCircle(t,s);let o=t.append("text").attr("visibility","hidden").text(i);const l=o.node().getBoundingClientRect().width;o.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";o=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(o.text(p),o.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,o.text(f),o.node().getBoundingClientRect().width>r){let m="";for(const y of f)m+=y,o.text(m+"-"),o.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=y);d=m}}else d=p}),d&&u.push(d),o.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=tw.drawText(t,f).node().getBoundingClientRect().width;g>IS&&g>e.leftMargin-g&&(IS=g)}),n+=Math.max(20,u.length*20)})}x(Ume,"drawActorLegend");var el=Pe().journey,Nh=0,Gut=x(function(t,e,r,n){const i=Pe(),a=i.journey.titleColor,s=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=pt("#i"+e));const h=pt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");Co.init();const d=h.select("#"+e);tw.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const w in gu)delete gu[w];let m=0;g.forEach(w=>{gu[w]={color:el.actorColours[m%el.actorColours.length],position:m},m++}),Ume(d),Nh=el.leftMargin+IS,Co.insert(0,0,Nh,Object.keys(gu).length*50),qut(d,f,0,e);const y=Co.getBounds();p&&d.append("text").text(p).attr("x",Nh).attr("font-size",s).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",o);const v=y.stopy-y.starty+2*el.diagramMarginY,T=Nh+y.stopx+2*el.diagramMarginX;wi(d,v,T,el.useMaxWidth),d.append("line").attr("x1",Nh).attr("y1",el.height*4).attr("x2",T-Nh-4).attr("y2",el.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const b=p?70:0;d.attr("viewBox",`${y.startx} -25 ${T} ${v+b}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",v+b+25)},"draw"),Co={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:x(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:x(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:x(function(t,e,r,n){const i=Pe().journey,a=this;let s=0;function o(l){return x(function(h){s++;const d=a.sequenceItems.length-s+1;a.updateVal(h,"starty",e-d*i.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(Co.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(Co.data,"stopx",r+d*i.boxMargin,Math.max),l!=="activation"&&(a.updateVal(h,"startx",t-d*i.boxMargin,Math.min),a.updateVal(h,"stopx",r+d*i.boxMargin,Math.max),a.updateVal(Co.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(Co.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}x(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:x(function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),o=Math.max(e,n);this.updateVal(Co.data,"startx",i,Math.min),this.updateVal(Co.data,"starty",s,Math.min),this.updateVal(Co.data,"stopx",a,Math.max),this.updateVal(Co.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),bumpVerticalPos:x(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return this.data},"getBounds")},$$=el.sectionFills,Hme=el.sectionColours,qut=x(function(t,e,r,n){const i=Pe().journey;let a="";const s=i.height*2+i.diagramMarginY,o=r+s;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(a!==p.section){u=$$[l%$$.length],d=l%$$.length,h=Hme[l%Hme.length];let m=0;const y=p.section;for(let T=f;T(gu[y]&&(m[y]=gu[y]),m),{});p.x=f*i.taskMargin+f*i.width+Nh,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,tw.drawTask(t,p,i,n),Co.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),Yme={setConf:zut,draw:Gut},Vut={parser:Cut,db:Gme,renderer:Yme,styles:Mut,init:x(t=>{Yme.setConf(t.journey),Gme.clear()},"init")};const Wut=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vut},Symbol.toStringTag,{value:"Module"}));var P$=(function(){var t=x(function(f,p,g,m){for(g=g||{},m=f.length;m--;g[f[m]]=p);return g},"o"),e=[6,11,13,14,15,17,19,20,23,24],r=[1,12],n=[1,13],i=[1,14],a=[1,15],s=[1,16],o=[1,19],l=[1,20],u={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:x(function(p,g,m,y,v,T,b){var w=T.length-1;switch(v){case 1:return T[w-1];case 3:y.setDirection("LR");break;case 4:y.setDirection("TD");break;case 5:this.$=[];break;case 6:T[w-1].push(T[w]),this.$=T[w-1];break;case 7:case 8:this.$=T[w];break;case 9:case 10:this.$=[];break;case 11:y.getCommonDb().setDiagramTitle(T[w].substr(6)),this.$=T[w].substr(6);break;case 12:this.$=T[w].trim(),y.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=T[w].trim(),y.getCommonDb().setAccDescription(this.$);break;case 15:y.addSection(T[w].substr(8)),this.$=T[w].substr(8);break;case 18:y.addTask(T[w],0,""),this.$=T[w];break;case 19:y.addEvent(T[w].substr(2)),this.$=T[w];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(e,[2,5],{5:6}),t(e,[2,2]),t(e,[2,3]),t(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,8]),t(e,[2,9]),t(e,[2,11]),{16:[1,22]},{18:[1,23]},t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,7]),t(e,[2,12]),t(e,[2,13])],defaultActions:{},parseError:x(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:x(function(p){var g=this,m=[0],y=[],v=[null],T=[],b=this.table,w="",k=0,A=0,C=2,_=1,L=T.slice.call(arguments,1),O=Object.create(this.lexer),M={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(M.yy[z]=this.yy[z]);O.setInput(p,M.yy),M.yy.lexer=O,M.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var F=O.yylloc;T.push(F);var S=O.options&&O.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function R(K){m.length=m.length-2*K,v.length=v.length-K,T.length=T.length-K}x(R,"popStack");function N(){var K;return K=y.pop()||O.lex()||_,typeof K!="number"&&(K instanceof Array&&(y=K,K=y.pop()),K=g.symbols_[K]||K),K}x(N,"lex");for(var D,I,$,B,P={},G,V,Y,W;;){if(I=m[m.length-1],this.defaultActions[I]?$=this.defaultActions[I]:((D===null||typeof D>"u")&&(D=N()),$=b[I]&&b[I][D]),typeof $>"u"||!$.length||!$[0]){var ie="";W=[];for(G in b[I])this.terminals_[G]&&G>C&&W.push("'"+this.terminals_[G]+"'");O.showPosition?ie="Parse error on line "+(k+1)+`: + ${mx()} +`,"getStyles"),Hut=Uut,F$=T(function(t,e){return m3(t,e)},"drawRect"),Yut=T(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=Pp().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}T(a,"smile");function s(l){const u=Pp().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}T(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return T(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),Xme=T(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),Kme=T(function(t,e){return uWe(t,e)},"drawText"),Xut=T(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}T(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Kme(t,e)},"drawLabel"),Kut=T(function(t,e,r){const n=t.append("g"),i=Ys();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,F$(n,i),jme(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),z$=-1,jut=T(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");z$++,a.append("line").attr("id",n+"-task"+z$).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Yut(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=Ys();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,F$(a,o);let l=e.x+14;e.people.forEach(u=>{const h=e.actors[u].color,d={cx:l,cy:e.y,r:7,fill:h,stroke:"#000",title:u,pos:e.actors[u].position};Xme(a,d),l+=10}),jme(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),Zut=T(function(t,e){Ete(t,e)},"drawBackgroundRect"),jme=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}T(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y{const a=gu[i].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:gu[i].position};nw.drawCircle(t,s);let o=t.append("text").attr("visibility","hidden").text(i);const l=o.node().getBoundingClientRect().width;o.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";o=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(o.text(p),o.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,o.text(f),o.node().getBoundingClientRect().width>r){let m="";for(const y of f)m+=y,o.text(m+"-"),o.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=y);d=m}}else d=p}),d&&u.push(d),o.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=nw.drawText(t,f).node().getBoundingClientRect().width;g>NS&&g>e.leftMargin-g&&(NS=g)}),n+=Math.max(20,u.length*20)})}T(Zme,"drawActorLegend");var el=Pe().journey,Nh=0,eht=T(function(t,e,r,n){const i=Pe(),a=i.journey.titleColor,s=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=pt("#i"+e));const h=pt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");Co.init();const d=h.select("#"+e);nw.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const w in gu)delete gu[w];let m=0;g.forEach(w=>{gu[w]={color:el.actorColours[m%el.actorColours.length],position:m},m++}),Zme(d),Nh=el.leftMargin+NS,Co.insert(0,0,Nh,Object.keys(gu).length*50),tht(d,f,0,e);const y=Co.getBounds();p&&d.append("text").text(p).attr("x",Nh).attr("font-size",s).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",o);const v=y.stopy-y.starty+2*el.diagramMarginY,x=Nh+y.stopx+2*el.diagramMarginX;wi(d,v,x,el.useMaxWidth),d.append("line").attr("x1",Nh).attr("y1",el.height*4).attr("x2",x-Nh-4).attr("y2",el.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const b=p?70:0;d.attr("viewBox",`${y.startx} -25 ${x} ${v+b}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",v+b+25)},"draw"),Co={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:T(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:T(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:T(function(t,e,r,n){const i=Pe().journey,a=this;let s=0;function o(l){return T(function(h){s++;const d=a.sequenceItems.length-s+1;a.updateVal(h,"starty",e-d*i.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(Co.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(Co.data,"stopx",r+d*i.boxMargin,Math.max),l!=="activation"&&(a.updateVal(h,"startx",t-d*i.boxMargin,Math.min),a.updateVal(h,"stopx",r+d*i.boxMargin,Math.max),a.updateVal(Co.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(Co.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}T(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:T(function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),o=Math.max(e,n);this.updateVal(Co.data,"startx",i,Math.min),this.updateVal(Co.data,"starty",s,Math.min),this.updateVal(Co.data,"stopx",a,Math.max),this.updateVal(Co.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),bumpVerticalPos:T(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:T(function(){return this.verticalPos},"getVerticalPos"),getBounds:T(function(){return this.data},"getBounds")},G$=el.sectionFills,Qme=el.sectionColours,tht=T(function(t,e,r,n){const i=Pe().journey;let a="";const s=i.height*2+i.diagramMarginY,o=r+s;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(a!==p.section){u=G$[l%G$.length],d=l%G$.length,h=Qme[l%Qme.length];let m=0;const y=p.section;for(let x=f;x(gu[y]&&(m[y]=gu[y]),m),{});p.x=f*i.taskMargin+f*i.width+Nh,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,nw.drawTask(t,p,i,n),Co.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),Jme={setConf:Jut,draw:eht},rht={parser:$ut,db:Yme,renderer:Jme,styles:Hut,init:T(t=>{Jme.setConf(t.journey),Yme.clear()},"init")};const nht=Object.freeze(Object.defineProperty({__proto__:null,diagram:rht},Symbol.toStringTag,{value:"Module"}));var q$=(function(){var t=T(function(f,p,g,m){for(g=g||{},m=f.length;m--;g[f[m]]=p);return g},"o"),e=[6,11,13,14,15,17,19,20,23,24],r=[1,12],n=[1,13],i=[1,14],a=[1,15],s=[1,16],o=[1,19],l=[1,20],u={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:T(function(p,g,m,y,v,x,b){var w=x.length-1;switch(v){case 1:return x[w-1];case 3:y.setDirection("LR");break;case 4:y.setDirection("TD");break;case 5:this.$=[];break;case 6:x[w-1].push(x[w]),this.$=x[w-1];break;case 7:case 8:this.$=x[w];break;case 9:case 10:this.$=[];break;case 11:y.getCommonDb().setDiagramTitle(x[w].substr(6)),this.$=x[w].substr(6);break;case 12:this.$=x[w].trim(),y.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=x[w].trim(),y.getCommonDb().setAccDescription(this.$);break;case 15:y.addSection(x[w].substr(8)),this.$=x[w].substr(8);break;case 18:y.addTask(x[w],0,""),this.$=x[w];break;case 19:y.addEvent(x[w].substr(2)),this.$=x[w];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(e,[2,5],{5:6}),t(e,[2,2]),t(e,[2,3]),t(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,8]),t(e,[2,9]),t(e,[2,11]),{16:[1,22]},{18:[1,23]},t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,7]),t(e,[2,12]),t(e,[2,13])],defaultActions:{},parseError:T(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:T(function(p){var g=this,m=[0],y=[],v=[null],x=[],b=this.table,w="",k=0,S=0,C=2,_=1,L=x.slice.call(arguments,1),O=Object.create(this.lexer),M={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(M.yy[z]=this.yy[z]);O.setInput(p,M.yy),M.yy.lexer=O,M.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var F=O.yylloc;x.push(F);var A=O.options&&O.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function R(K){m.length=m.length-2*K,v.length=v.length-K,x.length=x.length-K}T(R,"popStack");function N(){var K;return K=y.pop()||O.lex()||_,typeof K!="number"&&(K instanceof Array&&(y=K,K=y.pop()),K=g.symbols_[K]||K),K}T(N,"lex");for(var D,I,$,B,P={},G,V,X,W;;){if(I=m[m.length-1],this.defaultActions[I]?$=this.defaultActions[I]:((D===null||typeof D>"u")&&(D=N()),$=b[I]&&b[I][D]),typeof $>"u"||!$.length||!$[0]){var ie="";W=[];for(G in b[I])this.terminals_[G]&&G>C&&W.push("'"+this.terminals_[G]+"'");O.showPosition?ie="Parse error on line "+(k+1)+`: `+O.showPosition()+` -Expecting `+W.join(", ")+", got '"+(this.terminals_[D]||D)+"'":ie="Parse error on line "+(k+1)+": Unexpected "+(D==_?"end of input":"'"+(this.terminals_[D]||D)+"'"),this.parseError(ie,{text:O.match,token:this.terminals_[D]||D,line:O.yylineno,loc:F,expected:W})}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+D);switch($[0]){case 1:m.push(D),v.push(O.yytext),T.push(O.yylloc),m.push($[1]),D=null,A=O.yyleng,w=O.yytext,k=O.yylineno,F=O.yylloc;break;case 2:if(V=this.productions_[$[1]][1],P.$=v[v.length-V],P._$={first_line:T[T.length-(V||1)].first_line,last_line:T[T.length-1].last_line,first_column:T[T.length-(V||1)].first_column,last_column:T[T.length-1].last_column},S&&(P._$.range=[T[T.length-(V||1)].range[0],T[T.length-1].range[1]]),B=this.performAction.apply(P,[w,A,k,M.yy,$[1],v,T].concat(L)),typeof B<"u")return B;V&&(m=m.slice(0,-1*V*2),v=v.slice(0,-1*V),T=T.slice(0,-1*V)),m.push(this.productions_[$[1]][0]),v.push(P.$),T.push(P._$),Y=b[m[m.length-2]][m[m.length-1]],m.push(Y);break;case 3:return!0}}return!0},"parse")},h=(function(){var f={EOF:1,parseError:x(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:x(function(p,g){return this.yy=g||this.yy||{},this._input=p,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var g=p.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:x(function(p){var g=p.length,m=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var v=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:m?(m.length===y.length?this.yylloc.first_column:0)+y[y.length-m.length].length-m[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(p){this.unput(this.match.slice(p))},"less"),pastInput:x(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var p=this.match;return p.length<20&&(p+=this._input.substr(0,20-p.length)),(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var p=this.pastInput(),g=new Array(p.length+1).join("-");return p+this.upcomingInput()+` -`+g+"^"},"showPosition"),test_match:x(function(p,g){var m,y,v;if(this.options.backtrack_lexer&&(v={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(v.yylloc.range=this.yylloc.range.slice(0))),y=p[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+p[0].length},this.yytext+=p[0],this.match+=p[0],this.matches=p,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(p[0].length),this.matched+=p[0],m=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),m)return m;if(this._backtrack){for(var T in v)this[T]=v[T];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var p,g,m,y;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),T=0;Tg[0].length)){if(g=m,y=T,this.options.backtrack_lexer){if(p=this.test_match(m,v[T]),p!==!1)return p;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(p=this.test_match(g,v[y]),p!==!1?p:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var g=this.next();return g||this.lex()},"lex"),begin:x(function(g){this.conditionStack.push(g)},"begin"),popState:x(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:x(function(g){this.begin(g)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(g,m,y,v){switch(y){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return f})();u.lexer=h;function d(){this.yy={}}return x(d,"Parser"),d.prototype=u,u.Parser=d,new d})();P$.parser=P$;var Uut=P$,Xme={};bw(Xme,{addEvent:()=>i1e,addSection:()=>e1e,addTask:()=>n1e,addTaskOrg:()=>a1e,clear:()=>Zme,default:()=>Hut,getCommonDb:()=>jme,getDirection:()=>Jme,getSections:()=>t1e,getTasks:()=>r1e,setDirection:()=>Qme});var am="",Kme=0,B$="LR",F$=[],DS=[],sm=[],jme=x(()=>L6,"getCommonDb"),Zme=x(function(){F$.length=0,DS.length=0,am="",sm.length=0,B$="LR",In()},"clear"),Qme=x(function(t){B$=t},"setDirection"),Jme=x(function(){return B$},"getDirection"),e1e=x(function(t){am=t,F$.push(t)},"addSection"),t1e=x(function(){return F$},"getSections"),r1e=x(function(){let t=s1e();const e=100;let r=0;for(;!t&&rr.id===Kme-1).events.push(t)},"addEvent"),a1e=x(function(t){const e={section:am,type:am,description:t,task:t,classes:[]};DS.push(e)},"addTaskOrg"),s1e=x(function(){const t=x(function(r){return sm[r].processed},"compileTask");let e=!0;for(const[r,n]of sm.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Hut={clear:Zme,getCommonDb:jme,getDirection:Jme,setDirection:Qme,addSection:e1e,getSections:t1e,getTasks:r1e,addTask:n1e,addTaskOrg:a1e,addEvent:i1e},o1e=0,MS=x(function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),Yut=x(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=P0().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}x(a,"smile");function s(l){const u=P0().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}x(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return x(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),Xut=x(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),l1e=x(function(t,e){const r=e.text.replace(//gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),Kut=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,l1e(t,e)},"drawLabel"),jut=x(function(t,e,r){const n=t.append("g"),i=G$();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,MS(n,i),c1e(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),z$=-1,Zut=x(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");z$++,a.append("line").attr("id",n+"-task"+z$).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Yut(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=G$();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,MS(a,o),c1e(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),Qut=x(function(t,e){MS(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Jut=x(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),G$=x(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),c1e=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y)/).reverse(),i,a=[],s=1.1,o=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",l+"em");for(let h=0;he||i==="
")&&(a.pop(),u.text(a.join(" ").trim()),i==="
"?a=[""]:a=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em").text(i))})}x(q$,"wrap");var tht=x(function(t,e,r,n,i,a=!1){var v,T,b;const{theme:s,look:o}=n,l=s==null?void 0:s.includes("redux"),u=((v=n==null?void 0:n.themeVariables)==null?void 0:v.THEME_COLOR_LIMIT)??12,h=r%u-1,d=t.append("g");e.section=h,d.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+h));const f=d.append("g"),p=d.append("g"),m=p.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(q$,e.width).node().getBBox(),y=(T=n.fontSize)!=null&&T.replace?n.fontSize.replace("px",""):n.fontSize;if(e.height=m.height+y*1.1*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,p.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),l&&p.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),nht(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const w=s.includes("dark"),k=((b=t.node())==null?void 0:b.ownerSVGElement)??t.node(),A=pt(k),C=A.attr("id")??"",_=C?`${C}-drop-shadow`:"drop-shadow";if(A.select(`#${_}`).empty()){const L=A.select("defs");(L.empty()?A.append("defs"):L).append("filter").attr("id",_).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",w?"0.2":"0.06").attr("flood-color",w?"#FFFFFF":"#000000")}}return e},"drawNode"),rht=x(function(t,e,r){var o;const n=t.append("g"),a=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(q$,e.width).node().getBBox(),s=(o=r.fontSize)!=null&&o.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),a.height+s*1.1*.5+e.padding},"getVirtualNodeHeight"),nht=x(function(t,e,r,n,i){const{theme:a}=i,s=a!=null&&a.includes("redux")?0:5,o=5,l=s>0?`M0 ${e.height-o} v${-e.height+2*o} q0,-${s},${s},-${s} h${e.width-2*o} q${s},0,${s},${s} v${e.height-o} H0 Z`:`M0 ${e.height-o} v${-(e.height-o)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+o1e++).attr("class","node-bkg node-"+e.type).attr("d",l),a!=null&&a.includes("redux")||t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),Ds={drawRect:MS,drawCircle:Xut,drawSection:jut,drawText:l1e,drawLabel:Kut,drawTask:Zut,drawBackgroundRect:Qut,getTextObj:Jut,getNoteRect:G$,initGraphics:eht,drawNode:tht,getVirtualNodeHeight:rht},iht=x(function(t,e,r,n){var R,N,D;const i=Pe(),{look:a,theme:s,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((R=i.timeline)==null?void 0:R.leftMargin)??50;ae.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=pt("#i"+e));const m=pt(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const y=n.db.getTasks(),v=n.db.getCommonDb().getDiagramTitle();ae.debug("task",y),Ds.initGraphics(m,e);const T=n.db.getSections();ae.debug("sections",T);let b=0,w=0,k=0,A=0,C=50+d,_=50;A=50;let L=0,O=!0;T.forEach(function(I){const $={number:L,descr:I,section:L,width:150,padding:20,maxHeight:b},B=Ds.getVirtualNodeHeight(m,$,i);ae.debug("sectionHeight before draw",B),b=Math.max(b,B+20)});let M=0,z=0;ae.debug("tasks.length",y.length);for(const[I,$]of y.entries()){const B={number:I,descr:$,section:$.section,width:150,padding:20,maxHeight:w},P=Ds.getVirtualNodeHeight(m,B,i);ae.debug("taskHeight before draw",P),w=Math.max(w,P+20),M=Math.max(M,$.events.length);let G=0;for(const V of $.events){const Y={descr:V,section:$.section,number:$.section,width:150,padding:20,maxHeight:50};G+=Ds.getVirtualNodeHeight(m,Y,i)}$.events.length>0&&(G+=($.events.length-1)*10),z=Math.max(z,G)}ae.debug("maxSectionHeight before draw",b),ae.debug("maxTaskHeight before draw",w),T&&T.length>0?T.forEach(I=>{const $=y.filter(V=>V.section===I),B={number:L,descr:I,section:L,width:200*Math.max($.length,1)-50,padding:20,maxHeight:b};ae.debug("sectionNode",B);const P=m.append("g"),G=Ds.drawNode(P,B,L,i,e);ae.debug("sectionNode output",G),P.attr("transform",`translate(${C}, ${A})`),_+=b+50,$.length>0&&u1e(m,$,L,C,_,w,i,M,z,b,!1,e),C+=200*Math.max($.length,1),_=A,L++}):(O=!1,u1e(m,y,L,C,_,w,i,M,z,b,!0,e));const F=m.node().getBBox();if(ae.debug("bounds",F),v&&m.append("text").text(v).attr("x",a==="neo"?F.x*2+d:F.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),k=O?b+w+150:w+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",k).attr("x2",F.width+3*d).attr("y2",k).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),a==="neo"&&l&&s!=="neutral"){const I=m.select("defs"),B=(I.empty()?m.append("defs"):I).append("linearGradient").attr("id",m.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");B.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),B.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}E0(void 0,m,((N=i.timeline)==null?void 0:N.padding)??50,((D=i.timeline)==null?void 0:D.useMaxWidth)??!1)},"draw"),u1e=x(function(t,e,r,n,i,a,s,o,l,u,h,d){var f;for(const p of e){const g={descr:p.task,section:r,number:r,width:150,padding:20,maxHeight:a};ae.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),v=Ds.drawNode(m,g,r,s,d).height;if(ae.debug("taskHeight after draw",v),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,v),p.events){const T=t.append("g").attr("class","lineWrapper");let b=a;i+=100,b=b+aht(t,p.events,r,n,i,s,d),i-=100,T.append("line").attr("x1",n+190/2).attr("y1",i+a).attr("x2",n+190/2).attr("y2",i+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${d}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,h&&!((f=s.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),aht=x(function(t,e,r,n,i,a,s){let o=0;const l=i;i=i+100;for(const u of e){const h={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};ae.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=Ds.drawNode(d,h,r,a,s,!0).height;o=o+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,o},"drawEvents"),sht={setConf:x(()=>{},"setConf"),draw:iht},NS=200,mu=5,oht=NS+mu*2,V$=NS+100,lht=V$+mu*2,h1e=10,cht=0,d1e=20,f1e=20,p1e=30,g1e=50,uht=x(function(t,e,r,n){var R,N,D,I,$;const i=Pe(),a=((R=i.timeline)==null?void 0:R.leftMargin)??50;ae.debug("timeline",n.db);const s=ys(e);s.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();ae.debug("task",o),Ds.initGraphics(s);const u=n.db.getSections();ae.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,y=oht+f1e,v=lht+g1e,T=m+y;let b=0;const w=u&&u.length>0,k=w?T:f+y,A=Math.max(50,y+v-mu*2);u.forEach(function(B){const P={number:b,descr:B,section:b,width:A,padding:mu,maxHeight:h},G=Ds.getVirtualNodeHeight(s,P,i);ae.debug("sectionHeight before draw",G),h=Math.max(h,G)});let C=0;ae.debug("tasks.length",o.length);for(const[B,P]of o.entries()){const G={number:B,descr:P,section:P.section,width:NS,padding:mu,maxHeight:d},V=Ds.getVirtualNodeHeight(s,G,i);ae.debug("taskHeight before draw",V),d=Math.max(d,V);let Y=0;for(const W of P.events){const ie={descr:W,section:P.section,number:P.section,width:V$,padding:mu,maxHeight:50};Y+=Ds.getVirtualNodeHeight(s,ie,i)}P.events.length>0&&(Y+=(P.events.length-1)*h1e),C=Math.max(C,Y)+cht}ae.debug("maxSectionHeight before draw",h),ae.debug("maxTaskHeight before draw",d);const L=Math.max(d,C)+p1e;w?u.forEach(B=>{const P=o.filter(J=>J.section===B),G={number:b,descr:B,section:b,width:A,padding:mu,maxHeight:h};ae.debug("sectionNode",G);const V=s.append("g"),Y=Ds.drawNode(V,G,b,i);ae.debug("sectionNode output",Y);const W=k-y;V.attr("transform",`translate(${W}, ${p})`);const ie=p+Y.height+d1e;P.length>0&&m1e(s,P,b,k,ie,d,i,L,!1);const K=P.length,se=Y.height+d1e+L*Math.max(K,1)-(K>0?p1e*2:0);p+=se,b++}):m1e(s,o,b,k,p,d,i,L,!0);let O=(N=s.node())==null?void 0:N.getBBox();if(!O)throw new Error("bbox not found");if(ae.debug("bounds",O),l){if(s.append("text").text(l).attr("x",O.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),O=(D=s.node())==null?void 0:D.getBBox(),!O)throw new Error("bbox not found");ae.debug("bounds after title",O)}const[M]=xc(i.fontSize),z=(M??16)*2,F=(M??16)*.5+20,S=s.append("g").attr("class","lineWrapper");S.append("line").attr("x1",k).attr("y1",g-z).attr("x2",k).attr("y2",O.y+O.height+F).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),S.lower(),E0(void 0,s,((I=i.timeline)==null?void 0:I.padding)??50,(($=i.timeline)==null?void 0:$.useMaxWidth)??!1)},"draw"),m1e=x(function(t,e,r,n,i,a,s,o,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:NS,padding:mu,maxHeight:a};ae.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=Ds.drawNode(f,d,r,s),g=p.height;ae.debug("taskHeight after draw",g);const m=n-f1e-p.width;if(f.attr("transform",`translate(${m}, ${i})`),a=Math.max(a,g),h.events&&h.events.length>0){const y=i,v=n+g1e;hht(t,h.events,r,n,v,y,s)}i=i+o,l&&!((u=s.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),hht=x(function(t,e,r,n,i,a,s){let o=a;for(const l of e){const u={descr:l,section:r,number:r,width:V$,padding:mu,maxHeight:0};ae.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=Ds.drawNode(h,u,r,s).height;h.attr("transform",`translate(${i}, ${o})`);const p=t.append("g").attr("class","lineWrapper"),g=o+f/2;p.append("line").attr("x1",n).attr("y1",g).attr("x2",i).attr("y2",g).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+f+h1e}return o-a},"drawEvents"),dht={setConf:x(()=>{},"setConf"),draw:uht},fht=x(t=>{var o;const{theme:e}=lr(),r=e==null?void 0:e.includes("dark"),n=e==null?void 0:e.includes("color"),i=((o=t.svgId)==null?void 0:o.replace(/^#/,""))??"",a=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let s="";for(let l=0;l1)throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+D);switch($[0]){case 1:m.push(D),v.push(O.yytext),x.push(O.yylloc),m.push($[1]),D=null,S=O.yyleng,w=O.yytext,k=O.yylineno,F=O.yylloc;break;case 2:if(V=this.productions_[$[1]][1],P.$=v[v.length-V],P._$={first_line:x[x.length-(V||1)].first_line,last_line:x[x.length-1].last_line,first_column:x[x.length-(V||1)].first_column,last_column:x[x.length-1].last_column},A&&(P._$.range=[x[x.length-(V||1)].range[0],x[x.length-1].range[1]]),B=this.performAction.apply(P,[w,S,k,M.yy,$[1],v,x].concat(L)),typeof B<"u")return B;V&&(m=m.slice(0,-1*V*2),v=v.slice(0,-1*V),x=x.slice(0,-1*V)),m.push(this.productions_[$[1]][0]),v.push(P.$),x.push(P._$),X=b[m[m.length-2]][m[m.length-1]],m.push(X);break;case 3:return!0}}return!0},"parse")},h=(function(){var f={EOF:1,parseError:T(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:T(function(p,g){return this.yy=g||this.yy||{},this._input=p,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var g=p.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:T(function(p){var g=p.length,m=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var v=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:m?(m.length===y.length?this.yylloc.first_column:0)+y[y.length-m.length].length-m[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(p){this.unput(this.match.slice(p))},"less"),pastInput:T(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var p=this.match;return p.length<20&&(p+=this._input.substr(0,20-p.length)),(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var p=this.pastInput(),g=new Array(p.length+1).join("-");return p+this.upcomingInput()+` +`+g+"^"},"showPosition"),test_match:T(function(p,g){var m,y,v;if(this.options.backtrack_lexer&&(v={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(v.yylloc.range=this.yylloc.range.slice(0))),y=p[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+p[0].length},this.yytext+=p[0],this.match+=p[0],this.matches=p,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(p[0].length),this.matched+=p[0],m=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),m)return m;if(this._backtrack){for(var x in v)this[x]=v[x];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var p,g,m,y;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),x=0;xg[0].length)){if(g=m,y=x,this.options.backtrack_lexer){if(p=this.test_match(m,v[x]),p!==!1)return p;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(p=this.test_match(g,v[y]),p!==!1?p:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var g=this.next();return g||this.lex()},"lex"),begin:T(function(g){this.conditionStack.push(g)},"begin"),popState:T(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:T(function(g){this.begin(g)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(g,m,y,v){switch(y){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return f})();u.lexer=h;function d(){this.yy={}}return T(d,"Parser"),d.prototype=u,u.Parser=d,new d})();q$.parser=q$;var iht=q$,e1e={};Tw(e1e,{addEvent:()=>u1e,addSection:()=>s1e,addTask:()=>c1e,addTaskOrg:()=>h1e,clear:()=>n1e,default:()=>aht,getCommonDb:()=>r1e,getDirection:()=>a1e,getSections:()=>o1e,getTasks:()=>l1e,setDirection:()=>i1e});var sm="",t1e=0,V$="LR",W$=[],OS=[],om=[],r1e=T(()=>M6,"getCommonDb"),n1e=T(function(){W$.length=0,OS.length=0,sm="",om.length=0,V$="LR",In()},"clear"),i1e=T(function(t){V$=t},"setDirection"),a1e=T(function(){return V$},"getDirection"),s1e=T(function(t){sm=t,W$.push(t)},"addSection"),o1e=T(function(){return W$},"getSections"),l1e=T(function(){let t=d1e();const e=100;let r=0;for(;!t&&rr.id===t1e-1).events.push(t)},"addEvent"),h1e=T(function(t){const e={section:sm,type:sm,description:t,task:t,classes:[]};OS.push(e)},"addTaskOrg"),d1e=T(function(){const t=T(function(r){return om[r].processed},"compileTask");let e=!0;for(const[r,n]of om.entries())t(r),e=e&&n.processed;return e},"compileTasks"),aht={clear:n1e,getCommonDb:r1e,getDirection:a1e,setDirection:i1e,addSection:s1e,getSections:o1e,getTasks:l1e,addTask:c1e,addTaskOrg:h1e,addEvent:u1e},f1e=0,$S=T(function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),sht=T(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=Pp().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}T(a,"smile");function s(l){const u=Pp().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}T(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return T(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),oht=T(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),p1e=T(function(t,e){const r=e.text.replace(//gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),lht=T(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}T(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,p1e(t,e)},"drawLabel"),cht=T(function(t,e,r){const n=t.append("g"),i=H$();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,$S(n,i),g1e(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),U$=-1,uht=T(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");U$++,a.append("line").attr("id",n+"-task"+U$).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),sht(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=H$();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,$S(a,o),g1e(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),hht=T(function(t,e){$S(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),dht=T(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),H$=T(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),g1e=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}T(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y)/).reverse(),i,a=[],s=1.1,o=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",l+"em");for(let h=0;he||i==="
")&&(a.pop(),u.text(a.join(" ").trim()),i==="
"?a=[""]:a=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em").text(i))})}T(Y$,"wrap");var pht=T(function(t,e,r,n,i,a=!1){var v,x,b;const{theme:s,look:o}=n,l=s==null?void 0:s.includes("redux"),u=((v=n==null?void 0:n.themeVariables)==null?void 0:v.THEME_COLOR_LIMIT)??12,h=r%u-1,d=t.append("g");e.section=h,d.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+h));const f=d.append("g"),p=d.append("g"),m=p.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(Y$,e.width).node().getBBox(),y=(x=n.fontSize)!=null&&x.replace?n.fontSize.replace("px",""):n.fontSize;if(e.height=m.height+y*1.1*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,p.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),l&&p.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),mht(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const w=s.includes("dark"),k=((b=t.node())==null?void 0:b.ownerSVGElement)??t.node(),S=pt(k),C=S.attr("id")??"",_=C?`${C}-drop-shadow`:"drop-shadow";if(S.select(`#${_}`).empty()){const L=S.select("defs");(L.empty()?S.append("defs"):L).append("filter").attr("id",_).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",w?"0.2":"0.06").attr("flood-color",w?"#FFFFFF":"#000000")}}return e},"drawNode"),ght=T(function(t,e,r){var o;const n=t.append("g"),a=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(Y$,e.width).node().getBBox(),s=(o=r.fontSize)!=null&&o.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),a.height+s*1.1*.5+e.padding},"getVirtualNodeHeight"),mht=T(function(t,e,r,n,i){const{theme:a}=i,s=a!=null&&a.includes("redux")?0:5,o=5,l=s>0?`M0 ${e.height-o} v${-e.height+2*o} q0,-${s},${s},-${s} h${e.width-2*o} q${s},0,${s},${s} v${e.height-o} H0 Z`:`M0 ${e.height-o} v${-(e.height-o)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+f1e++).attr("class","node-bkg node-"+e.type).attr("d",l),a!=null&&a.includes("redux")||t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),Ds={drawRect:$S,drawCircle:oht,drawSection:cht,drawText:p1e,drawLabel:lht,drawTask:uht,drawBackgroundRect:hht,getTextObj:dht,getNoteRect:H$,initGraphics:fht,drawNode:pht,getVirtualNodeHeight:ght},yht=T(function(t,e,r,n){var R,N,D;const i=Pe(),{look:a,theme:s,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((R=i.timeline)==null?void 0:R.leftMargin)??50;ae.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=pt("#i"+e));const m=pt(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const y=n.db.getTasks(),v=n.db.getCommonDb().getDiagramTitle();ae.debug("task",y),Ds.initGraphics(m,e);const x=n.db.getSections();ae.debug("sections",x);let b=0,w=0,k=0,S=0,C=50+d,_=50;S=50;let L=0,O=!0;x.forEach(function(I){const $={number:L,descr:I,section:L,width:150,padding:20,maxHeight:b},B=Ds.getVirtualNodeHeight(m,$,i);ae.debug("sectionHeight before draw",B),b=Math.max(b,B+20)});let M=0,z=0;ae.debug("tasks.length",y.length);for(const[I,$]of y.entries()){const B={number:I,descr:$,section:$.section,width:150,padding:20,maxHeight:w},P=Ds.getVirtualNodeHeight(m,B,i);ae.debug("taskHeight before draw",P),w=Math.max(w,P+20),M=Math.max(M,$.events.length);let G=0;for(const V of $.events){const X={descr:V,section:$.section,number:$.section,width:150,padding:20,maxHeight:50};G+=Ds.getVirtualNodeHeight(m,X,i)}$.events.length>0&&(G+=($.events.length-1)*10),z=Math.max(z,G)}ae.debug("maxSectionHeight before draw",b),ae.debug("maxTaskHeight before draw",w),x&&x.length>0?x.forEach(I=>{const $=y.filter(V=>V.section===I),B={number:L,descr:I,section:L,width:200*Math.max($.length,1)-50,padding:20,maxHeight:b};ae.debug("sectionNode",B);const P=m.append("g"),G=Ds.drawNode(P,B,L,i,e);ae.debug("sectionNode output",G),P.attr("transform",`translate(${C}, ${S})`),_+=b+50,$.length>0&&m1e(m,$,L,C,_,w,i,M,z,b,!1,e),C+=200*Math.max($.length,1),_=S,L++}):(O=!1,m1e(m,y,L,C,_,w,i,M,z,b,!0,e));const F=m.node().getBBox();if(ae.debug("bounds",F),v&&m.append("text").text(v).attr("x",a==="neo"?F.x*2+d:F.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),k=O?b+w+150:w+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",k).attr("x2",F.width+3*d).attr("y2",k).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),a==="neo"&&l&&s!=="neutral"){const I=m.select("defs"),B=(I.empty()?m.append("defs"):I).append("linearGradient").attr("id",m.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");B.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),B.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}Ep(void 0,m,((N=i.timeline)==null?void 0:N.padding)??50,((D=i.timeline)==null?void 0:D.useMaxWidth)??!1)},"draw"),m1e=T(function(t,e,r,n,i,a,s,o,l,u,h,d){var f;for(const p of e){const g={descr:p.task,section:r,number:r,width:150,padding:20,maxHeight:a};ae.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),v=Ds.drawNode(m,g,r,s,d).height;if(ae.debug("taskHeight after draw",v),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,v),p.events){const x=t.append("g").attr("class","lineWrapper");let b=a;i+=100,b=b+vht(t,p.events,r,n,i,s,d),i-=100,x.append("line").attr("x1",n+190/2).attr("y1",i+a).attr("x2",n+190/2).attr("y2",i+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${d}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,h&&!((f=s.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),vht=T(function(t,e,r,n,i,a,s){let o=0;const l=i;i=i+100;for(const u of e){const h={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};ae.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=Ds.drawNode(d,h,r,a,s,!0).height;o=o+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,o},"drawEvents"),bht={setConf:T(()=>{},"setConf"),draw:yht},PS=200,mu=5,xht=PS+mu*2,X$=PS+100,Tht=X$+mu*2,y1e=10,wht=0,v1e=20,b1e=20,x1e=30,T1e=50,Cht=T(function(t,e,r,n){var R,N,D,I,$;const i=Pe(),a=((R=i.timeline)==null?void 0:R.leftMargin)??50;ae.debug("timeline",n.db);const s=ys(e);s.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();ae.debug("task",o),Ds.initGraphics(s);const u=n.db.getSections();ae.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,y=xht+b1e,v=Tht+T1e,x=m+y;let b=0;const w=u&&u.length>0,k=w?x:f+y,S=Math.max(50,y+v-mu*2);u.forEach(function(B){const P={number:b,descr:B,section:b,width:S,padding:mu,maxHeight:h},G=Ds.getVirtualNodeHeight(s,P,i);ae.debug("sectionHeight before draw",G),h=Math.max(h,G)});let C=0;ae.debug("tasks.length",o.length);for(const[B,P]of o.entries()){const G={number:B,descr:P,section:P.section,width:PS,padding:mu,maxHeight:d},V=Ds.getVirtualNodeHeight(s,G,i);ae.debug("taskHeight before draw",V),d=Math.max(d,V);let X=0;for(const W of P.events){const ie={descr:W,section:P.section,number:P.section,width:X$,padding:mu,maxHeight:50};X+=Ds.getVirtualNodeHeight(s,ie,i)}P.events.length>0&&(X+=(P.events.length-1)*y1e),C=Math.max(C,X)+wht}ae.debug("maxSectionHeight before draw",h),ae.debug("maxTaskHeight before draw",d);const L=Math.max(d,C)+x1e;w?u.forEach(B=>{const P=o.filter(J=>J.section===B),G={number:b,descr:B,section:b,width:S,padding:mu,maxHeight:h};ae.debug("sectionNode",G);const V=s.append("g"),X=Ds.drawNode(V,G,b,i);ae.debug("sectionNode output",X);const W=k-y;V.attr("transform",`translate(${W}, ${p})`);const ie=p+X.height+v1e;P.length>0&&w1e(s,P,b,k,ie,d,i,L,!1);const K=P.length,se=X.height+v1e+L*Math.max(K,1)-(K>0?x1e*2:0);p+=se,b++}):w1e(s,o,b,k,p,d,i,L,!0);let O=(N=s.node())==null?void 0:N.getBBox();if(!O)throw new Error("bbox not found");if(ae.debug("bounds",O),l){if(s.append("text").text(l).attr("x",O.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),O=(D=s.node())==null?void 0:D.getBBox(),!O)throw new Error("bbox not found");ae.debug("bounds after title",O)}const[M]=xc(i.fontSize),z=(M??16)*2,F=(M??16)*.5+20,A=s.append("g").attr("class","lineWrapper");A.append("line").attr("x1",k).attr("y1",g-z).attr("x2",k).attr("y2",O.y+O.height+F).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),A.lower(),Ep(void 0,s,((I=i.timeline)==null?void 0:I.padding)??50,(($=i.timeline)==null?void 0:$.useMaxWidth)??!1)},"draw"),w1e=T(function(t,e,r,n,i,a,s,o,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:PS,padding:mu,maxHeight:a};ae.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=Ds.drawNode(f,d,r,s),g=p.height;ae.debug("taskHeight after draw",g);const m=n-b1e-p.width;if(f.attr("transform",`translate(${m}, ${i})`),a=Math.max(a,g),h.events&&h.events.length>0){const y=i,v=n+T1e;kht(t,h.events,r,n,v,y,s)}i=i+o,l&&!((u=s.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),kht=T(function(t,e,r,n,i,a,s){let o=a;for(const l of e){const u={descr:l,section:r,number:r,width:X$,padding:mu,maxHeight:0};ae.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=Ds.drawNode(h,u,r,s).height;h.attr("transform",`translate(${i}, ${o})`);const p=t.append("g").attr("class","lineWrapper"),g=o+f/2;p.append("line").attr("x1",n).attr("y1",g).attr("x2",i).attr("y2",g).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+f+y1e}return o-a},"drawEvents"),Eht={setConf:T(()=>{},"setConf"),draw:Cht},Sht=T(t=>{var o;const{theme:e}=lr(),r=e==null?void 0:e.includes("dark"),n=e==null?void 0:e.includes("color"),i=((o=t.svgId)==null?void 0:o.replace(/^#/,""))??"",a=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let s="";for(let l=0;l{let e="";for(let r=0;r{let e="";for(let r=0;r{var s;const{theme:e}=lr(),r=e==null?void 0:e.includes("redux"),n=e==="neutral",i=((s=t.svgId)==null?void 0:s.replace(/^#/,""))??"";let a="";if(t.useGradient&&i&&t.THEME_COLOR_LIMIT&&!n)for(let o=0;o{var s;const{theme:e}=lr(),r=e==null?void 0:e.includes("redux"),n=e==="neutral",i=((s=t.svgId)==null?void 0:s.replace(/^#/,""))??"";let a="";if(t.useGradient&&i&&t.THEME_COLOR_LIMIT&&!n)for(let o=0;o{},"setConf"),draw:x((t,e,r,n)=>{var a,s;return(((s=(a=n==null?void 0:n.db)==null?void 0:a.getDirection)==null?void 0:s.call(a))??"LR")==="TD"?dht.draw(t,e,r,n):sht.draw(t,e,r,n)},"draw")},vht={db:Xme,renderer:yht,parser:Uut,styles:mht};const bht=Object.freeze(Object.defineProperty({__proto__:null,diagram:vht},Symbol.toStringTag,{value:"Module"})),Ca=[];for(let t=0;t<256;++t)Ca.push((t+256).toString(16).slice(1));function xht(t,e=0){return(Ca[t[e+0]]+Ca[t[e+1]]+Ca[t[e+2]]+Ca[t[e+3]]+"-"+Ca[t[e+4]]+Ca[t[e+5]]+"-"+Ca[t[e+6]]+Ca[t[e+7]]+"-"+Ca[t[e+8]]+Ca[t[e+9]]+"-"+Ca[t[e+10]]+Ca[t[e+11]]+Ca[t[e+12]]+Ca[t[e+13]]+Ca[t[e+14]]+Ca[t[e+15]]).toLowerCase()}const Tht=new Uint8Array(16);function wht(){return crypto.getRandomValues(Tht)}function Cht(t,e,r){return crypto.randomUUID?crypto.randomUUID():kht(t)}function kht(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??wht();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,xht(n)}var W$=(function(){var t=x(function(w,k,A,C){for(A=A||{},C=w.length;C--;A[w[C]]=k);return A},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],m=[1,34],y=[1,6,7,11,13,15,16,19,22],v={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:x(function(k,A,C,_,L,O,M){var z=O.length-1;switch(L){case 6:case 7:return _;case 8:_.getLogger().trace("Stop NL ");break;case 9:_.getLogger().trace("Stop EOF ");break;case 11:_.getLogger().trace("Stop NL2 ");break;case 12:_.getLogger().trace("Stop EOF2 ");break;case 15:_.getLogger().info("Node: ",O[z].id),_.addNode(O[z-1].length,O[z].id,O[z].descr,O[z].type);break;case 16:_.getLogger().trace("Icon: ",O[z]),_.decorateNode({icon:O[z]});break;case 17:case 21:_.decorateNode({class:O[z]});break;case 18:_.getLogger().trace("SPACELIST");break;case 19:_.getLogger().trace("Node: ",O[z].id),_.addNode(0,O[z].id,O[z].descr,O[z].type);break;case 20:_.decorateNode({icon:O[z]});break;case 25:_.getLogger().trace("node found ..",O[z-2]),this.$={id:O[z-1],descr:O[z-1],type:_.getType(O[z-2],O[z])};break;case 26:this.$={id:O[z],descr:O[z],type:_.nodeType.DEFAULT};break;case 27:_.getLogger().trace("node found ..",O[z-3]),this.$={id:O[z-3],descr:O[z-1],type:_.getType(O[z-2],O[z])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:u,7:h,10:23,11:d},t(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:o}),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,23]),t(f,[2,24]),t(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(p,[2,14],{7:g,11:m}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(f,[2,15]),t(f,[2,16]),t(f,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:g,11:m}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(k,A){if(A.recoverable)this.trace(k);else{var C=new Error(k);throw C.hash=A,C}},"parseError"),parse:x(function(k){var A=this,C=[0],_=[],L=[null],O=[],M=this.table,z="",F=0,S=0,R=2,N=1,D=O.slice.call(arguments,1),I=Object.create(this.lexer),$={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&($.yy[B]=this.yy[B]);I.setInput(k,$.yy),$.yy.lexer=I,$.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var P=I.yylloc;O.push(P);var G=I.options&&I.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(_e){C.length=C.length-2*_e,L.length=L.length-_e,O.length=O.length-_e}x(V,"popStack");function Y(){var _e;return _e=_.pop()||I.lex()||N,typeof _e!="number"&&(_e instanceof Array&&(_=_e,_e=_.pop()),_e=A.symbols_[_e]||_e),_e}x(Y,"lex");for(var W,ie,K,se,J={},Z,ee,ne,ue;;){if(ie=C[C.length-1],this.defaultActions[ie]?K=this.defaultActions[ie]:((W===null||typeof W>"u")&&(W=Y()),K=M[ie]&&M[ie][W]),typeof K>"u"||!K.length||!K[0]){var fe="";ue=[];for(Z in M[ie])this.terminals_[Z]&&Z>R&&ue.push("'"+this.terminals_[Z]+"'");I.showPosition?fe="Parse error on line "+(F+1)+`: +`},"getStyles"),Rht=_ht,Lht={setConf:T(()=>{},"setConf"),draw:T((t,e,r,n)=>{var a,s;return(((s=(a=n==null?void 0:n.db)==null?void 0:a.getDirection)==null?void 0:s.call(a))??"LR")==="TD"?Eht.draw(t,e,r,n):bht.draw(t,e,r,n)},"draw")},Iht={db:e1e,renderer:Lht,parser:iht,styles:Rht};const Dht=Object.freeze(Object.defineProperty({__proto__:null,diagram:Iht},Symbol.toStringTag,{value:"Module"})),Ca=[];for(let t=0;t<256;++t)Ca.push((t+256).toString(16).slice(1));function Mht(t,e=0){return(Ca[t[e+0]]+Ca[t[e+1]]+Ca[t[e+2]]+Ca[t[e+3]]+"-"+Ca[t[e+4]]+Ca[t[e+5]]+"-"+Ca[t[e+6]]+Ca[t[e+7]]+"-"+Ca[t[e+8]]+Ca[t[e+9]]+"-"+Ca[t[e+10]]+Ca[t[e+11]]+Ca[t[e+12]]+Ca[t[e+13]]+Ca[t[e+14]]+Ca[t[e+15]]).toLowerCase()}const Nht=new Uint8Array(16);function Oht(){return crypto.getRandomValues(Nht)}function $ht(t,e,r){return crypto.randomUUID?crypto.randomUUID():Pht(t)}function Pht(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??Oht();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Mht(n)}var K$=(function(){var t=T(function(w,k,S,C){for(S=S||{},C=w.length;C--;S[w[C]]=k);return S},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],m=[1,34],y=[1,6,7,11,13,15,16,19,22],v={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:T(function(k,S,C,_,L,O,M){var z=O.length-1;switch(L){case 6:case 7:return _;case 8:_.getLogger().trace("Stop NL ");break;case 9:_.getLogger().trace("Stop EOF ");break;case 11:_.getLogger().trace("Stop NL2 ");break;case 12:_.getLogger().trace("Stop EOF2 ");break;case 15:_.getLogger().info("Node: ",O[z].id),_.addNode(O[z-1].length,O[z].id,O[z].descr,O[z].type);break;case 16:_.getLogger().trace("Icon: ",O[z]),_.decorateNode({icon:O[z]});break;case 17:case 21:_.decorateNode({class:O[z]});break;case 18:_.getLogger().trace("SPACELIST");break;case 19:_.getLogger().trace("Node: ",O[z].id),_.addNode(0,O[z].id,O[z].descr,O[z].type);break;case 20:_.decorateNode({icon:O[z]});break;case 25:_.getLogger().trace("node found ..",O[z-2]),this.$={id:O[z-1],descr:O[z-1],type:_.getType(O[z-2],O[z])};break;case 26:this.$={id:O[z],descr:O[z],type:_.nodeType.DEFAULT};break;case 27:_.getLogger().trace("node found ..",O[z-3]),this.$={id:O[z-3],descr:O[z-1],type:_.getType(O[z-2],O[z])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:u,7:h,10:23,11:d},t(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:o}),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,23]),t(f,[2,24]),t(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(p,[2,14],{7:g,11:m}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(f,[2,15]),t(f,[2,16]),t(f,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:g,11:m}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:T(function(k,S){if(S.recoverable)this.trace(k);else{var C=new Error(k);throw C.hash=S,C}},"parseError"),parse:T(function(k){var S=this,C=[0],_=[],L=[null],O=[],M=this.table,z="",F=0,A=0,R=2,N=1,D=O.slice.call(arguments,1),I=Object.create(this.lexer),$={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&($.yy[B]=this.yy[B]);I.setInput(k,$.yy),$.yy.lexer=I,$.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var P=I.yylloc;O.push(P);var G=I.options&&I.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(_e){C.length=C.length-2*_e,L.length=L.length-_e,O.length=O.length-_e}T(V,"popStack");function X(){var _e;return _e=_.pop()||I.lex()||N,typeof _e!="number"&&(_e instanceof Array&&(_=_e,_e=_.pop()),_e=S.symbols_[_e]||_e),_e}T(X,"lex");for(var W,ie,K,se,J={},Z,ee,ne,ue;;){if(ie=C[C.length-1],this.defaultActions[ie]?K=this.defaultActions[ie]:((W===null||typeof W>"u")&&(W=X()),K=M[ie]&&M[ie][W]),typeof K>"u"||!K.length||!K[0]){var fe="";ue=[];for(Z in M[ie])this.terminals_[Z]&&Z>R&&ue.push("'"+this.terminals_[Z]+"'");I.showPosition?fe="Parse error on line "+(F+1)+`: `+I.showPosition()+` -Expecting `+ue.join(", ")+", got '"+(this.terminals_[W]||W)+"'":fe="Parse error on line "+(F+1)+": Unexpected "+(W==N?"end of input":"'"+(this.terminals_[W]||W)+"'"),this.parseError(fe,{text:I.match,token:this.terminals_[W]||W,line:I.yylineno,loc:P,expected:ue})}if(K[0]instanceof Array&&K.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ie+", token: "+W);switch(K[0]){case 1:C.push(W),L.push(I.yytext),O.push(I.yylloc),C.push(K[1]),W=null,S=I.yyleng,z=I.yytext,F=I.yylineno,P=I.yylloc;break;case 2:if(ee=this.productions_[K[1]][1],J.$=L[L.length-ee],J._$={first_line:O[O.length-(ee||1)].first_line,last_line:O[O.length-1].last_line,first_column:O[O.length-(ee||1)].first_column,last_column:O[O.length-1].last_column},G&&(J._$.range=[O[O.length-(ee||1)].range[0],O[O.length-1].range[1]]),se=this.performAction.apply(J,[z,S,F,$.yy,K[1],L,O].concat(D)),typeof se<"u")return se;ee&&(C=C.slice(0,-1*ee*2),L=L.slice(0,-1*ee),O=O.slice(0,-1*ee)),C.push(this.productions_[K[1]][0]),L.push(J.$),O.push(J._$),ne=M[C[C.length-2]][C[C.length-1]],C.push(ne);break;case 3:return!0}}return!0},"parse")},T=(function(){var w={EOF:1,parseError:x(function(A,C){if(this.yy.parser)this.yy.parser.parseError(A,C);else throw new Error(A)},"parseError"),setInput:x(function(k,A){return this.yy=A||this.yy||{},this._input=k,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var k=this._input[0];this.yytext+=k,this.yyleng++,this.offset++,this.match+=k,this.matched+=k;var A=k.match(/(?:\r\n?|\n).*/g);return A?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),k},"input"),unput:x(function(k){var A=k.length,C=k.split(/(?:\r\n?|\n)/g);this._input=k+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-A),this.offset-=A;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),C.length-1&&(this.yylineno-=C.length-1);var L=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:C?(C.length===_.length?this.yylloc.first_column:0)+_[_.length-C.length].length-C[0].length:this.yylloc.first_column-A},this.options.ranges&&(this.yylloc.range=[L[0],L[0]+this.yyleng-A]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(k){this.unput(this.match.slice(k))},"less"),pastInput:x(function(){var k=this.matched.substr(0,this.matched.length-this.match.length);return(k.length>20?"...":"")+k.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var k=this.match;return k.length<20&&(k+=this._input.substr(0,20-k.length)),(k.substr(0,20)+(k.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var k=this.pastInput(),A=new Array(k.length+1).join("-");return k+this.upcomingInput()+` -`+A+"^"},"showPosition"),test_match:x(function(k,A){var C,_,L;if(this.options.backtrack_lexer&&(L={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(L.yylloc.range=this.yylloc.range.slice(0))),_=k[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+k[0].length},this.yytext+=k[0],this.match+=k[0],this.matches=k,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(k[0].length),this.matched+=k[0],C=this.performAction.call(this,this.yy,this,A,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),C)return C;if(this._backtrack){for(var O in L)this[O]=L[O];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var k,A,C,_;this._more||(this.yytext="",this.match="");for(var L=this._currentRules(),O=0;OA[0].length)){if(A=C,_=O,this.options.backtrack_lexer){if(k=this.test_match(C,L[O]),k!==!1)return k;if(this._backtrack){A=!1;continue}else return!1}else if(!this.options.flex)break}return A?(k=this.test_match(A,L[_]),k!==!1?k:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var A=this.next();return A||this.lex()},"lex"),begin:x(function(A){this.conditionStack.push(A)},"begin"),popState:x(function(){var A=this.conditionStack.length-1;return A>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(A){return A=this.conditionStack.length-1-Math.abs(A||0),A>=0?this.conditionStack[A]:"INITIAL"},"topState"),pushState:x(function(A){this.begin(A)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(A,C,_,L){switch(_){case 0:return A.getLogger().trace("Found comment",C.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:A.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return A.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:A.getLogger().trace("end icon"),this.popState();break;case 10:return A.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return A.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return A.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return A.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:A.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return A.getLogger().trace("description:",C.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),A.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),A.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),A.getLogger().trace("node end ...",C.yytext),"NODE_DEND";case 30:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),A.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),A.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 35:return A.getLogger().trace("Long description:",C.yytext),20;case 36:return A.getLogger().trace("Long description:",C.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return w})();v.lexer=T;function b(){this.yy={}}return x(b,"Parser"),b.prototype=v,v.Parser=b,new b})();W$.parser=W$;var Eht=W$,Sht=12,yu={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Aht=(qv=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=yu,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level0?this.nodes[0]:null}addNode(e,r,n,i){var h,d;ae.info("addNode",e,r,n,i);let a=!1;this.nodes.length===0?(this.baseLevel=e,e=0,a=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,a=!1);const s=Pe();let o=((h=s.mindmap)==null?void 0:h.padding)??Fr.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:o*=2;break}const l={id:this.count++,nodeId:qr(r,s),level:e,descr:qr(n,s),type:i,children:[],width:((d=s.mindmap)==null?void 0:d.maxNodeWidth)??Fr.mindmap.maxNodeWidth,padding:o,isRoot:a},u=this.getParent(e);if(u)u.children.push(l),this.nodes.push(l);else if(a)this.nodes.push(l);else throw new Error(`There can be only one root. No parent could be found for ("${l.descr}")`)}getType(e,r){switch(ae.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const r=Pe(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=qr(e.icon,r)),e.class&&(n.class=qr(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(const[n,i]of e.children.entries()){const a=e.level===0?n%(Sht-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=Pe(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);const a=i.join(" "),s=x(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case yu.CIRCLE:return"mindmapCircle";case yu.RECT:return"rect";case yu.ROUNDED_RECT:return"rounded";case yu.CLOUD:return"cloud";case yu.BANG:return"bang";case yu.HEXAGON:return"hexagon";case yu.DEFAULT:return h?"rounded":"defaultMindmapNode";case yu.NO_BORDER:default:return"rect"}},"getShapeFromType"),o={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:s(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:a,cssStyles:[],look:n.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(o),e.children)for(const l of e.children)this.flattenNodes(l,r)}generateEdges(e,r){if(!e.children)return;const n=Pe();for(const i of e.children){let a="edge";i.section!==void 0&&(a+=` section-edge-${i.section}`);const s=e.level+1;a+=` edge-depth-${s}`;const o={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:n.look,classes:a,depth:e.level,section:i.section};r.push(o),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=Pe(),i=oxe().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};ae.debug("getData: mindmapRoot",e,r),this.assignSections(e);const s=[],o=[];this.flattenNodes(e,s),this.generateEdges(e,o),ae.debug(`getData: processed ${s.length} nodes and ${o.length} edges`);const l=new Map;for(const u of s)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:s,edges:o,config:a,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+Cht()}}getLogger(){return ae}},x(qv,"MindmapDB"),qv),_ht=x(async(t,e,r,n)=>{var f,p;ae.debug(`Rendering mindmap diagram -`+t);const i=n.db,a=i.getData(),s=Xp(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=sb(a.config.layout,{fallback:"cose-bilkent"}),a.diagramId=e,!i.getMindmap())return;a.nodes.forEach(g=>{g.shape==="rounded"?(g.radius=15,g.taper=15,g.stroke="none",g.width=0,g.padding=15):g.shape==="circle"?g.padding=10:g.shape==="rect"?(g.width=0,g.padding=10):g.shape==="hexagon"&&(g.width=0,g.height=0)}),await Z0(a,s);const{themeVariables:l}=lr(),{useGradient:u,gradientStart:h,gradientStop:d}=l;if(u&&h&&d){const g=s.attr("id"),m=s.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");m.append("stop").attr("offset","0%").attr("stop-color",h).attr("stop-opacity",1),m.append("stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}Wd(s,((f=a.config.mindmap)==null?void 0:f.padding)??Fr.mindmap.padding,"mindmapDiagram",((p=a.config.mindmap)==null?void 0:p.useMaxWidth)??Fr.mindmap.useMaxWidth)},"draw"),Rht={draw:_ht},Lht=x(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i1)throw new Error("Parse Error: multiple actions possible at state: "+ie+", token: "+W);switch(K[0]){case 1:C.push(W),L.push(I.yytext),O.push(I.yylloc),C.push(K[1]),W=null,A=I.yyleng,z=I.yytext,F=I.yylineno,P=I.yylloc;break;case 2:if(ee=this.productions_[K[1]][1],J.$=L[L.length-ee],J._$={first_line:O[O.length-(ee||1)].first_line,last_line:O[O.length-1].last_line,first_column:O[O.length-(ee||1)].first_column,last_column:O[O.length-1].last_column},G&&(J._$.range=[O[O.length-(ee||1)].range[0],O[O.length-1].range[1]]),se=this.performAction.apply(J,[z,A,F,$.yy,K[1],L,O].concat(D)),typeof se<"u")return se;ee&&(C=C.slice(0,-1*ee*2),L=L.slice(0,-1*ee),O=O.slice(0,-1*ee)),C.push(this.productions_[K[1]][0]),L.push(J.$),O.push(J._$),ne=M[C[C.length-2]][C[C.length-1]],C.push(ne);break;case 3:return!0}}return!0},"parse")},x=(function(){var w={EOF:1,parseError:T(function(S,C){if(this.yy.parser)this.yy.parser.parseError(S,C);else throw new Error(S)},"parseError"),setInput:T(function(k,S){return this.yy=S||this.yy||{},this._input=k,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var k=this._input[0];this.yytext+=k,this.yyleng++,this.offset++,this.match+=k,this.matched+=k;var S=k.match(/(?:\r\n?|\n).*/g);return S?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),k},"input"),unput:T(function(k){var S=k.length,C=k.split(/(?:\r\n?|\n)/g);this._input=k+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-S),this.offset-=S;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),C.length-1&&(this.yylineno-=C.length-1);var L=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:C?(C.length===_.length?this.yylloc.first_column:0)+_[_.length-C.length].length-C[0].length:this.yylloc.first_column-S},this.options.ranges&&(this.yylloc.range=[L[0],L[0]+this.yyleng-S]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(k){this.unput(this.match.slice(k))},"less"),pastInput:T(function(){var k=this.matched.substr(0,this.matched.length-this.match.length);return(k.length>20?"...":"")+k.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var k=this.match;return k.length<20&&(k+=this._input.substr(0,20-k.length)),(k.substr(0,20)+(k.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var k=this.pastInput(),S=new Array(k.length+1).join("-");return k+this.upcomingInput()+` +`+S+"^"},"showPosition"),test_match:T(function(k,S){var C,_,L;if(this.options.backtrack_lexer&&(L={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(L.yylloc.range=this.yylloc.range.slice(0))),_=k[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+k[0].length},this.yytext+=k[0],this.match+=k[0],this.matches=k,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(k[0].length),this.matched+=k[0],C=this.performAction.call(this,this.yy,this,S,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),C)return C;if(this._backtrack){for(var O in L)this[O]=L[O];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var k,S,C,_;this._more||(this.yytext="",this.match="");for(var L=this._currentRules(),O=0;OS[0].length)){if(S=C,_=O,this.options.backtrack_lexer){if(k=this.test_match(C,L[O]),k!==!1)return k;if(this._backtrack){S=!1;continue}else return!1}else if(!this.options.flex)break}return S?(k=this.test_match(S,L[_]),k!==!1?k:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var S=this.next();return S||this.lex()},"lex"),begin:T(function(S){this.conditionStack.push(S)},"begin"),popState:T(function(){var S=this.conditionStack.length-1;return S>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:T(function(S){this.begin(S)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(S,C,_,L){switch(_){case 0:return S.getLogger().trace("Found comment",C.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:S.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return S.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:S.getLogger().trace("end icon"),this.popState();break;case 10:return S.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return S.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return S.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return S.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:S.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return S.getLogger().trace("description:",C.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),S.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),S.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),S.getLogger().trace("node end ...",C.yytext),"NODE_DEND";case 30:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 35:return S.getLogger().trace("Long description:",C.yytext),20;case 36:return S.getLogger().trace("Long description:",C.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return w})();v.lexer=x;function b(){this.yy={}}return T(b,"Parser"),b.prototype=v,v.Parser=b,new b})();K$.parser=K$;var Bht=K$,Fht=12,yu={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},zht=(Vv=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=yu,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level0?this.nodes[0]:null}addNode(e,r,n,i){var h,d;ae.info("addNode",e,r,n,i);let a=!1;this.nodes.length===0?(this.baseLevel=e,e=0,a=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,a=!1);const s=Pe();let o=((h=s.mindmap)==null?void 0:h.padding)??Fr.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:o*=2;break}const l={id:this.count++,nodeId:qr(r,s),level:e,descr:qr(n,s),type:i,children:[],width:((d=s.mindmap)==null?void 0:d.maxNodeWidth)??Fr.mindmap.maxNodeWidth,padding:o,isRoot:a},u=this.getParent(e);if(u)u.children.push(l),this.nodes.push(l);else if(a)this.nodes.push(l);else throw new Error(`There can be only one root. No parent could be found for ("${l.descr}")`)}getType(e,r){switch(ae.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const r=Pe(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=qr(e.icon,r)),e.class&&(n.class=qr(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(const[n,i]of e.children.entries()){const a=e.level===0?n%(Fht-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=Pe(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);const a=i.join(" "),s=T(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case yu.CIRCLE:return"mindmapCircle";case yu.RECT:return"rect";case yu.ROUNDED_RECT:return"rounded";case yu.CLOUD:return"cloud";case yu.BANG:return"bang";case yu.HEXAGON:return"hexagon";case yu.DEFAULT:return h?"rounded":"defaultMindmapNode";case yu.NO_BORDER:default:return"rect"}},"getShapeFromType"),o={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:s(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:a,cssStyles:[],look:n.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(o),e.children)for(const l of e.children)this.flattenNodes(l,r)}generateEdges(e,r){if(!e.children)return;const n=Pe();for(const i of e.children){let a="edge";i.section!==void 0&&(a+=` section-edge-${i.section}`);const s=e.level+1;a+=` edge-depth-${s}`;const o={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:n.look,classes:a,depth:e.level,section:i.section};r.push(o),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=Pe(),i=fxe().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};ae.debug("getData: mindmapRoot",e,r),this.assignSections(e);const s=[],o=[];this.flattenNodes(e,s),this.generateEdges(e,o),ae.debug(`getData: processed ${s.length} nodes and ${o.length} edges`);const l=new Map;for(const u of s)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:s,edges:o,config:a,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+$ht()}}getLogger(){return ae}},T(Vv,"MindmapDB"),Vv),Ght=T(async(t,e,r,n)=>{var f,p;ae.debug(`Rendering mindmap diagram +`+t);const i=n.db,a=i.getData(),s=K0(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=ob(a.config.layout,{fallback:"cose-bilkent"}),a.diagramId=e,!i.getMindmap())return;a.nodes.forEach(g=>{g.shape==="rounded"?(g.radius=15,g.taper=15,g.stroke="none",g.width=0,g.padding=15):g.shape==="circle"?g.padding=10:g.shape==="rect"?(g.width=0,g.padding=10):g.shape==="hexagon"&&(g.width=0,g.height=0)}),await Zp(a,s);const{themeVariables:l}=lr(),{useGradient:u,gradientStart:h,gradientStop:d}=l;if(u&&h&&d){const g=s.attr("id"),m=s.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");m.append("stop").attr("offset","0%").attr("stop-color",h).attr("stop-opacity",1),m.append("stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}Wd(s,((f=a.config.mindmap)==null?void 0:f.padding)??Fr.mindmap.padding,"mindmapDiagram",((p=a.config.mindmap)==null?void 0:p.useMaxWidth)??Fr.mindmap.useMaxWidth)},"draw"),qht={draw:Ght},Vht=T(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i{let n="";for(let i=0;i{let n="";for(let i=0;i{const{theme:e}=t,r=t.svgId,n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return` + }`;return n},"genGradient"),Uht=T(t=>{const{theme:e}=t,r=t.svgId,n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return` .edge { stroke-width: 3; } - ${Lht(t)} + ${Vht(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -2807,18 +2807,18 @@ Expecting `+ue.join(", ")+", got '"+(this.terminals_[W]||W)+"'":fe="Parse error [data-look="neo"].mindmap-node.section-root .text-inner-tspan { fill: ${e!=null&&e.includes("redux")?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:0)]}; } - ${t.useGradient&&r&&t.mainBkg?Iht(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} -`},"getStyles"),Mht=Dht,Nht={get db(){return new Aht},renderer:Rht,parser:Eht,styles:Mht};const Oht=Object.freeze(Object.defineProperty({__proto__:null,diagram:Nht},Symbol.toStringTag,{value:"Module"}));var U$=(function(){var t=x(function(C,_,L,O){for(L=L||{},O=C.length;O--;L[C[O]]=_);return L},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,31],g=[6,7,11,24],m=[1,6,13,16,17,20,23],y=[1,35],v=[1,36],T=[1,6,7,11,13,16,17,20,23],b=[1,38],w={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:x(function(_,L,O,M,z,F,S){var R=F.length-1;switch(z){case 6:case 7:return M;case 8:M.getLogger().trace("Stop NL ");break;case 9:M.getLogger().trace("Stop EOF ");break;case 11:M.getLogger().trace("Stop NL2 ");break;case 12:M.getLogger().trace("Stop EOF2 ");break;case 15:M.getLogger().info("Node: ",F[R-1].id),M.addNode(F[R-2].length,F[R-1].id,F[R-1].descr,F[R-1].type,F[R]);break;case 16:M.getLogger().info("Node: ",F[R].id),M.addNode(F[R-1].length,F[R].id,F[R].descr,F[R].type);break;case 17:M.getLogger().trace("Icon: ",F[R]),M.decorateNode({icon:F[R]});break;case 18:case 23:M.decorateNode({class:F[R]});break;case 19:M.getLogger().trace("SPACELIST");break;case 20:M.getLogger().trace("Node: ",F[R-1].id),M.addNode(0,F[R-1].id,F[R-1].descr,F[R-1].type,F[R]);break;case 21:M.getLogger().trace("Node: ",F[R].id),M.addNode(0,F[R].id,F[R].descr,F[R].type);break;case 22:M.decorateNode({icon:F[R]});break;case 27:M.getLogger().trace("node found ..",F[R-2]),this.$={id:F[R-1],descr:F[R-1],type:M.getType(F[R-2],F[R])};break;case 28:this.$={id:F[R],descr:F[R],type:0};break;case 29:M.getLogger().trace("node found ..",F[R-3]),this.$={id:F[R-3],descr:F[R-1],type:M.getType(F[R-2],F[R])};break;case 30:this.$=F[R-1]+F[R];break;case 31:this.$=F[R];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:u,7:h,10:23,11:d},t(f,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:o}),t(f,[2,19]),t(f,[2,21],{15:30,24:p}),t(f,[2,22]),t(f,[2,23]),t(g,[2,25]),t(g,[2,26]),t(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:h,10:34,11:d},{1:[2,7],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(m,[2,14],{7:y,11:v}),t(T,[2,8]),t(T,[2,9]),t(T,[2,10]),t(f,[2,16],{15:37,24:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,20],{24:b}),t(g,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:y,11:v}),t(T,[2,11]),t(T,[2,12]),t(f,[2,15],{24:b}),t(g,[2,30]),{22:[1,41]},t(g,[2,27]),t(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(_,L){if(L.recoverable)this.trace(_);else{var O=new Error(_);throw O.hash=L,O}},"parseError"),parse:x(function(_){var L=this,O=[0],M=[],z=[null],F=[],S=this.table,R="",N=0,D=0,I=2,$=1,B=F.slice.call(arguments,1),P=Object.create(this.lexer),G={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(G.yy[V]=this.yy[V]);P.setInput(_,G.yy),G.yy.lexer=P,G.yy.parser=this,typeof P.yylloc>"u"&&(P.yylloc={});var Y=P.yylloc;F.push(Y);var W=P.options&&P.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ie(me){O.length=O.length-2*me,z.length=z.length-me,F.length=F.length-me}x(ie,"popStack");function K(){var me;return me=M.pop()||P.lex()||$,typeof me!="number"&&(me instanceof Array&&(M=me,me=M.pop()),me=L.symbols_[me]||me),me}x(K,"lex");for(var se,J,Z,ee,ne={},ue,fe,_e,Ae;;){if(J=O[O.length-1],this.defaultActions[J]?Z=this.defaultActions[J]:((se===null||typeof se>"u")&&(se=K()),Z=S[J]&&S[J][se]),typeof Z>"u"||!Z.length||!Z[0]){var Ne="";Ae=[];for(ue in S[J])this.terminals_[ue]&&ue>I&&Ae.push("'"+this.terminals_[ue]+"'");P.showPosition?Ne="Parse error on line "+(N+1)+`: + ${t.useGradient&&r&&t.mainBkg?Wht(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} +`},"getStyles"),Hht=Uht,Yht={get db(){return new zht},renderer:qht,parser:Bht,styles:Hht};const Xht=Object.freeze(Object.defineProperty({__proto__:null,diagram:Yht},Symbol.toStringTag,{value:"Module"}));var j$=(function(){var t=T(function(C,_,L,O){for(L=L||{},O=C.length;O--;L[C[O]]=_);return L},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,31],g=[6,7,11,24],m=[1,6,13,16,17,20,23],y=[1,35],v=[1,36],x=[1,6,7,11,13,16,17,20,23],b=[1,38],w={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:T(function(_,L,O,M,z,F,A){var R=F.length-1;switch(z){case 6:case 7:return M;case 8:M.getLogger().trace("Stop NL ");break;case 9:M.getLogger().trace("Stop EOF ");break;case 11:M.getLogger().trace("Stop NL2 ");break;case 12:M.getLogger().trace("Stop EOF2 ");break;case 15:M.getLogger().info("Node: ",F[R-1].id),M.addNode(F[R-2].length,F[R-1].id,F[R-1].descr,F[R-1].type,F[R]);break;case 16:M.getLogger().info("Node: ",F[R].id),M.addNode(F[R-1].length,F[R].id,F[R].descr,F[R].type);break;case 17:M.getLogger().trace("Icon: ",F[R]),M.decorateNode({icon:F[R]});break;case 18:case 23:M.decorateNode({class:F[R]});break;case 19:M.getLogger().trace("SPACELIST");break;case 20:M.getLogger().trace("Node: ",F[R-1].id),M.addNode(0,F[R-1].id,F[R-1].descr,F[R-1].type,F[R]);break;case 21:M.getLogger().trace("Node: ",F[R].id),M.addNode(0,F[R].id,F[R].descr,F[R].type);break;case 22:M.decorateNode({icon:F[R]});break;case 27:M.getLogger().trace("node found ..",F[R-2]),this.$={id:F[R-1],descr:F[R-1],type:M.getType(F[R-2],F[R])};break;case 28:this.$={id:F[R],descr:F[R],type:0};break;case 29:M.getLogger().trace("node found ..",F[R-3]),this.$={id:F[R-3],descr:F[R-1],type:M.getType(F[R-2],F[R])};break;case 30:this.$=F[R-1]+F[R];break;case 31:this.$=F[R];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:u,7:h,10:23,11:d},t(f,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:o}),t(f,[2,19]),t(f,[2,21],{15:30,24:p}),t(f,[2,22]),t(f,[2,23]),t(g,[2,25]),t(g,[2,26]),t(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:h,10:34,11:d},{1:[2,7],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(m,[2,14],{7:y,11:v}),t(x,[2,8]),t(x,[2,9]),t(x,[2,10]),t(f,[2,16],{15:37,24:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,20],{24:b}),t(g,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:y,11:v}),t(x,[2,11]),t(x,[2,12]),t(f,[2,15],{24:b}),t(g,[2,30]),{22:[1,41]},t(g,[2,27]),t(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:T(function(_,L){if(L.recoverable)this.trace(_);else{var O=new Error(_);throw O.hash=L,O}},"parseError"),parse:T(function(_){var L=this,O=[0],M=[],z=[null],F=[],A=this.table,R="",N=0,D=0,I=2,$=1,B=F.slice.call(arguments,1),P=Object.create(this.lexer),G={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(G.yy[V]=this.yy[V]);P.setInput(_,G.yy),G.yy.lexer=P,G.yy.parser=this,typeof P.yylloc>"u"&&(P.yylloc={});var X=P.yylloc;F.push(X);var W=P.options&&P.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ie(me){O.length=O.length-2*me,z.length=z.length-me,F.length=F.length-me}T(ie,"popStack");function K(){var me;return me=M.pop()||P.lex()||$,typeof me!="number"&&(me instanceof Array&&(M=me,me=M.pop()),me=L.symbols_[me]||me),me}T(K,"lex");for(var se,J,Z,ee,ne={},ue,fe,_e,Ae;;){if(J=O[O.length-1],this.defaultActions[J]?Z=this.defaultActions[J]:((se===null||typeof se>"u")&&(se=K()),Z=A[J]&&A[J][se]),typeof Z>"u"||!Z.length||!Z[0]){var Ne="";Ae=[];for(ue in A[J])this.terminals_[ue]&&ue>I&&Ae.push("'"+this.terminals_[ue]+"'");P.showPosition?Ne="Parse error on line "+(N+1)+`: `+P.showPosition()+` -Expecting `+Ae.join(", ")+", got '"+(this.terminals_[se]||se)+"'":Ne="Parse error on line "+(N+1)+": Unexpected "+(se==$?"end of input":"'"+(this.terminals_[se]||se)+"'"),this.parseError(Ne,{text:P.match,token:this.terminals_[se]||se,line:P.yylineno,loc:Y,expected:Ae})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+J+", token: "+se);switch(Z[0]){case 1:O.push(se),z.push(P.yytext),F.push(P.yylloc),O.push(Z[1]),se=null,D=P.yyleng,R=P.yytext,N=P.yylineno,Y=P.yylloc;break;case 2:if(fe=this.productions_[Z[1]][1],ne.$=z[z.length-fe],ne._$={first_line:F[F.length-(fe||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(fe||1)].first_column,last_column:F[F.length-1].last_column},W&&(ne._$.range=[F[F.length-(fe||1)].range[0],F[F.length-1].range[1]]),ee=this.performAction.apply(ne,[R,D,N,G.yy,Z[1],z,F].concat(B)),typeof ee<"u")return ee;fe&&(O=O.slice(0,-1*fe*2),z=z.slice(0,-1*fe),F=F.slice(0,-1*fe)),O.push(this.productions_[Z[1]][0]),z.push(ne.$),F.push(ne._$),_e=S[O[O.length-2]][O[O.length-1]],O.push(_e);break;case 3:return!0}}return!0},"parse")},k=(function(){var C={EOF:1,parseError:x(function(L,O){if(this.yy.parser)this.yy.parser.parseError(L,O);else throw new Error(L)},"parseError"),setInput:x(function(_,L){return this.yy=L||this.yy||{},this._input=_,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var _=this._input[0];this.yytext+=_,this.yyleng++,this.offset++,this.match+=_,this.matched+=_;var L=_.match(/(?:\r\n?|\n).*/g);return L?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),_},"input"),unput:x(function(_){var L=_.length,O=_.split(/(?:\r\n?|\n)/g);this._input=_+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-L),this.offset-=L;var M=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),O.length-1&&(this.yylineno-=O.length-1);var z=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:O?(O.length===M.length?this.yylloc.first_column:0)+M[M.length-O.length].length-O[0].length:this.yylloc.first_column-L},this.options.ranges&&(this.yylloc.range=[z[0],z[0]+this.yyleng-L]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(_){this.unput(this.match.slice(_))},"less"),pastInput:x(function(){var _=this.matched.substr(0,this.matched.length-this.match.length);return(_.length>20?"...":"")+_.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var _=this.match;return _.length<20&&(_+=this._input.substr(0,20-_.length)),(_.substr(0,20)+(_.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var _=this.pastInput(),L=new Array(_.length+1).join("-");return _+this.upcomingInput()+` -`+L+"^"},"showPosition"),test_match:x(function(_,L){var O,M,z;if(this.options.backtrack_lexer&&(z={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(z.yylloc.range=this.yylloc.range.slice(0))),M=_[0].match(/(?:\r\n?|\n).*/g),M&&(this.yylineno+=M.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:M?M[M.length-1].length-M[M.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+_[0].length},this.yytext+=_[0],this.match+=_[0],this.matches=_,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(_[0].length),this.matched+=_[0],O=this.performAction.call(this,this.yy,this,L,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),O)return O;if(this._backtrack){for(var F in z)this[F]=z[F];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var _,L,O,M;this._more||(this.yytext="",this.match="");for(var z=this._currentRules(),F=0;FL[0].length)){if(L=O,M=F,this.options.backtrack_lexer){if(_=this.test_match(O,z[F]),_!==!1)return _;if(this._backtrack){L=!1;continue}else return!1}else if(!this.options.flex)break}return L?(_=this.test_match(L,z[M]),_!==!1?_:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var L=this.next();return L||this.lex()},"lex"),begin:x(function(L){this.conditionStack.push(L)},"begin"),popState:x(function(){var L=this.conditionStack.length-1;return L>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(L){return L=this.conditionStack.length-1-Math.abs(L||0),L>=0?this.conditionStack[L]:"INITIAL"},"topState"),pushState:x(function(L){this.begin(L)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(L,O,M,z){switch(M){case 0:return this.pushState("shapeData"),O.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const F=/\n\s*/g;return O.yytext=O.yytext.replace(F,"
"),24;case 4:return 24;case 5:this.popState();break;case 6:return L.getLogger().trace("Found comment",O.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:L.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return L.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:L.getLogger().trace("end icon"),this.popState();break;case 16:return L.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return L.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return L.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return L.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:L.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return L.getLogger().trace("description:",O.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),L.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),L.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),L.getLogger().trace("node end ...",O.yytext),"NODE_DEND";case 36:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),L.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),L.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 41:return L.getLogger().trace("Long description:",O.yytext),21;case 42:return L.getLogger().trace("Long description:",O.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return C})();w.lexer=k;function A(){this.yy={}}return x(A,"Parser"),A.prototype=w,w.Parser=A,new A})();U$.parser=U$;var $ht=U$,ko=[],H$=[],Y$=0,X$={},Pht=x(()=>{ko=[],H$=[],Y$=0,X$={}},"clear"),Bht=x(t=>{if(ko.length===0)return null;const e=ko[0].level;let r=null;for(let n=ko.length-1;n>=0;n--)if(ko[n].level===e&&!r&&(r=ko[n]),ko[n].levelo.parentId===i.id);for(const o of s){const l={id:o.id,parentId:i.id,label:qr(o.label??"",n),labelType:"markdown",isGroup:!1,ticket:o==null?void 0:o.ticket,priority:o==null?void 0:o.priority,assigned:o==null?void 0:o.assigned,icon:o==null?void 0:o.icon,shape:"kanbanItem",level:o.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:Pe()}},"getData"),zht=x((t,e,r,n,i)=>{var u,h;const a=Pe();let s=((u=a.mindmap)==null?void 0:u.padding)??Fr.mindmap.padding;switch(n){case Hi.ROUNDED_RECT:case Hi.RECT:case Hi.HEXAGON:s*=2}const o={id:qr(e,a)||"kbn"+Y$++,level:t,label:qr(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??Fr.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(i!==void 0){let d;i.includes(` +Expecting `+Ae.join(", ")+", got '"+(this.terminals_[se]||se)+"'":Ne="Parse error on line "+(N+1)+": Unexpected "+(se==$?"end of input":"'"+(this.terminals_[se]||se)+"'"),this.parseError(Ne,{text:P.match,token:this.terminals_[se]||se,line:P.yylineno,loc:X,expected:Ae})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+J+", token: "+se);switch(Z[0]){case 1:O.push(se),z.push(P.yytext),F.push(P.yylloc),O.push(Z[1]),se=null,D=P.yyleng,R=P.yytext,N=P.yylineno,X=P.yylloc;break;case 2:if(fe=this.productions_[Z[1]][1],ne.$=z[z.length-fe],ne._$={first_line:F[F.length-(fe||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(fe||1)].first_column,last_column:F[F.length-1].last_column},W&&(ne._$.range=[F[F.length-(fe||1)].range[0],F[F.length-1].range[1]]),ee=this.performAction.apply(ne,[R,D,N,G.yy,Z[1],z,F].concat(B)),typeof ee<"u")return ee;fe&&(O=O.slice(0,-1*fe*2),z=z.slice(0,-1*fe),F=F.slice(0,-1*fe)),O.push(this.productions_[Z[1]][0]),z.push(ne.$),F.push(ne._$),_e=A[O[O.length-2]][O[O.length-1]],O.push(_e);break;case 3:return!0}}return!0},"parse")},k=(function(){var C={EOF:1,parseError:T(function(L,O){if(this.yy.parser)this.yy.parser.parseError(L,O);else throw new Error(L)},"parseError"),setInput:T(function(_,L){return this.yy=L||this.yy||{},this._input=_,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var _=this._input[0];this.yytext+=_,this.yyleng++,this.offset++,this.match+=_,this.matched+=_;var L=_.match(/(?:\r\n?|\n).*/g);return L?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),_},"input"),unput:T(function(_){var L=_.length,O=_.split(/(?:\r\n?|\n)/g);this._input=_+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-L),this.offset-=L;var M=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),O.length-1&&(this.yylineno-=O.length-1);var z=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:O?(O.length===M.length?this.yylloc.first_column:0)+M[M.length-O.length].length-O[0].length:this.yylloc.first_column-L},this.options.ranges&&(this.yylloc.range=[z[0],z[0]+this.yyleng-L]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(_){this.unput(this.match.slice(_))},"less"),pastInput:T(function(){var _=this.matched.substr(0,this.matched.length-this.match.length);return(_.length>20?"...":"")+_.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var _=this.match;return _.length<20&&(_+=this._input.substr(0,20-_.length)),(_.substr(0,20)+(_.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var _=this.pastInput(),L=new Array(_.length+1).join("-");return _+this.upcomingInput()+` +`+L+"^"},"showPosition"),test_match:T(function(_,L){var O,M,z;if(this.options.backtrack_lexer&&(z={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(z.yylloc.range=this.yylloc.range.slice(0))),M=_[0].match(/(?:\r\n?|\n).*/g),M&&(this.yylineno+=M.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:M?M[M.length-1].length-M[M.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+_[0].length},this.yytext+=_[0],this.match+=_[0],this.matches=_,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(_[0].length),this.matched+=_[0],O=this.performAction.call(this,this.yy,this,L,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),O)return O;if(this._backtrack){for(var F in z)this[F]=z[F];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var _,L,O,M;this._more||(this.yytext="",this.match="");for(var z=this._currentRules(),F=0;FL[0].length)){if(L=O,M=F,this.options.backtrack_lexer){if(_=this.test_match(O,z[F]),_!==!1)return _;if(this._backtrack){L=!1;continue}else return!1}else if(!this.options.flex)break}return L?(_=this.test_match(L,z[M]),_!==!1?_:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var L=this.next();return L||this.lex()},"lex"),begin:T(function(L){this.conditionStack.push(L)},"begin"),popState:T(function(){var L=this.conditionStack.length-1;return L>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(L){return L=this.conditionStack.length-1-Math.abs(L||0),L>=0?this.conditionStack[L]:"INITIAL"},"topState"),pushState:T(function(L){this.begin(L)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(L,O,M,z){switch(M){case 0:return this.pushState("shapeData"),O.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const F=/\n\s*/g;return O.yytext=O.yytext.replace(F,"
"),24;case 4:return 24;case 5:this.popState();break;case 6:return L.getLogger().trace("Found comment",O.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:L.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return L.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:L.getLogger().trace("end icon"),this.popState();break;case 16:return L.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return L.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return L.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return L.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:L.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return L.getLogger().trace("description:",O.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),L.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),L.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),L.getLogger().trace("node end ...",O.yytext),"NODE_DEND";case 36:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),L.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),L.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 41:return L.getLogger().trace("Long description:",O.yytext),21;case 42:return L.getLogger().trace("Long description:",O.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return C})();w.lexer=k;function S(){this.yy={}}return T(S,"Parser"),S.prototype=w,w.Parser=S,new S})();j$.parser=j$;var Kht=j$,ko=[],Z$=[],Q$=0,J$={},jht=T(()=>{ko=[],Z$=[],Q$=0,J$={}},"clear"),Zht=T(t=>{if(ko.length===0)return null;const e=ko[0].level;let r=null;for(let n=ko.length-1;n>=0;n--)if(ko[n].level===e&&!r&&(r=ko[n]),ko[n].levelo.parentId===i.id);for(const o of s){const l={id:o.id,parentId:i.id,label:qr(o.label??"",n),labelType:"markdown",isGroup:!1,ticket:o==null?void 0:o.ticket,priority:o==null?void 0:o.priority,assigned:o==null?void 0:o.assigned,icon:o==null?void 0:o.icon,shape:"kanbanItem",level:o.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:Pe()}},"getData"),Jht=T((t,e,r,n,i)=>{var u,h;const a=Pe();let s=((u=a.mindmap)==null?void 0:u.padding)??Fr.mindmap.padding;switch(n){case Hi.ROUNDED_RECT:case Hi.RECT:case Hi.HEXAGON:s*=2}const o={id:qr(e,a)||"kbn"+Q$++,level:t,label:qr(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??Fr.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(i!==void 0){let d;i.includes(` `)?d=i+` `:d=`{ `+i+` -}`;const f=_4(d,{schema:A4});if(f.shape&&(f.shape!==f.shape.toLowerCase()||f.shape.includes("_")))throw new Error(`No such shape: ${f.shape}. Shape names should be lowercase.`);f!=null&&f.shape&&f.shape==="kanbanItem"&&(o.shape=f==null?void 0:f.shape),f!=null&&f.label&&(o.label=f==null?void 0:f.label),f!=null&&f.icon&&(o.icon=f==null?void 0:f.icon.toString()),f!=null&&f.assigned&&(o.assigned=f==null?void 0:f.assigned.toString()),f!=null&&f.ticket&&(o.ticket=f==null?void 0:f.ticket.toString()),f!=null&&f.priority&&(o.priority=f==null?void 0:f.priority)}const l=Bht(t);l?o.parentId=l.id||"kbn"+Y$++:H$.push(o),ko.push(o)},"addNode"),Hi={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Ght=x((t,e)=>{switch(ae.debug("In get type",t,e),t){case"[":return Hi.RECT;case"(":return e===")"?Hi.ROUNDED_RECT:Hi.CLOUD;case"((":return Hi.CIRCLE;case")":return Hi.CLOUD;case"))":return Hi.BANG;case"{{":return Hi.HEXAGON;default:return Hi.DEFAULT}},"getType"),qht=x((t,e)=>{X$[t]=e},"setElementForId"),Vht=x(t=>{if(!t)return;const e=Pe(),r=ko[ko.length-1];t.icon&&(r.icon=qr(t.icon,e)),t.class&&(r.cssClasses=qr(t.class,e))},"decorateNode"),Wht=x(t=>{switch(t){case Hi.DEFAULT:return"no-border";case Hi.RECT:return"rect";case Hi.ROUNDED_RECT:return"rounded-rect";case Hi.CIRCLE:return"circle";case Hi.CLOUD:return"cloud";case Hi.BANG:return"bang";case Hi.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Uht=x(()=>ae,"getLogger"),Hht=x(t=>X$[t],"getElementById"),Yht={clear:Pht,addNode:zht,getSections:y1e,getData:Fht,nodeType:Hi,getType:Ght,setElementForId:qht,decorateNode:Vht,type2Str:Wht,getLogger:Uht,getElementById:Hht},Xht=Yht,Kht=x(async(t,e,r,n)=>{var y,v,T,b,w;ae.debug(`Rendering kanban diagram -`+t);const a=n.db.getData(),s=Pe();s.htmlLabels=!1;const o=ys(e);for(const k of a.nodes)k.domId=`${e}-${k.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=a.nodes.filter(k=>k.isGroup);let d=0;const f=10,p=[];let g=25;for(const k of h){const A=((y=s==null?void 0:s.kanban)==null?void 0:y.sectionWidth)||200;d=d+1,k.x=A*d+(d-1)*f/2,k.width=A,k.y=0,k.height=A*3,k.rx=5,k.ry=5,k.cssClasses=k.cssClasses+" section-"+d;const C=await V_(l,k);g=Math.max(g,(v=C==null?void 0:C.labelBBox)==null?void 0:v.height),p.push(C)}let m=0;for(const k of h){const A=p[m];m=m+1;const C=((T=s==null?void 0:s.kanban)==null?void 0:T.sectionWidth)||200,_=-C*3/2+g;let L=_;const O=a.nodes.filter(F=>F.parentId===k.id);for(const F of O){if(F.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");F.x=k.x,F.width=C-1.5*f;const R=(await nC(u,F,{config:s})).node().getBBox();F.y=L+R.height/2,await K_(F),L=F.y+R.height/2+f/2}const M=A.cluster.select("rect"),z=Math.max(L-_+3*f,50)+(g-25);M.attr("height",z)}E0(void 0,o,((b=s.mindmap)==null?void 0:b.padding)??Fr.kanban.padding,((w=s.mindmap)==null?void 0:w.useMaxWidth)??Fr.kanban.useMaxWidth)},"draw"),jht={draw:Kht},Zht=x(t=>{let e="";for(let n=0;nt.darkMode?st(n,i):at(n,i),"adjuster");for(let n=0;n{switch(ae.debug("In get type",t,e),t){case"[":return Hi.RECT;case"(":return e===")"?Hi.ROUNDED_RECT:Hi.CLOUD;case"((":return Hi.CIRCLE;case")":return Hi.CLOUD;case"))":return Hi.BANG;case"{{":return Hi.HEXAGON;default:return Hi.DEFAULT}},"getType"),tdt=T((t,e)=>{J$[t]=e},"setElementForId"),rdt=T(t=>{if(!t)return;const e=Pe(),r=ko[ko.length-1];t.icon&&(r.icon=qr(t.icon,e)),t.class&&(r.cssClasses=qr(t.class,e))},"decorateNode"),ndt=T(t=>{switch(t){case Hi.DEFAULT:return"no-border";case Hi.RECT:return"rect";case Hi.ROUNDED_RECT:return"rounded-rect";case Hi.CIRCLE:return"circle";case Hi.CLOUD:return"cloud";case Hi.BANG:return"bang";case Hi.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),idt=T(()=>ae,"getLogger"),adt=T(t=>J$[t],"getElementById"),sdt={clear:jht,addNode:Jht,getSections:C1e,getData:Qht,nodeType:Hi,getType:edt,setElementForId:tdt,decorateNode:rdt,type2Str:ndt,getLogger:idt,getElementById:adt},odt=sdt,ldt=T(async(t,e,r,n)=>{var y,v,x,b,w;ae.debug(`Rendering kanban diagram +`+t);const a=n.db.getData(),s=Pe();s.htmlLabels=!1;const o=ys(e);for(const k of a.nodes)k.domId=`${e}-${k.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=a.nodes.filter(k=>k.isGroup);let d=0;const f=10,p=[];let g=25;for(const k of h){const S=((y=s==null?void 0:s.kanban)==null?void 0:y.sectionWidth)||200;d=d+1,k.x=S*d+(d-1)*f/2,k.width=S,k.y=0,k.height=S*3,k.rx=5,k.ry=5,k.cssClasses=k.cssClasses+" section-"+d;const C=await H_(l,k);g=Math.max(g,(v=C==null?void 0:C.labelBBox)==null?void 0:v.height),p.push(C)}let m=0;for(const k of h){const S=p[m];m=m+1;const C=((x=s==null?void 0:s.kanban)==null?void 0:x.sectionWidth)||200,_=-C*3/2+g;let L=_;const O=a.nodes.filter(F=>F.parentId===k.id);for(const F of O){if(F.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");F.x=k.x,F.width=C-1.5*f;const R=(await aC(u,F,{config:s})).node().getBBox();F.y=L+R.height/2,await Q_(F),L=F.y+R.height/2+f/2}const M=S.cluster.select("rect"),z=Math.max(L-_+3*f,50)+(g-25);M.attr("height",z)}Ep(void 0,o,((b=s.mindmap)==null?void 0:b.padding)??Fr.kanban.padding,((w=s.mindmap)==null?void 0:w.useMaxWidth)??Fr.kanban.useMaxWidth)},"draw"),cdt={draw:ldt},udt=T(t=>{let e="";for(let n=0;nt.darkMode?st(n,i):at(n,i),"adjuster");for(let n=0;n` + `}return e},"genSections"),hdt=T(t=>` .edge { stroke-width: 3; } - ${Zht(t)} + ${udt(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -2895,15 +2895,15 @@ Expecting `+Ae.join(", ")+", got '"+(this.terminals_[se]||se)+"'":Ne="Parse erro dominant-baseline: middle; text-align: center; } - ${px()} -`,"getStyles"),Jht=Qht,edt={db:Xht,renderer:jht,parser:$ht,styles:Jht};const tdt=Object.freeze(Object.defineProperty({__proto__:null,diagram:edt},Symbol.toStringTag,{value:"Module"}));function v1e(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function b1e(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function K$(t,e){let r=0;if(e===void 0)for(let n of t)(n=+n)&&(r+=n);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function rdt(t){return t.target.depth}function ndt(t){return t.depth}function idt(t,e){return e-1-t.height}function x1e(t,e){return t.sourceLinks.length?t.depth:e-1}function adt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?b1e(t.sourceLinks,rdt)-1:0}function OS(t){return function(){return t}}function T1e(t,e){return $S(t.source,e.source)||t.index-e.index}function w1e(t,e){return $S(t.target,e.target)||t.index-e.index}function $S(t,e){return t.y0-e.y0}function j$(t){return t.value}function sdt(t){return t.index}function odt(t){return t.nodes}function ldt(t){return t.links}function C1e(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function k1e({nodes:t}){for(const e of t){let r=e.y0,n=r;for(const i of e.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(const i of e.targetLinks)i.y1=n+i.width/2,n+=i.width}}function cdt(){let t=0,e=0,r=1,n=1,i=24,a=8,s,o=sdt,l=x1e,u,h,d=odt,f=ldt,p=6;function g(){const R={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(R),y(R),v(R),T(R),k(R),k1e(R),R}g.update=function(R){return k1e(R),R},g.nodeId=function(R){return arguments.length?(o=typeof R=="function"?R:OS(R),g):o},g.nodeAlign=function(R){return arguments.length?(l=typeof R=="function"?R:OS(R),g):l},g.nodeSort=function(R){return arguments.length?(u=R,g):u},g.nodeWidth=function(R){return arguments.length?(i=+R,g):i},g.nodePadding=function(R){return arguments.length?(a=s=+R,g):a},g.nodes=function(R){return arguments.length?(d=typeof R=="function"?R:OS(R),g):d},g.links=function(R){return arguments.length?(f=typeof R=="function"?R:OS(R),g):f},g.linkSort=function(R){return arguments.length?(h=R,g):h},g.size=function(R){return arguments.length?(t=e=0,r=+R[0],n=+R[1],g):[r-t,n-e]},g.extent=function(R){return arguments.length?(t=+R[0][0],r=+R[1][0],e=+R[0][1],n=+R[1][1],g):[[t,e],[r,n]]},g.iterations=function(R){return arguments.length?(p=+R,g):p};function m({nodes:R,links:N}){for(const[I,$]of R.entries())$.index=I,$.sourceLinks=[],$.targetLinks=[];const D=new Map(R.map((I,$)=>[o(I,$,R),I]));for(const[I,$]of N.entries()){$.index=I;let{source:B,target:P}=$;typeof B!="object"&&(B=$.source=C1e(D,B)),typeof P!="object"&&(P=$.target=C1e(D,P)),B.sourceLinks.push($),P.targetLinks.push($)}if(h!=null)for(const{sourceLinks:I,targetLinks:$}of R)I.sort(h),$.sort(h)}function y({nodes:R}){for(const N of R)N.value=N.fixedValue===void 0?Math.max(K$(N.sourceLinks,j$),K$(N.targetLinks,j$)):N.fixedValue}function v({nodes:R}){const N=R.length;let D=new Set(R),I=new Set,$=0;for(;D.size;){for(const B of D){B.depth=$;for(const{target:P}of B.sourceLinks)I.add(P)}if(++$>N)throw new Error("circular link");D=I,I=new Set}}function T({nodes:R}){const N=R.length;let D=new Set(R),I=new Set,$=0;for(;D.size;){for(const B of D){B.height=$;for(const{source:P}of B.targetLinks)I.add(P)}if(++$>N)throw new Error("circular link");D=I,I=new Set}}function b({nodes:R}){const N=v1e(R,$=>$.depth)+1,D=(r-t-i)/(N-1),I=new Array(N);for(const $ of R){const B=Math.max(0,Math.min(N-1,Math.floor(l.call(null,$,N))));$.layer=B,$.x0=t+B*D,$.x1=$.x0+i,I[B]?I[B].push($):I[B]=[$]}if(u)for(const $ of I)$.sort(u);return I}function w(R){const N=b1e(R,D=>(n-e-(D.length-1)*s)/K$(D,j$));for(const D of R){let I=e;for(const $ of D){$.y0=I,$.y1=I+$.value*N,I=$.y1+s;for(const B of $.sourceLinks)B.width=B.value*N}I=(n-I+s)/(D.length+1);for(let $=0;$D.length)-1)),w(N);for(let D=0;D0))continue;let Y=(G/V-P.y0)*N;P.y0+=Y,P.y1+=Y,M(P)}u===void 0&&B.sort($S),_(B,D)}}function C(R,N,D){for(let I=R.length,$=I-2;$>=0;--$){const B=R[$];for(const P of B){let G=0,V=0;for(const{target:W,value:ie}of P.sourceLinks){let K=ie*(W.layer-P.layer);G+=S(P,W)*K,V+=K}if(!(V>0))continue;let Y=(G/V-P.y0)*N;P.y0+=Y,P.y1+=Y,M(P)}u===void 0&&B.sort($S),_(B,D)}}function _(R,N){const D=R.length>>1,I=R[D];O(R,I.y0-s,D-1,N),L(R,I.y1+s,D+1,N),O(R,n,R.length-1,N),L(R,e,0,N)}function L(R,N,D,I){for(;D1e-6&&($.y0+=B,$.y1+=B),N=$.y1+s}}function O(R,N,D,I){for(;D>=0;--D){const $=R[D],B=($.y1-N)*I;B>1e-6&&($.y0-=B,$.y1-=B),N=$.y0-s}}function M({sourceLinks:R,targetLinks:N}){if(h===void 0){for(const{source:{sourceLinks:D}}of N)D.sort(w1e);for(const{target:{targetLinks:D}}of R)D.sort(T1e)}}function z(R){if(h===void 0)for(const{sourceLinks:N,targetLinks:D}of R)N.sort(w1e),D.sort(T1e)}function F(R,N){let D=R.y0-(R.sourceLinks.length-1)*s/2;for(const{target:I,width:$}of R.sourceLinks){if(I===N)break;D+=$+s}for(const{source:I,width:$}of N.targetLinks){if(I===R)break;D-=$}return D}function S(R,N){let D=N.y0-(N.targetLinks.length-1)*s/2;for(const{source:I,width:$}of N.targetLinks){if(I===R)break;D+=$+s}for(const{target:I,width:$}of R.sourceLinks){if(I===N)break;D-=$}return D}return g}var Z$=Math.PI,Q$=2*Z$,i0=1e-6,udt=Q$-i0;function J$(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function E1e(){return new J$}J$.prototype=E1e.prototype={constructor:J$,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var a=this._x1,s=this._y1,o=r-t,l=n-e,u=a-t,h=s-e,d=u*u+h*h;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>i0)if(!(Math.abs(h*o-l*u)>i0)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-a,p=n-s,g=o*o+l*l,m=f*f+p*p,y=Math.sqrt(g),v=Math.sqrt(d),T=i*Math.tan((Z$-Math.acos((g+d-m)/(2*y*v)))/2),b=T/v,w=T/y;Math.abs(b-1)>i0&&(this._+="L"+(t+b*u)+","+(e+b*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+w*o)+","+(this._y1=e+w*l)}},arc:function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var s=r*Math.cos(n),o=r*Math.sin(n),l=t+s,u=e+o,h=1^a,d=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>i0||Math.abs(this._y1-u)>i0)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%Q$+Q$),d>udt?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>i0&&(this._+="A"+r+","+r+",0,"+ +(d>=Z$)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function S1e(t){return function(){return t}}function hdt(t){return t[0]}function ddt(t){return t[1]}var fdt=Array.prototype.slice;function pdt(t){return t.source}function gdt(t){return t.target}function mdt(t){var e=pdt,r=gdt,n=hdt,i=ddt,a=null;function s(){var o,l=fdt.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=o=E1e()),t(a,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),o)return a=null,o+""||null}return s.source=function(o){return arguments.length?(e=o,s):e},s.target=function(o){return arguments.length?(r=o,s):r},s.x=function(o){return arguments.length?(n=typeof o=="function"?o:S1e(+o),s):n},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:S1e(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function ydt(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function vdt(){return mdt(ydt)}function bdt(t){return[t.source.x1,t.y0]}function xdt(t){return[t.target.x0,t.y1]}function Tdt(){return vdt().source(bdt).target(xdt)}var eP=(function(){var t=x(function(o,l,u,h){for(u=u||{},h=o.length;h--;u[o[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:x(function(l,u,h,d,f,p,g){var m=p.length-1;switch(f){case 7:const y=d.findOrCreateNode(p[m-4].trim().replaceAll('""','"')),v=d.findOrCreateNode(p[m-2].trim().replaceAll('""','"')),T=parseFloat(p[m].trim());d.addLink(y,v,T);break;case 8:case 9:case 11:this.$=p[m];break;case 10:this.$=p[m-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:x(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:x(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",y=0,v=0,T=2,b=1,w=p.slice.call(arguments,1),k=Object.create(this.lexer),A={yy:{}};for(var C in this.yy)Object.prototype.hasOwnProperty.call(this.yy,C)&&(A.yy[C]=this.yy[C]);k.setInput(l,A.yy),A.yy.lexer=k,A.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var _=k.yylloc;p.push(_);var L=k.options&&k.options.ranges;typeof A.yy.parseError=="function"?this.parseError=A.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(G){h.length=h.length-2*G,f.length=f.length-G,p.length=p.length-G}x(O,"popStack");function M(){var G;return G=d.pop()||k.lex()||b,typeof G!="number"&&(G instanceof Array&&(d=G,G=d.pop()),G=u.symbols_[G]||G),G}x(M,"lex");for(var z,F,S,R,N={},D,I,$,B;;){if(F=h[h.length-1],this.defaultActions[F]?S=this.defaultActions[F]:((z===null||typeof z>"u")&&(z=M()),S=g[F]&&g[F][z]),typeof S>"u"||!S.length||!S[0]){var P="";B=[];for(D in g[F])this.terminals_[D]&&D>T&&B.push("'"+this.terminals_[D]+"'");k.showPosition?P="Parse error on line "+(y+1)+`: + ${mx()} +`,"getStyles"),ddt=hdt,fdt={db:odt,renderer:cdt,parser:Kht,styles:ddt};const pdt=Object.freeze(Object.defineProperty({__proto__:null,diagram:fdt},Symbol.toStringTag,{value:"Module"}));function k1e(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function E1e(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function eP(t,e){let r=0;if(e===void 0)for(let n of t)(n=+n)&&(r+=n);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function gdt(t){return t.target.depth}function mdt(t){return t.depth}function ydt(t,e){return e-1-t.height}function S1e(t,e){return t.sourceLinks.length?t.depth:e-1}function vdt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?E1e(t.sourceLinks,gdt)-1:0}function BS(t){return function(){return t}}function A1e(t,e){return FS(t.source,e.source)||t.index-e.index}function _1e(t,e){return FS(t.target,e.target)||t.index-e.index}function FS(t,e){return t.y0-e.y0}function tP(t){return t.value}function bdt(t){return t.index}function xdt(t){return t.nodes}function Tdt(t){return t.links}function R1e(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function L1e({nodes:t}){for(const e of t){let r=e.y0,n=r;for(const i of e.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(const i of e.targetLinks)i.y1=n+i.width/2,n+=i.width}}function wdt(){let t=0,e=0,r=1,n=1,i=24,a=8,s,o=bdt,l=S1e,u,h,d=xdt,f=Tdt,p=6;function g(){const R={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(R),y(R),v(R),x(R),k(R),L1e(R),R}g.update=function(R){return L1e(R),R},g.nodeId=function(R){return arguments.length?(o=typeof R=="function"?R:BS(R),g):o},g.nodeAlign=function(R){return arguments.length?(l=typeof R=="function"?R:BS(R),g):l},g.nodeSort=function(R){return arguments.length?(u=R,g):u},g.nodeWidth=function(R){return arguments.length?(i=+R,g):i},g.nodePadding=function(R){return arguments.length?(a=s=+R,g):a},g.nodes=function(R){return arguments.length?(d=typeof R=="function"?R:BS(R),g):d},g.links=function(R){return arguments.length?(f=typeof R=="function"?R:BS(R),g):f},g.linkSort=function(R){return arguments.length?(h=R,g):h},g.size=function(R){return arguments.length?(t=e=0,r=+R[0],n=+R[1],g):[r-t,n-e]},g.extent=function(R){return arguments.length?(t=+R[0][0],r=+R[1][0],e=+R[0][1],n=+R[1][1],g):[[t,e],[r,n]]},g.iterations=function(R){return arguments.length?(p=+R,g):p};function m({nodes:R,links:N}){for(const[I,$]of R.entries())$.index=I,$.sourceLinks=[],$.targetLinks=[];const D=new Map(R.map((I,$)=>[o(I,$,R),I]));for(const[I,$]of N.entries()){$.index=I;let{source:B,target:P}=$;typeof B!="object"&&(B=$.source=R1e(D,B)),typeof P!="object"&&(P=$.target=R1e(D,P)),B.sourceLinks.push($),P.targetLinks.push($)}if(h!=null)for(const{sourceLinks:I,targetLinks:$}of R)I.sort(h),$.sort(h)}function y({nodes:R}){for(const N of R)N.value=N.fixedValue===void 0?Math.max(eP(N.sourceLinks,tP),eP(N.targetLinks,tP)):N.fixedValue}function v({nodes:R}){const N=R.length;let D=new Set(R),I=new Set,$=0;for(;D.size;){for(const B of D){B.depth=$;for(const{target:P}of B.sourceLinks)I.add(P)}if(++$>N)throw new Error("circular link");D=I,I=new Set}}function x({nodes:R}){const N=R.length;let D=new Set(R),I=new Set,$=0;for(;D.size;){for(const B of D){B.height=$;for(const{source:P}of B.targetLinks)I.add(P)}if(++$>N)throw new Error("circular link");D=I,I=new Set}}function b({nodes:R}){const N=k1e(R,$=>$.depth)+1,D=(r-t-i)/(N-1),I=new Array(N);for(const $ of R){const B=Math.max(0,Math.min(N-1,Math.floor(l.call(null,$,N))));$.layer=B,$.x0=t+B*D,$.x1=$.x0+i,I[B]?I[B].push($):I[B]=[$]}if(u)for(const $ of I)$.sort(u);return I}function w(R){const N=E1e(R,D=>(n-e-(D.length-1)*s)/eP(D,tP));for(const D of R){let I=e;for(const $ of D){$.y0=I,$.y1=I+$.value*N,I=$.y1+s;for(const B of $.sourceLinks)B.width=B.value*N}I=(n-I+s)/(D.length+1);for(let $=0;$D.length)-1)),w(N);for(let D=0;D0))continue;let X=(G/V-P.y0)*N;P.y0+=X,P.y1+=X,M(P)}u===void 0&&B.sort(FS),_(B,D)}}function C(R,N,D){for(let I=R.length,$=I-2;$>=0;--$){const B=R[$];for(const P of B){let G=0,V=0;for(const{target:W,value:ie}of P.sourceLinks){let K=ie*(W.layer-P.layer);G+=A(P,W)*K,V+=K}if(!(V>0))continue;let X=(G/V-P.y0)*N;P.y0+=X,P.y1+=X,M(P)}u===void 0&&B.sort(FS),_(B,D)}}function _(R,N){const D=R.length>>1,I=R[D];O(R,I.y0-s,D-1,N),L(R,I.y1+s,D+1,N),O(R,n,R.length-1,N),L(R,e,0,N)}function L(R,N,D,I){for(;D1e-6&&($.y0+=B,$.y1+=B),N=$.y1+s}}function O(R,N,D,I){for(;D>=0;--D){const $=R[D],B=($.y1-N)*I;B>1e-6&&($.y0-=B,$.y1-=B),N=$.y0-s}}function M({sourceLinks:R,targetLinks:N}){if(h===void 0){for(const{source:{sourceLinks:D}}of N)D.sort(_1e);for(const{target:{targetLinks:D}}of R)D.sort(A1e)}}function z(R){if(h===void 0)for(const{sourceLinks:N,targetLinks:D}of R)N.sort(_1e),D.sort(A1e)}function F(R,N){let D=R.y0-(R.sourceLinks.length-1)*s/2;for(const{target:I,width:$}of R.sourceLinks){if(I===N)break;D+=$+s}for(const{source:I,width:$}of N.targetLinks){if(I===R)break;D-=$}return D}function A(R,N){let D=N.y0-(N.targetLinks.length-1)*s/2;for(const{source:I,width:$}of N.targetLinks){if(I===R)break;D+=$+s}for(const{target:I,width:$}of R.sourceLinks){if(I===N)break;D-=$}return D}return g}var rP=Math.PI,nP=2*rP,ip=1e-6,Cdt=nP-ip;function iP(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function I1e(){return new iP}iP.prototype=I1e.prototype={constructor:iP,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var a=this._x1,s=this._y1,o=r-t,l=n-e,u=a-t,h=s-e,d=u*u+h*h;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>ip)if(!(Math.abs(h*o-l*u)>ip)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-a,p=n-s,g=o*o+l*l,m=f*f+p*p,y=Math.sqrt(g),v=Math.sqrt(d),x=i*Math.tan((rP-Math.acos((g+d-m)/(2*y*v)))/2),b=x/v,w=x/y;Math.abs(b-1)>ip&&(this._+="L"+(t+b*u)+","+(e+b*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+w*o)+","+(this._y1=e+w*l)}},arc:function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var s=r*Math.cos(n),o=r*Math.sin(n),l=t+s,u=e+o,h=1^a,d=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>ip||Math.abs(this._y1-u)>ip)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%nP+nP),d>Cdt?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>ip&&(this._+="A"+r+","+r+",0,"+ +(d>=rP)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function D1e(t){return function(){return t}}function kdt(t){return t[0]}function Edt(t){return t[1]}var Sdt=Array.prototype.slice;function Adt(t){return t.source}function _dt(t){return t.target}function Rdt(t){var e=Adt,r=_dt,n=kdt,i=Edt,a=null;function s(){var o,l=Sdt.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=o=I1e()),t(a,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),o)return a=null,o+""||null}return s.source=function(o){return arguments.length?(e=o,s):e},s.target=function(o){return arguments.length?(r=o,s):r},s.x=function(o){return arguments.length?(n=typeof o=="function"?o:D1e(+o),s):n},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:D1e(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function Ldt(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function Idt(){return Rdt(Ldt)}function Ddt(t){return[t.source.x1,t.y0]}function Mdt(t){return[t.target.x0,t.y1]}function Ndt(){return Idt().source(Ddt).target(Mdt)}var aP=(function(){var t=T(function(o,l,u,h){for(u=u||{},h=o.length;h--;u[o[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:T(function(l,u,h,d,f,p,g){var m=p.length-1;switch(f){case 7:const y=d.findOrCreateNode(p[m-4].trim().replaceAll('""','"')),v=d.findOrCreateNode(p[m-2].trim().replaceAll('""','"')),x=parseFloat(p[m].trim());d.addLink(y,v,x);break;case 8:case 9:case 11:this.$=p[m];break;case 10:this.$=p[m-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:T(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:T(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",y=0,v=0,x=2,b=1,w=p.slice.call(arguments,1),k=Object.create(this.lexer),S={yy:{}};for(var C in this.yy)Object.prototype.hasOwnProperty.call(this.yy,C)&&(S.yy[C]=this.yy[C]);k.setInput(l,S.yy),S.yy.lexer=k,S.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var _=k.yylloc;p.push(_);var L=k.options&&k.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(G){h.length=h.length-2*G,f.length=f.length-G,p.length=p.length-G}T(O,"popStack");function M(){var G;return G=d.pop()||k.lex()||b,typeof G!="number"&&(G instanceof Array&&(d=G,G=d.pop()),G=u.symbols_[G]||G),G}T(M,"lex");for(var z,F,A,R,N={},D,I,$,B;;){if(F=h[h.length-1],this.defaultActions[F]?A=this.defaultActions[F]:((z===null||typeof z>"u")&&(z=M()),A=g[F]&&g[F][z]),typeof A>"u"||!A.length||!A[0]){var P="";B=[];for(D in g[F])this.terminals_[D]&&D>x&&B.push("'"+this.terminals_[D]+"'");k.showPosition?P="Parse error on line "+(y+1)+`: `+k.showPosition()+` -Expecting `+B.join(", ")+", got '"+(this.terminals_[z]||z)+"'":P="Parse error on line "+(y+1)+": Unexpected "+(z==b?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(P,{text:k.match,token:this.terminals_[z]||z,line:k.yylineno,loc:_,expected:B})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+F+", token: "+z);switch(S[0]){case 1:h.push(z),f.push(k.yytext),p.push(k.yylloc),h.push(S[1]),z=null,v=k.yyleng,m=k.yytext,y=k.yylineno,_=k.yylloc;break;case 2:if(I=this.productions_[S[1]][1],N.$=f[f.length-I],N._$={first_line:p[p.length-(I||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(I||1)].first_column,last_column:p[p.length-1].last_column},L&&(N._$.range=[p[p.length-(I||1)].range[0],p[p.length-1].range[1]]),R=this.performAction.apply(N,[m,v,y,A.yy,S[1],f,p].concat(w)),typeof R<"u")return R;I&&(h=h.slice(0,-1*I*2),f=f.slice(0,-1*I),p=p.slice(0,-1*I)),h.push(this.productions_[S[1]][0]),f.push(N.$),p.push(N._$),$=g[h[h.length-2]][h[h.length-1]],h.push($);break;case 3:return!0}}return!0},"parse")},a=(function(){var o={EOF:1,parseError:x(function(u,h){if(this.yy.parser)this.yy.parser.parseError(u,h);else throw new Error(u)},"parseError"),setInput:x(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:x(function(l){var u=l.length,h=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(l){this.unput(this.match.slice(l))},"less"),pastInput:x(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+` -`+u+"^"},"showPosition"),test_match:x(function(l,u){var h,d,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),d=l[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],h=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,h,d;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;pu[0].length)){if(u=h,d=p,this.options.backtrack_lexer){if(l=this.test_match(h,f[p]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,f[d]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var u=this.next();return u||this.lex()},"lex"),begin:x(function(u){this.conditionStack.push(u)},"begin"),popState:x(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:x(function(u){this.begin(u)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(u,h,d,f){switch(d){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return o})();i.lexer=a;function s(){this.yy={}}return x(s,"Parser"),s.prototype=i,i.Parser=s,new s})();eP.parser=eP;var PS=eP,BS=[],FS=[],zS=new Map,wdt=x(()=>{BS=[],FS=[],zS=new Map,In()},"clear"),Cdt=(Vv=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},x(Vv,"SankeyLink"),Vv),kdt=x((t,e,r)=>{BS.push(new Cdt(t,e,r))},"addLink"),Edt=(Wv=class{constructor(e){this.ID=e}},x(Wv,"SankeyNode"),Wv),Sdt=x(t=>{t=Lt.sanitizeText(t,Pe());let e=zS.get(t);return e===void 0&&(e=new Edt(t),zS.set(t,e),FS.push(e)),e},"findOrCreateNode"),Adt=x(()=>FS,"getNodes"),_dt=x(()=>BS,"getLinks"),Rdt=x(()=>({nodes:FS.map(t=>({id:t.ID})),links:BS.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),Ldt={nodesMap:zS,getConfig:x(()=>Pe().sankey,"getConfig"),getNodes:Adt,getLinks:_dt,getGraph:Rdt,addLink:kdt,findOrCreateNode:Sdt,getAccTitle:Fn,setAccTitle:Dn,getAccDescription:Gn,setAccDescription:zn,getDiagramTitle:Mn,setDiagramTitle:qn,clear:wdt},A1e=(bu=class{static next(e){return new bu(e+ ++bu.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},x(bu,"Uid"),bu.count=0,bu),Idt={left:ndt,right:idt,center:adt,justify:x1e},Ddt=x(t=>{let e=0,r=0;for(const n of t){const i=n.value??0;i>e&&(e=i,r=n.layer??0)}return r},"findCentralNodeLayer"),Mdt=x(function(t,e,r,n){const{securityLevel:i,sankey:a}=Pe(),s=$B.sankey;let o;i==="sandbox"&&(o=pt("#i"+e));const l=pt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):pt(`[id="${e}"]`),h=(a==null?void 0:a.width)??s.width,d=(a==null?void 0:a.height)??s.width,f=(a==null?void 0:a.useMaxWidth)??s.useMaxWidth,p=(a==null?void 0:a.nodeAlignment)??s.nodeAlignment,g=(a==null?void 0:a.prefix)??s.prefix,m=(a==null?void 0:a.suffix)??s.suffix,y=(a==null?void 0:a.showValues)??s.showValues,v=(a==null?void 0:a.nodeWidth)??s.nodeWidth??10,T=(a==null?void 0:a.nodePadding)??s.nodePadding??12,b=(a==null?void 0:a.labelStyle)??s.labelStyle??"legacy",w=(a==null?void 0:a.nodeColors)??{},k=n.db.getGraph(),A=Idt[p];cdt().nodeId(I=>I.id).nodeWidth(v).nodePadding(T+(y?15:0)).nodeAlign(A).extent([[0,0],[h,d]])(k);const _=Ddt(k.nodes),L=Qh(L3e),O=x(I=>w[I]??L(I),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(k.nodes).join("g").attr("class","node").attr("id",I=>(I.uid=A1e.next("node-")).id).attr("transform",function(I){return"translate("+I.x0+","+I.y0+")"}).attr("x",I=>I.x0).attr("y",I=>I.y0).append("rect").attr("height",I=>I.y1-I.y0).attr("width",I=>I.x1-I.x0).attr("fill",I=>O(I.id));const M=x(({id:I,value:$})=>y?`${I} -${g}${Math.round($*100)/100}${m}`:I,"getText"),z=x(I=>b==="outlined"?(I.layer??0)<_?{x:I.x0-6,anchor:"end"}:{x:I.x1+6,anchor:"start"}:I.x0F.selectAll(I?`.${I}`:"text").data(k.nodes).join("text").attr("class",I??null).attr("x",$=>z($).x).attr("y",$=>($.y1+$.y0)/2).attr("dy",`${y?"0":"0.35"}em`).attr("text-anchor",$=>z($).anchor).text(M),"appendLabel");b==="outlined"?(S("sankey-label-bg"),S("sankey-label-fg")):S();const R=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(k.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),N=(a==null?void 0:a.linkColor)??"gradient";if(N==="gradient"){const I=R.append("linearGradient").attr("id",$=>($.uid=A1e.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",$=>$.source.x1).attr("x2",$=>$.target.x0);I.append("stop").attr("offset","0%").attr("stop-color",$=>O($.source.id)),I.append("stop").attr("offset","100%").attr("stop-color",$=>O($.target.id))}let D;switch(N){case"gradient":D=x(I=>I.uid,"coloring");break;case"source":D=x(I=>O(I.source.id),"coloring");break;case"target":D=x(I=>O(I.target.id),"coloring");break;default:D=N}R.append("path").attr("d",Tdt()).attr("stroke",D).attr("stroke-width",I=>Math.max(1,I.width)),E0(void 0,u,0,f)},"draw"),Ndt={draw:Mdt},Odt=x(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` -`).trim(),"prepareTextForParsing"),$dt=x(t=>`.label { +Expecting `+B.join(", ")+", got '"+(this.terminals_[z]||z)+"'":P="Parse error on line "+(y+1)+": Unexpected "+(z==b?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(P,{text:k.match,token:this.terminals_[z]||z,line:k.yylineno,loc:_,expected:B})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+F+", token: "+z);switch(A[0]){case 1:h.push(z),f.push(k.yytext),p.push(k.yylloc),h.push(A[1]),z=null,v=k.yyleng,m=k.yytext,y=k.yylineno,_=k.yylloc;break;case 2:if(I=this.productions_[A[1]][1],N.$=f[f.length-I],N._$={first_line:p[p.length-(I||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(I||1)].first_column,last_column:p[p.length-1].last_column},L&&(N._$.range=[p[p.length-(I||1)].range[0],p[p.length-1].range[1]]),R=this.performAction.apply(N,[m,v,y,S.yy,A[1],f,p].concat(w)),typeof R<"u")return R;I&&(h=h.slice(0,-1*I*2),f=f.slice(0,-1*I),p=p.slice(0,-1*I)),h.push(this.productions_[A[1]][0]),f.push(N.$),p.push(N._$),$=g[h[h.length-2]][h[h.length-1]],h.push($);break;case 3:return!0}}return!0},"parse")},a=(function(){var o={EOF:1,parseError:T(function(u,h){if(this.yy.parser)this.yy.parser.parseError(u,h);else throw new Error(u)},"parseError"),setInput:T(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:T(function(l){var u=l.length,h=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(l){this.unput(this.match.slice(l))},"less"),pastInput:T(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+` +`+u+"^"},"showPosition"),test_match:T(function(l,u){var h,d,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),d=l[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],h=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,h,d;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;pu[0].length)){if(u=h,d=p,this.options.backtrack_lexer){if(l=this.test_match(h,f[p]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,f[d]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var u=this.next();return u||this.lex()},"lex"),begin:T(function(u){this.conditionStack.push(u)},"begin"),popState:T(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:T(function(u){this.begin(u)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(u,h,d,f){switch(d){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return o})();i.lexer=a;function s(){this.yy={}}return T(s,"Parser"),s.prototype=i,i.Parser=s,new s})();aP.parser=aP;var zS=aP,GS=[],qS=[],VS=new Map,Odt=T(()=>{GS=[],qS=[],VS=new Map,In()},"clear"),$dt=(Wv=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},T(Wv,"SankeyLink"),Wv),Pdt=T((t,e,r)=>{GS.push(new $dt(t,e,r))},"addLink"),Bdt=(Uv=class{constructor(e){this.ID=e}},T(Uv,"SankeyNode"),Uv),Fdt=T(t=>{t=Lt.sanitizeText(t,Pe());let e=VS.get(t);return e===void 0&&(e=new Bdt(t),VS.set(t,e),qS.push(e)),e},"findOrCreateNode"),zdt=T(()=>qS,"getNodes"),Gdt=T(()=>GS,"getLinks"),qdt=T(()=>({nodes:qS.map(t=>({id:t.ID})),links:GS.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),Vdt={nodesMap:VS,getConfig:T(()=>Pe().sankey,"getConfig"),getNodes:zdt,getLinks:Gdt,getGraph:qdt,addLink:Pdt,findOrCreateNode:Fdt,getAccTitle:Fn,setAccTitle:Dn,getAccDescription:Gn,setAccDescription:zn,getDiagramTitle:Mn,setDiagramTitle:qn,clear:Odt},M1e=(bu=class{static next(e){return new bu(e+ ++bu.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},T(bu,"Uid"),bu.count=0,bu),Wdt={left:mdt,right:ydt,center:vdt,justify:S1e},Udt=T(t=>{let e=0,r=0;for(const n of t){const i=n.value??0;i>e&&(e=i,r=n.layer??0)}return r},"findCentralNodeLayer"),Hdt=T(function(t,e,r,n){const{securityLevel:i,sankey:a}=Pe(),s=GB.sankey;let o;i==="sandbox"&&(o=pt("#i"+e));const l=pt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):pt(`[id="${e}"]`),h=(a==null?void 0:a.width)??s.width,d=(a==null?void 0:a.height)??s.width,f=(a==null?void 0:a.useMaxWidth)??s.useMaxWidth,p=(a==null?void 0:a.nodeAlignment)??s.nodeAlignment,g=(a==null?void 0:a.prefix)??s.prefix,m=(a==null?void 0:a.suffix)??s.suffix,y=(a==null?void 0:a.showValues)??s.showValues,v=(a==null?void 0:a.nodeWidth)??s.nodeWidth??10,x=(a==null?void 0:a.nodePadding)??s.nodePadding??12,b=(a==null?void 0:a.labelStyle)??s.labelStyle??"legacy",w=(a==null?void 0:a.nodeColors)??{},k=n.db.getGraph(),S=Wdt[p];wdt().nodeId(I=>I.id).nodeWidth(v).nodePadding(x+(y?15:0)).nodeAlign(S).extent([[0,0],[h,d]])(k);const _=Udt(k.nodes),L=Qh($3e),O=T(I=>w[I]??L(I),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(k.nodes).join("g").attr("class","node").attr("id",I=>(I.uid=M1e.next("node-")).id).attr("transform",function(I){return"translate("+I.x0+","+I.y0+")"}).attr("x",I=>I.x0).attr("y",I=>I.y0).append("rect").attr("height",I=>I.y1-I.y0).attr("width",I=>I.x1-I.x0).attr("fill",I=>O(I.id));const M=T(({id:I,value:$})=>y?`${I} +${g}${Math.round($*100)/100}${m}`:I,"getText"),z=T(I=>b==="outlined"?(I.layer??0)<_?{x:I.x0-6,anchor:"end"}:{x:I.x1+6,anchor:"start"}:I.x0F.selectAll(I?`.${I}`:"text").data(k.nodes).join("text").attr("class",I??null).attr("x",$=>z($).x).attr("y",$=>($.y1+$.y0)/2).attr("dy",`${y?"0":"0.35"}em`).attr("text-anchor",$=>z($).anchor).text(M),"appendLabel");b==="outlined"?(A("sankey-label-bg"),A("sankey-label-fg")):A();const R=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(k.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),N=(a==null?void 0:a.linkColor)??"gradient";if(N==="gradient"){const I=R.append("linearGradient").attr("id",$=>($.uid=M1e.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",$=>$.source.x1).attr("x2",$=>$.target.x0);I.append("stop").attr("offset","0%").attr("stop-color",$=>O($.source.id)),I.append("stop").attr("offset","100%").attr("stop-color",$=>O($.target.id))}let D;switch(N){case"gradient":D=T(I=>I.uid,"coloring");break;case"source":D=T(I=>O(I.source.id),"coloring");break;case"target":D=T(I=>O(I.target.id),"coloring");break;default:D=N}R.append("path").attr("d",Ndt()).attr("stroke",D).attr("stroke-width",I=>Math.max(1,I.width)),Ep(void 0,u,0,f)},"draw"),Ydt={draw:Hdt},Xdt=T(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` +`).trim(),"prepareTextForParsing"),Kdt=T(t=>`.label { font-family: ${t.fontFamily}; } @@ -2935,7 +2935,7 @@ ${g}${Math.round($*100)/100}${m}`:I,"getText"),z=x(I=>b==="outlined"?(I.layer??0 stroke-opacity: 0.5; mix-blend-mode: multiply; } -`,"getStyles"),Pdt=$dt,Bdt=PS.parse.bind(PS);PS.parse=t=>Bdt(Odt(t));var Fdt={styles:Pdt,parser:PS,db:Ldt,renderer:Ndt};const zdt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Fdt},Symbol.toStringTag,{value:"Module"}));var Gdt=Fr.packet,_1e=(Uv=class{constructor(){this.packet=[],this.setAccTitle=Dn,this.getAccTitle=Fn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getAccDescription=Gn,this.setAccDescription=zn}getConfig(){const e=ti({...Gdt,...lr().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){In(),this.packet=[]}},x(Uv,"PacketDB"),Uv),qdt=1e4,Vdt=x((t,e)=>{zl(t,e);let r=-1,n=[],i=1;const{bitsPerRow:a}=e.getConfig();for(let{start:s,end:o,bits:l,label:u}of t.blocks){if(s!==void 0&&o!==void 0&&o{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const n=e*r-1,i=e*r;return[{start:t.start,end:n,label:t.label,bits:n-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]},"getNextFittingBlock"),R1e={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Qo("packet",t),r=(n=R1e.parser)==null?void 0:n.yy;if(!(r instanceof _1e))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");ae.debug(e),Vdt(e,r)},"parse")},Udt=x((t,e,r,n)=>{const i=n.db,a=i.getConfig(),{rowHeight:s,paddingY:o,bitWidth:l,bitsPerRow:u}=a,h=i.getPacket(),d=i.getDiagramTitle(),f=s+o,p=f*(h.length+1)-(d?0:s),g=l*u+2,m=ys(e);m.attr("viewBox",`0 0 ${g} ${p}`),wi(m,p,g,a.useMaxWidth);for(const[y,v]of h.entries())Hdt(m,v,y,a);m.append("text").text(d).attr("x",g/2).attr("y",p-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),Hdt=x((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:o,showBits:l})=>{const u=t.append("g"),h=r*(n+a)+a;for(const d of e){const f=d.start%o*s+1,p=(d.end-d.start+1)*s-i;if(u.append("rect").attr("x",f).attr("y",h).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const g=d.end===d.start,m=h-2;u.append("text").attr("x",f+(g?p/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||u.append("text").attr("x",f+p).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),Ydt={draw:Udt},Xdt={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},Kdt=x(({packet:t}={})=>{const e=ti(Xdt,t);return` +`,"getStyles"),jdt=Kdt,Zdt=zS.parse.bind(zS);zS.parse=t=>Zdt(Xdt(t));var Qdt={styles:jdt,parser:zS,db:Vdt,renderer:Ydt};const Jdt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Qdt},Symbol.toStringTag,{value:"Module"}));var eft=Fr.packet,N1e=(Hv=class{constructor(){this.packet=[],this.setAccTitle=Dn,this.getAccTitle=Fn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getAccDescription=Gn,this.setAccDescription=zn}getConfig(){const e=ti({...eft,...lr().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){In(),this.packet=[]}},T(Hv,"PacketDB"),Hv),tft=1e4,rft=T((t,e)=>{zl(t,e);let r=-1,n=[],i=1;const{bitsPerRow:a}=e.getConfig();for(let{start:s,end:o,bits:l,label:u}of t.blocks){if(s!==void 0&&o!==void 0&&o{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const n=e*r-1,i=e*r;return[{start:t.start,end:n,label:t.label,bits:n-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]},"getNextFittingBlock"),O1e={parser:{yy:void 0},parse:T(async t=>{var n;const e=await Qo("packet",t),r=(n=O1e.parser)==null?void 0:n.yy;if(!(r instanceof N1e))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");ae.debug(e),rft(e,r)},"parse")},ift=T((t,e,r,n)=>{const i=n.db,a=i.getConfig(),{rowHeight:s,paddingY:o,bitWidth:l,bitsPerRow:u}=a,h=i.getPacket(),d=i.getDiagramTitle(),f=s+o,p=f*(h.length+1)-(d?0:s),g=l*u+2,m=ys(e);m.attr("viewBox",`0 0 ${g} ${p}`),wi(m,p,g,a.useMaxWidth);for(const[y,v]of h.entries())aft(m,v,y,a);m.append("text").text(d).attr("x",g/2).attr("y",p-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),aft=T((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:o,showBits:l})=>{const u=t.append("g"),h=r*(n+a)+a;for(const d of e){const f=d.start%o*s+1,p=(d.end-d.start+1)*s-i;if(u.append("rect").attr("x",f).attr("y",h).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const g=d.end===d.start,m=h-2;u.append("text").attr("x",f+(g?p/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||u.append("text").attr("x",f+p).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),sft={draw:ift},oft={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},lft=T(({packet:t}={})=>{const e=ti(oft,t);return` .packetByte { font-size: ${e.byteFontSize}; } @@ -2958,7 +2958,7 @@ ${g}${Math.round($*100)/100}${m}`:I,"getText"),z=x(I=>b==="outlined"?(I.layer??0 stroke-width: ${e.blockStrokeWidth}; fill: ${e.blockFillColor}; } - `},"styles"),jdt={parser:R1e,get db(){return new _1e},renderer:Ydt,styles:Kdt};const Zdt=Object.freeze(Object.defineProperty({__proto__:null,diagram:jdt},Symbol.toStringTag,{value:"Module"}));var om={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},L1e={axes:[],curves:[],options:om},a0=structuredClone(L1e),Qdt=Fr.radar,Jdt=x(()=>ti({...Qdt,...lr().radar}),"getConfig"),I1e=x(()=>a0.axes,"getAxes"),eft=x(()=>a0.curves,"getCurves"),tft=x(()=>a0.options,"getOptions"),rft=x(t=>{a0.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),nft=x(t=>{a0.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:ift(e.entries)}))},"setCurves"),ift=x(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=I1e();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(r=>{const n=t.find(i=>{var a;return((a=i.axis)==null?void 0:a.$refText)===r.name});if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),aft=x(t=>{var r,n,i,a,s;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});a0.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??om.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??om.ticks,max:((i=e.max)==null?void 0:i.value)??om.max,min:((a=e.min)==null?void 0:a.value)??om.min,graticule:((s=e.graticule)==null?void 0:s.value)??om.graticule}},"setOptions"),sft=x(()=>{In(),a0=structuredClone(L1e)},"clear"),rw={getAxes:I1e,getCurves:eft,getOptions:tft,setAxes:rft,setCurves:nft,setOptions:aft,getConfig:Jdt,clear:sft,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,getAccDescription:Gn,setAccDescription:zn},oft=x(t=>{zl(t,rw);const{axes:e,curves:r,options:n}=t;rw.setAxes(e),rw.setCurves(r),rw.setOptions(n)},"populate"),lft={parse:x(async t=>{const e=await Qo("radar",t);ae.debug(e),oft(e)},"parse")},cft=x((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=ys(e),d=uft(h,l),f=o.max??Math.max(...s.map(m=>Math.max(...m.entries))),p=o.min,g=Math.min(l.width,l.height)/2;hft(d,a,g,o.ticks,o.graticule),dft(d,a,g,l),D1e(d,a,s,p,f,o.graticule,l),O1e(d,s,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),uft=x((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return wi(t,n,r,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${r} ${n}`),t.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),hft=x((t,e,r,n,i)=>{if(i==="circle")for(let a=0;a{const d=2*h*Math.PI/a-Math.PI/2,f=o*Math.cos(d),p=o*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),dft=x((t,e,r,n)=>{const i=e.length;for(let a=0;a{if(u.entries.length!==o)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/o-Math.PI/2,m=M1e(f,n,i,l),y=m*Math.cos(g),v=m*Math.sin(g);return{x:y,y:v}});a==="circle"?t.append("path").attr("d",N1e(d,s.curveTension)).attr("class",`radarCurve-${h}`):a==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}x(D1e,"drawCurves");function M1e(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}x(M1e,"relativeRadius");function N1e(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i{const u=t.append("g").attr("transform",`translate(${i}, ${a+l*s})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}x(O1e,"drawLegend");var fft={draw:cft},pft=x((t,e)=>{let r="";for(let n=0;nti({...hft,...lr().radar}),"getConfig"),P1e=T(()=>ap.axes,"getAxes"),fft=T(()=>ap.curves,"getCurves"),pft=T(()=>ap.options,"getOptions"),gft=T(t=>{ap.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),mft=T(t=>{ap.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:yft(e.entries)}))},"setCurves"),yft=T(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=P1e();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(r=>{const n=t.find(i=>{var a;return((a=i.axis)==null?void 0:a.$refText)===r.name});if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),vft=T(t=>{var r,n,i,a,s;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});ap.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??lm.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??lm.ticks,max:((i=e.max)==null?void 0:i.value)??lm.max,min:((a=e.min)==null?void 0:a.value)??lm.min,graticule:((s=e.graticule)==null?void 0:s.value)??lm.graticule}},"setOptions"),bft=T(()=>{In(),ap=structuredClone($1e)},"clear"),iw={getAxes:P1e,getCurves:fft,getOptions:pft,setAxes:gft,setCurves:mft,setOptions:vft,getConfig:dft,clear:bft,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,getAccDescription:Gn,setAccDescription:zn},xft=T(t=>{zl(t,iw);const{axes:e,curves:r,options:n}=t;iw.setAxes(e),iw.setCurves(r),iw.setOptions(n)},"populate"),Tft={parse:T(async t=>{const e=await Qo("radar",t);ae.debug(e),xft(e)},"parse")},wft=T((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=ys(e),d=Cft(h,l),f=o.max??Math.max(...s.map(m=>Math.max(...m.entries))),p=o.min,g=Math.min(l.width,l.height)/2;kft(d,a,g,o.ticks,o.graticule),Eft(d,a,g,l),B1e(d,a,s,p,f,o.graticule,l),G1e(d,s,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),Cft=T((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return wi(t,n,r,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${r} ${n}`),t.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),kft=T((t,e,r,n,i)=>{if(i==="circle")for(let a=0;a{const d=2*h*Math.PI/a-Math.PI/2,f=o*Math.cos(d),p=o*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),Eft=T((t,e,r,n)=>{const i=e.length;for(let a=0;a{if(u.entries.length!==o)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/o-Math.PI/2,m=F1e(f,n,i,l),y=m*Math.cos(g),v=m*Math.sin(g);return{x:y,y:v}});a==="circle"?t.append("path").attr("d",z1e(d,s.curveTension)).attr("class",`radarCurve-${h}`):a==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}T(B1e,"drawCurves");function F1e(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}T(F1e,"relativeRadius");function z1e(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i{const u=t.append("g").attr("transform",`translate(${i}, ${a+l*s})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}T(G1e,"drawLegend");var Sft={draw:wft},Aft=T((t,e)=>{let r="";for(let n=0;nb==="outlined"?(I.layer??0 fill-opacity: ${e.curveOpacity}; stroke: ${i}; } - `}return r},"genIndexStyles"),gft=x(t=>{const e=w0(),r=lr(),n=ti(e,r.themeVariables),i=ti(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),mft=x(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=gft(t);return` + `}return r},"genIndexStyles"),_ft=T(t=>{const e=wp(),r=lr(),n=ti(e,r.themeVariables),i=ti(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),Rft=T(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=_ft(t);return` .radarTitle { font-size: ${e.fontSize}; color: ${e.titleColor}; @@ -2999,13 +2999,13 @@ ${g}${Math.round($*100)/100}${m}`:I,"getText"),z=x(I=>b==="outlined"?(I.layer??0 font-size: ${r.legendFontSize}px; dominant-baseline: hanging; } - ${pft(e,r)} - `},"styles"),yft={parser:lft,db:rw,renderer:fft,styles:mft};const vft=Object.freeze(Object.defineProperty({__proto__:null,diagram:yft},Symbol.toStringTag,{value:"Module"}));var tP=(function(){var t=x(function(b,w,k,A){for(k=k||{},A=b.length;A--;k[b[A]]=w);return k},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],a=[1,19],s=[1,16],o=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],f=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],m=[1,49],y={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:x(function(w,k,A,C,_,L,O){var M=L.length-1;switch(_){case 4:C.getLogger().debug("Rule: separator (NL) ");break;case 5:C.getLogger().debug("Rule: separator (Space) ");break;case 6:C.getLogger().debug("Rule: separator (EOF) ");break;case 7:C.getLogger().debug("Rule: hierarchy: ",L[M-1]),C.setHierarchy(L[M-1]);break;case 8:C.getLogger().debug("Stop NL ");break;case 9:C.getLogger().debug("Stop EOF ");break;case 10:C.getLogger().debug("Stop NL2 ");break;case 11:C.getLogger().debug("Stop EOF2 ");break;case 12:C.getLogger().debug("Rule: statement: ",L[M]),typeof L[M].length=="number"?this.$=L[M]:this.$=[L[M]];break;case 13:C.getLogger().debug("Rule: statement #2: ",L[M-1]),this.$=[L[M-1]].concat(L[M]);break;case 14:C.getLogger().debug("Rule: link: ",L[M],w),this.$={edgeTypeStr:L[M],label:""};break;case 15:C.getLogger().debug("Rule: LABEL link: ",L[M-3],L[M-1],L[M]),this.$={edgeTypeStr:L[M],label:L[M-1]};break;case 18:const z=parseInt(L[M]),F=C.generateId();this.$={id:F,type:"space",label:"",width:z,children:[]};break;case 23:C.getLogger().debug("Rule: (nodeStatement link node) ",L[M-2],L[M-1],L[M]," typestr: ",L[M-1].edgeTypeStr);const S=C.edgeStrToEdgeData(L[M-1].edgeTypeStr),R=C.edgeStrToEdgeStartData(L[M-1].edgeTypeStr),N=C.edgeStrToThickness(L[M-1].edgeTypeStr),D=C.edgeStrToPattern(L[M-1].edgeTypeStr);this.$=[{id:L[M-2].id,label:L[M-2].label,type:L[M-2].type,directions:L[M-2].directions},{id:L[M-2].id+"-"+L[M].id,start:L[M-2].id,end:L[M].id,label:L[M-1].label,type:"edge",thickness:N,pattern:D,directions:L[M].directions,arrowTypeEnd:S,arrowTypeStart:R},{id:L[M].id,label:L[M].label,type:C.typeStr2Type(L[M].typeStr),directions:L[M].directions}];break;case 24:C.getLogger().debug("Rule: nodeStatement (abc88 node size) ",L[M-1],L[M]),this.$={id:L[M-1].id,label:L[M-1].label,type:C.typeStr2Type(L[M-1].typeStr),directions:L[M-1].directions,widthInColumns:parseInt(L[M],10)};break;case 25:C.getLogger().debug("Rule: nodeStatement (node) ",L[M]),this.$={id:L[M].id,label:L[M].label,type:C.typeStr2Type(L[M].typeStr),directions:L[M].directions,widthInColumns:1};break;case 26:C.getLogger().debug("APA123",this?this:"na"),C.getLogger().debug("COLUMNS: ",L[M]),this.$={type:"column-setting",columns:L[M]==="auto"?-1:parseInt(L[M])};break;case 27:C.getLogger().debug("Rule: id-block statement : ",L[M-2],L[M-1]),C.generateId(),this.$={...L[M-2],type:"composite",children:L[M-1]};break;case 28:C.getLogger().debug("Rule: blockStatement : ",L[M-2],L[M-1],L[M]);const I=C.generateId();this.$={id:I,type:"composite",label:"",children:L[M-1]};break;case 29:C.getLogger().debug("Rule: node (NODE_ID separator): ",L[M]),this.$={id:L[M]};break;case 30:C.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",L[M-1],L[M]),this.$={id:L[M-1],label:L[M].label,typeStr:L[M].typeStr,directions:L[M].directions};break;case 31:C.getLogger().debug("Rule: dirList: ",L[M]),this.$=[L[M]];break;case 32:C.getLogger().debug("Rule: dirList: ",L[M-1],L[M]),this.$=[L[M-1]].concat(L[M]);break;case 33:C.getLogger().debug("Rule: nodeShapeNLabel: ",L[M-2],L[M-1],L[M]),this.$={typeStr:L[M-2]+L[M],label:L[M-1]};break;case 34:C.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",L[M-3],L[M-2]," #3:",L[M-1],L[M]),this.$={typeStr:L[M-3]+L[M],label:L[M-2],directions:L[M-1]};break;case 35:case 36:this.$={type:"classDef",id:L[M-1].trim(),css:L[M].trim()};break;case 37:this.$={type:"applyClass",id:L[M-1].trim(),styleClass:L[M].trim()};break;case 38:this.$={type:"applyStyles",id:L[M-1].trim(),stylesStr:L[M].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:a,39:s,43:o,46:l}),t(h,[2,16],{14:22,15:d,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:a},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:e,11:37,13:4,14:22,15:d,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:m},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:m,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:x(function(w,k){if(k.recoverable)this.trace(w);else{var A=new Error(w);throw A.hash=k,A}},"parseError"),parse:x(function(w){var k=this,A=[0],C=[],_=[null],L=[],O=this.table,M="",z=0,F=0,S=2,R=1,N=L.slice.call(arguments,1),D=Object.create(this.lexer),I={yy:{}};for(var $ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,$)&&(I.yy[$]=this.yy[$]);D.setInput(w,I.yy),I.yy.lexer=D,I.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var B=D.yylloc;L.push(B);var P=D.options&&D.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function G(fe){A.length=A.length-2*fe,_.length=_.length-fe,L.length=L.length-fe}x(G,"popStack");function V(){var fe;return fe=C.pop()||D.lex()||R,typeof fe!="number"&&(fe instanceof Array&&(C=fe,fe=C.pop()),fe=k.symbols_[fe]||fe),fe}x(V,"lex");for(var Y,W,ie,K,se={},J,Z,ee,ne;;){if(W=A[A.length-1],this.defaultActions[W]?ie=this.defaultActions[W]:((Y===null||typeof Y>"u")&&(Y=V()),ie=O[W]&&O[W][Y]),typeof ie>"u"||!ie.length||!ie[0]){var ue="";ne=[];for(J in O[W])this.terminals_[J]&&J>S&&ne.push("'"+this.terminals_[J]+"'");D.showPosition?ue="Parse error on line "+(z+1)+`: + ${Aft(e,r)} + `},"styles"),Lft={parser:Tft,db:iw,renderer:Sft,styles:Rft};const Ift=Object.freeze(Object.defineProperty({__proto__:null,diagram:Lft},Symbol.toStringTag,{value:"Module"}));var sP=(function(){var t=T(function(b,w,k,S){for(k=k||{},S=b.length;S--;k[b[S]]=w);return k},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],a=[1,19],s=[1,16],o=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],f=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],m=[1,49],y={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:T(function(w,k,S,C,_,L,O){var M=L.length-1;switch(_){case 4:C.getLogger().debug("Rule: separator (NL) ");break;case 5:C.getLogger().debug("Rule: separator (Space) ");break;case 6:C.getLogger().debug("Rule: separator (EOF) ");break;case 7:C.getLogger().debug("Rule: hierarchy: ",L[M-1]),C.setHierarchy(L[M-1]);break;case 8:C.getLogger().debug("Stop NL ");break;case 9:C.getLogger().debug("Stop EOF ");break;case 10:C.getLogger().debug("Stop NL2 ");break;case 11:C.getLogger().debug("Stop EOF2 ");break;case 12:C.getLogger().debug("Rule: statement: ",L[M]),typeof L[M].length=="number"?this.$=L[M]:this.$=[L[M]];break;case 13:C.getLogger().debug("Rule: statement #2: ",L[M-1]),this.$=[L[M-1]].concat(L[M]);break;case 14:C.getLogger().debug("Rule: link: ",L[M],w),this.$={edgeTypeStr:L[M],label:""};break;case 15:C.getLogger().debug("Rule: LABEL link: ",L[M-3],L[M-1],L[M]),this.$={edgeTypeStr:L[M],label:L[M-1]};break;case 18:const z=parseInt(L[M]),F=C.generateId();this.$={id:F,type:"space",label:"",width:z,children:[]};break;case 23:C.getLogger().debug("Rule: (nodeStatement link node) ",L[M-2],L[M-1],L[M]," typestr: ",L[M-1].edgeTypeStr);const A=C.edgeStrToEdgeData(L[M-1].edgeTypeStr),R=C.edgeStrToEdgeStartData(L[M-1].edgeTypeStr),N=C.edgeStrToThickness(L[M-1].edgeTypeStr),D=C.edgeStrToPattern(L[M-1].edgeTypeStr);this.$=[{id:L[M-2].id,label:L[M-2].label,type:L[M-2].type,directions:L[M-2].directions},{id:L[M-2].id+"-"+L[M].id,start:L[M-2].id,end:L[M].id,label:L[M-1].label,type:"edge",thickness:N,pattern:D,directions:L[M].directions,arrowTypeEnd:A,arrowTypeStart:R},{id:L[M].id,label:L[M].label,type:C.typeStr2Type(L[M].typeStr),directions:L[M].directions}];break;case 24:C.getLogger().debug("Rule: nodeStatement (abc88 node size) ",L[M-1],L[M]),this.$={id:L[M-1].id,label:L[M-1].label,type:C.typeStr2Type(L[M-1].typeStr),directions:L[M-1].directions,widthInColumns:parseInt(L[M],10)};break;case 25:C.getLogger().debug("Rule: nodeStatement (node) ",L[M]),this.$={id:L[M].id,label:L[M].label,type:C.typeStr2Type(L[M].typeStr),directions:L[M].directions,widthInColumns:1};break;case 26:C.getLogger().debug("APA123",this?this:"na"),C.getLogger().debug("COLUMNS: ",L[M]),this.$={type:"column-setting",columns:L[M]==="auto"?-1:parseInt(L[M])};break;case 27:C.getLogger().debug("Rule: id-block statement : ",L[M-2],L[M-1]),C.generateId(),this.$={...L[M-2],type:"composite",children:L[M-1]};break;case 28:C.getLogger().debug("Rule: blockStatement : ",L[M-2],L[M-1],L[M]);const I=C.generateId();this.$={id:I,type:"composite",label:"",children:L[M-1]};break;case 29:C.getLogger().debug("Rule: node (NODE_ID separator): ",L[M]),this.$={id:L[M]};break;case 30:C.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",L[M-1],L[M]),this.$={id:L[M-1],label:L[M].label,typeStr:L[M].typeStr,directions:L[M].directions};break;case 31:C.getLogger().debug("Rule: dirList: ",L[M]),this.$=[L[M]];break;case 32:C.getLogger().debug("Rule: dirList: ",L[M-1],L[M]),this.$=[L[M-1]].concat(L[M]);break;case 33:C.getLogger().debug("Rule: nodeShapeNLabel: ",L[M-2],L[M-1],L[M]),this.$={typeStr:L[M-2]+L[M],label:L[M-1]};break;case 34:C.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",L[M-3],L[M-2]," #3:",L[M-1],L[M]),this.$={typeStr:L[M-3]+L[M],label:L[M-2],directions:L[M-1]};break;case 35:case 36:this.$={type:"classDef",id:L[M-1].trim(),css:L[M].trim()};break;case 37:this.$={type:"applyClass",id:L[M-1].trim(),styleClass:L[M].trim()};break;case 38:this.$={type:"applyStyles",id:L[M-1].trim(),stylesStr:L[M].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:a,39:s,43:o,46:l}),t(h,[2,16],{14:22,15:d,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:a},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:e,11:37,13:4,14:22,15:d,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:m},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:m,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:T(function(w,k){if(k.recoverable)this.trace(w);else{var S=new Error(w);throw S.hash=k,S}},"parseError"),parse:T(function(w){var k=this,S=[0],C=[],_=[null],L=[],O=this.table,M="",z=0,F=0,A=2,R=1,N=L.slice.call(arguments,1),D=Object.create(this.lexer),I={yy:{}};for(var $ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,$)&&(I.yy[$]=this.yy[$]);D.setInput(w,I.yy),I.yy.lexer=D,I.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var B=D.yylloc;L.push(B);var P=D.options&&D.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function G(fe){S.length=S.length-2*fe,_.length=_.length-fe,L.length=L.length-fe}T(G,"popStack");function V(){var fe;return fe=C.pop()||D.lex()||R,typeof fe!="number"&&(fe instanceof Array&&(C=fe,fe=C.pop()),fe=k.symbols_[fe]||fe),fe}T(V,"lex");for(var X,W,ie,K,se={},J,Z,ee,ne;;){if(W=S[S.length-1],this.defaultActions[W]?ie=this.defaultActions[W]:((X===null||typeof X>"u")&&(X=V()),ie=O[W]&&O[W][X]),typeof ie>"u"||!ie.length||!ie[0]){var ue="";ne=[];for(J in O[W])this.terminals_[J]&&J>A&&ne.push("'"+this.terminals_[J]+"'");D.showPosition?ue="Parse error on line "+(z+1)+`: `+D.showPosition()+` -Expecting `+ne.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":ue="Parse error on line "+(z+1)+": Unexpected "+(Y==R?"end of input":"'"+(this.terminals_[Y]||Y)+"'"),this.parseError(ue,{text:D.match,token:this.terminals_[Y]||Y,line:D.yylineno,loc:B,expected:ne})}if(ie[0]instanceof Array&&ie.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+Y);switch(ie[0]){case 1:A.push(Y),_.push(D.yytext),L.push(D.yylloc),A.push(ie[1]),Y=null,F=D.yyleng,M=D.yytext,z=D.yylineno,B=D.yylloc;break;case 2:if(Z=this.productions_[ie[1]][1],se.$=_[_.length-Z],se._$={first_line:L[L.length-(Z||1)].first_line,last_line:L[L.length-1].last_line,first_column:L[L.length-(Z||1)].first_column,last_column:L[L.length-1].last_column},P&&(se._$.range=[L[L.length-(Z||1)].range[0],L[L.length-1].range[1]]),K=this.performAction.apply(se,[M,F,z,I.yy,ie[1],_,L].concat(N)),typeof K<"u")return K;Z&&(A=A.slice(0,-1*Z*2),_=_.slice(0,-1*Z),L=L.slice(0,-1*Z)),A.push(this.productions_[ie[1]][0]),_.push(se.$),L.push(se._$),ee=O[A[A.length-2]][A[A.length-1]],A.push(ee);break;case 3:return!0}}return!0},"parse")},v=(function(){var b={EOF:1,parseError:x(function(k,A){if(this.yy.parser)this.yy.parser.parseError(k,A);else throw new Error(k)},"parseError"),setInput:x(function(w,k){return this.yy=k||this.yy||{},this._input=w,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var k=w.match(/(?:\r\n?|\n).*/g);return k?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:x(function(w){var k=w.length,A=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;var C=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),A.length-1&&(this.yylineno-=A.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:A?(A.length===C.length?this.yylloc.first_column:0)+C[C.length-A.length].length-A[0].length:this.yylloc.first_column-k},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-k]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(w){this.unput(this.match.slice(w))},"less"),pastInput:x(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var w=this.pastInput(),k=new Array(w.length+1).join("-");return w+this.upcomingInput()+` -`+k+"^"},"showPosition"),test_match:x(function(w,k){var A,C,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),C=w[0].match(/(?:\r\n?|\n).*/g),C&&(this.yylineno+=C.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:C?C[C.length-1].length-C[C.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(w[0].length),this.matched+=w[0],A=this.performAction.call(this,this.yy,this,k,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),A)return A;if(this._backtrack){for(var L in _)this[L]=_[L];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,k,A,C;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),L=0;L<_.length;L++)if(A=this._input.match(this.rules[_[L]]),A&&(!k||A[0].length>k[0].length)){if(k=A,C=L,this.options.backtrack_lexer){if(w=this.test_match(A,_[L]),w!==!1)return w;if(this._backtrack){k=!1;continue}else return!1}else if(!this.options.flex)break}return k?(w=this.test_match(k,_[C]),w!==!1?w:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var k=this.next();return k||this.lex()},"lex"),begin:x(function(k){this.conditionStack.push(k)},"begin"),popState:x(function(){var k=this.conditionStack.length-1;return k>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(k){return k=this.conditionStack.length-1-Math.abs(k||0),k>=0?this.conditionStack[k]:"INITIAL"},"topState"),pushState:x(function(k){this.begin(k)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(k,A,C,_){switch(C){case 0:return k.getLogger().debug("Found block-beta"),10;case 1:return k.getLogger().debug("Found id-block"),29;case 2:return k.getLogger().debug("Found block"),10;case 3:k.getLogger().debug(".",A.yytext);break;case 4:k.getLogger().debug("_",A.yytext);break;case 5:return 5;case 6:return A.yytext=-1,28;case 7:return A.yytext=A.yytext.replace(/columns\s+/,""),k.getLogger().debug("COLUMNS (LEX)",A.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:k.getLogger().debug("LEX: POPPING STR:",A.yytext),this.popState();break;case 13:return k.getLogger().debug("LEX: STR end:",A.yytext),"STR";case 14:return A.yytext=A.yytext.replace(/space\:/,""),k.getLogger().debug("SPACE NUM (LEX)",A.yytext),21;case 15:return A.yytext="1",k.getLogger().debug("COLUMNS (LEX)",A.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),k.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),k.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),k.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),k.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),k.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),k.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),k.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),k.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),k.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),k.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),k.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),k.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return k.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return k.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return k.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return k.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return k.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return k.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return k.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),k.getLogger().debug("LEX ARR START"),37;case 74:return k.getLogger().debug("Lex: NODE_ID",A.yytext),31;case 75:return k.getLogger().debug("Lex: EOF",A.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:k.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:k.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return k.getLogger().debug("LEX: NODE_DESCR:",A.yytext),"NODE_DESCR";case 83:k.getLogger().debug("LEX POPPING"),this.popState();break;case 84:k.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return A.yytext=A.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (right): dir:",A.yytext),"DIR";case 86:return A.yytext=A.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (left):",A.yytext),"DIR";case 87:return A.yytext=A.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (x):",A.yytext),"DIR";case 88:return A.yytext=A.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (y):",A.yytext),"DIR";case 89:return A.yytext=A.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (up):",A.yytext),"DIR";case 90:return A.yytext=A.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (down):",A.yytext),"DIR";case 91:return A.yytext="]>",k.getLogger().debug("Lex (ARROW_DIR end):",A.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return k.getLogger().debug("Lex: LINK","#"+A.yytext+"#"),15;case 93:return k.getLogger().debug("Lex: LINK",A.yytext),15;case 94:return k.getLogger().debug("Lex: LINK",A.yytext),15;case 95:return k.getLogger().debug("Lex: LINK",A.yytext),15;case 96:return k.getLogger().debug("Lex: START_LINK",A.yytext),this.pushState("LLABEL"),16;case 97:return k.getLogger().debug("Lex: START_LINK",A.yytext),this.pushState("LLABEL"),16;case 98:return k.getLogger().debug("Lex: START_LINK",A.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return k.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),k.getLogger().debug("Lex: LINK","#"+A.yytext+"#"),15;case 102:return this.popState(),k.getLogger().debug("Lex: LINK",A.yytext),15;case 103:return this.popState(),k.getLogger().debug("Lex: LINK",A.yytext),15;case 104:return k.getLogger().debug("Lex: COLON",A.yytext),A.yytext=A.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return b})();y.lexer=v;function T(){this.yy={}}return x(T,"Parser"),T.prototype=y,y.Parser=T,new T})();tP.parser=tP;var bft=tP,tl=new Map,rP=[],nP=new Map,$1e="color",P1e="fill",xft="bgFill",B1e=",",Tft=Pe(),GS=new Map,iP="",wft=x(t=>Lt.sanitizeText(t,Tft),"sanitizeText"),Cft=x(function(t,e=""){let r=GS.get(t);r||(r={id:t,styles:[],textStyles:[]},GS.set(t,r)),e!=null&&e.split(B1e).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp($1e).exec(n)){const s=i.replace(P1e,xft).replace($1e,P1e);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),kft=x(function(t,e=""){const r=tl.get(t);e!=null&&(r.styles=e.split(B1e))},"addStyle2Node"),Eft=x(function(t,e){t.split(",").forEach(function(r){let n=tl.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},tl.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),F1e=x((t,e)=>{const r=t.flat(),n=[],i=r.find(s=>(s==null?void 0:s.type)==="column-setting"),a=(i==null?void 0:i.columns)??-1;for(const s of r){if(typeof a=="number"&&a>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>a&&ae.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${a}`),s.label&&(s.label=wft(s.label)),s.type==="classDef"){Cft(s.id,s.css);continue}if(s.type==="applyClass"){Eft(s.id,(s==null?void 0:s.styleClass)??"");continue}if(s.type==="applyStyles"){s!=null&&s.stylesStr&&kft(s.id,s==null?void 0:s.stylesStr);continue}if(s.type==="column-setting")e.columns=s.columns??-1;else if(s.type==="edge"){const o=(nP.get(s.id)??0)+1;nP.set(s.id,o),s.id=o+"-"+s.id,rP.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const o=tl.get(s.id);if(o===void 0?tl.set(s.id,s):(s.type!=="na"&&(o.type=s.type),s.label!==s.id&&(o.label=s.label)),s.children&&F1e(s.children,s),s.type==="space"){const l=s.width??1;for(let u=0;u{ae.debug("Clear called"),In(),nw={id:"root",type:"composite",children:[],columns:-1},tl=new Map([["root",nw]]),aP=[],GS=new Map,rP=[],nP=new Map,iP=""},"clear");function z1e(t){switch(ae.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return ae.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}x(z1e,"typeStr2Type");function G1e(t){switch(ae.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}x(G1e,"edgeTypeStr2Type");function q1e(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}x(q1e,"edgeStrToEdgeData");function V1e(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}x(V1e,"edgeStrToEdgeStartData");function W1e(t){return t.includes("==")?"thick":"normal"}x(W1e,"edgeStrToThickness");function U1e(t){return t.includes(".-")?"dotted":"solid"}x(U1e,"edgeStrToPattern");var H1e=0,Aft=x(()=>(H1e++,"id-"+Math.random().toString(36).substr(2,12)+"-"+H1e),"generateId"),_ft=x(t=>{nw.children=t,F1e(t,nw),aP=nw.children},"setHierarchy"),Rft=x(t=>{const e=tl.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),Lft=x(()=>[...tl.values()],"getBlocksFlat"),Ift=x(()=>aP||[],"getBlocks"),Dft=x(()=>rP,"getEdges"),Mft=x(t=>tl.get(t),"getBlock"),Nft=x(t=>{tl.set(t.id,t)},"setBlock"),Oft=x(t=>{iP=t},"setDiagramId"),$ft=x(()=>iP,"getDiagramId"),Pft=x(()=>ae,"getLogger"),Bft=x(function(){return GS},"getClasses"),Fft={getConfig:x(()=>lr().block,"getConfig"),typeStr2Type:z1e,edgeTypeStr2Type:G1e,edgeStrToEdgeData:q1e,edgeStrToEdgeStartData:V1e,edgeStrToThickness:W1e,edgeStrToPattern:U1e,getLogger:Pft,getBlocksFlat:Lft,getBlocks:Ift,getEdges:Dft,setHierarchy:_ft,getBlock:Mft,setBlock:Nft,getColumns:Rft,getClasses:Bft,clear:Sft,generateId:Aft,setDiagramId:Oft,getDiagramId:$ft},zft=Fft,sP=x((t,e)=>{const r=g6,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ao(n,i,a,e)},"fade"),Gft=x(t=>`.label { +Expecting `+ne.join(", ")+", got '"+(this.terminals_[X]||X)+"'":ue="Parse error on line "+(z+1)+": Unexpected "+(X==R?"end of input":"'"+(this.terminals_[X]||X)+"'"),this.parseError(ue,{text:D.match,token:this.terminals_[X]||X,line:D.yylineno,loc:B,expected:ne})}if(ie[0]instanceof Array&&ie.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+X);switch(ie[0]){case 1:S.push(X),_.push(D.yytext),L.push(D.yylloc),S.push(ie[1]),X=null,F=D.yyleng,M=D.yytext,z=D.yylineno,B=D.yylloc;break;case 2:if(Z=this.productions_[ie[1]][1],se.$=_[_.length-Z],se._$={first_line:L[L.length-(Z||1)].first_line,last_line:L[L.length-1].last_line,first_column:L[L.length-(Z||1)].first_column,last_column:L[L.length-1].last_column},P&&(se._$.range=[L[L.length-(Z||1)].range[0],L[L.length-1].range[1]]),K=this.performAction.apply(se,[M,F,z,I.yy,ie[1],_,L].concat(N)),typeof K<"u")return K;Z&&(S=S.slice(0,-1*Z*2),_=_.slice(0,-1*Z),L=L.slice(0,-1*Z)),S.push(this.productions_[ie[1]][0]),_.push(se.$),L.push(se._$),ee=O[S[S.length-2]][S[S.length-1]],S.push(ee);break;case 3:return!0}}return!0},"parse")},v=(function(){var b={EOF:1,parseError:T(function(k,S){if(this.yy.parser)this.yy.parser.parseError(k,S);else throw new Error(k)},"parseError"),setInput:T(function(w,k){return this.yy=k||this.yy||{},this._input=w,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var k=w.match(/(?:\r\n?|\n).*/g);return k?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:T(function(w){var k=w.length,S=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;var C=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),S.length-1&&(this.yylineno-=S.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:S?(S.length===C.length?this.yylloc.first_column:0)+C[C.length-S.length].length-S[0].length:this.yylloc.first_column-k},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-k]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(w){this.unput(this.match.slice(w))},"less"),pastInput:T(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var w=this.pastInput(),k=new Array(w.length+1).join("-");return w+this.upcomingInput()+` +`+k+"^"},"showPosition"),test_match:T(function(w,k){var S,C,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),C=w[0].match(/(?:\r\n?|\n).*/g),C&&(this.yylineno+=C.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:C?C[C.length-1].length-C[C.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(w[0].length),this.matched+=w[0],S=this.performAction.call(this,this.yy,this,k,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),S)return S;if(this._backtrack){for(var L in _)this[L]=_[L];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,k,S,C;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),L=0;L<_.length;L++)if(S=this._input.match(this.rules[_[L]]),S&&(!k||S[0].length>k[0].length)){if(k=S,C=L,this.options.backtrack_lexer){if(w=this.test_match(S,_[L]),w!==!1)return w;if(this._backtrack){k=!1;continue}else return!1}else if(!this.options.flex)break}return k?(w=this.test_match(k,_[C]),w!==!1?w:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var k=this.next();return k||this.lex()},"lex"),begin:T(function(k){this.conditionStack.push(k)},"begin"),popState:T(function(){var k=this.conditionStack.length-1;return k>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(k){return k=this.conditionStack.length-1-Math.abs(k||0),k>=0?this.conditionStack[k]:"INITIAL"},"topState"),pushState:T(function(k){this.begin(k)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:T(function(k,S,C,_){switch(C){case 0:return k.getLogger().debug("Found block-beta"),10;case 1:return k.getLogger().debug("Found id-block"),29;case 2:return k.getLogger().debug("Found block"),10;case 3:k.getLogger().debug(".",S.yytext);break;case 4:k.getLogger().debug("_",S.yytext);break;case 5:return 5;case 6:return S.yytext=-1,28;case 7:return S.yytext=S.yytext.replace(/columns\s+/,""),k.getLogger().debug("COLUMNS (LEX)",S.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:k.getLogger().debug("LEX: POPPING STR:",S.yytext),this.popState();break;case 13:return k.getLogger().debug("LEX: STR end:",S.yytext),"STR";case 14:return S.yytext=S.yytext.replace(/space\:/,""),k.getLogger().debug("SPACE NUM (LEX)",S.yytext),21;case 15:return S.yytext="1",k.getLogger().debug("COLUMNS (LEX)",S.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),k.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),k.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),k.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),k.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),k.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),k.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),k.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),k.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),k.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),k.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),k.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),k.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return k.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return k.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return k.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return k.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return k.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return k.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return k.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),k.getLogger().debug("LEX ARR START"),37;case 74:return k.getLogger().debug("Lex: NODE_ID",S.yytext),31;case 75:return k.getLogger().debug("Lex: EOF",S.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:k.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:k.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return k.getLogger().debug("LEX: NODE_DESCR:",S.yytext),"NODE_DESCR";case 83:k.getLogger().debug("LEX POPPING"),this.popState();break;case 84:k.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (right): dir:",S.yytext),"DIR";case 86:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (left):",S.yytext),"DIR";case 87:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (x):",S.yytext),"DIR";case 88:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (y):",S.yytext),"DIR";case 89:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (up):",S.yytext),"DIR";case 90:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (down):",S.yytext),"DIR";case 91:return S.yytext="]>",k.getLogger().debug("Lex (ARROW_DIR end):",S.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return k.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 93:return k.getLogger().debug("Lex: LINK",S.yytext),15;case 94:return k.getLogger().debug("Lex: LINK",S.yytext),15;case 95:return k.getLogger().debug("Lex: LINK",S.yytext),15;case 96:return k.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 97:return k.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 98:return k.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return k.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),k.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 102:return this.popState(),k.getLogger().debug("Lex: LINK",S.yytext),15;case 103:return this.popState(),k.getLogger().debug("Lex: LINK",S.yytext),15;case 104:return k.getLogger().debug("Lex: COLON",S.yytext),S.yytext=S.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return b})();y.lexer=v;function x(){this.yy={}}return T(x,"Parser"),x.prototype=y,y.Parser=x,new x})();sP.parser=sP;var Dft=sP,tl=new Map,oP=[],lP=new Map,q1e="color",V1e="fill",Mft="bgFill",W1e=",",Nft=Pe(),WS=new Map,cP="",Oft=T(t=>Lt.sanitizeText(t,Nft),"sanitizeText"),$ft=T(function(t,e=""){let r=WS.get(t);r||(r={id:t,styles:[],textStyles:[]},WS.set(t,r)),e!=null&&e.split(W1e).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(q1e).exec(n)){const s=i.replace(V1e,Mft).replace(q1e,V1e);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),Pft=T(function(t,e=""){const r=tl.get(t);e!=null&&(r.styles=e.split(W1e))},"addStyle2Node"),Bft=T(function(t,e){t.split(",").forEach(function(r){let n=tl.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},tl.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),U1e=T((t,e)=>{const r=t.flat(),n=[],i=r.find(s=>(s==null?void 0:s.type)==="column-setting"),a=(i==null?void 0:i.columns)??-1;for(const s of r){if(typeof a=="number"&&a>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>a&&ae.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${a}`),s.label&&(s.label=Oft(s.label)),s.type==="classDef"){$ft(s.id,s.css);continue}if(s.type==="applyClass"){Bft(s.id,(s==null?void 0:s.styleClass)??"");continue}if(s.type==="applyStyles"){s!=null&&s.stylesStr&&Pft(s.id,s==null?void 0:s.stylesStr);continue}if(s.type==="column-setting")e.columns=s.columns??-1;else if(s.type==="edge"){const o=(lP.get(s.id)??0)+1;lP.set(s.id,o),s.id=o+"-"+s.id,oP.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const o=tl.get(s.id);if(o===void 0?tl.set(s.id,s):(s.type!=="na"&&(o.type=s.type),s.label!==s.id&&(o.label=s.label)),s.children&&U1e(s.children,s),s.type==="space"){const l=s.width??1;for(let u=0;u{ae.debug("Clear called"),In(),aw={id:"root",type:"composite",children:[],columns:-1},tl=new Map([["root",aw]]),uP=[],WS=new Map,oP=[],lP=new Map,cP=""},"clear");function H1e(t){switch(ae.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return ae.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}T(H1e,"typeStr2Type");function Y1e(t){switch(ae.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}T(Y1e,"edgeTypeStr2Type");function X1e(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}T(X1e,"edgeStrToEdgeData");function K1e(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}T(K1e,"edgeStrToEdgeStartData");function j1e(t){return t.includes("==")?"thick":"normal"}T(j1e,"edgeStrToThickness");function Z1e(t){return t.includes(".-")?"dotted":"solid"}T(Z1e,"edgeStrToPattern");var Q1e=0,zft=T(()=>(Q1e++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Q1e),"generateId"),Gft=T(t=>{aw.children=t,U1e(t,aw),uP=aw.children},"setHierarchy"),qft=T(t=>{const e=tl.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),Vft=T(()=>[...tl.values()],"getBlocksFlat"),Wft=T(()=>uP||[],"getBlocks"),Uft=T(()=>oP,"getEdges"),Hft=T(t=>tl.get(t),"getBlock"),Yft=T(t=>{tl.set(t.id,t)},"setBlock"),Xft=T(t=>{cP=t},"setDiagramId"),Kft=T(()=>cP,"getDiagramId"),jft=T(()=>ae,"getLogger"),Zft=T(function(){return WS},"getClasses"),Qft={getConfig:T(()=>lr().block,"getConfig"),typeStr2Type:H1e,edgeTypeStr2Type:Y1e,edgeStrToEdgeData:X1e,edgeStrToEdgeStartData:K1e,edgeStrToThickness:j1e,edgeStrToPattern:Z1e,getLogger:jft,getBlocksFlat:Vft,getBlocks:Wft,getEdges:Uft,setHierarchy:Gft,getBlock:Hft,setBlock:Yft,getColumns:qft,getClasses:Zft,clear:Fft,generateId:zft,setDiagramId:Xft,getDiagramId:Kft},Jft=Qft,hP=T((t,e)=>{const r=v6,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ao(n,i,a,e)},"fade"),ept=T(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -3090,9 +3090,9 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":ue="Parse error } .node .cluster { - // fill: ${sP(t.mainBkg,.5)}; - fill: ${sP(t.clusterBkg,.5)}; - stroke: ${sP(t.clusterBorder,.2)}; + // fill: ${hP(t.mainBkg,.5)}; + fill: ${hP(t.clusterBkg,.5)}; + stroke: ${hP(t.clusterBorder,.2)}; box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; stroke-width: 1px; } @@ -3127,12 +3127,12 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":ue="Parse error font-size: 18px; fill: ${t.textColor}; } - ${px()} -`,"getStyles"),qft=Gft,Vft=x((t,e,r,n)=>{e.forEach(i=>{Jft[i](t,r,n)})},"insertMarkers"),Wft=x((t,e,r)=>{ae.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Uft=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Hft=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Yft=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Xft=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Kft=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),jft=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),Zft=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Qft=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Jft={extension:Wft,composition:Uft,aggregation:Hft,dependency:Yft,lollipop:Xft,point:Kft,circle:jft,cross:Zft,barb:Qft},e0t=Vft,mi=((Jve=(Qve=Pe())==null?void 0:Qve.block)==null?void 0:Jve.padding)??8;function oP(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}x(oP,"calculateBlockPosition");var t0t=x(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};if(ae.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",o,n.type),n.type==="space")continue;const l=i/(n.widthInColumns??1);l>e&&(e=l),a>r&&(r=a)}return{width:e,height:r}},"getMaxChildSize");function qS(t,e,r=0,n=0){var s,o,l,u,h,d,f,p,g,m,y;ae.debug("setBlockSizes abc95 (start)",t.id,(s=t==null?void 0:t.size)==null?void 0:s.x,"block width =",t==null?void 0:t.size,"siblingWidth",r),(o=t==null?void 0:t.size)!=null&&o.width||(t.size={width:r,height:n,x:0,y:0});let i=0,a=0;if(((l=t.children)==null?void 0:l.length)>0){for(const _ of t.children)qS(_,e);const v=t0t(t);i=v.width,a=v.height,ae.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",i,a);for(const _ of t.children)_.size&&(ae.debug(`abc95 Setting size of children of ${t.id} id=${_.id} ${i} ${a} ${JSON.stringify(_.size)}`),_.size.width=i*(_.widthInColumns??1)+mi*((_.widthInColumns??1)-1),_.size.height=a,_.size.x=0,_.size.y=0,ae.debug(`abc95 updating size of ${t.id} children child:${_.id} maxWidth:${i} maxHeight:${a}`));for(const _ of t.children)qS(_,e,i,a);const T=t.columns??-1;let b=0;for(const _ of t.children)b+=_.widthInColumns??1;let w=t.children.length;T>0&&T0?Math.min(t.children.length,T):t.children.length;if(_>0){const L=(A-_*mi-mi)/_;ae.debug("abc95 (growing to fit) width",t.id,A,(f=t.size)==null?void 0:f.width,L);for(const O of t.children)O.size&&(O.size.width=L)}}t.size={width:A,height:C,x:0,y:0}}ae.debug("setBlockSizes abc94 (done)",t.id,(p=t==null?void 0:t.size)==null?void 0:p.x,(g=t==null?void 0:t.size)==null?void 0:g.width,(m=t==null?void 0:t.size)==null?void 0:m.y,(y=t==null?void 0:t.size)==null?void 0:y.height)}x(qS,"setBlockSizes");function lP(t,e){var n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b;ae.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${(n=t==null?void 0:t.size)==null?void 0:n.x} y: ${(i=t==null?void 0:t.size)==null?void 0:i.y} width: ${(a=t==null?void 0:t.size)==null?void 0:a.width}`);const r=t.columns??-1;if(ae.debug("layoutBlocks columns abc95",t.id,"=>",r,t),t.children&&t.children.length>0){const w=((o=(s=t==null?void 0:t.children[0])==null?void 0:s.size)==null?void 0:o.width)??0,k=t.children.length*w+(t.children.length-1)*mi;ae.debug("widthOfChildren 88",k,"posX");const A=new Map;{let M=0;for(const z of t.children){if(!z.size)continue;const{py:F}=oP(r,M),S=A.get(F)??0;z.size.height>S&&A.set(F,z.size.height);let R=(z==null?void 0:z.widthInColumns)??1;r>0&&(R=Math.min(R,r-M%r)),M+=R}}const C=new Map;{let M=0;const z=[...A.keys()].sort((F,S)=>F-S);for(const F of z)C.set(F,M),M+=(A.get(F)??0)+mi}let _=0;ae.debug("abc91 block?.size?.x",t.id,(l=t==null?void 0:t.size)==null?void 0:l.x);let L=(u=t==null?void 0:t.size)!=null&&u.x?((h=t==null?void 0:t.size)==null?void 0:h.x)+(-((d=t==null?void 0:t.size)==null?void 0:d.width)/2||0):-mi,O=0;for(const M of t.children){const z=t;if(!M.size)continue;const{width:F,height:S}=M.size,{px:R,py:N}=oP(r,_);if(N!=O&&(O=N,L=(f=t==null?void 0:t.size)!=null&&f.x?((p=t==null?void 0:t.size)==null?void 0:p.x)+(-((g=t==null?void 0:t.size)==null?void 0:g.width)/2||0):-mi,ae.debug("New row in layout for block",t.id," and child ",M.id,O)),ae.debug(`abc89 layout blocks (child) id: ${M.id} Pos: ${_} (px, py) ${R},${N} (${(m=z==null?void 0:z.size)==null?void 0:m.x},${(y=z==null?void 0:z.size)==null?void 0:y.y}) parent: ${z.id} width: ${F}${mi}`),z.size){const I=F/2;M.size.x=L+mi+I,ae.debug(`abc91 layout blocks (calc) px, pyid:${M.id} startingPos=X${L} new startingPosX${M.size.x} ${I} padding=${mi} width=${F} halfWidth=${I} => x:${M.size.x} y:${M.size.y} ${M.widthInColumns} (width * (child?.w || 1)) / 2 ${F*((M==null?void 0:M.widthInColumns)??1)/2}`),L=M.size.x+I;const $=C.get(N)??0,B=A.get(N)??S;M.size.y=z.size.y-z.size.height/2+$+B/2+mi,ae.debug(`abc88 layout blocks (calc) px, pyid:${M.id}startingPosX${L}${mi}${I}=>x:${M.size.x}y:${M.size.y}${M.widthInColumns}(width * (child?.w || 1)) / 2${F*((M==null?void 0:M.widthInColumns)??1)/2}`)}M.children&&lP(M);let D=(M==null?void 0:M.widthInColumns)??1;r>0&&(D=Math.min(D,r-_%r)),_+=D,ae.debug("abc88 columnsPos",M,_)}}ae.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(v=t==null?void 0:t.size)==null?void 0:v.x} y: ${(T=t==null?void 0:t.size)==null?void 0:T.y} width: ${(b=t==null?void 0:t.size)==null?void 0:b.width}`)}x(lP,"layoutBlocks");function cP(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){const{x:a,y:s,width:o,height:l}=t.size;a-o/2n&&(n=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=cP(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}x(cP,"findBounds");function Y1e(t){const e=t.getBlock("root");if(!e)return;qS(e,t,0,0),lP(e),ae.debug("getBlocks",JSON.stringify(e,null,2));const{minX:r,minY:n,maxX:i,maxY:a}=cP(e),s=a-n,o=i-r;return{x:r,y:n,width:o,height:s}}x(Y1e,"layout");var r0t=x(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Pe(),o=on(s);return await Wa(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),rl=r0t,n0t=x((t,e,r,n,i)=>{e.arrowTypeStart&&X1e(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&X1e(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),i0t={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},X1e=x((t,e,r,n,i,a)=>{const s=i0t[r];if(!s){ae.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)},"addEdgeMarker"),uP={},Oa={},a0t=x(async(t,e)=>{const r=Pe(),n=on(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),s=e.labelType==="markdown",o=await Wa(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:s,isNode:!1,markdown:s,width:s?void 0:Number.POSITIVE_INFINITY},r);a.node().appendChild(o);let l=o.getBBox(),u=l;if(n){const d=o.children[0],f=pt(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=pt(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",yl(u,n)),uP[e.id]=i,e.width=l.width,e.height=l.height;let h;if(e.startLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await rl(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=pt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",yl(g,n)),Oa[e.id]||(Oa[e.id]={}),Oa[e.id].startLeft=d,iw(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await rl(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=pt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",yl(g,n)),Oa[e.id]||(Oa[e.id]={}),Oa[e.id].startRight=d,iw(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await rl(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=pt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",yl(g,n)),Oa[e.id]||(Oa[e.id]={}),Oa[e.id].endLeft=d,iw(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await rl(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=pt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",yl(g,n)),Oa[e.id]||(Oa[e.id]={}),Oa[e.id].endRight=d,iw(h,e.endLabelRight)}return o},"insertEdgeLabel");function iw(t,e){on(Pe())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}x(iw,"setTerminalWidth");var s0t=x((t,e)=>{ae.debug("Moving label abc88 ",t.id,t.label,uP[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Pe(),{subGraphTitleTotalMargin:i}=H2(n);if(t.label){const a=uP[t.id];let s=t.x,o=t.y;if(r){const l=Lr.calcLabelPosition(r);ae.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=Oa[t.id].startLeft;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=Oa[t.id].startRight;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=Oa[t.id].endLeft;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=Oa[t.id].endRight;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),o0t=x((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),l0t=x((t,e,r)=>{ae.debug(`intersection calc abc89: + ${mx()} +`,"getStyles"),tpt=ept,rpt=T((t,e,r,n)=>{e.forEach(i=>{dpt[i](t,r,n)})},"insertMarkers"),npt=T((t,e,r)=>{ae.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),ipt=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),apt=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),spt=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),opt=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),lpt=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),cpt=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),upt=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),hpt=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),dpt={extension:npt,composition:ipt,aggregation:apt,dependency:spt,lollipop:opt,point:lpt,circle:cpt,cross:upt,barb:hpt},fpt=rpt,mi=((a2e=(i2e=Pe())==null?void 0:i2e.block)==null?void 0:a2e.padding)??8;function dP(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}T(dP,"calculateBlockPosition");var ppt=T(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};if(ae.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",o,n.type),n.type==="space")continue;const l=i/(n.widthInColumns??1);l>e&&(e=l),a>r&&(r=a)}return{width:e,height:r}},"getMaxChildSize");function US(t,e,r=0,n=0){var s,o,l,u,h,d,f,p,g,m,y;ae.debug("setBlockSizes abc95 (start)",t.id,(s=t==null?void 0:t.size)==null?void 0:s.x,"block width =",t==null?void 0:t.size,"siblingWidth",r),(o=t==null?void 0:t.size)!=null&&o.width||(t.size={width:r,height:n,x:0,y:0});let i=0,a=0;if(((l=t.children)==null?void 0:l.length)>0){for(const _ of t.children)US(_,e);const v=ppt(t);i=v.width,a=v.height,ae.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",i,a);for(const _ of t.children)_.size&&(ae.debug(`abc95 Setting size of children of ${t.id} id=${_.id} ${i} ${a} ${JSON.stringify(_.size)}`),_.size.width=i*(_.widthInColumns??1)+mi*((_.widthInColumns??1)-1),_.size.height=a,_.size.x=0,_.size.y=0,ae.debug(`abc95 updating size of ${t.id} children child:${_.id} maxWidth:${i} maxHeight:${a}`));for(const _ of t.children)US(_,e,i,a);const x=t.columns??-1;let b=0;for(const _ of t.children)b+=_.widthInColumns??1;let w=t.children.length;x>0&&x0?Math.min(t.children.length,x):t.children.length;if(_>0){const L=(S-_*mi-mi)/_;ae.debug("abc95 (growing to fit) width",t.id,S,(f=t.size)==null?void 0:f.width,L);for(const O of t.children)O.size&&(O.size.width=L)}}t.size={width:S,height:C,x:0,y:0}}ae.debug("setBlockSizes abc94 (done)",t.id,(p=t==null?void 0:t.size)==null?void 0:p.x,(g=t==null?void 0:t.size)==null?void 0:g.width,(m=t==null?void 0:t.size)==null?void 0:m.y,(y=t==null?void 0:t.size)==null?void 0:y.height)}T(US,"setBlockSizes");function fP(t,e){var n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b;ae.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${(n=t==null?void 0:t.size)==null?void 0:n.x} y: ${(i=t==null?void 0:t.size)==null?void 0:i.y} width: ${(a=t==null?void 0:t.size)==null?void 0:a.width}`);const r=t.columns??-1;if(ae.debug("layoutBlocks columns abc95",t.id,"=>",r,t),t.children&&t.children.length>0){const w=((o=(s=t==null?void 0:t.children[0])==null?void 0:s.size)==null?void 0:o.width)??0,k=t.children.length*w+(t.children.length-1)*mi;ae.debug("widthOfChildren 88",k,"posX");const S=new Map;{let M=0;for(const z of t.children){if(!z.size)continue;const{py:F}=dP(r,M),A=S.get(F)??0;z.size.height>A&&S.set(F,z.size.height);let R=(z==null?void 0:z.widthInColumns)??1;r>0&&(R=Math.min(R,r-M%r)),M+=R}}const C=new Map;{let M=0;const z=[...S.keys()].sort((F,A)=>F-A);for(const F of z)C.set(F,M),M+=(S.get(F)??0)+mi}let _=0;ae.debug("abc91 block?.size?.x",t.id,(l=t==null?void 0:t.size)==null?void 0:l.x);let L=(u=t==null?void 0:t.size)!=null&&u.x?((h=t==null?void 0:t.size)==null?void 0:h.x)+(-((d=t==null?void 0:t.size)==null?void 0:d.width)/2||0):-mi,O=0;for(const M of t.children){const z=t;if(!M.size)continue;const{width:F,height:A}=M.size,{px:R,py:N}=dP(r,_);if(N!=O&&(O=N,L=(f=t==null?void 0:t.size)!=null&&f.x?((p=t==null?void 0:t.size)==null?void 0:p.x)+(-((g=t==null?void 0:t.size)==null?void 0:g.width)/2||0):-mi,ae.debug("New row in layout for block",t.id," and child ",M.id,O)),ae.debug(`abc89 layout blocks (child) id: ${M.id} Pos: ${_} (px, py) ${R},${N} (${(m=z==null?void 0:z.size)==null?void 0:m.x},${(y=z==null?void 0:z.size)==null?void 0:y.y}) parent: ${z.id} width: ${F}${mi}`),z.size){const I=F/2;M.size.x=L+mi+I,ae.debug(`abc91 layout blocks (calc) px, pyid:${M.id} startingPos=X${L} new startingPosX${M.size.x} ${I} padding=${mi} width=${F} halfWidth=${I} => x:${M.size.x} y:${M.size.y} ${M.widthInColumns} (width * (child?.w || 1)) / 2 ${F*((M==null?void 0:M.widthInColumns)??1)/2}`),L=M.size.x+I;const $=C.get(N)??0,B=S.get(N)??A;M.size.y=z.size.y-z.size.height/2+$+B/2+mi,ae.debug(`abc88 layout blocks (calc) px, pyid:${M.id}startingPosX${L}${mi}${I}=>x:${M.size.x}y:${M.size.y}${M.widthInColumns}(width * (child?.w || 1)) / 2${F*((M==null?void 0:M.widthInColumns)??1)/2}`)}M.children&&fP(M);let D=(M==null?void 0:M.widthInColumns)??1;r>0&&(D=Math.min(D,r-_%r)),_+=D,ae.debug("abc88 columnsPos",M,_)}}ae.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(v=t==null?void 0:t.size)==null?void 0:v.x} y: ${(x=t==null?void 0:t.size)==null?void 0:x.y} width: ${(b=t==null?void 0:t.size)==null?void 0:b.width}`)}T(fP,"layoutBlocks");function pP(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){const{x:a,y:s,width:o,height:l}=t.size;a-o/2n&&(n=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=pP(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}T(pP,"findBounds");function J1e(t){const e=t.getBlock("root");if(!e)return;US(e,t,0,0),fP(e),ae.debug("getBlocks",JSON.stringify(e,null,2));const{minX:r,minY:n,maxX:i,maxY:a}=pP(e),s=a-n,o=i-r;return{x:r,y:n,width:o,height:s}}T(J1e,"layout");var gpt=T(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Pe(),o=on(s);return await Wa(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),rl=gpt,mpt=T((t,e,r,n,i)=>{e.arrowTypeStart&&eye(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&eye(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),ypt={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},eye=T((t,e,r,n,i,a)=>{const s=ypt[r];if(!s){ae.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)},"addEdgeMarker"),gP={},Oa={},vpt=T(async(t,e)=>{const r=Pe(),n=on(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),s=e.labelType==="markdown",o=await Wa(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:s,isNode:!1,markdown:s,width:s?void 0:Number.POSITIVE_INFINITY},r);a.node().appendChild(o);let l=o.getBBox(),u=l;if(n){const d=o.children[0],f=pt(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=pt(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",yl(u,n)),gP[e.id]=i,e.width=l.width,e.height=l.height;let h;if(e.startLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await rl(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=pt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",yl(g,n)),Oa[e.id]||(Oa[e.id]={}),Oa[e.id].startLeft=d,sw(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await rl(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=pt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",yl(g,n)),Oa[e.id]||(Oa[e.id]={}),Oa[e.id].startRight=d,sw(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await rl(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=pt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",yl(g,n)),Oa[e.id]||(Oa[e.id]={}),Oa[e.id].endLeft=d,sw(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await rl(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=pt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",yl(g,n)),Oa[e.id]||(Oa[e.id]={}),Oa[e.id].endRight=d,sw(h,e.endLabelRight)}return o},"insertEdgeLabel");function sw(t,e){on(Pe())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}T(sw,"setTerminalWidth");var bpt=T((t,e)=>{ae.debug("Moving label abc88 ",t.id,t.label,gP[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Pe(),{subGraphTitleTotalMargin:i}=Y2(n);if(t.label){const a=gP[t.id];let s=t.x,o=t.y;if(r){const l=Lr.calcLabelPosition(r);ae.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=Oa[t.id].startLeft;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=Oa[t.id].startRight;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=Oa[t.id].endLeft;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=Oa[t.id].endRight;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),xpt=T((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),Tpt=T((t,e,r)=>{ae.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(e)} insidePoint : ${JSON.stringify(r)} - node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{ae.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!o0t(e,a)&&!i){const s=l0t(e,n,a);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)||r.push(s),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),c0t=x(function(t,e,r,n,i,a,s){let o=r.points;ae.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=a.node(e.v);var h=a.node(e.w);h!=null&&h.intersect&&(u!=null&&u.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(ae.debug("to cluster abc88",n[r.toCluster]),o=K1e(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(ae.debug("from cluster abc88",n[r.fromCluster]),o=K1e(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(w=>!Number.isNaN(w.y));let f=N2;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=Aq(r),m=M2().x(p).y(g).curve(f);let y;switch(r.thickness){case"normal":y="edge-thickness-normal";break;case"thick":y="edge-thickness-thick";break;case"invisible":y="edge-thickness-thick";break;default:y=""}switch(r.pattern){case"solid":y+=" edge-pattern-solid";break;case"dotted":y+=" edge-pattern-dotted";break;case"dashed":y+=" edge-pattern-dashed";break}const v=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+y+(r.classes?" "+r.classes:"")).attr("style",r.style);let T="";(Pe().flowchart.arrowMarkerAbsolute||Pe().state.arrowMarkerAbsolute)&&(T=Aw(!0)),n0t(v,r,T,s,i);let b={};return l&&(b.updatedPath=o),b.originalPath=r.points,b},"insertEdge"),u0t=x(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),h0t=x((t,e,r,n)=>{const i=u0t(t),a=2,s=e.height+2*r.padding,o=s/a,l=n??e.width+2*o+r.padding,u=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:o,y:0},{x:l/2,y:2*u},{x:l-o,y:0},{x:l,y:0},{x:l,y:-s/3},{x:l+2*u,y:-s/2},{x:l,y:-2*s/3},{x:l,y:-s},{x:l-o,y:-s},{x:l/2,y:-s-2*u},{x:o,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*u,y:-s/2},{x:0,y:-s/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:o,y:0},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:o,y:-s},{x:0,y:-s/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:o,y:-s},{x:l-o,y:-s},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-o},{x:l,y:-s+o},{x:0,y:-s}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-o},{x:0,y:-s+o},{x:l,y:-s}]:i.has("right")&&i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-o},{x:0,y:-s}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-s}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-o},{x:l,y:-s}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-s}]:i.has("right")?[{x:o,y:-u},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s+u}]:i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")?[{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function j1e(t,e){return t.intersect(e)}x(j1e,"intersectNode");var d0t=j1e;function Z1e(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}x(hP,"sameSign");var p0t=eye,g0t=tye;function tye(t,e,r){var n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){s=Math.min(s,g.x),o=Math.min(o,g.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-s,u=i-t.height/2-o,h=0;h1&&a.sort(function(g,m){var y=g.x-r.x,v=g.y-r.y,T=Math.sqrt(y*y+v*v),b=m.x-r.x,w=m.y-r.y,k=Math.sqrt(b*b+w*w);return T{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),y0t=m0t,Yn={node:d0t,circle:f0t,ellipse:Q1e,polygon:g0t,rect:y0t},sa=x(async(t,e,r,n)=>{const i=Pe();let a;const s=e.useHtmlLabels||on(i);r?a=r:a="node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let u;e.labelText===void 0?u="":u=typeof e.labelText=="string"?e.labelText:e.labelText[0];let h;e.labelType==="markdown"?h=Wa(l,qr(Tc(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await rl(l,qr(Tc(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(on(i)){const p=h.children[0],g=pt(h);await p_(p,u),d=p.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return s?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:f,label:l}},"labelHelper"),oi=x((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function nl(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x(nl,"insertPolygonShape");var v0t=x(async(t,e)=>{e.useHtmlLabels||on(Pe())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await sa(t,e,"node "+e.classes,!0);ae.info("Classes = ",e.classes);const s=n.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),oi(e,s),e.intersect=function(o){return Yn.rect(e,o)},n},"note"),b0t=v0t,rye=x(t=>t?" "+t:"","formatClass"),ro=x((t,e)=>`${e||"node default"}${rye(t.classes)} ${rye(t.class)}`,"getClassesFromNode"),nye=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=i+a,o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];ae.info("Question main (Circle)");const l=nl(r,s,s,o);return l.attr("style",e.style),oi(e,l),e.intersect=function(u){return ae.warn("Intersect called"),Yn.polygon(e,o,u)},r},"question"),x0t=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return Yn.circle(e,14,s)},r},"choice"),T0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=4,a=e.positioned?e.height:n.height+e.padding,s=a/i,o=e.positioned?e.width:n.width+2*s+e.padding,l=[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],u=nl(r,o,a,l);return u.attr("style",e.style),oi(e,u),e.intersect=function(h){return Yn.polygon(e,l,h)},r},"hexagon"),w0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,void 0,!0),i=2,a=n.height+2*e.padding,s=a/i,o=n.width+2*s+e.padding,u=e.positioned&&(e.widthInColumns??1)>1&&e.width>o?e.width:o,h=h0t(e.directions,n,e,u),d=nl(r,u,a,h);return d.attr("style",e.style),oi(e,d),e.intersect=function(f){return Yn.polygon(e,h,f)},r},"block_arrow"),C0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return nl(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return Yn.polygon(e,s,l)},r},"rect_left_inv_arrow"),k0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"lean_right"),E0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"lean_left"),S0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"trapezoid"),A0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"inv_trapezoid"),_0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"rect_right_inv_arrow"),R0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=i/2,s=a/(2.5+i/50),o=n.height+s+e.padding,l="M 0,"+s+" a "+a+","+s+" 0,0,0 "+i+" 0 a "+a+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+a+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,u=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return oi(e,u),e.intersect=function(h){const d=Yn.rect(e,h),f=d.x-e.x;if(a!=0&&(Math.abs(f)e.height/2-s)){let p=s*s*(1-f*f/(a*a));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),L0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await sa(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(VS(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{ae.warn(`Unknown node property ${d}`)})}return oi(e,a),e.intersect=function(h){return Yn.rect(e,h)},r},"rect"),I0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await sa(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(VS(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{ae.warn(`Unknown node property ${d}`)})}return oi(e,a),e.intersect=function(h){return Yn.rect(e,h)},r},"composite"),D0t=x(async(t,e)=>{const{shapeSvg:r}=await sa(t,e,"label",!0);ae.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,a=0;if(n.attr("width",i).attr("height",a),r.attr("class","label edgeLabel"),e.props){const s=new Set(Object.keys(e.props));e.props.borders&&(VS(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{ae.warn(`Unknown node property ${o}`)})}return oi(e,n),e.intersect=function(s){return Yn.rect(e,s)},r},"labelRect");function VS(t,e,r,n){const i=[],a=x(o=>{i.push(o,0)},"addBorder"),s=x(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(ae.debug("add top border"),a(r)):s(r),e.includes("r")?(ae.debug("add right border"),a(n)):s(n),e.includes("b")?(ae.debug("add bottom border"),a(r)):s(r),e.includes("l")?(ae.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}x(VS,"applyNodePropertyBorders");var M0t=x(async(t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof o=="object"?l=o[0]:l=o,ae.info("Label text abc79",l,o,typeof o=="object");const u=await rl(s,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(on(Pe())){const m=u.children[0],y=pt(u);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}ae.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await rl(s,d.join?d.join("
"):d,e.labelStyle,!0,!0);if(on(Pe())){const m=p.children[0],y=pt(p);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}const g=e.padding/2;return pt(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),pt(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return oi(e,s),e.intersect=function(o){return Yn.rect(e,o)},r},"stadium"),O0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await sa(t,e,ro(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),ae.info("Circle main"),oi(e,a),e.intersect=function(s){return ae.info("Circle intersect",e,n.width/2+i,s),Yn.circle(e,n.width/2+i,s)},r},"circle"),$0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await sa(t,e,ro(e,void 0),!0),a=5,s=r.insert("g",":first-child"),o=s.insert("circle"),l=s.insert("circle");return s.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+a).attr("width",n.width+e.padding+a*2).attr("height",n.height+e.padding+a*2),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),ae.info("DoubleCircle main"),oi(e,o),e.intersect=function(u){return ae.info("DoubleCircle intersect",e,n.width/2+i+a,u),Yn.circle(e,n.width/2+i+a,u)},r},"doublecircle"),P0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"subroutine"),B0t=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),oi(e,n),e.intersect=function(i){return Yn.circle(e,7,i)},r},"start"),iye=x((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;r==="LR"&&(i=10,a=70);const s=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return oi(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return Yn.rect(e,o)},n},"forkJoin"),F0t=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),oi(e,i),e.intersect=function(a){return Yn.circle(e,7,a)},r},"end"),z0t=x(async(t,e)=>{var _;const r=e.padding/2,n=4,i=8;let a;e.classes?a="node "+e.classes:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),o=s.insert("rect",":first-child"),l=s.insert("line"),u=s.insert("line");let h=0,d=n;const f=s.insert("g").attr("class","label");let p=0;const g=(_=e.classData.annotations)==null?void 0:_[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",y=await rl(f,m,e.labelStyle,!0,!0);let v=y.getBBox();if(on(Pe())){const L=y.children[0],O=pt(y);v=L.getBoundingClientRect(),O.attr("width",v.width),O.attr("height",v.height)}e.classData.annotations[0]&&(d+=v.height+n,h+=v.width);let T=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(on(Pe())?T+="<"+e.classData.type+">":T+="<"+e.classData.type+">");const b=await rl(f,T,e.labelStyle,!0,!0);pt(b).attr("class","classTitle");let w=b.getBBox();if(on(Pe())){const L=b.children[0],O=pt(b);w=L.getBoundingClientRect(),O.attr("width",w.width),O.attr("height",w.height)}d+=w.height+n,w.width>h&&(h=w.width);const k=[];e.classData.members.forEach(async L=>{const O=L.getDisplayDetails();let M=O.displayText;on(Pe())&&(M=M.replace(//g,">"));const z=await rl(f,M,O.cssStyle?O.cssStyle:e.labelStyle,!0,!0);let F=z.getBBox();if(on(Pe())){const S=z.children[0],R=pt(z);F=S.getBoundingClientRect(),R.attr("width",F.width),R.attr("height",F.height)}F.width>h&&(h=F.width),d+=F.height+n,k.push(z)}),d+=i;const A=[];if(e.classData.methods.forEach(async L=>{const O=L.getDisplayDetails();let M=O.displayText;on(Pe())&&(M=M.replace(//g,">"));const z=await rl(f,M,O.cssStyle?O.cssStyle:e.labelStyle,!0,!0);let F=z.getBBox();if(on(Pe())){const S=z.children[0],R=pt(z);F=S.getBoundingClientRect(),R.attr("width",F.width),R.attr("height",F.height)}F.width>h&&(h=F.width),d+=F.height+n,A.push(z)}),d+=i,g){let L=(h-v.width)/2;pt(y).attr("transform","translate( "+(-1*h/2+L)+", "+-1*d/2+")"),p=v.height+n}let C=(h-w.width)/2;return pt(b).attr("transform","translate( "+(-1*h/2+C)+", "+(-1*d/2+p)+")"),p+=w.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,k.forEach(L=>{pt(L).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const O=L==null?void 0:L.getBBox();p+=((O==null?void 0:O.height)??0)+n}),p+=i,u.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,A.forEach(L=>{pt(L).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const O=L==null?void 0:L.getBBox();p+=((O==null?void 0:O.height)??0)+n}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(d/2)-r).attr("width",h+e.padding).attr("height",d+e.padding),oi(e,o),e.intersect=function(L){return Yn.rect(e,L)},s},"class_box"),aye={rhombus:nye,composite:I0t,question:nye,rect:L0t,labelRect:D0t,rectWithTitle:M0t,choice:x0t,circle:O0t,doublecircle:$0t,stadium:N0t,hexagon:T0t,block_arrow:w0t,rect_left_inv_arrow:C0t,lean_right:k0t,lean_left:E0t,trapezoid:S0t,inv_trapezoid:A0t,rect_right_inv_arrow:_0t,cylinder:R0t,start:B0t,end:F0t,note:b0t,subroutine:P0t,fork:iye,join:iye,class_box:z0t},WS={},sye=x(async(t,e,r)=>{let n,i;if(e.link){let a;Pe().securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await aye[e.shape](n,e,r)}else i=await aye[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),WS[e.id]=n,e.haveCallback&&WS[e.id].attr("class",WS[e.id].attr("class")+" clickable"),n},"insertNode"),G0t=x(t=>{const e=WS[t.id];ae.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode");function dP(t,e,r=!1){var p,g,m;const n=t;let i="default";(((p=n==null?void 0:n.classes)==null?void 0:p.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";let a=0,s="",o;switch(n.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",o=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}const l=d_((n==null?void 0:n.styles)??[]),u=n.label,h=n.size??{width:0,height:0,x:0,y:0},d=e.getDiagramId();return{labelStyle:l.labelStyle,shape:s,labelText:u,rx:a,ry:a,class:i,style:l.style,id:n.id,domId:d?`${d}-${n.id}`:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:o??((m=(g=lr())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}x(dP,"getNodeFromBlock");async function oye(t,e,r){const n=dP(e,r,!1);if(n.type==="group")return;const i=lr(),a=await sye(t,n,{config:i}),s=a.node().getBBox(),o=r.getBlock(n.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},r.setBlock(o),a.remove()}x(oye,"calculateBlockSize");async function lye(t,e,r){const n=dP(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=lr();await sye(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,G0t(n)}}x(lye,"insertBlockPositioned");async function US(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await US(t,i.children,r,n)}x(US,"performOperations");async function cye(t,e,r){await US(t,e,r,oye)}x(cye,"calculateBlockSizes");async function uye(t,e,r){await US(t,e,r,lye)}x(uye,"insertBlocks");async function hye(t,e,r,n,i){const a=new Ts({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const o=n.getBlock(s.start),l=n.getBlock(s.end);if(o!=null&&o.size&&(l!=null&&l.size)){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}],f=i?`${i}-${s.id}`:s.id,p=s.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=s.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;c0t(t,{v:s.start,w:s.end,name:f},{...s,id:f,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m},void 0,"block",a,i),s.label&&(await a0t(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m}),s0t({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}x(hye,"insertEdges");var q0t=x(function(t,e){return e.db.getClasses()},"getClasses"),V0t=x(async function(t,e,r,n){const{securityLevel:i,block:a}=lr(),s=n.db;s.setDiagramId(e);let o;i==="sandbox"&&(o=pt("#i"+e));const l=pt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):pt(`[id="${e}"]`);e0t(u,["point","circle","cross"],n.type,e);const d=s.getBlocks(),f=s.getBlocksFlat(),p=s.getEdges(),g=u.insert("g").attr("class","block");await cye(g,d,s);const m=Y1e(s);if(await uye(g,d,s),await hye(g,p,f,s,e),m){const y=m,v=Math.max(1,Math.round(.125*(y.width/y.height))),T=y.height+v+10,b=y.width+10,{useMaxWidth:w}=a;wi(u,T,b,!!w),ae.debug("Here Bounds",m,y),u.attr("viewBox",`${y.x-5} ${y.y-5} ${y.width+10} ${y.height+10}`)}},"draw"),W0t={draw:V0t,getClasses:q0t},U0t={parser:bft,db:zft,renderer:W0t,styles:qft};const H0t=Object.freeze(Object.defineProperty({__proto__:null,diagram:U0t},Symbol.toStringTag,{value:"Module"}));var sc=new wI(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),Y0t=x(()=>{sc.reset(),In()},"clear"),X0t=x(()=>sc.records.stack[0],"getRoot"),K0t=x(()=>sc.records.cnt,"getCount"),j0t=Fr.treeView,Z0t=x(()=>ti(j0t,lr().treeView),"getConfig"),Q0t=x((t,e)=>{for(;t<=sc.records.stack[sc.records.stack.length-1].level;)sc.records.stack.pop();const r={id:sc.records.cnt++,level:t,name:e,children:[]};sc.records.stack[sc.records.stack.length-1].children.push(r),sc.records.stack.push(r)},"addNode"),J0t={clear:Y0t,addNode:Q0t,getRoot:X0t,getCount:K0t,getConfig:Z0t,getAccTitle:Fn,getAccDescription:Gn,getDiagramTitle:Mn,setAccDescription:zn,setAccTitle:Dn,setDiagramTitle:qn},fP=J0t,ept=x(t=>{zl(t,fP),t.nodes.map(e=>fP.addNode(e.indent?parseInt(e.indent):0,e.name))},"populate"),tpt={parse:x(async t=>{const e=await Qo("treeView",t);ae.debug(e),ept(e)},"parse")},rpt=x((t,e,r,n,i)=>{const a=n.append("text").text(r.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:s,width:o}=a.node().getBBox(),l=s+i.paddingY*2,u=o+i.paddingX*2;a.attr("x",t+i.paddingX),a.attr("y",e+l/2),r.BBox={x:t,y:e,width:u,height:l}},"positionLabel"),dye=x((t,e,r,n,i,a)=>t.append("line").attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),npt=x((t,e,r)=>{let n=0,i=0;const a=x((o,l,u,h)=>{const d=h*(u.rowIndent+u.paddingX);rpt(d,n,l,o,u);const{height:f,width:p}=l.BBox;dye(o,d-u.rowIndent,n+f/2,d,n+f/2,u.lineThickness),i=Math.max(i,d+p),n+=f},"drawNode"),s=x((o,l=0)=>{a(t,o,r,l),o.children.forEach(f=>{s(f,l+1)});const{x:u,y:h,height:d}=o.BBox;if(o.children.length){const{y:f,height:p}=o.children[o.children.length-1].BBox;dye(t,u+r.paddingX,h+d,u+r.paddingX,f+p/2+r.lineThickness/2,r.lineThickness)}},"processNode");return s(e),{totalHeight:n,totalWidth:i}},"drawTree"),ipt=x((t,e,r,n)=>{ae.debug(`Rendering treeView diagram -`+t);const i=n.db,a=i.getRoot(),s=i.getConfig(),o=ys(e),l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=npt(l,a,s);o.attr("viewBox",`-${s.lineThickness/2} 0 ${h} ${u}`),wi(o,u,h,s.useMaxWidth)},"draw"),apt={draw:ipt},spt=apt,opt={labelFontSize:"16px",labelColor:"black",lineColor:"black"},lpt=x(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n}=ti(opt,t);return` + node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{ae.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!xpt(e,a)&&!i){const s=Tpt(e,n,a);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)||r.push(s),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),wpt=T(function(t,e,r,n,i,a,s){let o=r.points;ae.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=a.node(e.v);var h=a.node(e.w);h!=null&&h.intersect&&(u!=null&&u.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(ae.debug("to cluster abc88",n[r.toCluster]),o=tye(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(ae.debug("from cluster abc88",n[r.fromCluster]),o=tye(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(w=>!Number.isNaN(w.y));let f=O2;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=Dq(r),m=N2().x(p).y(g).curve(f);let y;switch(r.thickness){case"normal":y="edge-thickness-normal";break;case"thick":y="edge-thickness-thick";break;case"invisible":y="edge-thickness-thick";break;default:y=""}switch(r.pattern){case"solid":y+=" edge-pattern-solid";break;case"dotted":y+=" edge-pattern-dotted";break;case"dashed":y+=" edge-pattern-dashed";break}const v=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+y+(r.classes?" "+r.classes:"")).attr("style",r.style);let x="";(Pe().flowchart.arrowMarkerAbsolute||Pe().state.arrowMarkerAbsolute)&&(x=Rw(!0)),mpt(v,r,x,s,i);let b={};return l&&(b.updatedPath=o),b.originalPath=r.points,b},"insertEdge"),Cpt=T(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),kpt=T((t,e,r,n)=>{const i=Cpt(t),a=2,s=e.height+2*r.padding,o=s/a,l=n??e.width+2*o+r.padding,u=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:o,y:0},{x:l/2,y:2*u},{x:l-o,y:0},{x:l,y:0},{x:l,y:-s/3},{x:l+2*u,y:-s/2},{x:l,y:-2*s/3},{x:l,y:-s},{x:l-o,y:-s},{x:l/2,y:-s-2*u},{x:o,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*u,y:-s/2},{x:0,y:-s/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:o,y:0},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:o,y:-s},{x:0,y:-s/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:o,y:-s},{x:l-o,y:-s},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-o},{x:l,y:-s+o},{x:0,y:-s}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-o},{x:0,y:-s+o},{x:l,y:-s}]:i.has("right")&&i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-o},{x:0,y:-s}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-s}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-o},{x:l,y:-s}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-s}]:i.has("right")?[{x:o,y:-u},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s+u}]:i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")?[{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function rye(t,e){return t.intersect(e)}T(rye,"intersectNode");var Ept=rye;function nye(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}T(mP,"sameSign");var Apt=sye,_pt=oye;function oye(t,e,r){var n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){s=Math.min(s,g.x),o=Math.min(o,g.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-s,u=i-t.height/2-o,h=0;h1&&a.sort(function(g,m){var y=g.x-r.x,v=g.y-r.y,x=Math.sqrt(y*y+v*v),b=m.x-r.x,w=m.y-r.y,k=Math.sqrt(b*b+w*w);return x{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),Lpt=Rpt,Yn={node:Ept,circle:Spt,ellipse:iye,polygon:_pt,rect:Lpt},sa=T(async(t,e,r,n)=>{const i=Pe();let a;const s=e.useHtmlLabels||on(i);r?a=r:a="node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let u;e.labelText===void 0?u="":u=typeof e.labelText=="string"?e.labelText:e.labelText[0];let h;e.labelType==="markdown"?h=Wa(l,qr(Tc(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await rl(l,qr(Tc(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(on(i)){const p=h.children[0],g=pt(h);await y_(p,u),d=p.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return s?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:f,label:l}},"labelHelper"),oi=T((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function nl(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}T(nl,"insertPolygonShape");var Ipt=T(async(t,e)=>{e.useHtmlLabels||on(Pe())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await sa(t,e,"node "+e.classes,!0);ae.info("Classes = ",e.classes);const s=n.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),oi(e,s),e.intersect=function(o){return Yn.rect(e,o)},n},"note"),Dpt=Ipt,lye=T(t=>t?" "+t:"","formatClass"),ro=T((t,e)=>`${e||"node default"}${lye(t.classes)} ${lye(t.class)}`,"getClassesFromNode"),cye=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=i+a,o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];ae.info("Question main (Circle)");const l=nl(r,s,s,o);return l.attr("style",e.style),oi(e,l),e.intersect=function(u){return ae.warn("Intersect called"),Yn.polygon(e,o,u)},r},"question"),Mpt=T((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return Yn.circle(e,14,s)},r},"choice"),Npt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=4,a=e.positioned?e.height:n.height+e.padding,s=a/i,o=e.positioned?e.width:n.width+2*s+e.padding,l=[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],u=nl(r,o,a,l);return u.attr("style",e.style),oi(e,u),e.intersect=function(h){return Yn.polygon(e,l,h)},r},"hexagon"),Opt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,void 0,!0),i=2,a=n.height+2*e.padding,s=a/i,o=n.width+2*s+e.padding,u=e.positioned&&(e.widthInColumns??1)>1&&e.width>o?e.width:o,h=kpt(e.directions,n,e,u),d=nl(r,u,a,h);return d.attr("style",e.style),oi(e,d),e.intersect=function(f){return Yn.polygon(e,h,f)},r},"block_arrow"),$pt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return nl(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return Yn.polygon(e,s,l)},r},"rect_left_inv_arrow"),Ppt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"lean_right"),Bpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"lean_left"),Fpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"trapezoid"),zpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"inv_trapezoid"),Gpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"rect_right_inv_arrow"),qpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=i/2,s=a/(2.5+i/50),o=n.height+s+e.padding,l="M 0,"+s+" a "+a+","+s+" 0,0,0 "+i+" 0 a "+a+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+a+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,u=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return oi(e,u),e.intersect=function(h){const d=Yn.rect(e,h),f=d.x-e.x;if(a!=0&&(Math.abs(f)e.height/2-s)){let p=s*s*(1-f*f/(a*a));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),Vpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await sa(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(HS(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{ae.warn(`Unknown node property ${d}`)})}return oi(e,a),e.intersect=function(h){return Yn.rect(e,h)},r},"rect"),Wpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await sa(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(HS(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{ae.warn(`Unknown node property ${d}`)})}return oi(e,a),e.intersect=function(h){return Yn.rect(e,h)},r},"composite"),Upt=T(async(t,e)=>{const{shapeSvg:r}=await sa(t,e,"label",!0);ae.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,a=0;if(n.attr("width",i).attr("height",a),r.attr("class","label edgeLabel"),e.props){const s=new Set(Object.keys(e.props));e.props.borders&&(HS(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{ae.warn(`Unknown node property ${o}`)})}return oi(e,n),e.intersect=function(s){return Yn.rect(e,s)},r},"labelRect");function HS(t,e,r,n){const i=[],a=T(o=>{i.push(o,0)},"addBorder"),s=T(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(ae.debug("add top border"),a(r)):s(r),e.includes("r")?(ae.debug("add right border"),a(n)):s(n),e.includes("b")?(ae.debug("add bottom border"),a(r)):s(r),e.includes("l")?(ae.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}T(HS,"applyNodePropertyBorders");var Hpt=T(async(t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof o=="object"?l=o[0]:l=o,ae.info("Label text abc79",l,o,typeof o=="object");const u=await rl(s,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(on(Pe())){const m=u.children[0],y=pt(u);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}ae.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await rl(s,d.join?d.join("
"):d,e.labelStyle,!0,!0);if(on(Pe())){const m=p.children[0],y=pt(p);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}const g=e.padding/2;return pt(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),pt(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return oi(e,s),e.intersect=function(o){return Yn.rect(e,o)},r},"stadium"),Xpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await sa(t,e,ro(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),ae.info("Circle main"),oi(e,a),e.intersect=function(s){return ae.info("Circle intersect",e,n.width/2+i,s),Yn.circle(e,n.width/2+i,s)},r},"circle"),Kpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await sa(t,e,ro(e,void 0),!0),a=5,s=r.insert("g",":first-child"),o=s.insert("circle"),l=s.insert("circle");return s.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+a).attr("width",n.width+e.padding+a*2).attr("height",n.height+e.padding+a*2),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),ae.info("DoubleCircle main"),oi(e,o),e.intersect=function(u){return ae.info("DoubleCircle intersect",e,n.width/2+i+a,u),Yn.circle(e,n.width/2+i+a,u)},r},"doublecircle"),jpt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"subroutine"),Zpt=T((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),oi(e,n),e.intersect=function(i){return Yn.circle(e,7,i)},r},"start"),uye=T((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;r==="LR"&&(i=10,a=70);const s=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return oi(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return Yn.rect(e,o)},n},"forkJoin"),Qpt=T((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),oi(e,i),e.intersect=function(a){return Yn.circle(e,7,a)},r},"end"),Jpt=T(async(t,e)=>{var _;const r=e.padding/2,n=4,i=8;let a;e.classes?a="node "+e.classes:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),o=s.insert("rect",":first-child"),l=s.insert("line"),u=s.insert("line");let h=0,d=n;const f=s.insert("g").attr("class","label");let p=0;const g=(_=e.classData.annotations)==null?void 0:_[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",y=await rl(f,m,e.labelStyle,!0,!0);let v=y.getBBox();if(on(Pe())){const L=y.children[0],O=pt(y);v=L.getBoundingClientRect(),O.attr("width",v.width),O.attr("height",v.height)}e.classData.annotations[0]&&(d+=v.height+n,h+=v.width);let x=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(on(Pe())?x+="<"+e.classData.type+">":x+="<"+e.classData.type+">");const b=await rl(f,x,e.labelStyle,!0,!0);pt(b).attr("class","classTitle");let w=b.getBBox();if(on(Pe())){const L=b.children[0],O=pt(b);w=L.getBoundingClientRect(),O.attr("width",w.width),O.attr("height",w.height)}d+=w.height+n,w.width>h&&(h=w.width);const k=[];e.classData.members.forEach(async L=>{const O=L.getDisplayDetails();let M=O.displayText;on(Pe())&&(M=M.replace(//g,">"));const z=await rl(f,M,O.cssStyle?O.cssStyle:e.labelStyle,!0,!0);let F=z.getBBox();if(on(Pe())){const A=z.children[0],R=pt(z);F=A.getBoundingClientRect(),R.attr("width",F.width),R.attr("height",F.height)}F.width>h&&(h=F.width),d+=F.height+n,k.push(z)}),d+=i;const S=[];if(e.classData.methods.forEach(async L=>{const O=L.getDisplayDetails();let M=O.displayText;on(Pe())&&(M=M.replace(//g,">"));const z=await rl(f,M,O.cssStyle?O.cssStyle:e.labelStyle,!0,!0);let F=z.getBBox();if(on(Pe())){const A=z.children[0],R=pt(z);F=A.getBoundingClientRect(),R.attr("width",F.width),R.attr("height",F.height)}F.width>h&&(h=F.width),d+=F.height+n,S.push(z)}),d+=i,g){let L=(h-v.width)/2;pt(y).attr("transform","translate( "+(-1*h/2+L)+", "+-1*d/2+")"),p=v.height+n}let C=(h-w.width)/2;return pt(b).attr("transform","translate( "+(-1*h/2+C)+", "+(-1*d/2+p)+")"),p+=w.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,k.forEach(L=>{pt(L).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const O=L==null?void 0:L.getBBox();p+=((O==null?void 0:O.height)??0)+n}),p+=i,u.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,S.forEach(L=>{pt(L).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const O=L==null?void 0:L.getBBox();p+=((O==null?void 0:O.height)??0)+n}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(d/2)-r).attr("width",h+e.padding).attr("height",d+e.padding),oi(e,o),e.intersect=function(L){return Yn.rect(e,L)},s},"class_box"),hye={rhombus:cye,composite:Wpt,question:cye,rect:Vpt,labelRect:Upt,rectWithTitle:Hpt,choice:Mpt,circle:Xpt,doublecircle:Kpt,stadium:Ypt,hexagon:Npt,block_arrow:Opt,rect_left_inv_arrow:$pt,lean_right:Ppt,lean_left:Bpt,trapezoid:Fpt,inv_trapezoid:zpt,rect_right_inv_arrow:Gpt,cylinder:qpt,start:Zpt,end:Qpt,note:Dpt,subroutine:jpt,fork:uye,join:uye,class_box:Jpt},YS={},dye=T(async(t,e,r)=>{let n,i;if(e.link){let a;Pe().securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await hye[e.shape](n,e,r)}else i=await hye[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),YS[e.id]=n,e.haveCallback&&YS[e.id].attr("class",YS[e.id].attr("class")+" clickable"),n},"insertNode"),e0t=T(t=>{const e=YS[t.id];ae.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode");function yP(t,e,r=!1){var p,g,m;const n=t;let i="default";(((p=n==null?void 0:n.classes)==null?void 0:p.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";let a=0,s="",o;switch(n.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",o=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}const l=g_((n==null?void 0:n.styles)??[]),u=n.label,h=n.size??{width:0,height:0,x:0,y:0},d=e.getDiagramId();return{labelStyle:l.labelStyle,shape:s,labelText:u,rx:a,ry:a,class:i,style:l.style,id:n.id,domId:d?`${d}-${n.id}`:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:o??((m=(g=lr())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}T(yP,"getNodeFromBlock");async function fye(t,e,r){const n=yP(e,r,!1);if(n.type==="group")return;const i=lr(),a=await dye(t,n,{config:i}),s=a.node().getBBox(),o=r.getBlock(n.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},r.setBlock(o),a.remove()}T(fye,"calculateBlockSize");async function pye(t,e,r){const n=yP(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=lr();await dye(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,e0t(n)}}T(pye,"insertBlockPositioned");async function XS(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await XS(t,i.children,r,n)}T(XS,"performOperations");async function gye(t,e,r){await XS(t,e,r,fye)}T(gye,"calculateBlockSizes");async function mye(t,e,r){await XS(t,e,r,pye)}T(mye,"insertBlocks");async function yye(t,e,r,n,i){const a=new Ts({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const o=n.getBlock(s.start),l=n.getBlock(s.end);if(o!=null&&o.size&&(l!=null&&l.size)){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}],f=i?`${i}-${s.id}`:s.id,p=s.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=s.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;wpt(t,{v:s.start,w:s.end,name:f},{...s,id:f,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m},void 0,"block",a,i),s.label&&(await vpt(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m}),bpt({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}T(yye,"insertEdges");var t0t=T(function(t,e){return e.db.getClasses()},"getClasses"),r0t=T(async function(t,e,r,n){const{securityLevel:i,block:a}=lr(),s=n.db;s.setDiagramId(e);let o;i==="sandbox"&&(o=pt("#i"+e));const l=pt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):pt(`[id="${e}"]`);fpt(u,["point","circle","cross"],n.type,e);const d=s.getBlocks(),f=s.getBlocksFlat(),p=s.getEdges(),g=u.insert("g").attr("class","block");await gye(g,d,s);const m=J1e(s);if(await mye(g,d,s),await yye(g,p,f,s,e),m){const y=m,v=Math.max(1,Math.round(.125*(y.width/y.height))),x=y.height+v+10,b=y.width+10,{useMaxWidth:w}=a;wi(u,x,b,!!w),ae.debug("Here Bounds",m,y),u.attr("viewBox",`${y.x-5} ${y.y-5} ${y.width+10} ${y.height+10}`)}},"draw"),n0t={draw:r0t,getClasses:t0t},i0t={parser:Dft,db:Jft,renderer:n0t,styles:tpt};const a0t=Object.freeze(Object.defineProperty({__proto__:null,diagram:i0t},Symbol.toStringTag,{value:"Module"}));var sc=new AI(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),s0t=T(()=>{sc.reset(),In()},"clear"),o0t=T(()=>sc.records.stack[0],"getRoot"),l0t=T(()=>sc.records.cnt,"getCount"),c0t=Fr.treeView,u0t=T(()=>ti(c0t,lr().treeView),"getConfig"),h0t=T((t,e)=>{for(;t<=sc.records.stack[sc.records.stack.length-1].level;)sc.records.stack.pop();const r={id:sc.records.cnt++,level:t,name:e,children:[]};sc.records.stack[sc.records.stack.length-1].children.push(r),sc.records.stack.push(r)},"addNode"),d0t={clear:s0t,addNode:h0t,getRoot:o0t,getCount:l0t,getConfig:u0t,getAccTitle:Fn,getAccDescription:Gn,getDiagramTitle:Mn,setAccDescription:zn,setAccTitle:Dn,setDiagramTitle:qn},vP=d0t,f0t=T(t=>{zl(t,vP),t.nodes.map(e=>vP.addNode(e.indent?parseInt(e.indent):0,e.name))},"populate"),p0t={parse:T(async t=>{const e=await Qo("treeView",t);ae.debug(e),f0t(e)},"parse")},g0t=T((t,e,r,n,i)=>{const a=n.append("text").text(r.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:s,width:o}=a.node().getBBox(),l=s+i.paddingY*2,u=o+i.paddingX*2;a.attr("x",t+i.paddingX),a.attr("y",e+l/2),r.BBox={x:t,y:e,width:u,height:l}},"positionLabel"),vye=T((t,e,r,n,i,a)=>t.append("line").attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),m0t=T((t,e,r)=>{let n=0,i=0;const a=T((o,l,u,h)=>{const d=h*(u.rowIndent+u.paddingX);g0t(d,n,l,o,u);const{height:f,width:p}=l.BBox;vye(o,d-u.rowIndent,n+f/2,d,n+f/2,u.lineThickness),i=Math.max(i,d+p),n+=f},"drawNode"),s=T((o,l=0)=>{a(t,o,r,l),o.children.forEach(f=>{s(f,l+1)});const{x:u,y:h,height:d}=o.BBox;if(o.children.length){const{y:f,height:p}=o.children[o.children.length-1].BBox;vye(t,u+r.paddingX,h+d,u+r.paddingX,f+p/2+r.lineThickness/2,r.lineThickness)}},"processNode");return s(e),{totalHeight:n,totalWidth:i}},"drawTree"),y0t=T((t,e,r,n)=>{ae.debug(`Rendering treeView diagram +`+t);const i=n.db,a=i.getRoot(),s=i.getConfig(),o=ys(e),l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=m0t(l,a,s);o.attr("viewBox",`-${s.lineThickness/2} 0 ${h} ${u}`),wi(o,u,h,s.useMaxWidth)},"draw"),v0t={draw:y0t},b0t=v0t,x0t={labelFontSize:"16px",labelColor:"black",lineColor:"black"},T0t=T(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n}=ti(x0t,t);return` .treeView-node-label { font-size: ${e}; fill: ${r}; @@ -3140,7 +3140,7 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":ue="Parse error .treeView-node-line { stroke: ${n}; } - `},"styles"),cpt=lpt,upt={db:fP,renderer:spt,parser:tpt,styles:cpt};const hpt=Object.freeze(Object.defineProperty({__proto__:null,diagram:upt},Symbol.toStringTag,{value:"Module"}));var HS={exports:{}},YS={exports:{}},XS={exports:{}},dpt=XS.exports,fye;function fpt(){return fye||(fye=1,(function(t,e){(function(n,i){t.exports=i()})(dpt,function(){return(function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=28)})([(function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a}),(function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.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=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l}),(function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,y){m==null&&y==null&&(y=g),a.call(this,y),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(y.target==p){if(y.source!=m)throw"Incorrect edge source!";g.push(y)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(!(y.source==m||y.target==m))throw"Incorrect edge source and/or target";(y.target==p||y.source==p)&&g.push(y)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var y=this.child.getNodes(),v=0;vg?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,T){a.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,T){if(v==null&&T==null){var b=y;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}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(v.owner==T.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=T.owner?null:(w.source=v,w.target=T,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),T!=v&&T.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=v.edges.slice(),b,w=T.length,k=0;k-1&&_>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(C,1),b.target!=b.source&&b.target.edges.splice(_,1);var A=b.source.owner.getEdges().indexOf(b);if(A==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(A,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,T,b,w,k=this.getNodes(),A=k.length,C=0;CT&&(y=T),v>b&&(v=b)}return y==s.MAX_VALUE?null:(k[0].getParent().paddingLeft!=null?w=k[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,k,A,C,_,L,O=this.nodes,M=O.length,z=0;zk&&(v=k),TC&&(b=C),w<_&&(w=_)}var S=new d(v,b,T-v,w-b);v==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),O[0].getParent().paddingLeft!=null?L=O[0].getParent().paddingLeft:L=this.margin,this.left=S.x-L,this.right=S.x+S.width+L,this.top=S.y-L,this.bottom=S.y+S.height+L},g.calculateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,k,A,C,_,L=y.length,O=0;Ok&&(v=k),TC&&(b=C),w<_&&(w=_)}var z=new d(v,b,T-v,w-b);return z},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var y=0,v=this.nodes,T=v.length,b=0;b=this.nodes.length){var M=0;T.forEach(function(z){z.owner==y&&M++}),M==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=O,!1;if(df)return u[0]=g,u[1]=d,u[2]=_,u[3]=p,!1;if(hf?(u[0]=v,u[1]=T,S=!0):(u[0]=y,u[1]=m,S=!0):N===I&&(h>f?(u[0]=g,u[1]=m,S=!0):(u[0]=b,u[1]=T,S=!0)),-D===I?f>h?(u[2]=L,u[3]=O,R=!0):(u[2]=_,u[3]=C,R=!0):D===I&&(f>h?(u[2]=A,u[3]=C,R=!0):(u[2]=M,u[3]=O,R=!0)),S&&R)return!1;if(h>f?d>p?($=this.getCardinalDirection(N,I,4),B=this.getCardinalDirection(D,I,2)):($=this.getCardinalDirection(-N,I,3),B=this.getCardinalDirection(-D,I,1)):d>p?($=this.getCardinalDirection(-N,I,1),B=this.getCardinalDirection(-D,I,3)):($=this.getCardinalDirection(N,I,2),B=this.getCardinalDirection(D,I,4)),!S)switch($){case 1:G=m,P=h+-k/I,u[0]=P,u[1]=G;break;case 2:P=b,G=d+w*I,u[0]=P,u[1]=G;break;case 3:G=T,P=h+k/I,u[0]=P,u[1]=G;break;case 4:P=v,G=d+-w*I,u[0]=P,u[1]=G;break}if(!R)switch(B){case 1:Y=C,V=f+-F/I,u[2]=V,u[3]=Y;break;case 2:V=M,Y=p+z*I,u[2]=V,u[3]=Y;break;case 3:Y=O,V=f+F/I,u[2]=V,u[3]=Y;break;case 4:V=L,Y=p+-z*I,u[2]=V,u[3]=Y;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,T=h.y,b=void 0,w=void 0,k=void 0,A=void 0,C=void 0,_=void 0,L=void 0,O=void 0,M=void 0;return k=g-f,C=d-p,L=p*f-d*g,A=T-y,_=m-v,O=v*y-m*T,M=k*_-A*C,M===0?null:(b=(C*O-_*L)/M,w=(A*L-k*O)/M,new a(b,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var T=(-m+Math.sqrt(m*m-4*g*y))/(2*g),b=(-m-Math.sqrt(m*m-4*g*y))/(2*g),w=null;return T>=0&&T<=1?[T]:b>=0&&b<=1?[b]:w}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s}),(function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(k.push(C[0]);k.length>0&&y;){var _=k[0];k.splice(0,1),w.add(_);for(var L=_.getEdges(),b=0;b-1&&C.splice(F,1)}w=new Set,A=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,T=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var T=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(O,1);var M=A.getNeighborsList();M.forEach(function(S){if(v.indexOf(S)<0){var R=T.get(S),N=R-1;N==1&&_.push(S),T.set(S,N)}})}v=v.concat(_),(y.length==1||y.length==2)&&(b=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,T,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mk||w>k)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*T)):(k=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>k||w>k)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||k>=b[0].length)){for(var A=0;Ad}}]),u})();r.exports=l}),(function(r,n,i){function a(){}a.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var o=Math.min(this.m,this.n);this.s=(function(xt){for(var ht=[];xt-- >0;)ht.push(0);return ht})(Math.min(this.m+1,this.n)),this.U=(function(xt){var ht=function oe(At){if(At.length==0)return 0;for(var dt=[],ut=0;ut0;)ht.push(0);return ht})(this.n),u=(function(xt){for(var ht=[];xt-- >0;)ht.push(0);return ht})(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p=0;D--)if(this.s[D]!==0){for(var I=D+1;I=0;W--){if((function(xt,ht){return xt&&ht})(W0;){var fe=void 0,_e=void 0;for(fe=S-2;fe>=-1&&fe!==-1;fe--)if(Math.abs(l[fe])<=ue+ne*(Math.abs(this.s[fe])+Math.abs(this.s[fe+1]))){l[fe]=0;break}if(fe===S-2)_e=4;else{var Ae=void 0;for(Ae=S-1;Ae>=fe&&Ae!==fe;Ae--){var Ne=(Ae!==S?Math.abs(l[Ae]):0)+(Ae!==fe+1?Math.abs(l[Ae-1]):0);if(Math.abs(this.s[Ae])<=ue+ne*Ne){this.s[Ae]=0;break}}Ae===fe?_e=3:Ae===S-1?_e=1:(_e=2,fe=Ae)}switch(fe++,_e){case 1:{var me=l[S-2];l[S-2]=0;for(var ve=S-2;ve>=fe;ve--){var Ge=a.hypot(this.s[ve],me),Te=this.s[ve]/Ge,Ze=me/Ge;this.s[ve]=Ge,ve!==fe&&(me=-Ze*l[ve-1],l[ve-1]=Te*l[ve-1]);for(var ke=0;ke=this.s[fe+1]);){var Et=this.s[fe];if(this.s[fe]=this.s[fe+1],this.s[fe+1]=Et,feMath.abs(o)?(l=o/s,l=Math.abs(s)*Math.sqrt(1+l*l)):o!=0?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=a}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u{var n={45:((o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h}),806:((o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.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,o.exports=d}),767:((o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),880:((o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),578:((o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),765:((o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),y=u(902),v=u(551).FDLayoutConstants,T=u(551).LayoutConstants,b=u(551).Point,w=u(551).PointD,k=u(551).DimensionD,A=u(551).Layout,C=u(551).Integer,_=u(551).IGeometry,L=u(551).LGraph,O=u(551).Transform,M=u(551).LinkedList;function z(){h.call(this),this.toBeTiled={},this.constraints={}}z.prototype=Object.create(h.prototype);for(var F in h)z[F]=h[F];z.prototype.newGraphManager=function(){var S=new d(this);return this.graphManager=S,S},z.prototype.newGraph=function(S){return new f(null,this.graphManager,S)},z.prototype.newNode=function(S){return new p(this.graphManager,S)},z.prototype.newEdge=function(S){return new g(null,null,S)},z.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.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)},z.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/v.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},z.prototype.layout=function(){var S=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return S&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},z.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){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),N=this.nodesWithGravity.filter(function($){return R.has($)});this.graphManager.setAllNodesToApplyGravitation(N)}}else{var S=this.getFlatForest();if(S.length>0)this.positionNodesRadially(S);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),N=this.nodesWithGravity.filter(function(D){return R.has(D)});this.graphManager.setAllNodesToApplyGravitation(N),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(y.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},z.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%v.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!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 S=new Set(this.getAllNodes()),R=this.nodesWithGravity.filter(function(I){return S.has(I)});this.graphManager.setAllNodesToApplyGravitation(R),this.graphManager.updateBounds(),this.updateGrid(),m.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()),m.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 N=!this.isTreeGrowing&&!this.isGrowthFinished,D=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(N,D),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},z.prototype.getPositionsData=function(){for(var S=this.graphManager.getAllNodes(),R={},N=0;N0&&this.updateDisplacements();for(var N=0;N0&&(D.fixedNodeWeight=$)}}if(this.constraints.relativePlacementConstraint){var B=new Map,P=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(J){S.fixedNodesOnHorizontal.add(J),S.fixedNodesOnVertical.add(J)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var G=this.constraints.alignmentConstraint.vertical,N=0;N=2*J.length/3;ne--)Z=Math.floor(Math.random()*(ne+1)),ee=J[ne],J[ne]=J[Z],J[Z]=ee;return J},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(J){if(J.left){var Z=B.has(J.left)?B.get(J.left):J.left,ee=B.has(J.right)?B.get(J.right):J.right;S.nodesInRelativeHorizontal.includes(Z)||(S.nodesInRelativeHorizontal.push(Z),S.nodeToRelativeConstraintMapHorizontal.set(Z,[]),S.dummyToNodeForVerticalAlignment.has(Z)?S.nodeToTempPositionMapHorizontal.set(Z,S.idToNodeMap.get(S.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):S.nodeToTempPositionMapHorizontal.set(Z,S.idToNodeMap.get(Z).getCenterX())),S.nodesInRelativeHorizontal.includes(ee)||(S.nodesInRelativeHorizontal.push(ee),S.nodeToRelativeConstraintMapHorizontal.set(ee,[]),S.dummyToNodeForVerticalAlignment.has(ee)?S.nodeToTempPositionMapHorizontal.set(ee,S.idToNodeMap.get(S.dummyToNodeForVerticalAlignment.get(ee)[0]).getCenterX()):S.nodeToTempPositionMapHorizontal.set(ee,S.idToNodeMap.get(ee).getCenterX())),S.nodeToRelativeConstraintMapHorizontal.get(Z).push({right:ee,gap:J.gap}),S.nodeToRelativeConstraintMapHorizontal.get(ee).push({left:Z,gap:J.gap})}else{var ne=P.has(J.top)?P.get(J.top):J.top,ue=P.has(J.bottom)?P.get(J.bottom):J.bottom;S.nodesInRelativeVertical.includes(ne)||(S.nodesInRelativeVertical.push(ne),S.nodeToRelativeConstraintMapVertical.set(ne,[]),S.dummyToNodeForHorizontalAlignment.has(ne)?S.nodeToTempPositionMapVertical.set(ne,S.idToNodeMap.get(S.dummyToNodeForHorizontalAlignment.get(ne)[0]).getCenterY()):S.nodeToTempPositionMapVertical.set(ne,S.idToNodeMap.get(ne).getCenterY())),S.nodesInRelativeVertical.includes(ue)||(S.nodesInRelativeVertical.push(ue),S.nodeToRelativeConstraintMapVertical.set(ue,[]),S.dummyToNodeForHorizontalAlignment.has(ue)?S.nodeToTempPositionMapVertical.set(ue,S.idToNodeMap.get(S.dummyToNodeForHorizontalAlignment.get(ue)[0]).getCenterY()):S.nodeToTempPositionMapVertical.set(ue,S.idToNodeMap.get(ue).getCenterY())),S.nodeToRelativeConstraintMapVertical.get(ne).push({bottom:ue,gap:J.gap}),S.nodeToRelativeConstraintMapVertical.get(ue).push({top:ne,gap:J.gap})}});else{var Y=new Map,W=new Map;this.constraints.relativePlacementConstraint.forEach(function(J){if(J.left){var Z=B.has(J.left)?B.get(J.left):J.left,ee=B.has(J.right)?B.get(J.right):J.right;Y.has(Z)?Y.get(Z).push(ee):Y.set(Z,[ee]),Y.has(ee)?Y.get(ee).push(Z):Y.set(ee,[Z])}else{var ne=P.has(J.top)?P.get(J.top):J.top,ue=P.has(J.bottom)?P.get(J.bottom):J.bottom;W.has(ne)?W.get(ne).push(ue):W.set(ne,[ue]),W.has(ue)?W.get(ue).push(ne):W.set(ue,[ne])}});var ie=function(Z,ee){var ne=[],ue=[],fe=new M,_e=new Set,Ae=0;return Z.forEach(function(Ne,me){if(!_e.has(me)){ne[Ae]=[],ue[Ae]=!1;var ve=me;for(fe.push(ve),_e.add(ve),ne[Ae].push(ve);fe.length!=0;){ve=fe.shift(),ee.has(ve)&&(ue[Ae]=!0);var Ge=Z.get(ve);Ge.forEach(function(Te){_e.has(Te)||(fe.push(Te),_e.add(Te),ne[Ae].push(Te))})}Ae++}}),{components:ne,isFixed:ue}},K=ie(Y,S.fixedNodesOnHorizontal);this.componentsOnHorizontal=K.components,this.fixedComponentsOnHorizontal=K.isFixed;var se=ie(W,S.fixedNodesOnVertical);this.componentsOnVertical=se.components,this.fixedComponentsOnVertical=se.isFixed}}},z.prototype.updateDisplacements=function(){var S=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(se){var J=S.idToNodeMap.get(se.nodeId);J.displacementX=0,J.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var R=this.constraints.alignmentConstraint.vertical,N=0;N1){var P;for(P=0;PD&&(D=Math.floor(B.y)),$=Math.floor(B.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new w(T.WORLD_CENTER_X-B.x/2,T.WORLD_CENTER_Y-B.y/2))},z.radialLayout=function(S,R,N){var D=Math.max(this.maxDiagonalInTree(S),m.DEFAULT_RADIAL_SEPARATION);z.branchRadialLayout(R,null,0,359,0,D);var I=L.calculateBounds(S),$=new O;$.setDeviceOrgX(I.getMinX()),$.setDeviceOrgY(I.getMinY()),$.setWorldOrgX(N.x),$.setWorldOrgY(N.y);for(var B=0;B1;){var ee=Z[0];Z.splice(0,1);var ne=W.indexOf(ee);ne>=0&&W.splice(ne,1),se--,ie--}R!=null?J=(W.indexOf(Z[0])+1)%se:J=0;for(var ue=Math.abs(D-N)/ie,fe=J;K!=ie;fe=++fe%se){var _e=W[fe].getOtherEnd(S);if(_e!=R){var Ae=(N+K*ue)%360,Ne=(Ae+ue)%360;z.branchRadialLayout(_e,S,Ae,Ne,I+$,$),K++}}},z.maxDiagonalInTree=function(S){for(var R=C.MIN_VALUE,N=0;NR&&(R=I)}return R},z.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},z.prototype.groupZeroDegreeMembers=function(){var S=this,R={};this.memberGroups={},this.idToDummyNode={};for(var N=[],D=this.graphManager.getAllNodes(),I=0;I"u"&&(R[P]=[]),R[P]=R[P].concat($)}Object.keys(R).forEach(function(G){if(R[G].length>1){var V="DummyCompound_"+G;S.memberGroups[V]=R[G];var Y=R[G][0].getParent(),W=new p(S.graphManager);W.id=V,W.paddingLeft=Y.paddingLeft||0,W.paddingRight=Y.paddingRight||0,W.paddingBottom=Y.paddingBottom||0,W.paddingTop=Y.paddingTop||0,S.idToDummyNode[V]=W;var ie=S.getGraphManager().add(S.newGraph(),W),K=Y.getChild();K.add(W);for(var se=0;seI?(D.rect.x-=(D.labelWidth-I)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-I)/2):D.labelPosHorizontal=="right"&&D.setWidth(I+D.labelWidth)),D.labelHeight&&(D.labelPosVertical=="top"?(D.rect.y-=D.labelHeight,D.setHeight($+D.labelHeight),D.labelMarginTop=D.labelHeight):D.labelPosVertical=="center"&&D.labelHeight>$?(D.rect.y-=(D.labelHeight-$)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-$)/2):D.labelPosVertical=="bottom"&&D.setHeight($+D.labelHeight))}})},z.prototype.repopulateCompounds=function(){for(var S=this.compoundOrder.length-1;S>=0;S--){var R=this.compoundOrder[S],N=R.id,D=R.paddingLeft,I=R.paddingTop,$=R.labelMarginLeft,B=R.labelMarginTop;this.adjustLocations(this.tiledMemberPack[N],R.rect.x,R.rect.y,D,I,$,B)}},z.prototype.repopulateZeroDegreeMembers=function(){var S=this,R=this.tiledZeroDegreePack;Object.keys(R).forEach(function(N){var D=S.idToDummyNode[N],I=D.paddingLeft,$=D.paddingTop,B=D.labelMarginLeft,P=D.labelMarginTop;S.adjustLocations(R[N],D.rect.x,D.rect.y,I,$,B,P)})},z.prototype.getToBeTiled=function(S){var R=S.id;if(this.toBeTiled[R]!=null)return this.toBeTiled[R];var N=S.getChild();if(N==null)return this.toBeTiled[R]=!1,!1;for(var D=N.getNodes(),I=0;I0)return this.toBeTiled[R]=!1,!1;if($.getChild()==null){this.toBeTiled[$.id]=!1;continue}if(!this.getToBeTiled($))return this.toBeTiled[R]=!1,!1}return this.toBeTiled[R]=!0,!0},z.prototype.getNodeDegree=function(S){S.id;for(var R=S.getEdges(),N=0,D=0;DY&&(Y=ie.rect.height)}N+=Y+S.verticalPadding}},z.prototype.tileCompoundMembers=function(S,R){var N=this;this.tiledMemberPack=[],Object.keys(S).forEach(function(D){var I=R[D];if(N.tiledMemberPack[D]=N.tileNodes(S[D],I.paddingLeft+I.paddingRight),I.rect.width=N.tiledMemberPack[D].width,I.rect.height=N.tiledMemberPack[D].height,I.setCenter(N.tiledMemberPack[D].centerX,N.tiledMemberPack[D].centerY),I.labelMarginLeft=0,I.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var $=I.rect.width,B=I.rect.height;I.labelWidth&&(I.labelPosHorizontal=="left"?(I.rect.x-=I.labelWidth,I.setWidth($+I.labelWidth),I.labelMarginLeft=I.labelWidth):I.labelPosHorizontal=="center"&&I.labelWidth>$?(I.rect.x-=(I.labelWidth-$)/2,I.setWidth(I.labelWidth),I.labelMarginLeft=(I.labelWidth-$)/2):I.labelPosHorizontal=="right"&&I.setWidth($+I.labelWidth)),I.labelHeight&&(I.labelPosVertical=="top"?(I.rect.y-=I.labelHeight,I.setHeight(B+I.labelHeight),I.labelMarginTop=I.labelHeight):I.labelPosVertical=="center"&&I.labelHeight>B?(I.rect.y-=(I.labelHeight-B)/2,I.setHeight(I.labelHeight),I.labelMarginTop=(I.labelHeight-B)/2):I.labelPosVertical=="bottom"&&I.setHeight(B+I.labelHeight))}})},z.prototype.tileNodes=function(S,R){var N=this.tileNodesByFavoringDim(S,R,!0),D=this.tileNodesByFavoringDim(S,R,!1),I=this.getOrgRatio(N),$=this.getOrgRatio(D),B;return $P&&(P=se.getWidth())});var G=$/I,V=B/I,Y=Math.pow(N-D,2)+4*(G+D)*(V+N)*I,W=(D-N+Math.sqrt(Y))/(2*(G+D)),ie;R?(ie=Math.ceil(W),ie==W&&ie++):ie=Math.floor(W);var K=ie*(G+D)-D;return P>K&&(K=P),K+=D*2,K},z.prototype.tileNodesByFavoringDim=function(S,R,N){var D=m.TILING_PADDING_VERTICAL,I=m.TILING_PADDING_HORIZONTAL,$=m.TILING_COMPARE_BY,B={rows:[],rowWidth:[],rowHeight:[],width:0,height:R,verticalPadding:D,horizontalPadding:I,centerX:0,centerY:0};$&&(B.idealRowWidth=this.calcIdealRowWidth(S,N));var P=function(J){return J.rect.width*J.rect.height},G=function(J,Z){return P(Z)-P(J)};S.sort(function(se,J){var Z=G;return B.idealRowWidth?(Z=$,Z(se.id,J.id)):Z(se,J)});for(var V=0,Y=0,W=0;W0&&(B+=S.horizontalPadding),S.rowWidth[N]=B,S.width0&&(P+=S.verticalPadding);var G=0;P>S.rowHeight[N]&&(G=S.rowHeight[N],S.rowHeight[N]=P,G=S.rowHeight[N]-G),S.height+=G,S.rows[N].push(R)},z.prototype.getShortestRowIndex=function(S){for(var R=-1,N=Number.MAX_VALUE,D=0;DN&&(R=D,N=S.rowWidth[D]);return R},z.prototype.canAddHorizontal=function(S,R,N){if(S.idealRowWidth){var D=S.rows.length-1,I=S.rowWidth[D];return I+R+S.horizontalPadding<=S.idealRowWidth}var $=this.getShortestRowIndex(S);if($<0)return!0;var B=S.rowWidth[$];if(B+S.horizontalPadding+R<=S.width)return!0;var P=0;S.rowHeight[$]0&&(P=N+S.verticalPadding-S.rowHeight[$]);var G;S.width-B>=R+S.horizontalPadding?G=(S.height+P)/(B+R+S.horizontalPadding):G=(S.height+P)/S.width,P=N+S.verticalPadding;var V;return S.width$&&R!=N){D.splice(-1,1),S.rows[N].push(I),S.rowWidth[R]=S.rowWidth[R]-$,S.rowWidth[N]=S.rowWidth[N]+$,S.width=S.rowWidth[instance.getLongestRowIndex(S)];for(var B=Number.MIN_VALUE,P=0;PB&&(B=D[P].height);R>0&&(B+=S.verticalPadding);var G=S.rowHeight[R]+S.rowHeight[N];S.rowHeight[R]=B,S.rowHeight[N]0)for(var K=I;K<=$;K++)ie[0]+=this.grid[K][B-1].length+this.grid[K][B].length-1;if($0)for(var K=B;K<=P;K++)ie[3]+=this.grid[I-1][K].length+this.grid[I][K].length-1;for(var se=C.MAX_VALUE,J,Z,ee=0;ee{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,y,v){h.call(this,g,m,y,v)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var y=this.getChild().getNodes(),v,T=0;T{function h(y){if(Array.isArray(y)){for(var v=0,T=Array(y.length);v0){var Et=0;be.forEach(function(ot){pe=="horizontal"?(qe.set(ot,b.has(ot)?w[b.get(ot)]:Be.get(ot)),Et+=qe.get(ot)):(qe.set(ot,b.has(ot)?k[b.get(ot)]:Be.get(ot)),Et+=qe.get(ot))}),Et=Et/be.length,lt.forEach(function(ot){re.has(ot)||qe.set(ot,Et)})}else{var vt=0;lt.forEach(function(ot){pe=="horizontal"?vt+=b.has(ot)?w[b.get(ot)]:Be.get(ot):vt+=b.has(ot)?k[b.get(ot)]:Be.get(ot)}),vt=vt/lt.length,lt.forEach(function(ot){qe.set(ot,vt)})}});for(var Ie=function(){var be=Xe.shift(),Et=j.get(be);Et.forEach(function(vt){if(qe.get(vt.id)ot&&(ot=wt),MrIt&&(It=Mr)}}catch(_r){ht=!0,oe=_r}finally{try{!xt&&At.return&&At.return()}finally{if(ht)throw oe}}var ye=(Et+ot)/2-(vt+It)/2,et=!0,ct=!1,_t=void 0;try{for(var Ft=lt[Symbol.iterator](),nr;!(et=(nr=Ft.next()).done);et=!0){var ir=nr.value;qe.set(ir,qe.get(ir)+ye)}}catch(_r){ct=!0,_t=_r}finally{try{!et&&Ft.return&&Ft.return()}finally{if(ct)throw _t}}})}return qe},F=function(j){var pe=0,re=0,Be=0,xe=0;if(j.forEach(function(Le){Le.left?w[b.get(Le.left)]-w[b.get(Le.right)]>=0?pe++:re++:k[b.get(Le.top)]-k[b.get(Le.bottom)]>=0?Be++:xe++}),pe>re&&Be>xe)for(var Ue=0;Uere)for(var De=0;Dexe)for(var qe=0;qe1)v.fixedNodeConstraint.forEach(function(he,j){D[j]=[he.position.x,he.position.y],I[j]=[w[b.get(he.nodeId)],k[b.get(he.nodeId)]]}),$=!0;else if(v.alignmentConstraint)(function(){var he=0;if(v.alignmentConstraint.vertical){for(var j=v.alignmentConstraint.vertical,pe=function(qe){var Le=new Set;j[qe].forEach(function(it){Le.add(it)});var Xe=new Set([].concat(h(Le)).filter(function(it){return P.has(it)})),Ie=void 0;Xe.size>0?Ie=w[b.get(Xe.values().next().value)]:Ie=M(Le).x,j[qe].forEach(function(it){D[he]=[Ie,k[b.get(it)]],I[he]=[w[b.get(it)],k[b.get(it)]],he++})},re=0;re0?Ie=w[b.get(Xe.values().next().value)]:Ie=M(Le).y,Be[qe].forEach(function(it){D[he]=[w[b.get(it)],Ie],I[he]=[w[b.get(it)],k[b.get(it)]],he++})},Ue=0;UeW&&(W=Y[K].length,ie=K);if(W0){var ke={x:0,y:0};v.fixedNodeConstraint.forEach(function(he,j){var pe={x:w[b.get(he.nodeId)],y:k[b.get(he.nodeId)]},re=he.position,Be=O(re,pe);ke.x+=Be.x,ke.y+=Be.y}),ke.x/=v.fixedNodeConstraint.length,ke.y/=v.fixedNodeConstraint.length,w.forEach(function(he,j){w[j]+=ke.x}),k.forEach(function(he,j){k[j]+=ke.y}),v.fixedNodeConstraint.forEach(function(he){w[b.get(he.nodeId)]=he.position.x,k[b.get(he.nodeId)]=he.position.y})}if(v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var Ve=v.alignmentConstraint.vertical,Qe=function(j){var pe=new Set;Ve[j].forEach(function(xe){pe.add(xe)});var re=new Set([].concat(h(pe)).filter(function(xe){return P.has(xe)})),Be=void 0;re.size>0?Be=w[b.get(re.values().next().value)]:Be=M(pe).x,pe.forEach(function(xe){P.has(xe)||(w[b.get(xe)]=Be)})},nt=0;nt0?Be=k[b.get(re.values().next().value)]:Be=M(pe).y,pe.forEach(function(xe){P.has(xe)||(k[b.get(xe)]=Be)})},Ce=0;Ce{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(45);return s})()})})(YS)),YS.exports}var mpt=HS.exports,gye;function ypt(){return gye||(gye=1,(function(t,e){(function(n,i){t.exports=i(gpt())})(mpt,function(r){return(()=>{var n={658:(o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d{var h=(function(){function p(g,m){var y=[],v=!0,T=!1,b=void 0;try{for(var w=g[Symbol.iterator](),k;!(v=(k=w.next()).done)&&(y.push(k.value),!(m&&y.length===m));v=!0);}catch(A){T=!0,b=A}finally{try{!v&&w.return&&w.return()}finally{if(T)throw b}}return y}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m0&&$.merge(V)});for(var B=0;B<$.length;B++){var P=$[B];if(w=m.intersection(P.union(P.ancestors())),w!=null&&!T.has(w[0])){var G=w.union(w.descendants());G.forEach(function(V){v.push(V),T.add(V),F.merge(V),m.has(V)&&b.push(V)})}}};v.length!=0;)N();if(F.forEach(function(I){g.intersection(I.connectedEdges()).forEach(function($){F.has($.source())&&F.has($.target())&&F.merge($)})}),b.length==m.length&&(C=!0),!C||C&&_>1){k=b[0],A=k.connectedEdges().length,b.forEach(function(I){I.connectedEdges().length0&&y.set("dummy"+(y.size+1),L),O},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var y=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var w=!0,k=!1,A=void 0;try{for(var C=g.nodeIndexes[Symbol.iterator](),_;!(w=(_=C.next()).done);w=!0){var L=_.value,O=h(L,2),M=O[0],z=O[1],F=m.cy.getElementById(M);if(F){var S=F.boundingBox(),R=g.xCoords[z]-S.w/2,N=g.xCoords[z]+S.w/2,D=g.yCoords[z]-S.h/2,I=g.yCoords[z]+S.h/2;Rv&&(v=N),Db&&(b=I)}}}catch(V){k=!0,A=V}finally{try{!w&&C.return&&C.return()}finally{if(k)throw A}}var $=p.x-(v+y)/2,B=p.y-(b+T)/2;g.xCoords=g.xCoords.map(function(V){return V+$}),g.yCoords=g.yCoords.map(function(V){return V+B})}else{Object.keys(g).forEach(function(V){var Y=g[V],W=Y.getRect().x,ie=Y.getRect().x+Y.getRect().width,K=Y.getRect().y,se=Y.getRect().y+Y.getRect().height;Wv&&(v=ie),Kb&&(b=se)});var P=p.x-(v+y)/2,G=p.y-(b+T)/2;Object.keys(g).forEach(function(V){var Y=g[V];Y.setCenter(Y.getCenterX()+P,Y.getCenterY()+G)})}}},f.calcBoundingBox=function(p,g,m,y){for(var v=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,b=Number.MAX_SAFE_INTEGER,w=Number.MIN_SAFE_INTEGER,k=void 0,A=void 0,C=void 0,_=void 0,L=p.descendants().not(":parent"),O=L.length,M=0;Mk&&(v=k),TC&&(b=C),w<_&&(w=_)}var F={};return F.topLeftX=v,F.topLeftY=b,F.width=T-v,F.height=w-b,F},f.calcParentsWithoutChildren=function(p,g){var m=p.collection();return g.nodes(":parent").forEach(function(y){var v=!1;y.children().forEach(function(T){T.css("display")!="none"&&(v=!0)}),v||m.merge(y)}),m},o.exports=f}),816:((o,l,u)=>{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,y=u(140).layoutBase.FDLayoutConstants,v=u(140).CoSEConstants,T=function(w,k){var A=w.cy,C=w.eles,_=C.nodes(),L=C.edges(),O=void 0,M=void 0,z=void 0,F={};w.randomize&&(O=k.nodeIndexes,M=k.xCoords,z=k.yCoords);var S=function(V){return typeof V=="function"},R=function(V,Y){return S(V)?V(Y):V},N=h.calcParentsWithoutChildren(A,C),D=function G(V,Y,W,ie){for(var K=Y.length,se=0;se0){var fe=void 0;fe=W.getGraphManager().add(W.newGraph(),ee),G(fe,Z,W,ie)}}},I=function(V,Y,W){for(var ie=0,K=0,se=0;se0?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=ie/K:S(w.idealEdgeLength)?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=50:v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=w.idealEdgeLength,v.MIN_REPULSION_DIST=y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,v.DEFAULT_RADIAL_SEPARATION=y.DEFAULT_EDGE_LENGTH)},$=function(V,Y){Y.fixedNodeConstraint&&(V.constraints.fixedNodeConstraint=Y.fixedNodeConstraint),Y.alignmentConstraint&&(V.constraints.alignmentConstraint=Y.alignmentConstraint),Y.relativePlacementConstraint&&(V.constraints.relativePlacementConstraint=Y.relativePlacementConstraint)};w.nestingFactor!=null&&(v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor),w.gravity!=null&&(v.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=w.gravity),w.numIter!=null&&(v.MAX_ITERATIONS=y.MAX_ITERATIONS=w.numIter),w.gravityRange!=null&&(v.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange),w.gravityCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound),w.gravityRangeCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound),w.initialEnergyOnIncremental!=null&&(v.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental),w.tilingCompareBy!=null&&(v.TILING_COMPARE_BY=w.tilingCompareBy),w.quality=="proof"?m.QUALITY=2:m.QUALITY=0,v.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!w.randomize,v.ANIMATE=y.ANIMATE=m.ANIMATE=w.animate,v.TILE=w.tile,v.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical=="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,v.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal=="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,v.PURE_INCREMENTAL=!w.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=w.uniformNodeDimensions,w.step=="transformed"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!1),w.step=="enforced"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!1),w.step=="cose"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!0),w.step=="all"&&(w.randomize?v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!0),w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint?v.TREE_REDUCTION_ON_INCREMENTAL=!1:v.TREE_REDUCTION_ON_INCREMENTAL=!0;var B=new d,P=B.newGraphManager();return D(P.addRoot(),h.getTopMostNodes(_),B,w),I(B,P,L),$(B,w),B.runLayout(),F};o.exports={coseLayout:T}}),212:((o,l,u)=>{var h=(function(){function w(k,A){for(var C=0;C0)if(N){var $=p.getTopMostNodes(C.eles.nodes());if(z=p.connectComponents(_,C.eles,$),z.forEach(function(Ne){var me=Ne.boundingBox();F.push({x:me.x1+me.w/2,y:me.y1+me.h/2})}),C.randomize&&z.forEach(function(Ne){C.eles=Ne,O.push(m(C))}),C.quality=="default"||C.quality=="proof"){var B=_.collection();if(C.tile){var P=new Map,G=[],V=[],Y=0,W={nodeIndexes:P,xCoords:G,yCoords:V},ie=[];if(z.forEach(function(Ne,me){Ne.edges().length==0&&(Ne.nodes().forEach(function(ve,Ge){B.merge(Ne.nodes()[Ge]),ve.isParent()||(W.nodeIndexes.set(Ne.nodes()[Ge].id(),Y++),W.xCoords.push(Ne.nodes()[0].position().x),W.yCoords.push(Ne.nodes()[0].position().y))}),ie.push(me))}),B.length>1){var K=B.boundingBox();F.push({x:K.x1+K.w/2,y:K.y1+K.h/2}),z.push(B),O.push(W);for(var se=ie.length-1;se>=0;se--)z.splice(ie[se],1),O.splice(ie[se],1),F.splice(ie[se],1)}}z.forEach(function(Ne,me){C.eles=Ne,M.push(v(C,O[me])),p.relocateComponent(F[me],M[me],C)})}else z.forEach(function(Ne,me){p.relocateComponent(F[me],O[me],C)});var J=new Set;if(z.length>1){var Z=[],ee=L.filter(function(Ne){return Ne.css("display")=="none"});z.forEach(function(Ne,me){var ve=void 0;if(C.quality=="draft"&&(ve=O[me].nodeIndexes),Ne.nodes().not(ee).length>0){var Ge={};Ge.edges=[],Ge.nodes=[];var Te=void 0;Ne.nodes().not(ee).forEach(function(Ze){if(C.quality=="draft")if(!Ze.isParent())Te=ve.get(Ze.id()),Ge.nodes.push({x:O[me].xCoords[Te]-Ze.boundingbox().w/2,y:O[me].yCoords[Te]-Ze.boundingbox().h/2,width:Ze.boundingbox().w,height:Ze.boundingbox().h});else{var ke=p.calcBoundingBox(Ze,O[me].xCoords,O[me].yCoords,ve);Ge.nodes.push({x:ke.topLeftX,y:ke.topLeftY,width:ke.width,height:ke.height})}else M[me][Ze.id()]&&Ge.nodes.push({x:M[me][Ze.id()].getLeft(),y:M[me][Ze.id()].getTop(),width:M[me][Ze.id()].getWidth(),height:M[me][Ze.id()].getHeight()})}),Ne.edges().forEach(function(Ze){var ke=Ze.source(),Ve=Ze.target();if(ke.css("display")!="none"&&Ve.css("display")!="none")if(C.quality=="draft"){var Qe=ve.get(ke.id()),nt=ve.get(Ve.id()),tt=[],je=[];if(ke.isParent()){var Ce=p.calcBoundingBox(ke,O[me].xCoords,O[me].yCoords,ve);tt.push(Ce.topLeftX+Ce.width/2),tt.push(Ce.topLeftY+Ce.height/2)}else tt.push(O[me].xCoords[Qe]),tt.push(O[me].yCoords[Qe]);if(Ve.isParent()){var Se=p.calcBoundingBox(Ve,O[me].xCoords,O[me].yCoords,ve);je.push(Se.topLeftX+Se.width/2),je.push(Se.topLeftY+Se.height/2)}else je.push(O[me].xCoords[nt]),je.push(O[me].yCoords[nt]);Ge.edges.push({startX:tt[0],startY:tt[1],endX:je[0],endY:je[1]})}else M[me][ke.id()]&&M[me][Ve.id()]&&Ge.edges.push({startX:M[me][ke.id()].getCenterX(),startY:M[me][ke.id()].getCenterY(),endX:M[me][Ve.id()].getCenterX(),endY:M[me][Ve.id()].getCenterY()})}),Ge.nodes.length>0&&(Z.push(Ge),J.add(me))}});var ne=R.packComponents(Z,C.randomize).shifts;if(C.quality=="draft")O.forEach(function(Ne,me){var ve=Ne.xCoords.map(function(Te){return Te+ne[me].dx}),Ge=Ne.yCoords.map(function(Te){return Te+ne[me].dy});Ne.xCoords=ve,Ne.yCoords=Ge});else{var ue=0;J.forEach(function(Ne){Object.keys(M[Ne]).forEach(function(me){var ve=M[Ne][me];ve.setCenter(ve.getCenterX()+ne[ue].dx,ve.getCenterY()+ne[ue].dy)}),ue++})}}}else{var D=C.eles.boundingBox();if(F.push({x:D.x1+D.w/2,y:D.y1+D.h/2}),C.randomize){var I=m(C);O.push(I)}C.quality=="default"||C.quality=="proof"?(M.push(v(C,O[0])),p.relocateComponent(F[0],M[0],C)):p.relocateComponent(F[0],O[0],C)}var fe=function(me,ve){if(C.quality=="default"||C.quality=="proof"){typeof me=="number"&&(me=ve);var Ge=void 0,Te=void 0,Ze=me.data("id");return M.forEach(function(Ve){Ze in Ve&&(Ge={x:Ve[Ze].getRect().getCenterX(),y:Ve[Ze].getRect().getCenterY()},Te=Ve[Ze])}),C.nodeDimensionsIncludeLabels&&(Te.labelWidth&&(Te.labelPosHorizontal=="left"?Ge.x+=Te.labelWidth/2:Te.labelPosHorizontal=="right"&&(Ge.x-=Te.labelWidth/2)),Te.labelHeight&&(Te.labelPosVertical=="top"?Ge.y+=Te.labelHeight/2:Te.labelPosVertical=="bottom"&&(Ge.y-=Te.labelHeight/2))),Ge==null&&(Ge={x:me.position("x"),y:me.position("y")}),{x:Ge.x,y:Ge.y}}else{var ke=void 0;return O.forEach(function(Ve){var Qe=Ve.nodeIndexes.get(me.id());Qe!=null&&(ke={x:Ve.xCoords[Qe],y:Ve.yCoords[Qe]})}),ke==null&&(ke={x:me.position("x"),y:me.position("y")}),{x:ke.x,y:ke.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var _e=p.calcParentsWithoutChildren(_,L),Ae=L.filter(function(Ne){return Ne.css("display")=="none"});C.eles=L.not(Ae),L.nodes().not(":parent").not(Ae).layoutPositions(A,C,fe),_e.length>0&&_e.forEach(function(Ne){Ne.position(fe(Ne))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w})();o.exports=b}),657:((o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var y=m.cy,v=m.eles,T=v.nodes(),b=v.nodes(":parent"),w=new Map,k=new Map,A=new Map,C=[],_=[],L=[],O=[],M=[],z=[],F=[],S=[],R=void 0,N=1e8,D=1e-9,I=m.piTol,$=m.samplingType,B=m.nodeSeparation,P=void 0,G=function(){for(var j=0,pe=0,re=!1;pe=xe;){De=Be[xe++];for(var we=C[De],lt=0;ltXe&&(Xe=M[Et],Ie=Et)}return Ie},Y=function(j){var pe=void 0;if(j){pe=Math.floor(Math.random()*R);for(var Be=0;Be=1)break;Le=qe}for(var it=0;it=1)break;Le=qe}for(var lt=0;lt0&&(pe.isParent()?C[j].push(A.get(pe.id())):C[j].push(pe.id()))})});var Ae=function(j){var pe=k.get(j),re=void 0;w.get(j).forEach(function(Be){y.getElementById(Be).isParent()?re=A.get(Be):re=Be,C[pe].push(re),C[k.get(re)].push(j)})},Ne=!0,me=!1,ve=void 0;try{for(var Ge=w.keys()[Symbol.iterator](),Te;!(Ne=(Te=Ge.next()).done);Ne=!0){var Ze=Te.value;Ae(Ze)}}catch(he){me=!0,ve=he}finally{try{!Ne&&Ge.return&&Ge.return()}finally{if(me)throw ve}}R=k.size;var ke=void 0;if(R>2){P=R{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d}),140:(o=>{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(579);return s})()})})(HS)),HS.exports}var vpt=ypt();const bpt=Os(vpt);var mye={L:"left",R:"right",T:"top",B:"bottom"},yye={L:x(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:x(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:x(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:x(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},KS={L:x((t,e)=>t-e+2,"L"),R:x((t,e)=>t-2,"R"),T:x((t,e)=>t-e+2,"T"),B:x((t,e)=>t-2,"B")},xpt=x(function(t){return fs(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),vye=x(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),fs=x(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),Oh=x(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),pP=x(function(t,e){const r=fs(t)&&Oh(e),n=Oh(t)&&fs(e);return r||n},"isArchitectureDirectionXY"),Tpt=x(function(t){const e=t[0],r=t[1],n=fs(e)&&Oh(r),i=Oh(e)&&fs(r);return n||i},"isArchitecturePairXY"),wpt=x(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),gP=x(function(t,e){const r=`${t}${e}`;return wpt(r)?r:void 0},"getArchitectureDirectionPair"),Cpt=x(function([t,e],r){const n=r[0],i=r[1];return fs(n)?Oh(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:fs(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),kpt=x(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ept=x(function(t,e){return pP(t,e)?"bend":fs(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Spt=x(function(t){return t.type==="service"},"isArchitectureService"),Apt=x(function(t){return t.type==="junction"},"isArchitectureJunction"),bye=x(t=>t.data(),"edgeData"),lm=x(t=>t.data(),"nodeData"),_pt=Fr.architecture,xye=(Hv=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Dn,this.getAccTitle=Fn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getAccDescription=Gn,this.setAccDescription=zn,this.clear()}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",In()}addService({id:e,icon:r,in:n,title:i,iconText:a}){if(this.registeredIds[e]!==void 0)throw new Error(`The service id [${e}] is already in use by another ${this.registeredIds[e]}`);if(n!==void 0){if(e===n)throw new Error(`The service [${e}] cannot be placed within itself`);if(this.registeredIds[n]===void 0)throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[n]==="node")throw new Error(`The service [${e}]'s parent is not a group`)}this.registeredIds[e]="node",this.nodes[e]={id:e,type:"service",icon:r,iconText:a,title:i,edges:[],in:n}}getServices(){return Object.values(this.nodes).filter(Spt)}addJunction({id:e,in:r}){if(this.registeredIds[e]!==void 0)throw new Error(`The junction id [${e}] is already in use by another ${this.registeredIds[e]}`);if(r!==void 0){if(e===r)throw new Error(`The junction [${e}] cannot be placed within itself`);if(this.registeredIds[r]===void 0)throw new Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[r]==="node")throw new Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds[e]="node",this.nodes[e]={id:e,type:"junction",edges:[],in:r}}getJunctions(){return Object.values(this.nodes).filter(Apt)}getNodes(){return Object.values(this.nodes)}getNode(e){return this.nodes[e]??null}addGroup({id:e,icon:r,in:n,title:i}){var a,s,o;if(((a=this.registeredIds)==null?void 0:a[e])!==void 0)throw new Error(`The group id [${e}] is already in use by another ${this.registeredIds[e]}`);if(n!==void 0){if(e===n)throw new Error(`The group [${e}] cannot be placed within itself`);if(((s=this.registeredIds)==null?void 0:s[n])===void 0)throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(((o=this.registeredIds)==null?void 0:o[n])==="node")throw new Error(`The group [${e}]'s parent is not a group`)}this.registeredIds[e]="group",this.groups[e]={id:e,icon:r,title:i,in:n}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:e,rhsId:r,lhsDir:n,rhsDir:i,lhsInto:a,rhsInto:s,lhsGroup:o,rhsGroup:l,title:u}){if(!vye(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!vye(i))throw new Error(`Invalid direction given for right hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(i)}`);if(this.nodes[e]===void 0&&this.groups[e]===void 0)throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[r]===void 0&&this.groups[r]===void 0)throw new Error(`The right-hand id [${r}] does not yet exist. Please create the service/group before declaring an edge to it.`);const h=this.nodes[e].in,d=this.nodes[r].in;if(o&&h&&d&&h==d)throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&h&&d&&h==d)throw new Error(`The right-hand id [${r}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const f={lhsId:e,lhsDir:n,lhsInto:a,lhsGroup:o,rhsId:r,rhsDir:i,rhsInto:s,rhsGroup:l,title:u};this.edges.push(f),this.nodes[e]&&this.nodes[r]&&(this.nodes[e].edges.push(this.edges[this.edges.length-1]),this.nodes[r].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const e={},r=Object.entries(this.nodes).reduce((l,[u,h])=>(l[u]=h.edges.reduce((d,f)=>{var m,y;const p=(m=this.getNode(f.lhsId))==null?void 0:m.in,g=(y=this.getNode(f.rhsId))==null?void 0:y.in;if(p&&g&&p!==g){const v=Ept(f.lhsDir,f.rhsDir);v!=="bend"&&(e[p]??(e[p]={}),e[p][g]=v,e[g]??(e[g]={}),e[g][p]=v)}if(f.lhsId===u){const v=gP(f.lhsDir,f.rhsDir);v&&(d[v]=f.rhsId)}else{const v=gP(f.rhsDir,f.lhsDir);v&&(d[v]=f.lhsId)}return d},{}),l),{}),n=Object.keys(r)[0],i={[n]:1},a=Object.keys(r).reduce((l,u)=>u===n?l:{...l,[u]:1},{}),s=x(l=>{const u={[l]:[0,0]},h=[l];for(;h.length>0;){const d=h.shift();if(d){i[d]=1,delete a[d];const f=r[d],[p,g]=u[d];Object.entries(f).forEach(([m,y])=>{i[y]||(u[y]=Cpt([p,g],m),h.push(y))})}}return u},"BFS"),o=[s(n)];for(;Object.keys(a).length>0;)o.push(s(Object.keys(a)[0]));this.dataStructures={adjList:r,spatialMaps:o,groupAlignments:e}}return this.dataStructures}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}getConfig(){return ti({..._pt,...lr().architecture})}getConfigField(e){return this.getConfig()[e]}},x(Hv,"ArchitectureDB"),Hv),Rpt=x((t,e)=>{zl(t,e),t.groups.map(r=>e.addGroup(r)),t.services.map(r=>e.addService({...r,type:"service"})),t.junctions.map(r=>e.addJunction({...r,type:"junction"})),t.edges.map(r=>e.addEdge(r))},"populateDb"),Tye={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Qo("architecture",t);ae.debug(e);const r=(n=Tye.parser)==null?void 0:n.yy;if(!(r instanceof xye))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Rpt(e,r)},"parse")},Lpt=x(t=>` + `},"styles"),w0t=T0t,C0t={db:vP,renderer:b0t,parser:p0t,styles:w0t};const k0t=Object.freeze(Object.defineProperty({__proto__:null,diagram:C0t},Symbol.toStringTag,{value:"Module"}));var KS={exports:{}},jS={exports:{}},ZS={exports:{}},E0t=ZS.exports,bye;function S0t(){return bye||(bye=1,(function(t,e){(function(n,i){t.exports=i()})(E0t,function(){return(function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=28)})([(function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a}),(function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.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=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l}),(function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,y){m==null&&y==null&&(y=g),a.call(this,y),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(y.target==p){if(y.source!=m)throw"Incorrect edge source!";g.push(y)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(!(y.source==m||y.target==m))throw"Incorrect edge source and/or target";(y.target==p||y.source==p)&&g.push(y)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var y=this.child.getNodes(),v=0;vg?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,x){a.call(this,x),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,x){if(v==null&&x==null){var b=y;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}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(v.owner==x.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=x.owner?null:(w.source=v,w.target=x,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),x!=v&&x.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var x=v.edges.slice(),b,w=x.length,k=0;k-1&&_>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(C,1),b.target!=b.source&&b.target.edges.splice(_,1);var S=b.source.owner.getEdges().indexOf(b);if(S==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,x,b,w,k=this.getNodes(),S=k.length,C=0;Cx&&(y=x),v>b&&(v=b)}return y==s.MAX_VALUE?null:(k[0].getParent().paddingLeft!=null?w=k[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,x=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,k,S,C,_,L,O=this.nodes,M=O.length,z=0;zk&&(v=k),xC&&(b=C),w<_&&(w=_)}var A=new d(v,b,x-v,w-b);v==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),O[0].getParent().paddingLeft!=null?L=O[0].getParent().paddingLeft:L=this.margin,this.left=A.x-L,this.right=A.x+A.width+L,this.top=A.y-L,this.bottom=A.y+A.height+L},g.calculateBounds=function(y){for(var v=s.MAX_VALUE,x=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,k,S,C,_,L=y.length,O=0;Ok&&(v=k),xC&&(b=C),w<_&&(w=_)}var z=new d(v,b,x-v,w-b);return z},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var y=0,v=this.nodes,x=v.length,b=0;b=this.nodes.length){var M=0;x.forEach(function(z){z.owner==y&&M++}),M==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=O,!1;if(df)return u[0]=g,u[1]=d,u[2]=_,u[3]=p,!1;if(hf?(u[0]=v,u[1]=x,A=!0):(u[0]=y,u[1]=m,A=!0):N===I&&(h>f?(u[0]=g,u[1]=m,A=!0):(u[0]=b,u[1]=x,A=!0)),-D===I?f>h?(u[2]=L,u[3]=O,R=!0):(u[2]=_,u[3]=C,R=!0):D===I&&(f>h?(u[2]=S,u[3]=C,R=!0):(u[2]=M,u[3]=O,R=!0)),A&&R)return!1;if(h>f?d>p?($=this.getCardinalDirection(N,I,4),B=this.getCardinalDirection(D,I,2)):($=this.getCardinalDirection(-N,I,3),B=this.getCardinalDirection(-D,I,1)):d>p?($=this.getCardinalDirection(-N,I,1),B=this.getCardinalDirection(-D,I,3)):($=this.getCardinalDirection(N,I,2),B=this.getCardinalDirection(D,I,4)),!A)switch($){case 1:G=m,P=h+-k/I,u[0]=P,u[1]=G;break;case 2:P=b,G=d+w*I,u[0]=P,u[1]=G;break;case 3:G=x,P=h+k/I,u[0]=P,u[1]=G;break;case 4:P=v,G=d+-w*I,u[0]=P,u[1]=G;break}if(!R)switch(B){case 1:X=C,V=f+-F/I,u[2]=V,u[3]=X;break;case 2:V=M,X=p+z*I,u[2]=V,u[3]=X;break;case 3:X=O,V=f+F/I,u[2]=V,u[3]=X;break;case 4:V=L,X=p+-z*I,u[2]=V,u[3]=X;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,x=h.y,b=void 0,w=void 0,k=void 0,S=void 0,C=void 0,_=void 0,L=void 0,O=void 0,M=void 0;return k=g-f,C=d-p,L=p*f-d*g,S=x-y,_=m-v,O=v*y-m*x,M=k*_-S*C,M===0?null:(b=(C*O-_*L)/M,w=(S*L-k*O)/M,new a(b,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var x=(-m+Math.sqrt(m*m-4*g*y))/(2*g),b=(-m-Math.sqrt(m*m-4*g*y))/(2*g),w=null;return x>=0&&x<=1?[x]:b>=0&&b<=1?[b]:w}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s}),(function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(k.push(C[0]);k.length>0&&y;){var _=k[0];k.splice(0,1),w.add(_);for(var L=_.getEdges(),b=0;b-1&&C.splice(F,1)}w=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,x=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var x=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(O,1);var M=S.getNeighborsList();M.forEach(function(A){if(v.indexOf(A)<0){var R=x.get(A),N=R-1;N==1&&_.push(A),x.set(A,N)}})}v=v.concat(_),(y.length==1||y.length==2)&&(b=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,x,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mk||w>k)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*x)):(k=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>k||w>k)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*x*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||k>=b[0].length)){for(var S=0;Sd}}]),u})();r.exports=l}),(function(r,n,i){function a(){}a.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var o=Math.min(this.m,this.n);this.s=(function(xt){for(var ht=[];xt-- >0;)ht.push(0);return ht})(Math.min(this.m+1,this.n)),this.U=(function(xt){var ht=function oe(At){if(At.length==0)return 0;for(var dt=[],ut=0;ut0;)ht.push(0);return ht})(this.n),u=(function(xt){for(var ht=[];xt-- >0;)ht.push(0);return ht})(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p=0;D--)if(this.s[D]!==0){for(var I=D+1;I=0;W--){if((function(xt,ht){return xt&&ht})(W0;){var fe=void 0,_e=void 0;for(fe=A-2;fe>=-1&&fe!==-1;fe--)if(Math.abs(l[fe])<=ue+ne*(Math.abs(this.s[fe])+Math.abs(this.s[fe+1]))){l[fe]=0;break}if(fe===A-2)_e=4;else{var Ae=void 0;for(Ae=A-1;Ae>=fe&&Ae!==fe;Ae--){var Ne=(Ae!==A?Math.abs(l[Ae]):0)+(Ae!==fe+1?Math.abs(l[Ae-1]):0);if(Math.abs(this.s[Ae])<=ue+ne*Ne){this.s[Ae]=0;break}}Ae===fe?_e=3:Ae===A-1?_e=1:(_e=2,fe=Ae)}switch(fe++,_e){case 1:{var me=l[A-2];l[A-2]=0;for(var ve=A-2;ve>=fe;ve--){var Ge=a.hypot(this.s[ve],me),Te=this.s[ve]/Ge,Ze=me/Ge;this.s[ve]=Ge,ve!==fe&&(me=-Ze*l[ve-1],l[ve-1]=Te*l[ve-1]);for(var ke=0;ke=this.s[fe+1]);){var Et=this.s[fe];if(this.s[fe]=this.s[fe+1],this.s[fe+1]=Et,feMath.abs(o)?(l=o/s,l=Math.abs(s)*Math.sqrt(1+l*l)):o!=0?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=a}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u{var n={45:((o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h}),806:((o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.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,o.exports=d}),767:((o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),880:((o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),578:((o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),765:((o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),y=u(902),v=u(551).FDLayoutConstants,x=u(551).LayoutConstants,b=u(551).Point,w=u(551).PointD,k=u(551).DimensionD,S=u(551).Layout,C=u(551).Integer,_=u(551).IGeometry,L=u(551).LGraph,O=u(551).Transform,M=u(551).LinkedList;function z(){h.call(this),this.toBeTiled={},this.constraints={}}z.prototype=Object.create(h.prototype);for(var F in h)z[F]=h[F];z.prototype.newGraphManager=function(){var A=new d(this);return this.graphManager=A,A},z.prototype.newGraph=function(A){return new f(null,this.graphManager,A)},z.prototype.newNode=function(A){return new p(this.graphManager,A)},z.prototype.newEdge=function(A){return new g(null,null,A)},z.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.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)},z.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/v.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},z.prototype.layout=function(){var A=x.DEFAULT_CREATE_BENDS_AS_NEEDED;return A&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},z.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){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),N=this.nodesWithGravity.filter(function($){return R.has($)});this.graphManager.setAllNodesToApplyGravitation(N)}}else{var A=this.getFlatForest();if(A.length>0)this.positionNodesRadially(A);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),N=this.nodesWithGravity.filter(function(D){return R.has(D)});this.graphManager.setAllNodesToApplyGravitation(N),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(y.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},z.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%v.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!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 A=new Set(this.getAllNodes()),R=this.nodesWithGravity.filter(function(I){return A.has(I)});this.graphManager.setAllNodesToApplyGravitation(R),this.graphManager.updateBounds(),this.updateGrid(),m.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()),m.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 N=!this.isTreeGrowing&&!this.isGrowthFinished,D=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(N,D),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},z.prototype.getPositionsData=function(){for(var A=this.graphManager.getAllNodes(),R={},N=0;N0&&this.updateDisplacements();for(var N=0;N0&&(D.fixedNodeWeight=$)}}if(this.constraints.relativePlacementConstraint){var B=new Map,P=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(J){A.fixedNodesOnHorizontal.add(J),A.fixedNodesOnVertical.add(J)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var G=this.constraints.alignmentConstraint.vertical,N=0;N=2*J.length/3;ne--)Z=Math.floor(Math.random()*(ne+1)),ee=J[ne],J[ne]=J[Z],J[Z]=ee;return J},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(J){if(J.left){var Z=B.has(J.left)?B.get(J.left):J.left,ee=B.has(J.right)?B.get(J.right):J.right;A.nodesInRelativeHorizontal.includes(Z)||(A.nodesInRelativeHorizontal.push(Z),A.nodeToRelativeConstraintMapHorizontal.set(Z,[]),A.dummyToNodeForVerticalAlignment.has(Z)?A.nodeToTempPositionMapHorizontal.set(Z,A.idToNodeMap.get(A.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):A.nodeToTempPositionMapHorizontal.set(Z,A.idToNodeMap.get(Z).getCenterX())),A.nodesInRelativeHorizontal.includes(ee)||(A.nodesInRelativeHorizontal.push(ee),A.nodeToRelativeConstraintMapHorizontal.set(ee,[]),A.dummyToNodeForVerticalAlignment.has(ee)?A.nodeToTempPositionMapHorizontal.set(ee,A.idToNodeMap.get(A.dummyToNodeForVerticalAlignment.get(ee)[0]).getCenterX()):A.nodeToTempPositionMapHorizontal.set(ee,A.idToNodeMap.get(ee).getCenterX())),A.nodeToRelativeConstraintMapHorizontal.get(Z).push({right:ee,gap:J.gap}),A.nodeToRelativeConstraintMapHorizontal.get(ee).push({left:Z,gap:J.gap})}else{var ne=P.has(J.top)?P.get(J.top):J.top,ue=P.has(J.bottom)?P.get(J.bottom):J.bottom;A.nodesInRelativeVertical.includes(ne)||(A.nodesInRelativeVertical.push(ne),A.nodeToRelativeConstraintMapVertical.set(ne,[]),A.dummyToNodeForHorizontalAlignment.has(ne)?A.nodeToTempPositionMapVertical.set(ne,A.idToNodeMap.get(A.dummyToNodeForHorizontalAlignment.get(ne)[0]).getCenterY()):A.nodeToTempPositionMapVertical.set(ne,A.idToNodeMap.get(ne).getCenterY())),A.nodesInRelativeVertical.includes(ue)||(A.nodesInRelativeVertical.push(ue),A.nodeToRelativeConstraintMapVertical.set(ue,[]),A.dummyToNodeForHorizontalAlignment.has(ue)?A.nodeToTempPositionMapVertical.set(ue,A.idToNodeMap.get(A.dummyToNodeForHorizontalAlignment.get(ue)[0]).getCenterY()):A.nodeToTempPositionMapVertical.set(ue,A.idToNodeMap.get(ue).getCenterY())),A.nodeToRelativeConstraintMapVertical.get(ne).push({bottom:ue,gap:J.gap}),A.nodeToRelativeConstraintMapVertical.get(ue).push({top:ne,gap:J.gap})}});else{var X=new Map,W=new Map;this.constraints.relativePlacementConstraint.forEach(function(J){if(J.left){var Z=B.has(J.left)?B.get(J.left):J.left,ee=B.has(J.right)?B.get(J.right):J.right;X.has(Z)?X.get(Z).push(ee):X.set(Z,[ee]),X.has(ee)?X.get(ee).push(Z):X.set(ee,[Z])}else{var ne=P.has(J.top)?P.get(J.top):J.top,ue=P.has(J.bottom)?P.get(J.bottom):J.bottom;W.has(ne)?W.get(ne).push(ue):W.set(ne,[ue]),W.has(ue)?W.get(ue).push(ne):W.set(ue,[ne])}});var ie=function(Z,ee){var ne=[],ue=[],fe=new M,_e=new Set,Ae=0;return Z.forEach(function(Ne,me){if(!_e.has(me)){ne[Ae]=[],ue[Ae]=!1;var ve=me;for(fe.push(ve),_e.add(ve),ne[Ae].push(ve);fe.length!=0;){ve=fe.shift(),ee.has(ve)&&(ue[Ae]=!0);var Ge=Z.get(ve);Ge.forEach(function(Te){_e.has(Te)||(fe.push(Te),_e.add(Te),ne[Ae].push(Te))})}Ae++}}),{components:ne,isFixed:ue}},K=ie(X,A.fixedNodesOnHorizontal);this.componentsOnHorizontal=K.components,this.fixedComponentsOnHorizontal=K.isFixed;var se=ie(W,A.fixedNodesOnVertical);this.componentsOnVertical=se.components,this.fixedComponentsOnVertical=se.isFixed}}},z.prototype.updateDisplacements=function(){var A=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(se){var J=A.idToNodeMap.get(se.nodeId);J.displacementX=0,J.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var R=this.constraints.alignmentConstraint.vertical,N=0;N1){var P;for(P=0;PD&&(D=Math.floor(B.y)),$=Math.floor(B.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new w(x.WORLD_CENTER_X-B.x/2,x.WORLD_CENTER_Y-B.y/2))},z.radialLayout=function(A,R,N){var D=Math.max(this.maxDiagonalInTree(A),m.DEFAULT_RADIAL_SEPARATION);z.branchRadialLayout(R,null,0,359,0,D);var I=L.calculateBounds(A),$=new O;$.setDeviceOrgX(I.getMinX()),$.setDeviceOrgY(I.getMinY()),$.setWorldOrgX(N.x),$.setWorldOrgY(N.y);for(var B=0;B1;){var ee=Z[0];Z.splice(0,1);var ne=W.indexOf(ee);ne>=0&&W.splice(ne,1),se--,ie--}R!=null?J=(W.indexOf(Z[0])+1)%se:J=0;for(var ue=Math.abs(D-N)/ie,fe=J;K!=ie;fe=++fe%se){var _e=W[fe].getOtherEnd(A);if(_e!=R){var Ae=(N+K*ue)%360,Ne=(Ae+ue)%360;z.branchRadialLayout(_e,A,Ae,Ne,I+$,$),K++}}},z.maxDiagonalInTree=function(A){for(var R=C.MIN_VALUE,N=0;NR&&(R=I)}return R},z.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},z.prototype.groupZeroDegreeMembers=function(){var A=this,R={};this.memberGroups={},this.idToDummyNode={};for(var N=[],D=this.graphManager.getAllNodes(),I=0;I"u"&&(R[P]=[]),R[P]=R[P].concat($)}Object.keys(R).forEach(function(G){if(R[G].length>1){var V="DummyCompound_"+G;A.memberGroups[V]=R[G];var X=R[G][0].getParent(),W=new p(A.graphManager);W.id=V,W.paddingLeft=X.paddingLeft||0,W.paddingRight=X.paddingRight||0,W.paddingBottom=X.paddingBottom||0,W.paddingTop=X.paddingTop||0,A.idToDummyNode[V]=W;var ie=A.getGraphManager().add(A.newGraph(),W),K=X.getChild();K.add(W);for(var se=0;seI?(D.rect.x-=(D.labelWidth-I)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-I)/2):D.labelPosHorizontal=="right"&&D.setWidth(I+D.labelWidth)),D.labelHeight&&(D.labelPosVertical=="top"?(D.rect.y-=D.labelHeight,D.setHeight($+D.labelHeight),D.labelMarginTop=D.labelHeight):D.labelPosVertical=="center"&&D.labelHeight>$?(D.rect.y-=(D.labelHeight-$)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-$)/2):D.labelPosVertical=="bottom"&&D.setHeight($+D.labelHeight))}})},z.prototype.repopulateCompounds=function(){for(var A=this.compoundOrder.length-1;A>=0;A--){var R=this.compoundOrder[A],N=R.id,D=R.paddingLeft,I=R.paddingTop,$=R.labelMarginLeft,B=R.labelMarginTop;this.adjustLocations(this.tiledMemberPack[N],R.rect.x,R.rect.y,D,I,$,B)}},z.prototype.repopulateZeroDegreeMembers=function(){var A=this,R=this.tiledZeroDegreePack;Object.keys(R).forEach(function(N){var D=A.idToDummyNode[N],I=D.paddingLeft,$=D.paddingTop,B=D.labelMarginLeft,P=D.labelMarginTop;A.adjustLocations(R[N],D.rect.x,D.rect.y,I,$,B,P)})},z.prototype.getToBeTiled=function(A){var R=A.id;if(this.toBeTiled[R]!=null)return this.toBeTiled[R];var N=A.getChild();if(N==null)return this.toBeTiled[R]=!1,!1;for(var D=N.getNodes(),I=0;I0)return this.toBeTiled[R]=!1,!1;if($.getChild()==null){this.toBeTiled[$.id]=!1;continue}if(!this.getToBeTiled($))return this.toBeTiled[R]=!1,!1}return this.toBeTiled[R]=!0,!0},z.prototype.getNodeDegree=function(A){A.id;for(var R=A.getEdges(),N=0,D=0;DX&&(X=ie.rect.height)}N+=X+A.verticalPadding}},z.prototype.tileCompoundMembers=function(A,R){var N=this;this.tiledMemberPack=[],Object.keys(A).forEach(function(D){var I=R[D];if(N.tiledMemberPack[D]=N.tileNodes(A[D],I.paddingLeft+I.paddingRight),I.rect.width=N.tiledMemberPack[D].width,I.rect.height=N.tiledMemberPack[D].height,I.setCenter(N.tiledMemberPack[D].centerX,N.tiledMemberPack[D].centerY),I.labelMarginLeft=0,I.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var $=I.rect.width,B=I.rect.height;I.labelWidth&&(I.labelPosHorizontal=="left"?(I.rect.x-=I.labelWidth,I.setWidth($+I.labelWidth),I.labelMarginLeft=I.labelWidth):I.labelPosHorizontal=="center"&&I.labelWidth>$?(I.rect.x-=(I.labelWidth-$)/2,I.setWidth(I.labelWidth),I.labelMarginLeft=(I.labelWidth-$)/2):I.labelPosHorizontal=="right"&&I.setWidth($+I.labelWidth)),I.labelHeight&&(I.labelPosVertical=="top"?(I.rect.y-=I.labelHeight,I.setHeight(B+I.labelHeight),I.labelMarginTop=I.labelHeight):I.labelPosVertical=="center"&&I.labelHeight>B?(I.rect.y-=(I.labelHeight-B)/2,I.setHeight(I.labelHeight),I.labelMarginTop=(I.labelHeight-B)/2):I.labelPosVertical=="bottom"&&I.setHeight(B+I.labelHeight))}})},z.prototype.tileNodes=function(A,R){var N=this.tileNodesByFavoringDim(A,R,!0),D=this.tileNodesByFavoringDim(A,R,!1),I=this.getOrgRatio(N),$=this.getOrgRatio(D),B;return $P&&(P=se.getWidth())});var G=$/I,V=B/I,X=Math.pow(N-D,2)+4*(G+D)*(V+N)*I,W=(D-N+Math.sqrt(X))/(2*(G+D)),ie;R?(ie=Math.ceil(W),ie==W&&ie++):ie=Math.floor(W);var K=ie*(G+D)-D;return P>K&&(K=P),K+=D*2,K},z.prototype.tileNodesByFavoringDim=function(A,R,N){var D=m.TILING_PADDING_VERTICAL,I=m.TILING_PADDING_HORIZONTAL,$=m.TILING_COMPARE_BY,B={rows:[],rowWidth:[],rowHeight:[],width:0,height:R,verticalPadding:D,horizontalPadding:I,centerX:0,centerY:0};$&&(B.idealRowWidth=this.calcIdealRowWidth(A,N));var P=function(J){return J.rect.width*J.rect.height},G=function(J,Z){return P(Z)-P(J)};A.sort(function(se,J){var Z=G;return B.idealRowWidth?(Z=$,Z(se.id,J.id)):Z(se,J)});for(var V=0,X=0,W=0;W0&&(B+=A.horizontalPadding),A.rowWidth[N]=B,A.width0&&(P+=A.verticalPadding);var G=0;P>A.rowHeight[N]&&(G=A.rowHeight[N],A.rowHeight[N]=P,G=A.rowHeight[N]-G),A.height+=G,A.rows[N].push(R)},z.prototype.getShortestRowIndex=function(A){for(var R=-1,N=Number.MAX_VALUE,D=0;DN&&(R=D,N=A.rowWidth[D]);return R},z.prototype.canAddHorizontal=function(A,R,N){if(A.idealRowWidth){var D=A.rows.length-1,I=A.rowWidth[D];return I+R+A.horizontalPadding<=A.idealRowWidth}var $=this.getShortestRowIndex(A);if($<0)return!0;var B=A.rowWidth[$];if(B+A.horizontalPadding+R<=A.width)return!0;var P=0;A.rowHeight[$]0&&(P=N+A.verticalPadding-A.rowHeight[$]);var G;A.width-B>=R+A.horizontalPadding?G=(A.height+P)/(B+R+A.horizontalPadding):G=(A.height+P)/A.width,P=N+A.verticalPadding;var V;return A.width$&&R!=N){D.splice(-1,1),A.rows[N].push(I),A.rowWidth[R]=A.rowWidth[R]-$,A.rowWidth[N]=A.rowWidth[N]+$,A.width=A.rowWidth[instance.getLongestRowIndex(A)];for(var B=Number.MIN_VALUE,P=0;PB&&(B=D[P].height);R>0&&(B+=A.verticalPadding);var G=A.rowHeight[R]+A.rowHeight[N];A.rowHeight[R]=B,A.rowHeight[N]0)for(var K=I;K<=$;K++)ie[0]+=this.grid[K][B-1].length+this.grid[K][B].length-1;if($0)for(var K=B;K<=P;K++)ie[3]+=this.grid[I-1][K].length+this.grid[I][K].length-1;for(var se=C.MAX_VALUE,J,Z,ee=0;ee{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,y,v){h.call(this,g,m,y,v)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var y=this.getChild().getNodes(),v,x=0;x{function h(y){if(Array.isArray(y)){for(var v=0,x=Array(y.length);v0){var Et=0;be.forEach(function(ot){pe=="horizontal"?(qe.set(ot,b.has(ot)?w[b.get(ot)]:Fe.get(ot)),Et+=qe.get(ot)):(qe.set(ot,b.has(ot)?k[b.get(ot)]:Fe.get(ot)),Et+=qe.get(ot))}),Et=Et/be.length,lt.forEach(function(ot){re.has(ot)||qe.set(ot,Et)})}else{var vt=0;lt.forEach(function(ot){pe=="horizontal"?vt+=b.has(ot)?w[b.get(ot)]:Fe.get(ot):vt+=b.has(ot)?k[b.get(ot)]:Fe.get(ot)}),vt=vt/lt.length,lt.forEach(function(ot){qe.set(ot,vt)})}});for(var De=function(){var be=Xe.shift(),Et=j.get(be);Et.forEach(function(vt){if(qe.get(vt.id)ot&&(ot=wt),MrIt&&(It=Mr)}}catch(_r){ht=!0,oe=_r}finally{try{!xt&&At.return&&At.return()}finally{if(ht)throw oe}}var ye=(Et+ot)/2-(vt+It)/2,et=!0,ct=!1,_t=void 0;try{for(var Ft=lt[Symbol.iterator](),nr;!(et=(nr=Ft.next()).done);et=!0){var ir=nr.value;qe.set(ir,qe.get(ir)+ye)}}catch(_r){ct=!0,_t=_r}finally{try{!et&&Ft.return&&Ft.return()}finally{if(ct)throw _t}}})}return qe},F=function(j){var pe=0,re=0,Fe=0,xe=0;if(j.forEach(function(Le){Le.left?w[b.get(Le.left)]-w[b.get(Le.right)]>=0?pe++:re++:k[b.get(Le.top)]-k[b.get(Le.bottom)]>=0?Fe++:xe++}),pe>re&&Fe>xe)for(var Ue=0;Uere)for(var Me=0;Mexe)for(var qe=0;qe1)v.fixedNodeConstraint.forEach(function(he,j){D[j]=[he.position.x,he.position.y],I[j]=[w[b.get(he.nodeId)],k[b.get(he.nodeId)]]}),$=!0;else if(v.alignmentConstraint)(function(){var he=0;if(v.alignmentConstraint.vertical){for(var j=v.alignmentConstraint.vertical,pe=function(qe){var Le=new Set;j[qe].forEach(function(it){Le.add(it)});var Xe=new Set([].concat(h(Le)).filter(function(it){return P.has(it)})),De=void 0;Xe.size>0?De=w[b.get(Xe.values().next().value)]:De=M(Le).x,j[qe].forEach(function(it){D[he]=[De,k[b.get(it)]],I[he]=[w[b.get(it)],k[b.get(it)]],he++})},re=0;re0?De=w[b.get(Xe.values().next().value)]:De=M(Le).y,Fe[qe].forEach(function(it){D[he]=[w[b.get(it)],De],I[he]=[w[b.get(it)],k[b.get(it)]],he++})},Ue=0;UeW&&(W=X[K].length,ie=K);if(W0){var ke={x:0,y:0};v.fixedNodeConstraint.forEach(function(he,j){var pe={x:w[b.get(he.nodeId)],y:k[b.get(he.nodeId)]},re=he.position,Fe=O(re,pe);ke.x+=Fe.x,ke.y+=Fe.y}),ke.x/=v.fixedNodeConstraint.length,ke.y/=v.fixedNodeConstraint.length,w.forEach(function(he,j){w[j]+=ke.x}),k.forEach(function(he,j){k[j]+=ke.y}),v.fixedNodeConstraint.forEach(function(he){w[b.get(he.nodeId)]=he.position.x,k[b.get(he.nodeId)]=he.position.y})}if(v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var Ve=v.alignmentConstraint.vertical,Qe=function(j){var pe=new Set;Ve[j].forEach(function(xe){pe.add(xe)});var re=new Set([].concat(h(pe)).filter(function(xe){return P.has(xe)})),Fe=void 0;re.size>0?Fe=w[b.get(re.values().next().value)]:Fe=M(pe).x,pe.forEach(function(xe){P.has(xe)||(w[b.get(xe)]=Fe)})},nt=0;nt0?Fe=k[b.get(re.values().next().value)]:Fe=M(pe).y,pe.forEach(function(xe){P.has(xe)||(k[b.get(xe)]=Fe)})},Ce=0;Ce{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(45);return s})()})})(jS)),jS.exports}var R0t=KS.exports,Tye;function L0t(){return Tye||(Tye=1,(function(t,e){(function(n,i){t.exports=i(_0t())})(R0t,function(r){return(()=>{var n={658:(o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d{var h=(function(){function p(g,m){var y=[],v=!0,x=!1,b=void 0;try{for(var w=g[Symbol.iterator](),k;!(v=(k=w.next()).done)&&(y.push(k.value),!(m&&y.length===m));v=!0);}catch(S){x=!0,b=S}finally{try{!v&&w.return&&w.return()}finally{if(x)throw b}}return y}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m0&&$.merge(V)});for(var B=0;B<$.length;B++){var P=$[B];if(w=m.intersection(P.union(P.ancestors())),w!=null&&!x.has(w[0])){var G=w.union(w.descendants());G.forEach(function(V){v.push(V),x.add(V),F.merge(V),m.has(V)&&b.push(V)})}}};v.length!=0;)N();if(F.forEach(function(I){g.intersection(I.connectedEdges()).forEach(function($){F.has($.source())&&F.has($.target())&&F.merge($)})}),b.length==m.length&&(C=!0),!C||C&&_>1){k=b[0],S=k.connectedEdges().length,b.forEach(function(I){I.connectedEdges().length0&&y.set("dummy"+(y.size+1),L),O},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var y=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var w=!0,k=!1,S=void 0;try{for(var C=g.nodeIndexes[Symbol.iterator](),_;!(w=(_=C.next()).done);w=!0){var L=_.value,O=h(L,2),M=O[0],z=O[1],F=m.cy.getElementById(M);if(F){var A=F.boundingBox(),R=g.xCoords[z]-A.w/2,N=g.xCoords[z]+A.w/2,D=g.yCoords[z]-A.h/2,I=g.yCoords[z]+A.h/2;Rv&&(v=N),Db&&(b=I)}}}catch(V){k=!0,S=V}finally{try{!w&&C.return&&C.return()}finally{if(k)throw S}}var $=p.x-(v+y)/2,B=p.y-(b+x)/2;g.xCoords=g.xCoords.map(function(V){return V+$}),g.yCoords=g.yCoords.map(function(V){return V+B})}else{Object.keys(g).forEach(function(V){var X=g[V],W=X.getRect().x,ie=X.getRect().x+X.getRect().width,K=X.getRect().y,se=X.getRect().y+X.getRect().height;Wv&&(v=ie),Kb&&(b=se)});var P=p.x-(v+y)/2,G=p.y-(b+x)/2;Object.keys(g).forEach(function(V){var X=g[V];X.setCenter(X.getCenterX()+P,X.getCenterY()+G)})}}},f.calcBoundingBox=function(p,g,m,y){for(var v=Number.MAX_SAFE_INTEGER,x=Number.MIN_SAFE_INTEGER,b=Number.MAX_SAFE_INTEGER,w=Number.MIN_SAFE_INTEGER,k=void 0,S=void 0,C=void 0,_=void 0,L=p.descendants().not(":parent"),O=L.length,M=0;Mk&&(v=k),xC&&(b=C),w<_&&(w=_)}var F={};return F.topLeftX=v,F.topLeftY=b,F.width=x-v,F.height=w-b,F},f.calcParentsWithoutChildren=function(p,g){var m=p.collection();return g.nodes(":parent").forEach(function(y){var v=!1;y.children().forEach(function(x){x.css("display")!="none"&&(v=!0)}),v||m.merge(y)}),m},o.exports=f}),816:((o,l,u)=>{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,y=u(140).layoutBase.FDLayoutConstants,v=u(140).CoSEConstants,x=function(w,k){var S=w.cy,C=w.eles,_=C.nodes(),L=C.edges(),O=void 0,M=void 0,z=void 0,F={};w.randomize&&(O=k.nodeIndexes,M=k.xCoords,z=k.yCoords);var A=function(V){return typeof V=="function"},R=function(V,X){return A(V)?V(X):V},N=h.calcParentsWithoutChildren(S,C),D=function G(V,X,W,ie){for(var K=X.length,se=0;se0){var fe=void 0;fe=W.getGraphManager().add(W.newGraph(),ee),G(fe,Z,W,ie)}}},I=function(V,X,W){for(var ie=0,K=0,se=0;se0?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=ie/K:A(w.idealEdgeLength)?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=50:v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=w.idealEdgeLength,v.MIN_REPULSION_DIST=y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,v.DEFAULT_RADIAL_SEPARATION=y.DEFAULT_EDGE_LENGTH)},$=function(V,X){X.fixedNodeConstraint&&(V.constraints.fixedNodeConstraint=X.fixedNodeConstraint),X.alignmentConstraint&&(V.constraints.alignmentConstraint=X.alignmentConstraint),X.relativePlacementConstraint&&(V.constraints.relativePlacementConstraint=X.relativePlacementConstraint)};w.nestingFactor!=null&&(v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor),w.gravity!=null&&(v.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=w.gravity),w.numIter!=null&&(v.MAX_ITERATIONS=y.MAX_ITERATIONS=w.numIter),w.gravityRange!=null&&(v.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange),w.gravityCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound),w.gravityRangeCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound),w.initialEnergyOnIncremental!=null&&(v.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental),w.tilingCompareBy!=null&&(v.TILING_COMPARE_BY=w.tilingCompareBy),w.quality=="proof"?m.QUALITY=2:m.QUALITY=0,v.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!w.randomize,v.ANIMATE=y.ANIMATE=m.ANIMATE=w.animate,v.TILE=w.tile,v.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical=="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,v.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal=="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,v.PURE_INCREMENTAL=!w.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=w.uniformNodeDimensions,w.step=="transformed"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!1),w.step=="enforced"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!1),w.step=="cose"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!0),w.step=="all"&&(w.randomize?v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!0),w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint?v.TREE_REDUCTION_ON_INCREMENTAL=!1:v.TREE_REDUCTION_ON_INCREMENTAL=!0;var B=new d,P=B.newGraphManager();return D(P.addRoot(),h.getTopMostNodes(_),B,w),I(B,P,L),$(B,w),B.runLayout(),F};o.exports={coseLayout:x}}),212:((o,l,u)=>{var h=(function(){function w(k,S){for(var C=0;C0)if(N){var $=p.getTopMostNodes(C.eles.nodes());if(z=p.connectComponents(_,C.eles,$),z.forEach(function(Ne){var me=Ne.boundingBox();F.push({x:me.x1+me.w/2,y:me.y1+me.h/2})}),C.randomize&&z.forEach(function(Ne){C.eles=Ne,O.push(m(C))}),C.quality=="default"||C.quality=="proof"){var B=_.collection();if(C.tile){var P=new Map,G=[],V=[],X=0,W={nodeIndexes:P,xCoords:G,yCoords:V},ie=[];if(z.forEach(function(Ne,me){Ne.edges().length==0&&(Ne.nodes().forEach(function(ve,Ge){B.merge(Ne.nodes()[Ge]),ve.isParent()||(W.nodeIndexes.set(Ne.nodes()[Ge].id(),X++),W.xCoords.push(Ne.nodes()[0].position().x),W.yCoords.push(Ne.nodes()[0].position().y))}),ie.push(me))}),B.length>1){var K=B.boundingBox();F.push({x:K.x1+K.w/2,y:K.y1+K.h/2}),z.push(B),O.push(W);for(var se=ie.length-1;se>=0;se--)z.splice(ie[se],1),O.splice(ie[se],1),F.splice(ie[se],1)}}z.forEach(function(Ne,me){C.eles=Ne,M.push(v(C,O[me])),p.relocateComponent(F[me],M[me],C)})}else z.forEach(function(Ne,me){p.relocateComponent(F[me],O[me],C)});var J=new Set;if(z.length>1){var Z=[],ee=L.filter(function(Ne){return Ne.css("display")=="none"});z.forEach(function(Ne,me){var ve=void 0;if(C.quality=="draft"&&(ve=O[me].nodeIndexes),Ne.nodes().not(ee).length>0){var Ge={};Ge.edges=[],Ge.nodes=[];var Te=void 0;Ne.nodes().not(ee).forEach(function(Ze){if(C.quality=="draft")if(!Ze.isParent())Te=ve.get(Ze.id()),Ge.nodes.push({x:O[me].xCoords[Te]-Ze.boundingbox().w/2,y:O[me].yCoords[Te]-Ze.boundingbox().h/2,width:Ze.boundingbox().w,height:Ze.boundingbox().h});else{var ke=p.calcBoundingBox(Ze,O[me].xCoords,O[me].yCoords,ve);Ge.nodes.push({x:ke.topLeftX,y:ke.topLeftY,width:ke.width,height:ke.height})}else M[me][Ze.id()]&&Ge.nodes.push({x:M[me][Ze.id()].getLeft(),y:M[me][Ze.id()].getTop(),width:M[me][Ze.id()].getWidth(),height:M[me][Ze.id()].getHeight()})}),Ne.edges().forEach(function(Ze){var ke=Ze.source(),Ve=Ze.target();if(ke.css("display")!="none"&&Ve.css("display")!="none")if(C.quality=="draft"){var Qe=ve.get(ke.id()),nt=ve.get(Ve.id()),tt=[],je=[];if(ke.isParent()){var Ce=p.calcBoundingBox(ke,O[me].xCoords,O[me].yCoords,ve);tt.push(Ce.topLeftX+Ce.width/2),tt.push(Ce.topLeftY+Ce.height/2)}else tt.push(O[me].xCoords[Qe]),tt.push(O[me].yCoords[Qe]);if(Ve.isParent()){var Se=p.calcBoundingBox(Ve,O[me].xCoords,O[me].yCoords,ve);je.push(Se.topLeftX+Se.width/2),je.push(Se.topLeftY+Se.height/2)}else je.push(O[me].xCoords[nt]),je.push(O[me].yCoords[nt]);Ge.edges.push({startX:tt[0],startY:tt[1],endX:je[0],endY:je[1]})}else M[me][ke.id()]&&M[me][Ve.id()]&&Ge.edges.push({startX:M[me][ke.id()].getCenterX(),startY:M[me][ke.id()].getCenterY(),endX:M[me][Ve.id()].getCenterX(),endY:M[me][Ve.id()].getCenterY()})}),Ge.nodes.length>0&&(Z.push(Ge),J.add(me))}});var ne=R.packComponents(Z,C.randomize).shifts;if(C.quality=="draft")O.forEach(function(Ne,me){var ve=Ne.xCoords.map(function(Te){return Te+ne[me].dx}),Ge=Ne.yCoords.map(function(Te){return Te+ne[me].dy});Ne.xCoords=ve,Ne.yCoords=Ge});else{var ue=0;J.forEach(function(Ne){Object.keys(M[Ne]).forEach(function(me){var ve=M[Ne][me];ve.setCenter(ve.getCenterX()+ne[ue].dx,ve.getCenterY()+ne[ue].dy)}),ue++})}}}else{var D=C.eles.boundingBox();if(F.push({x:D.x1+D.w/2,y:D.y1+D.h/2}),C.randomize){var I=m(C);O.push(I)}C.quality=="default"||C.quality=="proof"?(M.push(v(C,O[0])),p.relocateComponent(F[0],M[0],C)):p.relocateComponent(F[0],O[0],C)}var fe=function(me,ve){if(C.quality=="default"||C.quality=="proof"){typeof me=="number"&&(me=ve);var Ge=void 0,Te=void 0,Ze=me.data("id");return M.forEach(function(Ve){Ze in Ve&&(Ge={x:Ve[Ze].getRect().getCenterX(),y:Ve[Ze].getRect().getCenterY()},Te=Ve[Ze])}),C.nodeDimensionsIncludeLabels&&(Te.labelWidth&&(Te.labelPosHorizontal=="left"?Ge.x+=Te.labelWidth/2:Te.labelPosHorizontal=="right"&&(Ge.x-=Te.labelWidth/2)),Te.labelHeight&&(Te.labelPosVertical=="top"?Ge.y+=Te.labelHeight/2:Te.labelPosVertical=="bottom"&&(Ge.y-=Te.labelHeight/2))),Ge==null&&(Ge={x:me.position("x"),y:me.position("y")}),{x:Ge.x,y:Ge.y}}else{var ke=void 0;return O.forEach(function(Ve){var Qe=Ve.nodeIndexes.get(me.id());Qe!=null&&(ke={x:Ve.xCoords[Qe],y:Ve.yCoords[Qe]})}),ke==null&&(ke={x:me.position("x"),y:me.position("y")}),{x:ke.x,y:ke.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var _e=p.calcParentsWithoutChildren(_,L),Ae=L.filter(function(Ne){return Ne.css("display")=="none"});C.eles=L.not(Ae),L.nodes().not(":parent").not(Ae).layoutPositions(S,C,fe),_e.length>0&&_e.forEach(function(Ne){Ne.position(fe(Ne))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w})();o.exports=b}),657:((o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var y=m.cy,v=m.eles,x=v.nodes(),b=v.nodes(":parent"),w=new Map,k=new Map,S=new Map,C=[],_=[],L=[],O=[],M=[],z=[],F=[],A=[],R=void 0,N=1e8,D=1e-9,I=m.piTol,$=m.samplingType,B=m.nodeSeparation,P=void 0,G=function(){for(var j=0,pe=0,re=!1;pe=xe;){Me=Fe[xe++];for(var we=C[Me],lt=0;ltXe&&(Xe=M[Et],De=Et)}return De},X=function(j){var pe=void 0;if(j){pe=Math.floor(Math.random()*R);for(var Fe=0;Fe=1)break;Le=qe}for(var it=0;it=1)break;Le=qe}for(var lt=0;lt0&&(pe.isParent()?C[j].push(S.get(pe.id())):C[j].push(pe.id()))})});var Ae=function(j){var pe=k.get(j),re=void 0;w.get(j).forEach(function(Fe){y.getElementById(Fe).isParent()?re=S.get(Fe):re=Fe,C[pe].push(re),C[k.get(re)].push(j)})},Ne=!0,me=!1,ve=void 0;try{for(var Ge=w.keys()[Symbol.iterator](),Te;!(Ne=(Te=Ge.next()).done);Ne=!0){var Ze=Te.value;Ae(Ze)}}catch(he){me=!0,ve=he}finally{try{!Ne&&Ge.return&&Ge.return()}finally{if(me)throw ve}}R=k.size;var ke=void 0;if(R>2){P=R{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d}),140:(o=>{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(579);return s})()})})(KS)),KS.exports}var I0t=L0t();const D0t=Os(I0t);var wye={L:"left",R:"right",T:"top",B:"bottom"},Cye={L:T(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:T(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:T(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:T(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},QS={L:T((t,e)=>t-e+2,"L"),R:T((t,e)=>t-2,"R"),T:T((t,e)=>t-e+2,"T"),B:T((t,e)=>t-2,"B")},M0t=T(function(t){return fs(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),kye=T(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),fs=T(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),Oh=T(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),bP=T(function(t,e){const r=fs(t)&&Oh(e),n=Oh(t)&&fs(e);return r||n},"isArchitectureDirectionXY"),N0t=T(function(t){const e=t[0],r=t[1],n=fs(e)&&Oh(r),i=Oh(e)&&fs(r);return n||i},"isArchitecturePairXY"),O0t=T(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),xP=T(function(t,e){const r=`${t}${e}`;return O0t(r)?r:void 0},"getArchitectureDirectionPair"),$0t=T(function([t,e],r){const n=r[0],i=r[1];return fs(n)?Oh(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:fs(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),P0t=T(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),B0t=T(function(t,e){return bP(t,e)?"bend":fs(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),F0t=T(function(t){return t.type==="service"},"isArchitectureService"),z0t=T(function(t){return t.type==="junction"},"isArchitectureJunction"),Eye=T(t=>t.data(),"edgeData"),cm=T(t=>t.data(),"nodeData"),G0t=Fr.architecture,Sye=(Yv=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Dn,this.getAccTitle=Fn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getAccDescription=Gn,this.setAccDescription=zn,this.clear()}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",In()}addService({id:e,icon:r,in:n,title:i,iconText:a}){if(this.registeredIds[e]!==void 0)throw new Error(`The service id [${e}] is already in use by another ${this.registeredIds[e]}`);if(n!==void 0){if(e===n)throw new Error(`The service [${e}] cannot be placed within itself`);if(this.registeredIds[n]===void 0)throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[n]==="node")throw new Error(`The service [${e}]'s parent is not a group`)}this.registeredIds[e]="node",this.nodes[e]={id:e,type:"service",icon:r,iconText:a,title:i,edges:[],in:n}}getServices(){return Object.values(this.nodes).filter(F0t)}addJunction({id:e,in:r}){if(this.registeredIds[e]!==void 0)throw new Error(`The junction id [${e}] is already in use by another ${this.registeredIds[e]}`);if(r!==void 0){if(e===r)throw new Error(`The junction [${e}] cannot be placed within itself`);if(this.registeredIds[r]===void 0)throw new Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[r]==="node")throw new Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds[e]="node",this.nodes[e]={id:e,type:"junction",edges:[],in:r}}getJunctions(){return Object.values(this.nodes).filter(z0t)}getNodes(){return Object.values(this.nodes)}getNode(e){return this.nodes[e]??null}addGroup({id:e,icon:r,in:n,title:i}){var a,s,o;if(((a=this.registeredIds)==null?void 0:a[e])!==void 0)throw new Error(`The group id [${e}] is already in use by another ${this.registeredIds[e]}`);if(n!==void 0){if(e===n)throw new Error(`The group [${e}] cannot be placed within itself`);if(((s=this.registeredIds)==null?void 0:s[n])===void 0)throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(((o=this.registeredIds)==null?void 0:o[n])==="node")throw new Error(`The group [${e}]'s parent is not a group`)}this.registeredIds[e]="group",this.groups[e]={id:e,icon:r,title:i,in:n}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:e,rhsId:r,lhsDir:n,rhsDir:i,lhsInto:a,rhsInto:s,lhsGroup:o,rhsGroup:l,title:u}){if(!kye(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!kye(i))throw new Error(`Invalid direction given for right hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(i)}`);if(this.nodes[e]===void 0&&this.groups[e]===void 0)throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[r]===void 0&&this.groups[r]===void 0)throw new Error(`The right-hand id [${r}] does not yet exist. Please create the service/group before declaring an edge to it.`);const h=this.nodes[e].in,d=this.nodes[r].in;if(o&&h&&d&&h==d)throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&h&&d&&h==d)throw new Error(`The right-hand id [${r}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const f={lhsId:e,lhsDir:n,lhsInto:a,lhsGroup:o,rhsId:r,rhsDir:i,rhsInto:s,rhsGroup:l,title:u};this.edges.push(f),this.nodes[e]&&this.nodes[r]&&(this.nodes[e].edges.push(this.edges[this.edges.length-1]),this.nodes[r].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const e={},r=Object.entries(this.nodes).reduce((l,[u,h])=>(l[u]=h.edges.reduce((d,f)=>{var m,y;const p=(m=this.getNode(f.lhsId))==null?void 0:m.in,g=(y=this.getNode(f.rhsId))==null?void 0:y.in;if(p&&g&&p!==g){const v=B0t(f.lhsDir,f.rhsDir);v!=="bend"&&(e[p]??(e[p]={}),e[p][g]=v,e[g]??(e[g]={}),e[g][p]=v)}if(f.lhsId===u){const v=xP(f.lhsDir,f.rhsDir);v&&(d[v]=f.rhsId)}else{const v=xP(f.rhsDir,f.lhsDir);v&&(d[v]=f.lhsId)}return d},{}),l),{}),n=Object.keys(r)[0],i={[n]:1},a=Object.keys(r).reduce((l,u)=>u===n?l:{...l,[u]:1},{}),s=T(l=>{const u={[l]:[0,0]},h=[l];for(;h.length>0;){const d=h.shift();if(d){i[d]=1,delete a[d];const f=r[d],[p,g]=u[d];Object.entries(f).forEach(([m,y])=>{i[y]||(u[y]=$0t([p,g],m),h.push(y))})}}return u},"BFS"),o=[s(n)];for(;Object.keys(a).length>0;)o.push(s(Object.keys(a)[0]));this.dataStructures={adjList:r,spatialMaps:o,groupAlignments:e}}return this.dataStructures}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}getConfig(){return ti({...G0t,...lr().architecture})}getConfigField(e){return this.getConfig()[e]}},T(Yv,"ArchitectureDB"),Yv),q0t=T((t,e)=>{zl(t,e),t.groups.map(r=>e.addGroup(r)),t.services.map(r=>e.addService({...r,type:"service"})),t.junctions.map(r=>e.addJunction({...r,type:"junction"})),t.edges.map(r=>e.addEdge(r))},"populateDb"),Aye={parser:{yy:void 0},parse:T(async t=>{var n;const e=await Qo("architecture",t);ae.debug(e);const r=(n=Aye.parser)==null?void 0:n.yy;if(!(r instanceof Sye))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");q0t(e,r)},"parse")},V0t=T(t=>` .edge { stroke-width: ${t.archEdgeWidth}; stroke: ${t.archEdgeColor}; @@ -3158,10 +3158,10 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":ue="Parse error stroke-dasharray: 8; } .node-icon-text { - display: flex; + display: flex; align-items: center; } - + .node-icon-text > div { color: #fff; margin: 1px; @@ -3171,19 +3171,19 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":ue="Parse error display: -webkit-box; -webkit-box-orient: vertical; } -`,"getStyles"),Ipt=Lpt,cm=x(t=>`${t}`,"wrapIcon"),aw={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:cm('')},server:{body:cm('')},disk:{body:cm('')},internet:{body:cm('')},cloud:{body:cm('')},unknown:NV,blank:{body:cm("")}}},Dpt=x(async function(t,e,r,n){const i=r.getConfigField("padding"),a=r.getConfigField("iconSize"),s=a/2,o=a/6,l=o/2;await Promise.all(e.edges().map(async u=>{var O,M;const{source:h,sourceDir:d,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:y,targetGroup:v,label:T}=bye(u);let{x:b,y:w}=u[0].sourceEndpoint();const{x:k,y:A}=u[0].midpoint();let{x:C,y:_}=u[0].targetEndpoint();const L=i+4;if(p&&(fs(d)?b+=d==="L"?-L:L:w+=d==="T"?-L:L+18),v&&(fs(m)?C+=m==="L"?-L:L:_+=m==="T"?-L:L+18),!p&&((O=r.getNode(h))==null?void 0:O.type)==="junction"&&(fs(d)?b+=d==="L"?s:-s:w+=d==="T"?s:-s),!v&&((M=r.getNode(g))==null?void 0:M.type)==="junction"&&(fs(m)?C+=m==="L"?s:-s:_+=m==="T"?s:-s),u[0]._private.rscratch){const z=t.insert("g");if(z.insert("path").attr("d",`M ${b},${w} L ${k},${A} L${C},${_} `).attr("class","edge").attr("id",`${n}-${V0(h,g,{prefix:"L"})}`),f){const F=fs(d)?KS[d](b,o):b-l,S=Oh(d)?KS[d](w,o):w-l;z.insert("polygon").attr("points",yye[d](o)).attr("transform",`translate(${F},${S})`).attr("class","arrow")}if(y){const F=fs(m)?KS[m](C,o):C-l,S=Oh(m)?KS[m](_,o):_-l;z.insert("polygon").attr("points",yye[m](o)).attr("transform",`translate(${F},${S})`).attr("class","arrow")}if(T){const F=pP(d,m)?"XY":fs(d)?"X":"Y";let S=0;F==="X"?S=Math.abs(b-C):F==="Y"?S=Math.abs(w-_)/1.5:S=Math.abs(b-C)/2;const R=z.append("g");if(await Wa(R,T,{useHtmlLabels:!1,width:S,classes:"architecture-service-label"},Pe()),R.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),F==="X")R.attr("transform","translate("+k+", "+A+")");else if(F==="Y")R.attr("transform","translate("+k+", "+A+") rotate(-90)");else if(F==="XY"){const N=gP(d,m);if(N&&Tpt(N)){const D=R.node().getBoundingClientRect(),[I,$]=kpt(N);R.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*I*$*45})`);const B=R.node().getBoundingClientRect();R.attr("transform",` - translate(${k}, ${A-D.height/2}) +`,"getStyles"),W0t=V0t,um=T(t=>`${t}`,"wrapIcon"),ow={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:um('')},server:{body:um('')},disk:{body:um('')},internet:{body:um('')},cloud:{body:um('')},unknown:FV,blank:{body:um("")}}},U0t=T(async function(t,e,r,n){const i=r.getConfigField("padding"),a=r.getConfigField("iconSize"),s=a/2,o=a/6,l=o/2;await Promise.all(e.edges().map(async u=>{var O,M;const{source:h,sourceDir:d,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:y,targetGroup:v,label:x}=Eye(u);let{x:b,y:w}=u[0].sourceEndpoint();const{x:k,y:S}=u[0].midpoint();let{x:C,y:_}=u[0].targetEndpoint();const L=i+4;if(p&&(fs(d)?b+=d==="L"?-L:L:w+=d==="T"?-L:L+18),v&&(fs(m)?C+=m==="L"?-L:L:_+=m==="T"?-L:L+18),!p&&((O=r.getNode(h))==null?void 0:O.type)==="junction"&&(fs(d)?b+=d==="L"?s:-s:w+=d==="T"?s:-s),!v&&((M=r.getNode(g))==null?void 0:M.type)==="junction"&&(fs(m)?C+=m==="L"?s:-s:_+=m==="T"?s:-s),u[0]._private.rscratch){const z=t.insert("g");if(z.insert("path").attr("d",`M ${b},${w} L ${k},${S} L${C},${_} `).attr("class","edge").attr("id",`${n}-${Vp(h,g,{prefix:"L"})}`),f){const F=fs(d)?QS[d](b,o):b-l,A=Oh(d)?QS[d](w,o):w-l;z.insert("polygon").attr("points",Cye[d](o)).attr("transform",`translate(${F},${A})`).attr("class","arrow")}if(y){const F=fs(m)?QS[m](C,o):C-l,A=Oh(m)?QS[m](_,o):_-l;z.insert("polygon").attr("points",Cye[m](o)).attr("transform",`translate(${F},${A})`).attr("class","arrow")}if(x){const F=bP(d,m)?"XY":fs(d)?"X":"Y";let A=0;F==="X"?A=Math.abs(b-C):F==="Y"?A=Math.abs(w-_)/1.5:A=Math.abs(b-C)/2;const R=z.append("g");if(await Wa(R,x,{useHtmlLabels:!1,width:A,classes:"architecture-service-label"},Pe()),R.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),F==="X")R.attr("transform","translate("+k+", "+S+")");else if(F==="Y")R.attr("transform","translate("+k+", "+S+") rotate(-90)");else if(F==="XY"){const N=xP(d,m);if(N&&N0t(N)){const D=R.node().getBoundingClientRect(),[I,$]=P0t(N);R.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*I*$*45})`);const B=R.node().getBoundingClientRect();R.attr("transform",` + translate(${k}, ${S-D.height/2}) translate(${I*B.width/2}, ${$*B.height/2}) rotate(${-1*I*$*45}, 0, ${D.height/2}) - `)}}}}}))},"drawEdges"),Mpt=x(async function(t,e,r,n){const a=r.getConfigField("padding")*.75,s=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=lm(u);if(h.type==="group"){const{h:d,w:f,x1:p,y1:g}=u.boundingBox(),m=t.append("rect");m.attr("id",`${n}-group-${h.id}`).attr("x",p+l).attr("y",g+l).attr("width",f).attr("height",d).attr("class","node-bkg");const y=t.append("g");let v=p,T=g;if(h.icon){const b=y.append("g");b.html(`${await Lu(h.icon,{height:a,width:a,fallbackPrefix:aw.prefix})}`),b.attr("transform","translate("+(v+l+1)+", "+(T+l+1)+")"),v+=a,T+=s/2-1-2}if(h.label){const b=y.append("g");await Wa(b,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},Pe()),b.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),b.attr("transform","translate("+(v+l+4)+", "+(T+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),Npt=x(async function(t,e,r,n){const i=Pe();for(const a of r){const s=e.append("g"),o=t.getConfigField("iconSize");if(a.title){const d=s.append("g");await Wa(d,a.title,{useHtmlLabels:!1,width:o*1.5,classes:"architecture-service-label"},i),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+o/2+", "+o+")")}const l=s.append("g");if(a.icon)l.html(`${await Lu(a.icon,{height:o,width:o,fallbackPrefix:aw.prefix})}`);else if(a.iconText){l.html(`${await Lu("blank",{height:o,width:o,fallbackPrefix:aw.prefix})}`);const p=l.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(qr(a.iconText,i)),g=parseInt(window.getComputedStyle(p.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;p.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/g)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${a.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);s.attr("id",`${n}-service-${a.id}`).attr("class","architecture-service");const{width:u,height:h}=s.node().getBBox();a.width=u,a.height=h,t.setElementForId(a.id,s)}return 0},"drawServices"),Opt=x(function(t,e,r,n){r.forEach(i=>{const a=e.append("g"),s=t.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",s).attr("height",s),a.attr("class","architecture-junction");const{width:l,height:u}=a._groups[0][0].getBBox();a.width=l,a.height=u,t.setElementForId(i.id,a)})},"drawJunctions");$V([{name:aw.prefix,icons:aw}]),Pl.use(bpt);function wye(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}x(wye,"addServices");function Cye(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}x(Cye,"addJunctions");function kye(t,e){e.nodes().map(r=>{const n=lm(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}x(kye,"positionNodes");function Eye(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}x(Eye,"addGroups");function Sye(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:s,rhsInto:o,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=pP(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:a,sourceGroup:s,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:o,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}x(Sye,"addEdges");function Aye(t,e,r){const n=x((o,l)=>Object.entries(o).reduce((u,[h,d])=>{var g;let f=0;const p=Object.entries(d);if(p.length===1)return u[h]=p[0][1],u;for(let m=0;m{const l={},u={};return Object.entries(o).forEach(([h,[d,f]])=>{var g,m,y;const p=((g=t.getNode(h))==null?void 0:g.in)??"default";l[f]??(l[f]={}),(m=l[f])[p]??(m[p]=[]),l[f][p].push(h),u[d]??(u[d]={}),(y=u[d])[p]??(y[p]=[]),u[d][p].push(h)}),{horiz:Object.values(n(l,"horizontal")).filter(h=>h.length>1),vert:Object.values(n(u,"vertical")).filter(h=>h.length>1)}}),[a,s]=i.reduce(([o,l],{horiz:u,vert:h})=>[[...o,...u],[...l,...h]],[[],[]]);return{horizontal:a,vertical:s}}x(Aye,"getAlignments");function _ye(t,e){const r=[],n=x(a=>`${a[0]},${a[1]}`,"posToStr"),i=x(a=>a.split(",").map(s=>parseInt(s)),"strToPos");return t.forEach(a=>{const s=Object.fromEntries(Object.entries(a).map(([h,d])=>[n(d),h])),o=[n([0,0])],l={},u={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;o.length>0;){const h=o.shift();if(h){l[h]=1;const d=s[h];if(d){const f=i(h);Object.entries(u).forEach(([p,g])=>{const m=n([f[0]+g[0],f[1]+g[1]]),y=s[m];y&&!l[m]&&(o.push(m),r.push({[mye[p]]:y,[mye[xpt(p)]]:d,gap:1.5*e.getConfigField("iconSize")}))})}}}}),r}x(_ye,"getRelativeConstraints");function Rye(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise(o=>{const l=pt("body").append("div").attr("id","cy").attr("style","display:none"),u=Pl({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${i.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),Eye(r,u),wye(t,u,i),Cye(e,u,i),Sye(n,u);const h=Aye(i,a,s),d=_ye(a,i),f=i.getConfigField("iconSize"),p=i.getConfigField("idealEdgeLengthMultiplier")*f,g=.5*f,m=i.getConfigField("edgeElasticity"),y=u.layout({name:"fcose",quality:"proof",randomize:i.getConfigField("randomize"),nodeSeparation:i.getConfigField("nodeSeparation"),numIter:i.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(v){const[T,b]=v.connectedNodes(),{parent:w}=lm(T),{parent:k}=lm(b);return w===k?p:g},edgeElasticity(v){const[T,b]=v.connectedNodes(),{parent:w}=lm(T),{parent:k}=lm(b);return w===k?m:.001},alignmentConstraint:h,relativePlacementConstraint:d});y.one("layoutstop",()=>{var T;function v(b,w,k,A){let C,_;const{x:L,y:O}=b,{x:M,y:z}=w;_=(A-O+(L-k)*(O-z)/(L-M))/Math.sqrt(1+Math.pow((O-z)/(L-M),2)),C=Math.sqrt(Math.pow(A-O,2)+Math.pow(k-L,2)-Math.pow(_,2));const F=Math.sqrt(Math.pow(M-L,2)+Math.pow(z-O,2));C=C/F;let S=(M-L)*(A-O)-(z-O)*(k-L);switch(!0){case S>=0:S=1;break;case S<0:S=-1;break}let R=(M-L)*(k-L)+(z-O)*(A-O);switch(!0){case R>=0:R=1;break;case R<0:R=-1;break}return _=Math.abs(_)*S,C=C*R,{distances:_,weights:C}}x(v,"getSegmentWeights"),u.startBatch();for(const b of Object.values(u.edges()))if((T=b.data)!=null&&T.call(b)){const{x:w,y:k}=b.source().position(),{x:A,y:C}=b.target().position();if(w!==A&&k!==C){const _=b.sourceEndpoint(),L=b.targetEndpoint(),{sourceDir:O}=bye(b),[M,z]=Oh(O)?[_.x,L.y]:[L.x,_.y],{weights:F,distances:S}=v(_,L,M,z);b.style("segment-distances",S),b.style("segment-weights",F)}}u.endBatch(),y.run()}),y.run(),u.ready(v=>{ae.info("Ready",v),o(u)})})}x(Rye,"layoutArchitecture");var $pt=x(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=ys(e),d=h.append("g");d.attr("class","architecture-edges");const f=h.append("g");f.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await Npt(i,f,a,e),Opt(i,f,s,e);const g=await Rye(a,s,o,l,i,u);await Dpt(d,g,i,e),await Mpt(p,g,i,e),kye(i,g),E0(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),Ppt={draw:$pt},Bpt={parser:Tye,get db(){return new xye},renderer:Ppt,styles:Ipt};const Fpt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Bpt},Symbol.toStringTag,{value:"Module"}));var Lye="position frame",Iye="frame positioned",mP="position relation",Dye="relation positioned",zpt=x(function(t){ae.debug("options str",t)},"setOptions"),Gpt=x(function(){return{}},"getOptions"),qpt=x(function(){Mye(),In()},"clear");function Mye(){yP={}}x(Mye,"reset");var Vpt=Fr.eventmodeling,Wpt=x(()=>ti({...Vpt,...lr().eventmodeling}),"getConfig"),yP={};function Nye(){let t=Upt;const{ast:e}=yP,r=vP();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=Gye(n,e.dataEntities,r);t=ZS(t,{$kind:Lye,index:i,frame:n,textProps:a});let s;Yye(n)?(ae.debug("source frame",n.sourceFrames),s=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),s.forEach(o=>{t=ZS(t,{$kind:mP,index:i,frame:n,sourceFrame:o})})):t=ZS(t,{$kind:mP,index:i,frame:n})}),t={...t,sortedSwimlanesArray:bP(t.swimlanes)},t}x(Nye,"getState");function Oye(t){yP.ast=t}x(Oye,"setAst");var rn={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function vP(){return rn}x(vP,"getDiagramProps");var Upt={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function $ye(t){const e=t.split(".");if(e.length===2)return e[0]}x($ye,"extractNamespace");function Pye(t){const e=t.split(".");return e.length===2?e[1]:t}x(Pye,"extractName");function Bye(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}x(Bye,"findSwimlaneByNamespace");function jS(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}x(jS,"findNextAvailableIndex");function Fye(t,e){const r=$ye(t.entityIdentifier),n=Bye(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||rn.labelUiAutomation}:r?{index:jS(e,0,100),label:rn.labelUiAutomationPrefix+r}:{index:0,label:rn.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||rn.labelCommandReadModel}:r?{index:jS(e,100,200),label:rn.labelCommandReadModelPrefix+r}:{index:100,label:rn.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||rn.labelEvents}:r?{index:jS(e,200,300),label:rn.labelEventsPrefix+r}:{index:200,label:rn.labelEvents}}}x(Fye,"calculateSwimlaneProps");function zye(t){const{themeVariables:e}=lr();switch(t.modelEntityType){case"ui":return{fill:e.emUiFill??"white",stroke:e.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:e.emProcessorFill??"#edb3f6",stroke:e.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:e.emReadModelFill??"#d3f1a2",stroke:e.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:e.emCommandFill??"#bcd6fe",stroke:e.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:e.emEventFill??"#ffb778",stroke:e.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}x(zye,"calculateEntityVisualProps");function Gye(t,e,r){const n=lr(),i=qr(Pye(t.entityIdentifier)??"",n);let a;const s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let l=`${U2(i,r.textMaxWidth,s)}`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=qr(a,n),a=U2(a,r.textMaxWidth,s),a=a.replaceAll(" "," ")),t.dataReference){const g=e.find(m=>{var y;return m.name===((y=t.dataReference)==null?void 0:y.$refText)});g&&(a=g.dataBlockValue,a=a.substring(a.indexOf(`{ -`)+2),a=a.substring(0,a.lastIndexOf("}")-1),a=qr(a,n),a=U2(a,r.textMaxWidth,s),a=a.replaceAll(" "," "),a+="
")}const u=a!==void 0;u&&(l+=`

${a}`);const h={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},d=M4(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return ae.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}x(Gye,"calculateTextProps");function qye(t,e){const r=e,n=zye(r.frame),i={width:r.textProps.width+2*rn.boxTextPadding,height:r.textProps.height+2*rn.boxTextPadding};return[{$kind:Iye,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}x(qye,"decidePositionFrame");function Vye(t,e,r){return e===void 0?rn.contentStartX:e.index===t.index&&t.r?t.r+rn.boxPadding:r===void 0?rn.contentStartX:r.r-rn.boxOverlap+rn.boxPadding}x(Vye,"calculateX");function Wye(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}x(Wye,"calculateMaxRight");function bP(t){return Object.values(t).sort((e,r)=>e.index-r.index)}x(bP,"sortedSwimlanesArray");function Uye(t,e){const r=e,n=Fye(r.frame,t.swimlanes);let i;n.index in t.swimlanes?i=t.swimlanes[n.index]:i={index:n.index,label:n.label,r:0,y:n.index*rn.swimlaneMinHeight+rn.swimlaneGap,height:rn.swimlaneMinHeight,maxHeight:rn.swimlaneMinHeight};const a=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,s=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,o={width:Math.max(rn.boxMinWidth,Math.min(rn.boxMaxWidth,r.dimension.width))+2*rn.boxPadding,height:Math.max(rn.boxMinHeight,Math.min(rn.boxMaxHeight,r.dimension.height))+2*rn.boxPadding},l=Vye(i,s,a),u=l+o.width+rn.boxPadding,h=Wye(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(rn.swimlaneMinHeight,i.maxHeight)+2*rn.swimlanePadding;const d={x:l,y:rn.swimlanePadding+i.y,r:u,dimension:o,leftSibling:!1,swimlane:i,visual:r.visual,text:r.textProps.content,frame:r.frame,index:r.index},f={...t,boxes:[...t.boxes,d],swimlanes:{...t.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:n.index,previousFrame:r.frame,maxR:h},p=bP(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}x(Yye,"hasSourceFrame");function xP(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}x(xP,"findBoxByFrame");function Xye(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}x(Xye,"findBoxByLineIndex");function Kye(t,e){const r=e;if(E0e(r.frame)||Hye(r.index,r.frame))return[];const n=xP(t.boxes,r.frame);if(n===void 0)throw new Error(`Target box not found for frame ${r.frame.name}`);let i;return r.sourceFrame?i=xP(t.boxes,r.sourceFrame):i=Xye(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:Dye,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}x(Kye,"decidePositionRelation");function jye(t,e){const r=e,n={visual:{fill:"none",stroke:"#000"},source:{x:r.sourceBox.x,y:r.sourceBox.y},target:{x:r.targetBox.x,y:r.targetBox.y},sourceBox:r.sourceBox,targetBox:r.targetBox};return{...t,relations:[...t.relations,n]}}x(jye,"evolveRelationPositioned");var Hpt={[Lye]:qye,[mP]:Kye},Ypt={[Iye]:Uye,[Dye]:jye};function Zye(t,e){const r=Hpt[e.$kind];if(r==null)return[];const n=r(t,e);return ae.debug("decided events",n),n}x(Zye,"decide");function Qye(t,e){const r=e.reduce((n,i)=>{const a=Ypt[i.$kind];return a==null?n:a(n,i)},t);return ae.debug("evolve events",{state:t,newState:r,events:e}),r}x(Qye,"evolve");function ZS(t,e){const r=Zye(t,e);return Qye(t,r)}x(ZS,"dispatch");var TP={getConfig:Wpt,setOptions:zpt,getOptions:Gpt,clear:qpt,setAccTitle:Dn,getAccTitle:Fn,getAccDescription:Gn,setAccDescription:zn,setDiagramTitle:qn,getDiagramTitle:Mn,setAst:Oye,getDiagramProps:vP,getState:Nye},Xpt={parse:x(async t=>{const e=await Qo("eventmodeling",t);ae.debug(e),TP.setAst(e),zl(e,TP)},"parse")},wP=Pe(),Kpt=wP==null?void 0:wP.eventmodeling;function Jye(t,e){return r=>{const n=r.swimlane.y+e.swimlanePadding,i=t.append("g").attr("class","em-box");i.append("rect").attr("x",r.x).attr("y",n).attr("rx","3").attr("width",r.dimension.width).attr("height",r.dimension.height).attr("stroke",r.visual.stroke).attr("fill",r.visual.fill),i.append("foreignObject").attr("x",r.x+e.boxPadding).attr("y",n+10).attr("width",r.dimension.width-2*e.boxPadding).attr("height",r.dimension.height-2*e.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(r.text)}}x(Jye,"renderD3Box");function eve(t,e){return t>e}x(eve,"dirUpwards");function tve(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,s=i.targetBox.swimlane.y+e.swimlanePadding,o=eve(a,s),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;ae.debug(`rendering relation up=${o} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),o?(h=a,d=s+i.targetBox.dimension.height):(h=a+i.sourceBox.dimension.height,d=s);const f=n.emRelationStroke??i.visual.stroke;t.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",f).attr("stroke-width","1").attr("marker-end",`url(#${r})`).attr("d",`M${l} ${h} L${u} ${d}`)}}x(tve,"renderD3Relation");function rve(t,e,r,n){return i=>{const a=t.append("g").attr("class","em-swimlane"),s=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",o=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";a.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",e+r.swimlanePadding).attr("height",i.height).attr("fill",s).attr("stroke",o),a.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}x(rve,"renderD3Swimlane");var jpt=x(function(t,e,r,n){if(ae.debug("in eventmodeling renderer",t+` -`,"id:",e,r),!Kpt)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:s}=Pe(),o=pt(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(rve(o,u.maxR,l,a)),u.boxes.forEach(Jye(o,l)),u.relations.forEach(tve(o,l,h,a)),o.append("defs").append("marker").attr("id",h).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",d),P6(void 0,o,(s==null?void 0:s.padding)??30,s==null?void 0:s.useMaxWidth)},"draw"),Zpt={draw:jpt},Qpt=x(t=>"","getStyles"),Jpt=Qpt,egt={parser:Xpt,db:TP,renderer:Zpt,styles:Jpt};const tgt=Object.freeze(Object.defineProperty({__proto__:null,diagram:egt},Symbol.toStringTag,{value:"Module"}));var CP=(function(){var t=x(function(v,T,b,w){for(b=b||{},w=v.length;w--;b[v[w]]=T);return b},"o"),e=[1,4],r=[1,14],n=[1,12],i=[1,13],a=[6,7,8],s=[1,20],o=[1,18],l=[1,19],u=[6,7,11],h=[1,6,13,14],d=[1,23],f=[1,24],p=[1,6,7,11,13,14],g={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:x(function(T,b,w,k,A,C,_){var L=C.length-1;switch(A){case 6:case 7:return k;case 15:k.addNode(C[L-1].length,C[L].trim());break;case 16:k.addNode(0,C[L].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:i},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:s,7:o,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:o,10:22,11:l},{1:[2,7],6:r,12:15,13:n,14:i},t(h,[2,14],{7:d,11:f}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(u,[2,15]),t(h,[2,13],{7:d,11:f}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(T,b){if(b.recoverable)this.trace(T);else{var w=new Error(T);throw w.hash=b,w}},"parseError"),parse:x(function(T){var b=this,w=[0],k=[],A=[null],C=[],_=this.table,L="",O=0,M=0,z=2,F=1,S=C.slice.call(arguments,1),R=Object.create(this.lexer),N={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(N.yy[D]=this.yy[D]);R.setInput(T,N.yy),N.yy.lexer=R,N.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var I=R.yylloc;C.push(I);var $=R.options&&R.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function B(ne){w.length=w.length-2*ne,A.length=A.length-ne,C.length=C.length-ne}x(B,"popStack");function P(){var ne;return ne=k.pop()||R.lex()||F,typeof ne!="number"&&(ne instanceof Array&&(k=ne,ne=k.pop()),ne=b.symbols_[ne]||ne),ne}x(P,"lex");for(var G,V,Y,W,ie={},K,se,J,Z;;){if(V=w[w.length-1],this.defaultActions[V]?Y=this.defaultActions[V]:((G===null||typeof G>"u")&&(G=P()),Y=_[V]&&_[V][G]),typeof Y>"u"||!Y.length||!Y[0]){var ee="";Z=[];for(K in _[V])this.terminals_[K]&&K>z&&Z.push("'"+this.terminals_[K]+"'");R.showPosition?ee="Parse error on line "+(O+1)+`: + `)}}}}}))},"drawEdges"),H0t=T(async function(t,e,r,n){const a=r.getConfigField("padding")*.75,s=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=cm(u);if(h.type==="group"){const{h:d,w:f,x1:p,y1:g}=u.boundingBox(),m=t.append("rect");m.attr("id",`${n}-group-${h.id}`).attr("x",p+l).attr("y",g+l).attr("width",f).attr("height",d).attr("class","node-bkg");const y=t.append("g");let v=p,x=g;if(h.icon){const b=y.append("g");b.html(`${await Lu(h.icon,{height:a,width:a,fallbackPrefix:ow.prefix})}`),b.attr("transform","translate("+(v+l+1)+", "+(x+l+1)+")"),v+=a,x+=s/2-1-2}if(h.label){const b=y.append("g");await Wa(b,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},Pe()),b.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),b.attr("transform","translate("+(v+l+4)+", "+(x+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),Y0t=T(async function(t,e,r,n){const i=Pe();for(const a of r){const s=e.append("g"),o=t.getConfigField("iconSize");if(a.title){const d=s.append("g");await Wa(d,a.title,{useHtmlLabels:!1,width:o*1.5,classes:"architecture-service-label"},i),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+o/2+", "+o+")")}const l=s.append("g");if(a.icon)l.html(`${await Lu(a.icon,{height:o,width:o,fallbackPrefix:ow.prefix})}`);else if(a.iconText){l.html(`${await Lu("blank",{height:o,width:o,fallbackPrefix:ow.prefix})}`);const p=l.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(qr(a.iconText,i)),g=parseInt(window.getComputedStyle(p.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;p.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/g)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${a.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);s.attr("id",`${n}-service-${a.id}`).attr("class","architecture-service");const{width:u,height:h}=s.node().getBBox();a.width=u,a.height=h,t.setElementForId(a.id,s)}return 0},"drawServices"),X0t=T(function(t,e,r,n){r.forEach(i=>{const a=e.append("g"),s=t.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",s).attr("height",s),a.attr("class","architecture-junction");const{width:l,height:u}=a._groups[0][0].getBBox();a.width=l,a.height=u,t.setElementForId(i.id,a)})},"drawJunctions");GV([{name:ow.prefix,icons:ow}]),Pl.use(D0t);function _ye(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}T(_ye,"addServices");function Rye(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}T(Rye,"addJunctions");function Lye(t,e){e.nodes().map(r=>{const n=cm(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}T(Lye,"positionNodes");function Iye(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}T(Iye,"addGroups");function Dye(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:s,rhsInto:o,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=bP(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:a,sourceGroup:s,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:o,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}T(Dye,"addEdges");function Mye(t,e,r){const n=T((o,l)=>Object.entries(o).reduce((u,[h,d])=>{var g;let f=0;const p=Object.entries(d);if(p.length===1)return u[h]=p[0][1],u;for(let m=0;m{const l={},u={};return Object.entries(o).forEach(([h,[d,f]])=>{var g,m,y;const p=((g=t.getNode(h))==null?void 0:g.in)??"default";l[f]??(l[f]={}),(m=l[f])[p]??(m[p]=[]),l[f][p].push(h),u[d]??(u[d]={}),(y=u[d])[p]??(y[p]=[]),u[d][p].push(h)}),{horiz:Object.values(n(l,"horizontal")).filter(h=>h.length>1),vert:Object.values(n(u,"vertical")).filter(h=>h.length>1)}}),[a,s]=i.reduce(([o,l],{horiz:u,vert:h})=>[[...o,...u],[...l,...h]],[[],[]]);return{horizontal:a,vertical:s}}T(Mye,"getAlignments");function Nye(t,e){const r=[],n=T(a=>`${a[0]},${a[1]}`,"posToStr"),i=T(a=>a.split(",").map(s=>parseInt(s)),"strToPos");return t.forEach(a=>{const s=Object.fromEntries(Object.entries(a).map(([h,d])=>[n(d),h])),o=[n([0,0])],l={},u={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;o.length>0;){const h=o.shift();if(h){l[h]=1;const d=s[h];if(d){const f=i(h);Object.entries(u).forEach(([p,g])=>{const m=n([f[0]+g[0],f[1]+g[1]]),y=s[m];y&&!l[m]&&(o.push(m),r.push({[wye[p]]:y,[wye[M0t(p)]]:d,gap:1.5*e.getConfigField("iconSize")}))})}}}}),r}T(Nye,"getRelativeConstraints");function Oye(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise(o=>{const l=pt("body").append("div").attr("id","cy").attr("style","display:none"),u=Pl({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${i.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),Iye(r,u),_ye(t,u,i),Rye(e,u,i),Dye(n,u);const h=Mye(i,a,s),d=Nye(a,i),f=i.getConfigField("iconSize"),p=i.getConfigField("idealEdgeLengthMultiplier")*f,g=.5*f,m=i.getConfigField("edgeElasticity"),y=u.layout({name:"fcose",quality:"proof",randomize:i.getConfigField("randomize"),nodeSeparation:i.getConfigField("nodeSeparation"),numIter:i.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(v){const[x,b]=v.connectedNodes(),{parent:w}=cm(x),{parent:k}=cm(b);return w===k?p:g},edgeElasticity(v){const[x,b]=v.connectedNodes(),{parent:w}=cm(x),{parent:k}=cm(b);return w===k?m:.001},alignmentConstraint:h,relativePlacementConstraint:d});y.one("layoutstop",()=>{var x;function v(b,w,k,S){let C,_;const{x:L,y:O}=b,{x:M,y:z}=w;_=(S-O+(L-k)*(O-z)/(L-M))/Math.sqrt(1+Math.pow((O-z)/(L-M),2)),C=Math.sqrt(Math.pow(S-O,2)+Math.pow(k-L,2)-Math.pow(_,2));const F=Math.sqrt(Math.pow(M-L,2)+Math.pow(z-O,2));C=C/F;let A=(M-L)*(S-O)-(z-O)*(k-L);switch(!0){case A>=0:A=1;break;case A<0:A=-1;break}let R=(M-L)*(k-L)+(z-O)*(S-O);switch(!0){case R>=0:R=1;break;case R<0:R=-1;break}return _=Math.abs(_)*A,C=C*R,{distances:_,weights:C}}T(v,"getSegmentWeights"),u.startBatch();for(const b of Object.values(u.edges()))if((x=b.data)!=null&&x.call(b)){const{x:w,y:k}=b.source().position(),{x:S,y:C}=b.target().position();if(w!==S&&k!==C){const _=b.sourceEndpoint(),L=b.targetEndpoint(),{sourceDir:O}=Eye(b),[M,z]=Oh(O)?[_.x,L.y]:[L.x,_.y],{weights:F,distances:A}=v(_,L,M,z);b.style("segment-distances",A),b.style("segment-weights",F)}}u.endBatch(),y.run()}),y.run(),u.ready(v=>{ae.info("Ready",v),o(u)})})}T(Oye,"layoutArchitecture");var K0t=T(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=ys(e),d=h.append("g");d.attr("class","architecture-edges");const f=h.append("g");f.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await Y0t(i,f,a,e),X0t(i,f,s,e);const g=await Oye(a,s,o,l,i,u);await U0t(d,g,i,e),await H0t(p,g,i,e),Lye(i,g),Ep(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),j0t={draw:K0t},Z0t={parser:Aye,get db(){return new Sye},renderer:j0t,styles:W0t};const Q0t=Object.freeze(Object.defineProperty({__proto__:null,diagram:Z0t},Symbol.toStringTag,{value:"Module"}));var $ye="position frame",Pye="frame positioned",TP="position relation",Bye="relation positioned",J0t=T(function(t){ae.debug("options str",t)},"setOptions"),egt=T(function(){return{}},"getOptions"),tgt=T(function(){Fye(),In()},"clear");function Fye(){wP={}}T(Fye,"reset");var rgt=Fr.eventmodeling,ngt=T(()=>ti({...rgt,...lr().eventmodeling}),"getConfig"),wP={};function zye(){let t=igt;const{ast:e}=wP,r=CP();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=Yye(n,e.dataEntities,r);t=e6(t,{$kind:$ye,index:i,frame:n,textProps:a});let s;Jye(n)?(ae.debug("source frame",n.sourceFrames),s=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),s.forEach(o=>{t=e6(t,{$kind:TP,index:i,frame:n,sourceFrame:o})})):t=e6(t,{$kind:TP,index:i,frame:n})}),t={...t,sortedSwimlanesArray:kP(t.swimlanes)},t}T(zye,"getState");function Gye(t){wP.ast=t}T(Gye,"setAst");var rn={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function CP(){return rn}T(CP,"getDiagramProps");var igt={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function qye(t){const e=t.split(".");if(e.length===2)return e[0]}T(qye,"extractNamespace");function Vye(t){const e=t.split(".");return e.length===2?e[1]:t}T(Vye,"extractName");function Wye(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}T(Wye,"findSwimlaneByNamespace");function JS(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}T(JS,"findNextAvailableIndex");function Uye(t,e){const r=qye(t.entityIdentifier),n=Wye(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||rn.labelUiAutomation}:r?{index:JS(e,0,100),label:rn.labelUiAutomationPrefix+r}:{index:0,label:rn.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||rn.labelCommandReadModel}:r?{index:JS(e,100,200),label:rn.labelCommandReadModelPrefix+r}:{index:100,label:rn.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||rn.labelEvents}:r?{index:JS(e,200,300),label:rn.labelEventsPrefix+r}:{index:200,label:rn.labelEvents}}}T(Uye,"calculateSwimlaneProps");function Hye(t){const{themeVariables:e}=lr();switch(t.modelEntityType){case"ui":return{fill:e.emUiFill??"white",stroke:e.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:e.emProcessorFill??"#edb3f6",stroke:e.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:e.emReadModelFill??"#d3f1a2",stroke:e.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:e.emCommandFill??"#bcd6fe",stroke:e.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:e.emEventFill??"#ffb778",stroke:e.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}T(Hye,"calculateEntityVisualProps");function Yye(t,e,r){const n=lr(),i=qr(Vye(t.entityIdentifier)??"",n);let a;const s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let l=`${H2(i,r.textMaxWidth,s)}`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=qr(a,n),a=H2(a,r.textMaxWidth,s),a=a.replaceAll(" "," ")),t.dataReference){const g=e.find(m=>{var y;return m.name===((y=t.dataReference)==null?void 0:y.$refText)});g&&(a=g.dataBlockValue,a=a.substring(a.indexOf(`{ +`)+2),a=a.substring(0,a.lastIndexOf("}")-1),a=qr(a,n),a=H2(a,r.textMaxWidth,s),a=a.replaceAll(" "," "),a+="
")}const u=a!==void 0;u&&(l+=`

${a}`);const h={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},d=O4(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return ae.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}T(Yye,"calculateTextProps");function Xye(t,e){const r=e,n=Hye(r.frame),i={width:r.textProps.width+2*rn.boxTextPadding,height:r.textProps.height+2*rn.boxTextPadding};return[{$kind:Pye,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}T(Xye,"decidePositionFrame");function Kye(t,e,r){return e===void 0?rn.contentStartX:e.index===t.index&&t.r?t.r+rn.boxPadding:r===void 0?rn.contentStartX:r.r-rn.boxOverlap+rn.boxPadding}T(Kye,"calculateX");function jye(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}T(jye,"calculateMaxRight");function kP(t){return Object.values(t).sort((e,r)=>e.index-r.index)}T(kP,"sortedSwimlanesArray");function Zye(t,e){const r=e,n=Uye(r.frame,t.swimlanes);let i;n.index in t.swimlanes?i=t.swimlanes[n.index]:i={index:n.index,label:n.label,r:0,y:n.index*rn.swimlaneMinHeight+rn.swimlaneGap,height:rn.swimlaneMinHeight,maxHeight:rn.swimlaneMinHeight};const a=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,s=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,o={width:Math.max(rn.boxMinWidth,Math.min(rn.boxMaxWidth,r.dimension.width))+2*rn.boxPadding,height:Math.max(rn.boxMinHeight,Math.min(rn.boxMaxHeight,r.dimension.height))+2*rn.boxPadding},l=Kye(i,s,a),u=l+o.width+rn.boxPadding,h=jye(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(rn.swimlaneMinHeight,i.maxHeight)+2*rn.swimlanePadding;const d={x:l,y:rn.swimlanePadding+i.y,r:u,dimension:o,leftSibling:!1,swimlane:i,visual:r.visual,text:r.textProps.content,frame:r.frame,index:r.index},f={...t,boxes:[...t.boxes,d],swimlanes:{...t.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:n.index,previousFrame:r.frame,maxR:h},p=kP(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}T(Jye,"hasSourceFrame");function EP(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}T(EP,"findBoxByFrame");function eve(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}T(eve,"findBoxByLineIndex");function tve(t,e){const r=e;if(Ipe(r.frame)||Qye(r.index,r.frame))return[];const n=EP(t.boxes,r.frame);if(n===void 0)throw new Error(`Target box not found for frame ${r.frame.name}`);let i;return r.sourceFrame?i=EP(t.boxes,r.sourceFrame):i=eve(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:Bye,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}T(tve,"decidePositionRelation");function rve(t,e){const r=e,n={visual:{fill:"none",stroke:"#000"},source:{x:r.sourceBox.x,y:r.sourceBox.y},target:{x:r.targetBox.x,y:r.targetBox.y},sourceBox:r.sourceBox,targetBox:r.targetBox};return{...t,relations:[...t.relations,n]}}T(rve,"evolveRelationPositioned");var agt={[$ye]:Xye,[TP]:tve},sgt={[Pye]:Zye,[Bye]:rve};function nve(t,e){const r=agt[e.$kind];if(r==null)return[];const n=r(t,e);return ae.debug("decided events",n),n}T(nve,"decide");function ive(t,e){const r=e.reduce((n,i)=>{const a=sgt[i.$kind];return a==null?n:a(n,i)},t);return ae.debug("evolve events",{state:t,newState:r,events:e}),r}T(ive,"evolve");function e6(t,e){const r=nve(t,e);return ive(t,r)}T(e6,"dispatch");var SP={getConfig:ngt,setOptions:J0t,getOptions:egt,clear:tgt,setAccTitle:Dn,getAccTitle:Fn,getAccDescription:Gn,setAccDescription:zn,setDiagramTitle:qn,getDiagramTitle:Mn,setAst:Gye,getDiagramProps:CP,getState:zye},ogt={parse:T(async t=>{const e=await Qo("eventmodeling",t);ae.debug(e),SP.setAst(e),zl(e,SP)},"parse")},AP=Pe(),lgt=AP==null?void 0:AP.eventmodeling;function ave(t,e){return r=>{const n=r.swimlane.y+e.swimlanePadding,i=t.append("g").attr("class","em-box");i.append("rect").attr("x",r.x).attr("y",n).attr("rx","3").attr("width",r.dimension.width).attr("height",r.dimension.height).attr("stroke",r.visual.stroke).attr("fill",r.visual.fill),i.append("foreignObject").attr("x",r.x+e.boxPadding).attr("y",n+10).attr("width",r.dimension.width-2*e.boxPadding).attr("height",r.dimension.height-2*e.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(r.text)}}T(ave,"renderD3Box");function sve(t,e){return t>e}T(sve,"dirUpwards");function ove(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,s=i.targetBox.swimlane.y+e.swimlanePadding,o=sve(a,s),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;ae.debug(`rendering relation up=${o} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),o?(h=a,d=s+i.targetBox.dimension.height):(h=a+i.sourceBox.dimension.height,d=s);const f=n.emRelationStroke??i.visual.stroke;t.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",f).attr("stroke-width","1").attr("marker-end",`url(#${r})`).attr("d",`M${l} ${h} L${u} ${d}`)}}T(ove,"renderD3Relation");function lve(t,e,r,n){return i=>{const a=t.append("g").attr("class","em-swimlane"),s=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",o=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";a.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",e+r.swimlanePadding).attr("height",i.height).attr("fill",s).attr("stroke",o),a.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}T(lve,"renderD3Swimlane");var cgt=T(function(t,e,r,n){if(ae.debug("in eventmodeling renderer",t+` +`,"id:",e,r),!lgt)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:s}=Pe(),o=pt(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(lve(o,u.maxR,l,a)),u.boxes.forEach(ave(o,l)),u.relations.forEach(ove(o,l,h,a)),o.append("defs").append("marker").attr("id",h).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",d),z6(void 0,o,(s==null?void 0:s.padding)??30,s==null?void 0:s.useMaxWidth)},"draw"),ugt={draw:cgt},hgt=T(t=>"","getStyles"),dgt=hgt,fgt={parser:ogt,db:SP,renderer:ugt,styles:dgt};const pgt=Object.freeze(Object.defineProperty({__proto__:null,diagram:fgt},Symbol.toStringTag,{value:"Module"}));var _P=(function(){var t=T(function(v,x,b,w){for(b=b||{},w=v.length;w--;b[v[w]]=x);return b},"o"),e=[1,4],r=[1,14],n=[1,12],i=[1,13],a=[6,7,8],s=[1,20],o=[1,18],l=[1,19],u=[6,7,11],h=[1,6,13,14],d=[1,23],f=[1,24],p=[1,6,7,11,13,14],g={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:T(function(x,b,w,k,S,C,_){var L=C.length-1;switch(S){case 6:case 7:return k;case 15:k.addNode(C[L-1].length,C[L].trim());break;case 16:k.addNode(0,C[L].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:i},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:s,7:o,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:o,10:22,11:l},{1:[2,7],6:r,12:15,13:n,14:i},t(h,[2,14],{7:d,11:f}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(u,[2,15]),t(h,[2,13],{7:d,11:f}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:T(function(x,b){if(b.recoverable)this.trace(x);else{var w=new Error(x);throw w.hash=b,w}},"parseError"),parse:T(function(x){var b=this,w=[0],k=[],S=[null],C=[],_=this.table,L="",O=0,M=0,z=2,F=1,A=C.slice.call(arguments,1),R=Object.create(this.lexer),N={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(N.yy[D]=this.yy[D]);R.setInput(x,N.yy),N.yy.lexer=R,N.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var I=R.yylloc;C.push(I);var $=R.options&&R.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function B(ne){w.length=w.length-2*ne,S.length=S.length-ne,C.length=C.length-ne}T(B,"popStack");function P(){var ne;return ne=k.pop()||R.lex()||F,typeof ne!="number"&&(ne instanceof Array&&(k=ne,ne=k.pop()),ne=b.symbols_[ne]||ne),ne}T(P,"lex");for(var G,V,X,W,ie={},K,se,J,Z;;){if(V=w[w.length-1],this.defaultActions[V]?X=this.defaultActions[V]:((G===null||typeof G>"u")&&(G=P()),X=_[V]&&_[V][G]),typeof X>"u"||!X.length||!X[0]){var ee="";Z=[];for(K in _[V])this.terminals_[K]&&K>z&&Z.push("'"+this.terminals_[K]+"'");R.showPosition?ee="Parse error on line "+(O+1)+`: `+R.showPosition()+` -Expecting `+Z.join(", ")+", got '"+(this.terminals_[G]||G)+"'":ee="Parse error on line "+(O+1)+": Unexpected "+(G==F?"end of input":"'"+(this.terminals_[G]||G)+"'"),this.parseError(ee,{text:R.match,token:this.terminals_[G]||G,line:R.yylineno,loc:I,expected:Z})}if(Y[0]instanceof Array&&Y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+G);switch(Y[0]){case 1:w.push(G),A.push(R.yytext),C.push(R.yylloc),w.push(Y[1]),G=null,M=R.yyleng,L=R.yytext,O=R.yylineno,I=R.yylloc;break;case 2:if(se=this.productions_[Y[1]][1],ie.$=A[A.length-se],ie._$={first_line:C[C.length-(se||1)].first_line,last_line:C[C.length-1].last_line,first_column:C[C.length-(se||1)].first_column,last_column:C[C.length-1].last_column},$&&(ie._$.range=[C[C.length-(se||1)].range[0],C[C.length-1].range[1]]),W=this.performAction.apply(ie,[L,M,O,N.yy,Y[1],A,C].concat(S)),typeof W<"u")return W;se&&(w=w.slice(0,-1*se*2),A=A.slice(0,-1*se),C=C.slice(0,-1*se)),w.push(this.productions_[Y[1]][0]),A.push(ie.$),C.push(ie._$),J=_[w[w.length-2]][w[w.length-1]],w.push(J);break;case 3:return!0}}return!0},"parse")},m=(function(){var v={EOF:1,parseError:x(function(b,w){if(this.yy.parser)this.yy.parser.parseError(b,w);else throw new Error(b)},"parseError"),setInput:x(function(T,b){return this.yy=b||this.yy||{},this._input=T,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var T=this._input[0];this.yytext+=T,this.yyleng++,this.offset++,this.match+=T,this.matched+=T;var b=T.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),T},"input"),unput:x(function(T){var b=T.length,w=T.split(/(?:\r\n?|\n)/g);this._input=T+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var k=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),w.length-1&&(this.yylineno-=w.length-1);var A=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:w?(w.length===k.length?this.yylloc.first_column:0)+k[k.length-w.length].length-w[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(T){this.unput(this.match.slice(T))},"less"),pastInput:x(function(){var T=this.matched.substr(0,this.matched.length-this.match.length);return(T.length>20?"...":"")+T.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var T=this.match;return T.length<20&&(T+=this._input.substr(0,20-T.length)),(T.substr(0,20)+(T.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var T=this.pastInput(),b=new Array(T.length+1).join("-");return T+this.upcomingInput()+` -`+b+"^"},"showPosition"),test_match:x(function(T,b){var w,k,A;if(this.options.backtrack_lexer&&(A={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(A.yylloc.range=this.yylloc.range.slice(0))),k=T[0].match(/(?:\r\n?|\n).*/g),k&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+T[0].length},this.yytext+=T[0],this.match+=T[0],this.matches=T,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(T[0].length),this.matched+=T[0],w=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),w)return w;if(this._backtrack){for(var C in A)this[C]=A[C];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var T,b,w,k;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),C=0;Cb[0].length)){if(b=w,k=C,this.options.backtrack_lexer){if(T=this.test_match(w,A[C]),T!==!1)return T;if(this._backtrack){b=!1;continue}else return!1}else if(!this.options.flex)break}return b?(T=this.test_match(b,A[k]),T!==!1?T:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var b=this.next();return b||this.lex()},"lex"),begin:x(function(b){this.conditionStack.push(b)},"begin"),popState:x(function(){var b=this.conditionStack.length-1;return b>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(b){return b=this.conditionStack.length-1-Math.abs(b||0),b>=0?this.conditionStack[b]:"INITIAL"},"topState"),pushState:x(function(b){this.begin(b)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(b,w,k,A){switch(k){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return v})();g.lexer=m;function y(){this.yy={}}return x(y,"Parser"),y.prototype=g,g.Parser=y,new y})();CP.parser=CP;var rgt=CP,ngt=(Yv=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,In()}getRoot(){return this.root}addNode(e,r){const n=Lt.sanitizeText(r,Pe());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],qn(n);return}this.baseLevel??(this.baseLevel=e);let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();const a=this.stack[this.stack.length-1].node,s={text:n,children:[]};a.children.push(s),this.stack.push({level:i,node:s})}getAccTitle(){return Fn()}setAccTitle(e){Dn(e)}getAccDescription(){return Gn()}setAccDescription(e){zn(e)}getDiagramTitle(){return Mn()}setDiagramTitle(e){qn(e)}},x(Yv,"IshikawaDB"),Yv),igt=14,um=250,agt=30,sgt=60,ogt=5,nve=82*Math.PI/180,ive=Math.cos(nve),ave=Math.sin(nve),sve=x((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;wi(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),lgt=x((t,e,r,n)=>{var N,D;const a=n.db.getRoot();if(!a)return;const s=Pe(),{look:o,handDrawnSeed:l,themeVariables:u}=s,h=xc(s.fontSize)[0]??igt,d=o==="handDrawn",f=a.children??[],p=((N=s.ishikawa)==null?void 0:N.diagramPadding)??20,g=((D=s.ishikawa)==null?void 0:D.useMaxWidth)??!1,m=ys(e),y=m.append("g").attr("class","ishikawa"),v=d?Kt.svg(m.node()):void 0,T=v?{roughSvg:v,seed:l??0,lineColor:(u==null?void 0:u.lineColor)??"#333",fillColor:(u==null?void 0:u.mainBkg)??"#fff"}:void 0,b=`ishikawa-arrow-${e}`;d||y.append("defs").append("marker").attr("id",b).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let w=0,k=um;const A=d?void 0:hm(y,w,k,w,k,"ishikawa-spine");if(cgt(y,w,k,a.text,h,T),!f.length){d&&hm(y,w,k,w,k,"ishikawa-spine",T),sve(m,p,g);return}w-=20;const C=f.filter((I,$)=>$%2===0),_=f.filter((I,$)=>$%2===1),L=ove(C),O=ove(_),M=L.total+O.total;let z=um,F=um;if(M>0){const I=um*2,$=um*.3;z=Math.max($,I*(L.total/M)),F=Math.max($,I*(O.total/M))}const S=h*2;z=Math.max(z,L.max*S),F=Math.max(F,O.max*S),k=Math.max(z,um),A&&A.attr("y1",k).attr("y2",k),y.select(".ishikawa-head-group").attr("transform",`translate(0,${k})`);const R=Math.ceil(f.length/2);for(let I=0;IMath.min(B,P.getBBox().x),1/0)}if(d)hm(y,w,k,0,k,"ishikawa-spine",T);else{A.attr("x1",w);const I=`url(#${b})`;y.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",I)}sve(m,p,g)},"draw"),ove=x(t=>{const e=x(r=>r.children.reduce((n,i)=>n+1+e(i),0),"countDescendants");return t.reduce((r,n)=>{const i=e(n);return r.total+=i,r.max=Math.max(r.max,i),r},{total:0,max:0})},"sideStats"),cgt=x((t,e,r,n,i,a)=>{const s=Math.max(6,Math.floor(110/(i*.6))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=QS(o,lve(n,s),0,0,"ishikawa-head-label","start",i),u=l.node().getBBox(),h=Math.max(60,u.width+6),d=Math.max(40,u.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${h*2.4} 0 0 ${-d/2} Z`;if(a){const p=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});o.insert(()=>p,":first-child").attr("class","ishikawa-head")}else o.insert("path",":first-child").attr("class","ishikawa-head").attr("d",f);l.attr("transform",`translate(${(h-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),ugt=x((t,e)=>{const r=[],n=[],i=x((a,s,o)=>{const l=e===-1?[...a].reverse():a;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:o,text:lve(u.text,15),parentIndex:s,childCount:d.length}),o%2===0?(n.push(h),d.length&&i(d,h,o+1)):(d.length&&i(d,h,o+1),n.push(h))}},"walk");return i(t,-1,2),{entries:r,yOrder:n}},"flattenTree"),hgt=x((t,e,r,n,i,a,s)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=QS(o,e,r,n+11*i,"ishikawa-label cause","middle",a).node().getBBox();if(s){const h=s.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:s.seed,fill:s.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:s.lineColor,strokeWidth:2});o.insert(()=>h,":first-child").attr("class","ishikawa-label-box")}else o.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),kP=x((t,e,r,n,i,a)=>{const s=Math.sqrt(n*n+i*i);if(s===0)return;const o=n/s,l=i/s,u=6,h=-l*u,d=o*u,f=e,p=r,g=`M ${f} ${p} L ${f-o*u*2+h} ${p-l*u*2+d} L ${f-o*u*2-h} ${p-l*u*2-d} Z`,m=a.roughSvg.path(g,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>m)},"drawArrowMarker"),dgt=x((t,e,r,n,i,a,s,o)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-ive*u,d=ave*u*i,f=r+h,p=n+d;if(hm(t,r,n,f,p,"ishikawa-branch",o),o&&kP(t,r,n,r-f,n-p,o),hgt(t,e.text,f,p,i,s,o),!l.length)return;const{entries:g,yOrder:m}=ugt(l,i),y=g.length,v=new Array(y);for(const[A,C]of m.entries())v[C]=n+d*((A+1)/(y+1));const T=new Map;T.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const b=-ive,w=ave*i,k=i<0?"ishikawa-label up":"ishikawa-label down";for(const[A,C]of g.entries()){const _=v[A],L=T.get(C.parentIndex),O=t.append("g").attr("class","ishikawa-sub-group");let M=0,z=0,F=0;if(C.depth%2===0){const S=L.y1-L.y0;M=cve(L.x0,L.x1,S?(_-L.y0)/S:.5),z=_,F=M-(C.childCount>0?sgt+C.childCount*ogt:agt),hm(O,M,_,F,_,"ishikawa-sub-branch",o),o&&kP(O,M,_,1,0,o),QS(O,C.text,F,_,"ishikawa-label align","end",s)}else{const S=L.childrenDrawn++;M=cve(L.x0,L.x1,(L.childCount-S)/(L.childCount+1)),z=L.y0,F=M+b*((_-z)/w),hm(O,M,z,F,_,"ishikawa-sub-branch",o),o&&kP(O,M,z,M-F,z-_,o),QS(O,C.text,F,_,k,"end",s)}C.childCount>0&&T.set(A,{x0:M,y0:z,x1:F,y1:_,childCount:C.childCount,childrenDrawn:0})}},"drawBranch"),fgt=x(t=>t.split(/|\n/),"splitLines"),lve=x((t,e)=>{if(t.length<=e)return t;const r=[];for(const n of t.split(/\s+/)){const i=r.length-1;i>=0&&r[i].length+1+n.length<=e?r[i]+=" "+n:r.push(n)}return r.join(` -`)},"wrapText"),QS=x((t,e,r,n,i,a,s)=>{const o=fgt(e),l=s*1.05,u=t.append("text").attr("class",i).attr("text-anchor",a).attr("x",r).attr("y",n-(o.length-1)*l/2);for(const[h,d]of o.entries())u.append("tspan").attr("x",r).attr("dy",h===0?0:l).text(d);return u},"drawMultilineText"),cve=x((t,e,r)=>t+(e-t)*r,"lerp"),hm=x((t,e,r,n,i,a,s)=>{if(s){const o=s.roughSvg.line(e,r,n,i,{roughness:1.5,seed:s.seed,stroke:s.lineColor,strokeWidth:2});t.append(()=>o).attr("class",a);return}return t.append("line").attr("class",a).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),pgt={draw:lgt},ggt=x(t=>` +Expecting `+Z.join(", ")+", got '"+(this.terminals_[G]||G)+"'":ee="Parse error on line "+(O+1)+": Unexpected "+(G==F?"end of input":"'"+(this.terminals_[G]||G)+"'"),this.parseError(ee,{text:R.match,token:this.terminals_[G]||G,line:R.yylineno,loc:I,expected:Z})}if(X[0]instanceof Array&&X.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+G);switch(X[0]){case 1:w.push(G),S.push(R.yytext),C.push(R.yylloc),w.push(X[1]),G=null,M=R.yyleng,L=R.yytext,O=R.yylineno,I=R.yylloc;break;case 2:if(se=this.productions_[X[1]][1],ie.$=S[S.length-se],ie._$={first_line:C[C.length-(se||1)].first_line,last_line:C[C.length-1].last_line,first_column:C[C.length-(se||1)].first_column,last_column:C[C.length-1].last_column},$&&(ie._$.range=[C[C.length-(se||1)].range[0],C[C.length-1].range[1]]),W=this.performAction.apply(ie,[L,M,O,N.yy,X[1],S,C].concat(A)),typeof W<"u")return W;se&&(w=w.slice(0,-1*se*2),S=S.slice(0,-1*se),C=C.slice(0,-1*se)),w.push(this.productions_[X[1]][0]),S.push(ie.$),C.push(ie._$),J=_[w[w.length-2]][w[w.length-1]],w.push(J);break;case 3:return!0}}return!0},"parse")},m=(function(){var v={EOF:1,parseError:T(function(b,w){if(this.yy.parser)this.yy.parser.parseError(b,w);else throw new Error(b)},"parseError"),setInput:T(function(x,b){return this.yy=b||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var b=x.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:T(function(x){var b=x.length,w=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var k=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),w.length-1&&(this.yylineno-=w.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:w?(w.length===k.length?this.yylloc.first_column:0)+k[k.length-w.length].length-w[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(x){this.unput(this.match.slice(x))},"less"),pastInput:T(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var x=this.pastInput(),b=new Array(x.length+1).join("-");return x+this.upcomingInput()+` +`+b+"^"},"showPosition"),test_match:T(function(x,b){var w,k,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),k=x[0].match(/(?:\r\n?|\n).*/g),k&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(x[0].length),this.matched+=x[0],w=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),w)return w;if(this._backtrack){for(var C in S)this[C]=S[C];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,b,w,k;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),C=0;Cb[0].length)){if(b=w,k=C,this.options.backtrack_lexer){if(x=this.test_match(w,S[C]),x!==!1)return x;if(this._backtrack){b=!1;continue}else return!1}else if(!this.options.flex)break}return b?(x=this.test_match(b,S[k]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var b=this.next();return b||this.lex()},"lex"),begin:T(function(b){this.conditionStack.push(b)},"begin"),popState:T(function(){var b=this.conditionStack.length-1;return b>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(b){return b=this.conditionStack.length-1-Math.abs(b||0),b>=0?this.conditionStack[b]:"INITIAL"},"topState"),pushState:T(function(b){this.begin(b)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(b,w,k,S){switch(k){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return v})();g.lexer=m;function y(){this.yy={}}return T(y,"Parser"),y.prototype=g,g.Parser=y,new y})();_P.parser=_P;var ggt=_P,mgt=(Xv=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,In()}getRoot(){return this.root}addNode(e,r){const n=Lt.sanitizeText(r,Pe());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],qn(n);return}this.baseLevel??(this.baseLevel=e);let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();const a=this.stack[this.stack.length-1].node,s={text:n,children:[]};a.children.push(s),this.stack.push({level:i,node:s})}getAccTitle(){return Fn()}setAccTitle(e){Dn(e)}getAccDescription(){return Gn()}setAccDescription(e){zn(e)}getDiagramTitle(){return Mn()}setDiagramTitle(e){qn(e)}},T(Xv,"IshikawaDB"),Xv),ygt=14,hm=250,vgt=30,bgt=60,xgt=5,cve=82*Math.PI/180,uve=Math.cos(cve),hve=Math.sin(cve),dve=T((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;wi(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),Tgt=T((t,e,r,n)=>{var N,D;const a=n.db.getRoot();if(!a)return;const s=Pe(),{look:o,handDrawnSeed:l,themeVariables:u}=s,h=xc(s.fontSize)[0]??ygt,d=o==="handDrawn",f=a.children??[],p=((N=s.ishikawa)==null?void 0:N.diagramPadding)??20,g=((D=s.ishikawa)==null?void 0:D.useMaxWidth)??!1,m=ys(e),y=m.append("g").attr("class","ishikawa"),v=d?Kt.svg(m.node()):void 0,x=v?{roughSvg:v,seed:l??0,lineColor:(u==null?void 0:u.lineColor)??"#333",fillColor:(u==null?void 0:u.mainBkg)??"#fff"}:void 0,b=`ishikawa-arrow-${e}`;d||y.append("defs").append("marker").attr("id",b).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let w=0,k=hm;const S=d?void 0:dm(y,w,k,w,k,"ishikawa-spine");if(wgt(y,w,k,a.text,h,x),!f.length){d&&dm(y,w,k,w,k,"ishikawa-spine",x),dve(m,p,g);return}w-=20;const C=f.filter((I,$)=>$%2===0),_=f.filter((I,$)=>$%2===1),L=fve(C),O=fve(_),M=L.total+O.total;let z=hm,F=hm;if(M>0){const I=hm*2,$=hm*.3;z=Math.max($,I*(L.total/M)),F=Math.max($,I*(O.total/M))}const A=h*2;z=Math.max(z,L.max*A),F=Math.max(F,O.max*A),k=Math.max(z,hm),S&&S.attr("y1",k).attr("y2",k),y.select(".ishikawa-head-group").attr("transform",`translate(0,${k})`);const R=Math.ceil(f.length/2);for(let I=0;IMath.min(B,P.getBBox().x),1/0)}if(d)dm(y,w,k,0,k,"ishikawa-spine",x);else{S.attr("x1",w);const I=`url(#${b})`;y.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",I)}dve(m,p,g)},"draw"),fve=T(t=>{const e=T(r=>r.children.reduce((n,i)=>n+1+e(i),0),"countDescendants");return t.reduce((r,n)=>{const i=e(n);return r.total+=i,r.max=Math.max(r.max,i),r},{total:0,max:0})},"sideStats"),wgt=T((t,e,r,n,i,a)=>{const s=Math.max(6,Math.floor(110/(i*.6))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=t6(o,pve(n,s),0,0,"ishikawa-head-label","start",i),u=l.node().getBBox(),h=Math.max(60,u.width+6),d=Math.max(40,u.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${h*2.4} 0 0 ${-d/2} Z`;if(a){const p=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});o.insert(()=>p,":first-child").attr("class","ishikawa-head")}else o.insert("path",":first-child").attr("class","ishikawa-head").attr("d",f);l.attr("transform",`translate(${(h-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),Cgt=T((t,e)=>{const r=[],n=[],i=T((a,s,o)=>{const l=e===-1?[...a].reverse():a;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:o,text:pve(u.text,15),parentIndex:s,childCount:d.length}),o%2===0?(n.push(h),d.length&&i(d,h,o+1)):(d.length&&i(d,h,o+1),n.push(h))}},"walk");return i(t,-1,2),{entries:r,yOrder:n}},"flattenTree"),kgt=T((t,e,r,n,i,a,s)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=t6(o,e,r,n+11*i,"ishikawa-label cause","middle",a).node().getBBox();if(s){const h=s.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:s.seed,fill:s.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:s.lineColor,strokeWidth:2});o.insert(()=>h,":first-child").attr("class","ishikawa-label-box")}else o.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),RP=T((t,e,r,n,i,a)=>{const s=Math.sqrt(n*n+i*i);if(s===0)return;const o=n/s,l=i/s,u=6,h=-l*u,d=o*u,f=e,p=r,g=`M ${f} ${p} L ${f-o*u*2+h} ${p-l*u*2+d} L ${f-o*u*2-h} ${p-l*u*2-d} Z`,m=a.roughSvg.path(g,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>m)},"drawArrowMarker"),Egt=T((t,e,r,n,i,a,s,o)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-uve*u,d=hve*u*i,f=r+h,p=n+d;if(dm(t,r,n,f,p,"ishikawa-branch",o),o&&RP(t,r,n,r-f,n-p,o),kgt(t,e.text,f,p,i,s,o),!l.length)return;const{entries:g,yOrder:m}=Cgt(l,i),y=g.length,v=new Array(y);for(const[S,C]of m.entries())v[C]=n+d*((S+1)/(y+1));const x=new Map;x.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const b=-uve,w=hve*i,k=i<0?"ishikawa-label up":"ishikawa-label down";for(const[S,C]of g.entries()){const _=v[S],L=x.get(C.parentIndex),O=t.append("g").attr("class","ishikawa-sub-group");let M=0,z=0,F=0;if(C.depth%2===0){const A=L.y1-L.y0;M=gve(L.x0,L.x1,A?(_-L.y0)/A:.5),z=_,F=M-(C.childCount>0?bgt+C.childCount*xgt:vgt),dm(O,M,_,F,_,"ishikawa-sub-branch",o),o&&RP(O,M,_,1,0,o),t6(O,C.text,F,_,"ishikawa-label align","end",s)}else{const A=L.childrenDrawn++;M=gve(L.x0,L.x1,(L.childCount-A)/(L.childCount+1)),z=L.y0,F=M+b*((_-z)/w),dm(O,M,z,F,_,"ishikawa-sub-branch",o),o&&RP(O,M,z,M-F,z-_,o),t6(O,C.text,F,_,k,"end",s)}C.childCount>0&&x.set(S,{x0:M,y0:z,x1:F,y1:_,childCount:C.childCount,childrenDrawn:0})}},"drawBranch"),Sgt=T(t=>t.split(/|\n/),"splitLines"),pve=T((t,e)=>{if(t.length<=e)return t;const r=[];for(const n of t.split(/\s+/)){const i=r.length-1;i>=0&&r[i].length+1+n.length<=e?r[i]+=" "+n:r.push(n)}return r.join(` +`)},"wrapText"),t6=T((t,e,r,n,i,a,s)=>{const o=Sgt(e),l=s*1.05,u=t.append("text").attr("class",i).attr("text-anchor",a).attr("x",r).attr("y",n-(o.length-1)*l/2);for(const[h,d]of o.entries())u.append("tspan").attr("x",r).attr("dy",h===0?0:l).text(d);return u},"drawMultilineText"),gve=T((t,e,r)=>t+(e-t)*r,"lerp"),dm=T((t,e,r,n,i,a,s)=>{if(s){const o=s.roughSvg.line(e,r,n,i,{roughness:1.5,seed:s.seed,stroke:s.lineColor,strokeWidth:2});t.append(()=>o).attr("class",a);return}return t.append("line").attr("class",a).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),Agt={draw:Tgt},_gt=T(t=>` .ishikawa .ishikawa-spine, .ishikawa .ishikawa-branch, .ishikawa .ishikawa-sub-branch { @@ -3246,18 +3246,18 @@ Expecting `+Z.join(", ")+", got '"+(this.terminals_[G]||G)+"'":ee="Parse error o .ishikawa .ishikawa-label.down { dominant-baseline: hanging; } -`,"getStyles"),mgt=ggt,ygt={parser:rgt,get db(){return new ngt},renderer:pgt,styles:mgt};const vgt=Object.freeze(Object.defineProperty({__proto__:null,diagram:ygt},Symbol.toStringTag,{value:"Module"})),uve=1e-10;function JS(t,e){const r=xgt(t),n=r.filter(o=>bgt(o,t));let i=0,a=0;const s=[];if(n.length>1){const o=dve(n);for(let u=0;uh.angle-u.angle);let l=n[n.length-1];for(let u=0;ug.radius*2&&(b=g.radius*2),(f==null||f.width>b)&&(f={circle:g,width:b,p1:h,p2:l,large:b>g.radius,sweep:!0})}f!=null&&(s.push(f),i+=EP(f.circle.radius,f.width),l=h)}}else{let o=t[0];for(let u=1;uMath.abs(o.radius-t[u].radius)){l=!0;break}l?i=a=0:(i=o.radius*o.radius*Math.PI,s.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-uve,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=s,e.innerPoints=n,e.intersectionPoints=r),i+a}function bgt(t,e){return e.every(r=>Ms(t,r)=t+e)return 0;if(r<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const n=t-(r*r-e*e+t*t)/(2*r),i=e-(r*r-t*t+e*e)/(2*r);return EP(t,n)+EP(e,i)}function hve(t,e){const r=Ms(t,e),n=t.radius,i=e.radius;if(r>=n+i||r<=Math.abs(n-i))return[];const a=(n*n-i*i+r*r)/(2*r),s=Math.sqrt(n*n-a*a),o=t.x+a*(e.x-t.x)/r,l=t.y+a*(e.y-t.y)/r,u=-(e.y-t.y)*(s/r),h=-(e.x-t.x)*(s/r);return[{x:o+u,y:l-h},{x:o-u,y:l+h}]}function dve(t){const e={x:0,y:0};for(const r of t)e.x+=r.x,e.y+=r.y;return e.x/=t.length,e.y/=t.length,e}function Tgt(t,e,r,n){n=n||{};const i=n.maxIterations||100,a=n.tolerance||1e-10,s=t(e),o=t(r);let l=r-e;if(s*o>0)throw"Initial bisect points must have opposite signs";if(s===0)return e;if(o===0)return r;for(let u=0;u=0&&(e=h),Math.abs(l)AP(e))}function dm(t,e){let r=0;for(let n=0;nk.fx-A.fx,v=e.slice(),T=e.slice(),b=e.slice(),w=e.slice();for(let k=0;k{const L=_.slice();return L.fx=_.fx,L.id=_.id,L});C.sort((_,L)=>_.id-L.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:C})}f=0;for(let C=0;C=g[p-1].fx){let C=!1;if(T.fx>A.fx?(vu(b,1+h,v,-h,A),b.fx=t(b),b.fx=1)break;for(let _=1;_o+a*i*l||u>=y)m=i;else{if(Math.abs(d)<=-s*l)return i;d*(m-g)>=0&&(m=g),g=i,y=u}return 0}for(let g=0;g<10;++g){if(vu(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=dm(n.fxprime,e),u>o+a*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-s*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function Cgt(t,e,r){let n={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const a=e.slice();let s,o,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),s=n.fxprime.slice(),RP(s,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;fSP(t,e,n)-r,0,t+e)}function kgt(t,e={}){const r=e.distinct,n=t.map(o=>Object.assign({},o));function i(o){return o.join(";")}if(r){const o=new Map;for(const l of n)for(let u=0;uo===l?0:oa.sets.length===2).forEach(a=>{const s=r[a.sets[0]],o=r[a.sets[1]],l=Math.sqrt(e[s].size/Math.PI),u=Math.sqrt(e[o].size/Math.PI),h=LP(l,u,a.size);n[s][o]=n[o][s]=h;let d=0;a.size+1e-10>=Math.min(e[s].size,e[o].size)?d=1:a.size<=1e-10&&(d=-1),i[s][o]=i[o][s]=d}),{distances:n,constraints:i}}function Sgt(t,e,r,n){for(let a=0;a0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*a]+=4*m*(s-u),e[2*a+1]+=4*m*(o-h),e[2*l]+=4*m*(u-s),e[2*l+1]+=4*m*(h-o))}}return i}function Agt(t,e={}){let r=Rgt(t,e);const n=e.lossFunction||fm;if(t.length>=8){const i=_gt(t,e),a=n(i,t),s=n(r,t);a+1e-8f.map(p=>p/o));const l=(f,p)=>Sgt(f,p,a,s);let u=null;for(let f=0;fd.sets.length===2);for(const d of t){let f=d.weight!=null?d.weight:1;const p=d.sets[0],g=d.sets[1];d.size+mve>=Math.min(n[p].size,n[g].size)&&(f=0),i[p].push({set:g,size:d.size,weight:f}),i[g].push({set:p,size:d.size,weight:f})}const a=[];Object.keys(i).forEach(d=>{let f=0;for(let p=0;pt[s]));const a=n.weight!=null?n.weight:1;r+=a*(i-n.size)*(i-n.size)}return r}function yve(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const o=t[n.sets[0]],l=t[n.sets[1]];i=SP(o.radius,l.radius,Ms(o,l))}else i=JS(n.sets.map(o=>t[o]));const a=n.weight!=null?n.weight:1,s=Math.log((i+1)/(n.size+1));r+=a*s*s}return r}function Lgt(t,e,r){if(r==null?t.sort((i,a)=>a.radius-i.radius):t.sort(r),t.length>0){const i=t[0].x,a=t[0].y;for(const s of t)s.x-=i,s.y-=a}if(t.length===2&&Ms(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-e,a=Math.cos(i),s=Math.sin(i);for(const o of t){const l=o.x,u=o.y;o.x=a*l-s*u,o.y=s*l+a*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const a=t[1].y/(1e-10+t[1].x);for(const s of t){var n=(s.x+a*s.y)/(1+a*a);s.x=2*n-s.x,s.y=2*n*a-s.y}}}}function Igt(t){t.forEach(i=>{i.parent=i});function e(i){return i.parent!==i&&(i.parent=e(i.parent)),i.parent}function r(i,a){const s=e(i),o=e(a);s.parent=o}for(let i=0;i{delete i.parent}),Array.from(n.values())}function IP(t){const e=r=>{const n=t.reduce((a,s)=>Math.max(a,s[r]+s.radius),Number.NEGATIVE_INFINITY),i=t.reduce((a,s)=>Math.min(a,s[r]-s.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function vve(t,e,r){e==null&&(e=Math.PI/2);let n=Tve(t).map(u=>Object.assign({},u));const i=Igt(n);for(const u of i){Lgt(u,e,r);const h=IP(u);u.size=(h.xRange.max-h.xRange.min)*(h.yRange.max-h.yRange.min),u.bounds=h}i.sort((u,h)=>h.size-u.size),n=i[0];let a=n.bounds;const s=(a.xRange.max-a.xRange.min)/50;function o(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=a.xRange.max-f.xRange.min+s;else{p=a.xRange.max-f.xRange.max;const m=(f.xRange.max-f.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;m<0&&(p+=m)}if(d)g=a.yRange.max-f.yRange.min+s;else{g=a.yRange.max-f.yRange.max;const m=(f.yRange.max-f.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;m<0&&(g+=m)}for(const m of u)m.x+=p,m.y+=g,n.push(m)}let l=1;for(;l({radius:h*p.radius,x:n+d+(p.x-s.min)*h,y:n+f+(p.y-o.min)*h,setid:p.setid})))}function xve(t){const e={};for(const r of t)e[r.setid]=r;return e}function Tve(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function Dgt(t={}){let e=!1,r=600,n=350,i=15,a=1e3,s=Math.PI/2,o=!0,l=null,u=!0,h=!0,d=null,f=null,p=!1,g=null,m=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,y={},v=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],T=0,b=function(C){if(C in y)return y[C];var _=y[C]=v[T];return T+=1,T>=v.length&&(T=0),_},w=gve,k=fm;function A(C){let _=C.datum();const L=new Set;_.forEach(K=>{K.size==0&&K.sets.length==1&&L.add(K.sets[0])}),_=_.filter(K=>!K.sets.some(se=>L.has(se)));let O={},M={};if(_.length>0){let K=w(_,{lossFunction:k,distinct:p});o&&(K=vve(K,s,f)),O=bve(K,r,n,i,l),M=Cve(O,_,m)}const z={};_.forEach(K=>{K.label&&(z[K.sets]=K.label)});function F(K){if(K.sets in z)return z[K.sets];if(K.sets.length==1)return""+K.sets[0]}C.selectAll("svg").data([O]).enter().append("svg");const S=C.select("svg");e?S.attr("viewBox",`0 0 ${r} ${n}`):S.attr("width",r).attr("height",n);const R={};let N=!1;S.selectAll(".venn-area path").each(function(K){const se=this.getAttribute("d");K.sets.length==1&&se&&!p&&(N=!0,R[K.sets[0]]=Ogt(se))});function D(K){return se=>{const J=K.sets.map(Z=>{let ee=R[Z],ne=O[Z];return ee||(ee={x:r/2,y:n/2,radius:1}),ne||(ne={x:r/2,y:n/2,radius:1}),{x:ee.x*(1-se)+ne.x*se,y:ee.y*(1-se)+ne.y*se,radius:ee.radius*(1-se)+ne.radius*se}});return Sve(J,g)}}const I=S.selectAll(".venn-area").data(_,K=>K.sets),$=I.enter().append("g").attr("class",K=>`venn-area venn-${K.sets.length==1?"circle":"intersection"}${K.colour||K.color?" venn-coloured":""}`).attr("data-venn-sets",K=>K.sets.join("_")),B=$.append("path"),P=$.append("text").attr("class","label").text(K=>F(K)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(B.style("fill-opacity","0").filter(K=>K.sets.length==1).style("fill",K=>K.colour?K.colour:K.color?K.color:b(K.sets)).style("fill-opacity",".25"),P.style("fill",K=>K.colour||K.color?"#FFF":t.textFill?t.textFill:K.sets.length==1?b(K.sets):"#444"));function G(K){return typeof K.transition=="function"?K.transition("venn").duration(a):K}let V=C;N&&typeof V.transition=="function"?(V=G(C),V.selectAll("path").attrTween("d",D)):V.selectAll("path").attr("d",K=>Sve(K.sets.map(se=>O[se])),g);const Y=V.selectAll("text").filter(K=>K.sets in M).text(K=>F(K)).attr("x",K=>Math.floor(M[K.sets].x)).attr("y",K=>Math.floor(M[K.sets].y));u&&(N?"on"in Y?Y.on("end",DP(O,F)):Y.each("end",DP(O,F)):Y.each(DP(O,F)));const W=G(I.exit()).remove();typeof I.transition=="function"&&W.selectAll("path").attrTween("d",D);const ie=W.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(P.style("font-size","0px"),Y.style("font-size",d),ie.style("font-size","0px")),{circles:O,textCentres:M,nodes:I,enter:$,update:V,exit:W}}return A.wrap=function(C){return arguments.length?(u=C,A):u},A.useViewBox=function(){return e=!0,A},A.width=function(C){return arguments.length?(r=C,A):r},A.height=function(C){return arguments.length?(n=C,A):n},A.padding=function(C){return arguments.length?(i=C,A):i},A.distinct=function(C){return arguments.length?(p=C,A):p},A.colours=function(C){return arguments.length?(b=C,A):b},A.colors=function(C){return arguments.length?(b=C,A):b},A.fontSize=function(C){return arguments.length?(d=C,A):d},A.round=function(C){return arguments.length?(g=C,A):g},A.duration=function(C){return arguments.length?(a=C,A):a},A.layoutFunction=function(C){return arguments.length?(w=C,A):w},A.normalize=function(C){return arguments.length?(o=C,A):o},A.scaleToFit=function(C){return arguments.length?(l=C,A):l},A.styled=function(C){return arguments.length?(h=C,A):h},A.orientation=function(C){return arguments.length?(s=C,A):s},A.orientationOrder=function(C){return arguments.length?(f=C,A):f},A.lossFunction=function(C){return arguments.length?(k=C==="default"?fm:C==="logRatio"?yve:C,A):k},A}function DP(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,a=e(r)||"",s=a.split(/\s+/).reverse(),l=(a.length+s.length)/3;let u=s.pop(),h=[u],d=0;const f=1.1;n.textContent=null;const p=[];function g(b){const w=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return w.textContent=b,p.push(w),n.append(w),w}let m=g(u);for(;u=s.pop(),!!u;){h.push(u);const b=h.join(" ");m.textContent=b,b.length>l&&m.getComputedTextLength()>i&&(h.pop(),m.textContent=h.join(" "),h=[u],m=g(u),d++)}const y=.35-d*f/2,v=n.getAttribute("x"),T=n.getAttribute("y");p.forEach((b,w)=>{b.setAttribute("x",v),b.setAttribute("y",T),b.setAttribute("dy",`${y+w*f}em`)})}}function MP(t,e,r){let n=e[0].radius-Ms(e[0],t);for(let i=1;i=a&&(i=n[h],a=d)}const s=pve(h=>-1*MP({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:r?0:s[0],y:s[1]};let l=!0;for(const h of t)if(Ms(o,h)>h.radius){l=!1;break}for(const h of e)if(Ms(o,h)h.p1))}function Mgt(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n0&&console.log("WARNING: area "+s+" not represented on screen")}return n}function Ngt(t,e,r){const n=[];return n.push(` +`,"getStyles"),Rgt=_gt,Lgt={parser:ggt,get db(){return new mgt},renderer:Agt,styles:Rgt};const Igt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Lgt},Symbol.toStringTag,{value:"Module"})),mve=1e-10;function r6(t,e){const r=Mgt(t),n=r.filter(o=>Dgt(o,t));let i=0,a=0;const s=[];if(n.length>1){const o=vve(n);for(let u=0;uh.angle-u.angle);let l=n[n.length-1];for(let u=0;ug.radius*2&&(b=g.radius*2),(f==null||f.width>b)&&(f={circle:g,width:b,p1:h,p2:l,large:b>g.radius,sweep:!0})}f!=null&&(s.push(f),i+=LP(f.circle.radius,f.width),l=h)}}else{let o=t[0];for(let u=1;uMath.abs(o.radius-t[u].radius)){l=!0;break}l?i=a=0:(i=o.radius*o.radius*Math.PI,s.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-mve,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=s,e.innerPoints=n,e.intersectionPoints=r),i+a}function Dgt(t,e){return e.every(r=>Ms(t,r)=t+e)return 0;if(r<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const n=t-(r*r-e*e+t*t)/(2*r),i=e-(r*r-t*t+e*e)/(2*r);return LP(t,n)+LP(e,i)}function yve(t,e){const r=Ms(t,e),n=t.radius,i=e.radius;if(r>=n+i||r<=Math.abs(n-i))return[];const a=(n*n-i*i+r*r)/(2*r),s=Math.sqrt(n*n-a*a),o=t.x+a*(e.x-t.x)/r,l=t.y+a*(e.y-t.y)/r,u=-(e.y-t.y)*(s/r),h=-(e.x-t.x)*(s/r);return[{x:o+u,y:l-h},{x:o-u,y:l+h}]}function vve(t){const e={x:0,y:0};for(const r of t)e.x+=r.x,e.y+=r.y;return e.x/=t.length,e.y/=t.length,e}function Ngt(t,e,r,n){n=n||{};const i=n.maxIterations||100,a=n.tolerance||1e-10,s=t(e),o=t(r);let l=r-e;if(s*o>0)throw"Initial bisect points must have opposite signs";if(s===0)return e;if(o===0)return r;for(let u=0;u=0&&(e=h),Math.abs(l)DP(e))}function fm(t,e){let r=0;for(let n=0;nk.fx-S.fx,v=e.slice(),x=e.slice(),b=e.slice(),w=e.slice();for(let k=0;k{const L=_.slice();return L.fx=_.fx,L.id=_.id,L});C.sort((_,L)=>_.id-L.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:C})}f=0;for(let C=0;C=g[p-1].fx){let C=!1;if(x.fx>S.fx?(vu(b,1+h,v,-h,S),b.fx=t(b),b.fx=1)break;for(let _=1;_o+a*i*l||u>=y)m=i;else{if(Math.abs(d)<=-s*l)return i;d*(m-g)>=0&&(m=g),g=i,y=u}return 0}for(let g=0;g<10;++g){if(vu(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=fm(n.fxprime,e),u>o+a*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-s*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function $gt(t,e,r){let n={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const a=e.slice();let s,o,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),s=n.fxprime.slice(),NP(s,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;fIP(t,e,n)-r,0,t+e)}function Pgt(t,e={}){const r=e.distinct,n=t.map(o=>Object.assign({},o));function i(o){return o.join(";")}if(r){const o=new Map;for(const l of n)for(let u=0;uo===l?0:oa.sets.length===2).forEach(a=>{const s=r[a.sets[0]],o=r[a.sets[1]],l=Math.sqrt(e[s].size/Math.PI),u=Math.sqrt(e[o].size/Math.PI),h=OP(l,u,a.size);n[s][o]=n[o][s]=h;let d=0;a.size+1e-10>=Math.min(e[s].size,e[o].size)?d=1:a.size<=1e-10&&(d=-1),i[s][o]=i[o][s]=d}),{distances:n,constraints:i}}function Fgt(t,e,r,n){for(let a=0;a0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*a]+=4*m*(s-u),e[2*a+1]+=4*m*(o-h),e[2*l]+=4*m*(u-s),e[2*l+1]+=4*m*(h-o))}}return i}function zgt(t,e={}){let r=qgt(t,e);const n=e.lossFunction||pm;if(t.length>=8){const i=Ggt(t,e),a=n(i,t),s=n(r,t);a+1e-8f.map(p=>p/o));const l=(f,p)=>Fgt(f,p,a,s);let u=null;for(let f=0;fd.sets.length===2);for(const d of t){let f=d.weight!=null?d.weight:1;const p=d.sets[0],g=d.sets[1];d.size+wve>=Math.min(n[p].size,n[g].size)&&(f=0),i[p].push({set:g,size:d.size,weight:f}),i[g].push({set:p,size:d.size,weight:f})}const a=[];Object.keys(i).forEach(d=>{let f=0;for(let p=0;pt[s]));const a=n.weight!=null?n.weight:1;r+=a*(i-n.size)*(i-n.size)}return r}function Cve(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const o=t[n.sets[0]],l=t[n.sets[1]];i=IP(o.radius,l.radius,Ms(o,l))}else i=r6(n.sets.map(o=>t[o]));const a=n.weight!=null?n.weight:1,s=Math.log((i+1)/(n.size+1));r+=a*s*s}return r}function Vgt(t,e,r){if(r==null?t.sort((i,a)=>a.radius-i.radius):t.sort(r),t.length>0){const i=t[0].x,a=t[0].y;for(const s of t)s.x-=i,s.y-=a}if(t.length===2&&Ms(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-e,a=Math.cos(i),s=Math.sin(i);for(const o of t){const l=o.x,u=o.y;o.x=a*l-s*u,o.y=s*l+a*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const a=t[1].y/(1e-10+t[1].x);for(const s of t){var n=(s.x+a*s.y)/(1+a*a);s.x=2*n-s.x,s.y=2*n*a-s.y}}}}function Wgt(t){t.forEach(i=>{i.parent=i});function e(i){return i.parent!==i&&(i.parent=e(i.parent)),i.parent}function r(i,a){const s=e(i),o=e(a);s.parent=o}for(let i=0;i{delete i.parent}),Array.from(n.values())}function $P(t){const e=r=>{const n=t.reduce((a,s)=>Math.max(a,s[r]+s.radius),Number.NEGATIVE_INFINITY),i=t.reduce((a,s)=>Math.min(a,s[r]-s.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function kve(t,e,r){e==null&&(e=Math.PI/2);let n=Ave(t).map(u=>Object.assign({},u));const i=Wgt(n);for(const u of i){Vgt(u,e,r);const h=$P(u);u.size=(h.xRange.max-h.xRange.min)*(h.yRange.max-h.yRange.min),u.bounds=h}i.sort((u,h)=>h.size-u.size),n=i[0];let a=n.bounds;const s=(a.xRange.max-a.xRange.min)/50;function o(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=a.xRange.max-f.xRange.min+s;else{p=a.xRange.max-f.xRange.max;const m=(f.xRange.max-f.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;m<0&&(p+=m)}if(d)g=a.yRange.max-f.yRange.min+s;else{g=a.yRange.max-f.yRange.max;const m=(f.yRange.max-f.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;m<0&&(g+=m)}for(const m of u)m.x+=p,m.y+=g,n.push(m)}let l=1;for(;l({radius:h*p.radius,x:n+d+(p.x-s.min)*h,y:n+f+(p.y-o.min)*h,setid:p.setid})))}function Sve(t){const e={};for(const r of t)e[r.setid]=r;return e}function Ave(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function Ugt(t={}){let e=!1,r=600,n=350,i=15,a=1e3,s=Math.PI/2,o=!0,l=null,u=!0,h=!0,d=null,f=null,p=!1,g=null,m=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,y={},v=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],x=0,b=function(C){if(C in y)return y[C];var _=y[C]=v[x];return x+=1,x>=v.length&&(x=0),_},w=Tve,k=pm;function S(C){let _=C.datum();const L=new Set;_.forEach(K=>{K.size==0&&K.sets.length==1&&L.add(K.sets[0])}),_=_.filter(K=>!K.sets.some(se=>L.has(se)));let O={},M={};if(_.length>0){let K=w(_,{lossFunction:k,distinct:p});o&&(K=kve(K,s,f)),O=Eve(K,r,n,i,l),M=Rve(O,_,m)}const z={};_.forEach(K=>{K.label&&(z[K.sets]=K.label)});function F(K){if(K.sets in z)return z[K.sets];if(K.sets.length==1)return""+K.sets[0]}C.selectAll("svg").data([O]).enter().append("svg");const A=C.select("svg");e?A.attr("viewBox",`0 0 ${r} ${n}`):A.attr("width",r).attr("height",n);const R={};let N=!1;A.selectAll(".venn-area path").each(function(K){const se=this.getAttribute("d");K.sets.length==1&&se&&!p&&(N=!0,R[K.sets[0]]=Xgt(se))});function D(K){return se=>{const J=K.sets.map(Z=>{let ee=R[Z],ne=O[Z];return ee||(ee={x:r/2,y:n/2,radius:1}),ne||(ne={x:r/2,y:n/2,radius:1}),{x:ee.x*(1-se)+ne.x*se,y:ee.y*(1-se)+ne.y*se,radius:ee.radius*(1-se)+ne.radius*se}});return Dve(J,g)}}const I=A.selectAll(".venn-area").data(_,K=>K.sets),$=I.enter().append("g").attr("class",K=>`venn-area venn-${K.sets.length==1?"circle":"intersection"}${K.colour||K.color?" venn-coloured":""}`).attr("data-venn-sets",K=>K.sets.join("_")),B=$.append("path"),P=$.append("text").attr("class","label").text(K=>F(K)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(B.style("fill-opacity","0").filter(K=>K.sets.length==1).style("fill",K=>K.colour?K.colour:K.color?K.color:b(K.sets)).style("fill-opacity",".25"),P.style("fill",K=>K.colour||K.color?"#FFF":t.textFill?t.textFill:K.sets.length==1?b(K.sets):"#444"));function G(K){return typeof K.transition=="function"?K.transition("venn").duration(a):K}let V=C;N&&typeof V.transition=="function"?(V=G(C),V.selectAll("path").attrTween("d",D)):V.selectAll("path").attr("d",K=>Dve(K.sets.map(se=>O[se])),g);const X=V.selectAll("text").filter(K=>K.sets in M).text(K=>F(K)).attr("x",K=>Math.floor(M[K.sets].x)).attr("y",K=>Math.floor(M[K.sets].y));u&&(N?"on"in X?X.on("end",PP(O,F)):X.each("end",PP(O,F)):X.each(PP(O,F)));const W=G(I.exit()).remove();typeof I.transition=="function"&&W.selectAll("path").attrTween("d",D);const ie=W.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(P.style("font-size","0px"),X.style("font-size",d),ie.style("font-size","0px")),{circles:O,textCentres:M,nodes:I,enter:$,update:V,exit:W}}return S.wrap=function(C){return arguments.length?(u=C,S):u},S.useViewBox=function(){return e=!0,S},S.width=function(C){return arguments.length?(r=C,S):r},S.height=function(C){return arguments.length?(n=C,S):n},S.padding=function(C){return arguments.length?(i=C,S):i},S.distinct=function(C){return arguments.length?(p=C,S):p},S.colours=function(C){return arguments.length?(b=C,S):b},S.colors=function(C){return arguments.length?(b=C,S):b},S.fontSize=function(C){return arguments.length?(d=C,S):d},S.round=function(C){return arguments.length?(g=C,S):g},S.duration=function(C){return arguments.length?(a=C,S):a},S.layoutFunction=function(C){return arguments.length?(w=C,S):w},S.normalize=function(C){return arguments.length?(o=C,S):o},S.scaleToFit=function(C){return arguments.length?(l=C,S):l},S.styled=function(C){return arguments.length?(h=C,S):h},S.orientation=function(C){return arguments.length?(s=C,S):s},S.orientationOrder=function(C){return arguments.length?(f=C,S):f},S.lossFunction=function(C){return arguments.length?(k=C==="default"?pm:C==="logRatio"?Cve:C,S):k},S}function PP(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,a=e(r)||"",s=a.split(/\s+/).reverse(),l=(a.length+s.length)/3;let u=s.pop(),h=[u],d=0;const f=1.1;n.textContent=null;const p=[];function g(b){const w=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return w.textContent=b,p.push(w),n.append(w),w}let m=g(u);for(;u=s.pop(),!!u;){h.push(u);const b=h.join(" ");m.textContent=b,b.length>l&&m.getComputedTextLength()>i&&(h.pop(),m.textContent=h.join(" "),h=[u],m=g(u),d++)}const y=.35-d*f/2,v=n.getAttribute("x"),x=n.getAttribute("y");p.forEach((b,w)=>{b.setAttribute("x",v),b.setAttribute("y",x),b.setAttribute("dy",`${y+w*f}em`)})}}function BP(t,e,r){let n=e[0].radius-Ms(e[0],t);for(let i=1;i=a&&(i=n[h],a=d)}const s=xve(h=>-1*BP({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:r?0:s[0],y:s[1]};let l=!0;for(const h of t)if(Ms(o,h)>h.radius){l=!1;break}for(const h of e)if(Ms(o,h)h.p1))}function Hgt(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n0&&console.log("WARNING: area "+s+" not represented on screen")}return n}function Ygt(t,e,r){const n=[];return n.push(` M`,t,e),n.push(` m`,-r,0),n.push(` a`,r,r,0,1,0,r*2,0),n.push(` -a`,r,r,0,1,0,-r*2,0),n.join(" ")}function Ogt(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function kve(t){if(t.length===0)return[];const e={};return JS(t,e),e.arcs}function Eve(t,e){if(t.length===0)return"M 0 0";const r=Math.pow(10,e||0),n=e!=null?a=>Math.round(a*r)/r:a=>a;if(t.length==1){const a=t[0].circle;return Ngt(n(a.x),n(a.y),n(a.radius))}const i=[` +a`,r,r,0,1,0,-r*2,0),n.join(" ")}function Xgt(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function Lve(t){if(t.length===0)return[];const e={};return r6(t,e),e.arcs}function Ive(t,e){if(t.length===0)return"M 0 0";const r=Math.pow(10,e||0),n=e!=null?a=>Math.round(a*r)/r:a=>a;if(t.length==1){const a=t[0].circle;return Ygt(n(a.x),n(a.y),n(a.radius))}const i=[` M`,n(t[0].p2.x),n(t[0].p2.y)];for(const a of t){const s=n(a.circle.radius);i.push(` -A`,s,s,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}function Sve(t,e){return Eve(kve(t),e)}function $gt(t,e={}){const{lossFunction:r,layoutFunction:n=gve,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:s,width:o=600,height:l=350,padding:u=15,scaleToFit:h=!1,symmetricalTextCentre:d=!1,distinct:f,round:p=2}=e;let g=n(t,{lossFunction:r==="default"||!r?fm:r==="logRatio"?yve:r,distinct:f});i&&(g=vve(g,a,s));const m=bve(g,o,l,u,h),y=Cve(m,t,d),v=new Map(Object.keys(m).map(w=>[w,{set:w,x:m[w].x,y:m[w].y,radius:m[w].radius}])),T=t.map(w=>{const k=w.sets.map(_=>v.get(_)),A=kve(k),C=Eve(A,p);return{circles:k,arcs:A,path:C,area:w,has:new Set(w.sets)}});function b(w){let k="";for(const A of T)A.has.size>w.length&&w.every(C=>A.has.has(C))&&(k+=" "+A.path);return k}return T.map(({circles:w,arcs:k,path:A,area:C})=>({data:C,text:y[C.sets],circles:w,arcs:k,path:A,distinctPath:A+b(C.sets)}))}var NP=(function(){var t=x(function(T,b,w,k){for(w=w||{},k=T.length;k--;w[T[k]]=b);return w},"o"),e=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],a=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],s=[1,31],o=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],h=[1,56],d=[1,58],f=[1,59],p=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],m={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:x(function(b,w,k,A,C,_,L){var O=_.length-1;switch(C){case 1:return _[O-1];case 2:case 3:case 4:this.$=[];break;case 5:_[O-1].push(_[O]),this.$=_[O-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=_[O];break;case 8:A.setDiagramTitle(_[O].substr(6)),this.$=_[O].substr(6);break;case 9:A.addSubsetData([_[O]],void 0,void 0),A.setIndentMode&&A.setIndentMode(!0);break;case 10:A.addSubsetData([_[O-1]],_[O],void 0),A.setIndentMode&&A.setIndentMode(!0);break;case 11:A.addSubsetData([_[O-2]],void 0,parseFloat(_[O])),A.setIndentMode&&A.setIndentMode(!0);break;case 12:A.addSubsetData([_[O-3]],_[O-2],parseFloat(_[O])),A.setIndentMode&&A.setIndentMode(!0);break;case 13:if(_[O].length<2)throw new Error("union requires multiple identifiers");A.validateUnionIdentifiers&&A.validateUnionIdentifiers(_[O]),A.addSubsetData(_[O],void 0,void 0),A.setIndentMode&&A.setIndentMode(!0);break;case 14:if(_[O-1].length<2)throw new Error("union requires multiple identifiers");A.validateUnionIdentifiers&&A.validateUnionIdentifiers(_[O-1]),A.addSubsetData(_[O-1],_[O],void 0),A.setIndentMode&&A.setIndentMode(!0);break;case 15:if(_[O-2].length<2)throw new Error("union requires multiple identifiers");A.validateUnionIdentifiers&&A.validateUnionIdentifiers(_[O-2]),A.addSubsetData(_[O-2],void 0,parseFloat(_[O])),A.setIndentMode&&A.setIndentMode(!0);break;case 16:if(_[O-3].length<2)throw new Error("union requires multiple identifiers");A.validateUnionIdentifiers&&A.validateUnionIdentifiers(_[O-3]),A.addSubsetData(_[O-3],_[O-2],parseFloat(_[O])),A.setIndentMode&&A.setIndentMode(!0);break;case 17:case 18:case 19:A.addTextData(_[O-1],_[O],void 0);break;case 20:case 21:A.addTextData(_[O-2],_[O-1],_[O]);break;case 23:A.addStyleData(_[O-1],_[O]);break;case 24:case 25:case 26:var M=A.getCurrentSets();if(!M)throw new Error("text requires set");A.addTextData(M,_[O],void 0);break;case 27:case 28:var M=A.getCurrentSets();if(!M)throw new Error("text requires set");A.addTextData(M,_[O-1],_[O]);break;case 29:case 41:this.$=[_[O]];break;case 30:case 42:this.$=[..._[O-2],_[O]];break;case 31:this.$=[_[O-2],_[O]];break;case 33:this.$=_[O].join(" ");break;case 34:this.$=[_[O]];break;case 35:_[O-1].push(_[O]),this.$=_[O-1];break;case 43:case 44:this.$=_[O];break}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:n,21:i},{13:20,18:19,20:n,21:i},{13:20,18:21,20:n,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:i},t(r,[2,9],{14:[1,27],15:[1,28]}),t(a,[2,43]),t(a,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:s}),t(a,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:s},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:o,25:37,26:38,27:s},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:i},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(a,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:o,26:51},{16:u,20:h,21:[1,53],28:52,29:54,30:55,31:d,32:f,33:p},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:h,31:d,32:f,33:p}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:x(function(b,w){if(w.recoverable)this.trace(b);else{var k=new Error(b);throw k.hash=w,k}},"parseError"),parse:x(function(b){var w=this,k=[0],A=[],C=[null],_=[],L=this.table,O="",M=0,z=0,F=2,S=1,R=_.slice.call(arguments,1),N=Object.create(this.lexer),D={yy:{}};for(var I in this.yy)Object.prototype.hasOwnProperty.call(this.yy,I)&&(D.yy[I]=this.yy[I]);N.setInput(b,D.yy),D.yy.lexer=N,D.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var $=N.yylloc;_.push($);var B=N.options&&N.options.ranges;typeof D.yy.parseError=="function"?this.parseError=D.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function P(ue){k.length=k.length-2*ue,C.length=C.length-ue,_.length=_.length-ue}x(P,"popStack");function G(){var ue;return ue=A.pop()||N.lex()||S,typeof ue!="number"&&(ue instanceof Array&&(A=ue,ue=A.pop()),ue=w.symbols_[ue]||ue),ue}x(G,"lex");for(var V,Y,W,ie,K={},se,J,Z,ee;;){if(Y=k[k.length-1],this.defaultActions[Y]?W=this.defaultActions[Y]:((V===null||typeof V>"u")&&(V=G()),W=L[Y]&&L[Y][V]),typeof W>"u"||!W.length||!W[0]){var ne="";ee=[];for(se in L[Y])this.terminals_[se]&&se>F&&ee.push("'"+this.terminals_[se]+"'");N.showPosition?ne="Parse error on line "+(M+1)+`: +A`,s,s,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}function Dve(t,e){return Ive(Lve(t),e)}function Kgt(t,e={}){const{lossFunction:r,layoutFunction:n=Tve,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:s,width:o=600,height:l=350,padding:u=15,scaleToFit:h=!1,symmetricalTextCentre:d=!1,distinct:f,round:p=2}=e;let g=n(t,{lossFunction:r==="default"||!r?pm:r==="logRatio"?Cve:r,distinct:f});i&&(g=kve(g,a,s));const m=Eve(g,o,l,u,h),y=Rve(m,t,d),v=new Map(Object.keys(m).map(w=>[w,{set:w,x:m[w].x,y:m[w].y,radius:m[w].radius}])),x=t.map(w=>{const k=w.sets.map(_=>v.get(_)),S=Lve(k),C=Ive(S,p);return{circles:k,arcs:S,path:C,area:w,has:new Set(w.sets)}});function b(w){let k="";for(const S of x)S.has.size>w.length&&w.every(C=>S.has.has(C))&&(k+=" "+S.path);return k}return x.map(({circles:w,arcs:k,path:S,area:C})=>({data:C,text:y[C.sets],circles:w,arcs:k,path:S,distinctPath:S+b(C.sets)}))}var FP=(function(){var t=T(function(x,b,w,k){for(w=w||{},k=x.length;k--;w[x[k]]=b);return w},"o"),e=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],a=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],s=[1,31],o=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],h=[1,56],d=[1,58],f=[1,59],p=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],m={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:T(function(b,w,k,S,C,_,L){var O=_.length-1;switch(C){case 1:return _[O-1];case 2:case 3:case 4:this.$=[];break;case 5:_[O-1].push(_[O]),this.$=_[O-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=_[O];break;case 8:S.setDiagramTitle(_[O].substr(6)),this.$=_[O].substr(6);break;case 9:S.addSubsetData([_[O]],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 10:S.addSubsetData([_[O-1]],_[O],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 11:S.addSubsetData([_[O-2]],void 0,parseFloat(_[O])),S.setIndentMode&&S.setIndentMode(!0);break;case 12:S.addSubsetData([_[O-3]],_[O-2],parseFloat(_[O])),S.setIndentMode&&S.setIndentMode(!0);break;case 13:if(_[O].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(_[O]),S.addSubsetData(_[O],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 14:if(_[O-1].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(_[O-1]),S.addSubsetData(_[O-1],_[O],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 15:if(_[O-2].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(_[O-2]),S.addSubsetData(_[O-2],void 0,parseFloat(_[O])),S.setIndentMode&&S.setIndentMode(!0);break;case 16:if(_[O-3].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(_[O-3]),S.addSubsetData(_[O-3],_[O-2],parseFloat(_[O])),S.setIndentMode&&S.setIndentMode(!0);break;case 17:case 18:case 19:S.addTextData(_[O-1],_[O],void 0);break;case 20:case 21:S.addTextData(_[O-2],_[O-1],_[O]);break;case 23:S.addStyleData(_[O-1],_[O]);break;case 24:case 25:case 26:var M=S.getCurrentSets();if(!M)throw new Error("text requires set");S.addTextData(M,_[O],void 0);break;case 27:case 28:var M=S.getCurrentSets();if(!M)throw new Error("text requires set");S.addTextData(M,_[O-1],_[O]);break;case 29:case 41:this.$=[_[O]];break;case 30:case 42:this.$=[..._[O-2],_[O]];break;case 31:this.$=[_[O-2],_[O]];break;case 33:this.$=_[O].join(" ");break;case 34:this.$=[_[O]];break;case 35:_[O-1].push(_[O]),this.$=_[O-1];break;case 43:case 44:this.$=_[O];break}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:n,21:i},{13:20,18:19,20:n,21:i},{13:20,18:21,20:n,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:i},t(r,[2,9],{14:[1,27],15:[1,28]}),t(a,[2,43]),t(a,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:s}),t(a,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:s},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:o,25:37,26:38,27:s},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:i},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(a,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:o,26:51},{16:u,20:h,21:[1,53],28:52,29:54,30:55,31:d,32:f,33:p},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:h,31:d,32:f,33:p}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:T(function(b,w){if(w.recoverable)this.trace(b);else{var k=new Error(b);throw k.hash=w,k}},"parseError"),parse:T(function(b){var w=this,k=[0],S=[],C=[null],_=[],L=this.table,O="",M=0,z=0,F=2,A=1,R=_.slice.call(arguments,1),N=Object.create(this.lexer),D={yy:{}};for(var I in this.yy)Object.prototype.hasOwnProperty.call(this.yy,I)&&(D.yy[I]=this.yy[I]);N.setInput(b,D.yy),D.yy.lexer=N,D.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var $=N.yylloc;_.push($);var B=N.options&&N.options.ranges;typeof D.yy.parseError=="function"?this.parseError=D.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function P(ue){k.length=k.length-2*ue,C.length=C.length-ue,_.length=_.length-ue}T(P,"popStack");function G(){var ue;return ue=S.pop()||N.lex()||A,typeof ue!="number"&&(ue instanceof Array&&(S=ue,ue=S.pop()),ue=w.symbols_[ue]||ue),ue}T(G,"lex");for(var V,X,W,ie,K={},se,J,Z,ee;;){if(X=k[k.length-1],this.defaultActions[X]?W=this.defaultActions[X]:((V===null||typeof V>"u")&&(V=G()),W=L[X]&&L[X][V]),typeof W>"u"||!W.length||!W[0]){var ne="";ee=[];for(se in L[X])this.terminals_[se]&&se>F&&ee.push("'"+this.terminals_[se]+"'");N.showPosition?ne="Parse error on line "+(M+1)+`: `+N.showPosition()+` -Expecting `+ee.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ne="Parse error on line "+(M+1)+": Unexpected "+(V==S?"end of input":"'"+(this.terminals_[V]||V)+"'"),this.parseError(ne,{text:N.match,token:this.terminals_[V]||V,line:N.yylineno,loc:$,expected:ee})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Y+", token: "+V);switch(W[0]){case 1:k.push(V),C.push(N.yytext),_.push(N.yylloc),k.push(W[1]),V=null,z=N.yyleng,O=N.yytext,M=N.yylineno,$=N.yylloc;break;case 2:if(J=this.productions_[W[1]][1],K.$=C[C.length-J],K._$={first_line:_[_.length-(J||1)].first_line,last_line:_[_.length-1].last_line,first_column:_[_.length-(J||1)].first_column,last_column:_[_.length-1].last_column},B&&(K._$.range=[_[_.length-(J||1)].range[0],_[_.length-1].range[1]]),ie=this.performAction.apply(K,[O,z,M,D.yy,W[1],C,_].concat(R)),typeof ie<"u")return ie;J&&(k=k.slice(0,-1*J*2),C=C.slice(0,-1*J),_=_.slice(0,-1*J)),k.push(this.productions_[W[1]][0]),C.push(K.$),_.push(K._$),Z=L[k[k.length-2]][k[k.length-1]],k.push(Z);break;case 3:return!0}}return!0},"parse")},y=(function(){var T={EOF:1,parseError:x(function(w,k){if(this.yy.parser)this.yy.parser.parseError(w,k);else throw new Error(w)},"parseError"),setInput:x(function(b,w){return this.yy=w||this.yy||{},this._input=b,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var w=b.match(/(?:\r\n?|\n).*/g);return w?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:x(function(b){var w=b.length,k=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-w),this.offset-=w;var A=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),k.length-1&&(this.yylineno-=k.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:k?(k.length===A.length?this.yylloc.first_column:0)+A[A.length-k.length].length-k[0].length:this.yylloc.first_column-w},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-w]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(b){this.unput(this.match.slice(b))},"less"),pastInput:x(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var b=this.pastInput(),w=new Array(b.length+1).join("-");return b+this.upcomingInput()+` -`+w+"^"},"showPosition"),test_match:x(function(b,w){var k,A,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),A=b[0].match(/(?:\r\n?|\n).*/g),A&&(this.yylineno+=A.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:A?A[A.length-1].length-A[A.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],k=this.performAction.call(this,this.yy,this,w,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),k)return k;if(this._backtrack){for(var _ in C)this[_]=C[_];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,w,k,A;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),_=0;_w[0].length)){if(w=k,A=_,this.options.backtrack_lexer){if(b=this.test_match(k,C[_]),b!==!1)return b;if(this._backtrack){w=!1;continue}else return!1}else if(!this.options.flex)break}return w?(b=this.test_match(w,C[A]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var w=this.next();return w||this.lex()},"lex"),begin:x(function(w){this.conditionStack.push(w)},"begin"),popState:x(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:x(function(w){this.begin(w)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(w,k,A,C){switch(A){case 0:break;case 1:break;case 2:break;case 3:if(w.getIndentMode&&w.getIndentMode())return w.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:w.setIndentMode&&w.setIndentMode(!1),this.begin("INITIAL"),this.unput(k.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(w.consumeIndentText)w.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return k.yytext=k.yytext.slice(2,-2),14;case 17:return k.yytext=k.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return T})();m.lexer=y;function v(){this.yy={}}return x(v,"Parser"),v.prototype=m,m.Parser=v,new v})();NP.parser=NP;var Pgt=NP,OP=[],$P=[],PP=[],BP=new Set,FP,zP=!1,Bgt=x((t,e,r)=>{const n=e6(t).sort(),i=r??10/Math.pow(t.length,2);FP=n,n.length===1&&BP.add(n[0]),OP.push({sets:n,size:i,label:e?sw(e):void 0})},"addSubsetData"),Fgt=x(()=>OP,"getSubsetData"),sw=x(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),zgt=x(t=>t&&sw(t),"normalizeStyleValue"),Ggt=x((t,e,r)=>{const n=sw(e);$P.push({sets:e6(t).sort(),id:n,label:r?sw(r):void 0})},"addTextData"),qgt=x((t,e)=>{const r=e6(t).sort(),n={};for(const[i,a]of e)n[i]=zgt(a)??a;PP.push({targets:r,styles:n})},"addStyleData"),Vgt=x(()=>PP,"getStyleData"),e6=x(t=>t.map(e=>sw(e)),"normalizeIdentifierList"),Wgt=x(t=>{const r=e6(t).filter(n=>!BP.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),Ugt=x(()=>$P,"getTextData"),Hgt=x(()=>FP,"getCurrentSets"),Ygt=x(()=>zP,"getIndentMode"),Xgt=x(t=>{zP=t},"setIndentMode"),Kgt=Fr.venn;function Ave(){return ti(Kgt,lr().venn)}x(Ave,"getConfig");var jgt=x(()=>{In(),OP.length=0,$P.length=0,PP.length=0,BP.clear(),FP=void 0,zP=!1},"customClear"),Zgt={getConfig:Ave,clear:jgt,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,getAccDescription:Gn,setAccDescription:zn,addSubsetData:Bgt,getSubsetData:Fgt,addTextData:Ggt,addStyleData:qgt,validateUnionIdentifiers:Wgt,getTextData:Ugt,getStyleData:Vgt,getCurrentSets:Hgt,getIndentMode:Ygt,setIndentMode:Xgt},Qgt=x(t=>` +Expecting `+ee.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ne="Parse error on line "+(M+1)+": Unexpected "+(V==A?"end of input":"'"+(this.terminals_[V]||V)+"'"),this.parseError(ne,{text:N.match,token:this.terminals_[V]||V,line:N.yylineno,loc:$,expected:ee})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+X+", token: "+V);switch(W[0]){case 1:k.push(V),C.push(N.yytext),_.push(N.yylloc),k.push(W[1]),V=null,z=N.yyleng,O=N.yytext,M=N.yylineno,$=N.yylloc;break;case 2:if(J=this.productions_[W[1]][1],K.$=C[C.length-J],K._$={first_line:_[_.length-(J||1)].first_line,last_line:_[_.length-1].last_line,first_column:_[_.length-(J||1)].first_column,last_column:_[_.length-1].last_column},B&&(K._$.range=[_[_.length-(J||1)].range[0],_[_.length-1].range[1]]),ie=this.performAction.apply(K,[O,z,M,D.yy,W[1],C,_].concat(R)),typeof ie<"u")return ie;J&&(k=k.slice(0,-1*J*2),C=C.slice(0,-1*J),_=_.slice(0,-1*J)),k.push(this.productions_[W[1]][0]),C.push(K.$),_.push(K._$),Z=L[k[k.length-2]][k[k.length-1]],k.push(Z);break;case 3:return!0}}return!0},"parse")},y=(function(){var x={EOF:1,parseError:T(function(w,k){if(this.yy.parser)this.yy.parser.parseError(w,k);else throw new Error(w)},"parseError"),setInput:T(function(b,w){return this.yy=w||this.yy||{},this._input=b,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var w=b.match(/(?:\r\n?|\n).*/g);return w?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:T(function(b){var w=b.length,k=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-w),this.offset-=w;var S=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),k.length-1&&(this.yylineno-=k.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:k?(k.length===S.length?this.yylloc.first_column:0)+S[S.length-k.length].length-k[0].length:this.yylloc.first_column-w},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-w]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(b){this.unput(this.match.slice(b))},"less"),pastInput:T(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var b=this.pastInput(),w=new Array(b.length+1).join("-");return b+this.upcomingInput()+` +`+w+"^"},"showPosition"),test_match:T(function(b,w){var k,S,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),S=b[0].match(/(?:\r\n?|\n).*/g),S&&(this.yylineno+=S.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:S?S[S.length-1].length-S[S.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],k=this.performAction.call(this,this.yy,this,w,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),k)return k;if(this._backtrack){for(var _ in C)this[_]=C[_];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,w,k,S;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),_=0;_w[0].length)){if(w=k,S=_,this.options.backtrack_lexer){if(b=this.test_match(k,C[_]),b!==!1)return b;if(this._backtrack){w=!1;continue}else return!1}else if(!this.options.flex)break}return w?(b=this.test_match(w,C[S]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var w=this.next();return w||this.lex()},"lex"),begin:T(function(w){this.conditionStack.push(w)},"begin"),popState:T(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:T(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:T(function(w){this.begin(w)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(w,k,S,C){switch(S){case 0:break;case 1:break;case 2:break;case 3:if(w.getIndentMode&&w.getIndentMode())return w.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:w.setIndentMode&&w.setIndentMode(!1),this.begin("INITIAL"),this.unput(k.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(w.consumeIndentText)w.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return k.yytext=k.yytext.slice(2,-2),14;case 17:return k.yytext=k.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return x})();m.lexer=y;function v(){this.yy={}}return T(v,"Parser"),v.prototype=m,m.Parser=v,new v})();FP.parser=FP;var jgt=FP,zP=[],GP=[],qP=[],VP=new Set,WP,UP=!1,Zgt=T((t,e,r)=>{const n=n6(t).sort(),i=r??10/Math.pow(t.length,2);WP=n,n.length===1&&VP.add(n[0]),zP.push({sets:n,size:i,label:e?lw(e):void 0})},"addSubsetData"),Qgt=T(()=>zP,"getSubsetData"),lw=T(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),Jgt=T(t=>t&&lw(t),"normalizeStyleValue"),emt=T((t,e,r)=>{const n=lw(e);GP.push({sets:n6(t).sort(),id:n,label:r?lw(r):void 0})},"addTextData"),tmt=T((t,e)=>{const r=n6(t).sort(),n={};for(const[i,a]of e)n[i]=Jgt(a)??a;qP.push({targets:r,styles:n})},"addStyleData"),rmt=T(()=>qP,"getStyleData"),n6=T(t=>t.map(e=>lw(e)),"normalizeIdentifierList"),nmt=T(t=>{const r=n6(t).filter(n=>!VP.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),imt=T(()=>GP,"getTextData"),amt=T(()=>WP,"getCurrentSets"),smt=T(()=>UP,"getIndentMode"),omt=T(t=>{UP=t},"setIndentMode"),lmt=Fr.venn;function Mve(){return ti(lmt,lr().venn)}T(Mve,"getConfig");var cmt=T(()=>{In(),zP.length=0,GP.length=0,qP.length=0,VP.clear(),WP=void 0,UP=!1},"customClear"),umt={getConfig:Mve,clear:cmt,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,getAccDescription:Gn,setAccDescription:zn,addSubsetData:Zgt,getSubsetData:Qgt,addTextData:emt,addStyleData:tmt,validateUnionIdentifiers:nmt,getTextData:imt,getStyleData:rmt,getCurrentSets:amt,getIndentMode:smt,setIndentMode:omt},hmt=T(t=>` .venn-title { font-size: 32px; fill: ${t.vennTitleTextColor}; @@ -3279,7 +3279,7 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ne="Parse error font-family: ${t.fontFamily}; color: ${t.vennSetTextColor}; } -`,"getStyles"),Jgt=Qgt;function _ve(t){const e=new Map;for(const r of t){const n=r.targets.join("|"),i=e.get(n);i?Object.assign(i,r.styles):e.set(n,{...r.styles})}return e}x(_ve,"buildStyleByKey");var emt=x((t,e,r,n)=>{var S,R,N;const i=n.db,a=(S=i.getConfig)==null?void 0:S.call(i),{themeVariables:s,look:o,handDrawnSeed:l}=lr(),u=o==="handDrawn",h=[s.venn1,s.venn2,s.venn3,s.venn4,s.venn5,s.venn6,s.venn7,s.venn8].filter(Boolean),d=(R=i.getDiagramTitle)==null?void 0:R.call(i),f=i.getSubsetData(),p=i.getTextData(),g=_ve(i.getStyleData()),m=(a==null?void 0:a.width)??800,y=(a==null?void 0:a.height)??450,T=m/1600,b=d?48*T:0,w=s.primaryTextColor??s.textColor,k=ys(e);k.attr("viewBox",`0 0 ${m} ${y}`),d&&k.append("text").text(d).attr("class","venn-title").attr("font-size",`${32*T}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*T).style("fill",s.vennTitleTextColor||s.titleColor);const A=pt(document.createElement("div")),C=Dgt().width(m).height(y-b);A.datum(f).call(C);const _=u?Kt.svg(A.select("svg").node()):void 0,L=$gt(f,{width:m,height:y-b,padding:(a==null?void 0:a.padding)??15}),O=new Map;for(const D of L){const I=$h([...D.data.sets].sort());O.set(I,D)}p.length>0&&Rve(a,O,A,p,T,g);const M=Ba(s.background||"#f4f4f4");A.selectAll(".venn-circle").each(function(D,I){var se;const $=pt(this),P=$h([...D.sets].sort()),G=g.get(P),V=(G==null?void 0:G.fill)||h[I%h.length]||s.primaryColor;$.classed(`venn-set-${I%8}`,!0);const Y=(G==null?void 0:G["fill-opacity"])??.1,W=(G==null?void 0:G.stroke)||V,ie=(G==null?void 0:G["stroke-width"])||`${5*T}`;if(u&&_){const J=O.get(P);if(J&&J.circles.length>0){const Z=J.circles[0],ee=_.circle(Z.x,Z.y,Z.radius*2,{roughness:.7,seed:l,fill:JP(V,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+I*60,stroke:W,strokeWidth:parseFloat(String(ie))});$.select("path").remove(),(se=$.node())==null||se.insertBefore(ee,$.select("text").node())}}else $.select("path").style("fill",V).style("fill-opacity",Y).style("stroke",W).style("stroke-width",ie).style("stroke-opacity",.95);const K=(G==null?void 0:G.color)||(M?at(V,30):st(V,30));$.select("text").style("font-size",`${48*T}px`).style("fill",K)}),u&&_?A.selectAll(".venn-intersection").each(function(D){var V;const I=pt(this),B=$h([...D.sets].sort()),P=g.get(B),G=P==null?void 0:P.fill;if(G){const Y=I.select("path"),W=Y.attr("d");if(W){const ie=_.path(W,{roughness:.7,seed:l,fill:JP(G,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),K=Y.node();(V=K==null?void 0:K.parentNode)==null||V.insertBefore(ie,K),Y.remove()}}else I.select("path").style("fill-opacity",0);I.select("text").style("font-size",`${48*T}px`).style("fill",(P==null?void 0:P.color)??s.vennSetTextColor??w)}):(A.selectAll(".venn-intersection text").style("font-size",`${48*T}px`).style("fill",D=>{var B;const $=$h([...D.sets].sort());return((B=g.get($))==null?void 0:B.color)??s.vennSetTextColor??w}),A.selectAll(".venn-intersection path").style("fill-opacity",D=>{var B;const $=$h([...D.sets].sort());return(B=g.get($))!=null&&B.fill?1:0}).style("fill",D=>{var B;const $=$h([...D.sets].sort());return((B=g.get($))==null?void 0:B.fill)??"transparent"}));const z=k.append("g").attr("transform",`translate(0, ${b})`),F=A.select("svg").node();if(F&&"childNodes"in F)for(const D of[...F.childNodes])(N=z.node())==null||N.appendChild(D);wi(k,y,m,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function $h(t){return t.join("|")}x($h,"stableSetsKey");function Rve(t,e,r,n,i,a){var h;const s=(t==null?void 0:t.useDebugLayout)??!1,l=r.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const d of n){const f=$h(d.sets),p=u.get(f);p?p.push(d):u.set(f,[d])}for(const[d,f]of u.entries()){const p=e.get(d);if(!(p!=null&&p.text))continue;const g=p.text.x,m=p.text.y,y=Math.min(...p.circles.map(R=>R.radius)),v=Math.min(...p.circles.map(R=>R.radius-Math.hypot(g-R.x,m-R.y)));let T=Number.isFinite(v)?Math.max(0,v):0;T===0&&Number.isFinite(y)&&(T=y*.6);const b=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);s&&b.append("circle").attr("class","venn-text-debug-circle").attr("cx",g).attr("cy",m).attr("r",T).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const w=Math.max(80*i,T*2*.95),k=Math.max(60*i,T*2*.95),_=(p.data.label&&p.data.label.length>0?Math.min(32*i,T*.25):0)+(f.length<=2?30*i:0),L=g-w/2,O=m-k/2+_,M=Math.max(1,Math.ceil(Math.sqrt(f.length))),z=Math.max(1,Math.ceil(f.length/M)),F=w/M,S=k/z;for(const[R,N]of f.entries()){const D=R%M,I=Math.floor(R/M),$=L+F*(D+.5),B=O+S*(I+.5);s&&b.append("rect").attr("class","venn-text-debug-cell").attr("x",L+F*D).attr("y",O+S*I).attr("width",F).attr("height",S).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const P=F*.9,G=S*.9,V=b.append("foreignObject").attr("class","venn-text-node-fo").attr("width",P).attr("height",G).attr("x",$-P/2).attr("y",B-G/2).attr("overflow","visible"),Y=(h=a.get(N.id))==null?void 0:h.color,W=V.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(N.label??N.id);Y&&W.style("color",Y)}}}x(Rve,"renderTextNodes");var tmt={draw:emt},rmt={parser:Pgt,db:Zgt,renderer:tmt,styles:Jgt};const nmt=Object.freeze(Object.defineProperty({__proto__:null,diagram:rmt},Symbol.toStringTag,{value:"Module"}));var Lve=(Xv=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Dn,this.getAccTitle=Fn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getAccDescription=Gn,this.setAccDescription=zn}getNodes(){return this.nodes}getConfig(){const e=Fr,r=lr();return ti({...e.treemap,...r.treemap??{}})}addNode(e,r){this.nodes.push(e),this.levels.set(e,r),r===0&&(this.outerNodes.push(e),this.root??(this.root=e))}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,r){const n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},i=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i&&i.forEach(a=>{g_(a)&&(n!=null&&n.textStyles?n.textStyles.push(a):n.textStyles=[a]),n!=null&&n.styles?n.styles.push(a):n.styles=[a]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){var r;return((r=this.classes.get(e))==null?void 0:r.styles)??[]}clear(){In(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},x(Xv,"TreeMapDB"),Xv);function Ive(t){if(!t.length)return[];const e=[],r=[];return t.forEach(n=>{const i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(i.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)e.push(i);else{const a=r[r.length-1].node;a.children?a.children.push(i):a.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}x(Ive,"buildHierarchy");var imt=x((t,e)=>{zl(t,e);const r=[];for(const a of t.TreemapRows??[])a.$type==="ClassDefStatement"&&e.addClass(a.className??"",a.styleText??"");for(const a of t.TreemapRows??[]){const s=a.item;if(!s)continue;const o=a.indent?parseInt(a.indent):0,l=amt(s),u=s.classSelector?e.getStylesForClass(s.classSelector):[],h=u.length>0?u:void 0,d={level:o,name:l,type:s.$type,value:s.value,classSelector:s.classSelector,cssCompiledStyles:h};r.push(d)}const n=Ive(r),i=x((a,s)=>{for(const o of a)e.addNode(o,s),o.children&&o.children.length>0&&i(o.children,s+1)},"addNodesRecursively");i(n,0)},"populate"),amt=x(t=>t.name?String(t.name):"","getItemName"),Dve={parser:{yy:void 0},parse:x(async t=>{var e;try{const n=await Qo("treemap",t);ae.debug("Treemap AST:",n);const i=(e=Dve.parser)==null?void 0:e.yy;if(!(i instanceof Lve))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");imt(n,i)}catch(r){throw ae.error("Error parsing treemap:",r),r}},"parse")},smt=10,pm=10,ow=25,omt=x((t,e,r,n)=>{const i=n.db,a=i.getConfig(),s=a.padding??smt,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=lr();if(!l)return;const h=o?30:0,d=ys(e),f=a.nodeWidth?a.nodeWidth*pm:960,p=a.nodeHeight?a.nodeHeight*pm:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),wi(d,m,g,a.useMaxWidth);let y;try{const S=a.valueFormat||",";if(S==="$0,0")y=x(R=>"$"+Zh(",")(R),"valueFormat");else if(S.startsWith("$")&&S.includes(",")){const R=/\.\d+/.exec(S),N=R?R[0]:"";y=x(D=>"$"+Zh(","+N)(D),"valueFormat")}else if(S.startsWith("$")){const R=S.substring(1);y=x(N=>"$"+Zh(R||"")(N),"valueFormat")}else y=Zh(S)}catch(S){ae.error("Error creating format function:",S),y=Zh(",")}const v=Qh().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),T=Qh().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),b=Qh().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);o&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(o);const w=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),k=fA(l).sum(S=>S.value??0).sort((S,R)=>(R.value??0)-(S.value??0)),C=l5e().size([f,p]).paddingTop(S=>S.children&&S.children.length>0?ow+pm:0).paddingInner(s).paddingLeft(S=>S.children&&S.children.length>0?pm:0).paddingRight(S=>S.children&&S.children.length>0?pm:0).paddingBottom(S=>S.children&&S.children.length>0?pm:0).round(!0)(k),_=C.descendants().filter(S=>S.children&&S.children.length>0),L=w.selectAll(".treemapSection").data(_).enter().append("g").attr("class","treemapSection").attr("transform",S=>`translate(${S.x0},${S.y0})`);L.append("rect").attr("width",S=>S.x1-S.x0).attr("height",ow).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",S=>S.depth===0?"display: none;":""),L.append("clipPath").attr("id",(S,R)=>`clip-section-${e}-${R}`).append("rect").attr("width",S=>Math.max(0,S.x1-S.x0-12)).attr("height",ow),L.append("rect").attr("width",S=>S.x1-S.x0).attr("height",S=>S.y1-S.y0).attr("class",(S,R)=>`treemapSection section${R}`).attr("fill",S=>v(S.data.name)).attr("fill-opacity",.6).attr("stroke",S=>T(S.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",S=>{if(S.depth===0)return"display: none;";const R=Xt({cssCompiledStyles:S.data.cssCompiledStyles});return R.nodeStyles+";"+R.borderStyles.join(";")}),L.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",ow/2).attr("dominant-baseline","middle").text(S=>S.depth===0?"":S.data.name).attr("font-weight","bold").attr("style",S=>{if(S.depth===0)return"display: none;";const R="dominant-baseline: middle; font-size: 12px; fill:"+b(S.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",N=Xt({cssCompiledStyles:S.data.cssCompiledStyles});return R+N.labelStyles.replace("color:","fill:")}).each(function(S){if(S.depth===0)return;const R=pt(this),N=S.data.name;R.text(N);const D=S.x1-S.x0,I=6;let $;a.showValues!==!1&&S.value?$=D-10-30-10-I:$=D-I-6;const P=Math.max(15,$),G=R.node();if(G.getComputedTextLength()>P){let W=N;for(;W.length>0;){if(W=N.substring(0,W.length-1),W.length===0){R.text("..."),G.getComputedTextLength()>P&&R.text("");break}if(R.text(W+"..."),G.getComputedTextLength()<=P)break}}}),a.showValues!==!1&&L.append("text").attr("class","treemapSectionValue").attr("x",S=>S.x1-S.x0-10).attr("y",ow/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(S=>S.value?y(S.value):"").attr("font-style","italic").attr("style",S=>{if(S.depth===0)return"display: none;";const R="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+b(S.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",N=Xt({cssCompiledStyles:S.data.cssCompiledStyles});return R+N.labelStyles.replace("color:","fill:")});const O=C.leaves(),M=w.selectAll(".treemapLeafGroup").data(O).enter().append("g").attr("class",(S,R)=>`treemapNode treemapLeafGroup leaf${R}${S.data.classSelector?` ${S.data.classSelector}`:""}x`).attr("transform",S=>`translate(${S.x0},${S.y0})`);M.append("rect").attr("width",S=>S.x1-S.x0).attr("height",S=>S.y1-S.y0).attr("class","treemapLeaf").attr("fill",S=>S.parent?v(S.parent.data.name):v(S.data.name)).attr("style",S=>Xt({cssCompiledStyles:S.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",S=>S.parent?v(S.parent.data.name):v(S.data.name)).attr("stroke-width",3),M.append("clipPath").attr("id",(S,R)=>`clip-${e}-${R}`).append("rect").attr("width",S=>Math.max(0,S.x1-S.x0-4)).attr("height",S=>Math.max(0,S.y1-S.y0-4)),M.append("text").attr("class","treemapLabel").attr("x",S=>(S.x1-S.x0)/2).attr("y",S=>(S.y1-S.y0)/2).attr("style",S=>{const R="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+b(S.data.name)+";",N=Xt({cssCompiledStyles:S.data.cssCompiledStyles});return R+N.labelStyles.replace("color:","fill:")}).attr("clip-path",(S,R)=>`url(#clip-${e}-${R})`).text(S=>S.data.name).each(function(S){const R=pt(this),N=S.x1-S.x0,D=S.y1-S.y0,I=R.node(),$=4,B=N-2*$,P=D-2*$;if(B<10||P<10){R.style("display","none");return}let G=parseInt(R.style("font-size"),10);const V=8,Y=28,W=.6,ie=6,K=2;for(;I.getComputedTextLength()>B&&G>V;)G--,R.style("font-size",`${G}px`);let se=Math.max(ie,Math.min(Y,Math.round(G*W))),J=G+K+se;for(;J>P&&G>V&&(G--,se=Math.max(ie,Math.min(Y,Math.round(G*W))),!(seB||G(R.x1-R.x0)/2).attr("y",function(R){return(R.y1-R.y0)/2}).attr("style",R=>{const N="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+b(R.data.name)+";",D=Xt({cssCompiledStyles:R.data.cssCompiledStyles});return N+D.labelStyles.replace("color:","fill:")}).attr("clip-path",(R,N)=>`url(#clip-${e}-${N})`).text(R=>R.value?y(R.value):"").each(function(R){const N=pt(this),D=this.parentNode;if(!D){N.style("display","none");return}const I=pt(D).select(".treemapLabel");if(I.empty()||I.style("display")==="none"){N.style("display","none");return}const $=parseFloat(I.style("font-size")),B=28,P=.6,G=6,V=2,Y=Math.max(G,Math.min(B,Math.round($*P)));N.style("font-size",`${Y}px`);const ie=(R.y1-R.y0)/2+$/2+V;N.attr("y",ie);const K=R.x1-R.x0,Z=R.y1-R.y0-4,ee=K-8;N.node().getComputedTextLength()>ee||ie+Y>Z||Y{const e=w0(),r=lr(),n=ti(e,r.themeVariables),i=ti(umt,t),a=i.titleColor??n.titleColor,s=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return` +`,"getStyles"),dmt=hmt;function Nve(t){const e=new Map;for(const r of t){const n=r.targets.join("|"),i=e.get(n);i?Object.assign(i,r.styles):e.set(n,{...r.styles})}return e}T(Nve,"buildStyleByKey");var fmt=T((t,e,r,n)=>{var A,R,N;const i=n.db,a=(A=i.getConfig)==null?void 0:A.call(i),{themeVariables:s,look:o,handDrawnSeed:l}=lr(),u=o==="handDrawn",h=[s.venn1,s.venn2,s.venn3,s.venn4,s.venn5,s.venn6,s.venn7,s.venn8].filter(Boolean),d=(R=i.getDiagramTitle)==null?void 0:R.call(i),f=i.getSubsetData(),p=i.getTextData(),g=Nve(i.getStyleData()),m=(a==null?void 0:a.width)??800,y=(a==null?void 0:a.height)??450,x=m/1600,b=d?48*x:0,w=s.primaryTextColor??s.textColor,k=ys(e);k.attr("viewBox",`0 0 ${m} ${y}`),d&&k.append("text").text(d).attr("class","venn-title").attr("font-size",`${32*x}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*x).style("fill",s.vennTitleTextColor||s.titleColor);const S=pt(document.createElement("div")),C=Ugt().width(m).height(y-b);S.datum(f).call(C);const _=u?Kt.svg(S.select("svg").node()):void 0,L=Kgt(f,{width:m,height:y-b,padding:(a==null?void 0:a.padding)??15}),O=new Map;for(const D of L){const I=$h([...D.data.sets].sort());O.set(I,D)}p.length>0&&Ove(a,O,S,p,x,g);const M=Ba(s.background||"#f4f4f4");S.selectAll(".venn-circle").each(function(D,I){var se;const $=pt(this),P=$h([...D.sets].sort()),G=g.get(P),V=(G==null?void 0:G.fill)||h[I%h.length]||s.primaryColor;$.classed(`venn-set-${I%8}`,!0);const X=(G==null?void 0:G["fill-opacity"])??.1,W=(G==null?void 0:G.stroke)||V,ie=(G==null?void 0:G["stroke-width"])||`${5*x}`;if(u&&_){const J=O.get(P);if(J&&J.circles.length>0){const Z=J.circles[0],ee=_.circle(Z.x,Z.y,Z.radius*2,{roughness:.7,seed:l,fill:iB(V,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+I*60,stroke:W,strokeWidth:parseFloat(String(ie))});$.select("path").remove(),(se=$.node())==null||se.insertBefore(ee,$.select("text").node())}}else $.select("path").style("fill",V).style("fill-opacity",X).style("stroke",W).style("stroke-width",ie).style("stroke-opacity",.95);const K=(G==null?void 0:G.color)||(M?at(V,30):st(V,30));$.select("text").style("font-size",`${48*x}px`).style("fill",K)}),u&&_?S.selectAll(".venn-intersection").each(function(D){var V;const I=pt(this),B=$h([...D.sets].sort()),P=g.get(B),G=P==null?void 0:P.fill;if(G){const X=I.select("path"),W=X.attr("d");if(W){const ie=_.path(W,{roughness:.7,seed:l,fill:iB(G,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),K=X.node();(V=K==null?void 0:K.parentNode)==null||V.insertBefore(ie,K),X.remove()}}else I.select("path").style("fill-opacity",0);I.select("text").style("font-size",`${48*x}px`).style("fill",(P==null?void 0:P.color)??s.vennSetTextColor??w)}):(S.selectAll(".venn-intersection text").style("font-size",`${48*x}px`).style("fill",D=>{var B;const $=$h([...D.sets].sort());return((B=g.get($))==null?void 0:B.color)??s.vennSetTextColor??w}),S.selectAll(".venn-intersection path").style("fill-opacity",D=>{var B;const $=$h([...D.sets].sort());return(B=g.get($))!=null&&B.fill?1:0}).style("fill",D=>{var B;const $=$h([...D.sets].sort());return((B=g.get($))==null?void 0:B.fill)??"transparent"}));const z=k.append("g").attr("transform",`translate(0, ${b})`),F=S.select("svg").node();if(F&&"childNodes"in F)for(const D of[...F.childNodes])(N=z.node())==null||N.appendChild(D);wi(k,y,m,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function $h(t){return t.join("|")}T($h,"stableSetsKey");function Ove(t,e,r,n,i,a){var h;const s=(t==null?void 0:t.useDebugLayout)??!1,l=r.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const d of n){const f=$h(d.sets),p=u.get(f);p?p.push(d):u.set(f,[d])}for(const[d,f]of u.entries()){const p=e.get(d);if(!(p!=null&&p.text))continue;const g=p.text.x,m=p.text.y,y=Math.min(...p.circles.map(R=>R.radius)),v=Math.min(...p.circles.map(R=>R.radius-Math.hypot(g-R.x,m-R.y)));let x=Number.isFinite(v)?Math.max(0,v):0;x===0&&Number.isFinite(y)&&(x=y*.6);const b=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);s&&b.append("circle").attr("class","venn-text-debug-circle").attr("cx",g).attr("cy",m).attr("r",x).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const w=Math.max(80*i,x*2*.95),k=Math.max(60*i,x*2*.95),_=(p.data.label&&p.data.label.length>0?Math.min(32*i,x*.25):0)+(f.length<=2?30*i:0),L=g-w/2,O=m-k/2+_,M=Math.max(1,Math.ceil(Math.sqrt(f.length))),z=Math.max(1,Math.ceil(f.length/M)),F=w/M,A=k/z;for(const[R,N]of f.entries()){const D=R%M,I=Math.floor(R/M),$=L+F*(D+.5),B=O+A*(I+.5);s&&b.append("rect").attr("class","venn-text-debug-cell").attr("x",L+F*D).attr("y",O+A*I).attr("width",F).attr("height",A).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const P=F*.9,G=A*.9,V=b.append("foreignObject").attr("class","venn-text-node-fo").attr("width",P).attr("height",G).attr("x",$-P/2).attr("y",B-G/2).attr("overflow","visible"),X=(h=a.get(N.id))==null?void 0:h.color,W=V.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(N.label??N.id);X&&W.style("color",X)}}}T(Ove,"renderTextNodes");var pmt={draw:fmt},gmt={parser:jgt,db:umt,renderer:pmt,styles:dmt};const mmt=Object.freeze(Object.defineProperty({__proto__:null,diagram:gmt},Symbol.toStringTag,{value:"Module"}));var $ve=(Kv=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Dn,this.getAccTitle=Fn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getAccDescription=Gn,this.setAccDescription=zn}getNodes(){return this.nodes}getConfig(){const e=Fr,r=lr();return ti({...e.treemap,...r.treemap??{}})}addNode(e,r){this.nodes.push(e),this.levels.set(e,r),r===0&&(this.outerNodes.push(e),this.root??(this.root=e))}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,r){const n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},i=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i&&i.forEach(a=>{v_(a)&&(n!=null&&n.textStyles?n.textStyles.push(a):n.textStyles=[a]),n!=null&&n.styles?n.styles.push(a):n.styles=[a]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){var r;return((r=this.classes.get(e))==null?void 0:r.styles)??[]}clear(){In(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},T(Kv,"TreeMapDB"),Kv);function Pve(t){if(!t.length)return[];const e=[],r=[];return t.forEach(n=>{const i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(i.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)e.push(i);else{const a=r[r.length-1].node;a.children?a.children.push(i):a.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}T(Pve,"buildHierarchy");var ymt=T((t,e)=>{zl(t,e);const r=[];for(const a of t.TreemapRows??[])a.$type==="ClassDefStatement"&&e.addClass(a.className??"",a.styleText??"");for(const a of t.TreemapRows??[]){const s=a.item;if(!s)continue;const o=a.indent?parseInt(a.indent):0,l=vmt(s),u=s.classSelector?e.getStylesForClass(s.classSelector):[],h=u.length>0?u:void 0,d={level:o,name:l,type:s.$type,value:s.value,classSelector:s.classSelector,cssCompiledStyles:h};r.push(d)}const n=Pve(r),i=T((a,s)=>{for(const o of a)e.addNode(o,s),o.children&&o.children.length>0&&i(o.children,s+1)},"addNodesRecursively");i(n,0)},"populate"),vmt=T(t=>t.name?String(t.name):"","getItemName"),Bve={parser:{yy:void 0},parse:T(async t=>{var e;try{const n=await Qo("treemap",t);ae.debug("Treemap AST:",n);const i=(e=Bve.parser)==null?void 0:e.yy;if(!(i instanceof $ve))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");ymt(n,i)}catch(r){throw ae.error("Error parsing treemap:",r),r}},"parse")},bmt=10,gm=10,cw=25,xmt=T((t,e,r,n)=>{const i=n.db,a=i.getConfig(),s=a.padding??bmt,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=lr();if(!l)return;const h=o?30:0,d=ys(e),f=a.nodeWidth?a.nodeWidth*gm:960,p=a.nodeHeight?a.nodeHeight*gm:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),wi(d,m,g,a.useMaxWidth);let y;try{const A=a.valueFormat||",";if(A==="$0,0")y=T(R=>"$"+Zh(",")(R),"valueFormat");else if(A.startsWith("$")&&A.includes(",")){const R=/\.\d+/.exec(A),N=R?R[0]:"";y=T(D=>"$"+Zh(","+N)(D),"valueFormat")}else if(A.startsWith("$")){const R=A.substring(1);y=T(N=>"$"+Zh(R||"")(N),"valueFormat")}else y=Zh(A)}catch(A){ae.error("Error creating format function:",A),y=Zh(",")}const v=Qh().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),x=Qh().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),b=Qh().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);o&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(o);const w=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),k=mA(l).sum(A=>A.value??0).sort((A,R)=>(R.value??0)-(A.value??0)),C=p5e().size([f,p]).paddingTop(A=>A.children&&A.children.length>0?cw+gm:0).paddingInner(s).paddingLeft(A=>A.children&&A.children.length>0?gm:0).paddingRight(A=>A.children&&A.children.length>0?gm:0).paddingBottom(A=>A.children&&A.children.length>0?gm:0).round(!0)(k),_=C.descendants().filter(A=>A.children&&A.children.length>0),L=w.selectAll(".treemapSection").data(_).enter().append("g").attr("class","treemapSection").attr("transform",A=>`translate(${A.x0},${A.y0})`);L.append("rect").attr("width",A=>A.x1-A.x0).attr("height",cw).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",A=>A.depth===0?"display: none;":""),L.append("clipPath").attr("id",(A,R)=>`clip-section-${e}-${R}`).append("rect").attr("width",A=>Math.max(0,A.x1-A.x0-12)).attr("height",cw),L.append("rect").attr("width",A=>A.x1-A.x0).attr("height",A=>A.y1-A.y0).attr("class",(A,R)=>`treemapSection section${R}`).attr("fill",A=>v(A.data.name)).attr("fill-opacity",.6).attr("stroke",A=>x(A.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",A=>{if(A.depth===0)return"display: none;";const R=Xt({cssCompiledStyles:A.data.cssCompiledStyles});return R.nodeStyles+";"+R.borderStyles.join(";")}),L.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",cw/2).attr("dominant-baseline","middle").text(A=>A.depth===0?"":A.data.name).attr("font-weight","bold").attr("style",A=>{if(A.depth===0)return"display: none;";const R="dominant-baseline: middle; font-size: 12px; fill:"+b(A.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",N=Xt({cssCompiledStyles:A.data.cssCompiledStyles});return R+N.labelStyles.replace("color:","fill:")}).each(function(A){if(A.depth===0)return;const R=pt(this),N=A.data.name;R.text(N);const D=A.x1-A.x0,I=6;let $;a.showValues!==!1&&A.value?$=D-10-30-10-I:$=D-I-6;const P=Math.max(15,$),G=R.node();if(G.getComputedTextLength()>P){let W=N;for(;W.length>0;){if(W=N.substring(0,W.length-1),W.length===0){R.text("..."),G.getComputedTextLength()>P&&R.text("");break}if(R.text(W+"..."),G.getComputedTextLength()<=P)break}}}),a.showValues!==!1&&L.append("text").attr("class","treemapSectionValue").attr("x",A=>A.x1-A.x0-10).attr("y",cw/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(A=>A.value?y(A.value):"").attr("font-style","italic").attr("style",A=>{if(A.depth===0)return"display: none;";const R="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+b(A.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",N=Xt({cssCompiledStyles:A.data.cssCompiledStyles});return R+N.labelStyles.replace("color:","fill:")});const O=C.leaves(),M=w.selectAll(".treemapLeafGroup").data(O).enter().append("g").attr("class",(A,R)=>`treemapNode treemapLeafGroup leaf${R}${A.data.classSelector?` ${A.data.classSelector}`:""}x`).attr("transform",A=>`translate(${A.x0},${A.y0})`);M.append("rect").attr("width",A=>A.x1-A.x0).attr("height",A=>A.y1-A.y0).attr("class","treemapLeaf").attr("fill",A=>A.parent?v(A.parent.data.name):v(A.data.name)).attr("style",A=>Xt({cssCompiledStyles:A.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",A=>A.parent?v(A.parent.data.name):v(A.data.name)).attr("stroke-width",3),M.append("clipPath").attr("id",(A,R)=>`clip-${e}-${R}`).append("rect").attr("width",A=>Math.max(0,A.x1-A.x0-4)).attr("height",A=>Math.max(0,A.y1-A.y0-4)),M.append("text").attr("class","treemapLabel").attr("x",A=>(A.x1-A.x0)/2).attr("y",A=>(A.y1-A.y0)/2).attr("style",A=>{const R="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+b(A.data.name)+";",N=Xt({cssCompiledStyles:A.data.cssCompiledStyles});return R+N.labelStyles.replace("color:","fill:")}).attr("clip-path",(A,R)=>`url(#clip-${e}-${R})`).text(A=>A.data.name).each(function(A){const R=pt(this),N=A.x1-A.x0,D=A.y1-A.y0,I=R.node(),$=4,B=N-2*$,P=D-2*$;if(B<10||P<10){R.style("display","none");return}let G=parseInt(R.style("font-size"),10);const V=8,X=28,W=.6,ie=6,K=2;for(;I.getComputedTextLength()>B&&G>V;)G--,R.style("font-size",`${G}px`);let se=Math.max(ie,Math.min(X,Math.round(G*W))),J=G+K+se;for(;J>P&&G>V&&(G--,se=Math.max(ie,Math.min(X,Math.round(G*W))),!(seB||G(R.x1-R.x0)/2).attr("y",function(R){return(R.y1-R.y0)/2}).attr("style",R=>{const N="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+b(R.data.name)+";",D=Xt({cssCompiledStyles:R.data.cssCompiledStyles});return N+D.labelStyles.replace("color:","fill:")}).attr("clip-path",(R,N)=>`url(#clip-${e}-${N})`).text(R=>R.value?y(R.value):"").each(function(R){const N=pt(this),D=this.parentNode;if(!D){N.style("display","none");return}const I=pt(D).select(".treemapLabel");if(I.empty()||I.style("display")==="none"){N.style("display","none");return}const $=parseFloat(I.style("font-size")),B=28,P=.6,G=6,V=2,X=Math.max(G,Math.min(B,Math.round($*P)));N.style("font-size",`${X}px`);const ie=(R.y1-R.y0)/2+$/2+V;N.attr("y",ie);const K=R.x1-R.x0,Z=R.y1-R.y0-4,ee=K-8;N.node().getComputedTextLength()>ee||ie+X>Z||X{const e=wp(),r=lr(),n=ti(e,r.themeVariables),i=ti(Cmt,t),a=i.titleColor??n.titleColor,s=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return` .treemapNode.section { stroke: ${i.sectionStrokeColor}; stroke-width: ${i.sectionStrokeWidth}; @@ -3302,26 +3302,26 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ne="Parse error fill: ${a}; font-size: ${i.titleFontSize}; } - `},"getStyles"),dmt=hmt,fmt={parser:Dve,get db(){return new Lve},renderer:cmt,styles:dmt};const pmt=Object.freeze(Object.defineProperty({__proto__:null,diagram:fmt},Symbol.toStringTag,{value:"Module"}));var t6=x((t,e)=>{const r=t<=1?t*100:t;if(r<0||r>100)throw new Error(`${e} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${t}`);return r},"toPercent"),s0=x((t,e,r)=>({x:t6(e,`${r} evolution`),y:t6(t,`${r} visibility`)}),"toCoordinates"),Mve=x(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),gmt=x(t=>{if(!(t!=null&&t.startsWith("+")))return{};const e=/^\+'([^']*)'/.exec(t),r=e==null?void 0:e[1];return t.includes("<>")?{flow:"bidirectional",label:r}:t.includes("<")?{flow:"backward",label:r}:t.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),mmt=x((t,e)=>{if(zl(t,e),t.size&&e.setSize(t.size.width,t.size.height),t.evolution){const r=t.evolution.stages.map(i=>i.secondName?`${i.name.trim()} / ${i.secondName.trim()}`:i.name.trim()),n=t.evolution.stages.filter(i=>i.boundary!==void 0).map(i=>i.boundary);e.updateAxes({stages:r,stageBoundaries:n})}if(t.anchors.forEach(r=>{const n=s0(r.visibility,r.evolution,`Anchor "${r.name}"`);e.addNode(r.name,r.name,n.x,n.y,"anchor")}),t.components.forEach(r=>{var o;const n=s0(r.visibility,r.evolution,`Component "${r.name}"`),i=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,a=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,s=(o=r.decorator)==null?void 0:o.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,a,r.inertia,s)}),t.notes.forEach(r=>{const n=s0(r.visibility,r.evolution,`Note "${r.text}"`);e.addNote(r.text,n.x,n.y)}),t.pipelines.forEach(r=>{const n=e.getNode(r.parent);if(!n||typeof n.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const i=n.y;e.startPipeline(r.parent),r.components.forEach(a=>{const s=`${r.parent}_${a.name}`,o=a.label?(a.label.negX?-1:1)*a.label.offsetX:void 0,l=a.label?(a.label.negY?-1:1)*a.label.offsetY:void 0,u=t6(a.evolution,`Pipeline component "${a.name}" evolution`);e.addNode(s,a.name,u,i,"pipeline-component",o,l),e.addPipelineComponent(r.parent,s)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=Mve(r.fromPort)??Mve(r.toPort);const{flow:a,label:s}=gmt(r.arrow);!i&&a&&(i=a);const o=r.linkLabel,l=s??o;e.addLink(e.resolveNodeId(r.from),e.resolveNodeId(r.to),n,l,i)}),t.evolves.forEach(r=>{const n=e.getNode(r.component);if((n==null?void 0:n.y)!==void 0){const i=t6(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=s0(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=s0(r.x,r.y,`Annotation ${r.number}`);e.addAnnotation(r.number,[{x:n.x,y:n.y}],r.text)}),t.accelerators.forEach(r=>{const n=s0(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=s0(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),Nve={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Qo("wardley",t);ae.debug(e);const r=(n=Nve.parser)==null?void 0:n.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");mmt(e,r)},"parse")},ymt=(Kv=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(e){const r=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...r,...e,className:e.className??r.className,labelOffsetX:e.labelOffsetX??r.labelOffsetX,labelOffsetY:e.labelOffsetY??r.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const r=this.nodes.get(e);r&&(r.isPipelineParent=!0)}addPipelineComponent(e,r){const n=this.pipelines.get(e);n&&n.componentIds.push(r);const i=this.nodes.get(r);i&&(i.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,r){this.annotationsBox={x:e,y:r}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,r){this.size={width:e,height:r}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[r,n]of this.nodes)if(n.label===e)return r;return e}build(){const e=[];for(const r of this.nodes.values()){if(typeof r.x!="number"||typeof r.y!="number")throw new Error(`Node "${r.label}" is missing coordinates`);e.push(r)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},x(Kv,"WardleyBuilder"),Kv),$a=new ymt;function Ove(){return Pe()["wardley-beta"]}x(Ove,"getConfig");function $ve(t,e,r,n,i,a,s,o,l){$a.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:s,inertia:o,sourceStrategy:l})}x($ve,"addNode");function Pve(t,e,r=!1,n,i){$a.addLink({source:t,target:e,dashed:r,label:n,flow:i})}x(Pve,"addLink");function Bve(t,e,r){$a.addTrend({nodeId:t,targetX:e,targetY:r})}x(Bve,"addTrend");function Fve(t,e,r){$a.addAnnotation({number:t,coordinates:e,text:r})}x(Fve,"addAnnotation");function zve(t,e,r){$a.addNote({text:t,x:e,y:r})}x(zve,"addNote");function Gve(t,e,r){$a.addAccelerator({name:t,x:e,y:r})}x(Gve,"addAccelerator");function qve(t,e,r){$a.addDeaccelerator({name:t,x:e,y:r})}x(qve,"addDeaccelerator");function Vve(t,e){$a.setAnnotationsBox(t,e)}x(Vve,"setAnnotationsBox");function Wve(t,e){$a.setSize(t,e)}x(Wve,"setSize");function Uve(t){$a.startPipeline(t)}x(Uve,"startPipeline");function Hve(t,e){$a.addPipelineComponent(t,e)}x(Hve,"addPipelineComponent");function Yve(t){$a.setAxes(t)}x(Yve,"updateAxes");function Xve(t){return $a.getNode(t)}x(Xve,"getNode");function Kve(t){return $a.resolveNodeId(t)}x(Kve,"resolveNodeId");function jve(){return $a.build()}x(jve,"getWardleyData");function Zve(){$a.clear(),In()}x(Zve,"clear");var vmt={getConfig:Ove,addNode:$ve,addLink:Pve,addTrend:Bve,addAnnotation:Fve,addNote:zve,addAccelerator:Gve,addDeaccelerator:qve,setAnnotationsBox:Vve,setSize:Wve,startPipeline:Uve,addPipelineComponent:Hve,updateAxes:Yve,getNode:Xve,resolveNodeId:Kve,getWardleyData:jve,clear:Zve,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,getAccDescription:Gn,setAccDescription:zn},bmt=["Genesis","Custom Built","Product","Commodity"],xmt=x(()=>{var e,r,n,i,a,s,o,l,u,h,d,f;const{themeVariables:t}=Pe();return{backgroundColor:((e=t.wardley)==null?void 0:e.backgroundColor)??t.background??"#fff",axisColor:((r=t.wardley)==null?void 0:r.axisColor)??"#000",axisTextColor:((n=t.wardley)==null?void 0:n.axisTextColor)??t.primaryTextColor??"#222",gridColor:((i=t.wardley)==null?void 0:i.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((a=t.wardley)==null?void 0:a.componentFill)??"#fff",componentStroke:((s=t.wardley)==null?void 0:s.componentStroke)??"#000",componentLabelColor:((o=t.wardley)==null?void 0:o.componentLabelColor)??t.primaryTextColor??"#222",linkStroke:((l=t.wardley)==null?void 0:l.linkStroke)??"#000",evolutionStroke:((u=t.wardley)==null?void 0:u.evolutionStroke)??"#dc3545",annotationStroke:((h=t.wardley)==null?void 0:h.annotationStroke)??"#000",annotationTextColor:((d=t.wardley)==null?void 0:d.annotationTextColor)??t.primaryTextColor??"#222",annotationFill:((f=t.wardley)==null?void 0:f.annotationFill)??t.background??"#fff"}},"getTheme"),Tmt=x(()=>{const t=Pe()["wardley-beta"];return{width:(t==null?void 0:t.width)??900,height:(t==null?void 0:t.height)??600,padding:(t==null?void 0:t.padding)??48,nodeRadius:(t==null?void 0:t.nodeRadius)??6,nodeLabelOffset:(t==null?void 0:t.nodeLabelOffset)??8,axisFontSize:(t==null?void 0:t.axisFontSize)??12,labelFontSize:(t==null?void 0:t.labelFontSize)??10,showGrid:(t==null?void 0:t.showGrid)??!1,useMaxWidth:(t==null?void 0:t.useMaxWidth)??!0}},"getConfigValues"),wmt=x((t,e,r,n)=>{var I,$;ae.debug(`Rendering Wardley map -`+t);const i=Tmt(),a=xmt(),s=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=((I=l.size)==null?void 0:I.width)??i.width,d=(($=l.size)==null?void 0:$.height)??i.height,f=ys(e);f.selectAll("*").remove(),wi(f,d,h,i.useMaxWidth),f.attr("viewBox",`0 0 ${h} ${d}`);const p=f.append("g").attr("class","wardley-map"),g=f.append("defs");g.append("marker").attr("id",`arrow-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.evolutionStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-end-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.linkStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-start-${e}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",a.linkStroke).attr("stroke","none"),p.append("rect").attr("class","wardley-background").attr("width",h).attr("height",d).attr("fill",a.backgroundColor);const m=h-i.padding*2,y=d-i.padding*2;u&&p.append("text").attr("class","wardley-title").attr("x",h/2).attr("y",i.padding/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const v=x(B=>i.padding+B/100*m,"projectX"),T=x(B=>d-i.padding-B/100*y,"projectY"),b=p.append("g").attr("class","wardley-axes");b.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1),b.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1);const w=l.axes.xLabel??"Evolution",k=l.axes.yLabel??"Visibility";b.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+m/2).attr("y",d-i.padding/4).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(w),b.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+y/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+y/2})`).text(k);const A=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:bmt;if(A.length>0){const B=p.append("g").attr("class","wardley-stages"),P=l.axes.stageBoundaries,G=[];if(P&&P.length===A.length){let V=0;P.forEach(Y=>{G.push({start:V,end:Y}),V=Y})}else{const V=1/A.length;A.forEach((Y,W)=>{G.push({start:W*V,end:(W+1)*V})})}A.forEach((V,Y)=>{const W=G[Y],ie=i.padding+W.start*m,K=i.padding+W.end*m,se=(ie+K)/2;Y>0&&B.append("line").attr("x1",ie).attr("x2",ie).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),B.append("text").attr("class","wardley-stage-label").attr("x",se).attr("y",d-i.padding/1.5).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(V)})}if(i.showGrid){const B=p.append("g").attr("class","wardley-grid");for(let P=1;P<4;P++){const G=P/4,V=i.padding+m*G;B.append("line").attr("x1",V).attr("x2",V).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6"),B.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding-y*G).attr("y2",d-i.padding-y*G).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6")}}const C=new Map;if(l.nodes.forEach(B=>{C.set(B.id,{x:v(B.x),y:T(B.y),node:B})}),l.pipelines.length>0){const B=p.append("g").attr("class","wardley-pipelines"),P=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(G=>{if(G.componentIds.length===0)return;const V=G.componentIds.map(K=>({id:K,pos:C.get(K),node:l.nodes.find(se=>se.id===K)})).filter(K=>K.pos&&K.node).sort((K,se)=>K.node.x-se.node.x);for(let K=0;K{const se=C.get(K);se&&(Y=Math.min(Y,se.x),W=Math.max(W,se.x),ie=se.y)}),Y!==1/0&&W!==-1/0){const se=i.nodeRadius*4,J=ie-se/2,Z=C.get(G.nodeId);if(Z){const ee=(Y+W)/2;Z.x=ee,Z.y=J-s/6}B.append("rect").attr("class","wardley-pipeline-box").attr("x",Y-15).attr("y",J).attr("width",W-Y+30).attr("height",se).attr("fill","none").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=p.append("g").attr("class","wardley-links"),L=new Map;l.pipelines.forEach(B=>{L.set(B.nodeId,new Set(B.componentIds))});const O=l.links.filter(B=>{if(!C.has(B.source)||!C.has(B.target))return!1;const P=L.get(B.target);return!(P!=null&&P.has(B.source))});_.selectAll("line").data(O).enter().append("line").attr("class",B=>`wardley-link${B.dashed?" wardley-link--dashed":""}`).attr("x1",B=>{const P=C.get(B.source),G=C.get(B.target),Y=l.nodes.find(se=>se.id===B.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=G.x-P.x,ie=G.y-P.y,K=Math.sqrt(W*W+ie*ie);return P.x+W/K*Y}).attr("y1",B=>{const P=C.get(B.source),G=C.get(B.target),Y=l.nodes.find(se=>se.id===B.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=G.x-P.x,ie=G.y-P.y,K=Math.sqrt(W*W+ie*ie);return P.y+ie/K*Y}).attr("x2",B=>{const P=C.get(B.source),G=C.get(B.target),Y=l.nodes.find(se=>se.id===B.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=P.x-G.x,ie=P.y-G.y,K=Math.sqrt(W*W+ie*ie);return G.x+W/K*Y}).attr("y2",B=>{const P=C.get(B.source),G=C.get(B.target),Y=l.nodes.find(se=>se.id===B.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=P.x-G.x,ie=P.y-G.y,K=Math.sqrt(W*W+ie*ie);return G.y+ie/K*Y}).attr("stroke",a.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",B=>B.dashed?"6 6":null).attr("marker-end",B=>B.flow==="forward"||B.flow==="bidirectional"?`url(#link-arrow-end-${e})`:null).attr("marker-start",B=>B.flow==="backward"||B.flow==="bidirectional"?`url(#link-arrow-start-${e})`:null),_.selectAll("text").data(O.filter(B=>B.label)).enter().append("text").attr("class","wardley-link-label").attr("x",B=>{const P=C.get(B.source),G=C.get(B.target),V=(P.x+G.x)/2,Y=G.y-P.y,W=G.x-P.x,ie=Math.sqrt(W*W+Y*Y),K=8,se=Y/ie;return V+se*K}).attr("y",B=>{const P=C.get(B.source),G=C.get(B.target),V=(P.y+G.y)/2,Y=G.x-P.x,W=G.y-P.y,ie=Math.sqrt(Y*Y+W*W),K=8,se=-Y/ie;return V+se*K}).attr("fill",a.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",B=>{const P=C.get(B.source),G=C.get(B.target),V=(P.x+G.x)/2,Y=(P.y+G.y)/2,W=G.x-P.x,ie=G.y-P.y,K=Math.sqrt(W*W+ie*ie),se=8,J=ie/K,Z=-W/K,ee=V+J*se,ne=Y+Z*se;let ue=Math.atan2(ie,W)*180/Math.PI;return(ue>90||ue<-90)&&(ue+=180),`rotate(${ue} ${ee} ${ne})`}).text(B=>B.label);const M=p.append("g").attr("class","wardley-trends"),z=l.trends.map(B=>{const P=C.get(B.nodeId);if(!P)return null;const G=v(B.targetX),V=T(B.targetY),Y=G-P.x,W=V-P.y,ie=Math.sqrt(Y*Y+W*W),K=i.nodeRadius+2,se=ie>K?G-Y/ie*K:G,J=ie>K?V-W/ie*K:V;return{origin:P,targetX:G,targetY:V,adjustedX2:se,adjustedY2:J}}).filter(B=>B!==null);M.selectAll("line").data(z).enter().append("line").attr("class","wardley-trend").attr("x1",B=>B.origin.x).attr("y1",B=>B.origin.y).attr("x2",B=>B.adjustedX2).attr("y2",B=>B.adjustedY2).attr("stroke",a.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${e})`);const S=p.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",B=>["wardley-node",B.className?`wardley-node--${B.className}`:""].filter(Boolean).join(" "));S.filter(B=>B.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",a.componentStroke).attr("stroke-width",1),S.filter(B=>B.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",a.componentStroke).attr("stroke-width",1),S.filter(B=>B.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const R=S.filter(B=>B.sourceStrategy==="market");R.append("circle").attr("class","wardley-market-overlay").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),S.filter(B=>!B.isPipelineParent&&B.sourceStrategy!=="market"&&B.className!=="anchor").append("circle").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y).attr("r",i.nodeRadius).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1);const N=i.nodeRadius*.7,D=i.nodeRadius*1.2;if(R.append("line").attr("class","wardley-market-line").attr("x1",B=>C.get(B.id).x).attr("y1",B=>C.get(B.id).y-D).attr("x2",B=>C.get(B.id).x-D*Math.cos(Math.PI/6)).attr("y2",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("line").attr("class","wardley-market-line").attr("x1",B=>C.get(B.id).x-D*Math.cos(Math.PI/6)).attr("y1",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("x2",B=>C.get(B.id).x+D*Math.cos(Math.PI/6)).attr("y2",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("line").attr("class","wardley-market-line").attr("x1",B=>C.get(B.id).x+D*Math.cos(Math.PI/6)).attr("y1",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("x2",B=>C.get(B.id).x).attr("y2",B=>C.get(B.id).y-D).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("circle").attr("class","wardley-market-dot").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y-D).attr("r",N).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.append("circle").attr("class","wardley-market-dot").attr("cx",B=>C.get(B.id).x-D*Math.cos(Math.PI/6)).attr("cy",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("r",N).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.append("circle").attr("class","wardley-market-dot").attr("cx",B=>C.get(B.id).x+D*Math.cos(Math.PI/6)).attr("cy",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("r",N).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),S.filter(B=>B.isPipelineParent===!0).append("rect").attr("x",B=>C.get(B.id).x-s/2).attr("y",B=>C.get(B.id).y-s/2).attr("width",s).attr("height",s).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1),S.filter(B=>B.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",B=>{const P=C.get(B.id);let G=B.isPipelineParent?s/2+15:i.nodeRadius+15;return B.sourceStrategy&&(G+=i.nodeRadius+10),P.x+G}).attr("y1",B=>{const P=C.get(B.id),G=B.isPipelineParent?s:i.nodeRadius*2;return P.y-G/2}).attr("x2",B=>{const P=C.get(B.id);let G=B.isPipelineParent?s/2+15:i.nodeRadius+15;return B.sourceStrategy&&(G+=i.nodeRadius+10),P.x+G}).attr("y2",B=>{const P=C.get(B.id),G=B.isPipelineParent?s:i.nodeRadius*2;return P.y+G/2}).attr("stroke",a.componentStroke).attr("stroke-width",6),S.append("text").attr("x",B=>{const P=C.get(B.id);if(B.className==="anchor")return B.labelOffsetX!==void 0?P.x+B.labelOffsetX:P.x;let G=i.nodeLabelOffset;B.sourceStrategy&&B.labelOffsetX===void 0&&(G+=10);const V=B.labelOffsetX??G;return P.x+V}).attr("y",B=>{const P=C.get(B.id);if(B.className==="anchor")return B.labelOffsetY!==void 0?P.y+B.labelOffsetY:P.y-3;let G=-i.nodeLabelOffset;B.sourceStrategy&&B.labelOffsetY===void 0&&(G-=10);const V=B.labelOffsetY??G;return P.y+V}).attr("class","wardley-node-label").attr("fill",B=>B.className==="evolved"?a.evolutionStroke:B.className==="anchor"?"#000":a.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",B=>B.className==="anchor"?"bold":"normal").attr("text-anchor",B=>B.className==="anchor"?"middle":"start").attr("dominant-baseline",B=>B.className==="anchor"?"middle":"auto").text(B=>B.label),l.annotations.length>0){const B=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(P=>{const G=P.coordinates.map(V=>({x:v(V.x),y:T(V.y)}));if(G.length>1)for(let V=0;V{const Y=B.append("g").attr("class","wardley-annotation");Y.append("circle").attr("cx",V.x).attr("cy",V.y).attr("r",10).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5),Y.append("text").attr("x",V.x).attr("y",V.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(P.number)})}),l.annotationsBox){let P=v(l.annotationsBox.x),G=T(l.annotationsBox.y);const V=10,Y=16,W=11,ie=B.append("g").attr("class","wardley-annotations-box"),K=[...l.annotations].filter(J=>J.text).sort((J,Z)=>J.number-Z.number),se=[];if(K.forEach((J,Z)=>{const ee=ie.append("text").attr("x",P+V).attr("y",G+V+(Z+1)*Y).attr("font-size",W).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${J.number}. ${J.text}`);se.push(ee)}),se.length>0){let J=0,Z=0;se.forEach(Ne=>{const me=Ne.node(),ve=me.getComputedTextLength();J=Math.max(J,ve);const Ge=me.getBBox();Z=Math.max(Z,Ge.height)});const ee=J+V*2+105,ne=K.length*Y+V*2+Z/2,ue=i.padding,fe=h-i.padding-ee,_e=i.padding,Ae=d-i.padding-ne;P=Math.max(ue,Math.min(P,fe)),G=Math.max(_e,Math.min(G,Ae)),se.forEach((Ne,me)=>{Ne.attr("x",P+V).attr("y",G+V+(me+1)*Y)}),ie.insert("rect","text").attr("x",P).attr("y",G).attr("width",ee).attr("height",ne).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const B=p.append("g").attr("class","wardley-notes");l.notes.forEach(P=>{const G=v(P.x),V=T(P.y);B.append("text").attr("x",G).attr("y",V).attr("text-anchor","start").attr("font-size",11).attr("fill",a.axisTextColor).attr("font-weight","bold").text(P.text)})}if(l.accelerators.length>0){const B=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(P=>{const G=v(P.x),V=T(P.y),Y=60,W=30,ie=20,K=` + `},"getStyles"),Emt=kmt,Smt={parser:Bve,get db(){return new $ve},renderer:wmt,styles:Emt};const Amt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Smt},Symbol.toStringTag,{value:"Module"}));var i6=T((t,e)=>{const r=t<=1?t*100:t;if(r<0||r>100)throw new Error(`${e} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${t}`);return r},"toPercent"),sp=T((t,e,r)=>({x:i6(e,`${r} evolution`),y:i6(t,`${r} visibility`)}),"toCoordinates"),Fve=T(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),_mt=T(t=>{if(!(t!=null&&t.startsWith("+")))return{};const e=/^\+'([^']*)'/.exec(t),r=e==null?void 0:e[1];return t.includes("<>")?{flow:"bidirectional",label:r}:t.includes("<")?{flow:"backward",label:r}:t.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),Rmt=T((t,e)=>{if(zl(t,e),t.size&&e.setSize(t.size.width,t.size.height),t.evolution){const r=t.evolution.stages.map(i=>i.secondName?`${i.name.trim()} / ${i.secondName.trim()}`:i.name.trim()),n=t.evolution.stages.filter(i=>i.boundary!==void 0).map(i=>i.boundary);e.updateAxes({stages:r,stageBoundaries:n})}if(t.anchors.forEach(r=>{const n=sp(r.visibility,r.evolution,`Anchor "${r.name}"`);e.addNode(r.name,r.name,n.x,n.y,"anchor")}),t.components.forEach(r=>{var o;const n=sp(r.visibility,r.evolution,`Component "${r.name}"`),i=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,a=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,s=(o=r.decorator)==null?void 0:o.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,a,r.inertia,s)}),t.notes.forEach(r=>{const n=sp(r.visibility,r.evolution,`Note "${r.text}"`);e.addNote(r.text,n.x,n.y)}),t.pipelines.forEach(r=>{const n=e.getNode(r.parent);if(!n||typeof n.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const i=n.y;e.startPipeline(r.parent),r.components.forEach(a=>{const s=`${r.parent}_${a.name}`,o=a.label?(a.label.negX?-1:1)*a.label.offsetX:void 0,l=a.label?(a.label.negY?-1:1)*a.label.offsetY:void 0,u=i6(a.evolution,`Pipeline component "${a.name}" evolution`);e.addNode(s,a.name,u,i,"pipeline-component",o,l),e.addPipelineComponent(r.parent,s)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=Fve(r.fromPort)??Fve(r.toPort);const{flow:a,label:s}=_mt(r.arrow);!i&&a&&(i=a);const o=r.linkLabel,l=s??o;e.addLink(e.resolveNodeId(r.from),e.resolveNodeId(r.to),n,l,i)}),t.evolves.forEach(r=>{const n=e.getNode(r.component);if((n==null?void 0:n.y)!==void 0){const i=i6(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=sp(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=sp(r.x,r.y,`Annotation ${r.number}`);e.addAnnotation(r.number,[{x:n.x,y:n.y}],r.text)}),t.accelerators.forEach(r=>{const n=sp(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=sp(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),zve={parser:{yy:void 0},parse:T(async t=>{var n;const e=await Qo("wardley",t);ae.debug(e);const r=(n=zve.parser)==null?void 0:n.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Rmt(e,r)},"parse")},Lmt=(jv=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(e){const r=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...r,...e,className:e.className??r.className,labelOffsetX:e.labelOffsetX??r.labelOffsetX,labelOffsetY:e.labelOffsetY??r.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const r=this.nodes.get(e);r&&(r.isPipelineParent=!0)}addPipelineComponent(e,r){const n=this.pipelines.get(e);n&&n.componentIds.push(r);const i=this.nodes.get(r);i&&(i.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,r){this.annotationsBox={x:e,y:r}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,r){this.size={width:e,height:r}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[r,n]of this.nodes)if(n.label===e)return r;return e}build(){const e=[];for(const r of this.nodes.values()){if(typeof r.x!="number"||typeof r.y!="number")throw new Error(`Node "${r.label}" is missing coordinates`);e.push(r)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},T(jv,"WardleyBuilder"),jv),$a=new Lmt;function Gve(){return Pe()["wardley-beta"]}T(Gve,"getConfig");function qve(t,e,r,n,i,a,s,o,l){$a.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:s,inertia:o,sourceStrategy:l})}T(qve,"addNode");function Vve(t,e,r=!1,n,i){$a.addLink({source:t,target:e,dashed:r,label:n,flow:i})}T(Vve,"addLink");function Wve(t,e,r){$a.addTrend({nodeId:t,targetX:e,targetY:r})}T(Wve,"addTrend");function Uve(t,e,r){$a.addAnnotation({number:t,coordinates:e,text:r})}T(Uve,"addAnnotation");function Hve(t,e,r){$a.addNote({text:t,x:e,y:r})}T(Hve,"addNote");function Yve(t,e,r){$a.addAccelerator({name:t,x:e,y:r})}T(Yve,"addAccelerator");function Xve(t,e,r){$a.addDeaccelerator({name:t,x:e,y:r})}T(Xve,"addDeaccelerator");function Kve(t,e){$a.setAnnotationsBox(t,e)}T(Kve,"setAnnotationsBox");function jve(t,e){$a.setSize(t,e)}T(jve,"setSize");function Zve(t){$a.startPipeline(t)}T(Zve,"startPipeline");function Qve(t,e){$a.addPipelineComponent(t,e)}T(Qve,"addPipelineComponent");function Jve(t){$a.setAxes(t)}T(Jve,"updateAxes");function e2e(t){return $a.getNode(t)}T(e2e,"getNode");function t2e(t){return $a.resolveNodeId(t)}T(t2e,"resolveNodeId");function r2e(){return $a.build()}T(r2e,"getWardleyData");function n2e(){$a.clear(),In()}T(n2e,"clear");var Imt={getConfig:Gve,addNode:qve,addLink:Vve,addTrend:Wve,addAnnotation:Uve,addNote:Hve,addAccelerator:Yve,addDeaccelerator:Xve,setAnnotationsBox:Kve,setSize:jve,startPipeline:Zve,addPipelineComponent:Qve,updateAxes:Jve,getNode:e2e,resolveNodeId:t2e,getWardleyData:r2e,clear:n2e,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,getAccDescription:Gn,setAccDescription:zn},Dmt=["Genesis","Custom Built","Product","Commodity"],Mmt=T(()=>{var e,r,n,i,a,s,o,l,u,h,d,f;const{themeVariables:t}=Pe();return{backgroundColor:((e=t.wardley)==null?void 0:e.backgroundColor)??t.background??"#fff",axisColor:((r=t.wardley)==null?void 0:r.axisColor)??"#000",axisTextColor:((n=t.wardley)==null?void 0:n.axisTextColor)??t.primaryTextColor??"#222",gridColor:((i=t.wardley)==null?void 0:i.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((a=t.wardley)==null?void 0:a.componentFill)??"#fff",componentStroke:((s=t.wardley)==null?void 0:s.componentStroke)??"#000",componentLabelColor:((o=t.wardley)==null?void 0:o.componentLabelColor)??t.primaryTextColor??"#222",linkStroke:((l=t.wardley)==null?void 0:l.linkStroke)??"#000",evolutionStroke:((u=t.wardley)==null?void 0:u.evolutionStroke)??"#dc3545",annotationStroke:((h=t.wardley)==null?void 0:h.annotationStroke)??"#000",annotationTextColor:((d=t.wardley)==null?void 0:d.annotationTextColor)??t.primaryTextColor??"#222",annotationFill:((f=t.wardley)==null?void 0:f.annotationFill)??t.background??"#fff"}},"getTheme"),Nmt=T(()=>{const t=Pe()["wardley-beta"];return{width:(t==null?void 0:t.width)??900,height:(t==null?void 0:t.height)??600,padding:(t==null?void 0:t.padding)??48,nodeRadius:(t==null?void 0:t.nodeRadius)??6,nodeLabelOffset:(t==null?void 0:t.nodeLabelOffset)??8,axisFontSize:(t==null?void 0:t.axisFontSize)??12,labelFontSize:(t==null?void 0:t.labelFontSize)??10,showGrid:(t==null?void 0:t.showGrid)??!1,useMaxWidth:(t==null?void 0:t.useMaxWidth)??!0}},"getConfigValues"),Omt=T((t,e,r,n)=>{var I,$;ae.debug(`Rendering Wardley map +`+t);const i=Nmt(),a=Mmt(),s=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=((I=l.size)==null?void 0:I.width)??i.width,d=(($=l.size)==null?void 0:$.height)??i.height,f=ys(e);f.selectAll("*").remove(),wi(f,d,h,i.useMaxWidth),f.attr("viewBox",`0 0 ${h} ${d}`);const p=f.append("g").attr("class","wardley-map"),g=f.append("defs");g.append("marker").attr("id",`arrow-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.evolutionStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-end-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.linkStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-start-${e}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",a.linkStroke).attr("stroke","none"),p.append("rect").attr("class","wardley-background").attr("width",h).attr("height",d).attr("fill",a.backgroundColor);const m=h-i.padding*2,y=d-i.padding*2;u&&p.append("text").attr("class","wardley-title").attr("x",h/2).attr("y",i.padding/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const v=T(B=>i.padding+B/100*m,"projectX"),x=T(B=>d-i.padding-B/100*y,"projectY"),b=p.append("g").attr("class","wardley-axes");b.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1),b.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1);const w=l.axes.xLabel??"Evolution",k=l.axes.yLabel??"Visibility";b.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+m/2).attr("y",d-i.padding/4).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(w),b.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+y/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+y/2})`).text(k);const S=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:Dmt;if(S.length>0){const B=p.append("g").attr("class","wardley-stages"),P=l.axes.stageBoundaries,G=[];if(P&&P.length===S.length){let V=0;P.forEach(X=>{G.push({start:V,end:X}),V=X})}else{const V=1/S.length;S.forEach((X,W)=>{G.push({start:W*V,end:(W+1)*V})})}S.forEach((V,X)=>{const W=G[X],ie=i.padding+W.start*m,K=i.padding+W.end*m,se=(ie+K)/2;X>0&&B.append("line").attr("x1",ie).attr("x2",ie).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),B.append("text").attr("class","wardley-stage-label").attr("x",se).attr("y",d-i.padding/1.5).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(V)})}if(i.showGrid){const B=p.append("g").attr("class","wardley-grid");for(let P=1;P<4;P++){const G=P/4,V=i.padding+m*G;B.append("line").attr("x1",V).attr("x2",V).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6"),B.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding-y*G).attr("y2",d-i.padding-y*G).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6")}}const C=new Map;if(l.nodes.forEach(B=>{C.set(B.id,{x:v(B.x),y:x(B.y),node:B})}),l.pipelines.length>0){const B=p.append("g").attr("class","wardley-pipelines"),P=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(G=>{if(G.componentIds.length===0)return;const V=G.componentIds.map(K=>({id:K,pos:C.get(K),node:l.nodes.find(se=>se.id===K)})).filter(K=>K.pos&&K.node).sort((K,se)=>K.node.x-se.node.x);for(let K=0;K{const se=C.get(K);se&&(X=Math.min(X,se.x),W=Math.max(W,se.x),ie=se.y)}),X!==1/0&&W!==-1/0){const se=i.nodeRadius*4,J=ie-se/2,Z=C.get(G.nodeId);if(Z){const ee=(X+W)/2;Z.x=ee,Z.y=J-s/6}B.append("rect").attr("class","wardley-pipeline-box").attr("x",X-15).attr("y",J).attr("width",W-X+30).attr("height",se).attr("fill","none").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=p.append("g").attr("class","wardley-links"),L=new Map;l.pipelines.forEach(B=>{L.set(B.nodeId,new Set(B.componentIds))});const O=l.links.filter(B=>{if(!C.has(B.source)||!C.has(B.target))return!1;const P=L.get(B.target);return!(P!=null&&P.has(B.source))});_.selectAll("line").data(O).enter().append("line").attr("class",B=>`wardley-link${B.dashed?" wardley-link--dashed":""}`).attr("x1",B=>{const P=C.get(B.source),G=C.get(B.target),X=l.nodes.find(se=>se.id===B.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=G.x-P.x,ie=G.y-P.y,K=Math.sqrt(W*W+ie*ie);return P.x+W/K*X}).attr("y1",B=>{const P=C.get(B.source),G=C.get(B.target),X=l.nodes.find(se=>se.id===B.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=G.x-P.x,ie=G.y-P.y,K=Math.sqrt(W*W+ie*ie);return P.y+ie/K*X}).attr("x2",B=>{const P=C.get(B.source),G=C.get(B.target),X=l.nodes.find(se=>se.id===B.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=P.x-G.x,ie=P.y-G.y,K=Math.sqrt(W*W+ie*ie);return G.x+W/K*X}).attr("y2",B=>{const P=C.get(B.source),G=C.get(B.target),X=l.nodes.find(se=>se.id===B.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=P.x-G.x,ie=P.y-G.y,K=Math.sqrt(W*W+ie*ie);return G.y+ie/K*X}).attr("stroke",a.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",B=>B.dashed?"6 6":null).attr("marker-end",B=>B.flow==="forward"||B.flow==="bidirectional"?`url(#link-arrow-end-${e})`:null).attr("marker-start",B=>B.flow==="backward"||B.flow==="bidirectional"?`url(#link-arrow-start-${e})`:null),_.selectAll("text").data(O.filter(B=>B.label)).enter().append("text").attr("class","wardley-link-label").attr("x",B=>{const P=C.get(B.source),G=C.get(B.target),V=(P.x+G.x)/2,X=G.y-P.y,W=G.x-P.x,ie=Math.sqrt(W*W+X*X),K=8,se=X/ie;return V+se*K}).attr("y",B=>{const P=C.get(B.source),G=C.get(B.target),V=(P.y+G.y)/2,X=G.x-P.x,W=G.y-P.y,ie=Math.sqrt(X*X+W*W),K=8,se=-X/ie;return V+se*K}).attr("fill",a.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",B=>{const P=C.get(B.source),G=C.get(B.target),V=(P.x+G.x)/2,X=(P.y+G.y)/2,W=G.x-P.x,ie=G.y-P.y,K=Math.sqrt(W*W+ie*ie),se=8,J=ie/K,Z=-W/K,ee=V+J*se,ne=X+Z*se;let ue=Math.atan2(ie,W)*180/Math.PI;return(ue>90||ue<-90)&&(ue+=180),`rotate(${ue} ${ee} ${ne})`}).text(B=>B.label);const M=p.append("g").attr("class","wardley-trends"),z=l.trends.map(B=>{const P=C.get(B.nodeId);if(!P)return null;const G=v(B.targetX),V=x(B.targetY),X=G-P.x,W=V-P.y,ie=Math.sqrt(X*X+W*W),K=i.nodeRadius+2,se=ie>K?G-X/ie*K:G,J=ie>K?V-W/ie*K:V;return{origin:P,targetX:G,targetY:V,adjustedX2:se,adjustedY2:J}}).filter(B=>B!==null);M.selectAll("line").data(z).enter().append("line").attr("class","wardley-trend").attr("x1",B=>B.origin.x).attr("y1",B=>B.origin.y).attr("x2",B=>B.adjustedX2).attr("y2",B=>B.adjustedY2).attr("stroke",a.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${e})`);const A=p.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",B=>["wardley-node",B.className?`wardley-node--${B.className}`:""].filter(Boolean).join(" "));A.filter(B=>B.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",a.componentStroke).attr("stroke-width",1),A.filter(B=>B.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",a.componentStroke).attr("stroke-width",1),A.filter(B=>B.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const R=A.filter(B=>B.sourceStrategy==="market");R.append("circle").attr("class","wardley-market-overlay").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),A.filter(B=>!B.isPipelineParent&&B.sourceStrategy!=="market"&&B.className!=="anchor").append("circle").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y).attr("r",i.nodeRadius).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1);const N=i.nodeRadius*.7,D=i.nodeRadius*1.2;if(R.append("line").attr("class","wardley-market-line").attr("x1",B=>C.get(B.id).x).attr("y1",B=>C.get(B.id).y-D).attr("x2",B=>C.get(B.id).x-D*Math.cos(Math.PI/6)).attr("y2",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("line").attr("class","wardley-market-line").attr("x1",B=>C.get(B.id).x-D*Math.cos(Math.PI/6)).attr("y1",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("x2",B=>C.get(B.id).x+D*Math.cos(Math.PI/6)).attr("y2",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("line").attr("class","wardley-market-line").attr("x1",B=>C.get(B.id).x+D*Math.cos(Math.PI/6)).attr("y1",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("x2",B=>C.get(B.id).x).attr("y2",B=>C.get(B.id).y-D).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("circle").attr("class","wardley-market-dot").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y-D).attr("r",N).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.append("circle").attr("class","wardley-market-dot").attr("cx",B=>C.get(B.id).x-D*Math.cos(Math.PI/6)).attr("cy",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("r",N).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.append("circle").attr("class","wardley-market-dot").attr("cx",B=>C.get(B.id).x+D*Math.cos(Math.PI/6)).attr("cy",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("r",N).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),A.filter(B=>B.isPipelineParent===!0).append("rect").attr("x",B=>C.get(B.id).x-s/2).attr("y",B=>C.get(B.id).y-s/2).attr("width",s).attr("height",s).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1),A.filter(B=>B.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",B=>{const P=C.get(B.id);let G=B.isPipelineParent?s/2+15:i.nodeRadius+15;return B.sourceStrategy&&(G+=i.nodeRadius+10),P.x+G}).attr("y1",B=>{const P=C.get(B.id),G=B.isPipelineParent?s:i.nodeRadius*2;return P.y-G/2}).attr("x2",B=>{const P=C.get(B.id);let G=B.isPipelineParent?s/2+15:i.nodeRadius+15;return B.sourceStrategy&&(G+=i.nodeRadius+10),P.x+G}).attr("y2",B=>{const P=C.get(B.id),G=B.isPipelineParent?s:i.nodeRadius*2;return P.y+G/2}).attr("stroke",a.componentStroke).attr("stroke-width",6),A.append("text").attr("x",B=>{const P=C.get(B.id);if(B.className==="anchor")return B.labelOffsetX!==void 0?P.x+B.labelOffsetX:P.x;let G=i.nodeLabelOffset;B.sourceStrategy&&B.labelOffsetX===void 0&&(G+=10);const V=B.labelOffsetX??G;return P.x+V}).attr("y",B=>{const P=C.get(B.id);if(B.className==="anchor")return B.labelOffsetY!==void 0?P.y+B.labelOffsetY:P.y-3;let G=-i.nodeLabelOffset;B.sourceStrategy&&B.labelOffsetY===void 0&&(G-=10);const V=B.labelOffsetY??G;return P.y+V}).attr("class","wardley-node-label").attr("fill",B=>B.className==="evolved"?a.evolutionStroke:B.className==="anchor"?"#000":a.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",B=>B.className==="anchor"?"bold":"normal").attr("text-anchor",B=>B.className==="anchor"?"middle":"start").attr("dominant-baseline",B=>B.className==="anchor"?"middle":"auto").text(B=>B.label),l.annotations.length>0){const B=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(P=>{const G=P.coordinates.map(V=>({x:v(V.x),y:x(V.y)}));if(G.length>1)for(let V=0;V{const X=B.append("g").attr("class","wardley-annotation");X.append("circle").attr("cx",V.x).attr("cy",V.y).attr("r",10).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5),X.append("text").attr("x",V.x).attr("y",V.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(P.number)})}),l.annotationsBox){let P=v(l.annotationsBox.x),G=x(l.annotationsBox.y);const V=10,X=16,W=11,ie=B.append("g").attr("class","wardley-annotations-box"),K=[...l.annotations].filter(J=>J.text).sort((J,Z)=>J.number-Z.number),se=[];if(K.forEach((J,Z)=>{const ee=ie.append("text").attr("x",P+V).attr("y",G+V+(Z+1)*X).attr("font-size",W).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${J.number}. ${J.text}`);se.push(ee)}),se.length>0){let J=0,Z=0;se.forEach(Ne=>{const me=Ne.node(),ve=me.getComputedTextLength();J=Math.max(J,ve);const Ge=me.getBBox();Z=Math.max(Z,Ge.height)});const ee=J+V*2+105,ne=K.length*X+V*2+Z/2,ue=i.padding,fe=h-i.padding-ee,_e=i.padding,Ae=d-i.padding-ne;P=Math.max(ue,Math.min(P,fe)),G=Math.max(_e,Math.min(G,Ae)),se.forEach((Ne,me)=>{Ne.attr("x",P+V).attr("y",G+V+(me+1)*X)}),ie.insert("rect","text").attr("x",P).attr("y",G).attr("width",ee).attr("height",ne).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const B=p.append("g").attr("class","wardley-notes");l.notes.forEach(P=>{const G=v(P.x),V=x(P.y);B.append("text").attr("x",G).attr("y",V).attr("text-anchor","start").attr("font-size",11).attr("fill",a.axisTextColor).attr("font-weight","bold").text(P.text)})}if(l.accelerators.length>0){const B=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(P=>{const G=v(P.x),V=x(P.y),X=60,W=30,ie=20,K=` M ${G} ${V-W/2} - L ${G+Y-ie} ${V-W/2} - L ${G+Y-ie} ${V-W/2-8} - L ${G+Y} ${V} - L ${G+Y-ie} ${V+W/2+8} - L ${G+Y-ie} ${V+W/2} + L ${G+X-ie} ${V-W/2} + L ${G+X-ie} ${V-W/2-8} + L ${G+X} ${V} + L ${G+X-ie} ${V+W/2+8} + L ${G+X-ie} ${V+W/2} L ${G} ${V+W/2} Z - `;B.append("path").attr("d",K).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),B.append("text").attr("x",G+Y/2).attr("y",V+W/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(P.name)})}if(l.deaccelerators.length>0){const B=p.append("g").attr("class","wardley-deaccelerators");l.deaccelerators.forEach(P=>{const G=v(P.x),V=T(P.y),Y=60,W=30,ie=20,K=` - M ${G+Y} ${V-W/2} + `;B.append("path").attr("d",K).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),B.append("text").attr("x",G+X/2).attr("y",V+W/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(P.name)})}if(l.deaccelerators.length>0){const B=p.append("g").attr("class","wardley-deaccelerators");l.deaccelerators.forEach(P=>{const G=v(P.x),V=x(P.y),X=60,W=30,ie=20,K=` + M ${G+X} ${V-W/2} L ${G+ie} ${V-W/2} L ${G+ie} ${V-W/2-8} L ${G} ${V} L ${G+ie} ${V+W/2+8} L ${G+ie} ${V+W/2} - L ${G+Y} ${V+W/2} + L ${G+X} ${V+W/2} Z - `;B.append("path").attr("d",K).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),B.append("text").attr("x",G+Y/2).attr("y",V+W/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(P.name)})}},"draw"),Cmt={draw:wmt},kmt=x(({wardley:t}={})=>{const e=w0(),r=lr(),n=ti(e,r.themeVariables),i=ti(n.wardley,t);return` + `;B.append("path").attr("d",K).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),B.append("text").attr("x",G+X/2).attr("y",V+W/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(P.name)})}},"draw"),$mt={draw:Omt},Pmt=T(({wardley:t}={})=>{const e=wp(),r=lr(),n=ti(e,r.themeVariables),i=ti(n.wardley,t);return` .wardley-background { fill: ${i.backgroundColor}; } @@ -3379,4 +3379,4 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ne="Parse error .wardley-notes text { fill: ${i.axisTextColor}; } - `},"styles"),Emt={parser:Nve,db:vmt,renderer:Cmt,styles:kmt};const Smt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Emt},Symbol.toStringTag,{value:"Module"})),Amt=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:Epe,createInfoServices:Spe},Symbol.toStringTag,{value:"Module"})),_mt=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:Ape,createPacketServices:_pe},Symbol.toStringTag,{value:"Module"})),Rmt=Object.freeze(Object.defineProperty({__proto__:null,PieModule:Rpe,createPieServices:Lpe},Symbol.toStringTag,{value:"Module"})),Lmt=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:Ipe,createTreeViewServices:Dpe},Symbol.toStringTag,{value:"Module"})),Imt=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:Mpe,createArchitectureServices:Npe},Symbol.toStringTag,{value:"Module"})),Dmt=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:Cpe,createGitGraphServices:kpe},Symbol.toStringTag,{value:"Module"})),Mmt=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:zpe,createEventModelingServices:Gpe},Symbol.toStringTag,{value:"Module"})),Nmt=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:npe,createRadarServices:ipe},Symbol.toStringTag,{value:"Module"})),Omt=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:spe,createRailroadServices:ope},Symbol.toStringTag,{value:"Module"})),$mt=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:cpe,createRailroadEbnfServices:upe},Symbol.toStringTag,{value:"Module"})),Pmt=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:hpe,createRailroadAbnfServices:dpe},Symbol.toStringTag,{value:"Module"})),Bmt=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:ppe,createRailroadPegServices:gpe},Symbol.toStringTag,{value:"Module"})),Fmt=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:ype,createTreemapServices:vpe},Symbol.toStringTag,{value:"Module"})),zmt=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:bpe,createWardleyServices:xpe},Symbol.toStringTag,{value:"Module"})),Gmt=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:Tpe,createCynefinServices:wpe},Symbol.toStringTag,{value:"Module"}))})(); + `},"styles"),Bmt={parser:zve,db:Imt,renderer:$mt,styles:Pmt};const Fmt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Bmt},Symbol.toStringTag,{value:"Module"})),zmt=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:I0e,createInfoServices:D0e},Symbol.toStringTag,{value:"Module"})),Gmt=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:M0e,createPacketServices:N0e},Symbol.toStringTag,{value:"Module"})),qmt=Object.freeze(Object.defineProperty({__proto__:null,PieModule:O0e,createPieServices:$0e},Symbol.toStringTag,{value:"Module"})),Vmt=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:P0e,createTreeViewServices:B0e},Symbol.toStringTag,{value:"Module"})),Wmt=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:F0e,createArchitectureServices:z0e},Symbol.toStringTag,{value:"Module"})),Umt=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:R0e,createGitGraphServices:L0e},Symbol.toStringTag,{value:"Module"})),Hmt=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:H0e,createEventModelingServices:Y0e},Symbol.toStringTag,{value:"Module"})),Ymt=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:c0e,createRadarServices:u0e},Symbol.toStringTag,{value:"Module"})),Xmt=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:d0e,createRailroadServices:f0e},Symbol.toStringTag,{value:"Module"})),Kmt=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:g0e,createRailroadEbnfServices:m0e},Symbol.toStringTag,{value:"Module"})),jmt=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:y0e,createRailroadAbnfServices:v0e},Symbol.toStringTag,{value:"Module"})),Zmt=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:x0e,createRailroadPegServices:T0e},Symbol.toStringTag,{value:"Module"})),Qmt=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:C0e,createTreemapServices:k0e},Symbol.toStringTag,{value:"Module"})),Jmt=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:E0e,createWardleyServices:S0e},Symbol.toStringTag,{value:"Module"})),e1t=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:A0e,createCynefinServices:_0e},Symbol.toStringTag,{value:"Module"}))})(); diff --git a/packages/web/scripts/browser.e2e.mjs b/packages/web/scripts/browser.e2e.mjs index b2be822..1e5ba5b 100644 --- a/packages/web/scripts/browser.e2e.mjs +++ b/packages/web/scripts/browser.e2e.mjs @@ -188,14 +188,14 @@ test("exported viewer keeps note navigation, explorer context, and settings disc await page.locator('[data-note-path="guides/rollback.md"]').waitFor({ state: "visible" }); assert.equal(await page.locator("[data-note-path]").count(), 2, "beside mode should open a normal note link beside the active panel"); assert.equal(await page.locator("[data-note-navigator]").count(), 0, "multi-panel mode should not add a fixed bottom navigator"); - await page.locator('[data-note-path="index.md"]').click(); + await page.locator('[data-note-path="index.md"] .note-chrome').click(); assert.equal(await page.locator('[data-note-path="index.md"][data-active-panel="true"]').count(), 1); await page.getByRole("link", { name: "rollback guide" }).click({ modifiers: ["Shift"] }); await page.waitForFunction(() => document.querySelectorAll("[data-note-path]").length === 1); assert.equal(await page.locator("[data-note-path]").count(), 1, "Shift-click should invert beside mode and replace the active panel"); await page.goBack(); await page.waitForFunction(() => document.querySelectorAll("[data-note-path]").length === 2); - await page.locator('[data-note-path="index.md"]').click(); + await page.locator('[data-note-path="index.md"] .note-chrome').click(); await page.getByRole("button", { name: "Open file explorer" }).click(); const currentFile = page.locator('.file-sidebar [data-tree-path="index.md"]'); @@ -258,6 +258,94 @@ test("exported viewer renders Mermaid in initial and dynamic note panels", async await context.close(); }); +test("exported Mermaid diagrams open in a zoomable viewport", async () => { + const context = await browser.newContext({ viewport: { width: 1280, height: 720 } }); + const page = await context.newPage(); + const errors = collectPageErrors(page); + + await page.goto(viewerURL, { waitUntil: "networkidle" }); + const trigger = page.getByRole("button", { name: "Mermaid diagram 1 in Browser Test Handbook" }); + await trigger.click(); + + const dialog = page.getByRole("dialog", { name: "Mermaid diagram 1 in Browser Test Handbook" }); + await dialog.waitFor({ state: "visible" }); + const dialogBox = await dialog.boundingBox(); + assert.deepEqual(dialogBox && { width: dialogBox.width, height: dialogBox.height }, { width: 1280, height: 720 }); + + const status = page.getByRole("status", { name: "Diagram zoom" }); + const zoomIn = page.getByRole("button", { name: "Zoom in" }); + const zoomOut = page.getByRole("button", { name: "Zoom out" }); + const actual = page.getByRole("button", { name: "Show diagram at 100%" }); + const fit = page.getByRole("button", { name: "Fit diagram to viewport" }); + const canvas = page.getByLabel("Diagram canvas. Drag to pan."); + const stage = page.locator(".ok-mermaid-viewport-stage"); + + const fittedZoom = zoomPercent(await status.innerText()); + await zoomIn.click(); + assert.ok(zoomPercent(await status.innerText()) > fittedZoom); + await zoomOut.click(); + await actual.click(); + assert.equal(await status.innerText(), "100%"); + await fit.click(); + assert.equal(zoomPercent(await status.innerText()), fittedZoom); + + await canvas.hover(); + await page.mouse.wheel(0, -100); + assert.ok(zoomPercent(await status.innerText()) > fittedZoom); + + const canvasBox = await canvas.boundingBox(); + assert.ok(canvasBox); + const beforeDrag = await stage.getAttribute("style"); + await page.mouse.move(canvasBox.x + canvasBox.width / 2, canvasBox.y + canvasBox.height / 2); + await page.mouse.down(); + await page.mouse.move(canvasBox.x + canvasBox.width / 2 + 90, canvasBox.y + canvasBox.height / 2 + 50); + await page.mouse.up(); + const afterDrag = await stage.getAttribute("style"); + assert.notEqual(afterDrag, beforeDrag); + await canvas.press("ArrowRight"); + assert.notEqual(await stage.getAttribute("style"), afterDrag); + + await canvas.press("Escape"); + await dialog.waitFor({ state: "hidden" }); + assert.equal(await trigger.evaluate((element) => document.activeElement === element), true); + const restoredDiagram = page.locator('[data-note-path="index.md"] [data-mermaid-output] svg'); + await restoredDiagram.waitFor({ state: "visible" }); + assert.equal(await restoredDiagram.count(), 1); + + await trigger.press("Enter"); + await dialog.waitFor({ state: "visible" }); + await page.getByRole("button", { name: "Close diagram viewer" }).click(); + await dialog.waitFor({ state: "hidden" }); + assert.equal(await trigger.evaluate((element) => document.activeElement === element), true); + await restoredDiagram.waitFor({ state: "visible" }); + await page.keyboard.press("Space"); + await dialog.waitFor({ state: "visible" }); + await page.keyboard.press("Escape"); + + assert.equal(errors.length, 0, `viewer Mermaid viewport browser errors:\n${errors.join("\n")}`); + await context.close(); +}); + +test("exported Mermaid viewport fits mobile screens", async () => { + const context = await browser.newContext({ viewport: { width: 390, height: 844 } }); + const page = await context.newPage(); + const errors = collectPageErrors(page); + + await page.goto(viewerURL, { waitUntil: "networkidle" }); + await page.getByRole("button", { name: "Mermaid diagram 1 in Browser Test Handbook" }).click(); + const dialog = page.getByRole("dialog", { name: "Mermaid diagram 1 in Browser Test Handbook" }); + const toolbar = page.getByRole("toolbar", { name: "Diagram zoom controls" }); + const dialogBox = await dialog.boundingBox(); + const toolbarBox = await toolbar.boundingBox(); + assert.deepEqual(dialogBox && { width: dialogBox.width, height: dialogBox.height }, { width: 390, height: 844 }); + assert.ok(toolbarBox && toolbarBox.x >= 0 && toolbarBox.x + toolbarBox.width <= 390); + for (const name of ["Zoom out", "Zoom in", "Show diagram at 100%", "Fit diagram to viewport", "Close diagram viewer"]) { + assert.equal(await page.getByRole("button", { name }).isVisible(), true); + } + assert.equal(errors.length, 0, `mobile Mermaid viewport browser errors:\n${errors.join("\n")}`); + await context.close(); +}); + test("nested exported pages work directly from file URLs", async () => { const context = await browser.newContext(); const page = await context.newPage(); @@ -316,6 +404,10 @@ function collectPageErrors(page) { return errors; } +function zoomPercent(value) { + return Number.parseInt(value, 10); +} + async function listen(server) { await new Promise((resolve, reject) => { server.once("error", reject); diff --git a/packages/web/src/viewer/app.js b/packages/web/src/viewer/app.js index 374d0dd..0ff06c3 100644 --- a/packages/web/src/viewer/app.js +++ b/packages/web/src/viewer/app.js @@ -1,3 +1,4 @@ +import { bindMermaidViewport, closeMermaidViewport } from "./mermaid-viewport.js"; (function () { const workspace = document.querySelector("[data-note-workspace]"); @@ -2684,6 +2685,7 @@ } function scheduleMermaidThemeRender() { + closeMermaidViewport(); window.clearTimeout(mermaidThemeTimer); mermaidThemeTimer = window.setTimeout(function () { enhanceMermaid(stackEl, true); @@ -2776,6 +2778,13 @@ return diagram; } + function mermaidDiagramLabel(diagram) { + const panel = closestElement(diagram, "[data-note-path]"); + const title = panel?.querySelector(".note-body h1")?.textContent?.trim() || panel?.dataset.noteTitle || "document"; + const diagrams = Array.from(panel?.querySelectorAll("[data-mermaid-diagram]") || [diagram]); + return "Mermaid diagram " + (Math.max(0, diagrams.indexOf(diagram)) + 1) + " in " + title; + } + function enhanceMermaid(scope, force) { if (!window.mermaid || typeof window.mermaid.render !== "function") { return; @@ -2843,6 +2852,7 @@ output.hidden = false; sourceBlock.hidden = true; error.hidden = true; + bindMermaidViewport(output, mermaidDiagramLabel(diagram)); diagram.dataset.mermaidState = "rendered"; } catch { if (diagram._openKnowledgeMermaidRequest !== requestID) { diff --git a/packages/web/src/viewer/mermaid-viewport-controls.js b/packages/web/src/viewer/mermaid-viewport-controls.js new file mode 100644 index 0000000..c5966c5 --- /dev/null +++ b/packages/web/src/viewer/mermaid-viewport-controls.js @@ -0,0 +1,45 @@ +function button(text, label, action) { + const element = document.createElement("button"); + element.type = "button"; + element.textContent = text; + element.dataset.okMermaidAction = action; + element.setAttribute("aria-label", label); + element.setAttribute("title", label); + return element; +} + +export function createMermaidViewportControls() { + const dialog = document.createElement("dialog"); + dialog.className = "ok-mermaid-viewport"; + + const toolbar = document.createElement("div"); + toolbar.className = "ok-mermaid-viewport-toolbar"; + toolbar.setAttribute("role", "toolbar"); + toolbar.setAttribute("aria-label", "Diagram zoom controls"); + + const zoomOut = button("−", "Zoom out", "zoom-out"); + const zoomIn = button("+", "Zoom in", "zoom-in"); + const actual = button("100%", "Show diagram at 100%", "actual"); + const fitButton = button("Fit", "Fit diagram to viewport", "fit"); + const closeButton = button("Close", "Close diagram viewer", "close"); + const zoom = document.createElement("output"); + zoom.className = "ok-mermaid-viewport-zoom"; + zoom.dataset.okMermaidZoom = ""; + zoom.setAttribute("aria-label", "Diagram zoom"); + zoom.setAttribute("aria-live", "polite"); + toolbar.append(zoomOut, zoomIn, actual, fitButton, zoom, closeButton); + + const canvas = document.createElement("div"); + canvas.className = "ok-mermaid-viewport-canvas"; + canvas.dataset.okMermaidCanvas = ""; + canvas.tabIndex = 0; + canvas.setAttribute("aria-label", "Diagram canvas. Drag to pan."); + + const stage = document.createElement("div"); + stage.className = "ok-mermaid-viewport-stage"; + canvas.append(stage); + dialog.append(toolbar, canvas); + document.body.append(dialog); + + return { actual, canvas, closeButton, dialog, fitButton, stage, zoom, zoomIn, zoomOut }; +} diff --git a/packages/web/src/viewer/mermaid-viewport.js b/packages/web/src/viewer/mermaid-viewport.js new file mode 100644 index 0000000..404b175 --- /dev/null +++ b/packages/web/src/viewer/mermaid-viewport.js @@ -0,0 +1,255 @@ +import { createMermaidViewportControls } from "./mermaid-viewport-controls.js"; + +const minimumScale = 0.01; +const maximumScale = 8; +let controls; + +export function bindMermaidViewport(trigger, label) { + if ("okMermaidViewportBound" in trigger.dataset) { + return; + } + trigger.dataset.okMermaidViewportBound = ""; + trigger.tabIndex = 0; + trigger.setAttribute("role", "button"); + trigger.setAttribute("aria-label", label); + trigger.setAttribute("aria-haspopup", "dialog"); + trigger.setAttribute("aria-keyshortcuts", "Enter Space"); + trigger.setAttribute("title", "Open diagram viewer"); + const open = () => (controls ||= createViewport()).open(trigger, label); + trigger.addEventListener("click", (event) => { + if (!event.target?.closest?.("a")) { + open(); + } + }); + trigger.addEventListener("keydown", (event) => { + if (event.key === "Enter" || event.key === " " || event.code === "Space") { + event.preventDefault(); + open(); + } + }); +} + +export function closeMermaidViewport() { + controls?.close(); +} + +function createViewport() { + const { actual, canvas, closeButton, dialog, fitButton, stage, zoom, zoomIn, zoomOut } = + createMermaidViewportControls(); + const state = { + fit: true, + height: 1, + original: null, + pinch: null, + pointers: new Map(), + scale: 1, + trigger: null, + width: 1, + x: 0, + y: 0, + }; + + function update() { + stage.style.width = state.width + "px"; + stage.style.height = state.height + "px"; + stage.style.transform = + "translate3d(" + rounded(state.x) + "px, " + rounded(state.y) + "px, 0) scale(" + rounded(state.scale) + ")"; + zoom.textContent = Math.round(state.scale * 100) + "%"; + } + + function fit() { + const bounds = canvas.getBoundingClientRect(); + const availableWidth = Math.max(1, bounds.width - 48); + const availableHeight = Math.max(1, bounds.height - 48); + state.scale = clamp(Math.min(availableWidth / state.width, availableHeight / state.height)); + state.x = (bounds.width - state.width * state.scale) / 2; + state.y = (bounds.height - state.height * state.scale) / 2; + state.fit = true; + update(); + } + + function actualSize() { + const bounds = canvas.getBoundingClientRect(); + state.scale = 1; + state.x = (bounds.width - state.width) / 2; + state.y = (bounds.height - state.height) / 2; + state.fit = false; + update(); + } + + function zoomAt(multiplier, clientX, clientY) { + const nextScale = clamp(state.scale * multiplier); + const bounds = canvas.getBoundingClientRect(); + const pointX = clientX === undefined ? bounds.width / 2 : clientX - bounds.left; + const pointY = clientY === undefined ? bounds.height / 2 : clientY - bounds.top; + const ratio = nextScale / state.scale; + state.x = pointX - (pointX - state.x) * ratio; + state.y = pointY - (pointY - state.y) * ratio; + state.scale = nextScale; + state.fit = false; + update(); + } + + function restore() { + if (!state.original) { + return; + } + state.original.parent.insertBefore(state.original.svg, state.original.next); + state.original = null; + state.pinch = null; + state.pointers.clear(); + delete canvas.dataset.okMermaidPanning; + const trigger = state.trigger; + state.trigger = null; + if (trigger && trigger.isConnected !== false) { + trigger.focus(); + } + } + + function close() { + if (dialog.open) { + dialog.close(); + } + } + + function open(trigger, label) { + const svg = trigger.querySelector("svg"); + if (!svg) { + return; + } + close(); + const size = diagramSize(svg); + state.width = size.width; + state.height = size.height; + state.trigger = trigger; + state.original = { svg, parent: svg.parentNode, next: svg.nextSibling }; + dialog.setAttribute("aria-label", label); + stage.append(svg); + dialog.showModal(); + fit(); + canvas.focus(); + } + + zoomOut.addEventListener("click", () => zoomAt(0.8)); + zoomIn.addEventListener("click", () => zoomAt(1.25)); + actual.addEventListener("click", actualSize); + fitButton.addEventListener("click", fit); + closeButton.addEventListener("click", close); + dialog.addEventListener("close", restore); + dialog.addEventListener("cancel", (event) => { + event.preventDefault(); + close(); + }); + dialog.addEventListener("keydown", (event) => { + const key = event.key.toLowerCase(); + if (key === "+" || key === "=") { + zoomAt(1.25); + } else if (key === "-") { + zoomAt(0.8); + } else if (key === "0") { + actualSize(); + } else if (key === "f") { + fit(); + } else if (key === "escape") { + close(); + } else if (key.startsWith("arrow")) { + state.x += key === "arrowleft" ? -40 : key === "arrowright" ? 40 : 0; + state.y += key === "arrowup" ? -40 : key === "arrowdown" ? 40 : 0; + state.fit = false; + update(); + } else { + return; + } + event.preventDefault(); + }); + canvas.addEventListener("wheel", (event) => { + event.preventDefault(); + zoomAt(event.deltaY < 0 ? 1.1 : 1 / 1.1, event.clientX, event.clientY); + }, { passive: false }); + canvas.addEventListener("pointerdown", (event) => { + if (event.button !== 0) { + return; + } + state.pointers.set(event.pointerId, { x: event.clientX, y: event.clientY }); + state.pinch = pinchSnapshot(state.pointers); + state.fit = false; + canvas.dataset.okMermaidPanning = ""; + canvas.setPointerCapture(event.pointerId); + }); + canvas.addEventListener("pointermove", (event) => { + const previous = state.pointers.get(event.pointerId); + if (!previous) { + return; + } + state.pointers.set(event.pointerId, { x: event.clientX, y: event.clientY }); + if (state.pointers.size > 1) { + const nextPinch = pinchSnapshot(state.pointers); + if (state.pinch && nextPinch && state.pinch.distance > 0) { + zoomAt(nextPinch.distance / state.pinch.distance, state.pinch.x, state.pinch.y); + state.x += nextPinch.x - state.pinch.x; + state.y += nextPinch.y - state.pinch.y; + } + state.pinch = nextPinch; + } else { + state.x += event.clientX - previous.x; + state.y += event.clientY - previous.y; + } + update(); + }); + function endPan(event) { + if (!state.pointers.has(event.pointerId)) { + return; + } + state.pointers.delete(event.pointerId); + state.pinch = pinchSnapshot(state.pointers); + if (!state.pointers.size) { + delete canvas.dataset.okMermaidPanning; + } + if (!canvas.hasPointerCapture || canvas.hasPointerCapture(event.pointerId)) { + canvas.releasePointerCapture(event.pointerId); + } + } + canvas.addEventListener("pointerup", endPan); + canvas.addEventListener("pointercancel", endPan); + window.addEventListener("resize", () => { + if (dialog.open && state.fit) { + fit(); + } + }); + + return { close, dialog, open }; +} + +function diagramSize(svg) { + const viewBox = svg.viewBox?.baseVal; + const bounds = svg.getBoundingClientRect(); + return { + width: positive(viewBox?.width) || positive(svg.width?.baseVal?.value) || positive(bounds.width) || 1, + height: positive(viewBox?.height) || positive(svg.height?.baseVal?.value) || positive(bounds.height) || 1, + }; +} + +function positive(value) { + const number = Number(value); + return Number.isFinite(number) && number > 0 ? number : 0; +} + +function clamp(value) { + return Math.min(maximumScale, Math.max(minimumScale, value)); +} + +function rounded(value) { + return Math.round(value * 1000) / 1000; +} + +function pinchSnapshot(pointers) { + if (pointers.size < 2) { + return null; + } + const [first, second] = Array.from(pointers.values()); + return { + distance: Math.hypot(second.x - first.x, second.y - first.y), + x: (first.x + second.x) / 2, + y: (first.y + second.y) / 2, + }; +} diff --git a/packages/web/src/viewer/viewer.css b/packages/web/src/viewer/viewer.css index 22f6682..9dc8399 100644 --- a/packages/web/src/viewer/viewer.css +++ b/packages/web/src/viewer/viewer.css @@ -319,9 +319,26 @@ pre code, .code-block code { display: block; min-width: max-content; padding: 0; .ok-mermaid { display: grid; gap: 10px; margin: 22px 0 26px; } .ok-mermaid .code-block { margin: 0; } .ok-mermaid-output { width: 100%; overflow: auto; padding: 18px; border: 1px solid var(--ok-color-border); border-radius: 10px; background: var(--ok-color-surface); box-shadow: 0 8px 24px var(--ok-color-shadow); scrollbar-color: var(--ok-color-rail-thumb) transparent; } +.ok-mermaid-output[role="button"] { position: relative; cursor: zoom-in; transition: background-color .14s ease, box-shadow .14s ease; } +.ok-mermaid-output[role="button"]::after { position: absolute; top: 8px; right: 8px; padding: 5px 8px; border: 1px solid var(--ok-color-editor-trigger-border); border-radius: 6px; background: var(--ok-color-editor-trigger-bg); color: var(--ok-color-editor-trigger-text); box-shadow: 0 1px 0 var(--ok-color-editor-trigger-shadow) inset; content: "Expand"; font: 700 11px/1 var(--ok-font-body); pointer-events: none; } +.ok-mermaid-output[role="button"]:hover { background: var(--ok-color-accent-softer); box-shadow: inset 0 0 0 1px var(--ok-color-accent-border); } +.ok-mermaid-output[role="button"]:focus-visible { outline: 2px solid var(--ok-color-focus-ring); outline-offset: 3px; } .ok-mermaid-output[hidden], .ok-mermaid-error[hidden], .ok-mermaid [data-mermaid-source][hidden] { display: none; } .ok-mermaid-output svg { display: block; width: 100%; max-width: 100%; height: auto; margin: 0 auto; } .ok-mermaid-error { margin: 0; padding: 9px 11px; border: 1px solid var(--ok-color-border); border-radius: 7px; background: var(--ok-color-accent-softer); color: var(--ok-color-danger); font-size: 12px; line-height: 1.45; } +.ok-mermaid-viewport { position: fixed; inset: 0; width: 100vw; max-width: none; height: var(--ok-viewport-height); max-height: none; margin: 0; padding: 0; overflow: hidden; border: 0; background: var(--ok-color-viewer-canvas); color: var(--ok-color-text); } +.ok-mermaid-viewport[open] { display: flex; flex-direction: column; } +.ok-mermaid-viewport::backdrop { background: rgba(0, 0, 0, .72); } +.ok-mermaid-viewport-toolbar { z-index: 1; display: flex; flex: 0 0 auto; align-items: center; gap: 7px; min-height: 52px; overflow-x: auto; padding: 9px 12px; border-bottom: 1px solid var(--ok-color-border); background: var(--ok-color-surface); box-shadow: 0 1px 4px var(--ok-color-shadow); } +.ok-mermaid-viewport-toolbar button { flex: 0 0 auto; min-width: 34px; height: 32px; padding: 0 10px; border: 1px solid var(--ok-color-editor-trigger-border); border-radius: 7px; background: var(--ok-color-editor-trigger-bg); color: var(--ok-color-editor-trigger-text); cursor: pointer; font: 700 12px/1 var(--ok-font-body); } +.ok-mermaid-viewport-toolbar button:hover { border-color: var(--ok-color-editor-trigger-focus-border); background: var(--ok-color-control-hover-bg); color: var(--ok-color-control-hover-text); } +.ok-mermaid-viewport-toolbar button:focus-visible, .ok-mermaid-viewport-canvas:focus-visible { outline: 2px solid var(--ok-color-focus-ring); outline-offset: 2px; } +.ok-mermaid-viewport-toolbar [data-ok-mermaid-action="close"] { margin-left: auto; } +.ok-mermaid-viewport-zoom { min-width: 48px; color: var(--ok-color-muted); font: 700 12px/1 var(--ok-font-mono); text-align: center; } +.ok-mermaid-viewport-canvas { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: var(--ok-color-viewer-canvas); cursor: grab; touch-action: none; user-select: none; } +.ok-mermaid-viewport-canvas[data-ok-mermaid-panning] { cursor: grabbing; } +.ok-mermaid-viewport-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; } +.ok-mermaid-viewport-stage svg { display: block; width: 100%; max-width: none; height: 100%; min-width: 0; margin: 0; pointer-events: none; } .asset-code .code-block, .asset-text .code-block { margin: 0; min-height: 440px; } .ok-table-wrap { --ok-table-inner-radius: 6px; max-width: 100%; margin: 24px 0 28px; overflow: visible; border: 1px solid var(--ok-color-border); border-radius: 7px; background: var(--ok-color-surface); } .ok-table-scroller { overflow-x: auto; border-radius: 0 0 var(--ok-table-inner-radius) var(--ok-table-inner-radius); } @@ -470,6 +487,9 @@ html[data-viewer-motion="full"] .note-body a { transition: background-color .16s .ok-table-search { flex-basis: 110px; } .ok-table-filter-trigger { padding: 0 8px; } .ok-table-filter-panel { width: min(260px, calc(100vw - 36px)); } + .ok-mermaid-viewport-toolbar { gap: 5px; min-height: 48px; padding: 7px 8px; } + .ok-mermaid-viewport-toolbar button { min-width: 30px; padding: 0 8px; } + .ok-mermaid-viewport-zoom { min-width: 42px; } } .note-body h1 { font-size: calc(30px * var(--ok-document-scale, 1)); } .note-body h2 { font-size: calc(21px * var(--ok-document-scale, 1)); }