synabun 2.0.9 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/README.md +1 -1
- package/THIRD-PARTY-LICENSES.md +46 -4
- package/launcher.mjs +9 -3
- package/lib/start-launcher.js +6 -1
- package/mcp-server/package-lock.json +2 -2
- package/mcp-server/package.json +1 -1
- package/neural-interface/i18n/en.json +218 -7
- package/neural-interface/i18n/pt-BR.json +220 -9
- package/neural-interface/lib/account-usage.js +5 -3
- package/neural-interface/lib/app-controls-api.js +161 -0
- package/neural-interface/lib/assistant-api.js +21 -7
- package/neural-interface/lib/assistant-brains/opencode.js +13 -1
- package/neural-interface/lib/assistant-brains/opencode2-browser-policy/index.js +44 -0
- package/neural-interface/lib/assistant-brains/opencode2-route-gate/index.js +57 -0
- package/neural-interface/lib/assistant-catalog.js +17 -2
- package/neural-interface/lib/assistant-dispatch.js +3 -0
- package/neural-interface/lib/assistant-envelope.js +19 -1
- package/neural-interface/lib/assistant-runtime.js +127 -8
- package/neural-interface/lib/claude-model-catalog.js +64 -14
- package/neural-interface/lib/codex-settings-schema.js +109 -47
- package/neural-interface/lib/editor-completion-opencode.js +132 -35
- package/neural-interface/lib/exec-loop-command.js +8 -1
- package/neural-interface/lib/launch-cache.js +293 -0
- package/neural-interface/lib/login-start.js +524 -0
- package/neural-interface/lib/native-loop-providers.js +18 -3
- package/neural-interface/lib/native-loop-runtime.js +19 -0
- package/neural-interface/lib/opencode-db-schema.js +75 -0
- package/neural-interface/lib/opencode-history.js +16 -1
- package/neural-interface/lib/opencode-protocol.js +173 -0
- package/neural-interface/lib/opencode-provider-view.js +81 -0
- package/neural-interface/lib/opencode-runtime-config.js +10 -3
- package/neural-interface/lib/opencode-serve-records.js +606 -0
- package/neural-interface/lib/opencode-v2-client.js +33 -6
- package/neural-interface/lib/opencode-v2-ws-requests.js +19 -5
- package/neural-interface/lib/opencode-worker-activity.js +229 -0
- package/neural-interface/lib/opencode2-client.js +760 -0
- package/neural-interface/lib/opencode2-proxy.js +116 -0
- package/neural-interface/lib/opencode2-translate.js +1008 -0
- package/neural-interface/lib/process-identity.js +361 -0
- package/neural-interface/lib/session-cache-builder.js +26 -5
- package/neural-interface/lib/session-title-generator.js +18 -0
- package/neural-interface/lib/style-guide/api.js +4 -3
- package/neural-interface/lib/untrusted-file-headers.js +27 -0
- package/neural-interface/package-lock.json +1343 -45
- package/neural-interface/package.json +5 -1
- package/neural-interface/public/index.html +2 -2
- package/neural-interface/public/shared/agent-runtime-options.js +55 -11
- package/neural-interface/public/shared/assistant/asst-agents-dock.js +172 -17
- package/neural-interface/public/shared/assistant/asst-api.js +11 -3
- package/neural-interface/public/shared/assistant/asst-brain-picker.js +195 -80
- package/neural-interface/public/shared/assistant/asst-composer.js +1 -1
- package/neural-interface/public/shared/assistant/asst-hosts.js +49 -2
- package/neural-interface/public/shared/assistant/asst-menu.js +77 -6
- package/neural-interface/public/shared/assistant/asst-panel.js +197 -33
- package/neural-interface/public/shared/assistant/asst-rack-styles.js +28 -10
- package/neural-interface/public/shared/assistant/asst-redact.js +186 -0
- package/neural-interface/public/shared/assistant/asst-render.js +382 -36
- package/neural-interface/public/shared/assistant/asst-run-stage.js +231 -0
- package/neural-interface/public/shared/assistant/asst-sanitize.js +193 -3
- package/neural-interface/public/shared/assistant/asst-scene-styles.js +273 -0
- package/neural-interface/public/shared/assistant/asst-scenes.js +528 -0
- package/neural-interface/public/shared/assistant/asst-sidepanel-styles.js +3 -15
- package/neural-interface/public/shared/assistant/asst-state.js +14 -0
- package/neural-interface/public/shared/assistant/asst-styles.js +43 -0
- package/neural-interface/public/shared/assistant/asst-tool-kinds.js +13 -1
- package/neural-interface/public/shared/cc-dropdown.js +480 -0
- package/neural-interface/public/shared/cdx/cdx-panel.js +13 -1
- package/neural-interface/public/shared/cdx/cdx-render.js +15 -3
- package/neural-interface/public/shared/cdx/cdx-styles.js +4 -0
- package/neural-interface/public/shared/cdx/cdx-tabs.js +149 -35
- package/neural-interface/public/shared/cp/cp-markdown.js +4 -57
- package/neural-interface/public/shared/data-cache.js +223 -0
- package/neural-interface/public/shared/desktop-bridge.js +11 -0
- package/neural-interface/public/shared/desktop-titlebar-view.js +78 -1
- package/neural-interface/public/shared/desktop-titlebar.js +214 -28
- package/neural-interface/public/shared/desktop-update-view.js +15 -5
- package/neural-interface/public/shared/file-links.js +73 -8
- package/neural-interface/public/shared/html-shell.js +74 -80
- package/neural-interface/public/shared/launch-prefetch.js +59 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-caps.js +3 -2
- package/neural-interface/public/shared/ocp-v2/ocp-v2-childpanel.js +7 -2
- package/neural-interface/public/shared/ocp-v2/ocp-v2-modelpicker.js +54 -17
- package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +93 -2
- package/neural-interface/public/shared/ocp-v2/ocp-v2-projectbar.js +3 -2
- package/neural-interface/public/shared/ocp-v2/ocp-v2-providers.js +11 -9
- package/neural-interface/public/shared/ocp-v2/ocp-v2-rehydrate.js +15 -4
- package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +1 -1
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send-logic.js +401 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send.js +16 -9
- package/neural-interface/public/shared/ocp-v2/ocp-v2-sessions-logic.js +60 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +48 -19
- package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +195 -19
- package/neural-interface/public/shared/opencode-providers.js +39 -0
- package/neural-interface/public/shared/schedules-view.js +318 -0
- package/neural-interface/public/shared/settings/settings-app-pane.js +335 -0
- package/neural-interface/public/shared/settings/settings-app.js +243 -0
- package/neural-interface/public/shared/settings/settings-data.js +88 -0
- package/neural-interface/public/shared/settings/settings-ia.js +17 -0
- package/neural-interface/public/shared/sidepanel-session-status.js +49 -0
- package/neural-interface/public/shared/styles.css +540 -371
- package/neural-interface/public/shared/ui-assistant.js +27 -5
- package/neural-interface/public/shared/ui-automation-studio.js +67 -27
- package/neural-interface/public/shared/ui-bookmarks.js +2 -1
- package/neural-interface/public/shared/ui-claude-panel.js +76 -8
- package/neural-interface/public/shared/ui-codex-panel.js +1 -0
- package/neural-interface/public/shared/ui-detail.js +6 -6
- package/neural-interface/public/shared/ui-file-links.js +1 -0
- package/neural-interface/public/shared/ui-image-gallery.js +6 -5
- package/neural-interface/public/shared/ui-invite.js +18 -2
- package/neural-interface/public/shared/ui-link.js +9 -9
- package/neural-interface/public/shared/ui-menubar.js +232 -33
- package/neural-interface/public/shared/ui-native-loop-router.js +2 -0
- package/neural-interface/public/shared/ui-opencode-panel-v2.js +1 -0
- package/neural-interface/public/shared/ui-schedules-studio.js +2099 -869
- package/neural-interface/public/shared/ui-sessions.js +15 -4
- package/neural-interface/public/shared/ui-settings.js +87 -36
- package/neural-interface/public/shared/ui-sidebar.js +4 -4
- package/neural-interface/public/shared/ui-sidepanel-session-entry.js +13 -0
- package/neural-interface/public/shared/ui-sidepanel-sessions.js +55 -4
- package/neural-interface/public/shared/ui-sidepanel-tray.js +84 -8
- package/neural-interface/public/shared/ui-skills.js +70 -12
- package/neural-interface/public/shared/ui-sync.js +7 -0
- package/neural-interface/public/shared/ui-terminal.js +36 -20
- package/neural-interface/public/shared/ui-trash.js +8 -1
- package/neural-interface/public/shared/ui-tutorial-steps.js +7 -3
- package/neural-interface/public/shared/ui-tutorial.js +15 -5
- package/neural-interface/public/shared/ui-update.js +83 -14
- package/neural-interface/public/shared/ui-whiteboard.js +2 -1
- package/neural-interface/public/variant/2d/main.js +4 -1
- package/neural-interface/public/variant/3d/main.js +3 -0
- package/neural-interface/public/vendor/highlight/LICENSE +29 -0
- package/neural-interface/public/vendor/highlight/github-dark-dimmed-11.12.0.min.css +9 -0
- package/neural-interface/public/vendor/highlight/highlight-11.12.0.min.js +1262 -0
- package/neural-interface/public/vendor/highlight/manifest.json +5 -0
- package/neural-interface/public/vendor/html2canvas/LICENSE +22 -0
- package/neural-interface/public/vendor/html2canvas/html2canvas-1.4.1.min.js +20 -0
- package/neural-interface/public/vendor/html2canvas/manifest.json +4 -0
- package/neural-interface/public/vendor/marked/LICENSE.md +44 -0
- package/neural-interface/public/vendor/marked/manifest.json +4 -0
- package/neural-interface/public/vendor/marked/marked-14.1.4.esm.js +2502 -0
- package/neural-interface/public/vendor/mermaid/LICENSE +21 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/abnfDiagram-PAR5IXJI.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/architecture-7GRP2DOG-M7G3SWCO.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/architectureDiagram-2PNWDENW.mjs +36 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/blockDiagram-PUWGUBOA.mjs +129 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/c4Diagram-3NLNHZP5.mjs +38 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-2NMSUPJH.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-32MCUW2P.mjs +206 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-3NPNU5GP.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-3SMGFRGC.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-4CAJECRU.mjs +14 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-4OADUZ5Q.mjs +10 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-5IMINLNL.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-5IQCK5RY.mjs +3 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-5MVFYWFU.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-AQ6EADP3.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-AZZRMDJM.mjs +15 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-CLS4B6BI.mjs +168 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-DZP67EKU.mjs +70 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-EICP7K5X.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-GDY2UAB4.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-H7VHZCWX.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-IJBDOHL6.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-JFFVMJIA.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-JQRUD6KW.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-JZGDI5JK.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-KD6SPIPN.mjs +2 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-NF366YI6.mjs +231 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-NUDPKBEF.mjs +32 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-OJINMHTS.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-Q6NGPIAH.mjs +2 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-QJSWEUOL.mjs +132 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-R7JDMUKV.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-RCXAM2GK.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-RT4MAWR3.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-SFMINX4W.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-SLDQ463B.mjs +88 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-STOV2HOB.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-T5OCTHI4.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-TCEHX7R3.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-VQC2EELJ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-VRZKL3EH.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-VTHDQ7BV.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-VY2OSTJR.mjs +2 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-WUBWJARI.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-YBMQ5JGJ.mjs +2 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-YDMLL4PJ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-Z6V44ARX.mjs +62 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZJJ7VQJP.mjs +339 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZNLK7HRR.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZQN7UHIL.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZS6VBONO.mjs +174 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZUNWM646.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/classDiagram-FGAMPOII.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/classDiagram-v2-AI5RJEK4.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/cose-bilkent-Q72C2OJ3.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/cynefin-OW5HDTMX-6OCTWOGG.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/cynefinDiagram-2OOWUY4M.mjs +62 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/dagre-MPVFI544.mjs +4 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/diagram-AE4NWXFW.mjs +24 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/diagram-BUJID5UG.mjs +41 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/diagram-C44CZ5NI.mjs +24 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/diagram-EYOLEXXS.mjs +30 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/diagram-P7B6PWOJ.mjs +3 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/ebnfDiagram-FTPZ3PV6.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/erDiagram-H3ERR26V.mjs +99 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/eventmodeling-NTZA5JFV-WKSWQHFS.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/flowDiagram-YHGXBVSY.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/ganttDiagram-RWFTB7ED.mjs +292 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/gitGraph-4MIJSDKK-JH2HKYUO.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/gitGraphDiagram-MAR6GKOP.mjs +106 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/info-A6RAGUB7-3TX3OFWW.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/infoDiagram-LV547AFH.mjs +2 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/ishikawaDiagram-PUJQGNDS.mjs +70 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/journeyDiagram-EW5QJT4W.mjs +139 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/kanban-definition-JSQERAZB.mjs +89 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/katex-CZ4GXH2S.mjs +257 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/mindmap-definition-VBJCLQLM.mjs +96 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/packet-AYTQ26CC-MKII6P3Y.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/pegDiagram-7WILOQTJ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/pie-WAS4IAKB-6B4OPMJ5.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/pieDiagram-EFA7CBSB.mjs +39 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/quadrantDiagram-WARVYA7P.mjs +7 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/radar-RG4KPBEZ-UPTR3XUL.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/railroad-74A4TZTK-MEFUPFMS.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/railroad-abnf-HS5TGJTU-R5YG2S5D.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/railroad-ebnf-LZEXJU2U-G5QEX2L6.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/railroad-peg-WCYAUIDC-H5I2ZRY2.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/railroadDiagram-5NIQVNLQ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/requirementDiagram-SXREGOKZ.mjs +84 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/sankeyDiagram-VV74M2VP.mjs +40 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/sequenceDiagram-52ZFIFDL.mjs +162 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/sizeCapture-FGA5AGYP.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/stateDiagram-3QAKPIVI.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/stateDiagram-v2-HN2P4RDZ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/swimlanes-QLVP42QD.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/swimlanesDiagram-JKPDBFCN.mjs +8 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/timeline-definition-GS45XAXW.mjs +120 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/treeView-Q6P3EWNA-ZRJGANNQ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/treemap-WGGIJYW6-K64VN5AS.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/vennDiagram-QIQU2ZRJ.mjs +34 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/wardley-WFR3VGLG-D67OWCCH.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/wardleyDiagram-U6YNM66N.mjs +78 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/xychartDiagram-XJAZEDNM.mjs +7 -0
- package/neural-interface/public/vendor/mermaid/manifest.json +4 -0
- package/neural-interface/public/vendor/mermaid/mermaid-11.17.2.esm.min.mjs +14 -0
- package/neural-interface/scripts/build-vendor.mjs +84 -3
- package/neural-interface/server.js +1099 -286
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/skills/synabun/modules/schedule.md +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,b as o,c as n,d as a,e as u,g as d,k as l,x as s,y as G}from"./chunk-ZS6VBONO.mjs";import{a as t}from"./chunk-AQ6EADP3.mjs";var p=class extends G{static{t(this,"GitGraphTokenBuilder")}static{e(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},h={parser:{TokenBuilder:e(()=>new p,"TokenBuilder"),ValueConverter:e(()=>new s,"ValueConverter")}};function m(c=u){let r=a(n(c),d),i=a(o({shared:r}),l,h);return r.ServiceRegistry.register(i),{shared:r,GitGraph:i}}t(m,"createGitGraphServices");e(m,"createGitGraphServices");export{h as a,m as b};
|
package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/classDiagram-FGAMPOII.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b as o,c as e,d as t}from"./chunk-32MCUW2P.mjs";import"./chunk-AZZRMDJM.mjs";import"./chunk-RCXAM2GK.mjs";import"./chunk-VTHDQ7BV.mjs";import"./chunk-YDMLL4PJ.mjs";import"./chunk-EICP7K5X.mjs";import"./chunk-ZQN7UHIL.mjs";import"./chunk-4OADUZ5Q.mjs";import"./chunk-VRZKL3EH.mjs";import"./chunk-Z6V44ARX.mjs";import"./chunk-5IMINLNL.mjs";import"./chunk-ZNLK7HRR.mjs";import"./chunk-DZP67EKU.mjs";import"./chunk-2NMSUPJH.mjs";import"./chunk-VY2OSTJR.mjs";import"./chunk-STOV2HOB.mjs";import"./chunk-QJSWEUOL.mjs";import"./chunk-H7VHZCWX.mjs";import{a as i}from"./chunk-AQ6EADP3.mjs";var n={parser:a,get db(){return new o},renderer:t,styles:e,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/classDiagram-v2-AI5RJEK4.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b as o,c as e,d as t}from"./chunk-32MCUW2P.mjs";import"./chunk-AZZRMDJM.mjs";import"./chunk-RCXAM2GK.mjs";import"./chunk-VTHDQ7BV.mjs";import"./chunk-YDMLL4PJ.mjs";import"./chunk-EICP7K5X.mjs";import"./chunk-ZQN7UHIL.mjs";import"./chunk-4OADUZ5Q.mjs";import"./chunk-VRZKL3EH.mjs";import"./chunk-Z6V44ARX.mjs";import"./chunk-5IMINLNL.mjs";import"./chunk-ZNLK7HRR.mjs";import"./chunk-DZP67EKU.mjs";import"./chunk-2NMSUPJH.mjs";import"./chunk-VY2OSTJR.mjs";import"./chunk-STOV2HOB.mjs";import"./chunk-QJSWEUOL.mjs";import"./chunk-H7VHZCWX.mjs";import{a as i}from"./chunk-AQ6EADP3.mjs";var n={parser:a,get db(){return new o},renderer:t,styles:e,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/cose-bilkent-Q72C2OJ3.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as $}from"./chunk-ZJJ7VQJP.mjs";import{b as B,h as it}from"./chunk-H7VHZCWX.mjs";import{a as A,b as Q,d as ft}from"./chunk-AQ6EADP3.mjs";var q=Q((k,K)=>{"use strict";A((function(M,v){typeof k=="object"&&typeof K=="object"?K.exports=v():typeof define=="function"&&define.amd?define([],v):typeof k=="object"?k.layoutBase=v():M.layoutBase=v()}),"webpackUniversalModuleDefinition")(k,function(){return(function(m){var M={};function v(n){if(M[n])return M[n].exports;var e=M[n]={i:n,l:!1,exports:{}};return m[n].call(e.exports,e,e.exports,v),e.l=!0,e.exports}return A(v,"__webpack_require__"),v.m=m,v.c=M,v.i=function(n){return n},v.d=function(n,e,t){v.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:t})},v.n=function(n){var e=n&&n.__esModule?A(function(){return n.default},"getDefault"):A(function(){return n},"getModuleExports");return v.d(e,"a",e),e},v.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},v.p="",v(v.s=26)})([(function(m,M,v){"use strict";function n(){}A(n,"LayoutConstants"),n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,m.exports=n}),(function(m,M,v){"use strict";var n=v(2),e=v(8),t=v(9);function r(u,o,p){n.call(this,p),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=p,this.bendpoints=[],this.source=u,this.target=o}A(r,"LEdge"),r.prototype=Object.create(n.prototype);for(var a in n)r[a]=n[a];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(u){if(this.source===u)return this.target;if(this.target===u)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(u,o){for(var p=this.getOtherEnd(u),i=o.getGraphManager().getRoot();;){if(p.getOwner()==o)return p;if(p.getOwner()==i)break;p=p.getOwner().getParent()}return null},r.prototype.updateLength=function(){var u=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),u),this.isOverlapingSourceAndTarget||(this.lengthX=u[0]-u[2],this.lengthY=u[1]-u[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.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=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},m.exports=r}),(function(m,M,v){"use strict";function n(e){this.vGraphObject=e}A(n,"LGraphObject"),m.exports=n}),(function(m,M,v){"use strict";var n=v(2),e=v(10),t=v(13),r=v(0),a=v(16),u=v(4);function o(i,h,l,d){l==null&&d==null&&(d=h),n.call(this,d),i.graphManager!=null&&(i=i.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=i,l!=null&&h!=null?this.rect=new t(h.x,h.y,l.width,l.height):this.rect=new t}A(o,"LNode"),o.prototype=Object.create(n.prototype);for(var p in n)o[p]=n[p];o.prototype.getEdges=function(){return this.edges},o.prototype.getChild=function(){return this.child},o.prototype.getOwner=function(){return this.owner},o.prototype.getWidth=function(){return this.rect.width},o.prototype.setWidth=function(i){this.rect.width=i},o.prototype.getHeight=function(){return this.rect.height},o.prototype.setHeight=function(i){this.rect.height=i},o.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},o.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},o.prototype.getCenter=function(){return new u(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},o.prototype.getLocation=function(){return new u(this.rect.x,this.rect.y)},o.prototype.getRect=function(){return this.rect},o.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},o.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},o.prototype.setRect=function(i,h){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=h.width,this.rect.height=h.height},o.prototype.setCenter=function(i,h){this.rect.x=i-this.rect.width/2,this.rect.y=h-this.rect.height/2},o.prototype.setLocation=function(i,h){this.rect.x=i,this.rect.y=h},o.prototype.moveBy=function(i,h){this.rect.x+=i,this.rect.y+=h},o.prototype.getEdgeListToNode=function(i){var h=[],l,d=this;return d.edges.forEach(function(y){if(y.target==i){if(y.source!=d)throw"Incorrect edge source!";h.push(y)}}),h},o.prototype.getEdgesBetween=function(i){var h=[],l,d=this;return d.edges.forEach(function(y){if(!(y.source==d||y.target==d))throw"Incorrect edge source and/or target";(y.target==i||y.source==i)&&h.push(y)}),h},o.prototype.getNeighborsList=function(){var i=new Set,h=this;return h.edges.forEach(function(l){if(l.source==h)i.add(l.target);else{if(l.target!=h)throw"Incorrect incidency!";i.add(l.source)}}),i},o.prototype.withChildren=function(){var i=new Set,h,l;if(i.add(this),this.child!=null)for(var d=this.child.getNodes(),y=0;y<d.length;y++)h=d[y],l=h.withChildren(),l.forEach(function(T){i.add(T)});return i},o.prototype.getNoOfChildren=function(){var i=0,h;if(this.child==null)i=1;else for(var l=this.child.getNodes(),d=0;d<l.length;d++)h=l[d],i+=h.getNoOfChildren();return i==0&&(i=1),i},o.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},o.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},o.prototype.scatter=function(){var i,h,l=-r.INITIAL_WORLD_BOUNDARY,d=r.INITIAL_WORLD_BOUNDARY;i=r.WORLD_CENTER_X+a.nextDouble()*(d-l)+l;var y=-r.INITIAL_WORLD_BOUNDARY,T=r.INITIAL_WORLD_BOUNDARY;h=r.WORLD_CENTER_Y+a.nextDouble()*(T-y)+y,this.rect.x=i,this.rect.y=h},o.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),r.NODE_DIMENSIONS_INCLUDE_LABELS){var h=i.getRight()-i.getLeft(),l=i.getBottom()-i.getTop();this.labelWidth>h&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>l&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-l)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-l),this.setHeight(this.labelHeight))}}},o.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},o.prototype.transform=function(i){var h=this.rect.x;h>r.WORLD_BOUNDARY?h=r.WORLD_BOUNDARY:h<-r.WORLD_BOUNDARY&&(h=-r.WORLD_BOUNDARY);var l=this.rect.y;l>r.WORLD_BOUNDARY?l=r.WORLD_BOUNDARY:l<-r.WORLD_BOUNDARY&&(l=-r.WORLD_BOUNDARY);var d=new u(h,l),y=i.inverseTransformPoint(d);this.setLocation(y.x,y.y)},o.prototype.getLeft=function(){return this.rect.x},o.prototype.getRight=function(){return this.rect.x+this.rect.width},o.prototype.getTop=function(){return this.rect.y},o.prototype.getBottom=function(){return this.rect.y+this.rect.height},o.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},m.exports=o}),(function(m,M,v){"use strict";function n(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}A(n,"PointD"),n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(e){this.x=e},n.prototype.setY=function(e){this.y=e},n.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},m.exports=n}),(function(m,M,v){"use strict";var n=v(2),e=v(10),t=v(0),r=v(6),a=v(3),u=v(1),o=v(13),p=v(12),i=v(11);function h(d,y,T){n.call(this,T),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,y!=null&&y instanceof r?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}A(h,"LGraph"),h.prototype=Object.create(n.prototype);for(var l in n)h[l]=n[l];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(d,y,T){if(y==null&&T==null){var c=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(c)>-1)throw"Node already in graph!";return c.owner=this,this.getNodes().push(c),c}else{var D=d;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(y.owner==T.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=T.owner?null:(D.source=y,D.target=T,D.isInterGraph=!1,this.getEdges().push(D),y.edges.push(D),T!=y&&T.edges.push(D),D)}},h.prototype.remove=function(d){var y=d;if(d instanceof a){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=y.edges.slice(),c,D=T.length,E=0;E<D;E++)c=T[E],c.isInterGraph?this.graphManager.remove(c):c.source.owner.remove(c);var O=this.nodes.indexOf(y);if(O==-1)throw"Node not in owner node list!";this.nodes.splice(O,1)}else if(d instanceof u){var c=d;if(c==null)throw"Edge is null!";if(!(c.source!=null&&c.target!=null))throw"Source and/or target is null!";if(!(c.source.owner!=null&&c.target.owner!=null&&c.source.owner==this&&c.target.owner==this))throw"Source and/or target owner is invalid!";var s=c.source.edges.indexOf(c),g=c.target.edges.indexOf(c);if(!(s>-1&&g>-1))throw"Source and/or target doesn't know this edge!";c.source.edges.splice(s,1),c.target!=c.source&&c.target.edges.splice(g,1);var O=c.source.owner.getEdges().indexOf(c);if(O==-1)throw"Not in owner's edge list!";c.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var d=e.MAX_VALUE,y=e.MAX_VALUE,T,c,D,E=this.getNodes(),O=E.length,s=0;s<O;s++){var g=E[s];T=g.getTop(),c=g.getLeft(),d>T&&(d=T),y>c&&(y=c)}return d==e.MAX_VALUE?null:(E[0].getParent().paddingLeft!=null?D=E[0].getParent().paddingLeft:D=this.margin,this.left=y-D,this.top=d-D,new p(this.left,this.top))},h.prototype.updateBounds=function(d){for(var y=e.MAX_VALUE,T=-e.MAX_VALUE,c=e.MAX_VALUE,D=-e.MAX_VALUE,E,O,s,g,f,L=this.nodes,N=L.length,I=0;I<N;I++){var R=L[I];d&&R.child!=null&&R.updateBounds(),E=R.getLeft(),O=R.getRight(),s=R.getTop(),g=R.getBottom(),y>E&&(y=E),T<O&&(T=O),c>s&&(c=s),D<g&&(D=g)}var C=new o(y,c,T-y,D-c);y==e.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),L[0].getParent().paddingLeft!=null?f=L[0].getParent().paddingLeft:f=this.margin,this.left=C.x-f,this.right=C.x+C.width+f,this.top=C.y-f,this.bottom=C.y+C.height+f},h.calculateBounds=function(d){for(var y=e.MAX_VALUE,T=-e.MAX_VALUE,c=e.MAX_VALUE,D=-e.MAX_VALUE,E,O,s,g,f=d.length,L=0;L<f;L++){var N=d[L];E=N.getLeft(),O=N.getRight(),s=N.getTop(),g=N.getBottom(),y>E&&(y=E),T<O&&(T=O),c>s&&(c=s),D<g&&(D=g)}var I=new o(y,c,T-y,D-c);return I},h.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){for(var d=0,y=this.nodes,T=y.length,c=0;c<T;c++){var D=y[c];d+=D.calcEstimatedSize()}return d==0?this.estimatedSize=t.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=d/Math.sqrt(this.nodes.length),this.estimatedSize},h.prototype.updateConnected=function(){var d=this;if(this.nodes.length==0){this.isConnected=!0;return}var y=new i,T=new Set,c=this.nodes[0],D,E,O=c.withChildren();for(O.forEach(function(I){y.push(I),T.add(I)});y.length!==0;){c=y.shift(),D=c.getEdges();for(var s=D.length,g=0;g<s;g++){var f=D[g];if(E=f.getOtherEndInGraph(c,this),E!=null&&!T.has(E)){var L=E.withChildren();L.forEach(function(I){y.push(I),T.add(I)})}}}if(this.isConnected=!1,T.size>=this.nodes.length){var N=0;T.forEach(function(I){I.owner==d&&N++}),N==this.nodes.length&&(this.isConnected=!0)}},m.exports=h}),(function(m,M,v){"use strict";var n,e=v(1);function t(r){n=v(5),this.layout=r,this.graphs=[],this.edges=[]}A(t,"LGraphManager"),t.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),u=this.add(r,a);return this.setRootGraph(u),this.rootGraph},t.prototype.add=function(r,a,u,o,p){if(u==null&&o==null&&p==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{p=u,o=a,u=r;var i=o.getOwner(),h=p.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==h)return u.isInterGraph=!1,i.add(u,o,p);if(u.isInterGraph=!0,u.source=o,u.target=p,this.edges.indexOf(u)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(u),!(u.source!=null&&u.target!=null))throw"Edge source and/or target is null!";if(!(u.source.edges.indexOf(u)==-1&&u.target.edges.indexOf(u)==-1))throw"Edge already in source and/or target incidency list!";return u.source.edges.push(u),u.target.edges.push(u),u}},t.prototype.remove=function(r){if(r instanceof n){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var u=[];u=u.concat(a.getEdges());for(var o,p=u.length,i=0;i<p;i++)o=u[i],a.remove(o);var h=[];h=h.concat(a.getNodes());var l;p=h.length;for(var i=0;i<p;i++)l=h[i],a.remove(l);a==this.rootGraph&&this.setRootGraph(null);var d=this.graphs.indexOf(a);this.graphs.splice(d,1),a.parent=null}else if(r instanceof e){if(o=r,o==null)throw"Edge is null!";if(!o.isInterGraph)throw"Not an inter-graph edge!";if(!(o.source!=null&&o.target!=null))throw"Source and/or target is null!";if(!(o.source.edges.indexOf(o)!=-1&&o.target.edges.indexOf(o)!=-1))throw"Source and/or target doesn't know this edge!";var d=o.source.edges.indexOf(o);if(o.source.edges.splice(d,1),d=o.target.edges.indexOf(o),o.target.edges.splice(d,1),!(o.source.owner!=null&&o.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(o.source.owner.getGraphManager().edges.indexOf(o)==-1)throw"Not in owner graph manager's edge list!";var d=o.source.owner.getGraphManager().edges.indexOf(o);o.source.owner.getGraphManager().edges.splice(d,1)}},t.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},t.prototype.getGraphs=function(){return this.graphs},t.prototype.getAllNodes=function(){if(this.allNodes==null){for(var r=[],a=this.getGraphs(),u=a.length,o=0;o<u;o++)r=r.concat(a[o].getNodes());this.allNodes=r}return this.allNodes},t.prototype.resetAllNodes=function(){this.allNodes=null},t.prototype.resetAllEdges=function(){this.allEdges=null},t.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},t.prototype.getAllEdges=function(){if(this.allEdges==null){for(var r=[],a=this.getGraphs(),u=a.length,o=0;o<a.length;o++)r=r.concat(a[o].getEdges());r=r.concat(this.edges),this.allEdges=r}return this.allEdges},t.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},t.prototype.setAllNodesToApplyGravitation=function(r){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=r},t.prototype.getRoot=function(){return this.rootGraph},t.prototype.setRootGraph=function(r){if(r.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=r,r.parent==null&&(r.parent=this.layout.newNode("Root node"))},t.prototype.getLayout=function(){return this.layout},t.prototype.isOneAncestorOfOther=function(r,a){if(!(r!=null&&a!=null))throw"assert failed";if(r==a)return!0;var u=r.getOwner(),o;do{if(o=u.getParent(),o==null)break;if(o==a)return!0;if(u=o.getOwner(),u==null)break}while(!0);u=a.getOwner();do{if(o=u.getParent(),o==null)break;if(o==r)return!0;if(u=o.getOwner(),u==null)break}while(!0);return!1},t.prototype.calcLowestCommonAncestors=function(){for(var r,a,u,o,p,i=this.getAllEdges(),h=i.length,l=0;l<h;l++){if(r=i[l],a=r.source,u=r.target,r.lca=null,r.sourceInLca=a,r.targetInLca=u,a==u){r.lca=a.getOwner();continue}for(o=a.getOwner();r.lca==null;){for(r.targetInLca=u,p=u.getOwner();r.lca==null;){if(p==o){r.lca=p;break}if(p==this.rootGraph)break;if(r.lca!=null)throw"assert failed";r.targetInLca=p.getParent(),p=r.targetInLca.getOwner()}if(o==this.rootGraph)break;r.lca==null&&(r.sourceInLca=o.getParent(),o=r.sourceInLca.getOwner())}if(r.lca==null)throw"assert failed"}},t.prototype.calcLowestCommonAncestor=function(r,a){if(r==a)return r.getOwner();var u=r.getOwner();do{if(u==null)break;var o=a.getOwner();do{if(o==null)break;if(o==u)return o;o=o.getParent().getOwner()}while(!0);u=u.getParent().getOwner()}while(!0);return u},t.prototype.calcInclusionTreeDepths=function(r,a){r==null&&a==null&&(r=this.rootGraph,a=1);for(var u,o=r.getNodes(),p=o.length,i=0;i<p;i++)u=o[i],u.inclusionTreeDepth=a,u.child!=null&&this.calcInclusionTreeDepths(u.child,a+1)},t.prototype.includesInvalidEdge=function(){for(var r,a=this.edges.length,u=0;u<a;u++)if(r=this.edges[u],this.isOneAncestorOfOther(r.source,r.target))return!0;return!1},m.exports=t}),(function(m,M,v){"use strict";var n=v(0);function e(){}A(e,"FDLayoutConstants");for(var t in n)e[t]=n[t];e.MAX_ITERATIONS=2500,e.DEFAULT_EDGE_LENGTH=50,e.DEFAULT_SPRING_STRENGTH=.45,e.DEFAULT_REPULSION_STRENGTH=4500,e.DEFAULT_GRAVITY_STRENGTH=.4,e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,e.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,e.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,e.COOLING_ADAPTATION_FACTOR=.33,e.ADAPTATION_LOWER_NODE_LIMIT=1e3,e.ADAPTATION_UPPER_NODE_LIMIT=5e3,e.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,e.MAX_NODE_DISPLACEMENT=e.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,e.MIN_REPULSION_DIST=e.DEFAULT_EDGE_LENGTH/10,e.CONVERGENCE_CHECK_PERIOD=100,e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,e.MIN_EDGE_LENGTH=1,e.GRID_CALCULATION_CHECK_PERIOD=10,m.exports=e}),(function(m,M,v){"use strict";var n=v(12);function e(){}A(e,"IGeometry"),e.calcSeparationAmount=function(t,r,a,u){if(!t.intersects(r))throw"assert failed";var o=new Array(2);this.decideDirectionsForOverlappingNodes(t,r,o),a[0]=Math.min(t.getRight(),r.getRight())-Math.max(t.x,r.x),a[1]=Math.min(t.getBottom(),r.getBottom())-Math.max(t.y,r.y),t.getX()<=r.getX()&&t.getRight()>=r.getRight()?a[0]+=Math.min(r.getX()-t.getX(),t.getRight()-r.getRight()):r.getX()<=t.getX()&&r.getRight()>=t.getRight()&&(a[0]+=Math.min(t.getX()-r.getX(),r.getRight()-t.getRight())),t.getY()<=r.getY()&&t.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-t.getY(),t.getBottom()-r.getBottom()):r.getY()<=t.getY()&&r.getBottom()>=t.getBottom()&&(a[1]+=Math.min(t.getY()-r.getY(),r.getBottom()-t.getBottom()));var p=Math.abs((r.getCenterY()-t.getCenterY())/(r.getCenterX()-t.getCenterX()));r.getCenterY()===t.getCenterY()&&r.getCenterX()===t.getCenterX()&&(p=1);var i=p*a[0],h=a[1]/p;a[0]<h?h=a[0]:i=a[1],a[0]=-1*o[0]*(h/2+u),a[1]=-1*o[1]*(i/2+u)},e.decideDirectionsForOverlappingNodes=function(t,r,a){t.getCenterX()<r.getCenterX()?a[0]=-1:a[0]=1,t.getCenterY()<r.getCenterY()?a[1]=-1:a[1]=1},e.getIntersection2=function(t,r,a){var u=t.getCenterX(),o=t.getCenterY(),p=r.getCenterX(),i=r.getCenterY();if(t.intersects(r))return a[0]=u,a[1]=o,a[2]=p,a[3]=i,!0;var h=t.getX(),l=t.getY(),d=t.getRight(),y=t.getX(),T=t.getBottom(),c=t.getRight(),D=t.getWidthHalf(),E=t.getHeightHalf(),O=r.getX(),s=r.getY(),g=r.getRight(),f=r.getX(),L=r.getBottom(),N=r.getRight(),I=r.getWidthHalf(),R=r.getHeightHalf(),C=!1,G=!1;if(u===p){if(o>i)return a[0]=u,a[1]=l,a[2]=p,a[3]=L,!1;if(o<i)return a[0]=u,a[1]=T,a[2]=p,a[3]=s,!1}else if(o===i){if(u>p)return a[0]=h,a[1]=o,a[2]=g,a[3]=i,!1;if(u<p)return a[0]=d,a[1]=o,a[2]=O,a[3]=i,!1}else{var S=t.height/t.width,_=r.height/r.width,F=(i-o)/(p-u),w=void 0,x=void 0,P=void 0,Y=void 0,X=void 0,U=void 0;if(-S===F?u>p?(a[0]=y,a[1]=T,C=!0):(a[0]=d,a[1]=l,C=!0):S===F&&(u>p?(a[0]=h,a[1]=l,C=!0):(a[0]=c,a[1]=T,C=!0)),-_===F?p>u?(a[2]=f,a[3]=L,G=!0):(a[2]=g,a[3]=s,G=!0):_===F&&(p>u?(a[2]=O,a[3]=s,G=!0):(a[2]=N,a[3]=L,G=!0)),C&&G)return!1;if(u>p?o>i?(w=this.getCardinalDirection(S,F,4),x=this.getCardinalDirection(_,F,2)):(w=this.getCardinalDirection(-S,F,3),x=this.getCardinalDirection(-_,F,1)):o>i?(w=this.getCardinalDirection(-S,F,1),x=this.getCardinalDirection(-_,F,3)):(w=this.getCardinalDirection(S,F,2),x=this.getCardinalDirection(_,F,4)),!C)switch(w){case 1:Y=l,P=u+-E/F,a[0]=P,a[1]=Y;break;case 2:P=c,Y=o+D*F,a[0]=P,a[1]=Y;break;case 3:Y=T,P=u+E/F,a[0]=P,a[1]=Y;break;case 4:P=y,Y=o+-D*F,a[0]=P,a[1]=Y;break}if(!G)switch(x){case 1:U=s,X=p+-R/F,a[2]=X,a[3]=U;break;case 2:X=N,U=i+I*F,a[2]=X,a[3]=U;break;case 3:U=L,X=p+R/F,a[2]=X,a[3]=U;break;case 4:X=f,U=i+-I*F,a[2]=X,a[3]=U;break}}return!1},e.getCardinalDirection=function(t,r,a){return t>r?a:1+a%4},e.getIntersection=function(t,r,a,u){if(u==null)return this.getIntersection2(t,r,a);var o=t.x,p=t.y,i=r.x,h=r.y,l=a.x,d=a.y,y=u.x,T=u.y,c=void 0,D=void 0,E=void 0,O=void 0,s=void 0,g=void 0,f=void 0,L=void 0,N=void 0;return E=h-p,s=o-i,f=i*p-o*h,O=T-d,g=l-y,L=y*d-l*T,N=E*g-O*s,N===0?null:(c=(s*L-g*f)/N,D=(O*f-E*L)/N,new n(c,D))},e.angleOfVector=function(t,r,a,u){var o=void 0;return t!==a?(o=Math.atan((u-r)/(a-t)),a<t?o+=Math.PI:u<r&&(o+=this.TWO_PI)):u<r?o=this.ONE_AND_HALF_PI:o=this.HALF_PI,o},e.doIntersect=function(t,r,a,u){var o=t.x,p=t.y,i=r.x,h=r.y,l=a.x,d=a.y,y=u.x,T=u.y,c=(i-o)*(T-d)-(y-l)*(h-p);if(c===0)return!1;var D=((T-d)*(y-o)+(l-y)*(T-p))/c,E=((p-h)*(y-o)+(i-o)*(T-p))/c;return 0<D&&D<1&&0<E&&E<1},e.HALF_PI=.5*Math.PI,e.ONE_AND_HALF_PI=1.5*Math.PI,e.TWO_PI=2*Math.PI,e.THREE_PI=3*Math.PI,m.exports=e}),(function(m,M,v){"use strict";function n(){}A(n,"IMath"),n.sign=function(e){return e>0?1:e<0?-1:0},n.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},n.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},m.exports=n}),(function(m,M,v){"use strict";function n(){}A(n,"Integer"),n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,m.exports=n}),(function(m,M,v){"use strict";var n=(function(){function o(p,i){for(var h=0;h<i.length;h++){var l=i[h];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(p,l.key,l)}}return A(o,"defineProperties"),function(p,i,h){return i&&o(p.prototype,i),h&&o(p,h),p}})();function e(o,p){if(!(o instanceof p))throw new TypeError("Cannot call a class as a function")}A(e,"_classCallCheck");var t=A(function(p){return{value:p,next:null,prev:null}},"nodeFrom"),r=A(function(p,i,h,l){return p!==null?p.next=i:l.head=i,h!==null?h.prev=i:l.tail=i,i.prev=p,i.next=h,l.length++,i},"add"),a=A(function(p,i){var h=p.prev,l=p.next;return h!==null?h.next=l:i.head=l,l!==null?l.prev=h:i.tail=h,p.prev=p.next=null,i.length--,p},"_remove"),u=(function(){function o(p){var i=this;e(this,o),this.length=0,this.head=null,this.tail=null,p?.forEach(function(h){return i.push(h)})}return A(o,"LinkedList"),n(o,[{key:"size",value:A(function(){return this.length},"size")},{key:"insertBefore",value:A(function(i,h){return r(h.prev,t(i),h,this)},"insertBefore")},{key:"insertAfter",value:A(function(i,h){return r(h,t(i),h.next,this)},"insertAfter")},{key:"insertNodeBefore",value:A(function(i,h){return r(h.prev,i,h,this)},"insertNodeBefore")},{key:"insertNodeAfter",value:A(function(i,h){return r(h,i,h.next,this)},"insertNodeAfter")},{key:"push",value:A(function(i){return r(this.tail,t(i),null,this)},"push")},{key:"unshift",value:A(function(i){return r(null,t(i),this.head,this)},"unshift")},{key:"remove",value:A(function(i){return a(i,this)},"remove")},{key:"pop",value:A(function(){return a(this.tail,this).value},"pop")},{key:"popNode",value:A(function(){return a(this.tail,this)},"popNode")},{key:"shift",value:A(function(){return a(this.head,this).value},"shift")},{key:"shiftNode",value:A(function(){return a(this.head,this)},"shiftNode")},{key:"get_object_at",value:A(function(i){if(i<=this.length()){for(var h=1,l=this.head;h<i;)l=l.next,h++;return l.value}},"get_object_at")},{key:"set_object_at",value:A(function(i,h){if(i<=this.length()){for(var l=1,d=this.head;l<i;)d=d.next,l++;d.value=h}},"set_object_at")}]),o})();m.exports=u}),(function(m,M,v){"use strict";function n(e,t,r){this.x=null,this.y=null,e==null&&t==null&&r==null?(this.x=0,this.y=0):typeof e=="number"&&typeof t=="number"&&r==null?(this.x=e,this.y=t):e.constructor.name=="Point"&&t==null&&r==null&&(r=e,this.x=r.x,this.y=r.y)}A(n,"Point"),n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.getLocation=function(){return new n(this.x,this.y)},n.prototype.setLocation=function(e,t,r){e.constructor.name=="Point"&&t==null&&r==null?(r=e,this.setLocation(r.x,r.y)):typeof e=="number"&&typeof t=="number"&&r==null&&(parseInt(e)==e&&parseInt(t)==t?this.move(e,t):(this.x=Math.floor(e+.5),this.y=Math.floor(t+.5)))},n.prototype.move=function(e,t){this.x=e,this.y=t},n.prototype.translate=function(e,t){this.x+=e,this.y+=t},n.prototype.equals=function(e){if(e.constructor.name=="Point"){var t=e;return this.x==t.x&&this.y==t.y}return this==e},n.prototype.toString=function(){return new n().constructor.name+"[x="+this.x+",y="+this.y+"]"},m.exports=n}),(function(m,M,v){"use strict";function n(e,t,r,a){this.x=0,this.y=0,this.width=0,this.height=0,e!=null&&t!=null&&r!=null&&a!=null&&(this.x=e,this.y=t,this.width=r,this.height=a)}A(n,"RectangleD"),n.prototype.getX=function(){return this.x},n.prototype.setX=function(e){this.x=e},n.prototype.getY=function(){return this.y},n.prototype.setY=function(e){this.y=e},n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(e){this.width=e},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(e){this.height=e},n.prototype.getRight=function(){return this.x+this.width},n.prototype.getBottom=function(){return this.y+this.height},n.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},n.prototype.getCenterX=function(){return this.x+this.width/2},n.prototype.getMinX=function(){return this.getX()},n.prototype.getMaxX=function(){return this.getX()+this.width},n.prototype.getCenterY=function(){return this.y+this.height/2},n.prototype.getMinY=function(){return this.getY()},n.prototype.getMaxY=function(){return this.getY()+this.height},n.prototype.getWidthHalf=function(){return this.width/2},n.prototype.getHeightHalf=function(){return this.height/2},m.exports=n}),(function(m,M,v){"use strict";var n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function e(){}A(e,"UniqueIDGeneretor"),e.lastID=0,e.createID=function(t){return e.isPrimitive(t)?t:(t.uniqueID!=null||(t.uniqueID=e.getString(),e.lastID++),t.uniqueID)},e.getString=function(t){return t==null&&(t=e.lastID),"Object#"+t},e.isPrimitive=function(t){var r=typeof t>"u"?"undefined":n(t);return t==null||r!="object"&&r!="function"},m.exports=e}),(function(m,M,v){"use strict";function n(l){if(Array.isArray(l)){for(var d=0,y=Array(l.length);d<l.length;d++)y[d]=l[d];return y}else return Array.from(l)}A(n,"_toConsumableArray");var e=v(0),t=v(6),r=v(3),a=v(1),u=v(5),o=v(4),p=v(17),i=v(27);function h(l){i.call(this),this.layoutQuality=e.QUALITY,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=e.DEFAULT_INCREMENTAL,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new t(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,l!=null&&(this.isRemoteUse=l)}A(h,"Layout"),h.RANDOM_SEED=1,h.prototype=Object.create(i.prototype),h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},h.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},h.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},h.prototype.newGraphManager=function(){var l=new t(this);return this.graphManager=l,l},h.prototype.newGraph=function(l){return new u(null,this.graphManager,l)},h.prototype.newNode=function(l){return new r(this.graphManager,l)},h.prototype.newEdge=function(l){return new a(null,null,l)},h.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},h.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var l;return this.checkLayoutSuccess()?l=!1:l=this.layout(),e.ANIMATE==="during"?!1:(l&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,l)},h.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},h.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var l,d=this.graphManager.getAllEdges(),y=0;y<d.length;y++)l=d[y];for(var T,c=this.graphManager.getRoot().getNodes(),y=0;y<c.length;y++)T=c[y];this.update(this.graphManager.getRoot())}},h.prototype.update=function(l){if(l==null)this.update2();else if(l instanceof r){var d=l;if(d.getChild()!=null)for(var y=d.getChild().getNodes(),T=0;T<y.length;T++)update(y[T]);if(d.vGraphObject!=null){var c=d.vGraphObject;c.update(d)}}else if(l instanceof a){var D=l;if(D.vGraphObject!=null){var E=D.vGraphObject;E.update(D)}}else if(l instanceof u){var O=l;if(O.vGraphObject!=null){var s=O.vGraphObject;s.update(O)}}},h.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=e.QUALITY,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=e.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},h.prototype.transform=function(l){if(l==null)this.transform(new o(0,0));else{var d=new p,y=this.graphManager.getRoot().updateLeftTop();if(y!=null){d.setWorldOrgX(l.x),d.setWorldOrgY(l.y),d.setDeviceOrgX(y.x),d.setDeviceOrgY(y.y);for(var T=this.getAllNodes(),c,D=0;D<T.length;D++)c=T[D],c.transform(d)}}},h.prototype.positionNodesRandomly=function(l){if(l==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var d,y,T=l.getNodes(),c=0;c<T.length;c++)d=T[c],y=d.getChild(),y==null||y.getNodes().length==0?d.scatter():(this.positionNodesRandomly(y),d.updateBounds())},h.prototype.getFlatForest=function(){for(var l=[],d=!0,y=this.graphManager.getRoot().getNodes(),T=!0,c=0;c<y.length;c++)y[c].getChild()!=null&&(T=!1);if(!T)return l;var D=new Set,E=[],O=new Map,s=[];for(s=s.concat(y);s.length>0&&d;){for(E.push(s[0]);E.length>0&&d;){var g=E[0];E.splice(0,1),D.add(g);for(var f=g.getEdges(),c=0;c<f.length;c++){var L=f[c].getOtherEnd(g);if(O.get(g)!=L)if(!D.has(L))E.push(L),O.set(L,g);else{d=!1;break}}}if(!d)l=[];else{var N=[].concat(n(D));l.push(N);for(var c=0;c<N.length;c++){var I=N[c],R=s.indexOf(I);R>-1&&s.splice(R,1)}D=new Set,O=new Map}}return l},h.prototype.createDummyNodesForBendpoints=function(l){for(var d=[],y=l.source,T=this.graphManager.calcLowestCommonAncestor(l.source,l.target),c=0;c<l.bendpoints.length;c++){var D=this.newNode(null);D.setRect(new Point(0,0),new Dimension(1,1)),T.add(D);var E=this.newEdge(null);this.graphManager.add(E,y,D),d.add(D),y=D}var E=this.newEdge(null);return this.graphManager.add(E,y,l.target),this.edgeToDummyNodes.set(l,d),l.isInterGraph()?this.graphManager.remove(l):T.remove(l),d},h.prototype.createBendpointsFromDummyNodes=function(){var l=[];l=l.concat(this.graphManager.getAllEdges()),l=[].concat(n(this.edgeToDummyNodes.keys())).concat(l);for(var d=0;d<l.length;d++){var y=l[d];if(y.bendpoints.length>0){for(var T=this.edgeToDummyNodes.get(y),c=0;c<T.length;c++){var D=T[c],E=new o(D.getCenterX(),D.getCenterY()),O=y.bendpoints.get(c);O.x=E.x,O.y=E.y,D.getOwner().remove(D)}this.graphManager.add(y,y.source,y.target)}}},h.transform=function(l,d,y,T){if(y!=null&&T!=null){var c=d;if(l<=50){var D=d/y;c-=(d-D)/50*(50-l)}else{var E=d*T;c+=(E-d)/50*(l-50)}return c}else{var O,s;return l<=50?(O=9*d/500,s=d/10):(O=9*d/50,s=-8*d),O*l+s}},h.findCenterOfTree=function(l){var d=[];d=d.concat(l);var y=[],T=new Map,c=!1,D=null;(d.length==1||d.length==2)&&(c=!0,D=d[0]);for(var E=0;E<d.length;E++){var O=d[E],s=O.getNeighborsList().size;T.set(O,O.getNeighborsList().size),s==1&&y.push(O)}var g=[];for(g=g.concat(y);!c;){var f=[];f=f.concat(g),g=[];for(var E=0;E<d.length;E++){var O=d[E],L=d.indexOf(O);L>=0&&d.splice(L,1);var N=O.getNeighborsList();N.forEach(function(C){if(y.indexOf(C)<0){var G=T.get(C),S=G-1;S==1&&g.push(C),T.set(C,S)}})}y=y.concat(g),(d.length==1||d.length==2)&&(c=!0,D=d[0])}return D},h.prototype.setGraphManager=function(l){this.graphManager=l},m.exports=h}),(function(m,M,v){"use strict";function n(){}A(n,"RandomSeed"),n.seed=1,n.x=0,n.nextDouble=function(){return n.x=Math.sin(n.seed++)*1e4,n.x-Math.floor(n.x)},m.exports=n}),(function(m,M,v){"use strict";var n=v(4);function e(t,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}A(e,"Transform"),e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/a),r},e.prototype.transformY=function(t){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/a),r},e.prototype.inverseTransformX=function(t){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/a),r},e.prototype.inverseTransformY=function(t){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/a),r},e.prototype.inverseTransformPoint=function(t){var r=new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return r},m.exports=e}),(function(m,M,v){"use strict";function n(i){if(Array.isArray(i)){for(var h=0,l=Array(i.length);h<i.length;h++)l[h]=i[h];return l}else return Array.from(i)}A(n,"_toConsumableArray");var e=v(15),t=v(7),r=v(0),a=v(8),u=v(9);function o(){e.call(this),this.useSmartIdealEdgeLengthCalculation=t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=t.DEFAULT_EDGE_LENGTH,this.springConstant=t.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=t.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=t.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=t.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*t.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=t.MAX_ITERATIONS}A(o,"FDLayout"),o.prototype=Object.create(e.prototype);for(var p in e)o[p]=e[p];o.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},o.prototype.calcIdealEdgeLengths=function(){for(var i,h,l,d,y,T,c=this.getGraphManager().getAllEdges(),D=0;D<c.length;D++)i=c[D],i.idealLength=this.idealEdgeLength,i.isInterGraph&&(l=i.getSource(),d=i.getTarget(),y=i.getSourceInLca().getEstimatedSize(),T=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(i.idealLength+=y+T-2*r.SIMPLE_NODE_SIZE),h=i.getLca().getInclusionTreeDepth(),i.idealLength+=t.DEFAULT_EDGE_LENGTH*t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(l.getInclusionTreeDepth()+d.getInclusionTreeDepth()-2*h))},o.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;this.incremental?(i>t.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(i>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(i-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},o.prototype.calcSpringForces=function(){for(var i=this.getAllEdges(),h,l=0;l<i.length;l++)h=i[l],this.calcSpringForce(h,h.idealLength)},o.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l,d,y,T,c=this.getAllNodes(),D;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&i&&this.updateGrid(),D=new Set,l=0;l<c.length;l++)y=c[l],this.calculateRepulsionForceOfANode(y,D,i,h),D.add(y);else for(l=0;l<c.length;l++)for(y=c[l],d=l+1;d<c.length;d++)T=c[d],y.getOwner()==T.getOwner()&&this.calcRepulsionForce(y,T)},o.prototype.calcGravitationalForces=function(){for(var i,h=this.getAllNodesToApplyGravitation(),l=0;l<h.length;l++)i=h[l],this.calcGravitationalForce(i)},o.prototype.moveNodes=function(){for(var i=this.getAllNodes(),h,l=0;l<i.length;l++)h=i[l],h.move()},o.prototype.calcSpringForce=function(i,h){var l=i.getSource(),d=i.getTarget(),y,T,c,D;if(this.uniformLeafNodeSizes&&l.getChild()==null&&d.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;y=i.getLength(),y!=0&&(T=this.springConstant*(y-h),c=T*(i.lengthX/y),D=T*(i.lengthY/y),l.springForceX+=c,l.springForceY+=D,d.springForceX-=c,d.springForceY-=D)},o.prototype.calcRepulsionForce=function(i,h){var l=i.getRect(),d=h.getRect(),y=new Array(2),T=new Array(4),c,D,E,O,s,g,f;if(l.intersects(d)){a.calcSeparationAmount(l,d,y,t.DEFAULT_EDGE_LENGTH/2),g=2*y[0],f=2*y[1];var L=i.noOfChildren*h.noOfChildren/(i.noOfChildren+h.noOfChildren);i.repulsionForceX-=L*g,i.repulsionForceY-=L*f,h.repulsionForceX+=L*g,h.repulsionForceY+=L*f}else this.uniformLeafNodeSizes&&i.getChild()==null&&h.getChild()==null?(c=d.getCenterX()-l.getCenterX(),D=d.getCenterY()-l.getCenterY()):(a.getIntersection(l,d,T),c=T[2]-T[0],D=T[3]-T[1]),Math.abs(c)<t.MIN_REPULSION_DIST&&(c=u.sign(c)*t.MIN_REPULSION_DIST),Math.abs(D)<t.MIN_REPULSION_DIST&&(D=u.sign(D)*t.MIN_REPULSION_DIST),E=c*c+D*D,O=Math.sqrt(E),s=this.repulsionConstant*i.noOfChildren*h.noOfChildren/E,g=s*c/O,f=s*D/O,i.repulsionForceX-=g,i.repulsionForceY-=f,h.repulsionForceX+=g,h.repulsionForceY+=f},o.prototype.calcGravitationalForce=function(i){var h,l,d,y,T,c,D,E;h=i.getOwner(),l=(h.getRight()+h.getLeft())/2,d=(h.getTop()+h.getBottom())/2,y=i.getCenterX()-l,T=i.getCenterY()-d,c=Math.abs(y)+i.getWidth()/2,D=Math.abs(T)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()?(E=h.getEstimatedSize()*this.gravityRangeFactor,(c>E||D>E)&&(i.gravitationForceX=-this.gravityConstant*y,i.gravitationForceY=-this.gravityConstant*T)):(E=h.getEstimatedSize()*this.compoundGravityRangeFactor,(c>E||D>E)&&(i.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},o.prototype.isConverged=function(){var i,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||h},o.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},o.prototype.calcNoOfChildrenForAllNodes=function(){for(var i,h=this.graphManager.getAllNodes(),l=0;l<h.length;l++)i=h[l],i.noOfChildren=i.getNoOfChildren()},o.prototype.calcGrid=function(i){var h=0,l=0;h=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),l=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));for(var d=new Array(h),y=0;y<h;y++)d[y]=new Array(l);for(var y=0;y<h;y++)for(var T=0;T<l;T++)d[y][T]=new Array;return d},o.prototype.addNodeToGrid=function(i,h,l){var d=0,y=0,T=0,c=0;d=parseInt(Math.floor((i.getRect().x-h)/this.repulsionRange)),y=parseInt(Math.floor((i.getRect().width+i.getRect().x-h)/this.repulsionRange)),T=parseInt(Math.floor((i.getRect().y-l)/this.repulsionRange)),c=parseInt(Math.floor((i.getRect().height+i.getRect().y-l)/this.repulsionRange));for(var D=d;D<=y;D++)for(var E=T;E<=c;E++)this.grid[D][E].push(i),i.setGridCoordinates(d,y,T,c)},o.prototype.updateGrid=function(){var i,h,l=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),i=0;i<l.length;i++)h=l[i],this.addNodeToGrid(h,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},o.prototype.calculateRepulsionForceOfANode=function(i,h,l,d){if(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&l||d){var y=new Set;i.surrounding=new Array;for(var T,c=this.grid,D=i.startX-1;D<i.finishX+2;D++)for(var E=i.startY-1;E<i.finishY+2;E++)if(!(D<0||E<0||D>=c.length||E>=c[0].length)){for(var O=0;O<c[D][E].length;O++)if(T=c[D][E][O],!(i.getOwner()!=T.getOwner()||i==T)&&!h.has(T)&&!y.has(T)){var s=Math.abs(i.getCenterX()-T.getCenterX())-(i.getWidth()/2+T.getWidth()/2),g=Math.abs(i.getCenterY()-T.getCenterY())-(i.getHeight()/2+T.getHeight()/2);s<=this.repulsionRange&&g<=this.repulsionRange&&y.add(T)}}i.surrounding=[].concat(n(y))}for(D=0;D<i.surrounding.length;D++)this.calcRepulsionForce(i,i.surrounding[D])},o.prototype.calcRepulsionRange=function(){return 0},m.exports=o}),(function(m,M,v){"use strict";var n=v(1),e=v(7);function t(a,u,o){n.call(this,a,u,o),this.idealLength=e.DEFAULT_EDGE_LENGTH}A(t,"FDLayoutEdge"),t.prototype=Object.create(n.prototype);for(var r in n)t[r]=n[r];m.exports=t}),(function(m,M,v){"use strict";var n=v(3);function e(r,a,u,o){n.call(this,r,a,u,o),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}A(e,"FDLayoutNode"),e.prototype=Object.create(n.prototype);for(var t in n)e[t]=n[t];e.prototype.setGridCoordinates=function(r,a,u,o){this.startX=r,this.finishX=a,this.startY=u,this.finishY=o},m.exports=e}),(function(m,M,v){"use strict";function n(e,t){this.width=0,this.height=0,e!==null&&t!==null&&(this.height=t,this.width=e)}A(n,"DimensionD"),n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(e){this.width=e},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(e){this.height=e},m.exports=n}),(function(m,M,v){"use strict";var n=v(14);function e(){this.map={},this.keys=[]}A(e,"HashMap"),e.prototype.put=function(t,r){var a=n.createID(t);this.contains(a)||(this.map[a]=r,this.keys.push(t))},e.prototype.contains=function(t){var r=n.createID(t);return this.map[t]!=null},e.prototype.get=function(t){var r=n.createID(t);return this.map[r]},e.prototype.keySet=function(){return this.keys},m.exports=e}),(function(m,M,v){"use strict";var n=v(14);function e(){this.set={}}A(e,"HashSet"),e.prototype.add=function(t){var r=n.createID(t);this.contains(r)||(this.set[r]=t)},e.prototype.remove=function(t){delete this.set[n.createID(t)]},e.prototype.clear=function(){this.set={}},e.prototype.contains=function(t){return this.set[n.createID(t)]==t},e.prototype.isEmpty=function(){return this.size()===0},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAllTo=function(t){for(var r=Object.keys(this.set),a=r.length,u=0;u<a;u++)t.push(this.set[r[u]])},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAll=function(t){for(var r=t.length,a=0;a<r;a++){var u=t[a];this.add(u)}},m.exports=e}),(function(m,M,v){"use strict";var n=(function(){function a(u,o){for(var p=0;p<o.length;p++){var i=o[p];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}return A(a,"defineProperties"),function(u,o,p){return o&&a(u.prototype,o),p&&a(u,p),u}})();function e(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")}A(e,"_classCallCheck");var t=v(11),r=(function(){function a(u,o){e(this,a),(o!==null||o!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var p=void 0;u instanceof t?p=u.size():p=u.length,this._quicksort(u,0,p-1)}return A(a,"Quicksort"),n(a,[{key:"_quicksort",value:A(function(o,p,i){if(p<i){var h=this._partition(o,p,i);this._quicksort(o,p,h),this._quicksort(o,h+1,i)}},"_quicksort")},{key:"_partition",value:A(function(o,p,i){for(var h=this._get(o,p),l=p,d=i;;){for(;this.compareFunction(h,this._get(o,d));)d--;for(;this.compareFunction(this._get(o,l),h);)l++;if(l<d)this._swap(o,l,d),l++,d--;else return d}},"_partition")},{key:"_get",value:A(function(o,p){return o instanceof t?o.get_object_at(p):o[p]},"_get")},{key:"_set",value:A(function(o,p,i){o instanceof t?o.set_object_at(p,i):o[p]=i},"_set")},{key:"_swap",value:A(function(o,p,i){var h=this._get(o,p);this._set(o,p,this._get(o,i)),this._set(o,i,h)},"_swap")},{key:"_defaultCompareFunction",value:A(function(o,p){return p>o},"_defaultCompareFunction")}]),a})();m.exports=r}),(function(m,M,v){"use strict";var n=(function(){function r(a,u){for(var o=0;o<u.length;o++){var p=u[o];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(a,p.key,p)}}return A(r,"defineProperties"),function(a,u,o){return u&&r(a.prototype,u),o&&r(a,o),a}})();function e(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}A(e,"_classCallCheck");var t=(function(){function r(a,u){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,r),this.sequence1=a,this.sequence2=u,this.match_score=o,this.mismatch_penalty=p,this.gap_penalty=i,this.iMax=a.length+1,this.jMax=u.length+1,this.grid=new Array(this.iMax);for(var h=0;h<this.iMax;h++){this.grid[h]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[h][l]=0}this.tracebackGrid=new Array(this.iMax);for(var d=0;d<this.iMax;d++){this.tracebackGrid[d]=new Array(this.jMax);for(var y=0;y<this.jMax;y++)this.tracebackGrid[d][y]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return A(r,"NeedlemanWunsch"),n(r,[{key:"getScore",value:A(function(){return this.score},"getScore")},{key:"getAlignments",value:A(function(){return this.alignments},"getAlignments")},{key:"computeGrids",value:A(function(){for(var u=1;u<this.jMax;u++)this.grid[0][u]=this.grid[0][u-1]+this.gap_penalty,this.tracebackGrid[0][u]=[!1,!1,!0];for(var o=1;o<this.iMax;o++)this.grid[o][0]=this.grid[o-1][0]+this.gap_penalty,this.tracebackGrid[o][0]=[!1,!0,!1];for(var p=1;p<this.iMax;p++)for(var i=1;i<this.jMax;i++){var h=void 0;this.sequence1[p-1]===this.sequence2[i-1]?h=this.grid[p-1][i-1]+this.match_score:h=this.grid[p-1][i-1]+this.mismatch_penalty;var l=this.grid[p-1][i]+this.gap_penalty,d=this.grid[p][i-1]+this.gap_penalty,y=[h,l,d],T=this.arrayAllMaxIndexes(y);this.grid[p][i]=y[T[0]],this.tracebackGrid[p][i]=[T.includes(0),T.includes(1),T.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]},"computeGrids")},{key:"alignmentTraceback",value:A(function(){var u=[];for(u.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});u[0];){var o=u[0],p=this.tracebackGrid[o.pos[0]][o.pos[1]];p[0]&&u.push({pos:[o.pos[0]-1,o.pos[1]-1],seq1:this.sequence1[o.pos[0]-1]+o.seq1,seq2:this.sequence2[o.pos[1]-1]+o.seq2}),p[1]&&u.push({pos:[o.pos[0]-1,o.pos[1]],seq1:this.sequence1[o.pos[0]-1]+o.seq1,seq2:"-"+o.seq2}),p[2]&&u.push({pos:[o.pos[0],o.pos[1]-1],seq1:"-"+o.seq1,seq2:this.sequence2[o.pos[1]-1]+o.seq2}),o.pos[0]===0&&o.pos[1]===0&&this.alignments.push({sequence1:o.seq1,sequence2:o.seq2}),u.shift()}return this.alignments},"alignmentTraceback")},{key:"getAllIndexes",value:A(function(u,o){for(var p=[],i=-1;(i=u.indexOf(o,i+1))!==-1;)p.push(i);return p},"getAllIndexes")},{key:"arrayAllMaxIndexes",value:A(function(u){return this.getAllIndexes(u,Math.max.apply(null,u))},"arrayAllMaxIndexes")}]),r})();m.exports=t}),(function(m,M,v){"use strict";var n=A(function(){},"layoutBase");n.FDLayout=v(18),n.FDLayoutConstants=v(7),n.FDLayoutEdge=v(19),n.FDLayoutNode=v(20),n.DimensionD=v(21),n.HashMap=v(22),n.HashSet=v(23),n.IGeometry=v(8),n.IMath=v(9),n.Integer=v(10),n.Point=v(12),n.PointD=v(4),n.RandomSeed=v(16),n.RectangleD=v(13),n.Transform=v(17),n.UniqueIDGeneretor=v(14),n.Quicksort=v(24),n.LinkedList=v(11),n.LGraphObject=v(2),n.LGraph=v(5),n.LEdge=v(1),n.LGraphManager=v(6),n.LNode=v(3),n.Layout=v(15),n.LayoutConstants=v(0),n.NeedlemanWunsch=v(25),m.exports=n}),(function(m,M,v){"use strict";function n(){this.listeners=[]}A(n,"Emitter");var e=n.prototype;e.addListener=function(t,r){this.listeners.push({event:t,callback:r})},e.removeListener=function(t,r){for(var a=this.listeners.length;a>=0;a--){var u=this.listeners[a];u.event===t&&u.callback===r&&this.listeners.splice(a,1)}},e.emit=function(t,r){for(var a=0;a<this.listeners.length;a++){var u=this.listeners[a];t===u.event&&u.callback(r)}},m.exports=n})])})});var J=Q((Z,z)=>{"use strict";A((function(M,v){typeof Z=="object"&&typeof z=="object"?z.exports=v(q()):typeof define=="function"&&define.amd?define(["layout-base"],v):typeof Z=="object"?Z.coseBase=v(q()):M.coseBase=v(M.layoutBase)}),"webpackUniversalModuleDefinition")(Z,function(m){return(function(M){var v={};function n(e){if(v[e])return v[e].exports;var t=v[e]={i:e,l:!1,exports:{}};return M[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return A(n,"__webpack_require__"),n.m=M,n.c=v,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?A(function(){return e.default},"getDefault"):A(function(){return e},"getModuleExports");return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)})([(function(M,v){M.exports=m}),(function(M,v,n){"use strict";var e=n(0).FDLayoutConstants;function t(){}A(t,"CoSEConstants");for(var r in e)t[r]=e[r];t.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,t.DEFAULT_RADIAL_SEPARATION=e.DEFAULT_EDGE_LENGTH,t.DEFAULT_COMPONENT_SEPERATION=60,t.TILE=!0,t.TILING_PADDING_VERTICAL=10,t.TILING_PADDING_HORIZONTAL=10,t.TREE_REDUCTION_ON_INCREMENTAL=!1,M.exports=t}),(function(M,v,n){"use strict";var e=n(0).FDLayoutEdge;function t(a,u,o){e.call(this,a,u,o)}A(t,"CoSEEdge"),t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];M.exports=t}),(function(M,v,n){"use strict";var e=n(0).LGraph;function t(a,u,o){e.call(this,a,u,o)}A(t,"CoSEGraph"),t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];M.exports=t}),(function(M,v,n){"use strict";var e=n(0).LGraphManager;function t(a){e.call(this,a)}A(t,"CoSEGraphManager"),t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];M.exports=t}),(function(M,v,n){"use strict";var e=n(0).FDLayoutNode,t=n(0).IMath;function r(u,o,p,i){e.call(this,u,o,p,i)}A(r,"CoSENode"),r.prototype=Object.create(e.prototype);for(var a in e)r[a]=e[a];r.prototype.move=function(){var u=this.graphManager.getLayout();this.displacementX=u.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=u.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>u.coolingFactor*u.maxNodeDisplacement&&(this.displacementX=u.coolingFactor*u.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>u.coolingFactor*u.maxNodeDisplacement&&(this.displacementY=u.coolingFactor*u.maxNodeDisplacement*t.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),u.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},r.prototype.propogateDisplacementToChildren=function(u,o){for(var p=this.getChild().getNodes(),i,h=0;h<p.length;h++)i=p[h],i.getChild()==null?(i.moveBy(u,o),i.displacementX+=u,i.displacementY+=o):i.propogateDisplacementToChildren(u,o)},r.prototype.setPred1=function(u){this.pred1=u},r.prototype.getPred1=function(){return pred1},r.prototype.getPred2=function(){return pred2},r.prototype.setNext=function(u){this.next=u},r.prototype.getNext=function(){return next},r.prototype.setProcessed=function(u){this.processed=u},r.prototype.isProcessed=function(){return processed},M.exports=r}),(function(M,v,n){"use strict";var e=n(0).FDLayout,t=n(4),r=n(3),a=n(5),u=n(2),o=n(1),p=n(0).FDLayoutConstants,i=n(0).LayoutConstants,h=n(0).Point,l=n(0).PointD,d=n(0).Layout,y=n(0).Integer,T=n(0).IGeometry,c=n(0).LGraph,D=n(0).Transform;function E(){e.call(this),this.toBeTiled={}}A(E,"CoSELayout"),E.prototype=Object.create(e.prototype);for(var O in e)E[O]=e[O];E.prototype.newGraphManager=function(){var s=new t(this);return this.graphManager=s,s},E.prototype.newGraph=function(s){return new r(null,this.graphManager,s)},E.prototype.newNode=function(s){return new a(this.graphManager,s)},E.prototype.newEdge=function(s){return new u(null,null,s)},E.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=p.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=p.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=p.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=p.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=p.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=p.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/p.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=p.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},E.prototype.layout=function(){var s=i.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},E.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(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var g=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(I){return g.has(I)});this.graphManager.setAllNodesToApplyGravitation(f)}}else{var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var g=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(L){return g.has(L)});this.graphManager.setAllNodesToApplyGravitation(f),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},E.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%p.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()),g=this.nodesWithGravity.filter(function(N){return s.has(N)});this.graphManager.setAllNodesToApplyGravitation(g),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=p.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=p.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var f=!this.isTreeGrowing&&!this.isGrowthFinished,L=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(f,L),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},E.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),g={},f=0;f<s.length;f++){var L=s[f].rect,N=s[f].id;g[N]={id:N,x:L.getCenterX(),y:L.getCenterY(),w:L.width,h:L.height}}return g},E.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(p.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},E.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],g,f=this.graphManager.getGraphs(),L=f.length,N;for(N=0;N<L;N++)g=f[N],g.updateConnected(),g.isConnected||(s=s.concat(g.getNodes()));return s},E.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var g=new Set,f;for(f=0;f<s.length;f++){var L=s[f];if(!g.has(L)){var N=L.getSource(),I=L.getTarget();if(N==I)L.getBendpoints().push(new l),L.getBendpoints().push(new l),this.createDummyNodesForBendpoints(L),g.add(L);else{var R=[];if(R=R.concat(N.getEdgeListToNode(I)),R=R.concat(I.getEdgeListToNode(N)),!g.has(R[0])){if(R.length>1){var C;for(C=0;C<R.length;C++){var G=R[C];G.getBendpoints().push(new l),this.createDummyNodesForBendpoints(G)}}R.forEach(function(S){g.add(S)})}}}if(g.size==s.length)break}},E.prototype.positionNodesRadially=function(s){for(var g=new h(0,0),f=Math.ceil(Math.sqrt(s.length)),L=0,N=0,I=0,R=new l(0,0),C=0;C<s.length;C++){C%f==0&&(I=0,N=L,C!=0&&(N+=o.DEFAULT_COMPONENT_SEPERATION),L=0);var G=s[C],S=d.findCenterOfTree(G);g.x=I,g.y=N,R=E.radialLayout(G,S,g),R.y>L&&(L=Math.floor(R.y)),I=Math.floor(R.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new l(i.WORLD_CENTER_X-R.x/2,i.WORLD_CENTER_Y-R.y/2))},E.radialLayout=function(s,g,f){var L=Math.max(this.maxDiagonalInTree(s),o.DEFAULT_RADIAL_SEPARATION);E.branchRadialLayout(g,null,0,359,0,L);var N=c.calculateBounds(s),I=new D;I.setDeviceOrgX(N.getMinX()),I.setDeviceOrgY(N.getMinY()),I.setWorldOrgX(f.x),I.setWorldOrgY(f.y);for(var R=0;R<s.length;R++){var C=s[R];C.transform(I)}var G=new l(N.getMaxX(),N.getMaxY());return I.inverseTransformPoint(G)},E.branchRadialLayout=function(s,g,f,L,N,I){var R=(L-f+1)/2;R<0&&(R+=180);var C=(R+f)%360,G=C*T.TWO_PI/360,S=Math.cos(G),_=N*Math.cos(G),F=N*Math.sin(G);s.setCenter(_,F);var w=[];w=w.concat(s.getEdges());var x=w.length;g!=null&&x--;for(var P=0,Y=w.length,X,U=s.getEdgesBetween(g);U.length>1;){var b=U[0];U.splice(0,1);var V=w.indexOf(b);V>=0&&w.splice(V,1),Y--,x--}g!=null?X=(w.indexOf(U[0])+1)%Y:X=0;for(var H=Math.abs(L-f)/x,W=X;P!=x;W=++W%Y){var et=w[W].getOtherEnd(s);if(et!=g){var rt=(f+P*H)%360,gt=(rt+H)%360;E.branchRadialLayout(et,s,rt,gt,N+I,I),P++}}},E.maxDiagonalInTree=function(s){for(var g=y.MIN_VALUE,f=0;f<s.length;f++){var L=s[f],N=L.getDiagonal();N>g&&(g=N)}return g},E.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},E.prototype.groupZeroDegreeMembers=function(){var s=this,g={};this.memberGroups={},this.idToDummyNode={};for(var f=[],L=this.graphManager.getAllNodes(),N=0;N<L.length;N++){var I=L[N],R=I.getParent();this.getNodeDegreeWithChildren(I)===0&&(R.id==null||!this.getToBeTiled(R))&&f.push(I)}for(var N=0;N<f.length;N++){var I=f[N],C=I.getParent().id;typeof g[C]>"u"&&(g[C]=[]),g[C]=g[C].concat(I)}Object.keys(g).forEach(function(G){if(g[G].length>1){var S="DummyCompound_"+G;s.memberGroups[S]=g[G];var _=g[G][0].getParent(),F=new a(s.graphManager);F.id=S,F.paddingLeft=_.paddingLeft||0,F.paddingRight=_.paddingRight||0,F.paddingBottom=_.paddingBottom||0,F.paddingTop=_.paddingTop||0,s.idToDummyNode[S]=F;var w=s.getGraphManager().add(s.newGraph(),F),x=_.getChild();x.add(F);for(var P=0;P<g[G].length;P++){var Y=g[G][P];x.remove(Y),w.add(Y)}}})},E.prototype.clearCompounds=function(){var s={},g={};this.performDFSOnCompounds();for(var f=0;f<this.compoundOrder.length;f++)g[this.compoundOrder[f].id]=this.compoundOrder[f],s[this.compoundOrder[f].id]=[].concat(this.compoundOrder[f].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[f].getChild()),this.compoundOrder[f].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,g)},E.prototype.clearZeroDegreeMembers=function(){var s=this,g=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(f){var L=s.idToDummyNode[f];g[f]=s.tileNodes(s.memberGroups[f],L.paddingLeft+L.paddingRight),L.rect.width=g[f].width,L.rect.height=g[f].height})},E.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var g=this.compoundOrder[s],f=g.id,L=g.paddingLeft,N=g.paddingTop;this.adjustLocations(this.tiledMemberPack[f],g.rect.x,g.rect.y,L,N)}},E.prototype.repopulateZeroDegreeMembers=function(){var s=this,g=this.tiledZeroDegreePack;Object.keys(g).forEach(function(f){var L=s.idToDummyNode[f],N=L.paddingLeft,I=L.paddingTop;s.adjustLocations(g[f],L.rect.x,L.rect.y,N,I)})},E.prototype.getToBeTiled=function(s){var g=s.id;if(this.toBeTiled[g]!=null)return this.toBeTiled[g];var f=s.getChild();if(f==null)return this.toBeTiled[g]=!1,!1;for(var L=f.getNodes(),N=0;N<L.length;N++){var I=L[N];if(this.getNodeDegree(I)>0)return this.toBeTiled[g]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[g]=!1,!1}return this.toBeTiled[g]=!0,!0},E.prototype.getNodeDegree=function(s){for(var g=s.id,f=s.getEdges(),L=0,N=0;N<f.length;N++){var I=f[N];I.getSource().id!==I.getTarget().id&&(L=L+1)}return L},E.prototype.getNodeDegreeWithChildren=function(s){var g=this.getNodeDegree(s);if(s.getChild()==null)return g;for(var f=s.getChild().getNodes(),L=0;L<f.length;L++){var N=f[L];g+=this.getNodeDegreeWithChildren(N)}return g},E.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},E.prototype.fillCompexOrderByDFS=function(s){for(var g=0;g<s.length;g++){var f=s[g];f.getChild()!=null&&this.fillCompexOrderByDFS(f.getChild().getNodes()),this.getToBeTiled(f)&&this.compoundOrder.push(f)}},E.prototype.adjustLocations=function(s,g,f,L,N){g+=L,f+=N;for(var I=g,R=0;R<s.rows.length;R++){var C=s.rows[R];g=I;for(var G=0,S=0;S<C.length;S++){var _=C[S];_.rect.x=g,_.rect.y=f,g+=_.rect.width+s.horizontalPadding,_.rect.height>G&&(G=_.rect.height)}f+=G+s.verticalPadding}},E.prototype.tileCompoundMembers=function(s,g){var f=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(L){var N=g[L];f.tiledMemberPack[L]=f.tileNodes(s[L],N.paddingLeft+N.paddingRight),N.rect.width=f.tiledMemberPack[L].width,N.rect.height=f.tiledMemberPack[L].height})},E.prototype.tileNodes=function(s,g){var f=o.TILING_PADDING_VERTICAL,L=o.TILING_PADDING_HORIZONTAL,N={rows:[],rowWidth:[],rowHeight:[],width:0,height:g,verticalPadding:f,horizontalPadding:L};s.sort(function(C,G){return C.rect.width*C.rect.height>G.rect.width*G.rect.height?-1:C.rect.width*C.rect.height<G.rect.width*G.rect.height?1:0});for(var I=0;I<s.length;I++){var R=s[I];N.rows.length==0?this.insertNodeToRow(N,R,0,g):this.canAddHorizontal(N,R.rect.width,R.rect.height)?this.insertNodeToRow(N,R,this.getShortestRowIndex(N),g):this.insertNodeToRow(N,R,N.rows.length,g),this.shiftToLastRow(N)}return N},E.prototype.insertNodeToRow=function(s,g,f,L){var N=L;if(f==s.rows.length){var I=[];s.rows.push(I),s.rowWidth.push(N),s.rowHeight.push(0)}var R=s.rowWidth[f]+g.rect.width;s.rows[f].length>0&&(R+=s.horizontalPadding),s.rowWidth[f]=R,s.width<R&&(s.width=R);var C=g.rect.height;f>0&&(C+=s.verticalPadding);var G=0;C>s.rowHeight[f]&&(G=s.rowHeight[f],s.rowHeight[f]=C,G=s.rowHeight[f]-G),s.height+=G,s.rows[f].push(g)},E.prototype.getShortestRowIndex=function(s){for(var g=-1,f=Number.MAX_VALUE,L=0;L<s.rows.length;L++)s.rowWidth[L]<f&&(g=L,f=s.rowWidth[L]);return g},E.prototype.getLongestRowIndex=function(s){for(var g=-1,f=Number.MIN_VALUE,L=0;L<s.rows.length;L++)s.rowWidth[L]>f&&(g=L,f=s.rowWidth[L]);return g},E.prototype.canAddHorizontal=function(s,g,f){var L=this.getShortestRowIndex(s);if(L<0)return!0;var N=s.rowWidth[L];if(N+s.horizontalPadding+g<=s.width)return!0;var I=0;s.rowHeight[L]<f&&L>0&&(I=f+s.verticalPadding-s.rowHeight[L]);var R;s.width-N>=g+s.horizontalPadding?R=(s.height+I)/(N+g+s.horizontalPadding):R=(s.height+I)/s.width,I=f+s.verticalPadding;var C;return s.width<g?C=(s.height+I)/g:C=(s.height+I)/s.width,C<1&&(C=1/C),R<1&&(R=1/R),R<C},E.prototype.shiftToLastRow=function(s){var g=this.getLongestRowIndex(s),f=s.rowWidth.length-1,L=s.rows[g],N=L[L.length-1],I=N.width+s.horizontalPadding;if(s.width-s.rowWidth[f]>I&&g!=f){L.splice(-1,1),s.rows[f].push(N),s.rowWidth[g]=s.rowWidth[g]-I,s.rowWidth[f]=s.rowWidth[f]+I,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var R=Number.MIN_VALUE,C=0;C<L.length;C++)L[C].height>R&&(R=L[C].height);g>0&&(R+=s.verticalPadding);var G=s.rowHeight[g]+s.rowHeight[f];s.rowHeight[g]=R,s.rowHeight[f]<N.height+s.verticalPadding&&(s.rowHeight[f]=N.height+s.verticalPadding);var S=s.rowHeight[g]+s.rowHeight[f];s.height+=S-G,this.shiftToLastRow(s)}},E.prototype.tilingPreLayout=function(){o.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},E.prototype.tilingPostLayout=function(){o.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},E.prototype.reduceTrees=function(){for(var s=[],g=!0,f;g;){var L=this.graphManager.getAllNodes(),N=[];g=!1;for(var I=0;I<L.length;I++)f=L[I],f.getEdges().length==1&&!f.getEdges()[0].isInterGraph&&f.getChild()==null&&(N.push([f,f.getEdges()[0],f.getOwner()]),g=!0);if(g==!0){for(var R=[],C=0;C<N.length;C++)N[C][0].getEdges().length==1&&(R.push(N[C]),N[C][0].getOwner().remove(N[C][0]));s.push(R),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},E.prototype.growTree=function(s){for(var g=s.length,f=s[g-1],L,N=0;N<f.length;N++)L=f[N],this.findPlaceforPrunedNode(L),L[2].add(L[0]),L[2].add(L[1],L[1].source,L[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},E.prototype.findPlaceforPrunedNode=function(s){var g,f,L=s[0];L==s[1].source?f=s[1].target:f=s[1].source;var N=f.startX,I=f.finishX,R=f.startY,C=f.finishY,G=0,S=0,_=0,F=0,w=[G,_,S,F];if(R>0)for(var x=N;x<=I;x++)w[0]+=this.grid[x][R-1].length+this.grid[x][R].length-1;if(I<this.grid.length-1)for(var x=R;x<=C;x++)w[1]+=this.grid[I+1][x].length+this.grid[I][x].length-1;if(C<this.grid[0].length-1)for(var x=N;x<=I;x++)w[2]+=this.grid[x][C+1].length+this.grid[x][C].length-1;if(N>0)for(var x=R;x<=C;x++)w[3]+=this.grid[N-1][x].length+this.grid[N][x].length-1;for(var P=y.MAX_VALUE,Y,X,U=0;U<w.length;U++)w[U]<P?(P=w[U],Y=1,X=U):w[U]==P&&Y++;if(Y==3&&P==0)w[0]==0&&w[1]==0&&w[2]==0?g=1:w[0]==0&&w[1]==0&&w[3]==0?g=0:w[0]==0&&w[2]==0&&w[3]==0?g=3:w[1]==0&&w[2]==0&&w[3]==0&&(g=2);else if(Y==2&&P==0){var b=Math.floor(Math.random()*2);w[0]==0&&w[1]==0?b==0?g=0:g=1:w[0]==0&&w[2]==0?b==0?g=0:g=2:w[0]==0&&w[3]==0?b==0?g=0:g=3:w[1]==0&&w[2]==0?b==0?g=1:g=2:w[1]==0&&w[3]==0?b==0?g=1:g=3:b==0?g=2:g=3}else if(Y==4&&P==0){var b=Math.floor(Math.random()*4);g=b}else g=X;g==0?L.setCenter(f.getCenterX(),f.getCenterY()-f.getHeight()/2-p.DEFAULT_EDGE_LENGTH-L.getHeight()/2):g==1?L.setCenter(f.getCenterX()+f.getWidth()/2+p.DEFAULT_EDGE_LENGTH+L.getWidth()/2,f.getCenterY()):g==2?L.setCenter(f.getCenterX(),f.getCenterY()+f.getHeight()/2+p.DEFAULT_EDGE_LENGTH+L.getHeight()/2):L.setCenter(f.getCenterX()-f.getWidth()/2-p.DEFAULT_EDGE_LENGTH-L.getWidth()/2,f.getCenterY())},M.exports=E}),(function(M,v,n){"use strict";var e={};e.layoutBase=n(0),e.CoSEConstants=n(1),e.CoSEEdge=n(2),e.CoSEGraph=n(3),e.CoSEGraphManager=n(4),e.CoSELayout=n(6),e.CoSENode=n(5),M.exports=e})])})});var nt=Q((j,tt)=>{"use strict";A((function(M,v){typeof j=="object"&&typeof tt=="object"?tt.exports=v(J()):typeof define=="function"&&define.amd?define(["cose-base"],v):typeof j=="object"?j.cytoscapeCoseBilkent=v(J()):M.cytoscapeCoseBilkent=v(M.coseBase)}),"webpackUniversalModuleDefinition")(j,function(m){return(function(M){var v={};function n(e){if(v[e])return v[e].exports;var t=v[e]={i:e,l:!1,exports:{}};return M[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return A(n,"__webpack_require__"),n.m=M,n.c=v,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?A(function(){return e.default},"getDefault"):A(function(){return e},"getModuleExports");return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)})([(function(M,v){M.exports=m}),(function(M,v,n){"use strict";var e=n(0).layoutBase.LayoutConstants,t=n(0).layoutBase.FDLayoutConstants,r=n(0).CoSEConstants,a=n(0).CoSELayout,u=n(0).CoSENode,o=n(0).layoutBase.PointD,p=n(0).layoutBase.DimensionD,i={ready:A(function(){},"ready"),stop:A(function(){},"stop"),quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function h(T,c){var D={};for(var E in T)D[E]=T[E];for(var E in c)D[E]=c[E];return D}A(h,"extend");function l(T){this.options=h(i,T),d(this.options)}A(l,"_CoSELayout");var d=A(function(c){c.nodeRepulsion!=null&&(r.DEFAULT_REPULSION_STRENGTH=t.DEFAULT_REPULSION_STRENGTH=c.nodeRepulsion),c.idealEdgeLength!=null&&(r.DEFAULT_EDGE_LENGTH=t.DEFAULT_EDGE_LENGTH=c.idealEdgeLength),c.edgeElasticity!=null&&(r.DEFAULT_SPRING_STRENGTH=t.DEFAULT_SPRING_STRENGTH=c.edgeElasticity),c.nestingFactor!=null&&(r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.nestingFactor),c.gravity!=null&&(r.DEFAULT_GRAVITY_STRENGTH=t.DEFAULT_GRAVITY_STRENGTH=c.gravity),c.numIter!=null&&(r.MAX_ITERATIONS=t.MAX_ITERATIONS=c.numIter),c.gravityRange!=null&&(r.DEFAULT_GRAVITY_RANGE_FACTOR=t.DEFAULT_GRAVITY_RANGE_FACTOR=c.gravityRange),c.gravityCompound!=null&&(r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.gravityCompound),c.gravityRangeCompound!=null&&(r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.gravityRangeCompound),c.initialEnergyOnIncremental!=null&&(r.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.initialEnergyOnIncremental),c.quality=="draft"?e.QUALITY=0:c.quality=="proof"?e.QUALITY=2:e.QUALITY=1,r.NODE_DIMENSIONS_INCLUDE_LABELS=t.NODE_DIMENSIONS_INCLUDE_LABELS=e.NODE_DIMENSIONS_INCLUDE_LABELS=c.nodeDimensionsIncludeLabels,r.DEFAULT_INCREMENTAL=t.DEFAULT_INCREMENTAL=e.DEFAULT_INCREMENTAL=!c.randomize,r.ANIMATE=t.ANIMATE=e.ANIMATE=c.animate,r.TILE=c.tile,r.TILING_PADDING_VERTICAL=typeof c.tilingPaddingVertical=="function"?c.tilingPaddingVertical.call():c.tilingPaddingVertical,r.TILING_PADDING_HORIZONTAL=typeof c.tilingPaddingHorizontal=="function"?c.tilingPaddingHorizontal.call():c.tilingPaddingHorizontal},"getUserOptions");l.prototype.run=function(){var T,c,D=this.options,E=this.idToLNode={},O=this.layout=new a,s=this;s.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var g=O.newGraphManager();this.gm=g;var f=this.options.eles.nodes(),L=this.options.eles.edges();this.root=g.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(f),O);for(var N=0;N<L.length;N++){var I=L[N],R=this.idToLNode[I.data("source")],C=this.idToLNode[I.data("target")];if(R!==C&&R.getEdgesBetween(C).length==0){var G=g.add(O.newEdge(),R,C);G.id=I.id()}}var S=A(function(w,x){typeof w=="number"&&(w=x);var P=w.data("id"),Y=s.idToLNode[P];return{x:Y.getRect().getCenterX(),y:Y.getRect().getCenterY()}},"getPositions"),_=A(function F(){for(var w=A(function(){D.fit&&D.cy.fit(D.eles,D.padding),T||(T=!0,s.cy.one("layoutready",D.ready),s.cy.trigger({type:"layoutready",layout:s}))},"afterReposition"),x=s.options.refresh,P,Y=0;Y<x&&!P;Y++)P=s.stopped||s.layout.tick();if(P){O.checkLayoutSuccess()&&!O.isSubLayout&&O.doPostLayout(),O.tilingPostLayout&&O.tilingPostLayout(),O.isLayoutFinished=!0,s.options.eles.nodes().positions(S),w(),s.cy.one("layoutstop",s.options.stop),s.cy.trigger({type:"layoutstop",layout:s}),c&&cancelAnimationFrame(c),T=!1;return}var X=s.layout.getPositionsData();D.eles.nodes().positions(function(U,b){if(typeof U=="number"&&(U=b),!U.isParent()){for(var V=U.id(),H=X[V],W=U;H==null&&(H=X[W.data("parent")]||X["DummyCompound_"+W.data("parent")],X[V]=H,W=W.parent()[0],W!=null););return H!=null?{x:H.x,y:H.y}:{x:U.position("x"),y:U.position("y")}}}),w(),c=requestAnimationFrame(F)},"iterateAnimated");return O.addListener("layoutstarted",function(){s.options.animate==="during"&&(c=requestAnimationFrame(_))}),O.runLayout(),this.options.animate!=="during"&&(s.options.eles.nodes().not(":parent").layoutPositions(s,s.options,S),T=!1),this},l.prototype.getTopMostNodes=function(T){for(var c={},D=0;D<T.length;D++)c[T[D].id()]=!0;var E=T.filter(function(O,s){typeof O=="number"&&(O=s);for(var g=O.parent()[0];g!=null;){if(c[g.id()])return!1;g=g.parent()[0]}return!0});return E},l.prototype.processChildrenList=function(T,c,D){for(var E=c.length,O=0;O<E;O++){var s=c[O],g=s.children(),f,L=s.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(s.outerWidth()!=null&&s.outerHeight()!=null?f=T.add(new u(D.graphManager,new o(s.position("x")-L.w/2,s.position("y")-L.h/2),new p(parseFloat(L.w),parseFloat(L.h)))):f=T.add(new u(this.graphManager)),f.id=s.data("id"),f.paddingLeft=parseInt(s.css("padding")),f.paddingTop=parseInt(s.css("padding")),f.paddingRight=parseInt(s.css("padding")),f.paddingBottom=parseInt(s.css("padding")),this.options.nodeDimensionsIncludeLabels&&s.isParent()){var N=s.boundingBox({includeLabels:!0,includeNodes:!1}).w,I=s.boundingBox({includeLabels:!0,includeNodes:!1}).h,R=s.css("text-halign");f.labelWidth=N,f.labelHeight=I,f.labelPos=R}if(this.idToLNode[s.data("id")]=f,isNaN(f.rect.x)&&(f.rect.x=0),isNaN(f.rect.y)&&(f.rect.y=0),g!=null&&g.length>0){var C;C=D.getGraphManager().add(D.newGraph(),f),this.processChildrenList(C,g,D)}}},l.prototype.stop=function(){return this.stopped=!0,this};var y=A(function(c){c("layout","cose-bilkent",l)},"register");typeof cytoscape<"u"&&y(cytoscape),M.exports=y})])})});var ot=ft(nt(),1);$.use(ot.default);function ct(m,M){m.forEach(v=>{let n={id:v.id,labelText:v.label,height:v.height,width:v.width,padding:v.padding??0};Object.keys(v).forEach(e=>{["id","label","height","width","padding","x","y"].includes(e)||(n[e]=v[e])}),M.add({group:"nodes",data:n,position:{x:v.x??0,y:v.y??0}})})}A(ct,"addNodes");function pt(m,M){m.forEach(v=>{let n={id:v.id,source:v.start,target:v.end};Object.keys(v).forEach(e=>{["id","start","end"].includes(e)||(n[e]=v[e])}),M.add({group:"edges",data:n})})}A(pt,"addEdges");function st(m){return new Promise(M=>{let v=it("body").append("div").attr("id","cy").attr("style","display:none"),n=$({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});v.remove(),ct(m.nodes,n),pt(m.edges,n),n.nodes().forEach(function(t){t.layoutDimensions=()=>{let r=t.data();return{w:r.width,h:r.height}}});let e={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(e).run(),n.ready(t=>{B.info("Cytoscape ready",t),M(n)})})}A(st,"createCytoscapeInstance");function at(m){return m.nodes().map(M=>{let v=M.data(),n=M.position(),e={id:v.id,x:n.x,y:n.y};return Object.keys(v).forEach(t=>{t!=="id"&&(e[t]=v[t])}),e})}A(at,"extractPositionedNodes");function ht(m){return m.edges().map(M=>{let v=M.data(),n=M._private.rscratch,e={id:v.id,source:v.source,target:v.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(v).forEach(t=>{["id","source","target"].includes(t)||(e[t]=v[t])}),e})}A(ht,"extractPositionedEdges");async function lt(m,M){B.debug("Starting cose-bilkent layout algorithm");try{dt(m);let v=await st(m),n=at(v),e=ht(v);return B.debug(`Layout completed: ${n.length} nodes, ${e.length} edges`),{nodes:n,edges:e}}catch(v){throw B.error("Error in cose-bilkent layout algorithm:",v),v}}A(lt,"executeCoseBilkentLayout");function dt(m){if(!m)throw new Error("Layout data is required");if(!m.config)throw new Error("Configuration is required in layout data");if(!m.rootNode)throw new Error("Root node is required");if(!m.nodes||!Array.isArray(m.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(m.edges))throw new Error("Edges array is required in layout data");return!0}A(dt,"validateLayoutData");var ut=A(async(m,M,{insertCluster:v,insertEdge:n,insertEdgeLabel:e,insertMarkers:t,insertNode:r,log:a,positionEdgeLabel:u},{algorithm:o})=>{let p={},i={},h=M.select("g");t(h,m.markers,m.type,m.diagramId);let l=h.insert("g").attr("class","subgraphs"),d=h.insert("g").attr("class","edgePaths"),y=h.insert("g").attr("class","edgeLabels"),T=h.insert("g").attr("class","nodes");a.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(m.nodes.map(async E=>{if(E.isGroup){let O={...E};i[E.id]=O,p[E.id]=O,await v(l,E)}else{let O={...E};p[E.id]=O;let s=await r(T,E,{config:m.config,dir:m.direction||"TB"}),g=s.node().getBBox();O.width=g.width,O.height=g.height,O.domId=s,a.debug(`Node ${E.id} dimensions: ${g.width}x${g.height}`)}})),a.debug("Running cose-bilkent layout algorithm");let c={...m,nodes:m.nodes.map(E=>{let O=p[E.id];return{...E,width:O.width,height:O.height}})},D=await lt(c,m.config);a.debug("Positioning nodes based on layout results"),D.nodes.forEach(E=>{let O=p[E.id];O?.domId&&(O.domId.attr("transform",`translate(${E.x}, ${E.y})`),O.x=E.x,O.y=E.y,a.debug(`Positioned node ${O.id} at center (${E.x}, ${E.y})`))}),D.edges.forEach(E=>{let O=m.edges.find(s=>s.id===E.id);O&&(O.points=[{x:E.startX,y:E.startY},{x:E.midX,y:E.midY},{x:E.endX,y:E.endY}])}),a.debug("Inserting and positioning edges"),await Promise.all(m.edges.map(async E=>{let O=await e(y,E),s=p[E.start??""],g=p[E.end??""];if(s&&g){let f=D.edges.find(L=>L.id===E.id);if(f){a.debug("APA01 positionedEdge",f);let L={...E},N=n(d,L,i,m.type,s,g,m.diagramId);u(L,N)}else{let L={...E,points:[{x:s.x||0,y:s.y||0},{x:g.x||0,y:g.y||0}]},N=n(d,L,i,m.type,s,g,m.diagramId);u(L,N)}}})),a.debug("Cose-bilkent rendering completed")},"render");var xt=ut;export{xt as render};
|
package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/cynefin-OW5HDTMX-6OCTWOGG.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,b as r}from"./chunk-JZGDI5JK.mjs";import"./chunk-ZS6VBONO.mjs";import"./chunk-AQ6EADP3.mjs";export{e as CynefinModule,r as createCynefinServices};
|
package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/cynefinDiagram-2OOWUY4M.mjs
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import{a as yt}from"./chunk-JQRUD6KW.mjs";import{a as pt}from"./chunk-5IQCK5RY.mjs";import"./chunk-JZGDI5JK.mjs";import"./chunk-OJINMHTS.mjs";import"./chunk-VQC2EELJ.mjs";import"./chunk-KD6SPIPN.mjs";import"./chunk-Q6NGPIAH.mjs";import"./chunk-RT4MAWR3.mjs";import"./chunk-YBMQ5JGJ.mjs";import"./chunk-GDY2UAB4.mjs";import"./chunk-3SMGFRGC.mjs";import"./chunk-3NPNU5GP.mjs";import"./chunk-TCEHX7R3.mjs";import"./chunk-5MVFYWFU.mjs";import"./chunk-SFMINX4W.mjs";import"./chunk-JFFVMJIA.mjs";import"./chunk-ZUNWM646.mjs";import"./chunk-ZS6VBONO.mjs";import{a as ut}from"./chunk-IJBDOHL6.mjs";import{o as H}from"./chunk-VY2OSTJR.mjs";import"./chunk-STOV2HOB.mjs";import{O as at,S as it,T as st,U as ct,V as mt,W as lt,X as ft,Y as dt,h as _,j as rt,t as E}from"./chunk-QJSWEUOL.mjs";import{b as j}from"./chunk-H7VHZCWX.mjs";import{a}from"./chunk-AQ6EADP3.mjs";var gt=a(()=>({domains:new Map,transitions:[]}),"createDefaultData"),Y=gt(),Pt=a(()=>Y.domains,"getDomains"),vt=a(()=>Y.transitions,"getTransitions"),zt=a(t=>{if(t)for(let e of t){let n=e.domain,o=(e.items??[]).map(c=>({label:c.label}));Y.domains.set(n,{name:n,items:o})}},"setDomains"),Lt=a(t=>{t&&(Y.transitions=t.filter(e=>e.from===e.to?(j.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Rt=a(()=>H({...rt.cynefin,...E().cynefin}),"getConfig"),jt=a(()=>{it(),Y=gt()},"clear"),O={getDomains:Pt,getTransitions:vt,setDomains:zt,setTransitions:Lt,getConfig:Rt,clear:jt,setAccTitle:st,getAccTitle:ct,setDiagramTitle:ft,getDiagramTitle:dt,getAccDescription:lt,setAccDescription:mt};var It=a(t=>{yt(t,O),O.setDomains(t.domains),O.setTransitions(t.transitions)},"populate"),xt={parse:a(async t=>{let e=await pt("cynefin",t);j.debug(e),It(e)},"parse")};function q(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}a(q,"seededRandom");function Wt(t){let e=0;for(let n=0;n<t.length;n++){let o=t.charCodeAt(n);e=(e<<5)-e+o,e|=0}return e}a(Wt,"hashString");function bt(t,e){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:Wt(e)}a(bt,"resolveSeed");function ht(t,e,n,o){let c=t/2,d=o??t*.015,w=7,I=e/w,l=[];for(let r=0;r<=w;r++){let p=q(n+r*17)*d*2-d;l.push({x:c+p,y:r*I})}let B=`M${l[0].x},${l[0].y}`;for(let r=0;r<l.length-1;r++){let p=l[r],s=l[r+1],f=(p.y+s.y)/2,C=r%2===0?1:-1,g=d*1.5*C*q(n+r*31+7),W=p.x+g,F=f,V=s.x-g;B+=` C${W},${F} ${V},${f} ${s.x},${s.y}`}return B}a(ht,"generateFoldPath");function Ct(t,e,n,o){let c=e/2,d=o??e*.015,w=7,I=t/w,l=[];for(let r=0;r<=w;r++){let p=q(n+r*23)*d*2-d;l.push({x:r*I,y:c+p})}let B=`M${l[0].x},${l[0].y}`;for(let r=0;r<l.length-1;r++){let p=l[r],s=l[r+1],f=(p.x+s.x)/2,C=r%2===0?1:-1,g=d*1.5*C*q(n+r*37+11),W=f,F=p.y+g,V=f,P=s.y-g;B+=` C${W},${F} ${V},${P} ${s.x},${s.y}`}return B}a(Ct,"generateHorizontalBoundary");function Dt(t,e){let n=t/2,o=e*.5,c=e,d=t*.03;return[`M${n},${o}`,`C${n+d},${o+(c-o)*.2}`,`${n-d*1.5},${o+(c-o)*.55}`,`${n+d*.5},${o+(c-o)*.75}`,`C${n-d},${o+(c-o)*.85}`,`${n+d*.3},${o+(c-o)*.95}`,`${n},${c}`].join(" ")}a(Dt,"generateCliffPath");function $t(t,e,n,o){return[`M${t-n},${e}`,`A${n},${o} 0 1,1 ${t+n},${e}`,`A${n},${o} 0 1,1 ${t-n},${e}`,"Z"].join(" ")}a($t,"generateConfusionPath");var wt={complex:{model:"Probe \u2192 Sense \u2192 Respond",practice:"Emergent Practices"},complicated:{model:"Sense \u2192 Analyse \u2192 Respond",practice:"Good Practices"},clear:{model:"Sense \u2192 Categorise \u2192 Respond",practice:"Best Practices"},chaotic:{model:"Act \u2192 Sense \u2192 Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},Ft=a((t,e)=>{let n=t/2,o=e/2;return{complex:{cx:n/2,cy:o/2,x:0,y:0,w:n,h:o},complicated:{cx:n+n/2,cy:o/2,x:n,y:0,w:n,h:o},chaotic:{cx:n/2,cy:o+o/2,x:0,y:o,w:n,h:o},clear:{cx:n+n/2,cy:o+o/2,x:n,y:o,w:n,h:o},confusion:{cx:n,cy:o,x:n*.7,y:o*.7,w:n*.6,h:o*.6}}},"getDomainLayouts"),Vt=a(()=>{let t=_(),e=E();return H(t,e.themeVariables).cynefin},"getCynefinDomainColors"),Z=3,Gt=a((t,e,n,o)=>{let c=o.db,d=c.getDomains(),w=c.getTransitions(),I=c.getDiagramTitle(),l=c.getAccTitle(),B=c.getAccDescription(),r=c.getConfig(),p=Vt();j.debug("Rendering Cynefin diagram");let s=r.width,f=r.height,C=r.padding,g=r.showDomainDescriptions,W=r.boundaryAmplitude,F=s+C*2,V=f+C*2,P={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},T=ut(e);at(T,V,F,r.useMaxWidth??!0),T.attr("viewBox",`0 0 ${F} ${V}`),l&&T.append("title").text(l),B&&T.append("desc").text(B);let A=T.append("g").attr("transform",`translate(${C}, ${C})`),G=Ft(s,f),J=bt(r.seed,e),At=A.append("g").attr("class","cynefin-backgrounds"),U=["complex","complicated","chaotic","clear"];for(let m of U){let i=G[m];At.append("rect").attr("class","cynefinDomain").attr("x",i.x).attr("y",i.y).attr("width",i.w).attr("height",i.h).attr("fill",P[m]).attr("fill-opacity",.4).attr("stroke","none")}let Q=A.append("g").attr("class","cynefin-boundaries");Q.append("path").attr("class","cynefinBoundary").attr("d",ht(s,f,J,W)).attr("fill","none"),Q.append("path").attr("class","cynefinBoundary").attr("d",Ct(s,f,J+100,W)).attr("fill","none"),Q.append("path").attr("class","cynefinCliff").attr("d",Dt(s,f)).attr("fill","none");let kt=s*.15,Nt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",$t(s/2,f/2,kt,Nt)).attr("fill",P.confusion).attr("fill-opacity",.5);let K=A.append("g").attr("class","cynefin-labels");for(let m of U){let i=G[m];K.append("text").attr("class","cynefinDomainLabel").attr("x",i.cx).attr("y",g?i.cy-30:i.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(m.charAt(0).toUpperCase()+m.slice(1))}if(K.append("text").attr("class","cynefinDomainLabel").attr("x",s/2).attr("y",g?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),g){let m=A.append("g").attr("class","cynefin-subtitles");for(let i of U){let u=G[i],y=wt[i];m.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),m.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}m.append("text").attr("class","cynefinSubtitle").attr("x",s/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(wt.confusion.practice)}let tt=A.append("g").attr("class","cynefin-items"),k=26,et=10,St=["complex","complicated","chaotic","clear","confusion"];for(let m of St){let i=d.get(m);if(!i||i.items.length===0)continue;let u=G[m],y=m==="confusion",v=i.items,z=0;y&&i.items.length>Z&&(z=i.items.length-Z,v=i.items.slice(0,Z));let N;if(y){let b=g?22:14;N=u.cy+b}else N=u.cy+(g?25:15);if([...v].forEach((b,S)=>{let D=N+S*(k+4),M=tt.append("g"),L=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",k/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(b.label),h=b.label.length*7,x=L.node();if(x&&typeof x.getBBox=="function"){let X=x.getBBox();X.width>0&&(h=X.width)}let $=h+et*2,R=u.cx-$/2;M.attr("transform",`translate(${R}, ${D})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",$).attr("height",k).attr("rx",4).attr("ry",4).attr("fill",P[m]).attr("fill-opacity",.95),L.attr("x",$/2).attr("y",k/2)}),z>0){let b=N+v.length*(k+4),S=`+${z} more`,D=tt.append("g"),M=D.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",k/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S),L=S.length*7,h=M.node();if(h&&typeof h.getBBox=="function"){let R=h.getBBox();R.width>0&&(L=R.width)}let x=L+et*2,$=u.cx-x/2;D.attr("transform",`translate(${$}, ${b})`),D.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",k).attr("rx",4).attr("ry",4).attr("fill",P[m]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",k/2)}}if(w.length>0){let m=T.select("defs").empty()?T.append("defs"):T.select("defs"),i=`cynefin-arrow-${e}`;m.append("marker").attr("id",i).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("class","cynefinArrowHead");let u=A.append("g").attr("class","cynefin-arrows");w.forEach(y=>{let v=G[y.from],z=G[y.to];if(!v||!z)return;if(y.from===y.to){j.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}let N=v.cx,b=v.cy,S=z.cx,D=z.cy,M=(N+S)/2,L=(b+D)/2,h=S-N,x=D-b,$=Math.sqrt(h*h+x*x),R=$*.15,X=-x/$,Mt=h/$,nt=M+X*R,ot=L+Mt*R;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${N},${b} Q${nt},${ot} ${S},${D}`).attr("fill","none").attr("marker-end",`url(#${i})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",nt).attr("y",ot-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}I&&A.append("text").attr("class","cynefinTitle").attr("x",s/2).attr("y",-C/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(I)},"draw"),Bt={draw:Gt};var Et=a(()=>{let t=_(),e=E();return H(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=a(()=>{let t=Et();return`
|
|
2
|
+
.cynefinDomain {
|
|
3
|
+
stroke: none;
|
|
4
|
+
}
|
|
5
|
+
.cynefinDomainLabel {
|
|
6
|
+
font-size: ${t.domainFontSize}px;
|
|
7
|
+
font-weight: bold;
|
|
8
|
+
fill: ${t.labelColor};
|
|
9
|
+
}
|
|
10
|
+
.cynefinSubtitle {
|
|
11
|
+
font-size: ${t.itemFontSize-1}px;
|
|
12
|
+
fill: ${t.textColor};
|
|
13
|
+
font-style: italic;
|
|
14
|
+
}
|
|
15
|
+
.cynefinItem {
|
|
16
|
+
fill-opacity: 0.95;
|
|
17
|
+
stroke: ${t.boundaryColor};
|
|
18
|
+
stroke-width: 1;
|
|
19
|
+
}
|
|
20
|
+
.cynefinItemText {
|
|
21
|
+
font-size: ${t.itemFontSize}px;
|
|
22
|
+
fill: ${t.textColor};
|
|
23
|
+
}
|
|
24
|
+
.cynefinItemOverflow {
|
|
25
|
+
fill-opacity: 0.6;
|
|
26
|
+
stroke: ${t.boundaryColor};
|
|
27
|
+
stroke-width: 1;
|
|
28
|
+
stroke-dasharray: 3 2;
|
|
29
|
+
}
|
|
30
|
+
.cynefinBoundary {
|
|
31
|
+
stroke: ${t.boundaryColor};
|
|
32
|
+
stroke-width: ${t.boundaryWidth};
|
|
33
|
+
stroke-dasharray: 6 3;
|
|
34
|
+
}
|
|
35
|
+
.cynefinCliff {
|
|
36
|
+
stroke: ${t.cliffColor};
|
|
37
|
+
stroke-width: ${t.cliffWidth};
|
|
38
|
+
}
|
|
39
|
+
.cynefinConfusion {
|
|
40
|
+
stroke: ${t.boundaryColor};
|
|
41
|
+
stroke-width: 1.5;
|
|
42
|
+
stroke-dasharray: 4 2;
|
|
43
|
+
}
|
|
44
|
+
.cynefinArrowLine {
|
|
45
|
+
stroke: ${t.arrowColor};
|
|
46
|
+
stroke-width: ${t.arrowWidth};
|
|
47
|
+
fill: none;
|
|
48
|
+
}
|
|
49
|
+
.cynefinArrowHead {
|
|
50
|
+
fill: ${t.arrowColor};
|
|
51
|
+
stroke: none;
|
|
52
|
+
}
|
|
53
|
+
.cynefinArrowLabel {
|
|
54
|
+
font-size: ${t.itemFontSize-1}px;
|
|
55
|
+
fill: ${t.textColor};
|
|
56
|
+
}
|
|
57
|
+
.cynefinTitle {
|
|
58
|
+
font-size: ${t.domainFontSize+2}px;
|
|
59
|
+
font-weight: bold;
|
|
60
|
+
fill: ${t.labelColor};
|
|
61
|
+
}
|
|
62
|
+
`},"styles"),Tt=Ht;var we={parser:xt,db:O,renderer:Bt,styles:Tt};export{we as diagram};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as A}from"./chunk-R7JDMUKV.mjs";import{a as Y,b as H,c as w,d as X,e as J,f as x,g as T}from"./chunk-WUBWJARI.mjs";import{C as G}from"./chunk-4CAJECRU.mjs";import{a as I}from"./chunk-ZQN7UHIL.mjs";import{f as S,g as M,h as O}from"./chunk-4OADUZ5Q.mjs";import{a as B,c as k,e as N}from"./chunk-VRZKL3EH.mjs";import{b as P}from"./chunk-Z6V44ARX.mjs";import"./chunk-5IMINLNL.mjs";import"./chunk-ZNLK7HRR.mjs";import"./chunk-DZP67EKU.mjs";import"./chunk-2NMSUPJH.mjs";import"./chunk-VY2OSTJR.mjs";import"./chunk-STOV2HOB.mjs";import{_ as D}from"./chunk-QJSWEUOL.mjs";import{b as p}from"./chunk-H7VHZCWX.mjs";import{a as m}from"./chunk-AQ6EADP3.mjs";var _=m((t,e,o)=>Math.max(e,Math.min(o,t)),"clamp"),j=m((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),K=m(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram"||t==="er"||t==="classDiagram","shouldMergeSelfLoopSegments"),Q=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],V=m((t,e,o,a,r)=>{let g=[],h=new Set;if(o.forEach(({start:d,end:n})=>{d!==a&&h.add(d),n!==a&&h.add(n)}),h.forEach(d=>{let n=t.node(d);typeof n?.x=="number"&&typeof n?.y=="number"&&g.push(n)}),g.length===0&&o.forEach(({edge:d})=>{(d.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&g.push(n)})}),g.length===0)return j(r);let l=g.reduce((d,n)=>({x:d.x+n.x/g.length,y:d.y+n.y/g.length}),{x:0,y:0}),c=l.x-e.x,s=l.y-e.y;return Math.abs(c)>Math.abs(s)?c>0?"right":"left":Math.abs(s)>0?s>0?"bottom":"top":j(r)},"getSelfLoopSide"),Z=m((t,e="top",o=0,a=0)=>{let r=t.x,g=t.y-o,h=t.width/2,l=t.height/2,c=Math.max(36,Math.min(100,t.width*.8)),s=_(Math.max(a,t.width*.35),36,c),d=_(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{let n=g+l;return[{x:r-s/2,y:n},{x:r-s/2,y:n+d},{x:r+s/2,y:n+d},{x:r+s/2,y:n}]}case"right":{let n=r+h;return[{x:n,y:g-s/2},{x:n+d,y:g-s/2},{x:n+d,y:g+s/2},{x:n,y:g+s/2}]}case"left":{let n=r-h;return[{x:n,y:g-s/2},{x:n-d,y:g-s/2},{x:n-d,y:g+s/2},{x:n,y:g+s/2}]}case"top":default:{let n=g-l;return[{x:r-s/2,y:n},{x:r-s/2,y:n-d},{x:r+s/2,y:n-d},{x:r+s/2,y:n}]}}},"getSelfLoopPoints"),$=m((t,e,o="top",a=0,r={})=>{let h=t.x,l=t.y-a,c=r.width??0,s=r.height??0;switch(o){case"bottom":return{x:h,y:Math.max(...e.map(d=>d.y))+s/2+4};case"right":return{x:Math.max(...e.map(d=>d.x))+c/2+4,y:l};case"left":return{x:Math.min(...e.map(d=>d.x))-c/2-4,y:l};case"top":default:return{x:h,y:Math.min(...e.map(d=>d.y))-s/2-4}}},"getSelfLoopLabelPosition"),F=m((t,e=0,{mergeSelfLoops:o=!0}={})=>{let a=new Map,r=[],g=t.graph()?.rankdir;return t.edges().forEach(h=>{let l=t.edge(h);if(o&&l.selfLoop){let c=l.selfLoop.id;a.has(c)||a.set(c,[]),a.get(c).push({edge:l,start:h.v,end:h.w})}else r.push({edge:l,start:h.v,end:h.w})}),a.forEach(h=>{if(h.length!==3){h.forEach(u=>r.push(u));return}h.sort((u,E)=>u.edge.selfLoop.order-E.edge.selfLoop.order);let[l,c,s]=h,d=l.edge.originalEdge??c.edge.originalEdge??s.edge.originalEdge??c.edge,n=t.node(d.start);if(!n){h.forEach(u=>r.push(u));return}let i={width:c.edge.width,height:c.edge.height},L=V(t,n,h,d.start,g),b=Z(n,L,e,i.width??0),y=$(n,b,L,e,i),f={...c.edge,...d,id:d.id,points:b,start:d.start,end:d.end,x:y.x,y:y.y,width:i.width,height:i.height,labelStyle:c.edge.labelStyle,fromCluster:l.edge.fromCluster??c.edge.fromCluster??s.edge.fromCluster,toCluster:l.edge.toCluster??c.edge.toCluster??s.edge.toCluster};delete f.selfLoop,delete f.originalEdge,r.push({edge:f,start:f.start,end:f.end})}),r},"getEdgesToRender"),W=m(async({element:t,graph:e,diagramType:o,id:a,parentCluster:r,siteConfig:g})=>{let h=e.graph().rankdir;p.trace("Dir in recursive render - dir:",h);let{clusters:l,edgePaths:c,edgeLabels:s,nodes:d,rootGroups:n}=Y(t,{edgePathsClass:"edgePaths"});e.nodes()?p.info("Recursive render XXX",e.nodes()):p.info("No nodes found for",e),e.edges().length>0&&p.info("Recursive edges",e.edge(e.edges()[0]));let i=K(o);await Promise.all(e.nodes().map(async function(y){let f=e.node(y);if(r!==void 0){let u=JSON.parse(JSON.stringify(r.clusterData));p.trace(`Setting data for parent cluster XXX
|
|
2
|
+
Node.id = `,y,`
|
|
3
|
+
data=`,u.height,`
|
|
4
|
+
Parent cluster`,r.height),e.setNode(r.id,u),e.parent(y)||(p.trace("Setting parent",y,r.id),e.setParent(y,r.id,u))}if(p.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),f?.clusterNode){p.info("Cluster identified XBX",y,f.width,e.node(y));let{ranksep:u,nodesep:E}=e.graph();f.graph.setGraph({...f.graph.graph(),ranksep:u+25,nodesep:E});let R=await ne({element:d,graph:f.graph,diagramType:o,id:a,parentCluster:e.node(y),siteConfig:g}),C=R.elem;P(f,C),f.diff=R.diff||0,p.info("New compound node after recursive render XAX",y,"width",f.width,"height",f.height),k(C,f)}else e.children(y).length>0?(p.trace("Cluster - the non recursive path XBX",y,f.id,f,f.width,"Graph:",e),p.trace(X(f.id,e)),w.set(f.id,{id:X(f.id,e),node:f})):(p.trace("Node - the non recursive path XAX",y,d,e.node(y),h),await H(d,e.node(y),{config:g,dir:h}))})),await m(async()=>{let y=e.edges().map(async function(f){let u=e.edge(f.v,f.w,f.name);if(p.info("Edge "+f.v+" -> "+f.w+": "+JSON.stringify(f)),p.info("Edge "+f.v+" -> "+f.w+": ",f," ",JSON.stringify(e.edge(f))),p.info("Fix",w,"ids:",f.v,f.w,"Translating: ",w.get(f.v),w.get(f.w)),i&&u.selfLoop){if(u.selfLoop.order!==1)return;let E={...u.originalEdge,...u,id:u.selfLoop.id,startLabelLeft:u.originalEdge?.startLabelLeft??u.startLabelLeft,startLabelRight:u.originalEdge?.startLabelRight??u.startLabelRight,endLabelLeft:u.originalEdge?.endLabelLeft??u.endLabelLeft,endLabelRight:u.originalEdge?.endLabelRight??u.endLabelRight};await S(s,E),u.width=E.width,u.height=E.height,u.labelStyle=E.labelStyle;return}await S(s,u)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:b}=B(g);return{elem:n,graph:e,groups:{clusters:l,edgePaths:c,edgeLabels:s,nodes:d,rootGroups:n},diagramType:o,id:a,mergeSelfLoops:i,subGraphTitleTotalMargin:b}},"measureDagreGraph"),q=m(t=>{p.info("############################################# XXX"),p.info("### Layout ### XXX"),p.info("############################################# XXX"),A(t)},"runDagreGraphLayout"),v=m((t,e,o)=>{let a=t.node(e);if(!a)return;let r={...a};return a?.clusterNode?r.y=(a.y??0)+o:t.children(e).length>0?r.height=(a.height??0)+o:r.y=(a.y??0)+o/2,r},"normalizeDagreNode"),z=m((t,e)=>{Q.forEach(o=>{e[o]!==void 0&&(t[o]=e[o])})},"applyDagreNodeLayout"),ee=m((t,e,o,a)=>({...t,start:t.start??e,end:t.end??o,points:(t.points??[]).map(r=>({...r,y:typeof r.y=="number"?r.y+a:r.y}))}),"normalizeDagreEdge"),te=m((t,e)=>{let{graph:o,mergeSelfLoops:a,subGraphTitleTotalMargin:r=0}=e,g=new Map(t.nodes.map(l=>[l.id,l]));x(o).forEach(l=>{let c=v(o,l,r);if(!c)return;z(o.node(l),c);let s=g.get(l);s&&z(s,c)});let h=r/2;return t.edges=F(o,h,{mergeSelfLoops:a}).map(({edge:l,start:c,end:s})=>ee(l,c,s,h)),t},"applyDagreLayoutResult"),oe=m(async({elem:t,graph:e,groups:{clusters:o,edgePaths:a},diagramType:r,id:g,mergeSelfLoops:h,subGraphTitleTotalMargin:l})=>{let c=0;await Promise.all(x(e).map(async function(n){let i=e.node(n);if(p.info("Position XBX => "+n+": ("+i.x,","+i.y,") width: ",i.width," height: ",i.height),i?.clusterNode)i.y+=l,p.info("A tainted cluster node XBX1",n,i.id,i.width,i.height,i.x,i.y,e.parent(n)),w.get(i.id).node=i,N(i);else if(e.children(n).length>0){p.info("A pure cluster node XBX1",n,i.id,i.x,i.y,i.width,i.height,e.parent(n)),i.height+=l,e.node(i.parentId);let L=i?.padding/2||0,b=i?.labelBBox?.height||0,y=b-L||0;p.debug("OffsetY",y,"labelHeight",b,"halfPadding",L),await I(o,i),w.get(i.id).node=i}else{let L=e.node(i.parentId);i.y+=l/2,p.info("A regular node XBX1 - using the padding",i.id,"parent",i.parentId,i.width,i.height,i.x,i.y,"offsetY",i.offsetY,"parent",L,L?.offsetY,i),N(i)}}));let s=l/2;return F(e,s,{mergeSelfLoops:h}).forEach(function({edge:n,start:i,end:L}){p.info("Edge "+i+" -> "+L+": "+JSON.stringify(n),n),n.points.forEach(u=>u.y+=s);let b=e.node(i),y=e.node(L),f=O(a,n,w,r,b,y,g);M(n,f)}),e.nodes().forEach(function(n){let i=e.node(n);p.info(n,i.type,i.diff),i.isGroup&&(c=i.diff)}),p.warn("Returning from recursive render XAX",t,c),{elem:t,diff:c}},"paintDagreLayoutCore"),ne=m(async t=>{let e=await W(t);return q(e.graph),await oe(e)},"renderDagreSubgraph"),U=m(t=>{let e=new G({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:t.config?.nodeSpacing||t.nodeSpacing||t.config?.flowchart?.nodeSpacing,ranksep:t.config?.rankSpacing||t.rankSpacing||t.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return t.nodes.forEach(o=>{e.setNode(o.id,{...o}),o.parentId&&e.setParent(o.id,o.parentId)}),p.debug("Edges:",t.edges),t.edges.forEach(o=>{if(o.start===o.end){let a=o.start,r=a+"---"+a+"---1",g=a+"---"+a+"---2",h=e.node(a);e.setNode(r,{domId:r,id:r,parentId:h.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(r,h.parentId),e.setNode(g,{domId:g,id:g,parentId:h.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(g,h.parentId);let l=structuredClone(o),c=structuredClone(o),s=structuredClone(o),d=structuredClone(o);c.originalEdge=l,c.selfLoop={id:l.id,order:0},s.originalEdge=l,s.selfLoop={id:l.id,order:1},d.originalEdge=l,d.selfLoop={id:l.id,order:2},c.label="",c.arrowTypeEnd="none",c.endLabelLeft="",c.endLabelRight="",c.startLabelLeft="",c.id=a+"-cyclic-special-1",s.startLabelRight="",s.startLabelLeft="",s.endLabelLeft="",s.endLabelRight="",s.arrowTypeStart="none",s.arrowTypeEnd="none",s.id=a+"-cyclic-special-mid",d.label="",d.startLabelRight="",d.startLabelLeft="",d.arrowTypeStart="none",h.isGroup&&(c.fromCluster=a,d.toCluster=a),d.id=a+"-cyclic-special-2",d.arrowTypeStart="none",e.setEdge(a,r,c,a+"-cyclic-special-0"),e.setEdge(r,g,s,a+"-cyclic-special-1"),e.setEdge(g,a,d,a+"-cyclic-special-2")}else e.setEdge(o.start,o.end,{...o},o.id)}),J(e),{graph:e}},"prepareLayoutForDagre"),re=m(async(t,{element:e,preparedLayout:o})=>{let a=o??U(t),r=D(),g=await W({element:e,graph:a.graph,diagramType:t.type,id:t.diagramId,parentCluster:void 0,siteConfig:r});return a.measuredLayout=g,g},"measureDagreLayout"),ie=m((t,e)=>{let o=e.preparedLayout?.measuredLayout;if(!o)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return q(o.graph),te(t,o),o},"runDagreLayoutCore"),se=m((t,{measure:e})=>x(e.graph).map(o=>e.graph.node(o)).filter(Boolean),"getDagrePaintNodes"),de=m((t,e,{measure:o})=>t?o.graph.node(t):void 0,"getDagreEdgeNode"),xe=T({prepareLayout:U,measureLayout:re,runLayoutCore:ie,paintOptions:{clusterDb:w,getNodes:se,getEdgeNode:de,skipNode:m((t,{measure:e})=>!e.graph.hasNode(t.id),"skipNode"),isCluster:m((t,{measure:e})=>e.graph.hasNode(t.id)&&(e.graph.children(t.id)??[]).length>0,"isCluster")}});export{te as applyDagreLayoutResult,F as getEdgesToRender,re as measureDagreLayout,U as prepareLayoutForDagre,xe as render,ie as runDagreLayoutCore};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{a as A}from"./chunk-JQRUD6KW.mjs";import{a as j}from"./chunk-5IQCK5RY.mjs";import"./chunk-JZGDI5JK.mjs";import"./chunk-OJINMHTS.mjs";import"./chunk-VQC2EELJ.mjs";import"./chunk-KD6SPIPN.mjs";import"./chunk-Q6NGPIAH.mjs";import"./chunk-RT4MAWR3.mjs";import"./chunk-YBMQ5JGJ.mjs";import"./chunk-GDY2UAB4.mjs";import"./chunk-3SMGFRGC.mjs";import"./chunk-3NPNU5GP.mjs";import"./chunk-TCEHX7R3.mjs";import"./chunk-5MVFYWFU.mjs";import"./chunk-SFMINX4W.mjs";import"./chunk-JFFVMJIA.mjs";import"./chunk-ZUNWM646.mjs";import"./chunk-ZS6VBONO.mjs";import{a as E}from"./chunk-IJBDOHL6.mjs";import{o as b}from"./chunk-VY2OSTJR.mjs";import"./chunk-STOV2HOB.mjs";import{O as x,S as B,T as C,U as S,V as $,W as v,X as T,Y as W,j as P,t as w}from"./chunk-QJSWEUOL.mjs";import{b as h}from"./chunk-H7VHZCWX.mjs";import{a as c}from"./chunk-AQ6EADP3.mjs";var O=P.packet,y=class{constructor(){this.packet=[];this.setAccTitle=C;this.getAccTitle=S;this.setDiagramTitle=T;this.getDiagramTitle=W;this.getAccDescription=v;this.setAccDescription=$}static{c(this,"PacketDB")}getConfig(){let t=b({...O,...w().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){B(),this.packet=[]}};var _=1e4,V=c((e,t)=>{A(e,t);let a=-1,o=[],s=1,{bitsPerRow:l}=t.getConfig();for(let{start:r,end:n,bits:d,label:p}of e.blocks){if(r!==void 0&&n!==void 0&&n<r)throw new Error(`Packet block ${r} - ${n} is invalid. End must be greater than start.`);if(r??=a+1,r!==a+1)throw new Error(`Packet block ${r} - ${n??r} is not contiguous. It should start from ${a+1}.`);if(d===0)throw new Error(`Packet block ${r} is invalid. Cannot have a zero bit field.`);for(n??=r+(d??1)-1,d??=n-r+1,a=n,h.debug(`Packet block ${r} - ${a} with label ${p}`);o.length<=l+1&&t.getPacket().length<_;){let[m,i]=q({start:r,end:n,bits:d,label:p},s,l);if(o.push(m),m.end+1===s*l&&(t.pushWord(o),o=[],s++),!i)break;({start:r,end:n,bits:d,label:p}=i)}}t.pushWord(o)},"populate"),q=c((e,t,a)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*a)return[e,void 0];let o=t*a-1,s=t*a;return[{start:e.start,end:o,label:e.label,bits:o-e.start},{start:s,end:e.end,label:e.label,bits:e.end-s}]},"getNextFittingBlock"),D={parser:{yy:void 0},parse:c(async e=>{let t=await j("packet",e),a=D.parser?.yy;if(!(a instanceof y))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.");h.debug(t),V(t,a)},"parse")};var L=c((e,t,a,o)=>{let s=o.db,l=s.getConfig(),{rowHeight:r,paddingY:n,bitWidth:d,bitsPerRow:p}=l,m=s.getPacket(),i=s.getDiagramTitle(),g=r+n,f=g*(m.length+1)-(i?0:r),k=d*p+2,u=E(t);u.attr("viewBox",`0 0 ${k} ${f}`),x(u,f,k,l.useMaxWidth);for(let[G,R]of m.entries())M(u,R,G,l);u.append("text").text(i).attr("x",k/2).attr("y",f-g/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),M=c((e,t,a,{rowHeight:o,paddingX:s,paddingY:l,bitWidth:r,bitsPerRow:n,showBits:d})=>{let p=e.append("g"),m=a*(o+l)+l;for(let i of t){let g=i.start%n*r+1,f=(i.end-i.start+1)*r-s;if(p.append("rect").attr("x",g).attr("y",m).attr("width",f).attr("height",o).attr("class","packetBlock"),p.append("text").attr("x",g+f/2).attr("y",m+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(i.label),!d)continue;let k=i.end===i.start,u=m-2;p.append("text").attr("x",g+(k?f/2:0)).attr("y",u).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(i.start),k||p.append("text").attr("x",g+f).attr("y",u).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(i.end)}},"drawWord"),F={draw:L};var N={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},z=c(({packet:e}={})=>{let t=b(N,e);return`
|
|
2
|
+
.packetByte {
|
|
3
|
+
font-size: ${t.byteFontSize};
|
|
4
|
+
}
|
|
5
|
+
.packetByte.start {
|
|
6
|
+
fill: ${t.startByteColor};
|
|
7
|
+
}
|
|
8
|
+
.packetByte.end {
|
|
9
|
+
fill: ${t.endByteColor};
|
|
10
|
+
}
|
|
11
|
+
.packetLabel {
|
|
12
|
+
fill: ${t.labelColor};
|
|
13
|
+
font-size: ${t.labelFontSize};
|
|
14
|
+
}
|
|
15
|
+
.packetTitle {
|
|
16
|
+
fill: ${t.titleColor};
|
|
17
|
+
font-size: ${t.titleFontSize};
|
|
18
|
+
}
|
|
19
|
+
.packetBlock {
|
|
20
|
+
stroke: ${t.blockStrokeColor};
|
|
21
|
+
stroke-width: ${t.blockStrokeWidth};
|
|
22
|
+
fill: ${t.blockFillColor};
|
|
23
|
+
}
|
|
24
|
+
`},"styles");var gt={parser:D,get db(){return new y},renderer:F,styles:z};export{gt as diagram};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{a as P}from"./chunk-JQRUD6KW.mjs";import{a as j}from"./chunk-5IQCK5RY.mjs";import"./chunk-JZGDI5JK.mjs";import"./chunk-OJINMHTS.mjs";import"./chunk-VQC2EELJ.mjs";import"./chunk-KD6SPIPN.mjs";import"./chunk-Q6NGPIAH.mjs";import"./chunk-RT4MAWR3.mjs";import"./chunk-YBMQ5JGJ.mjs";import"./chunk-GDY2UAB4.mjs";import"./chunk-3SMGFRGC.mjs";import"./chunk-3NPNU5GP.mjs";import"./chunk-TCEHX7R3.mjs";import"./chunk-5MVFYWFU.mjs";import"./chunk-SFMINX4W.mjs";import"./chunk-JFFVMJIA.mjs";import"./chunk-ZUNWM646.mjs";import"./chunk-ZS6VBONO.mjs";import{a as V}from"./chunk-IJBDOHL6.mjs";import{o as R}from"./chunk-VY2OSTJR.mjs";import"./chunk-STOV2HOB.mjs";import{O as w,S,T as M,U as O,V as T,W as G,X as L,Y as k,h as v,j as A,t as C}from"./chunk-QJSWEUOL.mjs";import{b as $}from"./chunk-H7VHZCWX.mjs";import{a as n}from"./chunk-AQ6EADP3.mjs";var f={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},D=32,I={axes:[],curves:[],options:f},g=structuredClone(I),W=A.radar,H=n(()=>R({...W,...C().radar}),"getConfig"),E=n(()=>g.axes,"getAxes"),U=n(()=>g.curves,"getCurves"),N=n(()=>g.options,"getOptions"),X=n(e=>{g.axes=e.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),K=n(e=>{g.curves=e.map(t=>({name:t.name,label:t.label??t.name,entries:Y(t.entries)}))},"setCurves"),Y=n(e=>{if(e[0].axis==null)return e.map(r=>r.value);let t=E();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(r=>{let a=e.find(o=>o.axis?.$refText===r.name);if(a===void 0)throw new Error("Missing entry for axis "+r.label);return a.value})},"computeCurveEntries"),Z=n(e=>{let t=e.reduce((r,a)=>(r[a.name]=a,r),{});g.options={showLegend:t.showLegend?.value??f.showLegend,ticks:t.ticks?.value??f.ticks,max:t.max?.value??f.max,min:t.min?.value??f.min,graticule:t.graticule?.value??f.graticule},g.options.ticks>D&&($.warn(`Radar diagram ticks (${g.options.ticks}) exceeds maximum allowed (${D}). Using ${D} instead.`),g.options.ticks=D)},"setOptions"),J=n(()=>{S(),g=structuredClone(I)},"clear"),x={getAxes:E,getCurves:U,getOptions:N,setAxes:X,setCurves:K,setOptions:Z,getConfig:H,clear:J,setAccTitle:M,getAccTitle:O,setDiagramTitle:L,getDiagramTitle:k,getAccDescription:G,setAccDescription:T};var Q=n(e=>{P(e,x);let{axes:t,curves:r,options:a}=e;x.setAxes(t),x.setCurves(r),x.setOptions(a)},"populate"),F={parse:n(async e=>{let t=await j("radar",e);$.debug(t),Q(t)},"parse")};var tt=n((e,t,r,a)=>{let o=a.db,c=o.getAxes(),m=o.getCurves(),i=o.getOptions(),s=o.getConfig(),l=o.getDiagramTitle(),p=V(t),d=rt(p,s),u=i.max??Math.max(...m.map(b=>Math.max(...b.entries))),h=i.min,y=Math.min(s.width,s.height)/2;et(d,c,y,i.ticks,i.graticule),at(d,c,y,s),ot(d,c,m,h,u,i.graticule,s),st(d,m,i.showLegend,s),d.append("text").attr("class","radarTitle").text(l).attr("x",0).attr("y",-s.height/2-s.marginTop)},"draw"),rt=n((e,t)=>{let r=t.width+t.marginLeft+t.marginRight,a=t.height+t.marginTop+t.marginBottom,o={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return w(e,a,r,t.useMaxWidth??!0),e.attr("viewBox",`0 0 ${r} ${a}`).attr("overflow","visible"),e.append("g").attr("transform",`translate(${o.x}, ${o.y})`)},"drawFrame"),et=n((e,t,r,a,o)=>{if(o==="circle")for(let c=0;c<a;c++){let m=r*(c+1)/a;e.append("circle").attr("r",m).attr("class","radarGraticule")}else if(o==="polygon"){let c=t.length;for(let m=0;m<a;m++){let i=r*(m+1)/a,s=t.map((l,p)=>{let d=2*p*Math.PI/c-Math.PI/2,u=i*Math.cos(d),h=i*Math.sin(d);return`${u},${h}`}).join(" ");e.append("polygon").attr("points",s).attr("class","radarGraticule")}}},"drawGraticule"),at=n((e,t,r,a)=>{let o=t.length;for(let c=0;c<o;c++){let m=t[c].label,i=2*c*Math.PI/o-Math.PI/2,s=Math.cos(i),l=Math.sin(i);e.append("line").attr("x1",0).attr("y1",0).attr("x2",r*a.axisScaleFactor*s).attr("y2",r*a.axisScaleFactor*l).attr("class","radarAxisLine");let p=s>.01?"start":s<-.01?"end":"middle",d=l>.01?"hanging":l<-.01?"auto":"central",u=4;e.append("text").text(m).attr("x",r*a.axisLabelFactor*s+u*s).attr("y",r*a.axisLabelFactor*l+u*l).attr("text-anchor",p).attr("dominant-baseline",d).attr("class","radarAxisLabel")}},"drawAxes");function ot(e,t,r,a,o,c,m){let i=t.length,s=Math.min(m.width,m.height)/2;r.forEach((l,p)=>{if(l.entries.length!==i)return;let d=l.entries.map((u,h)=>{let y=2*Math.PI*h/i-Math.PI/2,b=nt(u,a,o,s),z=b*Math.cos(y),q=b*Math.sin(y);return{x:z,y:q}});c==="circle"?e.append("path").attr("d",it(d,m.curveTension)).attr("class",`radarCurve-${p}`):c==="polygon"&&e.append("polygon").attr("points",d.map(u=>`${u.x},${u.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}n(ot,"drawCurves");function nt(e,t,r,a){let o=Math.min(Math.max(e,t),r);return a*(o-t)/(r-t)}n(nt,"relativeRadius");function it(e,t){let r=e.length,a=`M${e[0].x},${e[0].y}`;for(let o=0;o<r;o++){let c=e[(o-1+r)%r],m=e[o],i=e[(o+1)%r],s=e[(o+2)%r],l={x:m.x+(i.x-c.x)*t,y:m.y+(i.y-c.y)*t},p={x:i.x-(s.x-m.x)*t,y:i.y-(s.y-m.y)*t};a+=` C${l.x},${l.y} ${p.x},${p.y} ${i.x},${i.y}`}return`${a} Z`}n(it,"closedRoundCurve");function st(e,t,r,a){if(!r)return;let o=(a.width/2+a.marginRight)*3/4,c=-(a.height/2+a.marginTop)*3/4,m=20;t.forEach((i,s)=>{let l=e.append("g").attr("transform",`translate(${o}, ${c+s*m})`);l.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${s}`),l.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(i.label)})}n(st,"drawLegend");var B={draw:tt};var ct=n((e,t)=>{let r="";for(let a=0;a<e.THEME_COLOR_LIMIT;a++){let o=e[`cScale${a}`];r+=`
|
|
2
|
+
.radarCurve-${a} {
|
|
3
|
+
color: ${o};
|
|
4
|
+
fill: ${o};
|
|
5
|
+
fill-opacity: ${t.curveOpacity};
|
|
6
|
+
stroke: ${o};
|
|
7
|
+
stroke-width: ${t.curveStrokeWidth};
|
|
8
|
+
}
|
|
9
|
+
.radarLegendBox-${a} {
|
|
10
|
+
fill: ${o};
|
|
11
|
+
fill-opacity: ${t.curveOpacity};
|
|
12
|
+
stroke: ${o};
|
|
13
|
+
}
|
|
14
|
+
`}return r},"genIndexStyles"),mt=n(e=>{let t=v(),r=C(),a=R(t,r.themeVariables),o=R(a.radar,e);return{themeVariables:a,radarOptions:o}},"buildRadarStyleOptions"),_=n(({radar:e}={})=>{let{themeVariables:t,radarOptions:r}=mt(e);return`
|
|
15
|
+
.radarTitle {
|
|
16
|
+
font-size: ${t.fontSize};
|
|
17
|
+
color: ${t.titleColor};
|
|
18
|
+
dominant-baseline: hanging;
|
|
19
|
+
text-anchor: middle;
|
|
20
|
+
}
|
|
21
|
+
.radarAxisLine {
|
|
22
|
+
stroke: ${r.axisColor};
|
|
23
|
+
stroke-width: ${r.axisStrokeWidth};
|
|
24
|
+
}
|
|
25
|
+
.radarAxisLabel {
|
|
26
|
+
font-size: ${r.axisLabelFontSize}px;
|
|
27
|
+
color: ${r.axisColor};
|
|
28
|
+
}
|
|
29
|
+
.radarGraticule {
|
|
30
|
+
fill: ${r.graticuleColor};
|
|
31
|
+
fill-opacity: ${r.graticuleOpacity};
|
|
32
|
+
stroke: ${r.graticuleColor};
|
|
33
|
+
stroke-width: ${r.graticuleStrokeWidth};
|
|
34
|
+
}
|
|
35
|
+
.radarLegendText {
|
|
36
|
+
text-anchor: start;
|
|
37
|
+
font-size: ${r.legendFontSize}px;
|
|
38
|
+
dominant-baseline: hanging;
|
|
39
|
+
}
|
|
40
|
+
${ct(t,r)}
|
|
41
|
+
`},"styles");var Vt={parser:F,db:x,renderer:B,styles:_};export{Vt as diagram};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{a as ye}from"./chunk-JQRUD6KW.mjs";import{a as ue}from"./chunk-5IQCK5RY.mjs";import"./chunk-JZGDI5JK.mjs";import"./chunk-OJINMHTS.mjs";import"./chunk-VQC2EELJ.mjs";import"./chunk-KD6SPIPN.mjs";import"./chunk-Q6NGPIAH.mjs";import"./chunk-RT4MAWR3.mjs";import"./chunk-YBMQ5JGJ.mjs";import"./chunk-GDY2UAB4.mjs";import"./chunk-3SMGFRGC.mjs";import"./chunk-3NPNU5GP.mjs";import"./chunk-TCEHX7R3.mjs";import"./chunk-5MVFYWFU.mjs";import"./chunk-SFMINX4W.mjs";import"./chunk-JFFVMJIA.mjs";import"./chunk-ZUNWM646.mjs";import"./chunk-ZS6VBONO.mjs";import{a as Se}from"./chunk-IJBDOHL6.mjs";import{a as he}from"./chunk-VTHDQ7BV.mjs";import{c as ge,d as w}from"./chunk-ZNLK7HRR.mjs";import{o as W}from"./chunk-VY2OSTJR.mjs";import"./chunk-STOV2HOB.mjs";import{O as se,S as le,T as oe,U as ne,V as ie,W as ce,X as pe,Y as me,h as ae,j as re,t as L}from"./chunk-QJSWEUOL.mjs";import{b as k,h as E,j as P,k as de,l as fe,m as I}from"./chunk-H7VHZCWX.mjs";import{a as p}from"./chunk-AQ6EADP3.mjs";var F=class{constructor(){this.nodes=[];this.levels=new Map;this.outerNodes=[];this.classes=new Map;this.setAccTitle=oe;this.getAccTitle=ne;this.setDiagramTitle=pe;this.getDiagramTitle=me;this.getAccDescription=ce;this.setAccDescription=ie}static{p(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){let r=re,i=L();return W({...r.treemap,...i.treemap??{}})}addNode(r,i){this.nodes.push(r),this.levels.set(r,i),i===0&&(this.outerNodes.push(r),this.root??=r)}getRoot(){return{name:"",children:this.outerNodes}}addClass(r,i){let l=this.classes.get(r)??{id:r,styles:[],textStyles:[]},o=i.replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/§§§/g,",").split(";");o&&o.forEach(s=>{ge(s)&&(l?.textStyles?l.textStyles.push(s):l.textStyles=[s]),l?.styles?l.styles.push(s):l.styles=[s]}),this.classes.set(r,l)}getClasses(){return this.classes}getStylesForClass(r){return this.classes.get(r)?.styles??[]}clear(){le(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function be(m){if(!m.length)return[];let r=[],i=[];return m.forEach(l=>{let o={name:l.name,children:l.type==="Leaf"?void 0:[]};for(o.classSelector=l?.classSelector,l?.cssCompiledStyles&&(o.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(o.value=l.value);i.length>0&&i[i.length-1].level>=l.level;)i.pop();if(i.length===0)r.push(o);else{let s=i[i.length-1].node;s.children?s.children.push(o):s.children=[o]}l.type!=="Leaf"&&i.push({node:o,level:l.level})}),r}p(be,"buildHierarchy");var Pe=p((m,r)=>{ye(m,r);let i=[];for(let s of m.TreemapRows??[])s.$type==="ClassDefStatement"&&r.addClass(s.className??"",s.styleText??"");for(let s of m.TreemapRows??[]){let d=s.item;if(!d)continue;let f=s.indent?parseInt(s.indent):0,R=Fe(d),a=d.classSelector?r.getStylesForClass(d.classSelector):[],z=a.length>0?a:void 0,x={level:f,name:R,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:z};i.push(x)}let l=be(i),o=p((s,d)=>{for(let f of s)r.addNode(f,d),f.children&&f.children.length>0&&o(f.children,d+1)},"addNodesRecursively");o(l,0)},"populate"),Fe=p(m=>m.name?String(m.name):"","getItemName"),Y={parser:{yy:void 0},parse:p(async m=>{try{let i=await ue("treemap",m);k.debug("Treemap AST:",i);let l=Y.parser?.yy;if(!(l instanceof F))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.");Pe(i,l)}catch(r){throw k.error("Error parsing treemap:",r),r}},"parse")};var Ae=10,A=10,B=25,ze=p((m,r,i,l)=>{let o=l.db,s=o.getConfig(),d=s.padding??Ae,f=o.getDiagramTitle(),R=o.getRoot(),{themeVariables:a}=L();if(!R)return;let z=f?30:0,x=Se(r),q=s.nodeWidth?s.nodeWidth*A:960,U=s.nodeHeight?s.nodeHeight*A:500,G=q,J=U+z;x.attr("viewBox",`0 0 ${G} ${J}`),se(x,J,G,s.useMaxWidth);let T;try{let e=s.valueFormat||",";if(e==="$0,0")T=p(t=>"$"+P(",")(t),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){let t=/\.\d+/.exec(e),n=t?t[0]:"";T=p(g=>"$"+P(","+n)(g),"valueFormat")}else if(e.startsWith("$")){let t=e.substring(1);T=p(n=>"$"+P(t||"")(n),"valueFormat")}else T=P(e)}catch(e){k.error("Error creating format function:",e),T=P(",")}let M=I().range(["transparent",a.cScale0,a.cScale1,a.cScale2,a.cScale3,a.cScale4,a.cScale5,a.cScale6,a.cScale7,a.cScale8,a.cScale9,a.cScale10,a.cScale11]),Ce=I().range(["transparent",a.cScalePeer0,a.cScalePeer1,a.cScalePeer2,a.cScalePeer3,a.cScalePeer4,a.cScalePeer5,a.cScalePeer6,a.cScalePeer7,a.cScalePeer8,a.cScalePeer9,a.cScalePeer10,a.cScalePeer11]),H=I().range([a.cScaleLabel0,a.cScaleLabel1,a.cScaleLabel2,a.cScaleLabel3,a.cScaleLabel4,a.cScaleLabel5,a.cScaleLabel6,a.cScaleLabel7,a.cScaleLabel8,a.cScaleLabel9,a.cScaleLabel10,a.cScaleLabel11]);f&&x.append("text").attr("x",G/2).attr("y",z/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(f);let K=x.append("g").attr("transform",`translate(0, ${z})`).attr("class","treemapContainer"),De=de(R).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),Q=fe().size([q,U]).paddingTop(e=>e.children&&e.children.length>0?B+A:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?A:0).paddingRight(e=>e.children&&e.children.length>0?A:0).paddingBottom(e=>e.children&&e.children.length>0?A:0).round(!0)(De),ve=Q.descendants().filter(e=>e.children&&e.children.length>0),V=K.selectAll(".treemapSection").data(ve).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);V.append("rect").attr("width",e=>e.x1-e.x0).attr("height",B).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),V.append("clipPath").attr("id",(e,t)=>`clip-section-${r}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",B),V.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,t)=>`treemapSection section${t}`).attr("fill",e=>M(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>Ce(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";let t=w({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+";"+t.borderStyles.join(";")}),V.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",B/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,t)=>`url(#clip-section-${r}-${t})`).attr("style",e=>{if(e.depth===0)return"display: none;";let t="dominant-baseline: middle; font-size: 12px; fill:"+H(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",n=w({cssCompiledStyles:e.data.cssCompiledStyles});return t+n.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;let t=E(this),n=e.data.name;t.text(n);let g=e.x1-e.x0,u=6,h;s.showValues!==!1&&e.value?h=g-10-30-10-u:h=g-u-6;let c=Math.max(15,h),D=t.node();if(D.getComputedTextLength()>c){let v=n;for(;v.length>0;){if(v=n.substring(0,v.length-1),v.length===0){t.text("..."),D.getComputedTextLength()>c&&t.text("");break}if(t.text(v+"..."),D.getComputedTextLength()<=c)break}}}),s.showValues!==!1&&V.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",B/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?T(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";let t="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+H(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",n=w({cssCompiledStyles:e.data.cssCompiledStyles});return t+n.labelStyles.replace("color:","fill:")});let Z=Q.leaves(),S=Z.length>20,we=S?16:38,_=S?14:28,N=S?4:8,$=S?4:6,O=S?2:4,ee=S?8:10,X=S?1:2,j=K.selectAll(".treemapLeafGroup").data(Z).enter().append("g").attr("class",(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?M(e.parent.data.name):M(e.data.name)).attr("style",e=>w({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?M(e.parent.data.name):M(e.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(e,t)=>`clip-${r}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{let t=`text-anchor: middle; dominant-baseline: middle; font-size: ${we}px;fill:`+H(e.data.name)+";",n=w({cssCompiledStyles:e.data.cssCompiledStyles});return t+n.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,t)=>`url(#clip-${r}-${t})`).text(e=>e.data.name).each(function(e){let t=E(this),n=e.x1-e.x0,g=e.y1-e.y0,u=t.node(),h=n-2*O,C=g-2*O;if(h<ee||C<ee){t.style("display","none");return}let c=parseInt(t.style("font-size"),10),D=.6;for(;u.getComputedTextLength()>h&&c>N;)c--,t.style("font-size",`${c}px`);let y=Math.max($,Math.min(_,Math.round(c*D))),b=c+X+y;for(;b>C&&c>N&&(c--,y=Math.max($,Math.min(_,Math.round(c*D))),!(y<$&&c===N));)t.style("font-size",`${c}px`),b=c+X+y,y<=$&&b>C;t.style("font-size",`${c}px`),S?(c<N||C<N)&&t.style("display","none"):(u.getComputedTextLength()>h||c<N||C<c)&&t.style("display","none")}),s.showValues!==!1&&j.append("text").attr("class","treemapValue").attr("x",t=>(t.x1-t.x0)/2).attr("y",function(t){return(t.y1-t.y0)/2}).attr("style",t=>{let n=`text-anchor: middle; dominant-baseline: hanging; font-size: ${_}px;fill:`+H(t.data.name)+";",g=w({cssCompiledStyles:t.data.cssCompiledStyles});return n+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,n)=>`url(#clip-${r}-${n})`).text(t=>t.value?T(t.value):"").each(function(t){let n=E(this),g=this.parentNode;if(!g){n.style("display","none");return}let u=E(g).select(".treemapLabel");if(u.empty()||u.style("display")==="none"){n.style("display","none");return}let h=parseFloat(u.style("font-size")),c=Math.max($,Math.min(_,Math.round(h*.6)));n.style("font-size",`${c}px`);let y=(t.y1-t.y0)/2+h/2+X;n.attr("y",y);let b=t.x1-t.x0,te=t.y1-t.y0-4,Le=b-2*O;n.node().getComputedTextLength()>Le||y+c>te||c<$?n.style("display","none"):n.style("display",null)});let Ne=s.diagramPadding??8;he(x,Ne,"flowchart",s?.useMaxWidth||!1)},"draw"),Me=p(function(m,r){return r.db.getClasses()},"getClasses"),xe={draw:ze,getClasses:Me};var Ve={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},ke=p(({treemap:m}={})=>{let r=ae(),i=L(),l=W(r,i.themeVariables),o=W(Ve,m),s=o.titleColor??l.titleColor,d=o.labelColor??l.textColor,f=o.valueColor??l.textColor;return`
|
|
2
|
+
.treemapNode.section {
|
|
3
|
+
stroke: ${o.sectionStrokeColor};
|
|
4
|
+
stroke-width: ${o.sectionStrokeWidth};
|
|
5
|
+
fill: ${o.sectionFillColor};
|
|
6
|
+
}
|
|
7
|
+
.treemapNode.leaf {
|
|
8
|
+
stroke: ${o.leafStrokeColor};
|
|
9
|
+
stroke-width: ${o.leafStrokeWidth};
|
|
10
|
+
fill: ${o.leafFillColor};
|
|
11
|
+
}
|
|
12
|
+
.treemapLabel {
|
|
13
|
+
fill: ${d};
|
|
14
|
+
font-size: ${o.labelFontSize};
|
|
15
|
+
}
|
|
16
|
+
.treemapValue {
|
|
17
|
+
fill: ${f};
|
|
18
|
+
font-size: ${o.valueFontSize};
|
|
19
|
+
}
|
|
20
|
+
.treemapTitle {
|
|
21
|
+
fill: ${s};
|
|
22
|
+
font-size: ${o.titleFontSize};
|
|
23
|
+
}
|
|
24
|
+
`},"getStyles"),Te=ke;var St={parser:Y,get db(){return new F},renderer:xe,styles:Te};export{St as diagram};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{a as O}from"./chunk-T5OCTHI4.mjs";import{a as j}from"./chunk-JQRUD6KW.mjs";import{a as _}from"./chunk-5IQCK5RY.mjs";import"./chunk-JZGDI5JK.mjs";import"./chunk-OJINMHTS.mjs";import"./chunk-VQC2EELJ.mjs";import"./chunk-KD6SPIPN.mjs";import"./chunk-Q6NGPIAH.mjs";import"./chunk-RT4MAWR3.mjs";import"./chunk-YBMQ5JGJ.mjs";import"./chunk-GDY2UAB4.mjs";import"./chunk-3SMGFRGC.mjs";import"./chunk-3NPNU5GP.mjs";import"./chunk-TCEHX7R3.mjs";import"./chunk-5MVFYWFU.mjs";import"./chunk-SFMINX4W.mjs";import"./chunk-JFFVMJIA.mjs";import"./chunk-ZUNWM646.mjs";import"./chunk-ZS6VBONO.mjs";import{a as H}from"./chunk-IJBDOHL6.mjs";import{b as k,d as B}from"./chunk-2NMSUPJH.mjs";import{o as C}from"./chunk-VY2OSTJR.mjs";import"./chunk-STOV2HOB.mjs";import{A as E,O as R,S as G,T as $,U as A,V as M,W as v,X as L,Y as P,j as S,t as T}from"./chunk-QJSWEUOL.mjs";import{b as V}from"./chunk-H7VHZCWX.mjs";import{a as l}from"./chunk-AQ6EADP3.mjs";var q=/[─━│┃└┗├┣]/,Y=/[└┗├┣]/,ne=/[─━]/,X=/^[\s│┃]+$/,z=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,W=/^\s*%%/,re=" ";function ie(n){return n.some(t=>q.test(t))}l(ie,"isBoxDrawingFormat");function oe(n){for(let t of n){let e=Y.exec(t);if(e?.index&&e.index>0)return e.index}return 4}l(oe,"inferSegmentWidth");function F(n,t){return n.replace(/\bline\s+(\d+)\b/gi,(e,r)=>{let s=parseInt(r,10),i=t.get(s);return i?`line ${i}`:e})}l(F,"remapErrorLines");function U(n){let t=n.split(`
|
|
2
|
+
`),e=new Map,r=-1;for(let[g,c]of t.entries())if(c.trim()==="treeView-beta"){r=g;break}if(r===-1)return{text:n,lineMap:e};let s=[];for(let g=r+1;g<t.length;g++){let c=t[g];c.trim()===""||W.test(c)||z.test(c)||X.test(c)||s.push(c.replace(/\t/g," "))}if(!ie(s))return{text:n,lineMap:e};let i=oe(s),o=[],a=0;for(let g=0;g<=r;g++)o.push(t[g]),a++,e.set(a,g+1);for(let g=r+1;g<t.length;g++){let c=t[g],p=c.trim(),m=g+1;if(p===""){o.push(c),a++,e.set(a,m);continue}if(W.test(c)){o.push(c),a++,e.set(a,m);continue}if(z.test(c)){o.push(c),a++,e.set(a,m);continue}if(X.test(c))continue;let d=c.replace(/\t/g," "),u=Y.exec(d);if(u?.index!==void 0){let f=u.index,w=Math.round(f/i)+1,h=f+1;for(;h<d.length&&ne.test(d[h]);)h++;for(;h<d.length&&d[h]===" ";)h++;let y=d.slice(h).trimEnd();if(!y)throw new Error(`Line ${m}: Empty node \u2014 expected a filename or directory name after the box-drawing prefix`);let te=re.repeat(w);o.push(te+y),a++,e.set(a,m)}else{if(/^[\s─━│┃└┗├┣]+$/.test(d))continue;if(q.test(d))o.push(c),a++,e.set(a,m);else{if(/^\s+/.test(d))throw new Error(`Line ${m}: Unexpected indentation without box-drawing characters. In box-drawing format, use \u251C\u2500\u2500 or \u2514\u2500\u2500 prefixes for indented nodes.`);o.push(c),a++,e.set(a,m)}}}return{text:o.join(`
|
|
3
|
+
`),lineMap:e}}l(U,"preprocessBoxDrawing");var x=new O(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),se=l(()=>{x.reset(),G()},"clear"),ae=l(()=>x.records.stack[0],"getRoot"),ce=l(()=>x.records.cnt,"getCount"),de=S.treeView,le=l(()=>C(de,T().treeView),"getConfig"),pe=l((n,t,e,r,s,i)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();let o={id:x.records.cnt++,level:n,name:t,nodeType:e,icon:s,cssClass:r,description:i,children:[]};x.records.stack[x.records.stack.length-1].children.push(o),x.records.stack.push(o)},"addNode"),me={clear:se,addNode:pe,getRoot:ae,getCount:ce,getConfig:le,getAccTitle:A,getAccDescription:v,getDiagramTitle:P,setAccDescription:M,setAccTitle:$,setDiagramTitle:L},D=me;var ge=l(n=>{j(n,D);for(let t of n.nodes){let e=typeof t.indent=="number"?t.indent:0,r=t.name,s=r.endsWith("/");s&&(r=r.slice(0,-1));let i=s?"directory":"file",o=t.classAnnotation||void 0,a=t.iconAnnotation,g=a!==void 0?a||"none":void 0,c=t.descAnnotation||void 0,p=c?E(c,T()):void 0;D.addNode(e,r,i,o,g,p)}},"populate"),Z={parse:l(async n=>{let{text:t,lineMap:e}=U(n);try{let r=await _("treeView",t);V.debug(r),ge(r)}catch(r){throw e.size>0&&r instanceof Error&&(r.message=F(r.message,e)),r}},"parse")};var b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function fe(n,t){let e=t?.filenameIcons?.[n];if(e)return e;let r=n.lastIndexOf(".");if(r>0){let s=n.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[s]??i?.[s.slice(1)]}}l(fe,"detectIcon");function J(n,t){return n.includes(":")?n:n in b.icons||!t?`${b.prefix}:${n}`:`${t}:${n}`}l(J,"qualifyIcon");function I(n,t){if(n.icon!=="none"){if(n.icon)return J(n.icon,t.defaultIconPack);if(t.showIcons){if(n.nodeType==="file"){let e=fe(n.name,t);if(e==="none")return;if(e)return J(e,t.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}l(I,"getNodeIcon");k([{name:b.prefix,icons:b}]);var N=14,he=4,ue=16,we=l(async(n,t)=>{let e=[],r=l(i=>{let o=I(i,t);o&&e.push({icon:o,node:i}),i.children.forEach(r)},"collect");r(n);let s=await Promise.all(e.map(async({icon:i,node:o})=>({id:o.id,svg:await B(i,{height:N,width:N})})));return new Map(s.map(({id:i,svg:o})=>[i,o]))},"resolveNodeIcons"),xe=l((n,t,e,r,s,i)=>{let o=r.append("g"),a="treeView-node-label";e.nodeType==="directory"&&(a+=" treeView-node-dir"),e.cssClass&&(a+=` ${e.cssClass}`);let g=N+he,c=I(e,s),p=c!==void 0;c&&o.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${n+s.paddingX}, ${t+s.paddingY})`).html(i.get(e.id)??"");let m=o.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",a),{height:d,width:u}=m.node().getBBox(),f=d+s.paddingY*2,w=n+s.paddingX+(p?g:0);m.attr("x",w),m.attr("y",t+f/2);let h=w+u,y=u+s.paddingX*2+(p?g:0);return e.BBox={x:n,y:t,width:y,height:f},e.cssClass?.split(/\s+/).includes("highlight")&&o.insert("rect",":first-child").attr("x",n).attr("y",t+1).attr("width",0).attr("height",f-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:o,labelRightEdge:h,centerY:t+f/2}},"positionLabel"),K=l((n,t,e,r,s,i)=>n.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",s).attr("stroke-width",i).attr("class","treeView-node-line"),"positionLine"),ye=l((n,t,e,r)=>{let s=0,i=0,o=[],a=l((p,m,d,u)=>{let f=u*(d.rowIndent+d.paddingX),w=xe(f,s,m,p,d,r);o.push(w);let{height:h,width:y}=m.BBox;K(p,f-d.rowIndent,s+h/2,f,s+h/2,d.lineThickness),i=Math.max(i,f+y),s+=h},"drawNode"),g=l((p,m=0)=>{a(n,p,e,m),p.children.forEach(w=>{g(w,m+1)});let{x:d,y:u,height:f}=p.BBox;if(p.children.length){let{y:w,height:h}=p.children[p.children.length-1].BBox;K(n,d+e.paddingX,u+f,d+e.paddingX,w+h/2+e.lineThickness/2,e.lineThickness)}},"processNode");g(t);let c=o.filter(p=>p.node.description);if(c.length>0){let m=Math.max(...o.map(d=>d.labelRightEdge))+ue;for(let d of c){let f=d.nodeGroup.append("text").text(d.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",m).attr("y",d.centerY).node().getBBox();i=Math.max(i,m+f.width+e.paddingX)}}for(let p of o)if(p.node.cssClass?.split(/\s+/).includes("highlight")){let m=p.nodeGroup.select(".treeView-highlight-bg");if(!m.empty()){let d=i-p.node.BBox.x+8;m.attr("width",d),i=Math.max(i,p.node.BBox.x+d+2)}}return{totalHeight:s,totalWidth:i}},"drawTree"),be=l(async(n,t,e,r)=>{V.debug(`Rendering treeView diagram
|
|
4
|
+
`+n);let s=r.db,i=s.getRoot(),o=s.getConfig(),a=H(t),g=a.append("g");g.attr("class","tree-view");let c=await we(i,o),{totalHeight:p,totalWidth:m}=ye(g,i,o,c);a.attr("viewBox",`-${o.lineThickness/2} 0 ${m} ${p}`),R(a,p,m,o.useMaxWidth)},"draw"),De={draw:be},Q=De;var Ve={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Te=l(({treeView:n})=>{let{labelFontSize:t,labelColor:e,lineColor:r,iconColor:s,descriptionColor:i,highlightBg:o,highlightStroke:a}=C(Ve,n);return`
|
|
5
|
+
.treeView-node-label {
|
|
6
|
+
font-size: ${t};
|
|
7
|
+
fill: ${e};
|
|
8
|
+
white-space: pre;
|
|
9
|
+
}
|
|
10
|
+
.treeView-node-dir {
|
|
11
|
+
font-weight: bold;
|
|
12
|
+
}
|
|
13
|
+
.treeView-node-line {
|
|
14
|
+
stroke: ${r};
|
|
15
|
+
}
|
|
16
|
+
.treeView-node-icon {
|
|
17
|
+
color: ${s};
|
|
18
|
+
}
|
|
19
|
+
.treeView-node-description {
|
|
20
|
+
font-size: ${t};
|
|
21
|
+
fill: ${i};
|
|
22
|
+
font-style: italic;
|
|
23
|
+
white-space: pre;
|
|
24
|
+
}
|
|
25
|
+
.treeView-highlight-bg {
|
|
26
|
+
fill: ${o};
|
|
27
|
+
stroke: ${a};
|
|
28
|
+
stroke-width: 1;
|
|
29
|
+
}
|
|
30
|
+
`},"styles"),ee=Te;var it={db:D,renderer:Q,parser:Z,styles:ee};export{it as diagram};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as X}from"./chunk-JQRUD6KW.mjs";import{a as K}from"./chunk-5IQCK5RY.mjs";import"./chunk-JZGDI5JK.mjs";import"./chunk-OJINMHTS.mjs";import"./chunk-VQC2EELJ.mjs";import"./chunk-KD6SPIPN.mjs";import"./chunk-Q6NGPIAH.mjs";import"./chunk-RT4MAWR3.mjs";import"./chunk-YBMQ5JGJ.mjs";import"./chunk-GDY2UAB4.mjs";import"./chunk-3SMGFRGC.mjs";import"./chunk-3NPNU5GP.mjs";import"./chunk-TCEHX7R3.mjs";import"./chunk-5MVFYWFU.mjs";import"./chunk-SFMINX4W.mjs";import"./chunk-JFFVMJIA.mjs";import"./chunk-ZUNWM646.mjs";import{f as G}from"./chunk-ZS6VBONO.mjs";import{i as y,l as L,o as V}from"./chunk-VY2OSTJR.mjs";import"./chunk-STOV2HOB.mjs";import{A as v,S as A,T as $,U as O,V as W,W as H,X as N,Y as j,_ as F,ca as I,j as T,t as w}from"./chunk-QJSWEUOL.mjs";import{b as x,h as U}from"./chunk-H7VHZCWX.mjs";import{a}from"./chunk-AQ6EADP3.mjs";var S="position frame",B="frame positioned",P="position relation",M="relation positioned";var Z=a(function(e){x.debug("options str",e)},"setOptions"),ee=a(function(){return{}},"getOptions"),te=a(function(){ne(),A()},"clear");function ne(){R={}}a(ne,"reset");var ie=T.eventmodeling,oe=a(()=>V({...ie,...w().eventmodeling}),"getConfig"),R={};function re(){let e=se,{ast:n}=R,t=_();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,o)=>{let r=xe(i,n.dataEntities,t);e=C(e,{$kind:S,index:o,frame:i,textProps:r});let m;we(i)?(x.debug("source frame",i.sourceFrames),m=n.frames.filter(d=>i.sourceFrames.some(l=>l.$refText===d.name)),m.forEach(d=>{e=C(e,{$kind:P,index:o,frame:i,sourceFrame:d})})):e=C(e,{$kind:P,index:o,frame:i})}),e={...e,sortedSwimlanesArray:z(e.swimlanes)},e}a(re,"getState");function ae(e){R.ast=e}a(ae,"setAst");var s={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 _(){return s}a(_,"getDiagramProps");var se={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function me(e){let n=e.split(".");if(n.length===2)return n[0]}a(me,"extractNamespace");function de(e){let n=e.split(".");return n.length===2?n[1]:e}a(de,"extractName");function le(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}a(le,"findSwimlaneByNamespace");function D(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{let o=Number.parseInt(i);return o>n&&o<t}).map(i=>Number.parseInt(i)))+1}a(D,"findNextAvailableIndex");function ce(e,n){let t=me(e.entityIdentifier),i=le(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:D(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:D(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:D(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}a(ce,"calculateSwimlaneProps");function ue(e){let{themeVariables:n}=w();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}a(ue,"calculateEntityVisualProps");function xe(e,n,t){let i=w(),o=v(de(e.entityIdentifier)??"",i),r,m={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"},l=`<b>${y(o,t.textMaxWidth,m)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=v(r,i),r=y(r,t.textMaxWidth,m),r=r.replaceAll(" "," ")),e.dataReference){let b=n.find(E=>E.name===e.dataReference?.$refText);b&&(r=b.dataBlockValue,r=r.substring(r.indexOf(`{
|
|
2
|
+
`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=v(r,i),r=y(r,t.textMaxWidth,m),r=r.replaceAll(" "," "),r+="<br/>")}let c=r!==void 0;c&&(l+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);let f={fontSize:m.fontSize,fontWeight:m.fontWeight,fontFamily:m.fontFamily},u=L(l,f),g=c?u.width/3:u.width,p={content:l,width:g,height:u.height};return x.debug(`[${e.name}] ${e.entityIdentifier} text`,p),p}a(xe,"calculateTextProps");function fe(e,n){let t=n,i=ue(t.frame),o={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:B,frame:t.frame,index:t.index,visual:i,dimension:o,textProps:t.textProps}]}a(fe,"decidePositionFrame");function pe(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}a(pe,"calculateX");function ge(e,n){let t=[...e.map(i=>i.r),n];return Math.max(...t)}a(ge,"calculateMaxRight");function z(e){return Object.values(e).sort((n,t)=>n.index-t.index)}a(z,"sortedSwimlanesArray");function be(e,n){let t=n,i=ce(t.frame,e.swimlanes),o;i.index in e.swimlanes?o=e.swimlanes[i.index]:o={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};let r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,m=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,d={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},l=pe(o,m,r),c=l+d.width+s.boxPadding,f=ge(Object.values(e.swimlanes),c);o.r=l+d.width,o.maxHeight=Math.max(o.maxHeight,d.height),o.height=Math.max(s.swimlaneMinHeight,o.maxHeight)+2*s.swimlanePadding;let u={x:l,y:s.swimlanePadding+o.y,r:c,dimension:d,leftSibling:!1,swimlane:o,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},g={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${o.index}`]:o},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:f},p=z(g.swimlanes);p.length>0&&(p[0].y=0);for(let b=1;b<p.length;b++){let E=p[b],k=p[b-1];E.y=k.y+k.height+s.swimlaneGap}return g}a(be,"evolveFramePositioned");function he(e,n){return e===0&&n.sourceFrames.length===0}a(he,"isFirstFrame");function we(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}a(we,"hasSourceFrame");function Y(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}a(Y,"findBoxByFrame");function ve(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){let o=e[i];if(o.swimlane.index!==n)return o}}a(ve,"findBoxByLineIndex");function ye(e,n){let t=n;if(G(t.frame)||he(t.index,t.frame))return[];let i=Y(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let o;return t.sourceFrame?o=Y(e.boxes,t.sourceFrame):o=ve(e.boxes,i.swimlane.index,t.index-1),o===void 0?[]:[{$kind:M,frame:t.frame,index:t.index,sourceBox:o,targetBox:i}]}a(ye,"decidePositionRelation");function Pe(e,n){let t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}a(Pe,"evolveRelationPositioned");var Ee={[S]:fe,[P]:ye},Fe={[B]:be,[M]:Pe};function Se(e,n){let t=Ee[n.$kind];if(t==null)return[];let i=t(e,n);return x.debug("decided events",i),i}a(Se,"decide");function Be(e,n){let t=n.reduce((i,o)=>{let r=Fe[o.$kind];return r==null?i:r(i,o)},e);return x.debug("evolve events",{state:e,newState:t,events:n}),t}a(Be,"evolve");function C(e,n){let t=Se(e,n);return Be(e,t)}a(C,"dispatch");var h={getConfig:oe,setOptions:Z,getOptions:ee,clear:te,setAccTitle:$,getAccTitle:O,getAccDescription:H,setAccDescription:W,setDiagramTitle:N,getDiagramTitle:j,setAst:ae,getDiagramProps:_,getState:re};var q={parse:a(async e=>{let n=await K("eventmodeling",e);x.debug(n),h.setAst(n),X(n,h)},"parse")};var Me=F(),De=Me?.eventmodeling;function Ce(e,n){return t=>{let i=t.swimlane.y+n.swimlanePadding,o=e.append("g").attr("class","em-box");o.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),o.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.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(t.text)}}a(Ce,"renderD3Box");function Re(e,n){return e>n}a(Re,"dirUpwards");function ke(e,n,t,i){return o=>{let r=o.sourceBox.swimlane.y+n.swimlanePadding,m=o.targetBox.swimlane.y+n.swimlanePadding,d=Re(r,m),l=o.sourceBox.x+o.sourceBox.dimension.width*2/3,c=o.targetBox.x+o.targetBox.dimension.width/3,f,u;x.debug(`rendering relation up=${d} for `,{sourceBox:o.sourceBox,targetBox:o.targetBox}),d?(f=r,u=m+o.targetBox.dimension.height):(f=r+o.sourceBox.dimension.height,u=m);let g=i.emRelationStroke??o.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",o.visual.fill).attr("stroke",g).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${l} ${f} L${c} ${u}`)}}a(ke,"renderD3Relation");function Te(e,n,t,i){return o=>{let r=e.append("g").attr("class","em-swimlane"),m=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",d=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",o.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",o.height).attr("fill",m).attr("stroke",d),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",o.y+30).text(o.label)}}a(Te,"renderD3Swimlane");var Ae=a(function(e,n,t,i){if(x.debug("in eventmodeling renderer",e+`
|
|
3
|
+
`,"id:",n,t),!De)throw new Error("EventModeling config not found");let o=i.db,{themeVariables:r,eventmodeling:m}=F(),d=U(`[id="${n}"]`),l=o.getDiagramProps(),c=o.getState(),f=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";c.sortedSwimlanesArray.forEach(Te(d,c.maxR,l,r)),c.boxes.forEach(Ce(d,l)),c.relations.forEach(ke(d,l,f,r)),d.append("defs").append("marker").attr("id",f).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",u),I(void 0,d,m?.padding??30,m?.useMaxWidth)},"draw"),J={draw:Ae};var $e=a(e=>"","getStyles"),Q=$e;var lt={parser:q,db:h,renderer:J,styles:Q};export{lt as diagram};
|
package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/ebnfDiagram-FTPZ3PV6.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r,b as l,c as m}from"./chunk-SLDQ463B.mjs";import{a as f}from"./chunk-JQRUD6KW.mjs";import{b as p}from"./chunk-5IQCK5RY.mjs";import"./chunk-JZGDI5JK.mjs";import"./chunk-OJINMHTS.mjs";import"./chunk-VQC2EELJ.mjs";import"./chunk-KD6SPIPN.mjs";import{b as s}from"./chunk-Q6NGPIAH.mjs";import"./chunk-RT4MAWR3.mjs";import"./chunk-YBMQ5JGJ.mjs";import"./chunk-GDY2UAB4.mjs";import"./chunk-3SMGFRGC.mjs";import"./chunk-3NPNU5GP.mjs";import"./chunk-TCEHX7R3.mjs";import"./chunk-5MVFYWFU.mjs";import"./chunk-SFMINX4W.mjs";import"./chunk-JFFVMJIA.mjs";import"./chunk-ZUNWM646.mjs";import"./chunk-ZS6VBONO.mjs";import"./chunk-IJBDOHL6.mjs";import"./chunk-QJSWEUOL.mjs";import{b as i}from"./chunk-H7VHZCWX.mjs";import{a as n}from"./chunk-AQ6EADP3.mjs";var b=s().RailroadEbnf.parser.LangiumParser,a=n(e=>{let t=e.alternatives.map(c);return t.length===1?t[0]:{type:"choice",alternatives:t}},"transformChoice"),c=n(e=>{let t=e.elements.map(d);return t.length===1?t[0]:{type:"sequence",elements:t}},"transformSequence"),u=n(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return a(e.element);case"EbnfOptional":return{type:"optional",element:a(e.element)};case"EbnfRepetition":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),y=n((e,t)=>{switch(t.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},u(t.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${t.$type}`)}},"transformPostfix"),d=n(e=>e.postfixes.reduce((t,o)=>y(t,o),u(e.base)),"transformTerm"),g=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),x=n(e=>{f(e,r),e.title&&r.setTitle(e.title),e.rules.map(t=>r.addRule(g(t)))},"populateDb"),E={parse:n(e=>{r.clear(),i.debug("[EBNF Parser] Starting Langium parse");let t=b.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new p(t);let o=t.value;i.debug("[EBNF Parser] Parsed rules:",o.rules.length),x(o),i.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:r}};var O={parser:E,db:r,renderer:m,styles:l};export{O as diagram};
|