@opentig/cli 0.2.3 → 0.2.4
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/LICENSE +1 -1
- package/README.md +14 -14
- package/dist/bin.mjs +25 -10
- package/dist/chunks/{cli-L6lvCZdX.mjs → cli-gyjD1t0O.mjs} +611 -268
- package/dist/chunks/network-settings-CdFeKFRB.mjs +142 -0
- package/dist/chunks/{server-Cz0gvydn.mjs → server-DMk8-Xxt.mjs} +557 -105
- package/dist/chunks/{service-manager-Jyx-MWo-.mjs → service-manager-BxSmV_8Z.mjs} +88 -14
- package/dist/client/assets/App-Bfw_TX8q.js +132 -0
- package/dist/client/assets/CreatePullRequestDialog-DyPd6SKH.js +2 -0
- package/dist/client/assets/DiffWorkspace-DCo89dF1.js +7 -0
- package/dist/client/assets/EditableFileViewer-Dotntfij.js +1 -0
- package/dist/client/assets/EditableFileViewer-svutjHZv.css +1 -0
- package/dist/client/assets/ExternalLink-jdtpN_yL.js +1 -0
- package/dist/client/assets/{File-BPxtFxHC.js → File-DHnVtIhS.js} +1 -1
- package/dist/client/assets/FilesView-D6f1hPVy.js +1 -0
- package/dist/client/assets/GitHubAvatar-B6vyoVlh.js +1 -0
- package/dist/client/assets/HistoryView-D9RhzCPY.js +1 -0
- package/dist/client/assets/HtmlFileViewer-Bwmj5umg.js +2 -0
- package/dist/client/assets/{IconAlertTriangle-C1OX2bTH.js → IconAlertTriangle-B9iDJKvP.js} +1 -1
- package/dist/client/assets/IconCheck-C-G-IA13.js +1 -0
- package/dist/client/assets/IconChevronDown-DU5i40lD.js +1 -0
- package/dist/client/assets/{IconEdit-BP5Emwzw.js → IconEdit-CZe-EJxX.js} +1 -1
- package/dist/client/assets/{IconFolderSymlink-BNWI0eXB.js → IconFolderSymlink-DkLEuUb6.js} +1 -1
- package/dist/client/assets/IconGitMerge-D9KEj1cE.js +1 -0
- package/dist/client/assets/IconGitPullRequest-ClaUqyVa.js +1 -0
- package/dist/client/assets/{IconLoader4-Bk6G4Bls.js → IconLoader4-D2VN7u1V.js} +1 -1
- package/dist/client/assets/{IconPlus-DUFNSK_i.js → IconPlus-DJCoD3wt.js} +1 -1
- package/dist/client/assets/{IconSearch-ZL3YVslZ.js → IconSearch-1VQ4P4kW.js} +1 -1
- package/dist/client/assets/{IconSelector-BGwY84R8.js → IconSelector-BVMU1PEt.js} +1 -1
- package/dist/client/assets/ImageFileViewer-3izbFVTw.css +1 -0
- package/dist/client/assets/ImageFileViewer-CdFLl_in.js +1 -0
- package/dist/client/assets/LinkedMarkdown-Bnc2OA63.js +1 -0
- package/dist/client/assets/LinkedText-BD6K3d1t.js +1 -0
- package/dist/client/assets/LocalRefsDialog-Bl-fddap.js +1 -0
- package/dist/client/assets/MarkdownFileViewer-NUAoQmv5.js +2 -0
- package/dist/client/assets/PairingPage-CqrxpC3_.js +1 -0
- package/dist/client/assets/PierreDiffViewer-CDfQ32e0.js +1 -0
- package/dist/client/assets/{PierreEditBoundary-Bt0q7SXc.js → PierreEditBoundary-DAdYNYZ3.js} +1 -1
- package/dist/client/assets/{PierreWorkerPool-DMFigp0u.js → PierreWorkerPool-mIDzTMB9.js} +3 -3
- package/dist/client/assets/PullRequestDiff-n1NZFHKN.js +1 -0
- package/dist/client/assets/PullRequestViewer-u89zl169.js +2 -0
- package/dist/client/assets/PullRequestsView-D6BqvB4E.js +1 -0
- package/dist/client/assets/QuickOpenDialog-BbEifGRi.js +1 -0
- package/dist/client/assets/RepositoryProjectsDialog-EGAsXL-Z.js +1 -0
- package/dist/client/assets/{SearchView-BYz1K1Ta.js → SearchView-BMz7qOdc.js} +1 -1
- package/dist/client/assets/SettingsDialog-DmD7HvhX.js +9 -0
- package/dist/client/assets/Viewer-CDj_vo6w.js +3 -0
- package/dist/client/assets/{abnfDiagram-YUKMZFIV-CpKAN_8n.js → abnfDiagram-YUKMZFIV-It6tW-4v.js} +1 -1
- package/dist/client/assets/{architecture-WOLXFQ4H-DrizVopY.js → architecture-WOLXFQ4H-CaOaChND.js} +1 -1
- package/dist/client/assets/{architectureDiagram-47P4ROYG-gvUijB3H.js → architectureDiagram-47P4ROYG-COtncecA.js} +1 -1
- package/dist/client/assets/{blockDiagram-E7TT5TSB-CdcXmnf_.js → blockDiagram-E7TT5TSB-NU4wFrfP.js} +1 -1
- package/dist/client/assets/{c4Diagram-CRA5TL53-DtoD1jKt.js → c4Diagram-CRA5TL53-0xzM4S8q.js} +1 -1
- package/dist/client/assets/channel-QED-4ACa.js +1 -0
- package/dist/client/assets/checkbox-Dh4T0bCe.js +1 -0
- package/dist/client/assets/{chunk-2BW5OAIV-Bxqf2dFQ.js → chunk-2BW5OAIV-BQMxlSNI.js} +1 -1
- package/dist/client/assets/{chunk-3YJQHVM4-BhzXJiq0.js → chunk-3YJQHVM4-CdP15KtA.js} +1 -1
- package/dist/client/assets/{chunk-4EA7E6EY-CvEILf8c.js → chunk-4EA7E6EY-xRPCCZLU.js} +1 -1
- package/dist/client/assets/{chunk-7TKQ45FW-pTEdzVz3.js → chunk-7TKQ45FW-Cr_UAObV.js} +1 -1
- package/dist/client/assets/{chunk-AW2ZBBNX-LVROkcXk.js → chunk-AW2ZBBNX-DBqqxF2h.js} +1 -1
- package/dist/client/assets/{chunk-DBDB3WZW-FCGrB-q8.js → chunk-DBDB3WZW-BonEIRP2.js} +1 -1
- package/dist/client/assets/{chunk-E2ZNV5FY-B3rGXPn-.js → chunk-E2ZNV5FY-DnKvxSiA.js} +1 -1
- package/dist/client/assets/{chunk-EU5HNXII-D6a_Ly_W.js → chunk-EU5HNXII-DLK0K3sR.js} +1 -1
- package/dist/client/assets/{chunk-FVRAUYC3-B5hy0Ket.js → chunk-FVRAUYC3-DmjKoYAh.js} +1 -1
- package/dist/client/assets/{chunk-HJ2JQQFS-CKHFz1Wl.js → chunk-HJ2JQQFS-AF4phse0.js} +1 -1
- package/dist/client/assets/{chunk-HTAEGDNF-CtwDuO27.js → chunk-HTAEGDNF-CG4pBnUZ.js} +1 -1
- package/dist/client/assets/{chunk-KQW6MTUR-BN3uxLYf.js → chunk-KQW6MTUR-Dd87yj5r.js} +1 -1
- package/dist/client/assets/{chunk-NTY3LDVX-CfXSvyIC.js → chunk-NTY3LDVX-OolU2PaP.js} +1 -1
- package/dist/client/assets/{chunk-VPRB5NB3-LAggcSji.js → chunk-VPRB5NB3-Dnr3edxV.js} +3 -3
- package/dist/client/assets/{chunk-XC4XBNZT-BksIPWQU.js → chunk-XC4XBNZT-CIqGRxkD.js} +1 -1
- package/dist/client/assets/{classDiagram-v2-K4WV4PDN-DH78Maqm.js → classDiagram-v2-K4WV4PDN-CPGawm8n.js} +1 -1
- package/dist/client/assets/createReactComponent-Ctub7J3a.js +1 -0
- package/dist/client/assets/{cynefin-EF2NZ3EQ-DozKlDV1.js → cynefin-EF2NZ3EQ-OA2R9WCH.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-3GCD6N5R-A1yS7NKN.js → cynefinDiagram-3GCD6N5R-DqCVtoKt.js} +1 -1
- package/dist/client/assets/{dagre-W4DXFKR2-DRJ1mmbe.js → dagre-W4DXFKR2-kc3-tkAQ.js} +1 -1
- package/dist/client/assets/{diagram-2UJZ2QOL-B1sI2b2o.js → diagram-2UJZ2QOL-DoBZKT3s.js} +1 -1
- package/dist/client/assets/{diagram-OVF4WLC6-DLE1o4-P.js → diagram-OVF4WLC6-DGkyha_F.js} +1 -1
- package/dist/client/assets/{diagram-PFPMY2P6-UtIEsv14.js → diagram-PFPMY2P6-DpRDDgdV.js} +1 -1
- package/dist/client/assets/{diagram-UMYRVEAY-BwTyzVap.js → diagram-UMYRVEAY-DlsfhYv3.js} +1 -1
- package/dist/client/assets/{diagram-YEKJPTXX-DNPUQqu0.js → diagram-YEKJPTXX-BIhRZzBM.js} +1 -1
- package/dist/client/assets/{diagram-ZIFT7M5P-ClXykQ3I.js → diagram-ZIFT7M5P-mweJcgBZ.js} +1 -1
- package/dist/client/assets/diff-parse.worker-C1IFRYY9.js +13 -0
- package/dist/client/assets/{ebnfDiagram-VR2GEFS7-Dm8VAviu.js → ebnfDiagram-VR2GEFS7-Dn5zyIbZ.js} +1 -1
- package/dist/client/assets/{elk-IJKZMXRS-CEEoPARn.js → elk-IJKZMXRS-eBPlf1-o.js} +1 -1
- package/dist/client/assets/{erDiagram-O2IAPWRE-CaDE4obX.js → erDiagram-O2IAPWRE-WEE519yZ.js} +1 -1
- package/dist/client/assets/{eventmodeling-K75KTNOO-PjYgMkPC.js → eventmodeling-K75KTNOO-BgE_VmNy.js} +1 -1
- package/dist/client/assets/external-url-IUS7RmYD.js +1 -0
- package/dist/client/assets/flowDiagram-OXPTDLAJ-CHQYfkMg.js +1 -0
- package/dist/client/assets/{ganttDiagram-R7TSEDQI-CmkBarBi.js → ganttDiagram-R7TSEDQI-D_1KyJZU.js} +1 -1
- package/dist/client/assets/{gitGraph-VSP46ZUC-DeotTdHj.js → gitGraph-VSP46ZUC-CEbT7DA4.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-XJZIOB7I-uV1hPaZT.js → gitGraphDiagram-XJZIOB7I-QQyYc1gM.js} +1 -1
- package/dist/client/assets/index-DsKvWsTs.js +47 -0
- package/dist/client/assets/index-kyWCnbkb.css +2 -0
- package/dist/client/assets/{info-OHQRW6UA-BQDsGvSl.js → info-OHQRW6UA-ChHAnveo.js} +1 -1
- package/dist/client/assets/{infoDiagram-5W2HQ5XZ-CDfEPsgZ.js → infoDiagram-5W2HQ5XZ-BaxAE7UA.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-K3B6WC7H-Bb7PQGe6.js → ishikawaDiagram-K3B6WC7H-vhUflBE_.js} +1 -1
- package/dist/client/assets/{journeyDiagram-COXZFDF6-BDythglw.js → journeyDiagram-COXZFDF6-C8WWosVa.js} +1 -1
- package/dist/client/assets/{kanban-definition-P3RFRI5V-CvY5kXhh.js → kanban-definition-P3RFRI5V-CU6W9Yi3.js} +1 -1
- package/dist/client/assets/katex-CQfTPFh0.js +1 -0
- package/dist/client/assets/{line-99p2yFnB.js → line-Axq4vVX-.js} +1 -1
- package/dist/client/assets/{mermaid-parser.core-BjZYtoJ8.js → mermaid-parser.core-DNeaCX12.js} +3 -3
- package/dist/client/assets/{mermaid.core-DRcXnUox.js → mermaid.core-Dtt7rXw0.js} +4 -4
- package/dist/client/assets/{mindmap-definition-LZFPQGKD-t9LoCpnW.js → mindmap-definition-LZFPQGKD-D_8ZqQot.js} +1 -1
- package/dist/client/assets/{packet-JDAUHWVQ-BlR-5V7K.js → packet-JDAUHWVQ-6z7ujmGF.js} +1 -1
- package/dist/client/assets/{pegDiagram-BGZESJAR-CWeGI-T9.js → pegDiagram-BGZESJAR-3ujyk-bt.js} +1 -1
- package/dist/client/assets/{pie-XZMESJXO-BkvYHWgl.js → pie-XZMESJXO-DvpLy2DB.js} +1 -1
- package/dist/client/assets/{pieDiagram-CAPJLFHJ-CY5PPIr3.js → pieDiagram-CAPJLFHJ-BPMPWyc7.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-GDMTTRAM-kqj-z271.js → quadrantDiagram-GDMTTRAM-BVUCR_lf.js} +1 -1
- package/dist/client/assets/{radar-ABXABTNO-DuEtYatv.js → radar-ABXABTNO-lu14X99R.js} +1 -1
- package/dist/client/assets/{railroad-I3PHUGI6-CVlnj2j9.js → railroad-I3PHUGI6-DI_WtDmt.js} +1 -1
- package/dist/client/assets/{railroad-abnf-LNEFI6M7-9Qiczw4d.js → railroad-abnf-LNEFI6M7-CmWAKZ2T.js} +1 -1
- package/dist/client/assets/{railroad-ebnf-DWYD2UWJ-BNL7TMEg.js → railroad-ebnf-DWYD2UWJ-BWKFU_UH.js} +1 -1
- package/dist/client/assets/{railroad-peg-JR7BVNR7-DdpRxgk6.js → railroad-peg-JR7BVNR7-9wkgzxMB.js} +1 -1
- package/dist/client/assets/{railroadDiagram-SM67HX2B-CDXvYNqW.js → railroadDiagram-SM67HX2B-4JnRbxl_.js} +1 -1
- package/dist/client/assets/{render-markdown-DF9Fy7MD.js → render-markdown-CQi2yKYQ.js} +2 -2
- package/dist/client/assets/{requirementDiagram-X7JNWC4A-BDdhqnZA.js → requirementDiagram-X7JNWC4A-CVJiZZsi.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-UM26HJRW-Rkyk5oEf.js → sankeyDiagram-UM26HJRW-BmlWQdkv.js} +1 -1
- package/dist/client/assets/select-Dq3KDX2O.js +1 -0
- package/dist/client/assets/{sequenceDiagram-ZO4K6R2Y-Coj9ap7h.js → sequenceDiagram-ZO4K6R2Y-zUx3LmPj.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-TBUQTH76-BucWlahR.js → stateDiagram-v2-TBUQTH76-o_ci-2bu.js} +1 -1
- package/dist/client/assets/{swimlanes-N4OXWK64-tEECcFP9.js → swimlanes-N4OXWK64-BlI0GC5-.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-K3J5GTZL-BEeJLN8d.js +8 -0
- package/dist/client/assets/tanstack-CVAt_k_T.js +1 -0
- package/dist/client/assets/{timeline-definition-YOQAKGHF-XvIbGO4d.js → timeline-definition-YOQAKGHF-DLnvF__o.js} +1 -1
- package/dist/client/assets/{treeView-D4JQ5SDB-DuhJpfXe.js → treeView-D4JQ5SDB-DPuMLQhB.js} +1 -1
- package/dist/client/assets/{treemap-SAJKECNS-CLiUWfZh.js → treemap-SAJKECNS-DjxqxJ8-.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-VIAY4XPW-BuwkpV9w.js → usecaseDiagram-VIAY4XPW-BtnFNltN.js} +1 -1
- package/dist/client/assets/utils-D0T3A-kS.js +1 -0
- package/dist/client/assets/{vennDiagram-BLWOH2XV-kfza5Rxq.js → vennDiagram-BLWOH2XV-CAiF2FKz.js} +1 -1
- package/dist/client/assets/viewer-tabs-DkkqN9MD.js +1 -0
- package/dist/client/assets/{wardley-7MLQ67FV-CcbU_Ykg.js → wardley-7MLQ67FV-DAWySamq.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-YMQ3BMBF-DnxlEg3a.js → wardleyDiagram-YMQ3BMBF-DiBCclEL.js} +1 -1
- package/dist/client/assets/{xychartDiagram-TAQBALBS-BzgtwtvK.js → xychartDiagram-TAQBALBS-B0NgfXz6.js} +1 -1
- package/dist/client/index.html +6 -4
- package/dist/dev.mjs +6 -6
- package/dist/manifest.json +1 -1
- package/dist/server.mjs +1 -1
- package/dist/service-update.mjs +11 -3
- package/dist/utility.mjs +25 -4
- package/package.json +4 -4
- package/dist/client/assets/App-DEIZhWJG.js +0 -132
- package/dist/client/assets/CreatePullRequestDialog-BceOUbYK.js +0 -2
- package/dist/client/assets/DiffWorkspace-BMtV4MMc.js +0 -6
- package/dist/client/assets/EditableFileViewer-B44TSuFu.css +0 -1
- package/dist/client/assets/EditableFileViewer-BE3AsnVa.js +0 -1
- package/dist/client/assets/FilesView-DoVhRfi1.js +0 -1
- package/dist/client/assets/GitHubAvatar-RiePq1Yf.js +0 -1
- package/dist/client/assets/HistoryView-Dl8uqmKe.js +0 -1
- package/dist/client/assets/HtmlFileViewer-xfjY1Swc.js +0 -2
- package/dist/client/assets/IconCheck-BPhxw_LS.js +0 -1
- package/dist/client/assets/IconChevronDown-C3FplJL8.js +0 -1
- package/dist/client/assets/ImageFileViewer-BJBOmpsf.css +0 -1
- package/dist/client/assets/ImageFileViewer-DXaIo7_d.js +0 -1
- package/dist/client/assets/LocalRefsDialog-C5J3kgTe.js +0 -1
- package/dist/client/assets/MarkdownFileViewer-18mvm0f2.js +0 -2
- package/dist/client/assets/PairingPage-BEUj3t0V.js +0 -1
- package/dist/client/assets/PierreDiffViewer-p29h7lW_.js +0 -1
- package/dist/client/assets/PullRequestDiff-C17JA4ko.js +0 -1
- package/dist/client/assets/PullRequestViewer-DaMtkESD.js +0 -2
- package/dist/client/assets/PullRequestsView-44f03VLC.js +0 -1
- package/dist/client/assets/QuickOpenDialog-Bi-L68PU.js +0 -1
- package/dist/client/assets/RepositoryProjectsDialog-DFGn74fe.js +0 -1
- package/dist/client/assets/SettingsDialog-CruoIiyN.js +0 -9
- package/dist/client/assets/Viewer-3WKpwRzo.js +0 -3
- package/dist/client/assets/channel-BqKQxg-1.js +0 -1
- package/dist/client/assets/checkbox-MDl2t9_3.js +0 -1
- package/dist/client/assets/createReactComponent-BfrD_oQK.js +0 -1
- package/dist/client/assets/flowDiagram-OXPTDLAJ-DSokwYKA.js +0 -1
- package/dist/client/assets/index-CoZCJqTQ.js +0 -47
- package/dist/client/assets/index-DUERTTRS.css +0 -2
- package/dist/client/assets/katex-C6e6EqXB.js +0 -1
- package/dist/client/assets/select-pZpCy7qn.js +0 -1
- package/dist/client/assets/swimlanesDiagram-K3J5GTZL-DEFKR6Vf.js +0 -8
- package/dist/client/assets/tanstack-CYi5knVJ.js +0 -1
- package/dist/client/assets/viewer-tabs-MMNrJqGE.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sizeCapture-INFHLROL-3uHXrFqA.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./index-CoZCJqTQ.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n}from"./src-JH1jZ6Eh.js";import{b as r,y as i}from"./chunk-VPRB5NB3-LAggcSji.js";import{_ as a}from"./chunk-3YJQHVM4-BhzXJiq0.js";import{o}from"./chunk-XC4XBNZT-BksIPWQU.js";import{i as s,n as c,r as l,t as u}from"./chunk-DBDB3WZW-FCGrB-q8.js";import{a as d,c as f,d as p,i as m,n as h,r as g,t as _,u as v}from"./chunk-2BW5OAIV-Bxqf2dFQ.js";import{t as y}from"./graphlib-DS17s2tU.js";import{r as ee,t as te}from"./chunk-NTY3LDVX-CfXSvyIC.js";function b(e,{edgePathsClass:t=`edges edgePaths`}={}){let n=e.insert(`g`).attr(`class`,`root`);return{clusters:n.insert(`g`).attr(`class`,`clusters`),edgePaths:n.insert(`g`).attr(`class`,t),edgeLabels:n.insert(`g`).attr(`class`,`edgeLabels`),nodes:n.insert(`g`).attr(`class`,`nodes`),rootGroups:n}}t(b,`createLayoutElementGroups`);async function x(e,t,n){if(t.label){let{shapeSvg:r,bbox:i}=await o(e,n===void 0?t:{...t,width:n});t.labelBBox={width:i.width,height:i.height},r.remove()}else t.labelBBox={width:0,height:0}}t(x,`measureGroupLabel`);async function S(e,t,n){let r=await l(e,t,n),i=r.node()?.getBBox()??{width:0,height:0};return t.width=i.width,t.height=i.height,r}t(S,`insertMeasuredNode`);function C(e,t,n){let r=e,i=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||i.has(r.parentId))break;i.add(r.parentId),r=t.get(r.parentId)}return n}t(C,`resolveNodeDir`);async function w(t,n,i={}){let a=new y({multigraph:!0,compound:!0}),o=[...n.edges],s=r(),c=b(t),{edgeLabels:l,nodes:u}=c,f=new Map,p=new Map(n.nodes.map(e=>[e.id,e])),m=n.direction,h=t.node()!=null;await Promise.all(n.nodes.map(async e=>{if(e.isGroup){if(h){let t=i.unwrapGroupLabels&&e.labelType!==`markdown`;await x(u,e,t?1/0:void 0)}a.setNode(e.id,{...e})}else{if(h){let t=await S(u,e,{config:s,dir:C(e,p,m)});f.set(e.id,t)}a.setNode(e.id,{...e})}}));for(let e of o)h&&g(e)&&await d(l,e),a.setEdge(e.start,e.end,{...e},e.id),n.edges.some(t=>t.id===e.id)||n.edges.push(e);if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:r}=await e(async()=>{let{captureNodeSizes:e}=await import(`./sizeCapture-INFHLROL-3uHXrFqA.js`);return{captureNodeSizes:e}},__vite__mapDeps([0,1]));r(t,n)}return{graph:a,groups:c,nodeElements:f}}t(w,`createGraphWithElements`);var T=new Map,E=new Map,D=new Map,O=t(()=>{E.clear(),D.clear(),T.clear()},`clear`),k=t((e,t)=>{let r=E.get(t)||[];return n.trace(`In isDescendant`,t,` `,e,` = `,r.includes(e)),r.includes(e)},`isDescendant`),A=t((e,t)=>{let r=E.get(t)||[];return n.info(`Descendants of `,t,` is `,r),n.info(`Edge is `,e),e.v===t||e.w===t?!1:r?r.includes(e.v)||k(e.v,t)||k(e.w,t)||r.includes(e.w):(n.debug(`Tilt, `,t,`,not in descendants`),!1)},`edgeInCluster`),j=t((e,t,r,i)=>{n.debug(`Copying children of `,e,`root`,i,`data`,t.node(e),i);let a=t.children(e)||[];e!==i&&a.push(e),n.debug(`Copying (nodes) clusterId`,e,`nodes`,a),a.forEach(a=>{if(t.children(a).length>0)j(a,t,r,i);else{let o=t.node(a);n.info(`cp `,a,` to `,i,` with parent `,e),r.setNode(a,o),i!==t.parent(a)&&(n.debug(`Setting parent`,a,t.parent(a)),r.setParent(a,t.parent(a))),e!==i&&a!==e?(n.debug(`Setting parent`,a,e),r.setParent(a,e)):(n.info(`In copy `,e,`root`,i,`data`,t.node(e),i),n.debug(`Not Setting parent for node=`,a,`cluster!==rootId`,e!==i,`node!==clusterId`,a!==e));let s=t.edges(a);n.debug(`Copying Edges`,s),s.forEach(a=>{n.info(`Edge`,a);let o=t.edge(a.v,a.w,a.name);n.info(`Edge data`,o,i);try{A(a,i)?(n.info(`Copying as `,a.v,a.w,o,a.name),r.setEdge(a.v,a.w,o,a.name),n.info(`newGraph edges `,r.edges(),r.edge(r.edges()[0]))):n.info(`Skipping copy of edge `,a.v,`-->`,a.w,` rootId: `,i,` clusterId:`,e)}catch(e){n.error(e)}})}n.debug(`Removing node`,a),t.removeNode(a)})},`copy`),M=t((e,t)=>{let n=t.children(e),r=[...n];for(let i of n)D.set(i,e),r=[...r,...M(i,t)];return r},`extractDescendants`),N=t((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},`findCommonEdges`),P=t((e,t,r)=>{let i=t.children(e);if(n.trace(`Searching children of id `,e,i),i.length<1)return e;let a;for(let e of i){let n=P(e,t,r),i=N(t,r,n);if(n){if(i.length>0)a=n;else return n}}return a},`findNonClusterChild`),F=t(e=>!T.has(e)||!T.get(e).externalConnections?e:T.has(e)?T.get(e).id:e,`getAnchorId`),ne=t((e,t)=>{if(!e||t>10)n.debug(`Opting out, no graph `);else{n.debug(`Opting in, graph `),e.nodes().forEach(function(t){e.children(t).length>0&&(n.debug(`Cluster identified`,t,` Replacement id in edges: `,P(t,e,t)),E.set(t,M(t,e)),T.set(t,{id:P(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let r=e.children(t),i=e.edges();r.length>0?(n.debug(`Cluster identified`,t,E),i.forEach(e=>{k(e.v,t)^k(e.w,t)&&(n.debug(`Edge: `,e,` leaves cluster `,t),n.debug(`Descendants of XXX `,t,`: `,E.get(t)),T.get(t).externalConnections=!0)})):n.debug(`Not a cluster `,t,E)});for(let t of T.keys()){let n=T.get(t).id,r=e.parent(n);r!==t&&T.has(r)&&!T.get(r).externalConnections&&(T.get(t).id=r);let i=e.edges().some(e=>e.v===t);if(n&&T.get(t)?.externalConnections&&i&&z(e,n,t)){let r=B(e,t,e.parent(n));r&&(T.get(t).id=r)}}e.edges().forEach(function(t){let r=e.edge(t);n.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(t)),n.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(e.edge(t)));let i=t.v,a=t.w;if(n.debug(`Fix XXX`,T,`ids:`,t.v,t.w,`Translating: `,T.get(t.v),` --- `,T.get(t.w)),T.get(t.v)||T.get(t.w)){if(n.debug(`Fixing and trying - removing XXX`,t.v,t.w,t.name),i=F(t.v),a=F(t.w),e.removeEdge(t.v,t.w,t.name),i!==t.v){let n=e.parent(i);T.get(n).externalConnections=!0,r.fromCluster=t.v}if(a!==t.w){let n=e.parent(a);T.get(n).externalConnections=!0,r.toCluster=t.w}n.debug(`Fix Replacing with XXX`,i,a,t.name),e.setEdge(i,a,r,t.name)}}),I(e,0),n.trace(T)}},`adjustClustersAndEdges`),I=t((e,t)=>{if(t>10){n.error(`Bailing out`);return}let r=e.nodes(),i=!1;for(let t of r){let n=e.children(t);i||=n.length>0}if(!i)n.debug(`Done, no node has children`,e.nodes());else{n.debug(`Nodes = `,r,t);for(let i of r)if(n.debug(`Extracting node`,i,T,T.has(i)&&!T.get(i).externalConnections,!e.parent(i),e.node(i),e.children(`D`),` Depth `,t),!T.has(i))n.debug(`Not a cluster`,i,t);else if(!T.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){n.debug(`Cluster without external connections, without a parent and with children`,i,t);let r=e.graph().rankdir===`TB`?`LR`:`TB`;T.get(i)?.clusterData?.dir&&(r=T.get(i).clusterData.dir,n.debug(`Fixing dir`,T.get(i).clusterData.dir,r));let a=new y({multigraph:!0,compound:!0}).setGraph({rankdir:r,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});j(i,e,a,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:T.get(i).clusterData,label:T.get(i).label,graph:a})}else n.debug(`Cluster ** `,i,` **not meeting the criteria !externalConnections:`,!T.get(i).externalConnections,` no parent: `,!e.parent(i),` children `,e.children(i)&&e.children(i).length>0,e.children(`D`),t),n.debug(T);r=e.nodes(),n.debug(`New list of nodes`,r);for(let i of r){let r=e.node(i);n.debug(` Now next level`,i,r),r?.clusterNode&&I(r.graph,t+1)}}},`extractor`),L=t((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=L(e,e.children(t));n=[...n,...r]}),n},`sorter`),R=t(e=>L(e,e.children()),`sortNodesByHierarchy`),z=t((e,t,n)=>{let r=e.parent(t);for(;r&&r!==n;){let t=T.get(r);if(t&&!t.externalConnections)return!0;r=e.parent(r)}return!1},`isNodeInExtractableCluster`),B=t((e,t,n)=>{let r=e.children(t)??[];for(let i of r){if(i===n||k(i,n))continue;let r=P(i,e,t);if(r&&!z(e,r,t))return r}return null},`findSafeAnchorNode`);function V({prepareLayout:e,measureLayout:n,runLayoutCore:r,paintLayout:i,afterPaint:a,paintOptions:o}){let s=n??U;return t(async function(t,n,c,l){let u=n.select(`g`);(c?.insertMarkers??f)(u,t.markers,t.type,t.diagramId),H();let d={element:u,helpers:c,options:l};d.preparedLayout=await e?.(t,d);let p=await s(t,d),m=await r(t,d),h={...d,measure:p};i?await i(t,h,m):await W(t,h,o),await a?.(t,h,m)},`render`)}t(V,`createCommonLayoutRenderer`);function H(){u(),_(),te(),O()}t(H,`clearLayoutRenderState`);async function U(e,{element:t},n){return await w(t,e,n)}t(U,`defaultMeasureLayout`);async function W(e,t,n={}){let{measure:r}=t,{groups:i}=r;for(let r of n.getNodes?.(e,t)??e.nodes)n.skipNode?.(r,t)||await G(i,r,t,n);let a=q(e.nodes);for(let r of e.edges)J(r,n)||await Y(i,r,a,e,n,t)}t(W,`paintLayoutData`);async function G(e,t,n,r){t.clusterNode?s(t):K(t,n,r)?await ee(e.clusters,t):s(t)}t(G,`paintLayoutNode`);function K(e,t,n){return e.isGroup===!0&&(n.isCluster?.(e,t)??!0)}t(K,`shouldPaintAsCluster`);function q(e){let t=new Map;for(let n of e)n?.id&&t.set(n.id,n);return t}t(q,`buildNodeLookup`);function J(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}t(J,`shouldSkipPaintEdge`);async function Y(e,t,n,r,i,a){let o=m(e.edgePaths,{...t},i.clusterDb??new Map,r.type,X(t.start,t,n,a,i),X(t.end,t,n,a,i),r.diagramId,Z(t,i));g(t)&&(h.has(t.id)||await d(e.edgeLabels,t),Q(t,o))}t(Y,`paintLayoutEdge`);function X(e,t,n,r,i){return i.getEdgeNode?.(e,t,r)??(e?n.get(e)??{}:{})}t(X,`getRenderedNode`);function Z(e,t){return typeof t.skipIntersect==`function`?t.skipIntersect(e):t.skipIntersect??!1}t(Z,`shouldSkipIntersect`);function Q(e,t){let n=t?.updatedPath??t?.originalPath,r=i(),{subGraphTitleTotalMargin:a}=c({flowchart:r.flowchart??{}});if(e.label){let n=h.get(e.id),{x:r,y:i}=v(e,t);n.attr(`transform`,`translate(${r}, ${i+a/2})`)}for(let[t,r]of[[`startLeft`,e.startLabelLeft],[`startRight`,e.startLabelRight],[`endLeft`,e.endLabelLeft],[`endRight`,e.endLabelRight]])if(r){let{x:r,y:i}=$(e,t,n);p.get(e.id)[t].attr(`transform`,`translate(${r}, ${i})`)}}t(Q,`positionRenderedEdgeLabel`);var re={startLeft:`start_left`,startRight:`start_right`,endLeft:`end_left`,endRight:`end_right`};function $(e,t,n){let r=e.terminalLabelCenters?.[t];if(r)return{...r};if(!n)return{x:e.x,y:e.y};let i=t.startsWith(`start`)?e.arrowTypeStart:e.arrowTypeEnd;return a.calcTerminalLabelPosition(i?10:0,re[t],n)}t($,`terminalLabelTranslate`);export{U as a,R as c,b as i,T as n,P as o,V as r,S as s,ne as t};
|
|
2
|
+
import{t as e}from"./index-DsKvWsTs.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n}from"./src-JH1jZ6Eh.js";import{b as r,y as i}from"./chunk-VPRB5NB3-Dnr3edxV.js";import{_ as a}from"./chunk-3YJQHVM4-CdP15KtA.js";import{o}from"./chunk-XC4XBNZT-CIqGRxkD.js";import{i as s,n as c,r as l,t as u}from"./chunk-DBDB3WZW-BonEIRP2.js";import{a as d,c as f,d as p,i as m,n as h,r as g,t as _,u as v}from"./chunk-2BW5OAIV-BQMxlSNI.js";import{t as y}from"./graphlib-DS17s2tU.js";import{r as ee,t as te}from"./chunk-NTY3LDVX-OolU2PaP.js";function b(e,{edgePathsClass:t=`edges edgePaths`}={}){let n=e.insert(`g`).attr(`class`,`root`);return{clusters:n.insert(`g`).attr(`class`,`clusters`),edgePaths:n.insert(`g`).attr(`class`,t),edgeLabels:n.insert(`g`).attr(`class`,`edgeLabels`),nodes:n.insert(`g`).attr(`class`,`nodes`),rootGroups:n}}t(b,`createLayoutElementGroups`);async function x(e,t,n){if(t.label){let{shapeSvg:r,bbox:i}=await o(e,n===void 0?t:{...t,width:n});t.labelBBox={width:i.width,height:i.height},r.remove()}else t.labelBBox={width:0,height:0}}t(x,`measureGroupLabel`);async function S(e,t,n){let r=await l(e,t,n),i=r.node()?.getBBox()??{width:0,height:0};return t.width=i.width,t.height=i.height,r}t(S,`insertMeasuredNode`);function C(e,t,n){let r=e,i=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||i.has(r.parentId))break;i.add(r.parentId),r=t.get(r.parentId)}return n}t(C,`resolveNodeDir`);async function w(t,n,i={}){let a=new y({multigraph:!0,compound:!0}),o=[...n.edges],s=r(),c=b(t),{edgeLabels:l,nodes:u}=c,f=new Map,p=new Map(n.nodes.map(e=>[e.id,e])),m=n.direction,h=t.node()!=null;await Promise.all(n.nodes.map(async e=>{if(e.isGroup){if(h){let t=i.unwrapGroupLabels&&e.labelType!==`markdown`;await x(u,e,t?1/0:void 0)}a.setNode(e.id,{...e})}else{if(h){let t=await S(u,e,{config:s,dir:C(e,p,m)});f.set(e.id,t)}a.setNode(e.id,{...e})}}));for(let e of o)h&&g(e)&&await d(l,e),a.setEdge(e.start,e.end,{...e},e.id),n.edges.some(t=>t.id===e.id)||n.edges.push(e);if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:r}=await e(async()=>{let{captureNodeSizes:e}=await import(`./sizeCapture-INFHLROL-3uHXrFqA.js`);return{captureNodeSizes:e}},__vite__mapDeps([0,1]));r(t,n)}return{graph:a,groups:c,nodeElements:f}}t(w,`createGraphWithElements`);var T=new Map,E=new Map,D=new Map,O=t(()=>{E.clear(),D.clear(),T.clear()},`clear`),k=t((e,t)=>{let r=E.get(t)||[];return n.trace(`In isDescendant`,t,` `,e,` = `,r.includes(e)),r.includes(e)},`isDescendant`),A=t((e,t)=>{let r=E.get(t)||[];return n.info(`Descendants of `,t,` is `,r),n.info(`Edge is `,e),e.v===t||e.w===t?!1:r?r.includes(e.v)||k(e.v,t)||k(e.w,t)||r.includes(e.w):(n.debug(`Tilt, `,t,`,not in descendants`),!1)},`edgeInCluster`),j=t((e,t,r,i)=>{n.debug(`Copying children of `,e,`root`,i,`data`,t.node(e),i);let a=t.children(e)||[];e!==i&&a.push(e),n.debug(`Copying (nodes) clusterId`,e,`nodes`,a),a.forEach(a=>{if(t.children(a).length>0)j(a,t,r,i);else{let o=t.node(a);n.info(`cp `,a,` to `,i,` with parent `,e),r.setNode(a,o),i!==t.parent(a)&&(n.debug(`Setting parent`,a,t.parent(a)),r.setParent(a,t.parent(a))),e!==i&&a!==e?(n.debug(`Setting parent`,a,e),r.setParent(a,e)):(n.info(`In copy `,e,`root`,i,`data`,t.node(e),i),n.debug(`Not Setting parent for node=`,a,`cluster!==rootId`,e!==i,`node!==clusterId`,a!==e));let s=t.edges(a);n.debug(`Copying Edges`,s),s.forEach(a=>{n.info(`Edge`,a);let o=t.edge(a.v,a.w,a.name);n.info(`Edge data`,o,i);try{A(a,i)?(n.info(`Copying as `,a.v,a.w,o,a.name),r.setEdge(a.v,a.w,o,a.name),n.info(`newGraph edges `,r.edges(),r.edge(r.edges()[0]))):n.info(`Skipping copy of edge `,a.v,`-->`,a.w,` rootId: `,i,` clusterId:`,e)}catch(e){n.error(e)}})}n.debug(`Removing node`,a),t.removeNode(a)})},`copy`),M=t((e,t)=>{let n=t.children(e),r=[...n];for(let i of n)D.set(i,e),r=[...r,...M(i,t)];return r},`extractDescendants`),N=t((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},`findCommonEdges`),P=t((e,t,r)=>{let i=t.children(e);if(n.trace(`Searching children of id `,e,i),i.length<1)return e;let a;for(let e of i){let n=P(e,t,r),i=N(t,r,n);if(n){if(i.length>0)a=n;else return n}}return a},`findNonClusterChild`),F=t(e=>!T.has(e)||!T.get(e).externalConnections?e:T.has(e)?T.get(e).id:e,`getAnchorId`),ne=t((e,t)=>{if(!e||t>10)n.debug(`Opting out, no graph `);else{n.debug(`Opting in, graph `),e.nodes().forEach(function(t){e.children(t).length>0&&(n.debug(`Cluster identified`,t,` Replacement id in edges: `,P(t,e,t)),E.set(t,M(t,e)),T.set(t,{id:P(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let r=e.children(t),i=e.edges();r.length>0?(n.debug(`Cluster identified`,t,E),i.forEach(e=>{k(e.v,t)^k(e.w,t)&&(n.debug(`Edge: `,e,` leaves cluster `,t),n.debug(`Descendants of XXX `,t,`: `,E.get(t)),T.get(t).externalConnections=!0)})):n.debug(`Not a cluster `,t,E)});for(let t of T.keys()){let n=T.get(t).id,r=e.parent(n);r!==t&&T.has(r)&&!T.get(r).externalConnections&&(T.get(t).id=r);let i=e.edges().some(e=>e.v===t);if(n&&T.get(t)?.externalConnections&&i&&z(e,n,t)){let r=B(e,t,e.parent(n));r&&(T.get(t).id=r)}}e.edges().forEach(function(t){let r=e.edge(t);n.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(t)),n.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(e.edge(t)));let i=t.v,a=t.w;if(n.debug(`Fix XXX`,T,`ids:`,t.v,t.w,`Translating: `,T.get(t.v),` --- `,T.get(t.w)),T.get(t.v)||T.get(t.w)){if(n.debug(`Fixing and trying - removing XXX`,t.v,t.w,t.name),i=F(t.v),a=F(t.w),e.removeEdge(t.v,t.w,t.name),i!==t.v){let n=e.parent(i);T.get(n).externalConnections=!0,r.fromCluster=t.v}if(a!==t.w){let n=e.parent(a);T.get(n).externalConnections=!0,r.toCluster=t.w}n.debug(`Fix Replacing with XXX`,i,a,t.name),e.setEdge(i,a,r,t.name)}}),I(e,0),n.trace(T)}},`adjustClustersAndEdges`),I=t((e,t)=>{if(t>10){n.error(`Bailing out`);return}let r=e.nodes(),i=!1;for(let t of r){let n=e.children(t);i||=n.length>0}if(!i)n.debug(`Done, no node has children`,e.nodes());else{n.debug(`Nodes = `,r,t);for(let i of r)if(n.debug(`Extracting node`,i,T,T.has(i)&&!T.get(i).externalConnections,!e.parent(i),e.node(i),e.children(`D`),` Depth `,t),!T.has(i))n.debug(`Not a cluster`,i,t);else if(!T.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){n.debug(`Cluster without external connections, without a parent and with children`,i,t);let r=e.graph().rankdir===`TB`?`LR`:`TB`;T.get(i)?.clusterData?.dir&&(r=T.get(i).clusterData.dir,n.debug(`Fixing dir`,T.get(i).clusterData.dir,r));let a=new y({multigraph:!0,compound:!0}).setGraph({rankdir:r,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});j(i,e,a,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:T.get(i).clusterData,label:T.get(i).label,graph:a})}else n.debug(`Cluster ** `,i,` **not meeting the criteria !externalConnections:`,!T.get(i).externalConnections,` no parent: `,!e.parent(i),` children `,e.children(i)&&e.children(i).length>0,e.children(`D`),t),n.debug(T);r=e.nodes(),n.debug(`New list of nodes`,r);for(let i of r){let r=e.node(i);n.debug(` Now next level`,i,r),r?.clusterNode&&I(r.graph,t+1)}}},`extractor`),L=t((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=L(e,e.children(t));n=[...n,...r]}),n},`sorter`),R=t(e=>L(e,e.children()),`sortNodesByHierarchy`),z=t((e,t,n)=>{let r=e.parent(t);for(;r&&r!==n;){let t=T.get(r);if(t&&!t.externalConnections)return!0;r=e.parent(r)}return!1},`isNodeInExtractableCluster`),B=t((e,t,n)=>{let r=e.children(t)??[];for(let i of r){if(i===n||k(i,n))continue;let r=P(i,e,t);if(r&&!z(e,r,t))return r}return null},`findSafeAnchorNode`);function V({prepareLayout:e,measureLayout:n,runLayoutCore:r,paintLayout:i,afterPaint:a,paintOptions:o}){let s=n??U;return t(async function(t,n,c,l){let u=n.select(`g`);(c?.insertMarkers??f)(u,t.markers,t.type,t.diagramId),H();let d={element:u,helpers:c,options:l};d.preparedLayout=await e?.(t,d);let p=await s(t,d),m=await r(t,d),h={...d,measure:p};i?await i(t,h,m):await W(t,h,o),await a?.(t,h,m)},`render`)}t(V,`createCommonLayoutRenderer`);function H(){u(),_(),te(),O()}t(H,`clearLayoutRenderState`);async function U(e,{element:t},n){return await w(t,e,n)}t(U,`defaultMeasureLayout`);async function W(e,t,n={}){let{measure:r}=t,{groups:i}=r;for(let r of n.getNodes?.(e,t)??e.nodes)n.skipNode?.(r,t)||await G(i,r,t,n);let a=q(e.nodes);for(let r of e.edges)J(r,n)||await Y(i,r,a,e,n,t)}t(W,`paintLayoutData`);async function G(e,t,n,r){t.clusterNode?s(t):K(t,n,r)?await ee(e.clusters,t):s(t)}t(G,`paintLayoutNode`);function K(e,t,n){return e.isGroup===!0&&(n.isCluster?.(e,t)??!0)}t(K,`shouldPaintAsCluster`);function q(e){let t=new Map;for(let n of e)n?.id&&t.set(n.id,n);return t}t(q,`buildNodeLookup`);function J(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}t(J,`shouldSkipPaintEdge`);async function Y(e,t,n,r,i,a){let o=m(e.edgePaths,{...t},i.clusterDb??new Map,r.type,X(t.start,t,n,a,i),X(t.end,t,n,a,i),r.diagramId,Z(t,i));g(t)&&(h.has(t.id)||await d(e.edgeLabels,t),Q(t,o))}t(Y,`paintLayoutEdge`);function X(e,t,n,r,i){return i.getEdgeNode?.(e,t,r)??(e?n.get(e)??{}:{})}t(X,`getRenderedNode`);function Z(e,t){return typeof t.skipIntersect==`function`?t.skipIntersect(e):t.skipIntersect??!1}t(Z,`shouldSkipIntersect`);function Q(e,t){let n=t?.updatedPath??t?.originalPath,r=i(),{subGraphTitleTotalMargin:a}=c({flowchart:r.flowchart??{}});if(e.label){let n=h.get(e.id),{x:r,y:i}=v(e,t);n.attr(`transform`,`translate(${r}, ${i+a/2})`)}for(let[t,r]of[[`startLeft`,e.startLabelLeft],[`startRight`,e.startLabelRight],[`endLeft`,e.endLabelLeft],[`endRight`,e.endLabelRight]])if(r){let{x:r,y:i}=$(e,t,n);p.get(e.id)[t].attr(`transform`,`translate(${r}, ${i})`)}}t(Q,`positionRenderedEdgeLabel`);var re={startLeft:`start_left`,startRight:`start_right`,endLeft:`end_left`,endRight:`end_right`};function $(e,t,n){let r=e.terminalLabelCenters?.[t];if(r)return{...r};if(!n)return{x:e.x,y:e.y};let i=t.startsWith(`start`)?e.arrowTypeStart:e.arrowTypeEnd;return a.calcTerminalLabelPosition(i?10:0,re[t],n)}t($,`terminalLabelTranslate`);export{U as a,R as c,b as i,T as n,P as o,V as r,S as s,ne as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-JH1jZ6Eh.js";import{y as n,z as r}from"./chunk-VPRB5NB3-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-JH1jZ6Eh.js";import{y as n,z as r}from"./chunk-VPRB5NB3-Dnr3edxV.js";var i=Object.freeze({left:0,top:0,width:16,height:16}),a=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),o=Object.freeze({...i,...a}),s=Object.freeze({...o,body:``,hidden:!1}),c=Object.freeze({width:null,height:null}),l=Object.freeze({...c,...a}),u=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!d(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!d(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!d(e,n)?null:e}return null},d=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function f(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function p(e,t){let n=f(e,t);for(let r in s)r in a?r in e&&!(r in n)&&(n[r]=a[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function m(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(a),i}function h(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=p(r[e]||i[e],a)}return o(t),n.forEach(o),p(e,a)}function g(e,t){if(e.icons[t])return h(e,t,[]);let n=m(e,[t])[t];return n?h(e,t,n):null}var _=/(-?[0-9.]*[0-9]+[0-9.]*)/g,v=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function y(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(_);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=v.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function b(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function x(e,t){return e?`<defs>`+e+`</defs>`+t:t}function S(e,t,n){let r=b(e);return x(r.defs,t+r.content+n)}var C=e=>e===`unset`||e===`undefined`||e===`none`;function w(e,t){let n={...o,...e},r={...l,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`)}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=S(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let s=r.width,c=r.height,u=i.width,d=i.height,f,p;s===null?(p=c===null?`1em`:c===`auto`?d:c,f=y(p,u/d)):(f=s===`auto`?u:s,p=c===null?y(f,d/u):c===`auto`?d:c);let m={},h=(e,t)=>{C(t)||(m[e]=t.toString())};h(`width`,f),h(`height`,p);let g=[i.left,i.top,u,d];return m.viewBox=g.join(` `),{attributes:m,viewBox:g,body:a}}var T=/\sid="(\S+)"/g,E=new Map;function D(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=E.get(e)||0;return E.set(e,t+1),t?`${e}${t}`:e}function O(e){let t=[],n;for(;n=T.exec(e);)t.push(n[1]);if(!t.length)return e;let r=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(t=>{let n=D(t),i=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+i+`)([")]|\\.[a-z])`,`g`),`$1`+n+r+`$3`)}),e=e.replace(new RegExp(r,`g`),``),e}function k(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}var A={body:`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>`,height:80,width:80},j=new Map,M=new Map,N=e(e=>{for(let n of e){if(!n.name)throw Error(`Invalid icon loader. Must have a "name" property with non-empty string value.`);if(t.debug(`Registering icon pack:`,n.name),`loader`in n)M.set(n.name,n.loader);else if(`icons`in n)j.set(n.name,n.icons);else throw t.error(`Invalid icon loader:`,n),Error(`Invalid icon loader. Must have either "icons" or "loader" property.`)}},`registerIconPacks`),P=e(async(e,n)=>{let r=u(e,!0,n!==void 0);if(!r)throw Error(`Invalid icon name: ${e}`);let i=r.prefix||n;if(!i)throw Error(`Icon name must contain a prefix: ${e}`);let a=j.get(i);if(!a){let e=M.get(i);if(!e)throw Error(`Icon set not found: ${r.prefix}`);try{a={...await e(),prefix:i},j.set(i,a)}catch(e){throw t.error(e),Error(`Failed to load icon set: ${r.prefix}`)}}let o=g(a,r.name);if(!o)throw Error(`Icon not found: ${e}`);return o},`getRegisteredIconData`),F=e(async e=>{try{return await P(e),!0}catch{return!1}},`isIconAvailable`),I=e(async(e,i,a)=>{let o;try{o=await P(e,i?.fallbackPrefix)}catch(e){t.error(e),o=A}let s=w(o,i),c=k(O(s.body),{...s.attributes,...a});return r(c,n())},`getIconSVG`);export{A as i,F as n,N as r,I as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{o as t}from"./chunk-2BW5OAIV-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{o as t}from"./chunk-2BW5OAIV-BQMxlSNI.js";var n=5,r=1e-5,i=2,a=.6,o=1e-6;function s(e){let t=[];for(let n=0;n<e.length-1;n++)t.push({a:e[n],b:e[n+1]});return t}e(s,`buildSegmentList`);function c(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,s=r.x-n.x,c=r.y-n.y,l=i*c-a*s;if(l===0)return null;let u=n.x-e.x,d=n.y-e.y,f=(u*c-d*s)/l,p=(u*a-d*i)/l;return f<=o||f>=1-o||p<=o||p>=1-o?null:{point:{x:e.x+f*i,y:e.y+f*a},tA:f,tB:p}}e(c,`segmentIntersection`);function l(e){return Math.abs(e.b.x-e.a.x)>=Math.abs(e.b.y-e.a.y)}e(l,`isHorizontalSeg`);function u(e,t,r){if(e.curve!==`rounded`)return!1;let i=e.points,a=i[t],o=i[t+1];if(!a||!o)return!1;let s=Math.hypot(o.x-a.x,o.y-a.y),c=r*s,l=t>0?_(i[t-1],a,o,n):null;if(l&&c<l.cutLen)return!0;let u=t+2<i.length?_(a,o,i[t+2],n):null;return u!==null&&s-c<u.cutLen}e(u,`crossingSitsInRoundedCorner`);function d(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=s(r.points);for(let a=n+1;a<e.length;a++){let n=e[a],o=s(n.points);for(let[e,a]of i.entries())for(let[i,s]of o.entries()){let o=c(a.a,a.b,s.a,s.b);if(!o||u(r,e,o.tA)||u(n,i,o.tB))continue;let d=l(a);d!==l(s)&&d?t.push({jumpEdgeId:r.id,otherEdgeId:n.id,segIndex:e,t:o.tA,point:o.point}):t.push({jumpEdgeId:n.id,otherEdgeId:r.id,segIndex:i,t:o.tB,point:o.point})}}}return t}e(d,`findEdgeIntersections`);function f(e){return`${Math.round(e*1e3)/1e3}`}e(f,`fmt`);function p(e){return`${f(e.x)},${f(e.y)}`}e(p,`pointToString`);function m(e){let t=e.b.x-e.a.x,n=e.b.y-e.a.y;return Math.abs(t)>=Math.abs(n)?+(t>=0):+(n>=0)}e(m,`getArcSweepFlag`);function h(e,n){if(e.length<2)return e.map(e=>({...e}));let r=e.map(e=>({...e})),i=n.arrowTypeStart&&t[n.arrowTypeStart];if(i){let t=e[0],n=e[1],a=Math.atan2(n.y-t.y,n.x-t.x);r[0].x=t.x+i*Math.cos(a),r[0].y=t.y+i*Math.sin(a)}let a=n.arrowTypeEnd&&t[n.arrowTypeEnd];if(a){let t=e.length,n=e[t-2],i=e[t-1],o=Math.atan2(i.y-n.y,i.x-n.x);r[t-1].x=i.x-a*Math.cos(o),r[t-1].y=i.y-a*Math.sin(o)}return r}e(h,`applyMarkerOffsets`);function g(e,t,n,r,i){let a=e.point.x,o=e.point.y,s={x:a-t*e.r,y:o-n*e.r},c={x:a+t*e.r,y:o+n*e.r},l=[`L${p(s)}`];return i===`arc`?l.push(`A${f(e.r)},${f(e.r)} 0 0 ${r} ${p(c)}`):l.push(`M${p(c)}`),l}e(g,`emitJump`);function _(e,t,n,i){let a=t.x-e.x,o=t.y-e.y,s=n.x-t.x,c=n.y-t.y,l=Math.hypot(a,o),u=Math.hypot(s,c);if(l<r||u<r)return null;let d=a/l,f=o/l,p=s/u,m=c/u,h=d*p+f*m,g=Math.acos(Math.max(-1,Math.min(1,h)));if(g<r||Math.abs(Math.PI-g)<r)return null;let _=Math.min(i/Math.sin(g/2),l/2,u/2);return{startX:t.x-d*_,startY:t.y-f*_,endX:t.x+p*_,endY:t.y+m*_,ctrlX:t.x,ctrlY:t.y,cutLen:_}}e(_,`computeRoundedCorner`);function v(e,t,r){let o=e.points;if(o.length<2)return``;let c=h(o,e),l=e.curve===`rounded`,u=s(c),d=new Map;for(let e of t){let t=u[e.segIndex];if(!t)continue;let n=Math.hypot(t.b.x-t.a.x,t.b.y-t.a.y),i=d.get(e.segIndex)??[];i.push({t:e.t,point:e.point,d:e.t*n,r:r.jumpRadius}),d.set(e.segIndex,i)}let v=[`M${p(c[0])}`];for(let e=0;e<u.length;e++){let t=u[e],o=Math.hypot(t.b.x-t.a.x,t.b.y-t.a.y),s=o===0?0:(t.b.x-t.a.x)/o,h=o===0?0:(t.b.y-t.a.y)/o,y=m(t),b=0;if(l&&e>0){let t=_(c[e-1],c[e],c[e+1]??c[e],n);t&&(b=t.cutLen)}let x=o,S=null;l&&e<u.length-1&&(S=_(c[e],c[e+1],c[e+2]??c[e+1],n),S&&(x=o-S.cutLen));let C=r.jumpRadius*a,w=[...d.get(e)??[]].sort((e,t)=>e.t-t.t).filter(e=>{let t=Math.min(e.d-b,x-e.d)-i;return e.r=Math.min(e.r,t),e.r>=C});for(let e=0;e<w.length-1;e++){let t=w[e+1].d-w[e].d;if(w[e].r+w[e+1].r>t){let n=t/2;w[e].r=Math.min(w[e].r,n),w[e+1].r=Math.min(w[e+1].r,n)}}for(let e of w)e.r<C||v.push(...g(e,s,h,y,r.jumpStyle));l&&S?(v.push(`L${f(S.startX)},${f(S.startY)}`),v.push(`Q${f(S.ctrlX)},${f(S.ctrlY)} ${f(S.endX)},${f(S.endY)}`)):v.push(`L${p(t.b)}`)}return v.join(` `)}e(v,`rewriteEdgePath`);function y(e){return/^[\d\s+,.LMelm-]*$/.test(e)}e(y,`isStraightPath`);function b(e){return!e||e===`linear`||e===`rounded`||e===`step`||e===`stepBefore`||e===`stepAfter`}e(b,`curveSupportsLineHops`);function x(e){if(!e)return null;try{let t=typeof atob==`function`?atob(e):Buffer.from(e,`base64`).toString(),n=JSON.parse(t);if(!Array.isArray(n))return null;let r=[];for(let e of n)e&&typeof e.x==`number`&&typeof e.y==`number`&&r.push({x:e.x,y:e.y});return r.length>=2?r:null}catch{return null}}e(x,`decodeDataPoints`);function S(e,t,n){if(!n.enabled)return;let r=e.node();if(!r)return;let i=new Map;for(let e of t)i.set(e.id,e);let a=new Map;for(let e of r.querySelectorAll(`path[data-id]`)){let t=e.getAttribute(`data-id`);t!==null&&!a.has(t)&&a.set(t,e)}let o=[];for(let e of t){let t=a.get(e.id);if(!t)continue;let n=x(t.getAttribute(`data-points`))??e.points;o.push({...e,points:n})}let s=d(o);if(s.length===0)return;let c=new Map;for(let e of s){let t=c.get(e.jumpEdgeId)??[];t.push(e),c.set(e.jumpEdgeId,t)}for(let e of o){let t=c.get(e.id);if(!t||t.length===0)continue;let r=i.get(e.id)?.curve;if(r!==void 0&&!b(r))continue;let o=a.get(e.id);if(!o||r===void 0&&!y(o.getAttribute(`d`)??``))continue;let s=o.getAttribute(`style`)??``,l=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(s),u=l?Number.parseFloat(l[1]):null,d=l?Number.parseFloat(l[2]):null,f=v(e,t,n);if(o.setAttribute(`d`,f),u!==null&&d!==null&&typeof o.getTotalLength==`function`){let e=o.getTotalLength(),t=`0 ${u} ${Math.max(0,e-u-d)} ${d}`,n=s.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${t};`).replace(/;\s*;+/g,`;`);o.setAttribute(`style`,n)}}}e(S,`applyLineJumpsToSvg`);export{S as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-JH1jZ6Eh.js";import{c as n}from"./chunk-VPRB5NB3-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-JH1jZ6Eh.js";import{c as n}from"./chunk-VPRB5NB3-Dnr3edxV.js";var r=e((e,r,o,s)=>{e.attr(`class`,o);let{width:c,height:l,x:u,y:d}=i(e,r);n(e,l,c,s);let f=a(u,d,c,l,r);e.attr(`viewBox`,f),t.debug(`viewBox configured: ${f} with padding: ${r}`)},`setupViewPortForSVG`),i=e((e,t)=>{let n=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:n.width+t*2,height:n.height+t*2,x:n.x,y:n.y}},`calculateDimensionsWithPadding`),a=e((e,t,n,r,i)=>`${e-i} ${t-i} ${n} ${r}`,`createViewBox`);export{r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-JH1jZ6Eh.js";import{b as r,g as i,w as a}from"./chunk-VPRB5NB3-LAggcSji.js";import{n as o}from"./chunk-E2ZNV5FY-B3rGXPn-.js";import{a as s,i as c,t as l}from"./chunk-4EA7E6EY-CvEILf8c.js";import{s as u}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import{t as d}from"./rough.esm-Dy-Kn_BL.js";import{i as f,n as p,t as m}from"./chunk-XC4XBNZT-BksIPWQU.js";import{n as h}from"./chunk-DBDB3WZW-FCGrB-q8.js";var g=e(async(e,a)=>{let l=r(),{theme:p,themeVariables:m,handDrawnSeed:h}=l,{clusterBkg:g,clusterBorder:_,borderColorArray:v}=m,y=_,{labelStyles:b,nodeStyles:x,borderStyles:S,backgroundStyles:C}=c(a),w=e.insert(`g`).attr(`class`,`cluster swimlane `+(a.cssClasses||``)).attr(`id`,a.id).attr(`data-id`,a.id).attr(`data-et`,`cluster`).attr(`data-look`,a.look);u(w,a.colorIndex,p,v);let T=i(l.flowchart.htmlLabels),E=a.direction===`LR`,D=w.insert(`g`).attr(`class`,`cluster-label swimlane-label`),O=await o(D,a.label,{style:a.labelStyle,useHtmlLabels:T,isNode:!0,width:a.width}),k=O.getBBox();if(T){let e=O.children[0],t=n(O);k=e.getBoundingClientRect(),t.attr(`width`,k.width),t.attr(`height`,k.height)}let A=a.padding??0,j=a.width<=k.width+A?k.width+A:a.width;a.diff=a.width<=k.width+A?(j-a.width)/2-A:-A;let M=a.height,N=a.y-M/2,P=a.y+M/2,F=a.x-j/2,I=a.swimlaneContentTop===void 0?N+M/3:a.swimlaneContentTop,L=E?4:0,R=k.height+2*L,z,B;if(E){let e=Math.max(R,k.height+2*L),t=F+e,n=Math.max(0,j-e);if(a.look===`handDrawn`){let r=d.svg(w),i=s(a,{roughness:.7,fill:g,stroke:y,seed:h}),o=s(a,{roughness:.7,fill:`none`,stroke:y,seed:h}),c=r.rectangle(F,N,e,M,i);z=w.insert(()=>c,`:first-child`).attr(`class`,`swimlane-title`);let l=r.rectangle(t,N,n,M,o);B=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,F).attr(`y`,N).attr(`width`,e).attr(`height`,M).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,t).attr(`y`,N).attr(`width`,n).attr(`height`,M).attr(`fill`,`none`).attr(`stroke`,y);let r=F+e/2,i=a.y;D.attr(`transform`,`translate(${r}, ${i}) rotate(-90) translate(${-k.width/2}, ${-k.height/2})`)}else{let e=Math.max(0,I-N),t=Math.min(R,e),n=N+t,r=Math.max(0,P-n),i=a.x-j/2;if(a.look===`handDrawn`){let e=d.svg(w),o=s(a,{roughness:.7,fill:g,stroke:y,fillWeight:3,seed:h}),c=s(a,{roughness:.7,fill:`none`,stroke:y,seed:h}),l=e.rectangle(i,N,j,t,o);z=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-title`);let u=e.rectangle(i,n,j,r,c);B=w.insert(()=>u,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,i).attr(`y`,N).attr(`width`,j).attr(`height`,t).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,i).attr(`y`,n).attr(`width`,j).attr(`height`,r).attr(`fill`,`none`).attr(`stroke`,y);let o=a.x-k.width/2,c=N+(t-k.height)/2;D.attr(`transform`,`translate(${o}, ${c})`)}if(t.trace(`Swimlane data `,a,JSON.stringify(a)),b){let e=D.select(`span`);e&&e.attr(`style`,b)}return a.offsetX=0,a.width=j,a.height=M,a.offsetY=k.height-A/2,a.intersect=function(e){return f(a,e)},{cluster:w,labelBBox:k}},`swimlane`),_=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let l=r(),{theme:g,themeVariables:_,handDrawnSeed:v}=l,{clusterBkg:y,clusterBorder:b,borderColorArray:x}=_,{labelStyles:S,nodeStyles:C,borderStyles:w,backgroundStyles:T}=c(i),E=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look);u(E,i.colorIndex,g,x);let D=a(l),O=E.insert(`g`).attr(`class`,`cluster-label `),k;k=i.labelType===`markdown`?await o(O,i.label,{style:i.labelStyle,useHtmlLabels:D,isNode:!0,width:i.width}):await m(O,i.label,i.labelStyle||``,!1,!0);let A=k.getBBox();if(a(l)){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let j=i.width<=A.width+i.padding?A.width+i.padding:i.width;i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let M=i.height,N=i.x-j/2,P=i.y-M/2;t.trace(`Data `,i,JSON.stringify(i));let F;if(i.look===`handDrawn`){let e=d.svg(E),n=s(i,{roughness:.7,fill:y,stroke:b,fillWeight:3,seed:v}),r=e.path(p(N,P,j,M,0),n);F=E.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),F.select(`path:nth-child(2)`).attr(`style`,w.join(`;`)),F.select(`path`).attr(`style`,T.join(`;`).replace(`fill`,`stroke`))}else F=E.insert(`rect`,`:first-child`),F.attr(`style`,C).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,N).attr(`y`,P).attr(`width`,j).attr(`height`,M);let{subGraphTitleTopMargin:I}=h(l);if(O.attr(`transform`,`translate(${i.x-A.width/2}, ${i.y-i.height/2+I})`),S){let e=O.select(`span`);e&&e.attr(`style`,S)}let L=F.node().getBBox();return i.offsetX=0,i.width=L.width,i.height=L.height,i.offsetY=A.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:E,labelBBox:A}},`rect`),v=e((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.domId),r=n.insert(`rect`,`:first-child`),i=0*t.padding,a=i/2;r.attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,t.x-t.width/2-a).attr(`y`,t.y-t.height/2-a).attr(`width`,t.width+i).attr(`height`,t.height+i).attr(`fill`,`none`);let o=r.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(e){return f(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),y=e(async(e,t)=>{let i=r(),{theme:o,themeVariables:s,handDrawnSeed:c}=i,{altBackground:l,borderColorArray:h,compositeBackground:g,compositeTitleBackground:_,nodeBorder:v}=s,y=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-id`,t.id).attr(`data-look`,t.look);u(y,t.colorIndex,o,h);let b=y.insert(`g`,`:first-child`),x=y.insert(`g`).attr(`class`,`cluster-label`),S=y.append(`rect`),C=await m(x,t.label,t.labelStyle,void 0,!0),w=C.getBBox();if(a(i)){let e=C.children[0],t=n(C);w=e.getBoundingClientRect(),t.attr(`width`,w.width),t.attr(`height`,w.height)}let T=0*t.padding,E=T/2,D=(t.width<=w.width+t.padding?w.width+t.padding:t.width)+T;t.diff=t.width<=w.width+t.padding?(D-t.width)/2-t.padding:-t.padding;let O=t.height+T,k=t.height+T-w.height-6,A=t.x-D/2,j=t.y-O/2;t.width=D;let M=t.y-t.height/2-E+w.height+2,N;if(t.look===`handDrawn`){let e=t.cssClasses.includes(`statediagram-cluster-alt`),n=d.svg(y),r=t.rx||t.ry?n.path(p(A,j,D,O,10),{roughness:.7,fill:_,fillStyle:`solid`,stroke:v,seed:c}):n.rectangle(A,j,D,O,{seed:c});N=y.insert(()=>r,`:first-child`);let i=n.rectangle(A,M,D,k,{fill:e?l:g,fillStyle:e?`hachure`:`solid`,stroke:v,seed:c});N=y.insert(()=>r,`:first-child`),S=y.insert(()=>i),N.attr(`class`,`outer`),S.attr(`class`,`inner`)}else N=b.insert(`rect`,`:first-child`),N.attr(`class`,`outer`).attr(`x`,A).attr(`y`,j).attr(`width`,D).attr(`height`,O).attr(`data-look`,t.look),S.attr(`class`,`inner`).attr(`x`,A).attr(`y`,M).attr(`width`,D).attr(`height`,k);return x.attr(`transform`,`translate(${t.x-w.width/2}, ${j+1-(a(i)?0:3)})`),t.height=N.node().getBBox().height,t.offsetX=0,t.offsetY=w.height-t.padding/2,t.labelBBox=w,t.intersect=function(e){return f(t,e)},{cluster:y,labelBBox:w}},`roundedWithTitle`),b=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let l=r(),{themeVariables:u,handDrawnSeed:m}=l,{clusterBkg:g,clusterBorder:_}=u,{labelStyles:v,nodeStyles:y,borderStyles:b,backgroundStyles:x}=c(i),S=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look),C=a(l),w=S.insert(`g`).attr(`class`,`cluster-label `),T=await o(w,i.label,{style:i.labelStyle,useHtmlLabels:C,isNode:!0,width:i.width}),E=T.getBBox();if(a(l)){let e=T.children[0],t=n(T);E=e.getBoundingClientRect(),t.attr(`width`,E.width),t.attr(`height`,E.height)}let D=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(D-i.width)/2-i.padding:-i.padding;let O=i.height,k=i.x-D/2,A=i.y-O/2;t.trace(`Data `,i,JSON.stringify(i));let j;if(i.look===`handDrawn`){let e=d.svg(S),n=s(i,{roughness:.7,fill:g,stroke:_,fillWeight:4,seed:m}),r=e.path(p(k,A,D,O,i.rx),n);j=S.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),j.select(`path:nth-child(2)`).attr(`style`,b.join(`;`)),j.select(`path`).attr(`style`,x.join(`;`).replace(`fill`,`stroke`))}else j=S.insert(`rect`,`:first-child`),j.attr(`style`,y).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,k).attr(`y`,A).attr(`width`,D).attr(`height`,O);let{subGraphTitleTopMargin:M}=h(l);if(w.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+M})`),v){let e=w.select(`span`);e&&e.attr(`style`,v)}let N=j.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:S,labelBBox:E}},`kanbanSection`),x=e((e,t)=>{let{theme:n,themeVariables:i,handDrawnSeed:a}=r(),{altBackground:o,nodeBorder:s,borderColorArray:c}=i,l=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look);u(l,t.colorIndex,n,c);let p=l.insert(`g`,`:first-child`),m=0*t.padding,h=t.width+m;t.diff=-t.padding;let g=t.height+m,_=t.x-h/2,v=t.y-g/2;t.width=h;let y;if(t.look===`handDrawn`){let e=d.svg(l).rectangle(_,v,h,g,{fill:o??`#efefef`,fillStyle:`solid`,roughness:.5,strokeLineDash:[5],stroke:s,seed:a});y=l.insert(()=>e,`:first-child`).attr(`class`,`divider`)}else{y=p.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),y.attr(`class`,e).attr(`x`,_).attr(`y`,v).attr(`width`,h).attr(`height`,g).attr(`data-look`,t.look)}return t.height=y.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return f(t,e)},{cluster:l,labelBBox:{}}},`divider`),S=e(async(e,i,l)=>{t.info(`Creating ${l.cssClass} for `,i.id,i);let g=r(),{theme:_,themeVariables:v,handDrawnSeed:y}=g,{borderColorArray:b}=v,{labelStyles:x,borderStyles:S}=c(i),C=e.insert(`g`).attr(`class`,`cluster `+l.cssClass+` `+i.cssClasses).attr(`id`,i.domId??i.id).attr(`data-look`,i.look);u(C,i.colorIndex,_,b);let w=a(g),T=C.insert(`g`).attr(`class`,`cluster-label`),E={width:0,height:0},D=i.label?.trim();if(D){let e;if(e=i.labelType===`markdown`?await o(T,i.label,{style:i.labelStyle,useHtmlLabels:w,isNode:!0,width:i.width}):await m(T,i.label,i.labelStyle||``,!1,!0),E=e.getBBox(),w){let t=e.children[0],r=n(e);E=t.getBoundingClientRect(),r.attr(`width`,E.width),r.attr(`height`,E.height)}}let O=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(O-i.width)/2-i.padding:-i.padding;let k=i.height,A=i.x-O/2,j=i.y-k/2,M;if(i.look===`handDrawn`){let e=d.svg(C),t=s(i,{roughness:l.roughness,fill:l.fill,stroke:l.stroke,strokeWidth:l.strokeWidth,seed:y,...l.fill===`none`?{fillWeight:0}:{fillStyle:`solid`},...l.strokeDash?{strokeLineDash:l.strokeDash}:{}}),n=e.path(p(A,j,O,k,l.rx),t);M=C.insert(()=>n,`:first-child`),M.select(`path:nth-child(2)`).attr(`style`,S.join(`;`))}else M=C.insert(`rect`,`:first-child`),M.attr(`rx`,l.rx).attr(`ry`,l.rx).attr(`x`,A).attr(`y`,j).attr(`width`,O).attr(`height`,k).attr(`fill`,l.fill).attr(`stroke`,l.stroke).attr(`stroke-width`,l.strokeWidth+`px`),l.strokeDash&&M.attr(`stroke-dasharray`,l.strokeDash.join(`, `));if(D){let{subGraphTitleTopMargin:e}=h(g);if(T.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+e})`),x){let e=T.select(`span`);e&&e.attr(`style`,x)}}let N=M.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:C,labelBBox:E}},`createContainerGroup`),C=e(async(e,t)=>{let{themeVariables:n}=r();return S(e,t,{cssClass:`flow-cluster`,rx:10,fill:`none`,stroke:n.flowContainerStroke||n.secondaryBorderColor,strokeWidth:.75,roughness:.7})},`flowGroup`),w=e((e,t)=>{let n=e.boundaryType||`rect`,r=n===`package`?20:e.padding,i=n===`package`?t.height+10:0,a=Math.max(e.width,t.width+r),o=n===`package`?Math.max(e.height,i+e.padding*2):e.height,s=e.x-a/2,c=e.y-o/2;return{boundaryType:n,width:a,height:o,x:s,y:c,bodyY:c+i,bodyHeight:o-i,tabHeight:i,tabWidth:n===`package`?Math.min(a,Math.max(80,t.width+20)):0}},`getUsecaseSystemBoundaryGeometry`),T={rect:_,squareRect:_,roundedWithTitle:y,noteGroup:v,divider:x,kanbanSection:b,flowGroup:C,usecaseSystemBoundary:e(async(e,i)=>{t.info(`Creating usecase system boundary for `,i.id,i);let p=r(),{theme:m,themeVariables:g,handDrawnSeed:_}=p,{clusterBkg:v,clusterBorder:y,borderColorArray:b}=g,{labelStyles:x,nodeStyles:S}=c(i),{stylesMap:C}=l(i),T=i.boundaryType||`rect`,E=e.insert(`g`).attr(`class`,`cluster usecase-system-boundary usecase-system-boundary-${T} ${i.cssClasses}`).attr(`id`,typeof i.domId==`string`?i.domId:i.id).attr(`data-boundary-type`,T).attr(`data-look`,i.look);u(E,i.colorIndex,m,b);let D=a(p),O=E.insert(`g`).attr(`class`,`cluster-label system-boundary-title`),k=await o(O,i.label,{style:x,useHtmlLabels:D,isNode:!0}),A=k.getBBox();if(D){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let{width:j,height:M,x:N,y:P,bodyY:F,bodyHeight:I,tabHeight:L,tabWidth:R}=w(i,A);i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let z=s(i,{fill:C.get(`fill`)||v,stroke:C.get(`stroke`)||y,strokeWidth:C.get(`stroke-width`)?.replace(`px`,``)||1,seed:_});if(i.look===`handDrawn`){let e=d.svg(E),t=e.rectangle(N,F,j,I,z);if(E.insert(()=>t,`:first-child`).attr(`class`,`boundary-body label-container`),T===`package`){let t=e.rectangle(N,P,R,L,z);E.insert(()=>t,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`)}}else E.insert(`rect`,`:first-child`).attr(`class`,`boundary-body label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,F).attr(`width`,j).attr(`height`,I),T===`package`&&E.insert(`rect`,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,P).attr(`width`,R).attr(`height`,L);let{subGraphTitleTopMargin:B}=h(p);return T===`package`?O.attr(`transform`,`translate(${N+(R-A.width)/2}, ${P+(L-A.height)/2})`):O.attr(`transform`,`translate(${i.x-A.width/2}, ${P+B})`),x&&(O.attr(`style`,x),O.select(`span`).attr(`style`,x)),i.offsetX=0,i.width=j,i.height=M,i.offsetY=A.height-i.padding/2,i.labelBBox=A,i.intersect=function(e){return f(i,e)},{cluster:E,labelBBox:A}},`usecaseSystemBoundary`),swimlane:g},E=new Set([`noteGroup`,`divider`]),D=e(e=>!E.has(e??`rect`),`clusterPaintsTitle`),O=new Map,k=e(async(e,t)=>{let n=await T[t.shape||`rect`](e,t);return O.set(t.id,n),n},`insertCluster`),A=e(()=>{O=new Map},`clear`);export{D as n,k as r,A as t};
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-JH1jZ6Eh.js";import{b as r,g as i,w as a}from"./chunk-VPRB5NB3-Dnr3edxV.js";import{n as o}from"./chunk-E2ZNV5FY-DnKvxSiA.js";import{a as s,i as c,t as l}from"./chunk-4EA7E6EY-xRPCCZLU.js";import{s as u}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import{t as d}from"./rough.esm-Dy-Kn_BL.js";import{i as f,n as p,t as m}from"./chunk-XC4XBNZT-CIqGRxkD.js";import{n as h}from"./chunk-DBDB3WZW-BonEIRP2.js";var g=e(async(e,a)=>{let l=r(),{theme:p,themeVariables:m,handDrawnSeed:h}=l,{clusterBkg:g,clusterBorder:_,borderColorArray:v}=m,y=_,{labelStyles:b,nodeStyles:x,borderStyles:S,backgroundStyles:C}=c(a),w=e.insert(`g`).attr(`class`,`cluster swimlane `+(a.cssClasses||``)).attr(`id`,a.id).attr(`data-id`,a.id).attr(`data-et`,`cluster`).attr(`data-look`,a.look);u(w,a.colorIndex,p,v);let T=i(l.flowchart.htmlLabels),E=a.direction===`LR`,D=w.insert(`g`).attr(`class`,`cluster-label swimlane-label`),O=await o(D,a.label,{style:a.labelStyle,useHtmlLabels:T,isNode:!0,width:a.width}),k=O.getBBox();if(T){let e=O.children[0],t=n(O);k=e.getBoundingClientRect(),t.attr(`width`,k.width),t.attr(`height`,k.height)}let A=a.padding??0,j=a.width<=k.width+A?k.width+A:a.width;a.diff=a.width<=k.width+A?(j-a.width)/2-A:-A;let M=a.height,N=a.y-M/2,P=a.y+M/2,F=a.x-j/2,I=a.swimlaneContentTop===void 0?N+M/3:a.swimlaneContentTop,L=E?4:0,R=k.height+2*L,z,B;if(E){let e=Math.max(R,k.height+2*L),t=F+e,n=Math.max(0,j-e);if(a.look===`handDrawn`){let r=d.svg(w),i=s(a,{roughness:.7,fill:g,stroke:y,seed:h}),o=s(a,{roughness:.7,fill:`none`,stroke:y,seed:h}),c=r.rectangle(F,N,e,M,i);z=w.insert(()=>c,`:first-child`).attr(`class`,`swimlane-title`);let l=r.rectangle(t,N,n,M,o);B=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,F).attr(`y`,N).attr(`width`,e).attr(`height`,M).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,t).attr(`y`,N).attr(`width`,n).attr(`height`,M).attr(`fill`,`none`).attr(`stroke`,y);let r=F+e/2,i=a.y;D.attr(`transform`,`translate(${r}, ${i}) rotate(-90) translate(${-k.width/2}, ${-k.height/2})`)}else{let e=Math.max(0,I-N),t=Math.min(R,e),n=N+t,r=Math.max(0,P-n),i=a.x-j/2;if(a.look===`handDrawn`){let e=d.svg(w),o=s(a,{roughness:.7,fill:g,stroke:y,fillWeight:3,seed:h}),c=s(a,{roughness:.7,fill:`none`,stroke:y,seed:h}),l=e.rectangle(i,N,j,t,o);z=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-title`);let u=e.rectangle(i,n,j,r,c);B=w.insert(()=>u,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,i).attr(`y`,N).attr(`width`,j).attr(`height`,t).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,i).attr(`y`,n).attr(`width`,j).attr(`height`,r).attr(`fill`,`none`).attr(`stroke`,y);let o=a.x-k.width/2,c=N+(t-k.height)/2;D.attr(`transform`,`translate(${o}, ${c})`)}if(t.trace(`Swimlane data `,a,JSON.stringify(a)),b){let e=D.select(`span`);e&&e.attr(`style`,b)}return a.offsetX=0,a.width=j,a.height=M,a.offsetY=k.height-A/2,a.intersect=function(e){return f(a,e)},{cluster:w,labelBBox:k}},`swimlane`),_=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let l=r(),{theme:g,themeVariables:_,handDrawnSeed:v}=l,{clusterBkg:y,clusterBorder:b,borderColorArray:x}=_,{labelStyles:S,nodeStyles:C,borderStyles:w,backgroundStyles:T}=c(i),E=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look);u(E,i.colorIndex,g,x);let D=a(l),O=E.insert(`g`).attr(`class`,`cluster-label `),k;k=i.labelType===`markdown`?await o(O,i.label,{style:i.labelStyle,useHtmlLabels:D,isNode:!0,width:i.width}):await m(O,i.label,i.labelStyle||``,!1,!0);let A=k.getBBox();if(a(l)){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let j=i.width<=A.width+i.padding?A.width+i.padding:i.width;i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let M=i.height,N=i.x-j/2,P=i.y-M/2;t.trace(`Data `,i,JSON.stringify(i));let F;if(i.look===`handDrawn`){let e=d.svg(E),n=s(i,{roughness:.7,fill:y,stroke:b,fillWeight:3,seed:v}),r=e.path(p(N,P,j,M,0),n);F=E.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),F.select(`path:nth-child(2)`).attr(`style`,w.join(`;`)),F.select(`path`).attr(`style`,T.join(`;`).replace(`fill`,`stroke`))}else F=E.insert(`rect`,`:first-child`),F.attr(`style`,C).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,N).attr(`y`,P).attr(`width`,j).attr(`height`,M);let{subGraphTitleTopMargin:I}=h(l);if(O.attr(`transform`,`translate(${i.x-A.width/2}, ${i.y-i.height/2+I})`),S){let e=O.select(`span`);e&&e.attr(`style`,S)}let L=F.node().getBBox();return i.offsetX=0,i.width=L.width,i.height=L.height,i.offsetY=A.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:E,labelBBox:A}},`rect`),v=e((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.domId),r=n.insert(`rect`,`:first-child`),i=0*t.padding,a=i/2;r.attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,t.x-t.width/2-a).attr(`y`,t.y-t.height/2-a).attr(`width`,t.width+i).attr(`height`,t.height+i).attr(`fill`,`none`);let o=r.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(e){return f(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),y=e(async(e,t)=>{let i=r(),{theme:o,themeVariables:s,handDrawnSeed:c}=i,{altBackground:l,borderColorArray:h,compositeBackground:g,compositeTitleBackground:_,nodeBorder:v}=s,y=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-id`,t.id).attr(`data-look`,t.look);u(y,t.colorIndex,o,h);let b=y.insert(`g`,`:first-child`),x=y.insert(`g`).attr(`class`,`cluster-label`),S=y.append(`rect`),C=await m(x,t.label,t.labelStyle,void 0,!0),w=C.getBBox();if(a(i)){let e=C.children[0],t=n(C);w=e.getBoundingClientRect(),t.attr(`width`,w.width),t.attr(`height`,w.height)}let T=0*t.padding,E=T/2,D=(t.width<=w.width+t.padding?w.width+t.padding:t.width)+T;t.diff=t.width<=w.width+t.padding?(D-t.width)/2-t.padding:-t.padding;let O=t.height+T,k=t.height+T-w.height-6,A=t.x-D/2,j=t.y-O/2;t.width=D;let M=t.y-t.height/2-E+w.height+2,N;if(t.look===`handDrawn`){let e=t.cssClasses.includes(`statediagram-cluster-alt`),n=d.svg(y),r=t.rx||t.ry?n.path(p(A,j,D,O,10),{roughness:.7,fill:_,fillStyle:`solid`,stroke:v,seed:c}):n.rectangle(A,j,D,O,{seed:c});N=y.insert(()=>r,`:first-child`);let i=n.rectangle(A,M,D,k,{fill:e?l:g,fillStyle:e?`hachure`:`solid`,stroke:v,seed:c});N=y.insert(()=>r,`:first-child`),S=y.insert(()=>i),N.attr(`class`,`outer`),S.attr(`class`,`inner`)}else N=b.insert(`rect`,`:first-child`),N.attr(`class`,`outer`).attr(`x`,A).attr(`y`,j).attr(`width`,D).attr(`height`,O).attr(`data-look`,t.look),S.attr(`class`,`inner`).attr(`x`,A).attr(`y`,M).attr(`width`,D).attr(`height`,k);return x.attr(`transform`,`translate(${t.x-w.width/2}, ${j+1-(a(i)?0:3)})`),t.height=N.node().getBBox().height,t.offsetX=0,t.offsetY=w.height-t.padding/2,t.labelBBox=w,t.intersect=function(e){return f(t,e)},{cluster:y,labelBBox:w}},`roundedWithTitle`),b=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let l=r(),{themeVariables:u,handDrawnSeed:m}=l,{clusterBkg:g,clusterBorder:_}=u,{labelStyles:v,nodeStyles:y,borderStyles:b,backgroundStyles:x}=c(i),S=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look),C=a(l),w=S.insert(`g`).attr(`class`,`cluster-label `),T=await o(w,i.label,{style:i.labelStyle,useHtmlLabels:C,isNode:!0,width:i.width}),E=T.getBBox();if(a(l)){let e=T.children[0],t=n(T);E=e.getBoundingClientRect(),t.attr(`width`,E.width),t.attr(`height`,E.height)}let D=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(D-i.width)/2-i.padding:-i.padding;let O=i.height,k=i.x-D/2,A=i.y-O/2;t.trace(`Data `,i,JSON.stringify(i));let j;if(i.look===`handDrawn`){let e=d.svg(S),n=s(i,{roughness:.7,fill:g,stroke:_,fillWeight:4,seed:m}),r=e.path(p(k,A,D,O,i.rx),n);j=S.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),j.select(`path:nth-child(2)`).attr(`style`,b.join(`;`)),j.select(`path`).attr(`style`,x.join(`;`).replace(`fill`,`stroke`))}else j=S.insert(`rect`,`:first-child`),j.attr(`style`,y).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,k).attr(`y`,A).attr(`width`,D).attr(`height`,O);let{subGraphTitleTopMargin:M}=h(l);if(w.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+M})`),v){let e=w.select(`span`);e&&e.attr(`style`,v)}let N=j.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:S,labelBBox:E}},`kanbanSection`),x=e((e,t)=>{let{theme:n,themeVariables:i,handDrawnSeed:a}=r(),{altBackground:o,nodeBorder:s,borderColorArray:c}=i,l=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look);u(l,t.colorIndex,n,c);let p=l.insert(`g`,`:first-child`),m=0*t.padding,h=t.width+m;t.diff=-t.padding;let g=t.height+m,_=t.x-h/2,v=t.y-g/2;t.width=h;let y;if(t.look===`handDrawn`){let e=d.svg(l).rectangle(_,v,h,g,{fill:o??`#efefef`,fillStyle:`solid`,roughness:.5,strokeLineDash:[5],stroke:s,seed:a});y=l.insert(()=>e,`:first-child`).attr(`class`,`divider`)}else{y=p.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),y.attr(`class`,e).attr(`x`,_).attr(`y`,v).attr(`width`,h).attr(`height`,g).attr(`data-look`,t.look)}return t.height=y.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return f(t,e)},{cluster:l,labelBBox:{}}},`divider`),S=e(async(e,i,l)=>{t.info(`Creating ${l.cssClass} for `,i.id,i);let g=r(),{theme:_,themeVariables:v,handDrawnSeed:y}=g,{borderColorArray:b}=v,{labelStyles:x,borderStyles:S}=c(i),C=e.insert(`g`).attr(`class`,`cluster `+l.cssClass+` `+i.cssClasses).attr(`id`,i.domId??i.id).attr(`data-look`,i.look);u(C,i.colorIndex,_,b);let w=a(g),T=C.insert(`g`).attr(`class`,`cluster-label`),E={width:0,height:0},D=i.label?.trim();if(D){let e;if(e=i.labelType===`markdown`?await o(T,i.label,{style:i.labelStyle,useHtmlLabels:w,isNode:!0,width:i.width}):await m(T,i.label,i.labelStyle||``,!1,!0),E=e.getBBox(),w){let t=e.children[0],r=n(e);E=t.getBoundingClientRect(),r.attr(`width`,E.width),r.attr(`height`,E.height)}}let O=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(O-i.width)/2-i.padding:-i.padding;let k=i.height,A=i.x-O/2,j=i.y-k/2,M;if(i.look===`handDrawn`){let e=d.svg(C),t=s(i,{roughness:l.roughness,fill:l.fill,stroke:l.stroke,strokeWidth:l.strokeWidth,seed:y,...l.fill===`none`?{fillWeight:0}:{fillStyle:`solid`},...l.strokeDash?{strokeLineDash:l.strokeDash}:{}}),n=e.path(p(A,j,O,k,l.rx),t);M=C.insert(()=>n,`:first-child`),M.select(`path:nth-child(2)`).attr(`style`,S.join(`;`))}else M=C.insert(`rect`,`:first-child`),M.attr(`rx`,l.rx).attr(`ry`,l.rx).attr(`x`,A).attr(`y`,j).attr(`width`,O).attr(`height`,k).attr(`fill`,l.fill).attr(`stroke`,l.stroke).attr(`stroke-width`,l.strokeWidth+`px`),l.strokeDash&&M.attr(`stroke-dasharray`,l.strokeDash.join(`, `));if(D){let{subGraphTitleTopMargin:e}=h(g);if(T.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+e})`),x){let e=T.select(`span`);e&&e.attr(`style`,x)}}let N=M.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:C,labelBBox:E}},`createContainerGroup`),C=e(async(e,t)=>{let{themeVariables:n}=r();return S(e,t,{cssClass:`flow-cluster`,rx:10,fill:`none`,stroke:n.flowContainerStroke||n.secondaryBorderColor,strokeWidth:.75,roughness:.7})},`flowGroup`),w=e((e,t)=>{let n=e.boundaryType||`rect`,r=n===`package`?20:e.padding,i=n===`package`?t.height+10:0,a=Math.max(e.width,t.width+r),o=n===`package`?Math.max(e.height,i+e.padding*2):e.height,s=e.x-a/2,c=e.y-o/2;return{boundaryType:n,width:a,height:o,x:s,y:c,bodyY:c+i,bodyHeight:o-i,tabHeight:i,tabWidth:n===`package`?Math.min(a,Math.max(80,t.width+20)):0}},`getUsecaseSystemBoundaryGeometry`),T={rect:_,squareRect:_,roundedWithTitle:y,noteGroup:v,divider:x,kanbanSection:b,flowGroup:C,usecaseSystemBoundary:e(async(e,i)=>{t.info(`Creating usecase system boundary for `,i.id,i);let p=r(),{theme:m,themeVariables:g,handDrawnSeed:_}=p,{clusterBkg:v,clusterBorder:y,borderColorArray:b}=g,{labelStyles:x,nodeStyles:S}=c(i),{stylesMap:C}=l(i),T=i.boundaryType||`rect`,E=e.insert(`g`).attr(`class`,`cluster usecase-system-boundary usecase-system-boundary-${T} ${i.cssClasses}`).attr(`id`,typeof i.domId==`string`?i.domId:i.id).attr(`data-boundary-type`,T).attr(`data-look`,i.look);u(E,i.colorIndex,m,b);let D=a(p),O=E.insert(`g`).attr(`class`,`cluster-label system-boundary-title`),k=await o(O,i.label,{style:x,useHtmlLabels:D,isNode:!0}),A=k.getBBox();if(D){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let{width:j,height:M,x:N,y:P,bodyY:F,bodyHeight:I,tabHeight:L,tabWidth:R}=w(i,A);i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let z=s(i,{fill:C.get(`fill`)||v,stroke:C.get(`stroke`)||y,strokeWidth:C.get(`stroke-width`)?.replace(`px`,``)||1,seed:_});if(i.look===`handDrawn`){let e=d.svg(E),t=e.rectangle(N,F,j,I,z);if(E.insert(()=>t,`:first-child`).attr(`class`,`boundary-body label-container`),T===`package`){let t=e.rectangle(N,P,R,L,z);E.insert(()=>t,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`)}}else E.insert(`rect`,`:first-child`).attr(`class`,`boundary-body label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,F).attr(`width`,j).attr(`height`,I),T===`package`&&E.insert(`rect`,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,P).attr(`width`,R).attr(`height`,L);let{subGraphTitleTopMargin:B}=h(p);return T===`package`?O.attr(`transform`,`translate(${N+(R-A.width)/2}, ${P+(L-A.height)/2})`):O.attr(`transform`,`translate(${i.x-A.width/2}, ${P+B})`),x&&(O.attr(`style`,x),O.select(`span`).attr(`style`,x)),i.offsetX=0,i.width=j,i.height=M,i.offsetY=A.height-i.padding/2,i.labelBBox=A,i.intersect=function(e){return f(i,e)},{cluster:E,labelBBox:A}},`usecaseSystemBoundary`),swimlane:g},E=new Set([`noteGroup`,`divider`]),D=e(e=>!E.has(e??`rect`),`clusterPaintsTitle`),O=new Map,k=e(async(e,t)=>{let n=await T[t.shape||`rect`](e,t);return O.set(t.id,n),n},`insertCluster`),A=e(()=>{O=new Map},`clear`);export{D as n,k as r,A as t};
|