collabmd 0.1.47 → 0.1.49
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/README.md +70 -11
- package/bin/collabmd.js +3 -0
- package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-C-nmgL5g.js +1 -0
- package/dist/client/assets/JetBrainsMono-Regular-BQaDgvhP.woff2 +0 -0
- package/dist/client/assets/abnfDiagram-VCTEODGH-CdVZqicp.js +1 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-I39sYjHI.js → architectureDiagram-5GKGNRK7-wUo0bXif.js} +3 -3
- package/dist/client/assets/babel-CY5KOv-I.js +16 -0
- package/dist/client/assets/{blockDiagram-NRAW4CY4-C6DtJy5Y.js → blockDiagram-I7D4REHJ-BRSK3m49.js} +4 -4
- package/dist/client/assets/browser-utils-DbXSMI-6.js +1 -0
- package/dist/client/assets/{c4Diagram-UCG6FXSJ-CtWtxS9_.js → c4Diagram-7LVT6UL2-yD2poxqw.js} +1 -1
- package/dist/client/assets/channel-Fa4GS_-F.js +1 -0
- package/dist/client/assets/chunk-2E4U76K2-BPnTT-J3.js +2 -0
- package/dist/client/assets/{chunk-TEH6E4GO-DVayPj-q.js → chunk-4HAMMTFA-DStbIfJ1.js} +20 -20
- package/dist/client/assets/{chunk-75Z2AOVW-CdFSaPjz.js → chunk-75Z2AOVW-C5pGd3W9.js} +1 -1
- package/dist/client/assets/{chunk-CLGD4ZFX-DQLgbQrv.js → chunk-CLGD4ZFX-BMeArk03.js} +1 -1
- package/dist/client/assets/chunk-DU6HZSFF-Zkp69c6c.js +127 -0
- package/dist/client/assets/{chunk-F27PBJKO-CNHIFhjo.js → chunk-F27PBJKO-D4xNct1r.js} +1 -1
- package/dist/client/assets/{chunk-GMAD6QVW-CbcBqPM5.js → chunk-GMAD6QVW-NZ6WpDb8.js} +1 -1
- package/dist/client/assets/{chunk-OBVCFTLP-BJR7u1jh.js → chunk-GVQU2GXP-D8SDprfX.js} +1 -1
- package/dist/client/assets/{chunk-G27WJ6UU-D9-eg537.js → chunk-IMKFNOWR-D8jEuU3Q.js} +2 -2
- package/dist/client/assets/{chunk-JQ64N6SF-DSFNH4bh.js → chunk-L3NEJ4N5-aijKP-eh.js} +1 -1
- package/dist/client/assets/chunk-OSK3NFVY-CCbLQAMa.js +10 -0
- package/dist/client/assets/{chunk-P2QGCYS3-BRpqY32H.js → chunk-P2QGCYS3-Oag_FdCq.js} +1 -1
- package/dist/client/assets/{chunk-POPQ4Y6H-Cb4SlVZF.js → chunk-POPQ4Y6H-CYnpIgXT.js} +1 -1
- package/dist/client/assets/{chunk-PWAF6VOD-Cz8IwBB5.js → chunk-PWAF6VOD-JSNrcBmP.js} +1 -1
- package/dist/client/assets/{chunk-RM4UPSZO-CWRwxNWJ.js → chunk-RM4UPSZO-DOWllDY8.js} +4 -4
- package/dist/client/assets/{chunk-RHFEMEQ7-CWY8cf4H.js → chunk-SHT3W25Y-BiQGljao.js} +5 -5
- package/dist/client/assets/{chunk-SVP7TREG-CyHOmcac.js → chunk-SVP7TREG-DB485R5x.js} +1 -1
- package/dist/client/assets/{chunk-LCL6LL3I-DmDkVukh.js → chunk-TICWLB2K-8rAVvoS3.js} +4 -4
- package/dist/client/assets/{chunk-CKBBP62Z-DG26UiBv.js → chunk-TLUHSLCS-DTY5v0aj.js} +2 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-BsQWoR3Q.js +1 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-BsQWoR3Q.js +1 -0
- package/dist/client/assets/{comment-thread-store-CdcwrObc.js → comment-thread-store-CX98zR6q.js} +1 -1
- package/dist/client/assets/comment-threads-BnRwo5B9.js +4 -0
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-CdTPi2yO.js → cynefinDiagram-5FMLGOSQ-rTz9RhFH.js} +1 -1
- package/dist/client/assets/{dagre-3AP2YEHR-5gtJtd0O.js → dagre-GXQ25YYZ-Cr67wLpQ.js} +2 -2
- package/dist/client/assets/{diagram-S7CK7UJ4-BudWz9WU.js → diagram-S7CK7UJ4-DywERe__.js} +2 -2
- package/dist/client/assets/{diagram-UQ7AKVKN-3v4rbH-s.js → diagram-UQ7AKVKN-CNYlXtu4.js} +1 -1
- package/dist/client/assets/diagram-VSXAHHWV-0H1a61Bn.js +3 -0
- package/dist/client/assets/{diagram-VX7I27RA-C_-rj0sw.js → diagram-VX7I27RA-CsJbsx5F.js} +1 -1
- package/dist/client/assets/{diagram-Z3DM3KII-B4yxavgj.js → diagram-Z3DM3KII-D0mLxEgI.js} +1 -1
- package/dist/client/assets/dist--hk9I5HQ.js +1 -0
- package/dist/client/assets/{dist-DutPuFmC.js → dist-B1XEa-Zs.js} +1 -1
- package/dist/client/assets/dist-Bd1JucQF.js +1 -0
- package/dist/client/assets/{dist-DZAAWTG-.js → dist-C0G3AaXG.js} +1 -1
- package/dist/client/assets/dist-ChRoo3IB.js +9 -0
- package/dist/client/assets/dist-Dm4w5UId.js +1 -0
- package/dist/client/assets/{dist-B_yQaEv_.js → dist-DpYDHR9p.js} +1 -1
- package/dist/client/assets/{dist-CietwTVS.js → dist-DzNmC81X.js} +1 -1
- package/dist/client/assets/{dist-DDUn5zTz.js → dist-GvvCNBe4.js} +1 -1
- package/dist/client/assets/dist-JaU3aRlD.js +19 -0
- package/dist/client/assets/{dist-Bw3VIE_v.js → dist-TW8iFRyW.js} +1 -1
- package/dist/client/assets/{dist-Dir5dDKZ.js → dist-jVU5Be5P.js} +1 -1
- package/dist/client/assets/document-formatter-rDDjRfZ2.js +2 -0
- package/dist/client/assets/drawioEditor-JubEEha7.js +9 -0
- package/dist/client/assets/ebnfDiagram-PWID7BFC-HeTxHpCU.js +1 -0
- package/dist/client/assets/editor-session-Bk6oIvSr.js +54 -0
- package/dist/client/assets/embedded-editor-base-BlCgz6mw.css +1 -0
- package/dist/client/assets/{erDiagram-SSCWMZ5O-C-iy6VkX.js → erDiagram-RLTQ6QDP-CbrDdd5P.js} +2 -2
- package/dist/client/assets/{es-CAsWR6hG.js → es-Bfdp096f.js} +13 -13
- package/dist/client/assets/estree-CuT_pB8K.js +44 -0
- package/dist/client/assets/excalidraw-element-link-YLIaTnVF.js +7 -0
- package/dist/client/assets/{excalidraw-scene-BOben2gr.js → excalidraw-scene-6uROebca.js} +1 -1
- package/dist/client/assets/{excalidraw-editor-BlcN6umJ.css → excalidrawEditor-BbSbI80a.css} +1 -1
- package/dist/client/assets/excalidrawEditor-dBMbRX_S.js +9 -0
- package/dist/client/assets/export-page-CRRQ2NEl.js +57 -0
- package/dist/client/assets/exportDocument-BlQRd9_m.js +2 -0
- package/dist/client/assets/exportDocument-CNSbjZwu.css +1 -0
- package/dist/client/assets/{file-icon-svg-CQAjlWjK.js → file-icon-svg-Y_kpF957.js} +1 -1
- package/dist/client/assets/file-kind-BwMIcZbi.js +1 -0
- package/dist/client/assets/file-search-DDLyyLDU.js +1 -0
- package/dist/client/assets/flowDiagram-HODETNUW-D5Gy0wmg.js +1 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-DtKHAbez.js → ganttDiagram-EL5Y4UJY-BHgOYiZz.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-oue8fQ5o.js → gitGraphDiagram-WWUBYQGX-Dl__X3Sk.js} +1 -1
- package/dist/client/assets/html-Cdnr2qzU.js +25 -0
- package/dist/client/assets/image-ZVKINSPA-DgzW5zAy.js +1 -0
- package/dist/client/assets/index-D3RER1SZ.js +1023 -0
- package/dist/client/assets/index-DREVKl_K.css +1 -0
- package/dist/client/assets/{infoDiagram-RXCK75RN-BMzo6KIn.js → infoDiagram-27XIBGKW-DBpoANC9.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-BIM3h287.js → ishikawaDiagram-5VMMS53U-BMPC6hfp.js} +1 -1
- package/dist/client/assets/{journeyDiagram-EYS64GPL-mF6Lh8O-.js → journeyDiagram-3NMN7TZE-B1sApUmM.js} +2 -2
- package/dist/client/assets/{kanban-definition-3QL26DDD-DLN2NyoR.js → kanban-definition-UXKFOSKX-C9yP4td1.js} +4 -4
- package/dist/client/assets/{line-BfTWJmgf.js → line-BFl3ujec.js} +1 -1
- package/dist/client/assets/markdown-CByV-4CU.js +70 -0
- package/dist/client/assets/{mermaid.core-CLZBlpIW.js → mermaid.core-BrY09czX.js} +5 -5
- package/dist/client/assets/mermaid.core-DfcNfOTv.js +1 -0
- package/dist/client/assets/{mindmap-definition-FBJOCRG2-CRyHaHTk.js → mindmap-definition-YA3MSWOX-BUQHcYbK.js} +8 -8
- package/dist/client/assets/pegDiagram-XKGWAZYB-Bi2Iml7Z.js +1 -0
- package/dist/client/assets/{pieDiagram-E7YTZNPT-B5OZPb88.js → pieDiagram-E7YTZNPT-_gYXnMoi.js} +1 -1
- package/dist/client/assets/preview-render-compiler-CfxJYldJ.js +41 -0
- package/dist/client/assets/preview-render-compiler-Cu8_i9iS.js +1 -0
- package/dist/client/assets/{preview-render-worker-BmN79bVc.js → preview-render-worker-c4Yi93qW.js} +41 -35
- package/dist/client/assets/prod-BiJL30sl.js +1 -0
- package/dist/client/assets/prod-qAk7rHa4.js +177 -0
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-Drrw14YH.js → quadrantDiagram-AXDQQJYC-DwexhEhd.js} +1 -1
- package/dist/client/assets/quick-switcher-controller-BoIK_wuG.js +1 -0
- package/dist/client/assets/railroadDiagram-O6MQD6OU-BVA5UbMu.js +1 -0
- package/dist/client/assets/{requirementDiagram-EFPCY7ZU-CRZG6mRB.js → requirementDiagram-BXWQKSXE-C4cKwiIw.js} +2 -2
- package/dist/client/assets/runtime-config-DcmnGcXU.js +1 -0
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-DvarEJpo.js → sankeyDiagram-P5KCCOFB-B5HHkRT2.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-B4oWlb-w.js → sequenceDiagram-WJ2MYXX4-BX6jqJFD.js} +6 -6
- package/dist/client/assets/standalone-6z5x8CWe.js +29 -0
- package/dist/client/assets/{stateDiagram-HBIQ2CUA-qbHIIqRZ.js → stateDiagram-D77RDMKH-CmqxyRGx.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-zoLLQVyh.js +1 -0
- package/dist/client/assets/{swimlanes-XN3QIQJK-xB6CtUGj.js → swimlanes-42K2YHIH-Bmgb9Zld.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DS-KQN37.js +8 -0
- package/dist/client/assets/{timeline-definition-24CTP7MA-Lj_yTNlY.js → timeline-definition-24CTP7MA-BA-lVH6P.js} +1 -1
- package/dist/client/assets/vault-api-client-iZLhMJKe.js +6 -0
- package/dist/client/assets/{vennDiagram-4TSXK5OY-BekRp5Y0.js → vennDiagram-4TSXK5OY-DNdUC_Xj.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-kdnV_Hdm.js → wardleyDiagram-VM6X3IG4-C2oY-YbF.js} +1 -1
- package/dist/client/assets/wiki-link-resolver-DFIwErjc.js +1 -0
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-DufGwNSB.js → xychartDiagram-S5SC5T6Z-CoIR8CBX.js} +1 -1
- package/dist/client/assets/yaml-9ltHPDNO.js +154 -0
- package/dist/client/assets/{yjs-provider-reset-guard-DE0vINDP.js → yjs-provider-reset-guard-9ul1qF6k.js} +1 -1
- package/dist/client/drawio-editor.html +11 -3
- package/dist/client/excalidraw-editor.html +45 -2
- package/dist/client/export-document.html +3 -3
- package/dist/client/index.html +106 -52
- package/integrations/pi/index.ts +94 -0
- package/package.json +41 -29
- package/src/client/app/drawio-editor.html +2 -2
- package/src/client/app/excalidraw-editor.html +2 -2
- package/src/client/app/export-document.html +1 -1
- package/src/client/app/index.html +88 -50
- package/src/client/app/main-entry.js +15 -1
- package/src/client/application/app-shell/chat-feature.js +7 -22
- package/src/client/application/app-shell/export-feature.js +17 -1
- package/src/client/application/app-shell/git-feature.js +51 -14
- package/src/client/application/app-shell/presence-feature.js +8 -25
- package/src/client/application/app-shell/ui-feature-identity.js +13 -0
- package/src/client/application/app-shell/ui-feature-shell.js +199 -99
- package/src/client/application/app-shell/ui-feature-sidebar.js +43 -7
- package/src/client/application/app-shell/ui-feature-tab-activity.js +19 -6
- package/src/client/application/app-shell/ui-feature-toolbar.js +16 -129
- package/src/client/application/app-shell-elements.js +8 -0
- package/src/client/application/preview-render-compiler.js +1 -87
- package/src/client/application/preview-render-scheduler.js +8 -24
- package/src/client/application/preview-renderer.js +2 -2
- package/src/client/application/webmcp-diagram-renderer.js +47 -0
- package/src/client/application/workspace-coordinator.js +23 -4
- package/src/client/application/workspace-preview-controller.js +120 -2
- package/src/client/application/workspace-route-controller.js +11 -1
- package/src/client/assets/vendor/jetbrains-mono/JetBrainsMono-Regular.woff2 +0 -0
- package/src/client/assets/vendor/jetbrains-mono/OFL.txt +93 -0
- package/src/client/bootstrap/collabmd-app-shell.js +99 -6
- package/src/client/domain/document-formatter.js +193 -0
- package/src/client/domain/excalidraw-element-link.js +73 -0
- package/src/client/domain/excalidraw-scene.js +21 -0
- package/src/client/domain/file-search.js +73 -0
- package/src/client/domain/git-labels.js +5 -0
- package/src/client/domain/hash-routes.js +8 -0
- package/src/client/domain/room.js +1 -5
- package/src/client/domain/runtime-paths.js +5 -0
- package/src/client/domain/vault-paths.js +6 -4
- package/src/client/domain/wiki-link-completions.js +20 -20
- package/src/client/drawio-editor.js +8 -3
- package/src/client/excalidraw-editor.js +287 -16
- package/src/client/export/export-host.js +59 -36
- package/src/client/export/export-page.js +14 -4
- package/src/client/export/export-pipeline.js +270 -42
- package/src/client/infrastructure/agent-connection-api-client.js +23 -0
- package/src/client/infrastructure/auth-client.js +3 -13
- package/src/client/infrastructure/editor-session.js +15 -0
- package/src/client/infrastructure/editor-view-adapter.js +73 -14
- package/src/client/infrastructure/excalidraw-room-client.js +80 -1
- package/src/client/infrastructure/git-api-client.js +39 -33
- package/src/client/infrastructure/lobby-presence.js +2 -5
- package/src/client/infrastructure/runtime-config.js +11 -1
- package/src/client/infrastructure/tab-activity-lock.js +2 -5
- package/src/client/infrastructure/vault-api-client.js +33 -26
- package/src/client/infrastructure/webmcp-tool-registry.js +283 -0
- package/src/client/infrastructure/workspace-sync-client.js +6 -4
- package/src/client/presentation/agent-connection-controller.js +255 -0
- package/src/client/presentation/backlinks-panel.js +3 -0
- package/src/client/presentation/bases-preview-controller.js +59 -26
- package/src/client/presentation/comment-ui/comment-ui-card.js +4 -2
- package/src/client/presentation/create-menu-presenter.js +19 -16
- package/src/client/presentation/excalidraw-embed-controller.js +164 -4
- package/src/client/presentation/file-action-controller.js +15 -2
- package/src/client/presentation/file-explorer-controller.js +3 -0
- package/src/client/presentation/file-explorer-view.js +71 -12
- package/src/client/presentation/file-history-view-controller.js +19 -12
- package/src/client/presentation/file-tree-state.js +1 -11
- package/src/client/presentation/git-diff-view-controller.js +70 -53
- package/src/client/presentation/git-panel-controller.js +86 -32
- package/src/client/presentation/image-lightbox-controller.js +20 -16
- package/src/client/presentation/layout-controller.js +3 -1
- package/src/client/presentation/quick-switcher-controller.js +74 -232
- package/src/client/presentation/quick-switcher-text-search.js +10 -14
- package/src/client/styles/components/navigation.css +1 -2
- package/src/client/styles/components/scrollbars.css +10 -0
- package/src/client/styles/export-document.css +44 -29
- package/src/client/styles/features/agent-connection.css +202 -0
- package/src/client/styles/features/collaboration-chat.css +8 -1
- package/src/client/styles/features/collaboration-dialogs.css +16 -1
- package/src/client/styles/features/collaboration-presence.css +30 -5
- package/src/client/styles/features/diff-toolbar.css +1 -1
- package/src/client/styles/features/media-lightbox.css +12 -3
- package/src/client/styles/features/preview-markdown.css +54 -0
- package/src/client/styles/features/quick-switcher.css +20 -11
- package/src/client/styles/foundation/themes.css +2 -0
- package/src/client/styles/foundation/tokens.css +8 -0
- package/src/client/styles/layout/editor-page.css +25 -11
- package/src/client/styles/layout/responsive.css +2 -20
- package/src/client/styles/layout/shell.css +77 -24
- package/src/client/styles/layout/sidebar.css +7 -4
- package/src/client/styles/layout/view-modes.css +2 -0
- package/src/client/styles/overrides/codemirror.css +31 -19
- package/src/client/styles/primitives/controls.css +21 -54
- package/src/client/styles/style.css +1 -0
- package/src/client/styles/surfaces/excalidraw-editor.css +42 -0
- package/src/domain/agent-tool-definitions.js +796 -0
- package/src/domain/collabmd-content-capabilities.js +149 -0
- package/src/domain/collaboration-protocol.js +2 -0
- package/src/domain/comment-threads.js +3 -5
- package/src/domain/diagram-source.js +50 -0
- package/src/domain/editable-content-revision.js +10 -0
- package/src/domain/editable-text.js +3 -0
- package/src/domain/exact-text-edits.js +69 -0
- package/src/domain/excalidraw-agent-scene.js +522 -0
- package/src/domain/excalidraw-agent-verification.js +460 -0
- package/src/domain/excalidraw-room-codec.js +1 -5
- package/src/domain/file-kind.js +12 -1
- package/src/domain/video-embed.js +76 -0
- package/src/server/application/agent-connection-service.js +178 -0
- package/src/server/application/agent-content-service.js +773 -0
- package/src/server/application/workspace-reconciliation.js +5 -7
- package/src/server/config/env.js +51 -1
- package/src/server/create-app-server.js +36 -0
- package/src/server/domain/bases/base-query-service.js +1 -5
- package/src/server/domain/collaboration/collaboration-room.js +121 -25
- package/src/server/domain/collaboration/protocol.js +4 -0
- package/src/server/domain/hosted-workspace.js +21 -0
- package/src/server/domain/markdown-reference-extractor.js +15 -1
- package/src/server/domain/ripgrep-search-service.js +110 -37
- package/src/server/infrastructure/git/git-service.js +19 -1
- package/src/server/infrastructure/git/history-service.js +1 -1
- package/src/server/infrastructure/git/local-exclude.js +25 -0
- package/src/server/infrastructure/git/parsers.js +19 -17
- package/src/server/infrastructure/git/path-utils.js +0 -16
- package/src/server/infrastructure/git/status-service.js +1 -1
- package/src/server/infrastructure/git/untracked-files.js +12 -21
- package/src/server/infrastructure/http/create-agent-api-handler.js +171 -0
- package/src/server/infrastructure/http/create-git-api-command-handler.js +32 -0
- package/src/server/infrastructure/http/create-request-handler.js +28 -0
- package/src/server/infrastructure/http/create-static-handler.js +6 -0
- package/src/server/infrastructure/mcp/create-agent-mcp-handler.js +199 -0
- package/src/server/infrastructure/persistence/agent-connection-store.js +120 -0
- package/src/server/infrastructure/persistence/path-utils.js +10 -4
- package/src/server/infrastructure/persistence/pull-backup-store.js +2 -27
- package/src/server/infrastructure/persistence/vault-file-store.js +11 -2
- package/src/server/shared/agent-tool-image.js +22 -0
- package/src/server/shared/agent-tool-rate-limiter.js +20 -0
- package/src/server/startup/git-remote-bootstrap.js +5 -33
- package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-BPH4FJkv.js +0 -1
- package/dist/client/assets/abnfDiagram-VCTEODGH-BNDLzJ7L.js +0 -1
- package/dist/client/assets/browser-utils--H_DkyEF.js +0 -1
- package/dist/client/assets/channel-CaoKA_We.js +0 -1
- package/dist/client/assets/chunk-DSNCTWBM-8xkug7fQ.js +0 -2
- package/dist/client/assets/chunk-DU6HZSFF-COXDzJK1.js +0 -127
- package/dist/client/assets/chunk-R7TYR2AO-CTd0Yj98.js +0 -10
- package/dist/client/assets/classDiagram-DTDB5LWJ-7fEmn0zV.js +0 -1
- package/dist/client/assets/classDiagram-v2-JRS7N3AN-7fEmn0zV.js +0 -1
- package/dist/client/assets/comment-threads-9J6Em-_y.js +0 -4
- package/dist/client/assets/comment-ui-shared-DWkk9Vh3.js +0 -7
- package/dist/client/assets/diagram-VSXAHHWV-CQRVEZR7.js +0 -3
- package/dist/client/assets/dist-73RPdcyU.js +0 -1
- package/dist/client/assets/dist-CH-sQu3r.js +0 -1
- package/dist/client/assets/drawio-editor-BjrxTe3l.js +0 -9
- package/dist/client/assets/drawioEditor-DUVZjSSr.js +0 -2
- package/dist/client/assets/ebnfDiagram-PWID7BFC-OXa8VEp1.js +0 -1
- package/dist/client/assets/editor-session-DfZuRgB_.js +0 -54
- package/dist/client/assets/embedded-editor-base-DvMynhKu.css +0 -1
- package/dist/client/assets/excalidraw-editor-D7pnUCLH.js +0 -9
- package/dist/client/assets/excalidraw-mermaid-stub-BNckbX2n.js +0 -1
- package/dist/client/assets/excalidraw-mermaid-stub-DE5FTiZB.js +0 -1
- package/dist/client/assets/excalidrawEditor-B0jOK3lv.js +0 -2
- package/dist/client/assets/export-page-Bs3xE1fg.js +0 -57
- package/dist/client/assets/exportDocument-Dg9MjkIk.js +0 -2
- package/dist/client/assets/exportDocument-PnYU3v1s.css +0 -1
- package/dist/client/assets/file-kind-BbqgGzpc.js +0 -1
- package/dist/client/assets/flowDiagram-A5DVABFB-CiW1eN8C.js +0 -1
- package/dist/client/assets/image-ZVKINSPA-0zXSnE7M.js +0 -1
- package/dist/client/assets/index-BIpgxyGZ.css +0 -1
- package/dist/client/assets/index-Z5sI0Bj-.js +0 -2
- package/dist/client/assets/main-Dwnj9Gaq.js +0 -903
- package/dist/client/assets/pegDiagram-XKGWAZYB-B31fKPR2.js +0 -1
- package/dist/client/assets/preview-render-compiler-BApvlLLo.js +0 -35
- package/dist/client/assets/preview-render-compiler-BQ_3h9vD.js +0 -1
- package/dist/client/assets/preview-render-profile-CE-5rVTC.js +0 -1
- package/dist/client/assets/prod-BiYPMR1i.js +0 -177
- package/dist/client/assets/prod-VxdGZ5Ly.js +0 -1
- package/dist/client/assets/quick-switcher-controller-ButWPmCI.js +0 -12
- package/dist/client/assets/railroadDiagram-O6MQD6OU-BPifP0MB.js +0 -1
- package/dist/client/assets/runtime-config-BLrEKVO1.js +0 -1
- package/dist/client/assets/stateDiagram-v2-4QOOHH4V-B--gjrit.js +0 -1
- package/dist/client/assets/swimlanesDiagram-VK2B7HYN-DO8XNXEg.js +0 -8
- package/dist/client/assets/vault-api-client-_LpV1aIn.js +0 -6
- package/dist/client/assets/vault-utils-wdQ0RNR9.js +0 -1
- package/src/client/app/drawio-editor-entry.js +0 -1
- package/src/client/app/excalidraw-editor-entry.js +0 -1
- package/src/client/excalidraw-mermaid-stub.js +0 -7
- package/src/client/main.js +0 -16
- /package/dist/client/assets/{drawio-editor-UQQ8XHou.css → drawioEditor-UQQ8XHou.css} +0 -0
- /package/dist/client/assets/{sizeCapture-X5ZJPWSS-B0uUizjq.js → sizeCapture-INFHLROL-B0uUizjq.js} +0 -0
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-oBChb5qS.js";import{A as r,B as i,M as a,T as o,b as s,f as c,g as l,x as u,z as d}from"./chunk-DU6HZSFF-COXDzJK1.js";import{a as f,p,r as m,u as h}from"./chunk-75Z2AOVW-CdFSaPjz.js";import{t as g}from"./chunk-PWAF6VOD-Cz8IwBB5.js";import{n as _,r as v}from"./chunk-GMAD6QVW-CbcBqPM5.js";import{a as y,i as b,r as x,t as S}from"./chunk-P2QGCYS3-BRpqY32H.js";import{t as C}from"./rough.esm-Dy-Kn_BL.js";var w=1,T=3;async function E(t){let n=t.getElementsByTagName(`img`);if(!n||n.length===0)return;let r=!D(t);await Promise.all([...n].map(t=>new Promise(n=>{function i(){if(t.style.display=`flex`,t.style.flexDirection=`column`,r){let e=u().fontSize?u().fontSize:window.getComputedStyle(document.body).fontSize,[n=c.fontSize]=p(e),r=n*5+`px`;t.style.minWidth=r,t.style.maxWidth=r}else t.style.width=`100%`;n(t)}e(i,`setupImage`),setTimeout(()=>{t.complete&&i()}),t.addEventListener(`error`,i),t.addEventListener(`load`,i)})))}e(E,`configureLabelImages`);function D(e){return e.nodeType===T?e.textContent?.trim()!==``:e.nodeType!==w||e.tagName.toLowerCase()===`img`?!1:[...e.childNodes].some(D)}e(D,`hasTextBesidesImages`);var O=3,k=32,A=e(async(e,t,r)=>{let i=u(),a=e.insert(`g`).attr(`class`,r??`node default`).attr(`id`,t.domId||t.id),o=a.insert(`g`).attr(`class`,`label`).attr(`style`,h(t.labelStyle)),s=[{text:typeof t.label==`string`?t.label:t.label?.[0]??``,cssClass:`c4-name`},{text:t.stereotype,cssClass:`c4-type`},...(t.description??[]).map(e=>({text:e,cssClass:`c4-descr`}))].filter(e=>e.text),c=t.width?Math.max(t.width-2*(t.padding??0),k):u().flowchart?.wrappingWidth??200,l=i.wrap?c:1/0,p=await Promise.all(s.map(async e=>{let r=o.append(`g`).attr(`class`,e.cssClass),a=await _(r,d(f(e.text??``),i),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:l,style:t.labelStyle},i);return n(a).selectAll(`tspan.text-outer-tspan`).attr(`text-anchor`,`middle`),n(a).selectAll(`tspan.text-inner-tspan`).attr(`font-weight`,null).attr(`font-style`,null),{el:r,box:r.node().getBBox()}})),m=Math.max(...p.map(({box:e})=>e.width),0),g=0;for(let{el:e,box:t}of p)e.attr(`transform`,`translate(${m/2-t.x-t.width/2}, ${g-t.y})`),g+=t.height+O;let v=p.length>0?g-O:0;return o.insert(`rect`,`:first-child`),o.attr(`transform`,`translate(${-m/2}, ${-v/2})`),{shapeSvg:a,bbox:o.node().getBBox(),halfPadding:(t.padding??0)/2,label:o}},`c4LabelHelper`),j=e(async(e,t,r)=>{if(t.stereotype!==void 0)return A(e,t,r);let i,a=t.useHtmlLabels||l(u()?.htmlLabels);i=r||`node default`;let o=e.insert(`g`).attr(`class`,i).attr(`id`,t.domId||t.id),s=o.insert(`g`).attr(`class`,`label`).attr(`style`,h(t.labelStyle)),c;c=t.label===void 0?``:typeof t.label==`string`?t.label:t.label[0];let p=!!t.icon||!!t.img,m=t.labelType===`markdown`,g=await _(s,d(f(c),u()),{useHtmlLabels:a,width:t.width||t.wrappingWidth||u().flowchart?.wrappingWidth,classes:m?`markdown-node-label`:``,style:t.labelStyle,addSvgBackground:p,markdown:m},u()),y=(t?.padding??0)/2,b;if(a){let e=g.children[0],t=n(g);await E(e),b=await v.measure(()=>e.getBoundingClientRect()),t.attr(`width`,b.width),t.attr(`height`,b.height)}else b=await v.measure(()=>g.getBBox());return a?s.attr(`transform`,`translate(`+-b.width/2+`, `+-b.height/2+`)`):s.attr(`transform`,`translate(0, `+-b.height/2+`)`),t.centerLabel&&s.attr(`transform`,`translate(`+-b.width/2+`, `+-b.height/2+`)`),s.insert(`rect`,`:first-child`),{shapeSvg:o,bbox:b,halfPadding:y,label:s}},`labelHelper`),M=e(async(e,t,r)=>{let i=r.useHtmlLabels??o(u()),a=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),s=await _(a,d(f(t),u()),{useHtmlLabels:i,width:r.width||u()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),c=r.padding/2,l;if(o(u())){let e=s.children[0],t=n(s);l=await v.measure(()=>e.getBoundingClientRect()),t.attr(`width`,l.width),t.attr(`height`,l.height)}else l=await v.measure(()=>s.getBBox());return i?a.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`):a.attr(`transform`,`translate(0, `+-l.height/2+`)`),r.centerLabel&&a.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`),a.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:l,halfPadding:c,label:a}},`insertLabel`),N=e((e,t,n)=>{if(n){e.width=n.width,e.height=n.height;return}let r=t.node().getBBox();e.width=r.width,e.height=r.height},`updateNodeBounds`),P=e((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function F(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}e(F,`createPathFromPoints`);function I(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}e(I,`generateFullSineWavePoints`);function L(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(L,`generateCirclePoints`);function ee(t){let n=Array.from(t.childNodes).filter(e=>e.tagName===`path`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),i=n.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);r.setAttribute(`d`,i);let a=n.find(e=>e.getAttribute(`fill`)!==`none`),o=n.find(e=>e.getAttribute(`stroke`)!==`none`),s=e((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(a){let e={fill:s(a,`fill`),"fill-opacity":s(a,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}if(o){let e={stroke:s(o,`stroke`),"stroke-width":s(o,`stroke-width`)??`1`,"stroke-opacity":s(o,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}let c=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return c.appendChild(r),c}e(ee,`mergePaths`);var R=e((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`),z=e((e,t,n,r,i)=>[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),te=e(async(e,t,n,r=!1,i=!1)=>{let a=t||``;typeof a==`object`&&(a=a[0]);let s=u(),c=o(s);return await _(e,a,{style:n,isTitle:r,useHtmlLabels:c,markdown:!1,isNode:i,width:1/0},s)},`createLabel`);function B(e,t){return e.intersect(t)}e(B,`intersectNode`);var ne=B;function V(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x<i&&(l=-l);var u=Math.abs(t*n*s/c);return r.y<a&&(u=-u),{x:i+l,y:a+u}}e(V,`intersectEllipse`);var H=V;function re(e,t,n){return H(e,t,t,n)}e(re,`intersectCircle`);var ie=re;function U(e,t,n,r){{let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,c=i*r.x+a*r.y+o,l=1e-6;if(s!==0&&c!==0&&W(s,c))return;let u=r.y-n.y,d=n.x-r.x,f=r.x*n.y-n.x*r.y,p=u*e.x+d*e.y+f,m=u*t.x+d*t.y+f;if(Math.abs(p)<l&&Math.abs(m)<l&&W(p,m))return;let h=i*d-u*a;if(h===0)return;let g=Math.abs(h/2),_=a*f-d*o,v=_<0?(_-g)/h:(_+g)/h;return _=u*o-i*f,{x:v,y:_<0?(_-g)/h:(_+g)/h}}}e(U,`intersectLine`);function W(e,t){return e*t>0}e(W,`sameSign`);var G=U;function ae(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r<t.length;r++){let i=t[r],o=t[r<t.length-1?r+1:0],s=G(e,n,{x:c+i.x,y:l+i.y},{x:c+o.x,y:l+o.y});s&&a.push(s)}return a.length?(a.length>1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a<c?-1:a===c?0:1}),a[0]):e}e(ae,`intersectPolygon`);var K={node:ne,circle:ie,ellipse:H,polygon:ae,rect:R};function oe(e,n){let{labelStyles:r}=b(n);n.labelStyle=r;let i=P(n),a=i;i||(a=`anchor`);let o=e.insert(`g`).attr(`class`,a).attr(`id`,n.domId||n.id),{cssStyles:s}=n,c=C.svg(o),l=y(n,{fill:`black`,stroke:`none`,fillStyle:`solid`});n.look!==`handDrawn`&&(l.roughness=0);let u=c.circle(0,0,2,l),d=o.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,h(s)),N(n,d),n.intersect=function(e){return t.info(`Circle intersect`,n,1,e),K.circle(n,1,e)},o}e(oe,`anchor`);function se(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}e(se,`generateArcPoints`);function ce(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}e(ce,`calculateArcSagitta`);async function le(t,n){let{labelStyles:r,nodeStyles:i}=b(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?16:a,s=n.look===`neo`?12:a,c=e(e=>e+s,`calcTotalHeight`),l=e(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await j(t,n,P(n)),f=c(n?.height?n?.height:d.height),[p,m]=l(f),h=ce(f,p,m),g=(n?.width?n?.width:d.width)+o*2+h-h,_=f,{cssStyles:v}=n,x=[{x:g/2,y:-_/2},{x:-g/2,y:-_/2},...se(-g/2,-_/2,-g/2,_/2,p,m,!1),{x:g/2,y:_/2},...se(g/2,_/2,g/2,-_/2,p,m,!0)],S=C.svg(u),w=y(n,{});n.look!==`handDrawn`&&(w.roughness=0,w.fillStyle=`solid`);let T=F(x),E=S.path(T,w),D=u.insert(()=>E,`:first-child`);return D.attr(`class`,`basic label-container outer-path`),v&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,v),i&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,i),D.attr(`transform`,`translate(${p/2}, 0)`),N(n,D),n.intersect=function(e){return K.polygon(n,x,e)},u}e(le,`bowTieRect`);async function ue(t,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=b(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,label:c}=await j(t,n,P(n)),l=r?.nodeBorder??r?.lineColor??`currentColor`,u=n.padding??12,d=Math.max(s.width+u*2,n.width??0,80),f=Math.max(Math.min(d*.08,12),5),p=Math.max(s.height+u*2+f,n.height??0),m=-p/2+f,h=p/2,g=d*.72,_=[`M${-d/2},${m}`,`L${-g/2},${h}`,`A${g/2},${f} 0 0 0 ${g/2},${h}`,`L${d/2},${m}`,`A${d/2},${f} 0 0 0 ${-d/2},${m}`,`Z`].join(` `),{cssStyles:v}=n,x=o.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(n.look===`handDrawn`){let e=C.svg(o).path(_,y(n,{}));x.node()?.appendChild(e),v&&x.attr(`style`,v)}else x.append(`path`).attr(`d`,_).attr(`style`,a);x.append(`ellipse`).attr(`cx`,0).attr(`cy`,m).attr(`rx`,d/2).attr(`ry`,f).attr(`style`,`fill:none;stroke:${l};stroke-width:1px`),N(n,x);let S=m+(h-m)/2;c.attr(`transform`,`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${S-s.height/2-(s.y-(s.top??0))})`);let w=e((e,t,n)=>Array.from({length:13},(r,i)=>{let a=Math.PI-i*Math.PI/12;return{x:e*Math.cos(a),y:t+n*f*Math.sin(a)}}),`arc`),T=[...w(d/2,m,-1),...w(g/2,h,1).reverse()];return n.intersect=function(e){return K.polygon(n,T,e)},o}e(ue,`bucket`);var de=20,fe=8,pe=80,me=8;async function he(e,t){let{themeVariables:n}=u(),r=n.clusterBkg,i=n.clusterBorder,{nodeStyles:a}=b(t),{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=t.padding??8,d=c.height,f=Math.max(c.width+l*2,pe,t?.width??0),p=Math.max(d+fe+de+l*2,t?.height??0),m=-f/2,g=-p/2,_=-(fe+de)/2,v=s.select(`.label`);v&&(t.useHtmlLabels??o(u())?v.attr(`transform`,`translate(${-c.width/2}, ${-c.height/2+_})`):v.attr(`transform`,`translate(0, ${-c.height/2+_})`));let x;if(t.look===`handDrawn`){let e=C.svg(s),n=y(t,{fill:r,stroke:i,fillStyle:`solid`}),a=e.path(z(m,g,f,p,me),n);x=s.insert(()=>a,`:first-child`),x.attr(`class`,`basic label-container collapsed-group`).attr(`style`,h(t.cssStyles))}else x=s.insert(`rect`,`:first-child`),x.attr(`class`,`basic label-container collapsed-group`).attr(`style`,a).attr(`rx`,me).attr(`ry`,me).attr(`x`,m).attr(`y`,g).attr(`width`,f).attr(`height`,p).attr(`fill`,r).attr(`stroke`,i);let S=g+l+d+fe;s.append(`line`).attr(`class`,`collapsed-separator`).attr(`x1`,m+8).attr(`y1`,S).attr(`x2`,m+f-8).attr(`y2`,S).attr(`stroke`,i).attr(`stroke-dasharray`,`3, 3`);let w=S+de/2;for(let e=-1;e<=1;e++)s.append(`circle`).attr(`class`,`collapsed-indicator`).attr(`cx`,e*10).attr(`cy`,w).attr(`r`,2.5).attr(`fill`,i);return N(t,x),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},s}e(he,`collapsedGroup`);function q(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}e(q,`insertPolygonShape`);var ge=[`right`,`left`,`up`,`down`],_e=`point`,ve=e(e=>{let t=new Set;for(let n of e)switch(n){case`x`:t.add(`right`),t.add(`left`);break;case`y`:t.add(`up`),t.add(`down`);break;default:t.add(n)}return t},`expandAndDeduplicateDirections`),ye=e(e=>ge.filter(t=>e.has(t)).join(`|`)||_e,`getDirectionKey`),be={"right|left|up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:0,y:0},{x:t,y:0},{x:r/2,y:2*n},{x:r-t,y:0},{x:r,y:0},{x:r,y:-e/3},{x:r+2*n,y:-e/2},{x:r,y:-2*e/3},{x:r,y:-e},{x:r-t,y:-e},{x:r/2,y:-e-2*n},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*n,y:-e/2},{x:0,y:-e/3}],`right|left|up|down`),"right|left|up":e(({height:e,midpoint:t,width:n})=>[{x:t,y:0},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],`right|left|up`),"right|left|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:t,y:-e},{x:n-t,y:-e},{x:n,y:0}],`right|left|down`),"right|up|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:n,y:-e+t},{x:0,y:-e}],`right|up|down`),"left|up|down":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:n,y:-e}],`left|up|down`),"right|left":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`right|left`),"up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`up|down`),"right|up":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:0,y:-e}],`right|up`),"right|down":e(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],`right|down`),"left|up":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:n,y:-e}],`left|up`),"left|down":e(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],`left|down`),right:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e+n}],`right`),left:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`left`),up:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n}],`up`),down:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`down`),[_e]:()=>[{x:0,y:0}]},xe=e((e,t,n,r)=>{let i=ve(e),a=(n.padding??0)/2,o=t.height+4*a,s=o/2,c=r??t.width+2*s+2*a;return(be[ye(i)]??be[_e])({height:o,midpoint:s,padding:a,width:c})},`getArrowPoints`);async function Se(e,t){let n=t,{shapeSvg:r,bbox:i}=await j(e,n,P(n)),a=n.padding??0,o=i.height+2*a,s=o/2,c=i.width+2*s+a,l=n.width??0,u=n.positioned&&(n.widthInColumns??1)>1&&l>c?l:c,d=xe(n.directions??[],i,n,u),f=q(r,u,o,d);return f.attr(`style`,n.style??null),N(n,f),n.intersect=function(e){return K.polygon(n,d,e)},r}e(Se,`block_arrow`);async function Ce(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=b(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await j(e,t,P(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+18,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=C.svg(a).path(z(-u/2,f,u,d,12),y(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`line`).attr(`x1`,-u/2).attr(`y1`,f+18).attr(`x2`,u/2).attr(`y2`,f+18).attr(`style`,`stroke:${c};stroke-width:1px`);for(let e=0;e<3;e++)m.append(`circle`).attr(`cx`,-u/2+12+e*9).attr(`cy`,f+9).attr(`r`,2.5).attr(`style`,`fill:${c};stroke:none`);m.append(`rect`).attr(`class`,`browser-address-bar`).attr(`x`,-u/2+44).attr(`y`,f+4).attr(`width`,Math.max(u-56,10)).attr(`height`,10).attr(`rx`,3).attr(`ry`,3).attr(`style`,`fill:none;stroke:${c};stroke-width:1px;opacity:0.6`),N(t,m);let h=f+18+(d-18)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(Ce,`browser`);var we=12;async function Te(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+we),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+we,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+we},{x:0+we,y:f}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=C.svg(s),n=y(t,{}),r=F(p),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=q(s,l,u,p);return r&&m.attr(`style`,r),N(t,m),t.intersect=function(e){return K.polygon(t,p,e)},s}e(Te,`card`);function Ee(e,t){let{nodeStyles:n}=b(t);t.label=``;let r=e.insert(`g`).attr(`class`,P(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=C.svg(r),c=y(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=F(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return K.polygon(t,o,e)},r}e(Ee,`choice`);async function De(e,n,r){let{labelStyles:i,nodeStyles:a}=b(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await j(e,n,P(n)),l=r?.padding??c,u=n.look===`neo`?s.width/2+32:s.width/2+l,d,{cssStyles:f}=n;if(n.look===`handDrawn`){let e=C.svg(o),t=y(n,{}),r=e.circle(0,0,u*2,t);d=o.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,h(f))}else d=o.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,a).attr(`r`,u).attr(`cx`,0).attr(`cy`,0);return N(n,d),n.calcIntersect=function(e,t){let n=e.width/2;return K.circle(e,n,t)},n.intersect=function(e){return t.info(`Circle intersect`,n,u,e),K.circle(n,u,e)},o}e(De,`circle`);async function Oe(e,t){let n=t,{shapeSvg:r,bbox:i,halfPadding:a}=await j(e,n,[`node`,n.cssClasses,n.class].filter(Boolean).join(` `)),o=r.insert(`rect`,`:first-child`),s=n.padding??0,c=n.positioned?n.width??0:i.width+s,l=n.positioned?n.height??0:i.height+s,u=n.positioned?-c/2:-i.width/2-a,d=n.positioned?-l/2:-i.height/2-a;return o.attr(`class`,`basic cluster composite label-container`).attr(`style`,n.style??null).attr(`rx`,n.rx??null).attr(`ry`,n.ry??null).attr(`x`,u).attr(`y`,d).attr(`width`,c).attr(`height`,l),N(n,o),n.intersect=function(e){return K.rect(n,e)},r}e(Oe,`composite`);async function ke(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=b(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await j(e,t,P(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+20,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=C.svg(a).path(z(-u/2,f,u,d,12),y(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`text`).attr(`x`,-u/2+12).attr(`y`,f+16).attr(`class`,`console-glyph`).attr(`style`,`font-family:monospace;font-weight:bold;font-size:14px;fill:${c}`).text(`>_`),N(t,m);let h=f+20+(d-20)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(ke,`consoleWindow`);function Ae(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y}
|
|
2
|
-
M ${i.x},${i.y} L ${o.x},${o.y}`}e(Ae,`createLine`);function je(e,n){let{labelStyles:r,nodeStyles:i}=b(n);n.labelStyle=r,n.label=``;let a=e.insert(`g`).attr(`class`,P(n)).attr(`id`,n.domId??n.id),o=Math.max(30,n?.width??0),{cssStyles:s}=n,c=C.svg(a),l=y(n,{});n.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=c.circle(0,0,o*2,l),d=Ae(o),f=c.path(d,l),p=a.insert(()=>u,`:first-child`);return p.insert(()=>f),p.attr(`class`,`outer-path`),s&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,s),i&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,i),N(n,p),n.intersect=function(e){return t.info(`crossedCircle intersect`,n,{radius:o,point:e}),K.circle(n,o,e)},a}e(je,`crossedCircle`);function J(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(J,`generateCirclePoints`);async function Me(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+s,u=a.height+c,d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...J(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...J(l/2+d*2,-d,d,20,-180,-270),...J(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...J(l/2,u/2,d,20,0,90)],m=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...J(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...J(l/2+l*.1,-d,d,20,-180,-270),...J(l/2+l*.1,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...J(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2,y:u/2+d}],h=C.svg(i),g=y(t,{fill:`none`});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=F(p).replace(`Z`,``),v=h.path(_,g),x=F(m),S=h.path(x,{...g}),w=i.insert(`g`,`:first-child`);return w.insert(()=>S,`:first-child`).attr(`stroke-opacity`,0),w.insert(()=>v,`:first-child`),w.attr(`class`,`text`),f&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(${d}, 0)`),o.attr(`transform`,`translate(${-l/2+d-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),N(t,w),t.intersect=function(e){return K.polygon(t,m,e)},i}e(Me,`curlyBraceLeft`);function Y(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:a,y:l})}return o}e(Y,`generateCirclePoints`);async function Ne(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...Y(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...Y(l/2+d*2,-d,d,20,-180,-270),...Y(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...Y(l/2,u/2,d,20,0,90)],m=[{x:-l/2,y:-u/2-d},{x:l/2,y:-u/2-d},...Y(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...Y(l/2+d*2,-d,d,20,-180,-270),...Y(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...Y(l/2,u/2,d,20,0,90),{x:l/2,y:u/2+d},{x:-l/2,y:u/2+d}],h=C.svg(i),g=y(t,{fill:`none`});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=F(p).replace(`Z`,``),v=h.path(_,g),x=F(m),S=h.path(x,{...g}),w=i.insert(`g`,`:first-child`);return w.insert(()=>S,`:first-child`).attr(`stroke-opacity`,0),w.insert(()=>v,`:first-child`),w.attr(`class`,`text`),f&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(${-d}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),N(t,w),t.intersect=function(e){return K.polygon(t,m,e)},i}e(Ne,`curlyBraceRight`);function X(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(X,`generateCirclePoints`);async function Pe(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...X(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...X(l/2+d*2,-d,d,20,-180,-270),...X(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...X(l/2,u/2,d,20,0,90)],m=[...X(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...X(-l/2-d/2,-d,d,20,0,90),...X(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...X(-l/2+d+d/2,u/2,d,30,-180,-270)],h=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...X(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...X(l/2+d*2,-d,d,20,-180,-270),...X(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...X(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2-d-d/2,y:u/2+d},...X(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...X(-l/2-d/2,-d,d,20,0,90),...X(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...X(-l/2+d+d/2,u/2,d,30,-180,-270)],g=C.svg(i),_=y(t,{fill:`none`});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=F(p).replace(`Z`,``),x=g.path(v,_),S=F(m).replace(`Z`,``),w=g.path(S,_),T=F(h),E=g.path(T,{..._}),D=i.insert(`g`,`:first-child`);return D.insert(()=>E,`:first-child`).attr(`stroke-opacity`,0),D.insert(()=>x,`:first-child`),D.insert(()=>w,`:first-child`),D.attr(`class`,`text`),f&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),D.attr(`transform`,`translate(${d-d/4}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),N(t,D),t.intersect=function(e){return K.polygon(t,h,e)},i}e(Pe,`curlyBraces`);async function Fe(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(20,(c.width+a*2)*1.25,t?.width??0),u=Math.max(5,c.height+o*2,t?.height??0),d=u/2,{cssStyles:f}=t,p=C.svg(s),m=y(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=l,g=u,_=h-d,v=g/4,x=[{x:_,y:0},{x:v,y:0},{x:0,y:g/2},{x:v,y:g},{x:_,y:g},...L(-_,-g/2,d,50,270,90)],S=F(x),w=p.path(S,m),T=s.insert(()=>w,`:first-child`);return T.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&T.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&T.selectChildren(`path`).attr(`style`,r),T.attr(`transform`,`translate(${-l/2}, ${-u/2})`),N(t,T),t.intersect=function(e){return K.polygon(t,x,e)},s}e(Fe,`curvedTrapezoid`);async function Ie(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.padding??20,c=Math.max(a.width+s*2,t.width??0,100),l=Math.min(Math.max(c*.23,16),56),u=l*.27,d=Math.max(a.height+s*2,t.height?t.height-(2*l-u):0),f=Math.min(c*.177,d*.45),p=d+2*l-u,m=-p/2,h=m+2*l-u,g=i.insert(`g`,`:first-child`).attr(`class`,`basic label-container`),{cssStyles:_}=t;if(t.look===`handDrawn`){let e=C.svg(i),n=y(t,{}),r=e.path(z(-c/2,h,c,d,f),n),a=e.circle(0,m+l,l*2,n);g.insert(()=>a,`:first-child`),g.insert(()=>r,`:first-child`),_&&g.attr(`style`,_)}else g.append(`rect`).attr(`x`,-c/2).attr(`y`,h).attr(`width`,c).attr(`height`,d).attr(`rx`,f).attr(`ry`,f).attr(`style`,r),g.append(`circle`).attr(`cx`,0).attr(`cy`,m+l).attr(`r`,l).attr(`style`,r);N(t,g);let v=h+d/2;o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${v-a.height/2-(a.y-(a.top??0))})`);let x=m+l,S=Math.asin(Math.min(1,(h-x)/l))*180/Math.PI,w=[...L(0,-x,l,24,180+S,-S),...L(-(-c/2+f),-(h+f),f,12,90,0),...L(-(-c/2+f),-(p/2-f),f,12,360,270),...L(-(c/2-f),-(p/2-f),f,12,270,180),...L(-(c/2-f),-(h+f),f,12,180,90)];return t.intersect=function(e){return K.polygon(t,w,e)},i}e(Ie,`person`);var Le=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createCylinderPathD`),Re=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createOuterCylinderPathD`),ze=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),Be=8,Ve=8;async function He(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?24:i,o=t.look===`neo`?24:i,s=t.width??0;if(t.width&&(t.width-=o,t.width<Ve&&(t.width=Ve)),t.height){let e=s/2/(2.5+s/50);t.height=t.height-a-e*3,t.height<Be&&(t.height=Be)}let{shapeSvg:c,bbox:l,label:u}=await j(e,t,P(t)),d=Math.max(t.width??0,l.width)+o,f=d/2,p=f/(2.5+d/50),m=Math.max(t.height??0,l.height)+a+p,g,{cssStyles:_}=t;if(t.look===`handDrawn`){let e=C.svg(c),n=Re(0,0,d,m,f,p),r=ze(0,p,d,m,f,p),i=y(t,{}),a=e.path(n,i),o=e.path(r,y(t,{fill:`none`}));g=c.insert(()=>o,`:first-child`),g=c.insert(()=>a,`:first-child`),g.attr(`class`,`basic label-container`),_&&g.attr(`style`,_)}else{let e=Le(0,0,d,m,f,p);g=c.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,h(_)).attr(`style`,r)}return g.attr(`label-offset-y`,p),g.attr(`transform`,`translate(${-d/2}, ${-(m/2+p)})`),N(t,g),u.attr(`transform`,`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(e){let n=K.rect(t,e),r=n.x-(t.x??0);if(f!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-p)){let i=p*p*(1-r*r/(f*f));i>0&&(i=Math.sqrt(i)),i=p-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},c}e(He,`cylinder`);async function Ue(e,t,n){let{labelStyles:r,nodeStyles:i}=b(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await j(e,t,P(t)),s=Math.max(o.width+n.labelPaddingX*2,t?.width||0),c=Math.max(o.height+n.labelPaddingY*2,t?.height||0),l=-s/2,u=-c/2,d,{rx:f,ry:p}=t,{cssStyles:m}=t;if(n?.rx&&n.ry&&(f=n.rx,p=n.ry),t.look===`handDrawn`){let e=C.svg(a),n=y(t,{}),r=f||p?e.path(z(l,u,s,c,f||0),n):e.rectangle(l,u,s,c,n);d=a.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,h(m))}else d=a.insert(`rect`,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,h(f)).attr(`ry`,h(p)).attr(`x`,l).attr(`y`,u).attr(`width`,s).attr(`height`,c);return N(t,d,t.look===`handDrawn`?void 0:{width:s,height:c}),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},a}e(Ue,`drawRect`);async function We(e,t){let{cssClasses:n,labelPaddingX:r,labelPaddingY:i,padding:a,width:o,height:s}=t,c=await Ue(e,t,{rx:0,ry:0,classes:n??``,labelPaddingX:r??(a??0)*2,labelPaddingY:i??a??0});if(t.look===`handDrawn`){let e=C.svg(c),n=y(t,{}),r=c.select(`.basic.label-container > path:nth-child(2)`),i=r.node();if(!i)return c;let a=null;if(i instanceof SVGGraphicsElement)a=i.getBBox();else return c;return c.insert(()=>e.line(a.x,a.y,a.x+a.width,a.y,n),`.basic.label-container g.label`),c.insert(()=>e.line(a.x,a.y+a.height,a.x+a.width,a.y+a.height,n),`.basic.label-container g.label`),r.remove(),c}let l=c.select(`.basic.label-container`),u=(Number(l.attr(`width`))||o)??0,d=(Number(l.attr(`height`))||s)??0;return u>0&&d>0&&l.attr(`stroke-dasharray`,`${u} ${d}`),c}e(We,`datastore`);async function Ge(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?16:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await j(e,t,P(t)),l=s.width+i,u=s.height+a,d=u*.2,f=-l/2,p=-u/2-d/2,{cssStyles:m}=t,h=C.svg(o),g=y(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],v=h.polygon(_.map(e=>[e.x,e.y]),g),x=o.insert(()=>v,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${f+(t.padding??0)/2-(s.x-(s.left??0))}, ${p+d+(t.padding??0)/2-(s.y-(s.top??0))})`),N(t,x),t.intersect=function(e){return K.rect(t,e)},o}e(Ge,`dividedRectangle`);async function Ke(e,n){let{labelStyles:r,nodeStyles:i}=b(n),a=n.look===`neo`?12:5;n.labelStyle=r;let o=n.padding??0,s=n.look===`neo`?16:o,{shapeSvg:c,bbox:l}=await j(e,n,P(n)),u=(n?.width?n?.width/2:l.width/2)+(s??0),d=u-a,f,{cssStyles:p}=n;if(n.look===`handDrawn`){let e=C.svg(c),t=y(n,{roughness:.2,strokeWidth:2.5}),r=y(n,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,u*2,t),a=e.circle(0,0,d*2,r);f=c.insert(`g`,`:first-child`),f.attr(`class`,h(n.cssClasses)).attr(`style`,h(p)),f.node()?.appendChild(i),f.node()?.appendChild(a)}else{f=c.insert(`g`,`:first-child`);let e=f.insert(`circle`,`:first-child`),t=f.insert(`circle`);f.attr(`class`,`basic label-container`).attr(`style`,i),e.attr(`class`,`outer-circle`).attr(`style`,i).attr(`r`,u).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,i).attr(`r`,d).attr(`cx`,0).attr(`cy`,0)}return N(n,f),n.intersect=function(e){return t.info(`DoubleCircle intersect`,n,u,e),K.circle(n,u,e)},c}e(Ke,`doublecircle`);function qe(e,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=b(n);n.label=``,n.labelStyle=i;let o=e.insert(`g`).attr(`class`,P(n)).attr(`id`,n.domId??n.id),{cssStyles:s}=n,c=C.svg(o),{nodeBorder:l}=r,u=y(n,{fillStyle:`solid`});n.look!==`handDrawn`&&(u.roughness=0);let d=c.circle(0,0,14,u),f=o.insert(()=>d,`:first-child`);return f.selectAll(`path`).attr(`style`,`fill: ${l} !important;`),s&&s.length>0&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,s),a&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,a),N(n,f),n.intersect=function(e){return t.info(`filledCircle intersect`,n,{radius:7,point:e}),K.circle(n,7,e)},o}e(qe,`filledCircle`);var Je=10,Ye=10;async function Xe(e,n){let{labelStyles:r,nodeStyles:i}=b(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?a*2:a;(n.width||n.height)&&(n.height=n?.height??0,n.height<Je&&(n.height=Je),n.width=(n?.width??0)-o-o/2,n.width<Ye&&(n.width=Ye));let{shapeSvg:s,bbox:c,label:l}=await j(e,n,P(n)),u=(n?.width?n?.width:c.width)+(o??0),d=n?.height?n?.height:u+c.height,f=d,p=[{x:0,y:-d},{x:f,y:-d},{x:f/2,y:0}],{cssStyles:m}=n,h=C.svg(s),g=y(n,{});n.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=F(p),v=h.path(_,g),x=s.insert(()=>v,`:first-child`).attr(`transform`,`translate(${-d/2}, ${d/2})`).attr(`class`,`outer-path`);return m&&n.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,m),i&&n.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,i),n.width=u,n.height=d,N(n,x),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-d/2+(n.padding??0)/2+(c.y-(c.top??0))})`),n.intersect=function(e){return t.info(`Triangle intersect`,n,p,e),K.polygon(n,p,e)},s}e(Xe,`flippedTriangle`);async function Ze(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.padding??12,c=Math.max(a.width+s*2,t.width??0,90),l=a.height+s*2,u=Math.max(Math.min(l*.16,14),8),d=Math.max(l+u,t.height??0),f=d-u,p=Math.max(c*.38,28),m=-d/2,h=[{x:-c/2,y:m},{x:-c/2+p,y:m},{x:-c/2+p,y:m+u},{x:c/2,y:m+u},{x:c/2,y:d/2},{x:-c/2,y:d/2}],g=[`M${h[0].x},${h[0].y}`,...h.slice(1).map(e=>`L${e.x},${e.y}`),`Z`].join(` `),{cssStyles:_}=t,v;if(t.look===`handDrawn`){let e=C.svg(i).path(g,y(t,{}));v=i.insert(()=>e,`:first-child`).attr(`class`,`basic label-container`),_&&v.attr(`style`,_)}else v=i.insert(`path`,`:first-child`).attr(`d`,g).attr(`class`,`basic label-container`).attr(`style`,r);t.look===`handDrawn`?N(t,v):N(t,v,{width:c,height:d});let x=m+u+f/2;return o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${x-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(e){return K.polygon(t,h,e)},i}e(Ze,`folder`);function Qe(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=b(t);t.label=``;let o=e.insert(`g`).attr(`class`,P(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=Math.max(70,t?.width??0),l=Math.max(10,t?.height??0);n===`LR`&&(c=Math.max(10,t?.width??0),l=Math.max(70,t?.height??0));let u=-1*c/2,d=-1*l/2,f=C.svg(o),p=y(t,{stroke:i.lineColor,fill:i.lineColor});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=f.rectangle(u,d,c,l,p),h=o.insert(()=>m,`:first-child`);s&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,a),N(t,h);let g=r?.padding??0;return t.width&&t.height&&(t.width+=g/2||0,t.height+=g/2||0),t.intersect=function(e){return K.rect(t,e)},o}e(Qe,`forkJoin`);async function $e(e,n){let{labelStyles:r,nodeStyles:i}=b(n);n.labelStyle=r;let a=n.look===`neo`?16:n.padding??0,o=n.look===`neo`?12:n.padding??0;(n.width||n.height)&&(n.height=(n?.height??0)-o*2,n.height<10&&(n.height=10),n.width=(n?.width??0)-a*2,n.width<15&&(n.width=15));let{shapeSvg:s,bbox:c}=await j(e,n,P(n)),l=(n?.width?n?.width:Math.max(15,c.width))+a*2,u=(n?.height?n?.height:Math.max(10,c.height))+o*2,d=u/2,{cssStyles:f}=n,p=C.svg(s),m=y(n,{});n.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-l/2,y:-u/2},{x:l/2-d,y:-u/2},...L(-l/2+d,0,d,50,90,270),{x:l/2-d,y:u/2},{x:-l/2,y:u/2}],g=F(h),_=p.path(g,m),v=s.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container outer-path`),f&&n.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,f),i&&n.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,i),N(n,v),n.intersect=function(e){return t.info(`Pill intersect`,n,{radius:d,point:e}),K.polygon(n,h,e)},s}e($e,`halfRoundedRectangle`);var et=e((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,`Z`].join(` `),`createHexagonPathD`);async function tt(e,t){let{labelStyles:n,nodeStyles:r}=b(t),i=t.look===`neo`?3.5:4;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?70:a,s=t.look===`neo`?32:a;if(t.width||t.height){let e=(t.height??0)/i;t.width=(t?.width??0)-2*e-s,t.height=(t.height??0)-o}let{shapeSvg:c,bbox:l}=await j(e,t,P(t)),u=(t?.height?t?.height:l.height)+o,d=u/i,f=(t?.width?t?.width:l.width)+2*d+s,p=[{x:d,y:0},{x:f-d,y:0},{x:f,y:-u/2},{x:f-d,y:-u},{x:d,y:-u},{x:0,y:-u/2}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=C.svg(c),n=y(t,{}),r=et(0,0,f,u,d),i=e.path(r,n);m=c.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-f/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=q(c,f,u,p);return r&&m.attr(`style`,r),t.width=f,t.height=u,N(t,m),t.intersect=function(e){return K.polygon(t,p,e)},c}e(tt,`hexagon`);async function nt(e,n){let{labelStyles:r,nodeStyles:i}=b(n);n.label=``,n.labelStyle=r;let{shapeSvg:a}=await j(e,n,P(n)),o=Math.max(30,n?.width??0),s=Math.max(30,n?.height??0),{cssStyles:c}=n,l=C.svg(a),u=y(n,{});n.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=[{x:0,y:0},{x:o,y:0},{x:0,y:s},{x:o,y:s}],f=F(d),p=l.path(f,u),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`basic label-container outer-path`),c&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,c),i&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,i),m.attr(`transform`,`translate(${-o/2}, ${-s/2})`),N(n,m),n.intersect=function(e){return t.info(`Pill intersect`,n,{points:d}),K.polygon(n,d,e)},a}e(nt,`hourglass`);async function rt(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=b(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await j(e,n,`icon-shape default`),p=n.pos===`t`,m=c,h=c,{nodeBorder:_}=r,{stylesMap:v}=S(n),x=-h/2,w=-m/2,T=n.label?8:0,E=C.svg(u),D=y(n,{stroke:`none`,fill:`none`});n.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=E.rectangle(x,w,h,m,D),k=Math.max(h,d.width),A=m+d.height+T,M=E.rectangle(-k/2,-A/2,k,A,{...D,fill:`transparent`,stroke:`none`}),P=u.insert(()=>O,`:first-child`),F=u.insert(()=>M);if(n.icon){let e=u.append(`g`);e.html(`<g>${await g(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${p?d.height/2+T/2-i/2-o:-d.height/2-T/2-i/2-o})`),e.attr(`style`,`color: ${v.get(`stroke`)??_};`)}return f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${p?-A/2:A/2-d.height})`),P.attr(`transform`,`translate(0,${p?d.height/2+T/2:-d.height/2-T/2})`),N(n,F),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=p?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+T},{x:r+h/2,y:i-a/2+d.height+T},{x:r+h/2,y:i+a/2},{x:r-h/2,y:i+a/2},{x:r-h/2,y:i-a/2+d.height+T},{x:r-d.width/2,y:i-a/2+d.height+T}]:[{x:r-h/2,y:i-a/2},{x:r+h/2,y:i-a/2},{x:r+h/2,y:i-a/2+m},{x:r+d.width/2,y:i-a/2+m},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+m},{x:r-h/2,y:i-a/2+m}],K.polygon(n,o,e)},u}e(rt,`icon`);async function it(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=b(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await j(e,n,`icon-shape default`),p=n.label?8:0,m=n.pos===`t`,{nodeBorder:h,mainBkg:_}=r,{stylesMap:v}=S(n),x=C.svg(u),w=y(n,{});n.look!==`handDrawn`&&(w.roughness=0,w.fillStyle=`solid`),w.stroke=v.get(`fill`)??_;let T=u.append(`g`);n.icon&&T.html(`<g>${await g(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let E=T.node().getBBox(),D=E.width,O=E.height,k=E.x,A=E.y,M=Math.max(D,O)*Math.SQRT2+40,P=x.circle(0,0,M,w),F=Math.max(M,d.width),I=M+d.height+p,L=x.rectangle(-F/2,-I/2,F,I,{...w,fill:`transparent`,stroke:`none`}),ee=u.insert(()=>P,`:first-child`),R=u.insert(()=>L);return T.attr(`transform`,`translate(${-D/2-k},${m?d.height/2+p/2-O/2-A:-d.height/2-p/2-O/2-A})`),T.attr(`style`,`color: ${v.get(`stroke`)??h};`),f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-I/2:I/2-d.height})`),ee.attr(`transform`,`translate(0,${m?d.height/2+p/2:-d.height/2-p/2})`),N(n,R),n.intersect=function(e){return t.info(`iconSquare intersect`,n,e),K.rect(n,e)},u}e(it,`iconCircle`);async function at(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=b(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await j(e,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,_=c+f*2,{nodeBorder:v,mainBkg:x}=r,{stylesMap:w}=S(n),T=-_/2,E=-h/2,D=n.label?8:0,O=C.svg(u),k=y(n,{});n.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`),k.stroke=w.get(`fill`)??x;let A=O.path(z(T,E,_,h,5),k),M=Math.max(_,d.width),P=h+d.height+D,F=O.rectangle(-M/2,-P/2,M,P,{...k,fill:`transparent`,stroke:`none`}),I=u.insert(()=>A,`:first-child`).attr(`class`,`icon-shape2`),L=u.insert(()=>F);if(n.icon){let e=u.append(`g`);e.html(`<g>${await g(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${w.get(`stroke`)??v};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-P/2:P/2-d.height})`),I.attr(`transform`,`translate(0,${m?d.height/2+D/2:-d.height/2-D/2})`),N(n,L),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+_/2,y:i-a/2+d.height+D},{x:r+_/2,y:i+a/2},{x:r-_/2,y:i+a/2},{x:r-_/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-_/2,y:i-a/2},{x:r+_/2,y:i-a/2},{x:r+_/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-_/2,y:i-a/2+h}],K.polygon(n,o,e)},u}e(at,`iconRounded`);async function ot(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=b(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await j(e,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,_=c+f*2,{nodeBorder:v,mainBkg:x}=r,{stylesMap:w}=S(n),T=-_/2,E=-h/2,D=n.label?8:0,O=C.svg(u),k=y(n,{});n.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`),k.stroke=w.get(`fill`)??x;let A=O.path(z(T,E,_,h,.1),k),M=Math.max(_,d.width),P=h+d.height+D,F=O.rectangle(-M/2,-P/2,M,P,{...k,fill:`transparent`,stroke:`none`}),I=u.insert(()=>A,`:first-child`),L=u.insert(()=>F);if(n.icon){let e=u.append(`g`);e.html(`<g>${await g(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${w.get(`stroke`)??v};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-P/2:P/2-d.height})`),I.attr(`transform`,`translate(0,${m?d.height/2+D/2:-d.height/2-D/2})`),N(n,L),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+_/2,y:i-a/2+d.height+D},{x:r+_/2,y:i+a/2},{x:r-_/2,y:i+a/2},{x:r-_/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-_/2,y:i-a/2},{x:r+_/2,y:i-a/2},{x:r+_/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-_/2,y:i-a/2+h}],K.polygon(n,o,e)},u}e(ot,`iconSquare`);async function st(e,n,{config:{flowchart:r}}){let i=new Image;i.src=n?.img??``,await i.decode();let a=Number(i.naturalWidth.toString().replace(`px`,``)),o=Number(i.naturalHeight.toString().replace(`px`,``));n.imageAspectRatio=a/o;let{labelStyles:s}=b(n);n.labelStyle=s;let c=r?.wrappingWidth;n.defaultWidth=r?.wrappingWidth;let l=Math.max(n.label?c??0:0,n?.assetWidth??a),u=n.constraint===`on`&&n?.assetHeight?n.assetHeight*n.imageAspectRatio:l,d=n.constraint===`on`?u/n.imageAspectRatio:n?.assetHeight??o;n.width=Math.max(u,c??0);let{shapeSvg:f,bbox:p,label:m}=await j(e,n,`image-shape default`),h=n.pos===`t`,g=-u/2,_=-d/2,v=n.label?8:0,x=C.svg(f),S=y(n,{});n.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`);let w=x.rectangle(g,_,u,d,S),T=Math.max(u,p.width),E=d+p.height+v,D=x.rectangle(-T/2,-E/2,T,E,{...S,fill:`none`,stroke:`none`}),O=f.insert(()=>w,`:first-child`),k=f.insert(()=>D);if(n.img){let e=f.append(`image`);e.attr(`href`,n.img),e.attr(`width`,u),e.attr(`height`,d),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-u/2},${h?E/2-d:-E/2})`)}return m.attr(`transform`,`translate(${-p.width/2-(p.x-(p.left??0))},${h?-d/2-p.height/2-v/2:d/2-p.height/2+v/2})`),O.attr(`transform`,`translate(0,${h?p.height/2+v/2:-p.height/2-v/2})`),N(n,k),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=h?[{x:r-p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2+p.height+v},{x:r+u/2,y:i-a/2+p.height+v},{x:r+u/2,y:i+a/2},{x:r-u/2,y:i+a/2},{x:r-u/2,y:i-a/2+p.height+v},{x:r-p.width/2,y:i-a/2+p.height+v}]:[{x:r-u/2,y:i-a/2},{x:r+u/2,y:i-a/2},{x:r+u/2,y:i-a/2+d},{x:r+p.width/2,y:i-a/2+d},{x:r+p.width/2/2,y:i+a/2},{x:r-p.width/2,y:i+a/2},{x:r-p.width/2,y:i-a/2+d},{x:r-u/2,y:i-a/2+d}],K.polygon(n,o,e)},f}e(st,`imageSquare`);async function ct(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(c.height+a*2,t.height??0),u=Math.max(c.width+o*2,(t.width??0)-l),d=[{x:0,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:-3*l/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=C.svg(s),n=y(t,{}),r=F(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,N(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(ct,`inv_trapezoid`);async function lt(e,t){let{shapeSvg:n,bbox:r,label:i}=await j(e,t,`label`),a=n.insert(`rect`,`:first-child`);return a.attr(`width`,.1).attr(`height`,.1),n.attr(`class`,`label edgeLabel`),i.attr(`transform`,`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),N(t,a),t.intersect=function(e){return K.rect(t,e)},n}e(lt,`labelRect`);async function ut(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:0,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:-(3*l)/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=C.svg(s),n=y(t,{}),r=F(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,N(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(ut,`lean_left`);async function dt(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:-3*l/6,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=C.svg(s),n=y(t,{}),r=F(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,N(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(dt,`lean_right`);function ft(e,n){let{labelStyles:r,nodeStyles:i}=b(n);n.label=``,n.labelStyle=r;let a=e.insert(`g`).attr(`class`,P(n)).attr(`id`,n.domId??n.id),{cssStyles:o}=n,s=Math.max(35,n?.width??0),c=Math.max(35,n?.height??0),l=[{x:s,y:0},{x:0,y:c+7/2},{x:s-14,y:c+7/2},{x:0,y:2*c},{x:s,y:c-7/2},{x:14,y:c-7/2}],u=C.svg(a),d=y(n,{});n.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=F(l),p=u.path(f,d),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`outer-path`),o&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,o),i&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,i),m.attr(`transform`,`translate(-${s/2},${-c})`),N(n,m),n.intersect=function(e){return t.info(`lightningBolt intersect`,n,e),K.polygon(n,l,e)},a}e(ft,`lightningBolt`);var pt=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createCylinderPathD`),mt=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createOuterCylinderPathD`),ht=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),gt=10,_t=10;async function vt(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-a,t.width<_t&&(t.width=_t);let n=e/2/(2.5+e/50);t.height=(t.height??0)-o-n*3,t.height<gt&&(t.height=gt)}let{shapeSvg:s,bbox:c,label:l}=await j(e,t,P(t)),u=(t?.width?t?.width:c.width)+a*2,d=u/2,f=d/(2.5+u/50),p=(t?.height?t?.height:c.height)+f+o*2,m=p*.1,g,{cssStyles:_}=t;if(t.look===`handDrawn`){let e=C.svg(s),n=mt(0,0,u,p,d,f,m),r=ht(0,f,u,p,d,f),i=y(t,{}),a=e.path(n,i),o=e.path(r,i);s.insert(()=>o,`:first-child`).attr(`class`,`line`),g=s.insert(()=>a,`:first-child`),g.attr(`class`,`basic label-container`),_&&g.attr(`style`,_)}else{let e=pt(0,0,u,p,d,f,m);g=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,h(_)).attr(`style`,r)}return g.attr(`label-offset-y`,f),g.attr(`transform`,`translate(${-u/2}, ${-(p/2+f)})`),N(t,g),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+f-(c.y-(c.top??0))})`),t.intersect=function(e){let n=K.rect(t,e),r=n.x-(t.x??0);if(d!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-f)){let i=f*f*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=f-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}e(vt,`linedCylinder`);async function yt(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=(t.width??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:s,bbox:c,label:l}=await j(e,t,P(t)),u=(t?.width?t?.width:c.width)+(a??0)*2,d=(t?.height?t?.height:c.height)+(o??0)*2,f=t.look===`neo`?d/4:d/8,p=d+f,{cssStyles:m}=t,h=C.svg(s),g=y(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:-u/2-u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:p/2},...I(-u/2-u/2*.1,p/2,u/2+u/2*.1,p/2,f,.8),{x:u/2+u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:-p/2},{x:-u/2,y:-p/2},{x:-u/2,y:p/2*1.1},{x:-u/2,y:-p/2}],v=h.polygon(_.map(e=>[e.x,e.y]),g),x=s.insert(()=>v,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.attr(`transform`,`translate(0,${-f/2})`),l.attr(`transform`,`translate(${-u/2+(t.padding??0)+u/2*.1/2-(c.x-(c.left??0))},${-d/2+(t.padding??0)-f/2-(c.y-(c.top??0))})`),N(t,x),t.intersect=function(e){return K.polygon(t,_,e)},s}e(yt,`linedWaveEdgedRect`);async function bt(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=t.look===`neo`?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*s,10),t.height=Math.max((t?.height??0)-o*2-2*s,10));let{shapeSvg:c,bbox:l,label:u}=await j(e,t,P(t)),d=(t?.width?t?.width:l.width)+a*2+2*s,f=(t?.height?t?.height:l.height)+o*2+2*s,p=d-2*s,m=f-2*s,h=-p/2,g=-m/2,{cssStyles:_}=t,v=C.svg(c),x=y(t,{}),S=[{x:h-s,y:g+s},{x:h-s,y:g+m+s},{x:h+p-s,y:g+m+s},{x:h+p-s,y:g+m},{x:h+p,y:g+m},{x:h+p,y:g+m-s},{x:h+p+s,y:g+m-s},{x:h+p+s,y:g-s},{x:h+s,y:g-s},{x:h+s,y:g},{x:h,y:g},{x:h,y:g+s}],w=[{x:h,y:g+s},{x:h+p-s,y:g+s},{x:h+p-s,y:g+m},{x:h+p,y:g+m},{x:h+p,y:g},{x:h,y:g}];t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let T=F(S),E=v.path(T,x),D=F(w),O=v.path(D,x);t.look!==`handDrawn`&&(E=ee(E),O=ee(O));let k=c.insert(`g`,`:first-child`);return k.insert(()=>E),k.insert(()=>O),k.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,r),u.attr(`transform`,`translate(${-(l.width/2)-s-(l.x-(l.left??0))}, ${-(l.height/2)+s-(l.y-(l.top??0))})`),N(t,k),t.intersect=function(e){return K.polygon(t,S,e)},c}e(bt,`multiRect`);async function xt(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.padding??0,c=t.look===`neo`?16:s,l=t.look===`neo`?12:s,u=!0;(t.width||t.height)&&(u=!1,t.width=(t?.width??0)-c*2,t.height=(t?.height??0)-l*3);let d=Math.max(a.width,t?.width??0)+c*2,f=Math.max(a.height,t?.height??0)+l*3,p=t.look===`neo`?f/4:f/8,m=f+(u?p/2:-p/2),h=-d/2,g=-m/2,{cssStyles:_}=t,v=I(h-10,g+m+10,h+d-10,g+m+10,p,.8),x=v?.[v.length-1],S=[{x:h-10,y:g+10},{x:h-10,y:g+m+10},...v,{x:h+d-10,y:x.y-10},{x:h+d,y:x.y-10},{x:h+d,y:x.y-20},{x:h+d+10,y:x.y-20},{x:h+d+10,y:g-10},{x:h+10,y:g-10},{x:h+10,y:g},{x:h,y:g},{x:h,y:g+10}],w=[{x:h,y:g+10},{x:h+d-10,y:g+10},{x:h+d-10,y:x.y-10},{x:h+d,y:x.y-10},{x:h+d,y:g},{x:h,y:g}],T=C.svg(i),E=y(t,{});t.look!==`handDrawn`&&(E.roughness=0,E.fillStyle=`solid`);let D=F(S),O=T.path(D,E),k=F(w),A=T.path(k,E),M=i.insert(()=>O,`:first-child`);return M.insert(()=>A),M.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,r),M.attr(`transform`,`translate(0,${-p/2})`),o.attr(`transform`,`translate(${-(a.width/2)-10-(a.x-(a.left??0))}, ${-(a.height/2)+10-p/2-(a.y-(a.top??0))})`),N(t,M),t.intersect=function(e){return K.polygon(t,S,e)},i}e(xt,`multiWaveEdgedRectangle`);async function St(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=b(t);t.labelStyle=r,t.useHtmlLabels||o(s())||(t.centerLabel=!0);let{shapeSvg:a,bbox:c,label:l}=await j(e,t,P(t)),u=Math.max(c.width+(t.padding??0)*2,t?.width??0),d=Math.max(c.height+(t.padding??0)*2,t?.height??0),f=-u/2,p=-d/2,{cssStyles:m}=t,h=C.svg(a),g=y(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=h.rectangle(f,p,u,d,g),v=a.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container outer-path`),l.attr(`class`,`label noteLabel`),m&&t.look!==`handDrawn`&&v.selectAll(`path`).attr(`style`,m),i&&t.look!==`handDrawn`&&v.selectAll(`path`).attr(`style`,i),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),N(t,v),t.intersect=function(e){return K.rect(t,e)},a}e(St,`note`);var Ct=e((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,`Z`].join(` `),`createDecisionBoxPathD`);async function wt(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await j(e,t,P(t)),o=a.width+(t.padding??0)+(a.height+(t.padding??0)),s=.5,c=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=C.svg(i),n=y(t,{}),r=Ct(0,0,o),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2+s}, ${o/2})`),u&&l.attr(`style`,u)}else l=q(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),N(t,l),t.calcIntersect=function(e,t){let n=e.width,r=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}],i=K.polygon(e,r,t);return{x:i.x-.5,y:i.y-.5}},t.intersect=function(e){return this.calcIntersect(t,e)},i}e(wt,`question`);async function Tt(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?21:i??0,o=t.look===`neo`?12:i??0,{shapeSvg:s,bbox:c,label:l}=await j(e,t,P(t)),u=c.width+(t.look===`neo`?a*2:a),d=Math.max(c.height+(t.look===`neo`?o*2:o),t.height??0),f=d/4,p=-Math.max(u,(t.width??0)-f)/2,m=-d/2,h=m/2,g=[{x:p+h,y:m},{x:p,y:0},{x:p+h,y:-m},{x:-p,y:-m},{x:-p,y:m}],{cssStyles:_}=t,v=C.svg(s),x=y(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=F(g),w=v.path(S,x),T=s.insert(()=>w,`:first-child`);return T.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&T.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&T.selectAll(`path`).attr(`style`,r),T.attr(`transform`,`translate(${-h/2},0)`),l.attr(`transform`,`translate(${-h/2-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),N(t,T),t.intersect=function(e){return K.polygon(t,g,e)},s}e(Tt,`rect_left_inv_arrow`);async function Et(e,r){let{labelStyles:i,nodeStyles:a}=b(r);r.labelStyle=i;let s;s=r.cssClasses?`node `+r.cssClasses:`node default`;let c=e.insert(`g`).attr(`class`,s).attr(`id`,r.domId||r.id),l=c.insert(`g`),d=c.insert(`g`).attr(`class`,`label`).attr(`style`,a),f=r.description,p=r.label,m=await te(d,p,r.labelStyle,!0,!0),h={width:0,height:0};if(o(u())){let e=m.children[0],t=n(m);h=e.getBoundingClientRect(),t.attr(`width`,h.width),t.attr(`height`,h.height)}t.info(`Text 2`,f);let g=f||[],_=m.getBBox(),v=await te(d,Array.isArray(g)?g.join(`<br/>`):g,r.labelStyle,!0,!0),x=v.children[0],S=n(v);h=x.getBoundingClientRect(),S.attr(`width`,h.width),S.attr(`height`,h.height);let w=(r.padding||0)/2;n(v).attr(`transform`,`translate( `+(h.width>_.width?0:(_.width-h.width)/2)+`, `+(_.height+w+5)+`)`),n(m).attr(`transform`,`translate( `+(h.width<_.width?0:-(_.width-h.width)/2)+`, 0)`),h=d.node().getBBox(),d.attr(`transform`,`translate(`+-h.width/2+`, `+(-h.height/2-w+3)+`)`);let T=h.width+(r.padding||0),E=h.height+(r.padding||0),D=-h.width/2-w,O=-h.height/2-w,k,A;if(r.look===`handDrawn`){let e=C.svg(c),n=y(r,{}),i=e.path(z(D,O,T,E,r.rx||0),n),a=e.line(-h.width/2-w,-h.height/2-w+_.height+w,h.width/2+w,-h.height/2-w+_.height+w,n);A=c.insert(()=>(t.debug(`Rough node insert CXC`,i),a),`:first-child`),k=c.insert(()=>(t.debug(`Rough node insert CXC`,i),i),`:first-child`)}else k=l.insert(`rect`,`:first-child`),A=l.insert(`line`),k.attr(`class`,`outer title-state`).attr(`style`,a).attr(`x`,-h.width/2-w).attr(`y`,-h.height/2-w).attr(`width`,h.width+(r.padding||0)).attr(`height`,h.height+(r.padding||0)),A.attr(`class`,`divider`).attr(`x1`,-h.width/2-w).attr(`x2`,h.width/2+w).attr(`y1`,-h.height/2-w+_.height+w).attr(`y2`,-h.height/2-w+_.height+w);return N(r,k),r.intersect=function(e){return K.rect(r,e)},c}e(Et,`rectWithTitle`);async function Dt(e,t,{config:{themeVariables:n}}){let r=n?.radius??5;return Ue(e,t,{rx:r,ry:r,classes:``,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1})}e(Dt,`roundedRect`);var Z=8;async function Ot(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await j(e,t,P(t)),l=(t?.width??s.width)+i*2+(t.look===`neo`?Z:Z*2),u=(t?.height??s.height)+a*2,d=l-Z,f=u,p=Z-l/2,m=-u/2,{cssStyles:g}=t,_=C.svg(o),v=y(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let x=[{x:p,y:m},{x:p+d,y:m},{x:p+d,y:m+f},{x:p-Z,y:m+f},{x:p-Z,y:m},{x:p,y:m},{x:p,y:m+f}],S=_.polygon(x.map(e=>[e.x,e.y]),v),w=o.insert(()=>S,`:first-child`);return w.attr(`class`,`basic label-container outer-path`).attr(`style`,h(g)),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),g&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${Z/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),N(t,w),t.intersect=function(e){return K.rect(t,e)},o}e(Ot,`shadedProcess`);async function kt(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:s,bbox:c,label:l}=await j(e,t,P(t)),u=(t?.width?t?.width:c.width)+a*2,d=((t?.height?t?.height:c.height)+o*2)*1.5,f=u,p=d/1.5,m=-f/2,h=-p/2,{cssStyles:g}=t,_=C.svg(s),v=y(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let x=[{x:m,y:h},{x:m,y:h+p},{x:m+f,y:h+p},{x:m+f,y:h-p/2}],S=F(x),w=_.path(S,v),T=s.insert(()=>w,`:first-child`);return T.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&T.selectChildren(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&T.selectChildren(`path`).attr(`style`,r),T.attr(`transform`,`translate(0, ${p/4})`),l.attr(`transform`,`translate(${-f/2+(t.padding??0)-(c.x-(c.left??0))}, ${-p/4+(t.padding??0)-(c.y-(c.top??0))})`),N(t,T),t.intersect=function(e){return K.polygon(t,x,e)},s}e(kt,`slopedRect`);async function At(e,t){let n=t.padding??0,r=t.look===`neo`?16:n*2,i=t.look===`neo`?12:n;return Ue(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??r,labelPaddingY:i})}e(At,`squareRect`);async function jt(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?20:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=c.height+(t.look===`neo`?o*2:o),u=c.width+l/4+(t.look===`neo`?a*2:a),d=l/2,{cssStyles:f}=t,p=C.svg(s),m=y(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-u/2+d,y:-l/2},{x:u/2-d,y:-l/2},...L(-u/2+d,0,d,50,90,270),{x:u/2-d,y:l/2},...L(u/2-d,0,d,50,270,450)],g=F(h),_=p.path(g,m),v=s.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,r),N(t,v),t.intersect=function(e){return K.polygon(t,h,e)},s}e(jt,`stadium`);async function Mt(e,t){return Ue(e,t,{rx:t.look===`neo`?3:5,ry:t.look===`neo`?3:5,classes:`flowchart-node`})}e(Mt,`state`);function Nt(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=b(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c,nodeShadow:l}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let u=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId??t.id),d=C.svg(u),f=y(t,{});t.look!==`handDrawn`&&(f.roughness=0,f.fillStyle=`solid`);let p=d.circle(0,0,t.width,{...f,stroke:o,strokeWidth:2}),m=s??c,h=(t.width??0)*5/14,g=d.circle(0,0,h,{...f,fill:m,stroke:m,strokeWidth:2,fillStyle:`solid`}),_=u.insert(()=>p,`:first-child`);if(_.insert(()=>g),t.look!==`handDrawn`&&_.attr(`class`,`outer-path`),a&&_.selectAll(`path`).attr(`style`,a),i&&_.selectAll(`path`).attr(`style`,i),t.width<25&&l&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;_.attr(`style`,`filter:url(#${n})`)}return N(t,_),t.intersect=function(e){return K.circle(t,(t.width??0)/2,e)},u}e(Nt,`stateEnd`);function Pt(e,t,{config:{themeVariables:n}}){let{lineColor:r,nodeShadow:i}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let a=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),o;if(t.look===`handDrawn`){let e=C.svg(a).circle(0,0,t.width,x(r));o=a.insert(()=>e),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14)}else o=a.insert(`circle`,`:first-child`),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14);if(t.width<25&&i&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;o.attr(`style`,`filter:url(#${n})`)}return N(t,o),t.intersect=function(e){return K.circle(t,(t.width??7)/2,e)},a}e(Pt,`stateStart`);var Ft=8;async function It(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let i=t?.padding??8,a=t.look===`neo`?28:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(c.width+2*Ft+a,t.width??0),u=Math.max(c.height+o,t.height??0),d=l-2*Ft,f=u,p=-l/2,m=-u/2,g=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look===`handDrawn`){let e=C.svg(s),n=y(t,{}),r=e.rectangle(p,m,d+16,f,n),i=e.line(p+Ft,m,p+Ft,m+f,n),a=e.line(p+Ft+d,m,p+Ft+d,m+f,n);s.insert(()=>i,`:first-child`),s.insert(()=>a,`:first-child`);let o=s.insert(()=>r,`:first-child`),{cssStyles:c}=t;o.attr(`class`,`basic label-container`).attr(`style`,h(c)),N(t,o)}else{let e=q(s,d,f,g);r&&e.attr(`style`,r),N(t,e)}return t.intersect=function(e){return K.polygon(t,g,e)},s}e(It,`subroutine`);var Lt=.2;async function Rt(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-Lt*(t.height+o*2),10));let{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=(t?.height?t?.height:c.height)+o*2,u=Lt*l,d=Lt*l,f=(t?.width?t?.width:c.width)+a*2+u-u,p=l,m=-f/2,h=-p/2,{cssStyles:g}=t,_=C.svg(s),v=y(t,{}),x=[{x:m-u/2,y:h},{x:m+f+u/2,y:h},{x:m+f+u/2,y:h+p},{x:m-u/2,y:h+p}],S=[{x:m+f-u/2,y:h+p},{x:m+f+u/2,y:h+p},{x:m+f+u/2,y:h+p-d}];t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let w=F(x),T=_.path(w,v),E=F(S),D=_.path(E,{...v,fillStyle:`solid`}),O=s.insert(()=>D,`:first-child`);return O.insert(()=>T,`:first-child`),O.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),N(t,O),t.intersect=function(e){return K.polygon(t,x,e)},s}e(Rt,`taggedRect`);async function zt(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/8,u=.2*s,d=.2*c,f=c+l,{cssStyles:p}=t,m=C.svg(i),h=y(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-s/2-s/2*.1,y:f/2},...I(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,l,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],_=-s/2+s/2*.1,v=-f/2-d*.4,x=[{x:_+s-u,y:(v+c)*1.3},{x:_+s,y:v+c-d},{x:_+s,y:(v+c)*.9},...I(_+s,(v+c)*1.25,_+s-u,(v+c)*1.3,-c*.02,.5)],S=F(g),w=m.path(S,h),T=F(x),E=m.path(T,{...h,fillStyle:`solid`}),D=i.insert(()=>E,`:first-child`);return D.insert(()=>w,`:first-child`),D.attr(`class`,`basic label-container outer-path`),p&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),D.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),N(t,D),t.intersect=function(e){return K.polygon(t,g,e)},i}e(zt,`taggedWaveEdgedRectangle`);async function Bt(e,t){let{labelStyles:n,nodeStyles:r}=b(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await j(e,t,P(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),s=Math.max(a.height+(t.padding??0),t?.height||0),c=-o/2,l=-s/2,u=i.insert(`rect`,`:first-child`);return u.attr(`class`,`text`).attr(`style`,r).attr(`rx`,0).attr(`ry`,0).attr(`x`,c).attr(`y`,l).attr(`width`,o).attr(`height`,s),N(t,u),t.intersect=function(e){return K.rect(t,e)},i}e(Bt,`text`);var Vt=e((e,t,n,r,i,a)=>`M${e},${t}
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-oBChb5qS.js";import{A as r,B as i,M as a,T as o,b as s,f as c,g as l,x as u,z as d}from"./chunk-DU6HZSFF-Zkp69c6c.js";import{a as f,p,r as m,u as h}from"./chunk-75Z2AOVW-C5pGd3W9.js";import{a as g,i as _,r as v,t as y}from"./chunk-P2QGCYS3-Oag_FdCq.js";import{t as b}from"./chunk-PWAF6VOD-JSNrcBmP.js";import{n as x,r as S}from"./chunk-GMAD6QVW-NZ6WpDb8.js";import{t as C}from"./rough.esm-Dy-Kn_BL.js";var w=1,T=3;async function E(t){let n=t.getElementsByTagName(`img`);if(!n||n.length===0)return;let r=!D(t);await Promise.all([...n].map(t=>new Promise(n=>{function i(){if(t.style.display=`flex`,t.style.flexDirection=`column`,r){let e=u().fontSize?u().fontSize:window.getComputedStyle(document.body).fontSize,[n=c.fontSize]=p(e),r=n*5+`px`;t.style.minWidth=r,t.style.maxWidth=r}else t.style.width=`100%`;n(t)}e(i,`setupImage`),setTimeout(()=>{t.complete&&i()}),t.addEventListener(`error`,i),t.addEventListener(`load`,i)})))}e(E,`configureLabelImages`);function D(e){return e.nodeType===T?e.textContent?.trim()!==``:e.nodeType!==w||e.tagName.toLowerCase()===`img`?!1:[...e.childNodes].some(D)}e(D,`hasTextBesidesImages`);var O=3,k=32,A=e(async(e,t,r)=>{let i=u(),a=e.insert(`g`).attr(`class`,r??`node default`).attr(`id`,t.domId||t.id),o=a.insert(`g`).attr(`class`,`label`).attr(`style`,h(t.labelStyle)),s=[{text:typeof t.label==`string`?t.label:t.label?.[0]??``,cssClass:`c4-name`},{text:t.stereotype,cssClass:`c4-type`},...(t.description??[]).map(e=>({text:e,cssClass:`c4-descr`}))].filter(e=>e.text),c=t.width?Math.max(t.width-2*(t.padding??0),k):u().flowchart?.wrappingWidth??200,l=i.c4?.wrap??!0?c:1/0,p=await Promise.all(s.map(async e=>{let r=o.append(`g`).attr(`class`,e.cssClass),a=await x(r,d(f(e.text??``),i),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:l,style:t.labelStyle},i);return n(a).selectAll(`tspan.text-outer-tspan`).attr(`text-anchor`,`middle`),n(a).selectAll(`tspan.text-inner-tspan`).attr(`font-weight`,null).attr(`font-style`,null),{el:r,box:r.node().getBBox()}})),m=Math.max(...p.map(({box:e})=>e.width),0),g=0;for(let{el:e,box:t}of p)e.attr(`transform`,`translate(${m/2-t.x-t.width/2}, ${g-t.y})`),g+=t.height+O;let _=p.length>0?g-O:0;return o.insert(`rect`,`:first-child`),o.attr(`transform`,`translate(${-m/2}, ${-_/2})`),{shapeSvg:a,bbox:o.node().getBBox(),halfPadding:(t.padding??0)/2,label:o}},`c4LabelHelper`),j=e(async(e,t,r)=>{if(t.stereotype!==void 0)return A(e,t,r);let i,a=t.useHtmlLabels||l(u()?.htmlLabels);i=r||`node default`;let o=e.insert(`g`).attr(`class`,i).attr(`id`,t.domId||t.id),s=o.insert(`g`).attr(`class`,`label`).attr(`style`,h(t.labelStyle)),c;c=t.label===void 0?``:typeof t.label==`string`?t.label:t.label[0];let p=!!t.icon||!!t.img,m=t.labelType===`markdown`,g=await x(s,d(f(c),u()),{useHtmlLabels:a,width:t.width||t.wrappingWidth||u().flowchart?.wrappingWidth,classes:m?`markdown-node-label`:``,style:t.labelStyle,addSvgBackground:p,markdown:m},u()),_=(t?.padding??0)/2,v;if(a){let e=g.children[0],t=n(g);await E(e),v=await S.measure(()=>e.getBoundingClientRect()),t.attr(`width`,v.width),t.attr(`height`,v.height)}else v=await S.measure(()=>g.getBBox());return a?s.attr(`transform`,`translate(`+-v.width/2+`, `+-v.height/2+`)`):s.attr(`transform`,`translate(0, `+-v.height/2+`)`),t.centerLabel&&s.attr(`transform`,`translate(`+-v.width/2+`, `+-v.height/2+`)`),s.insert(`rect`,`:first-child`),{shapeSvg:o,bbox:v,halfPadding:_,label:s}},`labelHelper`),M=e(async(e,t,r)=>{let i=r.useHtmlLabels??o(u()),a=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),s=await x(a,d(f(t),u()),{useHtmlLabels:i,width:r.width||u()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),c=r.padding/2,l;if(o(u())){let e=s.children[0],t=n(s);l=await S.measure(()=>e.getBoundingClientRect()),t.attr(`width`,l.width),t.attr(`height`,l.height)}else l=await S.measure(()=>s.getBBox());return i?a.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`):a.attr(`transform`,`translate(0, `+-l.height/2+`)`),r.centerLabel&&a.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`),a.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:l,halfPadding:c,label:a}},`insertLabel`),N=e((e,t,n)=>{if(n){e.width=n.width,e.height=n.height;return}let r=t.node().getBBox();e.width=r.width,e.height=r.height},`updateNodeBounds`),P=e((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function F(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}e(F,`createPathFromPoints`);function I(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}e(I,`generateFullSineWavePoints`);function L(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(L,`generateCirclePoints`);function ee(t){let n=Array.from(t.childNodes).filter(e=>e.tagName===`path`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),i=n.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);r.setAttribute(`d`,i);let a=n.find(e=>e.getAttribute(`fill`)!==`none`),o=n.find(e=>e.getAttribute(`stroke`)!==`none`),s=e((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(a){let e={fill:s(a,`fill`),"fill-opacity":s(a,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}if(o){let e={stroke:s(o,`stroke`),"stroke-width":s(o,`stroke-width`)??`1`,"stroke-opacity":s(o,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}let c=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return c.appendChild(r),c}e(ee,`mergePaths`);var R=e((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`),z=e((e,t,n,r,i)=>[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),te=e(async(e,t,n,r=!1,i=!1)=>{let a=t||``;typeof a==`object`&&(a=a[0]);let s=u(),c=o(s);return await x(e,a,{style:n,isTitle:r,useHtmlLabels:c,markdown:!1,isNode:i,width:1/0},s)},`createLabel`);function B(e,t){return e.intersect(t)}e(B,`intersectNode`);var ne=B;function V(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x<i&&(l=-l);var u=Math.abs(t*n*s/c);return r.y<a&&(u=-u),{x:i+l,y:a+u}}e(V,`intersectEllipse`);var H=V;function re(e,t,n){return H(e,t,t,n)}e(re,`intersectCircle`);var ie=re;function U(e,t,n,r){{let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,c=i*r.x+a*r.y+o,l=1e-6;if(s!==0&&c!==0&&W(s,c))return;let u=r.y-n.y,d=n.x-r.x,f=r.x*n.y-n.x*r.y,p=u*e.x+d*e.y+f,m=u*t.x+d*t.y+f;if(Math.abs(p)<l&&Math.abs(m)<l&&W(p,m))return;let h=i*d-u*a;if(h===0)return;let g=Math.abs(h/2),_=a*f-d*o,v=_<0?(_-g)/h:(_+g)/h;return _=u*o-i*f,{x:v,y:_<0?(_-g)/h:(_+g)/h}}}e(U,`intersectLine`);function W(e,t){return e*t>0}e(W,`sameSign`);var G=U;function ae(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r<t.length;r++){let i=t[r],o=t[r<t.length-1?r+1:0],s=G(e,n,{x:c+i.x,y:l+i.y},{x:c+o.x,y:l+o.y});s&&a.push(s)}return a.length?(a.length>1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a<c?-1:a===c?0:1}),a[0]):e}e(ae,`intersectPolygon`);var K={node:ne,circle:ie,ellipse:H,polygon:ae,rect:R};function oe(e,n){let{labelStyles:r}=_(n);n.labelStyle=r;let i=P(n),a=i;i||(a=`anchor`);let o=e.insert(`g`).attr(`class`,a).attr(`id`,n.domId||n.id),{cssStyles:s}=n,c=C.svg(o),l=g(n,{fill:`black`,stroke:`none`,fillStyle:`solid`});n.look!==`handDrawn`&&(l.roughness=0);let u=c.circle(0,0,2,l),d=o.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,h(s)),N(n,d),n.intersect=function(e){return t.info(`Circle intersect`,n,1,e),K.circle(n,1,e)},o}e(oe,`anchor`);function se(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}e(se,`generateArcPoints`);function ce(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}e(ce,`calculateArcSagitta`);async function le(t,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?16:a,s=n.look===`neo`?12:a,c=e(e=>e+s,`calcTotalHeight`),l=e(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await j(t,n,P(n)),f=c(n?.height?n?.height:d.height),[p,m]=l(f),h=ce(f,p,m),v=(n?.width?n?.width:d.width)+o*2+h-h,y=f,{cssStyles:b}=n,x=[{x:v/2,y:-y/2},{x:-v/2,y:-y/2},...se(-v/2,-y/2,-v/2,y/2,p,m,!1),{x:v/2,y:y/2},...se(v/2,y/2,v/2,-y/2,p,m,!0)],S=C.svg(u),w=g(n,{});n.look!==`handDrawn`&&(w.roughness=0,w.fillStyle=`solid`);let T=F(x),E=S.path(T,w),D=u.insert(()=>E,`:first-child`);return D.attr(`class`,`basic label-container outer-path`),b&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,b),i&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,i),D.attr(`transform`,`translate(${p/2}, 0)`),N(n,D),n.intersect=function(e){return K.polygon(n,x,e)},u}e(le,`bowTieRect`);async function ue(t,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=_(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,label:c}=await j(t,n,P(n)),l=r?.nodeBorder??r?.lineColor??`currentColor`,u=n.padding??12,d=Math.max(s.width+u*2,n.width??0,80),f=Math.max(Math.min(d*.08,12),5),p=Math.max(s.height+u*2+f,n.height??0),m=-p/2+f,h=p/2,v=d*.72,y=[`M${-d/2},${m}`,`L${-v/2},${h}`,`A${v/2},${f} 0 0 0 ${v/2},${h}`,`L${d/2},${m}`,`A${d/2},${f} 0 0 0 ${-d/2},${m}`,`Z`].join(` `),{cssStyles:b}=n,x=o.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(n.look===`handDrawn`){let e=C.svg(o).path(y,g(n,{}));x.node()?.appendChild(e),b&&x.attr(`style`,b)}else x.append(`path`).attr(`d`,y).attr(`style`,a);x.append(`ellipse`).attr(`cx`,0).attr(`cy`,m).attr(`rx`,d/2).attr(`ry`,f).attr(`style`,`fill:none;stroke:${l};stroke-width:1px`),N(n,x);let S=m+(h-m)/2;c.attr(`transform`,`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${S-s.height/2-(s.y-(s.top??0))})`);let w=e((e,t,n)=>Array.from({length:13},(r,i)=>{let a=Math.PI-i*Math.PI/12;return{x:e*Math.cos(a),y:t+n*f*Math.sin(a)}}),`arc`),T=[...w(d/2,m,-1),...w(v/2,h,1).reverse()];return n.intersect=function(e){return K.polygon(n,T,e)},o}e(ue,`bucket`);var de=20,fe=8,pe=80,me=8;async function he(e,t){let{themeVariables:n}=u(),r=n.clusterBkg,i=n.clusterBorder,{nodeStyles:a}=_(t),{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=t.padding??8,d=c.height,f=Math.max(c.width+l*2,pe,t?.width??0),p=Math.max(d+fe+de+l*2,t?.height??0),m=-f/2,v=-p/2,y=-(fe+de)/2,b=s.select(`.label`);b&&(t.useHtmlLabels??o(u())?b.attr(`transform`,`translate(${-c.width/2}, ${-c.height/2+y})`):b.attr(`transform`,`translate(0, ${-c.height/2+y})`));let x;if(t.look===`handDrawn`){let e=C.svg(s),n=g(t,{fill:r,stroke:i,fillStyle:`solid`}),a=e.path(z(m,v,f,p,me),n);x=s.insert(()=>a,`:first-child`),x.attr(`class`,`basic label-container collapsed-group`).attr(`style`,h(t.cssStyles))}else x=s.insert(`rect`,`:first-child`),x.attr(`class`,`basic label-container collapsed-group`).attr(`style`,a).attr(`rx`,me).attr(`ry`,me).attr(`x`,m).attr(`y`,v).attr(`width`,f).attr(`height`,p).attr(`fill`,r).attr(`stroke`,i);let S=v+l+d+fe;s.append(`line`).attr(`class`,`collapsed-separator`).attr(`x1`,m+8).attr(`y1`,S).attr(`x2`,m+f-8).attr(`y2`,S).attr(`stroke`,i).attr(`stroke-dasharray`,`3, 3`);let w=S+de/2;for(let e=-1;e<=1;e++)s.append(`circle`).attr(`class`,`collapsed-indicator`).attr(`cx`,e*10).attr(`cy`,w).attr(`r`,2.5).attr(`fill`,i);return N(t,x),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},s}e(he,`collapsedGroup`);function q(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}e(q,`insertPolygonShape`);var ge=[`right`,`left`,`up`,`down`],_e=`point`,ve=e(e=>{let t=new Set;for(let n of e)switch(n){case`x`:t.add(`right`),t.add(`left`);break;case`y`:t.add(`up`),t.add(`down`);break;default:t.add(n)}return t},`expandAndDeduplicateDirections`),ye=e(e=>ge.filter(t=>e.has(t)).join(`|`)||_e,`getDirectionKey`),be={"right|left|up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:0,y:0},{x:t,y:0},{x:r/2,y:2*n},{x:r-t,y:0},{x:r,y:0},{x:r,y:-e/3},{x:r+2*n,y:-e/2},{x:r,y:-2*e/3},{x:r,y:-e},{x:r-t,y:-e},{x:r/2,y:-e-2*n},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*n,y:-e/2},{x:0,y:-e/3}],`right|left|up|down`),"right|left|up":e(({height:e,midpoint:t,width:n})=>[{x:t,y:0},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],`right|left|up`),"right|left|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:t,y:-e},{x:n-t,y:-e},{x:n,y:0}],`right|left|down`),"right|up|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:n,y:-e+t},{x:0,y:-e}],`right|up|down`),"left|up|down":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:n,y:-e}],`left|up|down`),"right|left":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`right|left`),"up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`up|down`),"right|up":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:0,y:-e}],`right|up`),"right|down":e(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],`right|down`),"left|up":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:n,y:-e}],`left|up`),"left|down":e(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],`left|down`),right:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e+n}],`right`),left:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`left`),up:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n}],`up`),down:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`down`),[_e]:()=>[{x:0,y:0}]},xe=e((e,t,n,r)=>{let i=ve(e),a=(n.padding??0)/2,o=t.height+4*a,s=o/2,c=r??t.width+2*s+2*a;return(be[ye(i)]??be[_e])({height:o,midpoint:s,padding:a,width:c})},`getArrowPoints`);async function Se(e,t){let n=t,{shapeSvg:r,bbox:i}=await j(e,n,P(n)),a=n.padding??0,o=i.height+2*a,s=o/2,c=i.width+2*s+a,l=n.width??0,u=n.positioned&&(n.widthInColumns??1)>1&&l>c?l:c,d=xe(n.directions??[],i,n,u),f=q(r,u,o,d);return f.attr(`style`,n.style??null),N(n,f),n.intersect=function(e){return K.polygon(n,d,e)},r}e(Se,`block_arrow`);async function Ce(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await j(e,t,P(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+18,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=C.svg(a).path(z(-u/2,f,u,d,12),g(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`line`).attr(`x1`,-u/2).attr(`y1`,f+18).attr(`x2`,u/2).attr(`y2`,f+18).attr(`style`,`stroke:${c};stroke-width:1px`);for(let e=0;e<3;e++)m.append(`circle`).attr(`cx`,-u/2+12+e*9).attr(`cy`,f+9).attr(`r`,2.5).attr(`style`,`fill:${c};stroke:none`);m.append(`rect`).attr(`class`,`browser-address-bar`).attr(`x`,-u/2+44).attr(`y`,f+4).attr(`width`,Math.max(u-56,10)).attr(`height`,10).attr(`rx`,3).attr(`ry`,3).attr(`style`,`fill:none;stroke:${c};stroke-width:1px;opacity:0.6`),N(t,m);let h=f+18+(d-18)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(Ce,`browser`);var we=12;async function Te(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+we),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+we,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+we},{x:0+we,y:f}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=C.svg(s),n=g(t,{}),r=F(p),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=q(s,l,u,p);return r&&m.attr(`style`,r),N(t,m),t.intersect=function(e){return K.polygon(t,p,e)},s}e(Te,`card`);function Ee(e,t){let{nodeStyles:n}=_(t);t.label=``;let r=e.insert(`g`).attr(`class`,P(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=C.svg(r),c=g(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=F(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return K.polygon(t,o,e)},r}e(Ee,`choice`);async function De(e,n,r){let{labelStyles:i,nodeStyles:a}=_(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await j(e,n,P(n)),l=r?.padding??c,u=n.look===`neo`?s.width/2+32:s.width/2+l,d,{cssStyles:f}=n;if(n.look===`handDrawn`){let e=C.svg(o),t=g(n,{}),r=e.circle(0,0,u*2,t);d=o.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,h(f))}else d=o.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,a).attr(`r`,u).attr(`cx`,0).attr(`cy`,0);return N(n,d),n.calcIntersect=function(e,t){let n=e.width/2;return K.circle(e,n,t)},n.intersect=function(e){return t.info(`Circle intersect`,n,u,e),K.circle(n,u,e)},o}e(De,`circle`);async function Oe(e,t){let n=t,{shapeSvg:r,bbox:i,halfPadding:a}=await j(e,n,[`node`,n.cssClasses,n.class].filter(Boolean).join(` `)),o=r.insert(`rect`,`:first-child`),s=n.padding??0,c=n.positioned?n.width??0:i.width+s,l=n.positioned?n.height??0:i.height+s,u=n.positioned?-c/2:-i.width/2-a,d=n.positioned?-l/2:-i.height/2-a;return o.attr(`class`,`basic cluster composite label-container`).attr(`style`,n.style??null).attr(`rx`,n.rx??null).attr(`ry`,n.ry??null).attr(`x`,u).attr(`y`,d).attr(`width`,c).attr(`height`,l),N(n,o),n.intersect=function(e){return K.rect(n,e)},r}e(Oe,`composite`);async function ke(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await j(e,t,P(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+20,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=C.svg(a).path(z(-u/2,f,u,d,12),g(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`text`).attr(`x`,-u/2+12).attr(`y`,f+16).attr(`class`,`console-glyph`).attr(`style`,`font-family:monospace;font-weight:bold;font-size:14px;fill:${c}`).text(`>_`),N(t,m);let h=f+20+(d-20)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(ke,`consoleWindow`);function Ae(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y}
|
|
2
|
+
M ${i.x},${i.y} L ${o.x},${o.y}`}e(Ae,`createLine`);function je(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r,n.label=``;let a=e.insert(`g`).attr(`class`,P(n)).attr(`id`,n.domId??n.id),o=Math.max(30,n?.width??0),{cssStyles:s}=n,c=C.svg(a),l=g(n,{});n.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=c.circle(0,0,o*2,l),d=Ae(o),f=c.path(d,l),p=a.insert(()=>u,`:first-child`);return p.insert(()=>f),p.attr(`class`,`outer-path`),s&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,s),i&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,i),N(n,p),n.intersect=function(e){return t.info(`crossedCircle intersect`,n,{radius:o,point:e}),K.circle(n,o,e)},a}e(je,`crossedCircle`);function J(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(J,`generateCirclePoints`);async function Me(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+s,u=a.height+c,d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...J(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...J(l/2+d*2,-d,d,20,-180,-270),...J(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...J(l/2,u/2,d,20,0,90)],m=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...J(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...J(l/2+l*.1,-d,d,20,-180,-270),...J(l/2+l*.1,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...J(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2,y:u/2+d}],h=C.svg(i),v=g(t,{fill:`none`});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=F(p).replace(`Z`,``),b=h.path(y,v),x=F(m),S=h.path(x,{...v}),w=i.insert(`g`,`:first-child`);return w.insert(()=>S,`:first-child`).attr(`stroke-opacity`,0),w.insert(()=>b,`:first-child`),w.attr(`class`,`text`),f&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(${d}, 0)`),o.attr(`transform`,`translate(${-l/2+d-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),N(t,w),t.intersect=function(e){return K.polygon(t,m,e)},i}e(Me,`curlyBraceLeft`);function Y(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:a,y:l})}return o}e(Y,`generateCirclePoints`);async function Ne(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...Y(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...Y(l/2+d*2,-d,d,20,-180,-270),...Y(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...Y(l/2,u/2,d,20,0,90)],m=[{x:-l/2,y:-u/2-d},{x:l/2,y:-u/2-d},...Y(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...Y(l/2+d*2,-d,d,20,-180,-270),...Y(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...Y(l/2,u/2,d,20,0,90),{x:l/2,y:u/2+d},{x:-l/2,y:u/2+d}],h=C.svg(i),v=g(t,{fill:`none`});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=F(p).replace(`Z`,``),b=h.path(y,v),x=F(m),S=h.path(x,{...v}),w=i.insert(`g`,`:first-child`);return w.insert(()=>S,`:first-child`).attr(`stroke-opacity`,0),w.insert(()=>b,`:first-child`),w.attr(`class`,`text`),f&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(${-d}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),N(t,w),t.intersect=function(e){return K.polygon(t,m,e)},i}e(Ne,`curlyBraceRight`);function X(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(X,`generateCirclePoints`);async function Pe(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...X(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...X(l/2+d*2,-d,d,20,-180,-270),...X(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...X(l/2,u/2,d,20,0,90)],m=[...X(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...X(-l/2-d/2,-d,d,20,0,90),...X(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...X(-l/2+d+d/2,u/2,d,30,-180,-270)],h=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...X(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...X(l/2+d*2,-d,d,20,-180,-270),...X(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...X(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2-d-d/2,y:u/2+d},...X(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...X(-l/2-d/2,-d,d,20,0,90),...X(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...X(-l/2+d+d/2,u/2,d,30,-180,-270)],v=C.svg(i),y=g(t,{fill:`none`});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let b=F(p).replace(`Z`,``),x=v.path(b,y),S=F(m).replace(`Z`,``),w=v.path(S,y),T=F(h),E=v.path(T,{...y}),D=i.insert(`g`,`:first-child`);return D.insert(()=>E,`:first-child`).attr(`stroke-opacity`,0),D.insert(()=>x,`:first-child`),D.insert(()=>w,`:first-child`),D.attr(`class`,`text`),f&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),D.attr(`transform`,`translate(${d-d/4}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),N(t,D),t.intersect=function(e){return K.polygon(t,h,e)},i}e(Pe,`curlyBraces`);async function Fe(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(20,(c.width+a*2)*1.25,t?.width??0),u=Math.max(5,c.height+o*2,t?.height??0),d=u/2,{cssStyles:f}=t,p=C.svg(s),m=g(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=l,v=u,y=h-d,b=v/4,x=[{x:y,y:0},{x:b,y:0},{x:0,y:v/2},{x:b,y:v},{x:y,y:v},...L(-y,-v/2,d,50,270,90)],S=F(x),w=p.path(S,m),T=s.insert(()=>w,`:first-child`);return T.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&T.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&T.selectChildren(`path`).attr(`style`,r),T.attr(`transform`,`translate(${-l/2}, ${-u/2})`),N(t,T),t.intersect=function(e){return K.polygon(t,x,e)},s}e(Fe,`curvedTrapezoid`);async function Ie(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.padding??20,c=Math.max(a.width+s*2,t.width??0,100),l=Math.min(Math.max(c*.23,16),56),u=l*.27,d=Math.max(a.height+s*2,t.height?t.height-(2*l-u):0),f=Math.min(c*.177,d*.45),p=d+2*l-u,m=-p/2,h=m+2*l-u,v=i.insert(`g`,`:first-child`).attr(`class`,`basic label-container`),{cssStyles:y}=t;if(t.look===`handDrawn`){let e=C.svg(i),n=g(t,{}),r=e.path(z(-c/2,h,c,d,f),n),a=e.circle(0,m+l,l*2,n);v.insert(()=>a,`:first-child`),v.insert(()=>r,`:first-child`),y&&v.attr(`style`,y)}else v.append(`rect`).attr(`x`,-c/2).attr(`y`,h).attr(`width`,c).attr(`height`,d).attr(`rx`,f).attr(`ry`,f).attr(`style`,r),v.append(`circle`).attr(`cx`,0).attr(`cy`,m+l).attr(`r`,l).attr(`style`,r);N(t,v);let b=h+d/2;o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${b-a.height/2-(a.y-(a.top??0))})`);let x=m+l,S=Math.asin(Math.min(1,(h-x)/l))*180/Math.PI,w=[...L(0,-x,l,24,180+S,-S),...L(-(-c/2+f),-(h+f),f,12,90,0),...L(-(-c/2+f),-(p/2-f),f,12,360,270),...L(-(c/2-f),-(p/2-f),f,12,270,180),...L(-(c/2-f),-(h+f),f,12,180,90)];return t.intersect=function(e){return K.polygon(t,w,e)},i}e(Ie,`person`);var Le=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createCylinderPathD`),Re=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createOuterCylinderPathD`),ze=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),Be=8,Ve=8;async function He(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?24:i,o=t.look===`neo`?24:i,s=t.width??0;if(t.width&&(t.width-=o,t.width<Ve&&(t.width=Ve)),t.height){let e=s/2/(2.5+s/50);t.height=t.height-a-e*3,t.height<Be&&(t.height=Be)}let{shapeSvg:c,bbox:l,label:u}=await j(e,t,P(t)),d=Math.max(t.width??0,l.width)+o,f=d/2,p=f/(2.5+d/50),m=Math.max(t.height??0,l.height)+a+p,v,{cssStyles:y}=t;if(t.look===`handDrawn`){let e=C.svg(c),n=Re(0,0,d,m,f,p),r=ze(0,p,d,m,f,p),i=g(t,{}),a=e.path(n,i),o=e.path(r,g(t,{fill:`none`}));v=c.insert(()=>o,`:first-child`),v=c.insert(()=>a,`:first-child`),v.attr(`class`,`basic label-container`),y&&v.attr(`style`,y)}else{let e=Le(0,0,d,m,f,p);v=c.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,h(y)).attr(`style`,r)}return v.attr(`label-offset-y`,p),v.attr(`transform`,`translate(${-d/2}, ${-(m/2+p)})`),N(t,v),u.attr(`transform`,`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(e){let n=K.rect(t,e),r=n.x-(t.x??0);if(f!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-p)){let i=p*p*(1-r*r/(f*f));i>0&&(i=Math.sqrt(i)),i=p-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},c}e(He,`cylinder`);async function Ue(e,t,n){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await j(e,t,P(t)),s=Math.max(o.width+n.labelPaddingX*2,t?.width||0),c=Math.max(o.height+n.labelPaddingY*2,t?.height||0),l=-s/2,u=-c/2,d,{rx:f,ry:p}=t,{cssStyles:m}=t;if(n?.rx&&n.ry&&(f=n.rx,p=n.ry),t.look===`handDrawn`){let e=C.svg(a),n=g(t,{}),r=f||p?e.path(z(l,u,s,c,f||0),n):e.rectangle(l,u,s,c,n);d=a.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,h(m))}else d=a.insert(`rect`,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,h(f)).attr(`ry`,h(p)).attr(`x`,l).attr(`y`,u).attr(`width`,s).attr(`height`,c);return N(t,d,t.look===`handDrawn`?void 0:{width:s,height:c}),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},a}e(Ue,`drawRect`);async function We(e,t){let{cssClasses:n,labelPaddingX:r,labelPaddingY:i,padding:a,width:o,height:s}=t,c=await Ue(e,t,{rx:0,ry:0,classes:n??``,labelPaddingX:r??(a??0)*2,labelPaddingY:i??a??0});if(t.look===`handDrawn`){let e=C.svg(c),n=g(t,{}),r=c.select(`.basic.label-container > path:nth-child(2)`),i=r.node();if(!i)return c;let a=null;if(i instanceof SVGGraphicsElement)a=i.getBBox();else return c;return c.insert(()=>e.line(a.x,a.y,a.x+a.width,a.y,n),`.basic.label-container g.label`),c.insert(()=>e.line(a.x,a.y+a.height,a.x+a.width,a.y+a.height,n),`.basic.label-container g.label`),r.remove(),c}let l=c.select(`.basic.label-container`),u=(Number(l.attr(`width`))||o)??0,d=(Number(l.attr(`height`))||s)??0;return u>0&&d>0&&l.attr(`stroke-dasharray`,`${u} ${d}`),c}e(We,`datastore`);async function Ge(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?16:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await j(e,t,P(t)),l=s.width+i,u=s.height+a,d=u*.2,f=-l/2,p=-u/2-d/2,{cssStyles:m}=t,h=C.svg(o),v=g(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],b=h.polygon(y.map(e=>[e.x,e.y]),v),x=o.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${f+(t.padding??0)/2-(s.x-(s.left??0))}, ${p+d+(t.padding??0)/2-(s.y-(s.top??0))})`),N(t,x),t.intersect=function(e){return K.rect(t,e)},o}e(Ge,`dividedRectangle`);async function Ke(e,n){let{labelStyles:r,nodeStyles:i}=_(n),a=n.look===`neo`?12:5;n.labelStyle=r;let o=n.padding??0,s=n.look===`neo`?16:o,{shapeSvg:c,bbox:l}=await j(e,n,P(n)),u=(n?.width?n?.width/2:l.width/2)+(s??0),d=u-a,f,{cssStyles:p}=n;if(n.look===`handDrawn`){let e=C.svg(c),t=g(n,{roughness:.2,strokeWidth:2.5}),r=g(n,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,u*2,t),a=e.circle(0,0,d*2,r);f=c.insert(`g`,`:first-child`),f.attr(`class`,h(n.cssClasses)).attr(`style`,h(p)),f.node()?.appendChild(i),f.node()?.appendChild(a)}else{f=c.insert(`g`,`:first-child`);let e=f.insert(`circle`,`:first-child`),t=f.insert(`circle`);f.attr(`class`,`basic label-container`).attr(`style`,i),e.attr(`class`,`outer-circle`).attr(`style`,i).attr(`r`,u).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,i).attr(`r`,d).attr(`cx`,0).attr(`cy`,0)}return N(n,f),n.intersect=function(e){return t.info(`DoubleCircle intersect`,n,u,e),K.circle(n,u,e)},c}e(Ke,`doublecircle`);function qe(e,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=_(n);n.label=``,n.labelStyle=i;let o=e.insert(`g`).attr(`class`,P(n)).attr(`id`,n.domId??n.id),{cssStyles:s}=n,c=C.svg(o),{nodeBorder:l}=r,u=g(n,{fillStyle:`solid`});n.look!==`handDrawn`&&(u.roughness=0);let d=c.circle(0,0,14,u),f=o.insert(()=>d,`:first-child`);return f.selectAll(`path`).attr(`style`,`fill: ${l} !important;`),s&&s.length>0&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,s),a&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,a),N(n,f),n.intersect=function(e){return t.info(`filledCircle intersect`,n,{radius:7,point:e}),K.circle(n,7,e)},o}e(qe,`filledCircle`);var Je=10,Ye=10;async function Xe(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?a*2:a;(n.width||n.height)&&(n.height=n?.height??0,n.height<Je&&(n.height=Je),n.width=(n?.width??0)-o-o/2,n.width<Ye&&(n.width=Ye));let{shapeSvg:s,bbox:c,label:l}=await j(e,n,P(n)),u=(n?.width?n?.width:c.width)+(o??0),d=n?.height?n?.height:u+c.height,f=d,p=[{x:0,y:-d},{x:f,y:-d},{x:f/2,y:0}],{cssStyles:m}=n,h=C.svg(s),v=g(n,{});n.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=F(p),b=h.path(y,v),x=s.insert(()=>b,`:first-child`).attr(`transform`,`translate(${-d/2}, ${d/2})`).attr(`class`,`outer-path`);return m&&n.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,m),i&&n.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,i),n.width=u,n.height=d,N(n,x),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-d/2+(n.padding??0)/2+(c.y-(c.top??0))})`),n.intersect=function(e){return t.info(`Triangle intersect`,n,p,e),K.polygon(n,p,e)},s}e(Xe,`flippedTriangle`);async function Ze(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.padding??12,c=Math.max(a.width+s*2,t.width??0,90),l=a.height+s*2,u=Math.max(Math.min(l*.16,14),8),d=Math.max(l+u,t.height??0),f=d-u,p=Math.max(c*.38,28),m=-d/2,h=[{x:-c/2,y:m},{x:-c/2+p,y:m},{x:-c/2+p,y:m+u},{x:c/2,y:m+u},{x:c/2,y:d/2},{x:-c/2,y:d/2}],v=[`M${h[0].x},${h[0].y}`,...h.slice(1).map(e=>`L${e.x},${e.y}`),`Z`].join(` `),{cssStyles:y}=t,b;if(t.look===`handDrawn`){let e=C.svg(i).path(v,g(t,{}));b=i.insert(()=>e,`:first-child`).attr(`class`,`basic label-container`),y&&b.attr(`style`,y)}else b=i.insert(`path`,`:first-child`).attr(`d`,v).attr(`class`,`basic label-container`).attr(`style`,r);t.look===`handDrawn`?N(t,b):N(t,b,{width:c,height:d});let x=m+u+f/2;return o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${x-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(e){return K.polygon(t,h,e)},i}e(Ze,`folder`);function Qe(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=_(t);t.label=``;let o=e.insert(`g`).attr(`class`,P(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=Math.max(70,t?.width??0),l=Math.max(10,t?.height??0);n===`LR`&&(c=Math.max(10,t?.width??0),l=Math.max(70,t?.height??0));let u=-1*c/2,d=-1*l/2,f=C.svg(o),p=g(t,{stroke:i.lineColor,fill:i.lineColor});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=f.rectangle(u,d,c,l,p),h=o.insert(()=>m,`:first-child`);s&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,a),N(t,h);let v=r?.padding??0;return t.width&&t.height&&(t.width+=v/2||0,t.height+=v/2||0),t.intersect=function(e){return K.rect(t,e)},o}e(Qe,`forkJoin`);async function $e(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let a=n.look===`neo`?16:n.padding??0,o=n.look===`neo`?12:n.padding??0;(n.width||n.height)&&(n.height=(n?.height??0)-o*2,n.height<10&&(n.height=10),n.width=(n?.width??0)-a*2,n.width<15&&(n.width=15));let{shapeSvg:s,bbox:c}=await j(e,n,P(n)),l=(n?.width?n?.width:Math.max(15,c.width))+a*2,u=(n?.height?n?.height:Math.max(10,c.height))+o*2,d=u/2,{cssStyles:f}=n,p=C.svg(s),m=g(n,{});n.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-l/2,y:-u/2},{x:l/2-d,y:-u/2},...L(-l/2+d,0,d,50,90,270),{x:l/2-d,y:u/2},{x:-l/2,y:u/2}],v=F(h),y=p.path(v,m),b=s.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),f&&n.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,f),i&&n.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,i),N(n,b),n.intersect=function(e){return t.info(`Pill intersect`,n,{radius:d,point:e}),K.polygon(n,h,e)},s}e($e,`halfRoundedRectangle`);var et=e((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,`Z`].join(` `),`createHexagonPathD`);async function tt(e,t){let{labelStyles:n,nodeStyles:r}=_(t),i=t.look===`neo`?3.5:4;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?70:a,s=t.look===`neo`?32:a;if(t.width||t.height){let e=(t.height??0)/i;t.width=(t?.width??0)-2*e-s,t.height=(t.height??0)-o}let{shapeSvg:c,bbox:l}=await j(e,t,P(t)),u=(t?.height?t?.height:l.height)+o,d=u/i,f=(t?.width?t?.width:l.width)+2*d+s,p=[{x:d,y:0},{x:f-d,y:0},{x:f,y:-u/2},{x:f-d,y:-u},{x:d,y:-u},{x:0,y:-u/2}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=C.svg(c),n=g(t,{}),r=et(0,0,f,u,d),i=e.path(r,n);m=c.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-f/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=q(c,f,u,p);return r&&m.attr(`style`,r),t.width=f,t.height=u,N(t,m),t.intersect=function(e){return K.polygon(t,p,e)},c}e(tt,`hexagon`);async function nt(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.label=``,n.labelStyle=r;let{shapeSvg:a}=await j(e,n,P(n)),o=Math.max(30,n?.width??0),s=Math.max(30,n?.height??0),{cssStyles:c}=n,l=C.svg(a),u=g(n,{});n.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=[{x:0,y:0},{x:o,y:0},{x:0,y:s},{x:o,y:s}],f=F(d),p=l.path(f,u),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`basic label-container outer-path`),c&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,c),i&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,i),m.attr(`transform`,`translate(${-o/2}, ${-s/2})`),N(n,m),n.intersect=function(e){return t.info(`Pill intersect`,n,{points:d}),K.polygon(n,d,e)},a}e(nt,`hourglass`);async function rt(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=_(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await j(e,n,`icon-shape default`),p=n.pos===`t`,m=c,h=c,{nodeBorder:v}=r,{stylesMap:x}=y(n),S=-h/2,w=-m/2,T=n.label?8:0,E=C.svg(u),D=g(n,{stroke:`none`,fill:`none`});n.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=E.rectangle(S,w,h,m,D),k=Math.max(h,d.width),A=m+d.height+T,M=E.rectangle(-k/2,-A/2,k,A,{...D,fill:`transparent`,stroke:`none`}),P=u.insert(()=>O,`:first-child`),F=u.insert(()=>M);if(n.icon){let e=u.append(`g`);e.html(`<g>${await b(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${p?d.height/2+T/2-i/2-o:-d.height/2-T/2-i/2-o})`),e.attr(`style`,`color: ${x.get(`stroke`)??v};`)}return f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${p?-A/2:A/2-d.height})`),P.attr(`transform`,`translate(0,${p?d.height/2+T/2:-d.height/2-T/2})`),N(n,F),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=p?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+T},{x:r+h/2,y:i-a/2+d.height+T},{x:r+h/2,y:i+a/2},{x:r-h/2,y:i+a/2},{x:r-h/2,y:i-a/2+d.height+T},{x:r-d.width/2,y:i-a/2+d.height+T}]:[{x:r-h/2,y:i-a/2},{x:r+h/2,y:i-a/2},{x:r+h/2,y:i-a/2+m},{x:r+d.width/2,y:i-a/2+m},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+m},{x:r-h/2,y:i-a/2+m}],K.polygon(n,o,e)},u}e(rt,`icon`);async function it(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=_(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await j(e,n,`icon-shape default`),p=n.label?8:0,m=n.pos===`t`,{nodeBorder:h,mainBkg:v}=r,{stylesMap:x}=y(n),S=C.svg(u),w=g(n,{});n.look!==`handDrawn`&&(w.roughness=0,w.fillStyle=`solid`),w.stroke=x.get(`fill`)??v;let T=u.append(`g`);n.icon&&T.html(`<g>${await b(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let E=T.node().getBBox(),D=E.width,O=E.height,k=E.x,A=E.y,M=Math.max(D,O)*Math.SQRT2+40,P=S.circle(0,0,M,w),F=Math.max(M,d.width),I=M+d.height+p,L=S.rectangle(-F/2,-I/2,F,I,{...w,fill:`transparent`,stroke:`none`}),ee=u.insert(()=>P,`:first-child`),R=u.insert(()=>L);return T.attr(`transform`,`translate(${-D/2-k},${m?d.height/2+p/2-O/2-A:-d.height/2-p/2-O/2-A})`),T.attr(`style`,`color: ${x.get(`stroke`)??h};`),f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-I/2:I/2-d.height})`),ee.attr(`transform`,`translate(0,${m?d.height/2+p/2:-d.height/2-p/2})`),N(n,R),n.intersect=function(e){return t.info(`iconSquare intersect`,n,e),K.rect(n,e)},u}e(it,`iconCircle`);async function at(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=_(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await j(e,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,v=c+f*2,{nodeBorder:x,mainBkg:S}=r,{stylesMap:w}=y(n),T=-v/2,E=-h/2,D=n.label?8:0,O=C.svg(u),k=g(n,{});n.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`),k.stroke=w.get(`fill`)??S;let A=O.path(z(T,E,v,h,5),k),M=Math.max(v,d.width),P=h+d.height+D,F=O.rectangle(-M/2,-P/2,M,P,{...k,fill:`transparent`,stroke:`none`}),I=u.insert(()=>A,`:first-child`).attr(`class`,`icon-shape2`),L=u.insert(()=>F);if(n.icon){let e=u.append(`g`);e.html(`<g>${await b(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${w.get(`stroke`)??x};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-P/2:P/2-d.height})`),I.attr(`transform`,`translate(0,${m?d.height/2+D/2:-d.height/2-D/2})`),N(n,L),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+v/2,y:i-a/2+d.height+D},{x:r+v/2,y:i+a/2},{x:r-v/2,y:i+a/2},{x:r-v/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-v/2,y:i-a/2},{x:r+v/2,y:i-a/2},{x:r+v/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-v/2,y:i-a/2+h}],K.polygon(n,o,e)},u}e(at,`iconRounded`);async function ot(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=_(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await j(e,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,v=c+f*2,{nodeBorder:x,mainBkg:S}=r,{stylesMap:w}=y(n),T=-v/2,E=-h/2,D=n.label?8:0,O=C.svg(u),k=g(n,{});n.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`),k.stroke=w.get(`fill`)??S;let A=O.path(z(T,E,v,h,.1),k),M=Math.max(v,d.width),P=h+d.height+D,F=O.rectangle(-M/2,-P/2,M,P,{...k,fill:`transparent`,stroke:`none`}),I=u.insert(()=>A,`:first-child`),L=u.insert(()=>F);if(n.icon){let e=u.append(`g`);e.html(`<g>${await b(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${w.get(`stroke`)??x};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-P/2:P/2-d.height})`),I.attr(`transform`,`translate(0,${m?d.height/2+D/2:-d.height/2-D/2})`),N(n,L),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+v/2,y:i-a/2+d.height+D},{x:r+v/2,y:i+a/2},{x:r-v/2,y:i+a/2},{x:r-v/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-v/2,y:i-a/2},{x:r+v/2,y:i-a/2},{x:r+v/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-v/2,y:i-a/2+h}],K.polygon(n,o,e)},u}e(ot,`iconSquare`);async function st(e,n,{config:{flowchart:r}}){let i=new Image;i.src=n?.img??``,await i.decode();let a=Number(i.naturalWidth.toString().replace(`px`,``)),o=Number(i.naturalHeight.toString().replace(`px`,``));n.imageAspectRatio=a/o;let{labelStyles:s}=_(n);n.labelStyle=s;let c=r?.wrappingWidth;n.defaultWidth=r?.wrappingWidth;let l=Math.max(n.label?c??0:0,n?.assetWidth??a),u=n.constraint===`on`&&n?.assetHeight?n.assetHeight*n.imageAspectRatio:l,d=n.constraint===`on`?u/n.imageAspectRatio:n?.assetHeight??o;n.width=Math.max(u,c??0);let{shapeSvg:f,bbox:p,label:m}=await j(e,n,`image-shape default`),h=n.pos===`t`,v=-u/2,y=-d/2,b=n.label?8:0,x=C.svg(f),S=g(n,{});n.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`);let w=x.rectangle(v,y,u,d,S),T=Math.max(u,p.width),E=d+p.height+b,D=x.rectangle(-T/2,-E/2,T,E,{...S,fill:`none`,stroke:`none`}),O=f.insert(()=>w,`:first-child`),k=f.insert(()=>D);if(n.img){let e=f.append(`image`);e.attr(`href`,n.img),e.attr(`width`,u),e.attr(`height`,d),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-u/2},${h?E/2-d:-E/2})`)}return m.attr(`transform`,`translate(${-p.width/2-(p.x-(p.left??0))},${h?-d/2-p.height/2-b/2:d/2-p.height/2+b/2})`),O.attr(`transform`,`translate(0,${h?p.height/2+b/2:-p.height/2-b/2})`),N(n,k),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=h?[{x:r-p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2+p.height+b},{x:r+u/2,y:i-a/2+p.height+b},{x:r+u/2,y:i+a/2},{x:r-u/2,y:i+a/2},{x:r-u/2,y:i-a/2+p.height+b},{x:r-p.width/2,y:i-a/2+p.height+b}]:[{x:r-u/2,y:i-a/2},{x:r+u/2,y:i-a/2},{x:r+u/2,y:i-a/2+d},{x:r+p.width/2,y:i-a/2+d},{x:r+p.width/2/2,y:i+a/2},{x:r-p.width/2,y:i+a/2},{x:r-p.width/2,y:i-a/2+d},{x:r-u/2,y:i-a/2+d}],K.polygon(n,o,e)},f}e(st,`imageSquare`);async function ct(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(c.height+a*2,t.height??0),u=Math.max(c.width+o*2,(t.width??0)-l),d=[{x:0,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:-3*l/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=C.svg(s),n=g(t,{}),r=F(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,N(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(ct,`inv_trapezoid`);async function lt(e,t){let{shapeSvg:n,bbox:r,label:i}=await j(e,t,`label`),a=n.insert(`rect`,`:first-child`);return a.attr(`width`,.1).attr(`height`,.1),n.attr(`class`,`label edgeLabel`),i.attr(`transform`,`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),N(t,a),t.intersect=function(e){return K.rect(t,e)},n}e(lt,`labelRect`);async function ut(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:0,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:-(3*l)/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=C.svg(s),n=g(t,{}),r=F(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,N(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(ut,`lean_left`);async function dt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:-3*l/6,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=C.svg(s),n=g(t,{}),r=F(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,N(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(dt,`lean_right`);function ft(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.label=``,n.labelStyle=r;let a=e.insert(`g`).attr(`class`,P(n)).attr(`id`,n.domId??n.id),{cssStyles:o}=n,s=Math.max(35,n?.width??0),c=Math.max(35,n?.height??0),l=[{x:s,y:0},{x:0,y:c+7/2},{x:s-14,y:c+7/2},{x:0,y:2*c},{x:s,y:c-7/2},{x:14,y:c-7/2}],u=C.svg(a),d=g(n,{});n.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=F(l),p=u.path(f,d),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`outer-path`),o&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,o),i&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,i),m.attr(`transform`,`translate(-${s/2},${-c})`),N(n,m),n.intersect=function(e){return t.info(`lightningBolt intersect`,n,e),K.polygon(n,l,e)},a}e(ft,`lightningBolt`);var pt=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createCylinderPathD`),mt=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createOuterCylinderPathD`),ht=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),gt=10,_t=10;async function vt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-a,t.width<_t&&(t.width=_t);let n=e/2/(2.5+e/50);t.height=(t.height??0)-o-n*3,t.height<gt&&(t.height=gt)}let{shapeSvg:s,bbox:c,label:l}=await j(e,t,P(t)),u=(t?.width?t?.width:c.width)+a*2,d=u/2,f=d/(2.5+u/50),p=(t?.height?t?.height:c.height)+f+o*2,m=p*.1,v,{cssStyles:y}=t;if(t.look===`handDrawn`){let e=C.svg(s),n=mt(0,0,u,p,d,f,m),r=ht(0,f,u,p,d,f),i=g(t,{}),a=e.path(n,i),o=e.path(r,i);s.insert(()=>o,`:first-child`).attr(`class`,`line`),v=s.insert(()=>a,`:first-child`),v.attr(`class`,`basic label-container`),y&&v.attr(`style`,y)}else{let e=pt(0,0,u,p,d,f,m);v=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,h(y)).attr(`style`,r)}return v.attr(`label-offset-y`,f),v.attr(`transform`,`translate(${-u/2}, ${-(p/2+f)})`),N(t,v),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+f-(c.y-(c.top??0))})`),t.intersect=function(e){let n=K.rect(t,e),r=n.x-(t.x??0);if(d!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-f)){let i=f*f*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=f-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}e(vt,`linedCylinder`);async function yt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=(t.width??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:s,bbox:c,label:l}=await j(e,t,P(t)),u=(t?.width?t?.width:c.width)+(a??0)*2,d=(t?.height?t?.height:c.height)+(o??0)*2,f=t.look===`neo`?d/4:d/8,p=d+f,{cssStyles:m}=t,h=C.svg(s),v=g(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:-u/2-u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:p/2},...I(-u/2-u/2*.1,p/2,u/2+u/2*.1,p/2,f,.8),{x:u/2+u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:-p/2},{x:-u/2,y:-p/2},{x:-u/2,y:p/2*1.1},{x:-u/2,y:-p/2}],b=h.polygon(y.map(e=>[e.x,e.y]),v),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.attr(`transform`,`translate(0,${-f/2})`),l.attr(`transform`,`translate(${-u/2+(t.padding??0)+u/2*.1/2-(c.x-(c.left??0))},${-d/2+(t.padding??0)-f/2-(c.y-(c.top??0))})`),N(t,x),t.intersect=function(e){return K.polygon(t,y,e)},s}e(yt,`linedWaveEdgedRect`);async function bt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=t.look===`neo`?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*s,10),t.height=Math.max((t?.height??0)-o*2-2*s,10));let{shapeSvg:c,bbox:l,label:u}=await j(e,t,P(t)),d=(t?.width?t?.width:l.width)+a*2+2*s,f=(t?.height?t?.height:l.height)+o*2+2*s,p=d-2*s,m=f-2*s,h=-p/2,v=-m/2,{cssStyles:y}=t,b=C.svg(c),x=g(t,{}),S=[{x:h-s,y:v+s},{x:h-s,y:v+m+s},{x:h+p-s,y:v+m+s},{x:h+p-s,y:v+m},{x:h+p,y:v+m},{x:h+p,y:v+m-s},{x:h+p+s,y:v+m-s},{x:h+p+s,y:v-s},{x:h+s,y:v-s},{x:h+s,y:v},{x:h,y:v},{x:h,y:v+s}],w=[{x:h,y:v+s},{x:h+p-s,y:v+s},{x:h+p-s,y:v+m},{x:h+p,y:v+m},{x:h+p,y:v},{x:h,y:v}];t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let T=F(S),E=b.path(T,x),D=F(w),O=b.path(D,x);t.look!==`handDrawn`&&(E=ee(E),O=ee(O));let k=c.insert(`g`,`:first-child`);return k.insert(()=>E),k.insert(()=>O),k.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,r),u.attr(`transform`,`translate(${-(l.width/2)-s-(l.x-(l.left??0))}, ${-(l.height/2)+s-(l.y-(l.top??0))})`),N(t,k),t.intersect=function(e){return K.polygon(t,S,e)},c}e(bt,`multiRect`);async function xt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.padding??0,c=t.look===`neo`?16:s,l=t.look===`neo`?12:s,u=!0;(t.width||t.height)&&(u=!1,t.width=(t?.width??0)-c*2,t.height=(t?.height??0)-l*3);let d=Math.max(a.width,t?.width??0)+c*2,f=Math.max(a.height,t?.height??0)+l*3,p=t.look===`neo`?f/4:f/8,m=f+(u?p/2:-p/2),h=-d/2,v=-m/2,{cssStyles:y}=t,b=I(h-10,v+m+10,h+d-10,v+m+10,p,.8),x=b?.[b.length-1],S=[{x:h-10,y:v+10},{x:h-10,y:v+m+10},...b,{x:h+d-10,y:x.y-10},{x:h+d,y:x.y-10},{x:h+d,y:x.y-20},{x:h+d+10,y:x.y-20},{x:h+d+10,y:v-10},{x:h+10,y:v-10},{x:h+10,y:v},{x:h,y:v},{x:h,y:v+10}],w=[{x:h,y:v+10},{x:h+d-10,y:v+10},{x:h+d-10,y:x.y-10},{x:h+d,y:x.y-10},{x:h+d,y:v},{x:h,y:v}],T=C.svg(i),E=g(t,{});t.look!==`handDrawn`&&(E.roughness=0,E.fillStyle=`solid`);let D=F(S),O=T.path(D,E),k=F(w),A=T.path(k,E),M=i.insert(()=>O,`:first-child`);return M.insert(()=>A),M.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,r),M.attr(`transform`,`translate(0,${-p/2})`),o.attr(`transform`,`translate(${-(a.width/2)-10-(a.x-(a.left??0))}, ${-(a.height/2)+10-p/2-(a.y-(a.top??0))})`),N(t,M),t.intersect=function(e){return K.polygon(t,S,e)},i}e(xt,`multiWaveEdgedRectangle`);async function St(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r,t.useHtmlLabels||o(s())||(t.centerLabel=!0);let{shapeSvg:a,bbox:c,label:l}=await j(e,t,P(t)),u=Math.max(c.width+(t.padding??0)*2,t?.width??0),d=Math.max(c.height+(t.padding??0)*2,t?.height??0),f=-u/2,p=-d/2,{cssStyles:m}=t,h=C.svg(a),v=g(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=h.rectangle(f,p,u,d,v),b=a.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),l.attr(`class`,`label noteLabel`),m&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,m),i&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,i),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),N(t,b),t.intersect=function(e){return K.rect(t,e)},a}e(St,`note`);var Ct=e((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,`Z`].join(` `),`createDecisionBoxPathD`);async function wt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await j(e,t,P(t)),o=a.width+(t.padding??0)+(a.height+(t.padding??0)),s=.5,c=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=C.svg(i),n=g(t,{}),r=Ct(0,0,o),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2+s}, ${o/2})`),u&&l.attr(`style`,u)}else l=q(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),N(t,l),t.calcIntersect=function(e,t){let n=e.width,r=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}],i=K.polygon(e,r,t);return{x:i.x-.5,y:i.y-.5}},t.intersect=function(e){return this.calcIntersect(t,e)},i}e(wt,`question`);async function Tt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?21:i??0,o=t.look===`neo`?12:i??0,{shapeSvg:s,bbox:c,label:l}=await j(e,t,P(t)),u=c.width+(t.look===`neo`?a*2:a),d=Math.max(c.height+(t.look===`neo`?o*2:o),t.height??0),f=d/4,p=-Math.max(u,(t.width??0)-f)/2,m=-d/2,h=m/2,v=[{x:p+h,y:m},{x:p,y:0},{x:p+h,y:-m},{x:-p,y:-m},{x:-p,y:m}],{cssStyles:y}=t,b=C.svg(s),x=g(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=F(v),w=b.path(S,x),T=s.insert(()=>w,`:first-child`);return T.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&T.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&T.selectAll(`path`).attr(`style`,r),T.attr(`transform`,`translate(${-h/2},0)`),l.attr(`transform`,`translate(${-h/2-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),N(t,T),t.intersect=function(e){return K.polygon(t,v,e)},s}e(Tt,`rect_left_inv_arrow`);async function Et(e,r){let{labelStyles:i,nodeStyles:a}=_(r);r.labelStyle=i;let s;s=r.cssClasses?`node `+r.cssClasses:`node default`;let c=e.insert(`g`).attr(`class`,s).attr(`id`,r.domId||r.id),l=c.insert(`g`),d=c.insert(`g`).attr(`class`,`label`).attr(`style`,a),f=r.description,p=r.label,m=await te(d,p,r.labelStyle,!0,!0),h={width:0,height:0};if(o(u())){let e=m.children[0],t=n(m);h=e.getBoundingClientRect(),t.attr(`width`,h.width),t.attr(`height`,h.height)}t.info(`Text 2`,f);let v=f||[],y=m.getBBox(),b=await te(d,Array.isArray(v)?v.join(`<br/>`):v,r.labelStyle,!0,!0),x=b.children[0],S=n(b);h=x.getBoundingClientRect(),S.attr(`width`,h.width),S.attr(`height`,h.height);let w=(r.padding||0)/2;n(b).attr(`transform`,`translate( `+(h.width>y.width?0:(y.width-h.width)/2)+`, `+(y.height+w+5)+`)`),n(m).attr(`transform`,`translate( `+(h.width<y.width?0:-(y.width-h.width)/2)+`, 0)`),h=d.node().getBBox(),d.attr(`transform`,`translate(`+-h.width/2+`, `+(-h.height/2-w+3)+`)`);let T=h.width+(r.padding||0),E=h.height+(r.padding||0),D=-h.width/2-w,O=-h.height/2-w,k,A;if(r.look===`handDrawn`){let e=C.svg(c),n=g(r,{}),i=e.path(z(D,O,T,E,r.rx||0),n),a=e.line(-h.width/2-w,-h.height/2-w+y.height+w,h.width/2+w,-h.height/2-w+y.height+w,n);A=c.insert(()=>(t.debug(`Rough node insert CXC`,i),a),`:first-child`),k=c.insert(()=>(t.debug(`Rough node insert CXC`,i),i),`:first-child`)}else k=l.insert(`rect`,`:first-child`),A=l.insert(`line`),k.attr(`class`,`outer title-state`).attr(`style`,a).attr(`x`,-h.width/2-w).attr(`y`,-h.height/2-w).attr(`width`,h.width+(r.padding||0)).attr(`height`,h.height+(r.padding||0)),A.attr(`class`,`divider`).attr(`x1`,-h.width/2-w).attr(`x2`,h.width/2+w).attr(`y1`,-h.height/2-w+y.height+w).attr(`y2`,-h.height/2-w+y.height+w);return N(r,k),r.intersect=function(e){return K.rect(r,e)},c}e(Et,`rectWithTitle`);async function Dt(e,t,{config:{themeVariables:n}}){let r=n?.radius??5;return Ue(e,t,{rx:r,ry:r,classes:``,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1})}e(Dt,`roundedRect`);var Z=8;async function Ot(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await j(e,t,P(t)),l=(t?.width??s.width)+i*2+(t.look===`neo`?Z:Z*2),u=(t?.height??s.height)+a*2,d=l-Z,f=u,p=Z-l/2,m=-u/2,{cssStyles:v}=t,y=C.svg(o),b=g(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:p,y:m},{x:p+d,y:m},{x:p+d,y:m+f},{x:p-Z,y:m+f},{x:p-Z,y:m},{x:p,y:m},{x:p,y:m+f}],S=y.polygon(x.map(e=>[e.x,e.y]),b),w=o.insert(()=>S,`:first-child`);return w.attr(`class`,`basic label-container outer-path`).attr(`style`,h(v)),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),v&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${Z/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),N(t,w),t.intersect=function(e){return K.rect(t,e)},o}e(Ot,`shadedProcess`);async function kt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:s,bbox:c,label:l}=await j(e,t,P(t)),u=(t?.width?t?.width:c.width)+a*2,d=((t?.height?t?.height:c.height)+o*2)*1.5,f=u,p=d/1.5,m=-f/2,h=-p/2,{cssStyles:v}=t,y=C.svg(s),b=g(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:m,y:h},{x:m,y:h+p},{x:m+f,y:h+p},{x:m+f,y:h-p/2}],S=F(x),w=y.path(S,b),T=s.insert(()=>w,`:first-child`);return T.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&T.selectChildren(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&T.selectChildren(`path`).attr(`style`,r),T.attr(`transform`,`translate(0, ${p/4})`),l.attr(`transform`,`translate(${-f/2+(t.padding??0)-(c.x-(c.left??0))}, ${-p/4+(t.padding??0)-(c.y-(c.top??0))})`),N(t,T),t.intersect=function(e){return K.polygon(t,x,e)},s}e(kt,`slopedRect`);async function At(e,t){let n=t.padding??0,r=t.look===`neo`?16:n*2,i=t.look===`neo`?12:n;return Ue(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??r,labelPaddingY:i})}e(At,`squareRect`);async function jt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?20:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=c.height+(t.look===`neo`?o*2:o),u=c.width+l/4+(t.look===`neo`?a*2:a),d=l/2,{cssStyles:f}=t,p=C.svg(s),m=g(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-u/2+d,y:-l/2},{x:u/2-d,y:-l/2},...L(-u/2+d,0,d,50,90,270),{x:u/2-d,y:l/2},...L(u/2-d,0,d,50,270,450)],v=F(h),y=p.path(v,m),b=s.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,r),N(t,b),t.intersect=function(e){return K.polygon(t,h,e)},s}e(jt,`stadium`);async function Mt(e,t){return Ue(e,t,{rx:t.look===`neo`?3:5,ry:t.look===`neo`?3:5,classes:`flowchart-node`})}e(Mt,`state`);function Nt(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c,nodeShadow:l}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let u=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId??t.id),d=C.svg(u),f=g(t,{});t.look!==`handDrawn`&&(f.roughness=0,f.fillStyle=`solid`);let p=d.circle(0,0,t.width,{...f,stroke:o,strokeWidth:2}),m=s??c,h=(t.width??0)*5/14,v=d.circle(0,0,h,{...f,fill:m,stroke:m,strokeWidth:2,fillStyle:`solid`}),y=u.insert(()=>p,`:first-child`);if(y.insert(()=>v),t.look!==`handDrawn`&&y.attr(`class`,`outer-path`),a&&y.selectAll(`path`).attr(`style`,a),i&&y.selectAll(`path`).attr(`style`,i),t.width<25&&l&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;y.attr(`style`,`filter:url(#${n})`)}return N(t,y),t.intersect=function(e){return K.circle(t,(t.width??0)/2,e)},u}e(Nt,`stateEnd`);function Pt(e,t,{config:{themeVariables:n}}){let{lineColor:r,nodeShadow:i}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let a=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),o;if(t.look===`handDrawn`){let e=C.svg(a).circle(0,0,t.width,v(r));o=a.insert(()=>e),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14)}else o=a.insert(`circle`,`:first-child`),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14);if(t.width<25&&i&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;o.attr(`style`,`filter:url(#${n})`)}return N(t,o),t.intersect=function(e){return K.circle(t,(t.width??7)/2,e)},a}e(Pt,`stateStart`);var Ft=8;async function It(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t?.padding??8,a=t.look===`neo`?28:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(c.width+2*Ft+a,t.width??0),u=Math.max(c.height+o,t.height??0),d=l-2*Ft,f=u,p=-l/2,m=-u/2,v=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look===`handDrawn`){let e=C.svg(s),n=g(t,{}),r=e.rectangle(p,m,d+16,f,n),i=e.line(p+Ft,m,p+Ft,m+f,n),a=e.line(p+Ft+d,m,p+Ft+d,m+f,n);s.insert(()=>i,`:first-child`),s.insert(()=>a,`:first-child`);let o=s.insert(()=>r,`:first-child`),{cssStyles:c}=t;o.attr(`class`,`basic label-container`).attr(`style`,h(c)),N(t,o)}else{let e=q(s,d,f,v);r&&e.attr(`style`,r),N(t,e)}return t.intersect=function(e){return K.polygon(t,v,e)},s}e(It,`subroutine`);var Lt=.2;async function Rt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-Lt*(t.height+o*2),10));let{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=(t?.height?t?.height:c.height)+o*2,u=Lt*l,d=Lt*l,f=(t?.width?t?.width:c.width)+a*2+u-u,p=l,m=-f/2,h=-p/2,{cssStyles:v}=t,y=C.svg(s),b=g(t,{}),x=[{x:m-u/2,y:h},{x:m+f+u/2,y:h},{x:m+f+u/2,y:h+p},{x:m-u/2,y:h+p}],S=[{x:m+f-u/2,y:h+p},{x:m+f+u/2,y:h+p},{x:m+f+u/2,y:h+p-d}];t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let w=F(x),T=y.path(w,b),E=F(S),D=y.path(E,{...b,fillStyle:`solid`}),O=s.insert(()=>D,`:first-child`);return O.insert(()=>T,`:first-child`),O.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),N(t,O),t.intersect=function(e){return K.polygon(t,x,e)},s}e(Rt,`taggedRect`);async function zt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/8,u=.2*s,d=.2*c,f=c+l,{cssStyles:p}=t,m=C.svg(i),h=g(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let v=[{x:-s/2-s/2*.1,y:f/2},...I(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,l,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],y=-s/2+s/2*.1,b=-f/2-d*.4,x=[{x:y+s-u,y:(b+c)*1.3},{x:y+s,y:b+c-d},{x:y+s,y:(b+c)*.9},...I(y+s,(b+c)*1.25,y+s-u,(b+c)*1.3,-c*.02,.5)],S=F(v),w=m.path(S,h),T=F(x),E=m.path(T,{...h,fillStyle:`solid`}),D=i.insert(()=>E,`:first-child`);return D.insert(()=>w,`:first-child`),D.attr(`class`,`basic label-container outer-path`),p&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),D.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),N(t,D),t.intersect=function(e){return K.polygon(t,v,e)},i}e(zt,`taggedWaveEdgedRectangle`);async function Bt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await j(e,t,P(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),s=Math.max(a.height+(t.padding??0),t?.height||0),c=-o/2,l=-s/2,u=i.insert(`rect`,`:first-child`);return u.attr(`class`,`text`).attr(`style`,r).attr(`rx`,0).attr(`ry`,0).attr(`x`,c).attr(`y`,l).attr(`width`,o).attr(`height`,s),N(t,u),t.intersect=function(e){return K.rect(t,e)},i}e(Bt,`text`);var Vt=e((e,t,n,r,i,a)=>`M${e},${t}
|
|
3
3
|
a${i},${a} 0,0,1 0,${-r}
|
|
4
4
|
l${n},0
|
|
5
5
|
a${i},${a} 0,0,1 0,${r}
|
|
6
6
|
M${n},${-r}
|
|
7
7
|
a${i},${a} 0,0,0 0,${r}
|
|
8
|
-
l${-n},0`,`createCylinderPathD`),Ht=e((e,t,n,r,i,a)=>[`M${e},${t}`,`M${e+n},${t}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(` `),`createOuterCylinderPathD`),Ut=e((e,t,n,r,i,a)=>[`M${e+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(` `),`createInnerCylinderPathD`),Wt=5,Gt=10;async function Kt(e,t){let{labelStyles:n,nodeStyles:r}=
|
|
8
|
+
l${-n},0`,`createCylinderPathD`),Ht=e((e,t,n,r,i,a)=>[`M${e},${t}`,`M${e+n},${t}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(` `),`createOuterCylinderPathD`),Ut=e((e,t,n,r,i,a)=>[`M${e+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(` `),`createInnerCylinderPathD`),Wt=5,Gt=10;async function Kt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?12:i/2,o=t.height??0;if(t.height&&(t.height-=a,t.height<Wt&&(t.height=Wt)),t.width){let e=o/2/(2.5+o/50);t.width=t.width-a-e*3,t.width<Gt&&(t.width=Gt)}let{shapeSvg:s,bbox:c,label:l}=await j(e,t,P(t)),u=Math.max(t.height??0,c.height)+a,d=u/2,f=d/(2.5+u/50),p=Math.max(t.width??0,c.width)+f+a,{cssStyles:m}=t,v;if(t.look===`handDrawn`){let e=C.svg(s),n=Ht(0,0,p,u,f,d),r=Ut(0,0,p,u,f,d),i=e.path(n,g(t,{})),a=e.path(r,g(t,{fill:`none`}));v=s.insert(()=>a,`:first-child`),v=s.insert(()=>i,`:first-child`),v.attr(`class`,`basic label-container`),m&&v.attr(`style`,m)}else{let e=Vt(0,0,p,u,f,d);v=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,h(m)).attr(`style`,r),v.attr(`class`,`basic label-container outer-path`),m&&v.selectAll(`path`).attr(`style`,m),r&&v.selectAll(`path`).attr(`style`,r)}return v.attr(`label-offset-x`,f),v.attr(`transform`,`translate(${-p/2}, ${u/2} )`),l.attr(`transform`,`translate(${-(c.width/2)-f-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),N(t,v),t.intersect=function(e){let n=K.rect(t,e),r=n.y-(t.y??0);if(d!=0&&(Math.abs(r)<(t.height??0)/2||Math.abs(r)==(t.height??0)/2&&Math.abs(n.x-(t.x??0))>(t.width??0)/2-f)){let i=f*f*(1-r*r/(d*d));i!=0&&(i=Math.sqrt(Math.abs(i))),i=f-i,e.x-(t.x??0)>0&&(i=-i),n.x+=i}return n},s}e(Kt,`tiltedCylinder`);async function qt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=(t.look,i),o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:-3*l/6,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=C.svg(s),n=g(t,{}),r=F(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,N(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(qt,`trapezoid`);async function Jt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=(t.height??0)-o*2,t.height<5&&(t.height=5),t.width=(t.width??0)-a*2,t.width<15&&(t.width=15));let{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o*2,{cssStyles:d}=t,f=C.svg(s),p=g(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=[{x:-l/2*.8,y:-u/2},{x:l/2*.8,y:-u/2},{x:l/2,y:-u/2*.6},{x:l/2,y:u/2},{x:-l/2,y:u/2},{x:-l/2,y:-u/2*.6}],h=F(m),v=f.path(h,p),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),d&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,r),N(t,y),t.intersect=function(e){return K.polygon(t,m,e)},s}e(Jt,`trapezoidalPentagon`);var Yt=10,Xt=10;async function Zt(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?a*2:a;(n.width||n.height)&&(n.width=((n?.width??0)-o)/2,n.width<Xt&&(n.width=Xt),n.height=n?.height??0,n.height<Yt&&(n.height=Yt));let{shapeSvg:s,bbox:c,label:d}=await j(e,n,P(n)),f=l(u().flowchart?.htmlLabels),p=(n?.width?n?.width:c.width)+o,m=n?.height?n?.height:p+c.height,h=m,v=[{x:0,y:0},{x:h,y:0},{x:h/2,y:-m}],{cssStyles:y}=n,b=C.svg(s),x=g(n,{});n.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=F(v),w=b.path(S,x),T=s.insert(()=>w,`:first-child`).attr(`transform`,`translate(${-m/2}, ${m/2})`).attr(`class`,`outer-path`);return y&&n.look!==`handDrawn`&&T.selectChildren(`path`).attr(`style`,y),i&&n.look!==`handDrawn`&&T.selectChildren(`path`).attr(`style`,i),n.width=p,n.height=m,N(n,T),d.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${m/2-(c.height+(n.padding??0)/(f?2:1)-(c.y-(c.top??0)))})`),n.intersect=function(e){return t.info(`Triangle intersect`,n,v,e),K.polygon(n,v,e)},s}e(Zt,`triangle`);async function Qt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=!0;(t.width||t.height)&&(s=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:c,bbox:l,label:u}=await j(e,t,P(t)),d=(t?.width?t?.width:l.width)+(a??0)*2,f=(t?.height?t?.height:l.height)+(o??0)*2,p=t.look===`neo`?f/4:f/8,m=f+(s?p:-p),{cssStyles:h}=t,v=14-d,y=v>0?v/2:0,b=C.svg(c),x=g(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=[{x:-d/2-y,y:m/2},...I(-d/2-y,m/2,d/2+y,m/2,p,.8),{x:d/2+y,y:-m/2},{x:-d/2-y,y:-m/2}],w=F(S),T=b.path(w,x),E=c.insert(()=>T,`:first-child`);return E.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,r),E.attr(`transform`,`translate(0,${-p/2})`),u.attr(`transform`,`translate(${-d/2+(t.padding??0)-(l.x-(l.left??0))},${-f/2+(t.padding??0)-p-(l.y-(l.top??0))})`),N(t,E),t.intersect=function(e){return K.polygon(t,S,e)},c}e(Qt,`waveEdgedRectangle`);async function $t(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?20:i;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let e=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-o-20/9*e),t.width-=a*2}let{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o,d=u/8,f=u+d*2,{cssStyles:p}=t,m=C.svg(s),h=g(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let v=[{x:-l/2,y:f/2},...I(-l/2,f/2,l/2,f/2,d,1),{x:l/2,y:-f/2},...I(l/2,-f/2,-l/2,-f/2,d,-1)],y=F(v),b=m.path(y,h),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),N(t,x),t.intersect=function(e){return K.polygon(t,v,e)},s}e($t,`waveRectangle`);var Q=10;async function en(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-i*2-Q,10),t.height=Math.max((t?.height??0)-a*2-Q,10));let{shapeSvg:o,bbox:s,label:c}=await j(e,t,P(t)),l=(t?.width?t?.width:s.width)+i*2+Q,u=(t?.height?t?.height:s.height)+a*2+Q,d=l-Q,f=u-Q,p=-d/2,m=-f/2,{cssStyles:h}=t,v=C.svg(o),y=g(t,{}),b=[{x:p-Q,y:m-Q},{x:p-Q,y:m+f},{x:p+d,y:m+f},{x:p+d,y:m-Q}],x=`M${p-Q},${m-Q} L${p+d},${m-Q} L${p+d},${m+f} L${p-Q},${m+f} L${p-Q},${m-Q}
|
|
9
9
|
M${p-Q},${m} L${p+d},${m}
|
|
10
|
-
M${p},${m-Q} L${p},${m+f}`;t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let S=g.path(x,_),w=o.insert(()=>S,`:first-child`);return w.attr(`transform`,`translate(${Q/2}, ${Q/2})`),w.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${-(s.width/2)+Q/2-(s.x-(s.left??0))}, ${-(s.height/2)+Q/2-(s.y-(s.top??0))})`),N(t,w),t.intersect=function(e){return K.polygon(t,v,e)},o}e(en,`windowPane`);var tn=new Set([`redux-color`,`redux-dark-color`]),nn=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]);async function rn(e,t){let r=t;r.alias&&(t.label=r.alias);let{theme:i,themeVariables:a}=s(),{rowEven:o,rowOdd:c,nodeBorder:u,borderColorArray:d}=a;if(t.look===`handDrawn`){let{themeVariables:n}=s(),{background:r}=n;await rn(e,{...t,id:t.id+`-background`,domId:(t.domId||t.id)+`-background`,look:`default`,cssStyles:[`stroke: none`,`fill: ${r}`]})}let f=s();t.useHtmlLabels=f.htmlLabels;let p=f.er?.diagramPadding??10,h=f.er?.entityPadding??6,{cssStyles:g}=t,{labelStyles:_,nodeStyles:v}=b(t);if(r.attributes.length===0&&t.label){let n={rx:0,ry:0,labelPaddingX:p,labelPaddingY:p*1.5,classes:``};m(t.label,f)+n.labelPaddingX*2<f.er.minEntityWidth&&(t.width=f.er.minEntityWidth);let a=await Ue(e,t,n);if(i!=null&&tn.has(i)){let e=r.colorIndex??0;a.attr(`data-color-id`,`color-${e%d.length}`)}if(!l(f.htmlLabels)){let e=a.select(`text`),t=e.node()?.getBBox();e.attr(`transform`,`translate(${-t.width/2}, 0)`)}return a}f.htmlLabels||(p*=1.25,h*=1.25);let x=P(t);x||=`node default`;let S=e.insert(`g`).attr(`class`,x).attr(`id`,t.domId||t.id),w=await an(S,t.label??``,f,0,0,[`name`],_);w.height+=h;let T=0,E=[],D=[],O=0,k=0,A=0,j=0,M=!0,F=!0;for(let e of r.attributes){let t=await an(S,e.type,f,0,T,[`attribute-type`],_);O=Math.max(O,t.width+p);let n=await an(S,e.name,f,0,T,[`attribute-name`],_);k=Math.max(k,n.width+p);let r=await an(S,e.keys.join(),f,0,T,[`attribute-keys`],_);A=Math.max(A,r.width+p);let i=await an(S,e.comment,f,0,T,[`attribute-comment`],_);j=Math.max(j,i.width+p);let a=Math.max(t.height,n.height,r.height,i.height)+h;D.push({yOffset:T,rowHeight:a}),T+=a}let I=4;A<=p&&(M=!1,A=0,I--),j<=p&&(F=!1,j=0,I--);let L=S.node().getBBox();if(w.width+p*2-(O+k+A+j)>0){let e=w.width+p*2-(O+k+A+j);O+=e/I,k+=e/I,A>0&&(A+=e/I),j>0&&(j+=e/I)}let ee=O+k+A+j,R=C.svg(S),z=y(t,{});t.look!==`handDrawn`&&(z.roughness=0,z.fillStyle=`solid`);let te=0;D.length>0&&(te=D.reduce((e,t)=>e+(t?.rowHeight??0),0));let B=Math.max(L.width+p*2,t?.width||0,ee),ne=Math.max((te??0)+w.height,t?.height||0),V=-B/2,H=-ne/2;if(S.selectAll(`g:not(:first-child)`).each((e,t,r)=>{let i=n(r[t]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]),i.attr(`class`).includes(`attribute-name`)?o+=O:i.attr(`class`).includes(`attribute-keys`)?o+=O+k:i.attr(`class`).includes(`attribute-comment`)&&(o+=O+k+A))}i.attr(`transform`,`translate(${V+p/2+o}, ${s+H+w.height+h/2})`)}),S.select(`.name`).attr(`transform`,`translate(`+-w.width/2+`, `+(H+h/2)+`)`),i!=null&&tn.has(i)){let e=r.colorIndex??0;S.attr(`data-color-id`,`color-${e%d.length}`)}let re=R.rectangle(V,H,B,ne,z),ie=S.insert(()=>re,`:first-child`).attr(`class`,`outer-path`).attr(`style`,g.join(``));E.push(0);for(let[e,t]of D.entries()){let n=(e+1)%2==0&&t.yOffset!==0,r=R.rectangle(V,w.height+H+t?.yOffset,B,t?.rowHeight,{...z,fill:n?o:c,stroke:u});S.insert(()=>r,`g.label`).attr(`style`,g.join(``)).attr(`class`,`row-rect-${n?`even`:`odd`}`)}let U=1e-4,W=on(V,w.height+H,B+V,w.height+H,U),G=R.polygon(W.map(e=>[e.x,e.y]),z);if(S.insert(()=>G).attr(`class`,`divider`),W=on(O+V,w.height+H,O+V,ne+H,U),G=R.polygon(W.map(e=>[e.x,e.y]),z),S.insert(()=>G).attr(`class`,`divider`),M){let e=O+k+V;W=on(e,w.height+H,e,ne+H,U),G=R.polygon(W.map(e=>[e.x,e.y]),z),S.insert(()=>G).attr(`class`,`divider`)}if(F){let e=O+k+A+V;W=on(e,w.height+H,e,ne+H,U),G=R.polygon(W.map(e=>[e.x,e.y]),z),S.insert(()=>G).attr(`class`,`divider`)}for(let e of E){let t=w.height+H+e;W=on(V,t,B+V,t,U),G=R.polygon(W.map(e=>[e.x,e.y]),z),S.insert(()=>G).attr(`class`,`divider`)}if(N(t,ie),v&&t.look!==`handDrawn`){if(i!=null&&nn.has(i))S.selectAll(`path`).attr(`style`,v);else{let e=v.split(`;`)?.filter(e=>e.includes(`stroke`))?.map(e=>`${e}`).join(`; `);S.selectAll(`path`).attr(`style`,e??``),S.selectAll(`.row-rect-even path`).attr(`style`,v)}}return t.intersect=function(e){return K.rect(t,e)},S}e(rn,`erBox`);async function an(e,t,r,i=0,o=0,s=[],c=``){let u=e.insert(`g`).attr(`class`,`label ${s.join(` `)}`).attr(`transform`,`translate(${i}, ${o})`).attr(`style`,c);t!==a(t)&&(t=a(t),t=t.replaceAll(`<`,`<`).replaceAll(`>`,`>`));let d=u.node().appendChild(await _(u,t,{width:m(t,r)+100,style:c,useHtmlLabels:r.htmlLabels},r));if(t.includes(`<`)||t.includes(`>`)){let e=d.children[0];for(e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`);e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`)}let f=d.getBBox();if(l(r.htmlLabels)){let e=d.children[0];e.style.textAlign=`start`;let t=n(d);f=e.getBoundingClientRect(),t.attr(`width`,f.width),t.attr(`height`,f.height)}return f}e(an,`addText`);function on(e,t,n,r,i){return e===n?[{x:e-i/2,y:t},{x:e+i/2,y:t},{x:n+i/2,y:r},{x:n-i/2,y:r}]:[{x:e,y:t-i/2},{x:e,y:t+i/2},{x:n,y:r+i/2},{x:n,y:r-i/2}]}e(on,`lineToPolygon`);async function sn(e,t,n,r,i=n.class.padding??12){let a=r?0:3,o=e.insert(`g`).attr(`class`,P(t)).attr(`id`,t.domId||t.id),s=null,c=null,l=null,u=null,d=0,f=0,p=0;if(s=o.insert(`g`).attr(`class`,`annotation-group text`),t.annotations.length>0){let e=t.annotations[0];await cn(s,{text:`\xAB${e}\xBB`},0),d=s.node().getBBox().height}c=o.insert(`g`).attr(`class`,`label-group text`),await cn(c,t,0,[`font-weight: bolder`]);let m=c.node().getBBox();f=m.height,l=o.insert(`g`).attr(`class`,`members-group text`);let h=0;for(let e of t.members){let t=await cn(l,e,h,[e.parseClassifier()]);h+=t+a}p=l.node().getBBox().height,p<=0&&(p=i/2),u=o.insert(`g`).attr(`class`,`methods-group text`);let g=0;for(let e of t.methods){let t=await cn(u,e,g,[e.parseClassifier()]);g+=t+a}let _=o.node().getBBox();if(s!==null){let e=s.node().getBBox();s.attr(`transform`,`translate(${-e.width/2})`)}return c.attr(`transform`,`translate(${-m.width/2}, ${d})`),_=o.node().getBBox(),l.attr(`transform`,`translate(0, ${d+f+i*2})`),_=o.node().getBBox(),u.attr(`transform`,`translate(0, ${d+f+(p?p+i*4:i*2)})`),_=o.node().getBBox(),{shapeSvg:o,bbox:_}}e(sn,`textHelper`);async function cn(e,t,a,o=[]){let c=e.insert(`g`).attr(`class`,`label`).attr(`style`,o.join(`; `)),u=s(),d=`useHtmlLabels`in t?t.useHtmlLabels:l(u.htmlLabels)??!0,p=``;p=`text`in t?t.text:t.label,!d&&p.startsWith(`\\`)&&(p=p.substring(1)),r(p)&&(d=!0);let h=await _(c,i(f(p)),{width:m(p,u)+50,classes:`markdown-node-label`,useHtmlLabels:d},u),g,v=1;if(d){let e=h.children[0],t=n(h);v=e.innerHTML.split(`<br>`).length,e.innerHTML.includes(`</math>`)&&(v+=e.innerHTML.split(`<mrow>`).length-1),await E(e),g=e.getBoundingClientRect(),t.attr(`width`,g.width),t.attr(`height`,g.height)}else{o.includes(`font-weight: bolder`)&&n(h).selectAll(`tspan`).attr(`font-weight`,``),v=h.children.length;let e=h.children[0];(h.textContent===``||h.textContent.includes(`>`))&&(e.textContent=p[0]+p.substring(1).replaceAll(`>`,`>`).replaceAll(`<`,`<`).trim(),p[1]===` `&&(e.textContent=e.textContent[0]+` `+e.textContent.substring(1))),e.textContent===`undefined`&&(e.textContent=``),g=h.getBBox()}return c.attr(`transform`,`translate(0,`+(-g.height/(2*v)+a)+`)`),g.height}e(cn,`addText`);async function ln(e,t){let r=u(),{themeVariables:i}=r,{useGradient:a}=i,o=r.class.padding??12,s=o,c=t.useHtmlLabels??l(r.htmlLabels)??!0,d=t;d.annotations=d.annotations??[],d.members=d.members??[],d.methods=d.methods??[];let{shapeSvg:f,bbox:p}=await sn(e,t,r,c,s),{labelStyles:m,nodeStyles:h}=b(t);t.labelStyle=m,t.cssStyles=d.styles||``;let g=d.styles?.join(`;`)||h||``;t.cssStyles||=g.replaceAll(`!important`,``).split(`;`);let _=d.members.length===0&&d.methods.length===0&&!r.class?.hideEmptyMembersBox,v=C.svg(f),x=y(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=Math.max(t.width??0,p.width),w=Math.max(t.height??0,p.height),T=(t.height??0)>p.height;d.members.length===0&&d.methods.length===0?w+=s:d.members.length>0&&d.methods.length===0&&(w+=s*2);let E=-S/2,D=-w/2,O=_?o*2:d.members.length===0&&d.methods.length===0?-o:0;T&&(O=o*2);let k=v.rectangle(E-o,D-o-(_?o:d.members.length===0&&d.methods.length===0?-o/2:0),S+2*o,w+2*o+O,x),A=f.insert(()=>k,`:first-child`);A.attr(`class`,`basic label-container outer-path`);let j=A.node().getBBox(),M=f.select(`.annotation-group`).node().getBBox().height-(_?o/2:0)||0,P=f.select(`.label-group`).node().getBBox().height-(_?o/2:0)||0,F=f.select(`.members-group`).node().getBBox().height-(_?o/2:0)||0,I=(M+P+D+o-(D-o-(_?o:d.members.length===0&&d.methods.length===0?-o/2:0)))/2;if(f.selectAll(`.text`).each((e,t,i)=>{let a=n(i[t]),l=a.attr(`transform`),u=0;if(l){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(l);e&&(u=parseFloat(e[2]))}let p=u+D+o-(_?o:d.members.length===0&&d.methods.length===0?-o/2:0);if(a.attr(`class`).includes(`methods-group`)){let e=Math.max(F,s/2);p=T?Math.max(I,M+P+e+D+s*2+o)+s*2:M+P+e+D+s*4+o}d.members.length===0&&d.methods.length===0&&r.class?.hideEmptyMembersBox&&(p=d.annotations.length>0?u-s:u),c||(p-=4);let m=E;(a.attr(`class`).includes(`label-group`)||a.attr(`class`).includes(`annotation-group`))&&(m=-a.node()?.getBBox().width/2||0,f.selectAll(`text`).each(function(e,t,n){window.getComputedStyle(n[t]).textAnchor===`middle`&&(m=0)})),a.attr(`transform`,`translate(${m}, ${p})`)}),d.members.length>0||d.methods.length>0||_){let e=M+P+D+o,n=v.line(j.x,e,j.x+j.width,e+.001,x);f.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!a?` neo-line`:``}`).attr(`style`,g)}if(_||d.members.length>0||d.methods.length>0){let e=M+P+F+D+s*2+o,n=v.line(j.x,T?Math.max(I,e):e,j.x+j.width,(T?Math.max(I,e):e)+.001,x);f.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!a?` neo-line`:``}`).attr(`style`,g)}if(d.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,g),A.select(`:nth-child(2)`).attr(`style`,g),f.selectAll(`.divider`).select(`path`).attr(`style`,g),t.labelStyle?f.selectAll(`span`).attr(`style`,t.labelStyle):f.selectAll(`span`).attr(`style`,g),!c){let e=RegExp(/color\s*:\s*([^;]*)/),t=e.exec(g);if(t){let e=t[0].replace(`color`,`fill`);f.selectAll(`tspan`).attr(`style`,e)}else if(m){let t=e.exec(m);if(t){let e=t[0].replace(`color`,`fill`);f.selectAll(`tspan`).attr(`style`,e)}}}return N(t,A),t.intersect=function(e){return K.rect(t,e)},f}e(ln,`classBox`);async function un(e,t){let{labelStyles:r,nodeStyles:i}=b(t);t.labelStyle=r;let a=t,o=t,s=`verifyMethod`in t,c=P(t),l=u(),{themeVariables:d}=l,{borderColorArray:f,requirementEdgeLabelBackground:p}=d,m=l.layout===`elk`?`start`:`center`,h=e.insert(`g`).attr(`class`,c).attr(`id`,t.domId??t.id),g;g=s?await $(h,`<<${a.type}>>`,0,t.labelStyle):await $(h,`<<Element>>`,0,t.labelStyle);let _=g,v=await $(h,a.name,_,t.labelStyle+`; font-weight: bold;`);if(_+=v+20,s){let e=await $(h,`${a.requirementId?`ID: ${a.requirementId}`:``}`,_,t.labelStyle,m);_+=e;let n=await $(h,`${a.text?`Text: ${a.text}`:``}`,_,t.labelStyle,m);_+=n;let r=await $(h,`${a.risk?`Risk: ${a.risk}`:``}`,_,t.labelStyle,m);_+=r,await $(h,`${a.verifyMethod?`Verification: ${a.verifyMethod}`:``}`,_,t.labelStyle,m)}else{let e=await $(h,`${o.type?`Type: ${o.type}`:``}`,_,t.labelStyle,m);_+=e,await $(h,`${o.docRef?`Doc Ref: ${o.docRef}`:``}`,_,t.labelStyle,m)}let x=(h.node()?.getBBox().width??200)+20,S=(h.node()?.getBBox().height??200)+20,w=-x/2,T=-S/2,E=C.svg(h),D=y(t,{});t.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=E.rectangle(w,T,x,S,D),k=h.insert(()=>O,`:first-child`);if(k.attr(`class`,`basic label-container outer-path`).attr(`style`,i),f?.length){let e=t.colorIndex??0;h.attr(`data-color-id`,`color-${e%f.length}`)}if(h.selectAll(`.label`).each((e,t,r)=>{let i=n(r[t]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]))}let c=s-S/2,l=w+10;(t===0||t===1)&&(l=o),i.attr(`transform`,`translate(${l}, ${c+20})`)}),_>g+v+20){let e=T+g+v+20,n;if(t.look===`neo`){let t=.001,r=[[w,e],[w+x,e],[w+x,e+t],[w,e+t]];n=E.polygon(r,D)}else n=E.line(w,e,w+x,e,D);h.insert(()=>n).attr(`class`,`divider`)}return N(t,k),t.intersect=function(e){return K.rect(t,e)},i&&t.look!==`handDrawn`&&(p||f?.length)&&h.selectAll(`path`).attr(`style`,i),h}e(un,`requirementBox`);async function $(e,t,r,a=``,o=`center`){if(t===``)return 0;let s=e.insert(`g`).attr(`class`,`label`).attr(`style`,a),c=u(),l=c.htmlLabels??!0,d=await _(s,i(f(t)),{width:m(t,c)+50,classes:`markdown-node-label`,useHtmlLabels:l,style:a},c),p;if(l){let e=d.children[0],t=n(d);o===`start`&&n(e).style(`text-align`,`left`),p=e.getBoundingClientRect(),t.attr(`width`,p.width),t.attr(`height`,p.height)}else{let e=d.children[0];for(let t of e.children)a&&t.setAttribute(`style`,a);if(o===`start`){e.setAttribute(`text-anchor`,`start`);for(let t of e.children)t.setAttribute(`text-anchor`,`start`)}p=d.getBBox(),p.height+=6}return s.attr(`transform`,`translate(${-p.width/2},${-p.height/2+r})`),p.height}e($,`addText`);var dn=e(e=>{switch(e){case`Very High`:return`red`;case`High`:return`orange`;case`Medium`:return null;case`Low`:return`blue`;case`Very Low`:return`lightblue`}},`colorFromPriority`);async function fn(e,t,{config:n}){let{labelStyles:r,nodeStyles:i}=b(t);t.labelStyle=r||``;let a=t.width;t.width=(t.width??200)-10;let{shapeSvg:o,bbox:s,label:c}=await j(e,t,P(t)),l=t.padding||10,u=``,d;`ticket`in t&&t.ticket&&n?.kanban?.ticketBaseUrl&&(u=n?.kanban?.ticketBaseUrl.replace(`#TICKET#`,t.ticket),d=o.insert(`svg:a`,`:first-child`).attr(`class`,`kanban-ticket-link`).attr(`xlink:href`,u).attr(`target`,`_blank`));let f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||``,width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},p,m;d?{label:p,bbox:m}=await M(d,`ticket`in t&&t.ticket||``,f):{label:p,bbox:m}=await M(o,`ticket`in t&&t.ticket||``,f);let{label:h,bbox:g}=await M(o,`assigned`in t&&t.assigned||``,f);t.width=a;let _=t?.width||0,v=Math.max(m.height,g.height)/2,x=Math.max(s.height+20,t?.height||0)+v,S=-_/2,w=-x/2;c.attr(`transform`,`translate(`+(l-_/2)+`, `+(-v-s.height/2)+`)`),p.attr(`transform`,`translate(`+(l-_/2)+`, `+(-v+s.height/2)+`)`),h.attr(`transform`,`translate(`+(l+_/2-g.width-20)+`, `+(-v+s.height/2)+`)`);let T,{rx:E,ry:D}=t,{cssStyles:O}=t;if(t.look===`handDrawn`){let e=C.svg(o),n=y(t,{}),r=E||D?e.path(z(S,w,_,x,E||0),n):e.rectangle(S,w,_,x,n);T=o.insert(()=>r,`:first-child`),T.attr(`class`,`basic label-container`).attr(`style`,O||null)}else{T=o.insert(`rect`,`:first-child`),T.attr(`class`,`basic label-container __APA__`).attr(`style`,i).attr(`rx`,E??5).attr(`ry`,D??5).attr(`x`,S).attr(`y`,w).attr(`width`,_).attr(`height`,x);let e=`priority`in t&&t.priority;if(e){let t=o.append(`line`),n=S+2,r=w+Math.floor((E??0)/2),i=w+x-Math.floor((E??0)/2);t.attr(`x1`,n).attr(`y1`,r).attr(`x2`,n).attr(`y2`,i).attr(`stroke-width`,`4`).attr(`stroke`,dn(e))}}return N(t,T),t.height=x,t.intersect=function(e){return K.rect(t,e)},o}e(fn,`kanbanItem`);async function pn(e,n){let{labelStyles:r,nodeStyles:i}=b(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await j(e,n,P(n)),l=o.width+10*s,u=o.height+8*s,d=.15*l,{cssStyles:f}=n,p=o.width+20,m=o.height+20,g=Math.max(l,p),_=Math.max(u,m);c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`);let v,x=`M0 0
|
|
11
|
-
a${d},${d} 1 0,0 ${
|
|
12
|
-
a${d},${d} 1 0,0 ${
|
|
13
|
-
a${d},${d} 1 0,0 ${
|
|
14
|
-
a${d},${d} 1 0,0 ${
|
|
10
|
+
M${p},${m-Q} L${p},${m+f}`;t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let S=v.path(x,y),w=o.insert(()=>S,`:first-child`);return w.attr(`transform`,`translate(${Q/2}, ${Q/2})`),w.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${-(s.width/2)+Q/2-(s.x-(s.left??0))}, ${-(s.height/2)+Q/2-(s.y-(s.top??0))})`),N(t,w),t.intersect=function(e){return K.polygon(t,b,e)},o}e(en,`windowPane`);var tn=new Set([`redux-color`,`redux-dark-color`]),nn=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]);async function rn(e,t){let r=t;r.alias&&(t.label=r.alias);let{theme:i,themeVariables:a}=s(),{rowEven:o,rowOdd:c,nodeBorder:u,borderColorArray:d}=a;if(t.look===`handDrawn`){let{themeVariables:n}=s(),{background:r}=n;await rn(e,{...t,id:t.id+`-background`,domId:(t.domId||t.id)+`-background`,look:`default`,cssStyles:[`stroke: none`,`fill: ${r}`]})}let f=s();t.useHtmlLabels=f.htmlLabels;let p=f.er?.diagramPadding??10,h=f.er?.entityPadding??6,{cssStyles:v}=t,{labelStyles:y,nodeStyles:b}=_(t);if(r.attributes.length===0&&t.label){let n={rx:0,ry:0,labelPaddingX:p,labelPaddingY:p*1.5,classes:``};m(t.label,f)+n.labelPaddingX*2<f.er.minEntityWidth&&(t.width=f.er.minEntityWidth);let a=await Ue(e,t,n);if(i!=null&&tn.has(i)){let e=r.colorIndex??0;a.attr(`data-color-id`,`color-${e%d.length}`)}if(!l(f.htmlLabels)){let e=a.select(`text`),t=e.node()?.getBBox();e.attr(`transform`,`translate(${-t.width/2}, 0)`)}return a}f.htmlLabels||(p*=1.25,h*=1.25);let x=P(t);x||=`node default`;let S=e.insert(`g`).attr(`class`,x).attr(`id`,t.domId||t.id),w=await an(S,t.label??``,f,0,0,[`name`],y);w.height+=h;let T=0,E=[],D=[],O=0,k=0,A=0,j=0,M=!0,F=!0;for(let e of r.attributes){let t=await an(S,e.type,f,0,T,[`attribute-type`],y);O=Math.max(O,t.width+p);let n=await an(S,e.name,f,0,T,[`attribute-name`],y);k=Math.max(k,n.width+p);let r=await an(S,e.keys.join(),f,0,T,[`attribute-keys`],y);A=Math.max(A,r.width+p);let i=await an(S,e.comment,f,0,T,[`attribute-comment`],y);j=Math.max(j,i.width+p);let a=Math.max(t.height,n.height,r.height,i.height)+h;D.push({yOffset:T,rowHeight:a}),T+=a}let I=4;A<=p&&(M=!1,A=0,I--),j<=p&&(F=!1,j=0,I--);let L=S.node().getBBox();if(w.width+p*2-(O+k+A+j)>0){let e=w.width+p*2-(O+k+A+j);O+=e/I,k+=e/I,A>0&&(A+=e/I),j>0&&(j+=e/I)}let ee=O+k+A+j,R=C.svg(S),z=g(t,{});t.look!==`handDrawn`&&(z.roughness=0,z.fillStyle=`solid`);let te=0;D.length>0&&(te=D.reduce((e,t)=>e+(t?.rowHeight??0),0));let B=Math.max(L.width+p*2,t?.width||0,ee),ne=Math.max((te??0)+w.height,t?.height||0),V=-B/2,H=-ne/2;if(S.selectAll(`g:not(:first-child)`).each((e,t,r)=>{let i=n(r[t]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]),i.attr(`class`).includes(`attribute-name`)?o+=O:i.attr(`class`).includes(`attribute-keys`)?o+=O+k:i.attr(`class`).includes(`attribute-comment`)&&(o+=O+k+A))}i.attr(`transform`,`translate(${V+p/2+o}, ${s+H+w.height+h/2})`)}),S.select(`.name`).attr(`transform`,`translate(`+-w.width/2+`, `+(H+h/2)+`)`),i!=null&&tn.has(i)){let e=r.colorIndex??0;S.attr(`data-color-id`,`color-${e%d.length}`)}let re=R.rectangle(V,H,B,ne,z),ie=S.insert(()=>re,`:first-child`).attr(`class`,`outer-path`).attr(`style`,v.join(``));E.push(0);for(let[e,t]of D.entries()){let n=(e+1)%2==0&&t.yOffset!==0,r=R.rectangle(V,w.height+H+t?.yOffset,B,t?.rowHeight,{...z,fill:n?o:c,stroke:u});S.insert(()=>r,`g.label`).attr(`style`,v.join(``)).attr(`class`,`row-rect-${n?`even`:`odd`}`)}let U=1e-4,W=on(V,w.height+H,B+V,w.height+H,U),G=R.polygon(W.map(e=>[e.x,e.y]),z);if(S.insert(()=>G).attr(`class`,`divider`),W=on(O+V,w.height+H,O+V,ne+H,U),G=R.polygon(W.map(e=>[e.x,e.y]),z),S.insert(()=>G).attr(`class`,`divider`),M){let e=O+k+V;W=on(e,w.height+H,e,ne+H,U),G=R.polygon(W.map(e=>[e.x,e.y]),z),S.insert(()=>G).attr(`class`,`divider`)}if(F){let e=O+k+A+V;W=on(e,w.height+H,e,ne+H,U),G=R.polygon(W.map(e=>[e.x,e.y]),z),S.insert(()=>G).attr(`class`,`divider`)}for(let e of E){let t=w.height+H+e;W=on(V,t,B+V,t,U),G=R.polygon(W.map(e=>[e.x,e.y]),z),S.insert(()=>G).attr(`class`,`divider`)}if(N(t,ie),b&&t.look!==`handDrawn`){if(i!=null&&nn.has(i))S.selectAll(`path`).attr(`style`,b);else{let e=b.split(`;`)?.filter(e=>e.includes(`stroke`))?.map(e=>`${e}`).join(`; `);S.selectAll(`path`).attr(`style`,e??``),S.selectAll(`.row-rect-even path`).attr(`style`,b)}}return t.intersect=function(e){return K.rect(t,e)},S}e(rn,`erBox`);async function an(e,t,r,i=0,o=0,s=[],c=``){let u=e.insert(`g`).attr(`class`,`label ${s.join(` `)}`).attr(`transform`,`translate(${i}, ${o})`).attr(`style`,c);t!==a(t)&&(t=a(t),t=t.replaceAll(`<`,`<`).replaceAll(`>`,`>`));let d=u.node().appendChild(await x(u,t,{width:m(t,r)+100,style:c,useHtmlLabels:r.htmlLabels},r));if(t.includes(`<`)||t.includes(`>`)){let e=d.children[0];for(e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`);e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`)}let f=d.getBBox();if(l(r.htmlLabels)){let e=d.children[0];e.style.textAlign=`start`;let t=n(d);f=e.getBoundingClientRect(),t.attr(`width`,f.width),t.attr(`height`,f.height)}return f}e(an,`addText`);function on(e,t,n,r,i){return e===n?[{x:e-i/2,y:t},{x:e+i/2,y:t},{x:n+i/2,y:r},{x:n-i/2,y:r}]:[{x:e,y:t-i/2},{x:e,y:t+i/2},{x:n,y:r+i/2},{x:n,y:r-i/2}]}e(on,`lineToPolygon`);async function sn(e,t,n,r,i=n.class.padding??12){let a=r?0:3,o=e.insert(`g`).attr(`class`,P(t)).attr(`id`,t.domId||t.id),s=null,c=null,l=null,u=null,d=0,f=0,p=0;if(s=o.insert(`g`).attr(`class`,`annotation-group text`),t.annotations.length>0){let e=t.annotations[0];await cn(s,{text:`\xAB${e}\xBB`},0),d=s.node().getBBox().height}c=o.insert(`g`).attr(`class`,`label-group text`),await cn(c,t,0,[`font-weight: bolder`]);let m=c.node().getBBox();f=m.height,l=o.insert(`g`).attr(`class`,`members-group text`);let h=0;for(let e of t.members){let t=await cn(l,e,h,[e.parseClassifier()]);h+=t+a}p=l.node().getBBox().height,p<=0&&(p=i/2),u=o.insert(`g`).attr(`class`,`methods-group text`);let g=0;for(let e of t.methods){let t=await cn(u,e,g,[e.parseClassifier()]);g+=t+a}let _=o.node().getBBox();if(s!==null){let e=s.node().getBBox();s.attr(`transform`,`translate(${-e.width/2})`)}return c.attr(`transform`,`translate(${-m.width/2}, ${d})`),_=o.node().getBBox(),l.attr(`transform`,`translate(0, ${d+f+i*2})`),_=o.node().getBBox(),u.attr(`transform`,`translate(0, ${d+f+(p?p+i*4:i*2)})`),_=o.node().getBBox(),{shapeSvg:o,bbox:_}}e(sn,`textHelper`);async function cn(e,t,a,o=[]){let c=e.insert(`g`).attr(`class`,`label`).attr(`style`,o.join(`; `)),u=s(),d=`useHtmlLabels`in t?t.useHtmlLabels:l(u.htmlLabels)??!0,p=``;p=`text`in t?t.text:t.label,!d&&p.startsWith(`\\`)&&(p=p.substring(1)),r(p)&&(d=!0);let h=await x(c,i(f(p)),{width:m(p,u)+50,classes:`markdown-node-label`,useHtmlLabels:d},u),g,_=1;if(d){let e=h.children[0],t=n(h);_=e.innerHTML.split(`<br>`).length,e.innerHTML.includes(`</math>`)&&(_+=e.innerHTML.split(`<mrow>`).length-1),await E(e),g=e.getBoundingClientRect(),t.attr(`width`,g.width),t.attr(`height`,g.height)}else{o.includes(`font-weight: bolder`)&&n(h).selectAll(`tspan`).attr(`font-weight`,``),_=h.children.length;let e=h.children[0];(h.textContent===``||h.textContent.includes(`>`))&&(e.textContent=p[0]+p.substring(1).replaceAll(`>`,`>`).replaceAll(`<`,`<`).trim(),p[1]===` `&&(e.textContent=e.textContent[0]+` `+e.textContent.substring(1))),e.textContent===`undefined`&&(e.textContent=``),g=h.getBBox()}return c.attr(`transform`,`translate(0,`+(-g.height/(2*_)+a)+`)`),g.height}e(cn,`addText`);async function ln(e,t){let r=u(),{themeVariables:i}=r,{useGradient:a}=i,o=r.class.padding??12,s=o,c=t.useHtmlLabels??l(r.htmlLabels)??!0,d=t;d.annotations=d.annotations??[],d.members=d.members??[],d.methods=d.methods??[];let{shapeSvg:f,bbox:p}=await sn(e,t,r,c,s),{labelStyles:m,nodeStyles:h}=_(t);t.labelStyle=m,t.cssStyles=d.styles||``;let v=d.styles?.join(`;`)||h||``;t.cssStyles||=v.replaceAll(`!important`,``).split(`;`);let y=d.members.length===0&&d.methods.length===0&&!r.class?.hideEmptyMembersBox,b=C.svg(f),x=g(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=Math.max(t.width??0,p.width),w=Math.max(t.height??0,p.height),T=(t.height??0)>p.height;d.members.length===0&&d.methods.length===0?w+=s:d.members.length>0&&d.methods.length===0&&(w+=s*2);let E=-S/2,D=-w/2,O=y?o*2:d.members.length===0&&d.methods.length===0?-o:0;T&&(O=o*2);let k=b.rectangle(E-o,D-o-(y?o:d.members.length===0&&d.methods.length===0?-o/2:0),S+2*o,w+2*o+O,x),A=f.insert(()=>k,`:first-child`);A.attr(`class`,`basic label-container outer-path`);let j=A.node().getBBox(),M=f.select(`.annotation-group`).node().getBBox().height-(y?o/2:0)||0,P=f.select(`.label-group`).node().getBBox().height-(y?o/2:0)||0,F=f.select(`.members-group`).node().getBBox().height-(y?o/2:0)||0,I=(M+P+D+o-(D-o-(y?o:d.members.length===0&&d.methods.length===0?-o/2:0)))/2;if(f.selectAll(`.text`).each((e,t,i)=>{let a=n(i[t]),l=a.attr(`transform`),u=0;if(l){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(l);e&&(u=parseFloat(e[2]))}let p=u+D+o-(y?o:d.members.length===0&&d.methods.length===0?-o/2:0);if(a.attr(`class`).includes(`methods-group`)){let e=Math.max(F,s/2);p=T?Math.max(I,M+P+e+D+s*2+o)+s*2:M+P+e+D+s*4+o}d.members.length===0&&d.methods.length===0&&r.class?.hideEmptyMembersBox&&(p=d.annotations.length>0?u-s:u),c||(p-=4);let m=E;(a.attr(`class`).includes(`label-group`)||a.attr(`class`).includes(`annotation-group`))&&(m=-a.node()?.getBBox().width/2||0,f.selectAll(`text`).each(function(e,t,n){window.getComputedStyle(n[t]).textAnchor===`middle`&&(m=0)})),a.attr(`transform`,`translate(${m}, ${p})`)}),d.members.length>0||d.methods.length>0||y){let e=M+P+D+o,n=b.line(j.x,e,j.x+j.width,e+.001,x);f.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!a?` neo-line`:``}`).attr(`style`,v)}if(y||d.members.length>0||d.methods.length>0){let e=M+P+F+D+s*2+o,n=b.line(j.x,T?Math.max(I,e):e,j.x+j.width,(T?Math.max(I,e):e)+.001,x);f.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!a?` neo-line`:``}`).attr(`style`,v)}if(d.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,v),A.select(`:nth-child(2)`).attr(`style`,v),f.selectAll(`.divider`).select(`path`).attr(`style`,v),t.labelStyle?f.selectAll(`span`).attr(`style`,t.labelStyle):f.selectAll(`span`).attr(`style`,v),!c){let e=RegExp(/color\s*:\s*([^;]*)/),t=e.exec(v);if(t){let e=t[0].replace(`color`,`fill`);f.selectAll(`tspan`).attr(`style`,e)}else if(m){let t=e.exec(m);if(t){let e=t[0].replace(`color`,`fill`);f.selectAll(`tspan`).attr(`style`,e)}}}return N(t,A),t.intersect=function(e){return K.rect(t,e)},f}e(ln,`classBox`);async function un(e,t){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let a=t,o=t,s=`verifyMethod`in t,c=P(t),l=u(),{themeVariables:d}=l,{borderColorArray:f,requirementEdgeLabelBackground:p}=d,m=l.layout===`elk`?`start`:`center`,h=e.insert(`g`).attr(`class`,c).attr(`id`,t.domId??t.id),v;v=s?await $(h,`<<${a.type}>>`,0,t.labelStyle):await $(h,`<<Element>>`,0,t.labelStyle);let y=v,b=await $(h,a.name,y,t.labelStyle+`; font-weight: bold;`);if(y+=b+20,s){let e=await $(h,`${a.requirementId?`ID: ${a.requirementId}`:``}`,y,t.labelStyle,m);y+=e;let n=await $(h,`${a.text?`Text: ${a.text}`:``}`,y,t.labelStyle,m);y+=n;let r=await $(h,`${a.risk?`Risk: ${a.risk}`:``}`,y,t.labelStyle,m);y+=r,await $(h,`${a.verifyMethod?`Verification: ${a.verifyMethod}`:``}`,y,t.labelStyle,m)}else{let e=await $(h,`${o.type?`Type: ${o.type}`:``}`,y,t.labelStyle,m);y+=e,await $(h,`${o.docRef?`Doc Ref: ${o.docRef}`:``}`,y,t.labelStyle,m)}let x=(h.node()?.getBBox().width??200)+20,S=(h.node()?.getBBox().height??200)+20,w=-x/2,T=-S/2,E=C.svg(h),D=g(t,{});t.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=E.rectangle(w,T,x,S,D),k=h.insert(()=>O,`:first-child`);if(k.attr(`class`,`basic label-container outer-path`).attr(`style`,i),f?.length){let e=t.colorIndex??0;h.attr(`data-color-id`,`color-${e%f.length}`)}if(h.selectAll(`.label`).each((e,t,r)=>{let i=n(r[t]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]))}let c=s-S/2,l=w+10;(t===0||t===1)&&(l=o),i.attr(`transform`,`translate(${l}, ${c+20})`)}),y>v+b+20){let e=T+v+b+20,n;if(t.look===`neo`){let t=.001,r=[[w,e],[w+x,e],[w+x,e+t],[w,e+t]];n=E.polygon(r,D)}else n=E.line(w,e,w+x,e,D);h.insert(()=>n).attr(`class`,`divider`)}return N(t,k),t.intersect=function(e){return K.rect(t,e)},i&&t.look!==`handDrawn`&&(p||f?.length)&&h.selectAll(`path`).attr(`style`,i),h}e(un,`requirementBox`);async function $(e,t,r,a=``,o=`center`){if(t===``)return 0;let s=e.insert(`g`).attr(`class`,`label`).attr(`style`,a),c=u(),l=c.htmlLabels??!0,d=await x(s,i(f(t)),{width:m(t,c)+50,classes:`markdown-node-label`,useHtmlLabels:l,style:a},c),p;if(l){let e=d.children[0],t=n(d);o===`start`&&n(e).style(`text-align`,`left`),p=e.getBoundingClientRect(),t.attr(`width`,p.width),t.attr(`height`,p.height)}else{let e=d.children[0];for(let t of e.children)a&&t.setAttribute(`style`,a);if(o===`start`){e.setAttribute(`text-anchor`,`start`);for(let t of e.children)t.setAttribute(`text-anchor`,`start`)}p=d.getBBox(),p.height+=6}return s.attr(`transform`,`translate(${-p.width/2},${-p.height/2+r})`),p.height}e($,`addText`);var dn=e(e=>{switch(e){case`Very High`:return`red`;case`High`:return`orange`;case`Medium`:return null;case`Low`:return`blue`;case`Very Low`:return`lightblue`}},`colorFromPriority`);async function fn(e,t,{config:n}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r||``;let a=t.width;t.width=(t.width??200)-10;let{shapeSvg:o,bbox:s,label:c}=await j(e,t,P(t)),l=t.padding||10,u=``,d;`ticket`in t&&t.ticket&&n?.kanban?.ticketBaseUrl&&(u=n?.kanban?.ticketBaseUrl.replace(`#TICKET#`,t.ticket),d=o.insert(`svg:a`,`:first-child`).attr(`class`,`kanban-ticket-link`).attr(`xlink:href`,u).attr(`target`,`_blank`));let f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||``,width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},p,m;d?{label:p,bbox:m}=await M(d,`ticket`in t&&t.ticket||``,f):{label:p,bbox:m}=await M(o,`ticket`in t&&t.ticket||``,f);let{label:h,bbox:v}=await M(o,`assigned`in t&&t.assigned||``,f);t.width=a;let y=t?.width||0,b=Math.max(m.height,v.height)/2,x=Math.max(s.height+20,t?.height||0)+b,S=-y/2,w=-x/2;c.attr(`transform`,`translate(`+(l-y/2)+`, `+(-b-s.height/2)+`)`),p.attr(`transform`,`translate(`+(l-y/2)+`, `+(-b+s.height/2)+`)`),h.attr(`transform`,`translate(`+(l+y/2-v.width-20)+`, `+(-b+s.height/2)+`)`);let T,{rx:E,ry:D}=t,{cssStyles:O}=t;if(t.look===`handDrawn`){let e=C.svg(o),n=g(t,{}),r=E||D?e.path(z(S,w,y,x,E||0),n):e.rectangle(S,w,y,x,n);T=o.insert(()=>r,`:first-child`),T.attr(`class`,`basic label-container`).attr(`style`,O||null)}else{T=o.insert(`rect`,`:first-child`),T.attr(`class`,`basic label-container __APA__`).attr(`style`,i).attr(`rx`,E??5).attr(`ry`,D??5).attr(`x`,S).attr(`y`,w).attr(`width`,y).attr(`height`,x);let e=`priority`in t&&t.priority;if(e){let t=o.append(`line`),n=S+2,r=w+Math.floor((E??0)/2),i=w+x-Math.floor((E??0)/2);t.attr(`x1`,n).attr(`y1`,r).attr(`x2`,n).attr(`y2`,i).attr(`stroke-width`,`4`).attr(`stroke`,dn(e))}}return N(t,T),t.height=x,t.intersect=function(e){return K.rect(t,e)},o}e(fn,`kanbanItem`);async function pn(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await j(e,n,P(n)),l=o.width+10*s,u=o.height+8*s,d=.15*l,{cssStyles:f}=n,p=o.width+20,m=o.height+20,v=Math.max(l,p),y=Math.max(u,m);c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`);let b,x=`M0 0
|
|
11
|
+
a${d},${d} 1 0,0 ${v*.25},${-1*y*.1}
|
|
12
|
+
a${d},${d} 1 0,0 ${v*.25},0
|
|
13
|
+
a${d},${d} 1 0,0 ${v*.25},0
|
|
14
|
+
a${d},${d} 1 0,0 ${v*.25},${y*.1}
|
|
15
15
|
|
|
16
|
-
a${d},${d} 1 0,0 ${
|
|
17
|
-
a${d*.8},${d*.8} 1 0,0 0,${
|
|
18
|
-
a${d},${d} 1 0,0 ${-1*
|
|
16
|
+
a${d},${d} 1 0,0 ${v*.15},${y*.33}
|
|
17
|
+
a${d*.8},${d*.8} 1 0,0 0,${y*.34}
|
|
18
|
+
a${d},${d} 1 0,0 ${-1*v*.15},${y*.33}
|
|
19
19
|
|
|
20
|
-
a${d},${d} 1 0,0 ${-1*
|
|
21
|
-
a${d},${d} 1 0,0 ${-1*
|
|
22
|
-
a${d},${d} 1 0,0 ${-1*
|
|
23
|
-
a${d},${d} 1 0,0 ${-1*
|
|
20
|
+
a${d},${d} 1 0,0 ${-1*v*.25},${y*.15}
|
|
21
|
+
a${d},${d} 1 0,0 ${-1*v*.25},0
|
|
22
|
+
a${d},${d} 1 0,0 ${-1*v*.25},0
|
|
23
|
+
a${d},${d} 1 0,0 ${-1*v*.25},${-1*y*.15}
|
|
24
24
|
|
|
25
|
-
a${d},${d} 1 0,0 ${-1*
|
|
26
|
-
a${d*.8},${d*.8} 1 0,0 0,${-1*
|
|
27
|
-
a${d},${d} 1 0,0 ${
|
|
28
|
-
H0 V0 Z`;if(n.look===`handDrawn`){let e=C.svg(a),t=
|
|
25
|
+
a${d},${d} 1 0,0 ${-1*v*.1},${-1*y*.33}
|
|
26
|
+
a${d*.8},${d*.8} 1 0,0 0,${-1*y*.34}
|
|
27
|
+
a${d},${d} 1 0,0 ${v*.1},${-1*y*.33}
|
|
28
|
+
H0 V0 Z`;if(n.look===`handDrawn`){let e=C.svg(a),t=g(n,{}),r=e.path(x,t);b=a.insert(()=>r,`:first-child`),b.attr(`class`,`basic label-container`).attr(`style`,h(f))}else b=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,x);return b.attr(`transform`,`translate(${-v/2}, ${-y/2})`),N(n,b),n.calcIntersect=function(e,t){return K.rect(e,t)},n.intersect=function(e){return t.info(`Bang intersect`,n,e),K.rect(n,e)},a}e(pn,`bang`);async function mn(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await j(e,n,P(n)),l=o.width+2*s,u=o.height+2*s,d=.15*l,f=.25*l,p=.35*l,m=.2*l,{cssStyles:v}=n,y,b=`M0 0
|
|
29
29
|
a${d},${d} 0 0,1 ${l*.25},${-1*l*.1}
|
|
30
30
|
a${p},${p} 1 0,1 ${l*.4},${-1*l*.1}
|
|
31
31
|
a${f},${f} 1 0,1 ${l*.35},${l*.2}
|
|
@@ -39,7 +39,7 @@ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src
|
|
|
39
39
|
|
|
40
40
|
a${d},${d} 1 0,1 ${-1*l*.1},${-1*u*.35}
|
|
41
41
|
a${m},${m} 1 0,1 ${l*.1},${-1*u*.65}
|
|
42
|
-
H0 V0 Z`;if(n.look===`handDrawn`){let e=C.svg(a),t=
|
|
42
|
+
H0 V0 Z`;if(n.look===`handDrawn`){let e=C.svg(a),t=g(n,{}),r=e.path(b,t);y=a.insert(()=>r,`:first-child`),y.attr(`class`,`basic label-container`).attr(`style`,h(v))}else y=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,b);return c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`),y.attr(`transform`,`translate(${-l/2}, ${-u/2})`),N(n,y),n.calcIntersect=function(e,t){return K.rect(e,t)},n.intersect=function(e){return t.info(`Cloud intersect`,n,e),K.rect(n,e)},a}e(mn,`cloud`);async function hn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await j(e,t,P(t)),c=a.width+8*o,l=a.height+2*o,u=t.look===`neo`?`
|
|
43
43
|
M${-c/2} ${l/2-5}
|
|
44
44
|
v${-l+10}
|
|
45
45
|
q0,-5 5,-5
|