@kabmo-labs/kabmo 0.47.0 → 0.48.0
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/dist/client/index.html +1 -1
- package/dist/client/index.js +497 -497
- package/dist/client/static/js/Body-3tspyjtk.js +3 -0
- package/dist/client/static/js/{CsvGrid-vfgttmym.js → CsvGrid-3pwsfmxp.js} +2 -2
- package/dist/client/static/js/{DocxView-dc41t6rp.js → DocxView-xcg9jktb.js} +3 -3
- package/dist/client/static/js/{DrawioView-wpwr38d9.js → DrawioView-2q19tgkx.js} +2 -2
- package/dist/client/static/js/{HtmlPreview-23n7t5cs.js → HtmlPreview-92cadvbr.js} +1 -1
- package/dist/client/static/js/ImageView-pr4h38hb.js +1 -0
- package/dist/client/static/js/LayoutWrapper-n4tzhjes.js +2 -0
- package/dist/client/static/js/MergeDiffView-0t15nh9f.js +1 -0
- package/dist/client/static/js/{Modal-dsqhas10.js → Modal-77hgx4dw.js} +20 -20
- package/dist/client/static/js/{PdfView-cpvsbfk0.js → PdfView-gzxhvxe8.js} +1 -1
- package/dist/client/static/js/{SessionsView-s0crtcm8.js → SessionsView-2tdqrvk0.js} +1 -1
- package/dist/client/static/js/{SheetView-n6mst0hq.js → SheetView-w5w2m2de.js} +21 -21
- package/dist/client/static/js/{SvgPreview-g2aqq812.js → SvgPreview-mtk6de6h.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-3vac8sq4.js → abnfDiagram-O67JEVCF-tha4j2fn.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-zs15nydj.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-1nh4htz2.js → architectureDiagram-NJMV4G6O-heep78p6.js} +6 -6
- package/dist/client/static/js/{astro-63zcysj7.js → astro-r4dp34pw.js} +1 -1
- package/dist/client/static/js/bash-8d3wrx5c.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-62z6kaar.js → blockDiagram-BEXU5L5S-6mzgfqh8.js} +5 -5
- package/dist/client/static/js/c-rn3z0csz.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-rts5zgx4.js → c4Diagram-YGBWAQC7-sfkcw7g9.js} +4 -4
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-tnpww186.js → classDiagram-v2-NBCMYWYE-v530ny5e.js} +6 -6
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-8vsjbzwa.js → cose-bilkent-JH36ORCC-ybv1ttbx.js} +1 -1
- package/dist/client/static/js/cpp-99ws9nak.js +1 -0
- package/dist/client/static/js/css-narcr42w.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-p3y1b4ap.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-005gc8km.js → cynefinDiagram-VND7K2PF-k8f3z0mm.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-41zsteyd.js → dagre-6A5THRUB-gk0gp124.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-prsm18a1.js → diagram-22UHCM2B-2zh2957c.js} +15 -15
- package/dist/client/static/js/{diagram-3UASUU5V-5nx9wf04.js → diagram-3UASUU5V-bzstt5e2.js} +2 -2
- package/dist/client/static/js/{diagram-ATOU4E4O-k3d4z3aq.js → diagram-ATOU4E4O-16adx4g0.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-x2c5x5j2.js → diagram-CDSNMT55-1ja98ens.js} +5 -5
- package/dist/client/static/js/{diagram-MLGK6HIB-nvr76jqh.js → diagram-MLGK6HIB-f9nnyjbq.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-v1jpzp9p.js → diagram-MPIPVDR6-3qgadfjz.js} +2 -2
- package/dist/client/static/js/{dockerfile-vz6va73h.js → dockerfile-04tc68pq.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-0v4tqr9v.js → ebnfDiagram-ZINNZB2B-022cz603.js} +1 -1
- package/dist/client/static/js/{elixir-80wq7gak.js → elixir-61gbjv6c.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-qfn4r7xj.js → elk-276RUBZZ-2anf1c36.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-cd667n9f.js → erDiagram-OPXOYQCR-ndd27fz1.js} +7 -7
- package/dist/client/static/js/{erlang-vk66vt7q.js → erlang-bh5cbm8m.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-sx2cwkz3.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-dsc17mty.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-ps0h3drm.js → ganttDiagram-FUAMR5RP-9gm6hkgn.js} +4 -4
- package/dist/client/static/js/gitGraph-4MIJSDKK-yqhbscsd.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-fts23jer.js → gitGraphDiagram-X574FWY7-78bxa67c.js} +8 -8
- package/dist/client/static/js/graphql-tr0jcndy.js +1 -0
- package/dist/client/static/js/html-n8fdvrdk.js +1 -0
- package/dist/client/static/js/index-0e51wknc.js +10 -0
- package/dist/client/static/js/{index-7zedprz3.js → index-13g17wa3.js} +1 -1
- package/dist/client/static/js/index-1hb8fvw9.js +1 -0
- package/dist/client/static/js/{index-1c2jvnyh.js → index-2bsnywea.js} +2 -2
- package/dist/client/static/js/{index-9ab6xaxd.js → index-2n1fgpjv.js} +2 -2
- package/dist/client/static/js/{index-a4h5np9r.js → index-30a8py59.js} +2 -2
- package/dist/client/static/js/{index-e5j5gc4h.js → index-34aq5bz5.js} +2 -2
- package/dist/client/static/js/index-3en15m75.js +2 -0
- package/dist/client/static/js/{index-64p1dncg.js → index-417fbrqk.js} +2 -2
- package/dist/client/static/js/{index-z4530r3c.js → index-45p59fxq.js} +2 -2
- package/dist/client/static/js/index-4n7t26ap.js +2 -0
- package/dist/client/static/js/{index-1whzs9kb.js → index-55pqvh82.js} +2 -2
- package/dist/client/static/js/index-5mpv57fn.js +12 -0
- package/dist/client/static/js/{index-tqgj7rd9.js → index-7pz6n3pg.js} +2 -2
- package/dist/client/static/js/{index-4jzsr1ky.js → index-7whstwc7.js} +2 -2
- package/dist/client/static/js/index-869vdnz8.js +2 -0
- package/dist/client/static/js/{index-52nd4hgm.js → index-8tvrzce0.js} +2 -2
- package/dist/client/static/js/index-9a78xmkk.js +462 -0
- package/dist/client/static/js/{index-33qxg79j.js → index-a58rkn3f.js} +5 -5
- package/dist/client/static/js/{index-9xsf8162.js → index-aa3hmn6j.js} +65 -65
- package/dist/client/static/js/{index-dxkefysk.js → index-aabp7nt6.js} +1 -1
- package/dist/client/static/js/{index-c5hjht5e.js → index-abrrqhne.js} +2 -2
- package/dist/client/static/js/{index-an2wv33f.js → index-ac2q5903.js} +2 -2
- package/dist/client/static/js/index-axtm1aq8.js +2 -0
- package/dist/client/static/js/index-b2cs4c51.js +4 -0
- package/dist/client/static/js/{index-xk1cqjkn.js → index-c250nzm1.js} +3 -3
- package/dist/client/static/js/{index-56rtb871.js → index-dxnkwf39.js} +52 -52
- package/dist/client/static/js/{index-39d8zbkx.js → index-e6ny4gd9.js} +6 -6
- package/dist/client/static/js/index-ebf50mrs.js +9 -0
- package/dist/client/static/js/{index-g4kkapka.js → index-ep6bqcmg.js} +2 -2
- package/dist/client/static/js/{index-396r53n0.js → index-fb2s080r.js} +2 -2
- package/dist/client/static/js/index-fryp0kgf.js +2 -0
- package/dist/client/static/js/{index-evmcc5qh.js → index-g3rg6vsd.js} +2 -2
- package/dist/client/static/js/{index-sa1675y0.js → index-g8rpydkr.js} +2 -2
- package/dist/client/static/js/{index-zhjjpvcc.js → index-gkmn4y1v.js} +1 -1
- package/dist/client/static/js/{index-0dkc6z8e.js → index-gpmcth0x.js} +2 -2
- package/dist/client/static/js/{index-62jgcgfd.js → index-hcmhdpp4.js} +10 -10
- package/dist/client/static/js/{index-fxd8dfj4.js → index-he4k2j91.js} +2 -2
- package/dist/client/static/js/{index-x0xspam4.js → index-hq28918s.js} +2 -2
- package/dist/client/static/js/{index-c63qyysm.js → index-hwzxdwwg.js} +1 -1
- package/dist/client/static/js/{index-4wnzs76g.js → index-jnkc9p53.js} +1 -1
- package/dist/client/static/js/{index-54mkp2r2.js → index-k39be93q.js} +1 -1
- package/dist/client/static/js/{index-y6ke70e6.js → index-kaxvwh07.js} +2 -2
- package/dist/client/static/js/{index-7zeah164.js → index-kjr68pcj.js} +2 -2
- package/dist/client/static/js/{index-cra9mgkq.js → index-m0fatq7c.js} +4 -4
- package/dist/client/static/js/{index-ccgzzydx.js → index-m39gbcxn.js} +1 -1
- package/dist/client/static/js/{index-q4ke39rh.js → index-mqzgf7rw.js} +2 -2
- package/dist/client/static/js/{index-dzeyd153.js → index-pzsp1src.js} +2 -2
- package/dist/client/static/js/{index-n1yr4khe.js → index-qe0vfv6s.js} +1 -1
- package/dist/client/static/js/{index-6009v8jf.js → index-qek9mt5w.js} +1 -1
- package/dist/client/static/js/{index-nkahe229.js → index-qxzj780x.js} +2 -2
- package/dist/client/static/js/{index-cvyqp8nz.css → index-rgxg0azs.css} +1 -1
- package/dist/client/static/js/{index-1d8bxjsz.js → index-rq4dk4tp.js} +4 -4
- package/dist/client/static/js/{index-6d6hxwb5.js → index-seekt5k3.js} +2 -2
- package/dist/client/static/js/{index-gzkzwgzv.js → index-sng4prpr.js} +2 -2
- package/dist/client/static/js/{index-dyc886cc.js → index-t4s10406.js} +2 -2
- package/dist/client/static/js/{index-f2ahkev0.js → index-tzz5gp8a.js} +5 -5
- package/dist/client/static/js/index-vnv9z0a1.js +1 -0
- package/dist/client/static/js/{index-70g527sb.js → index-x7rajphe.js} +2 -2
- package/dist/client/static/js/{index-5f4b44ay.js → index-xny7vsfz.js} +2 -2
- package/dist/client/static/js/index-xr4hjv01.js +2 -0
- package/dist/client/static/js/{index-fjex1y0t.js → index-ya9yqj5w.js} +2 -2
- package/dist/client/static/js/{index-z0fkfphe.js → index-zcgqacvx.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-0sd3zzgg.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-88qbtpq5.js → infoDiagram-VRGFBTTK-bxk0g0pe.js} +2 -2
- package/dist/client/static/js/ini-tnaw7zjy.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-s8bagk00.js → ishikawaDiagram-OU5B5YK6-d1kdkhth.js} +3 -3
- package/dist/client/static/js/java-m4dpc2vw.js +1 -0
- package/dist/client/static/js/javascript-8y26t991.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-hz8z0b9x.js → journeyDiagram-ZHPQQLJL-cahg3zjq.js} +4 -4
- package/dist/client/static/js/json-azm7bdqd.js +1 -0
- package/dist/client/static/js/jsx-p9j1k773.js +1 -0
- package/dist/client/static/js/{julia-dm0j9apa.js → julia-2n5k898q.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-sjjnjb51.js → kanban-definition-PNTS6WVX-nq7t83en.js} +6 -6
- package/dist/client/static/js/lua-hbm9rhz9.js +1 -0
- package/dist/client/static/js/markdown-tk3cd3vs.js +1 -0
- package/dist/client/static/js/{mermaid.core-zvwygxbh.js → mermaid.core-6nw0853j.js} +8 -8
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-kgj8enan.js → mindmap-definition-NLK3R4M7-cm7ykxf2.js} +3 -3
- package/dist/client/static/js/one-dark-pro-2cdc2nk7.js +1 -0
- package/dist/client/static/js/one-light-bt6z4jf0.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-13w2v5bb.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-gxzw1qwa.js → pegDiagram-GJSIUBJH-xwxz8nsq.js} +1 -1
- package/dist/client/static/js/{perl-4jcm2jxv.js → perl-66vb5pz7.js} +1 -1
- package/dist/client/static/js/{php-q32mec74.js → php-4e9we8am.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-swtnysgn.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-pdqwyqcm.js → pieDiagram-5QR66LMP-n910k9th.js} +3 -3
- package/dist/client/static/js/properties-6911ckw7.js +1 -0
- package/dist/client/static/js/python-44cvj250.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-yx2t364p.js → quadrantDiagram-O4NWA36T-dxkwxbqb.js} +6 -6
- package/dist/client/static/js/r-t3sepzm4.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-vtvxkx55.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-5sp2d63r.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-kg706fan.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-4ra1gzx5.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-hms3zpjm.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-800fdzkr.js → railroadDiagram-XR7U4H2S-xb1smt7r.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-vc5rpgtm.js → requirementDiagram-PLB6GJNP-6kb21b9f.js} +6 -6
- package/dist/client/static/js/{ruby-npmpb290.js → ruby-v7nmcvyr.js} +1 -1
- package/dist/client/static/js/{rust-waks43wh.js → rust-5ersd7be.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-ccjk8zgn.js → sankeyDiagram-IPEJSGJF-74z0fskw.js} +4 -4
- package/dist/client/static/js/{sass-502a4r7y.js → sass-h3nvy4c8.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-c0tk7gfn.js → sequenceDiagram-PO4LG4MO-apn6kezn.js} +17 -17
- package/dist/client/static/js/{sizeCapture-INFHLROL-fma9p1vy.js → sizeCapture-INFHLROL-2drzcjb8.js} +1 -1
- package/dist/client/static/js/sql-zdkawqx3.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-d8f24b7j.js → stateDiagram-v2-GCMORJYK-ma09vhby.js} +3 -3
- package/dist/client/static/js/{svelte-c15d0421.js → svelte-dhspkgss.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-sdt7qy36.js → swimlanes-2SLR337P-f6y9xqnx.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-3dwas56m.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-rv8qyr8b.js → timeline-definition-EJHVYXUP-zmcmvq00.js} +5 -5
- package/dist/client/static/js/treeView-Q6P3EWNA-7t5k6rs2.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-w56ry3bg.js +1 -0
- package/dist/client/static/js/tsx-b7eabr17.js +1 -0
- package/dist/client/static/js/typescript-nnkvhwfy.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-w6ew1red.js → usecaseDiagram-POWQR4AR-wfaa019a.js} +24 -24
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-p9axw7ch.js → vennDiagram-UO4OBE2U-46wf2pgd.js} +8 -8
- package/dist/client/static/js/{vue-xpemy62d.js → vue-ffngx2b3.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-rtjb9kgv.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-5ewc8s4p.js → wardleyDiagram-VNRHLVJA-10ph3bzq.js} +4 -4
- package/dist/client/static/js/xml-xy1tw6b2.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-7n4gn7k6.js → xychartDiagram-PMCCYNJV-2ba825z9.js} +5 -5
- package/dist/client/static/js/yaml-0fexqg2d.js +1 -0
- package/package.json +1 -1
- package/src/client/components/settings/categories/usage-settings/LimitsSection.tsx +10 -3
- package/src/client/components/settings/categories/usage-settings/ProviderDetail.tsx +27 -4
- package/src/client/components/settings/categories/usage-settings/TokenHarborCard.tsx +160 -0
- package/src/client/components/settings/categories/usage-settings/TokenPortalCard.tsx +104 -0
- package/src/client/components/settings/categories/usage-settings/format.ts +35 -0
- package/src/client/components/settings/categories/usage-settings/limits-section.test.tsx +16 -0
- package/src/client/components/settings/categories/usage-settings/providers.ts +26 -4
- package/src/client/components/settings/categories/usage-settings/token-harbor-card.test.tsx +114 -0
- package/src/client/components/settings/categories/usage-settings/token-harbor-hint.test.ts +68 -0
- package/src/client/components/settings/categories/usage-settings/token-portal-card.test.tsx +81 -0
- package/src/client/components/settings/categories/usage-settings/usage-and-picker.test.ts +66 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/DiffView.test.ts +13 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/DiffView.tsx +41 -18
- package/src/client/components/workspace/editor/BodyLazy.tsx +40 -0
- package/src/client/components/workspace/editor/index.tsx +2 -2
- package/src/client/data/settings/omp-schema.json +33 -10
- package/src/server/lib/usage/provider-key.ts +18 -0
- package/src/server/lib/usage/providers.server.ts +27 -3
- package/src/server/lib/usage/report.server.ts +24 -0
- package/src/server/lib/usage/token-harbor.test.ts +191 -0
- package/src/server/lib/usage/token-harbor.ts +207 -0
- package/src/server/lib/usage/token-portal.test.ts +140 -0
- package/src/server/lib/usage/token-portal.ts +179 -0
- package/src/server/lib/usage/vendor-http.test.ts +52 -0
- package/src/server/lib/usage/vendor-http.ts +9 -2
- package/src/shared/lib/omp/config/schema-releases.test.ts +22 -0
- package/src/shared/types/settings/usage.ts +89 -2
- package/dist/client/static/js/ImageView-mvjb3qh1.js +0 -1
- package/dist/client/static/js/LayoutWrapper-eenx0hp2.js +0 -2
- package/dist/client/static/js/architecture-7GRP2DOG-b5w9mnn5.js +0 -1
- package/dist/client/static/js/bash-hv3167gh.js +0 -1
- package/dist/client/static/js/c-acmn1zc9.js +0 -1
- package/dist/client/static/js/cpp-v2mqp8j7.js +0 -1
- package/dist/client/static/js/css-x7gyc3ta.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-kdj8rjc1.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-m57b7ytw.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-fasj2gxy.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-wvzsc4ph.js +0 -1
- package/dist/client/static/js/graphql-a4gbqpj9.js +0 -1
- package/dist/client/static/js/html-m0megrvb.js +0 -1
- package/dist/client/static/js/index-3nsrnyqr.js +0 -2
- package/dist/client/static/js/index-4x9p7hf9.js +0 -2
- package/dist/client/static/js/index-9vqkyj58.js +0 -3
- package/dist/client/static/js/index-d2xtbabt.js +0 -2
- package/dist/client/static/js/index-dxp2yvy7.js +0 -2
- package/dist/client/static/js/index-p6s3fz6b.js +0 -12
- package/dist/client/static/js/index-qtd0e38d.js +0 -1
- package/dist/client/static/js/index-x2v1zmth.js +0 -479
- package/dist/client/static/js/index-x9hfvbz6.js +0 -2
- package/dist/client/static/js/info-A6RAGUB7-ym2xevn8.js +0 -1
- package/dist/client/static/js/ini-80p6sp79.js +0 -1
- package/dist/client/static/js/java-mm2b3s9b.js +0 -1
- package/dist/client/static/js/javascript-n9w9p97f.js +0 -1
- package/dist/client/static/js/json-fzy76fkw.js +0 -1
- package/dist/client/static/js/jsx-c7v2f8s7.js +0 -1
- package/dist/client/static/js/lua-ppfdxrmv.js +0 -1
- package/dist/client/static/js/markdown-xed7y3ds.js +0 -1
- package/dist/client/static/js/one-dark-pro-mq6sn6a2.js +0 -1
- package/dist/client/static/js/one-light-pt6t6vax.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-01vcsy6x.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-053gzkmh.js +0 -1
- package/dist/client/static/js/properties-8ysbq2n2.js +0 -1
- package/dist/client/static/js/python-4ysexc8s.js +0 -1
- package/dist/client/static/js/r-hrsw5arc.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-bkpby8am.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-67bxrjgw.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-xj9ymacg.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-2xxpbnf6.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-78w88znz.js +0 -1
- package/dist/client/static/js/sql-hd42h8wx.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-rz309qrx.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-g2bkjr4z.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-pj7yw9rw.js +0 -1
- package/dist/client/static/js/tsx-xjp2ds8g.js +0 -1
- package/dist/client/static/js/typescript-yg97da8h.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-c7ekf8r2.js +0 -1
- package/dist/client/static/js/xml-nrb23phz.js +0 -1
- package/dist/client/static/js/yaml-sqs6pjpx.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ye}from"./index-x9hfvbz6.js";import{t,l,Y,C,ee,Ur,F,M,G,z,j,H,q,p,h,pe,og,Ui,dr,ie,Sn,dn}from"./index-9xsf8162.js";import{Re}from"./index-56rtb871.js";import{$r}from"./index-33qxg79j.js";import{hn,Nn}from"./index-evmcc5qh.js";var Se=Nn(function(Ee,Ie){(function(R,D){if(typeof Ee==="object"&&typeof Ie==="object")Ie.exports=D();else if(typeof define==="function"&&define.amd)define([],D);else if(typeof Ee==="object")Ee.layoutBase=D();else R.layoutBase=D()})(Ee,function(){return function(w){var R={};function D(v){if(R[v])return R[v].exports;var f=R[v]={i:v,l:!1,exports:{}};return w[v].call(f.exports,f,f.exports,D),f.l=!0,f.exports}return D.m=w,D.c=R,D.i=function(v){return v},D.d=function(v,f,o){if(!D.o(v,f))Object.defineProperty(v,f,{configurable:!1,enumerable:!0,get:o})},D.n=function(v){var f=v&&v.__esModule?function(){return v.default}:function(){return v};return D.d(f,"a",f),f},D.o=function(v,f){return Object.prototype.hasOwnProperty.call(v,f)},D.p="",D(D.s=28)}([function(w,R,D){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1000,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,w.exports=v},function(w,R,D){var v=D(2),f=D(8),o=D(9);function n(u,r,y){v.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=u,this.target=r}n.prototype=Object.create(v.prototype);for(var a in v)n[a]=v[a];n.prototype.getSource=function(){return this.source},n.prototype.getTarget=function(){return this.target},n.prototype.isInterGraph=function(){return this.isInterGraph},n.prototype.getLength=function(){return this.length},n.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},n.prototype.getBendpoints=function(){return this.bendpoints},n.prototype.getLca=function(){return this.lca},n.prototype.getSourceInLca=function(){return this.sourceInLca},n.prototype.getTargetInLca=function(){return this.targetInLca},n.prototype.getOtherEnd=function(u){if(this.source===u)return this.target;else if(this.target===u)return this.source;else throw"Node is not incident with this edge"},n.prototype.getOtherEndInGraph=function(u,r){var y=this.getOtherEnd(u),i=r.getGraphManager().getRoot();while(!0){if(y.getOwner()==r)return y;if(y.getOwner()==i)break;y=y.getOwner().getParent()}return null},n.prototype.updateLength=function(){var u=[,,,,];if(this.isOverlapingSourceAndTarget=f.getIntersection(this.target.getRect(),this.source.getRect(),u),!this.isOverlapingSourceAndTarget){if(this.lengthX=u[0]-u[2],this.lengthY=u[1]-u[3],Math.abs(this.lengthX)<1)this.lengthX=o.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=o.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},n.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=o.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=o.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},w.exports=n},function(w,R,D){function v(f){this.vGraphObject=f}w.exports=v},function(w,R,D){var v=D(2),f=D(10),o=D(13),n=D(0),a=D(16),u=D(5);function r(i,e,g,d){if(g==null&&d==null)d=e;if(v.call(this,d),i.graphManager!=null)i=i.graphManager;if(this.estimatedSize=f.MIN_VALUE,this.inclusionTreeDepth=f.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=i,g!=null&&e!=null)this.rect=new o(e.x,e.y,g.width,g.height);else this.rect=new o}r.prototype=Object.create(v.prototype);for(var y in v)r[y]=v[y];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(i){this.rect.width=i},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(i){this.rect.height=i},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new u(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new u(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(i,e){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=e.width,this.rect.height=e.height},r.prototype.setCenter=function(i,e){this.rect.x=i-this.rect.width/2,this.rect.y=e-this.rect.height/2},r.prototype.setLocation=function(i,e){this.rect.x=i,this.rect.y=e},r.prototype.moveBy=function(i,e){this.rect.x+=i,this.rect.y+=e},r.prototype.getEdgeListToNode=function(i){var e=[],g,d=this;return d.edges.forEach(function(c){if(c.target==i){if(c.source!=d)throw"Incorrect edge source!";e.push(c)}}),e},r.prototype.getEdgesBetween=function(i){var e=[],g,d=this;return d.edges.forEach(function(c){if(!(c.source==d||c.target==d))throw"Incorrect edge source and/or target";if(c.target==i||c.source==i)e.push(c)}),e},r.prototype.getNeighborsList=function(){var i=new Set,e=this;return e.edges.forEach(function(g){if(g.source==e)i.add(g.target);else{if(g.target!=e)throw"Incorrect incidency!";i.add(g.source)}}),i},r.prototype.withChildren=function(){var i=new Set,e,g;if(i.add(this),this.child!=null){var d=this.child.getNodes();for(var c=0;c<d.length;c++)e=d[c],g=e.withChildren(),g.forEach(function(x){i.add(x)})}return i},r.prototype.getNoOfChildren=function(){var i=0,e;if(this.child==null)i=1;else{var g=this.child.getNodes();for(var d=0;d<g.length;d++)e=g[d],i+=e.getNoOfChildren()}if(i==0)i=1;return i},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==f.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},r.prototype.scatter=function(){var i,e,g=-n.INITIAL_WORLD_BOUNDARY,d=n.INITIAL_WORLD_BOUNDARY;i=n.WORLD_CENTER_X+a.nextDouble()*(d-g)+g;var c=-n.INITIAL_WORLD_BOUNDARY,x=n.INITIAL_WORLD_BOUNDARY;e=n.WORLD_CENTER_Y+a.nextDouble()*(x-c)+c,this.rect.x=i,this.rect.y=e},r.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),n.NODE_DIMENSIONS_INCLUDE_LABELS){var e=i.getRight()-i.getLeft(),g=i.getBottom()-i.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(e+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>e)this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(e+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(g+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>g)this.rect.y-=(this.labelHeight-g)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(g+this.labelHeight)}}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==f.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(i){var e=this.rect.x;if(e>n.WORLD_BOUNDARY)e=n.WORLD_BOUNDARY;else if(e<-n.WORLD_BOUNDARY)e=-n.WORLD_BOUNDARY;var g=this.rect.y;if(g>n.WORLD_BOUNDARY)g=n.WORLD_BOUNDARY;else if(g<-n.WORLD_BOUNDARY)g=-n.WORLD_BOUNDARY;var d=new u(e,g),c=i.inverseTransformPoint(d);this.setLocation(c.x,c.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},w.exports=r},function(w,R,D){var v=D(0);function f(){}for(var o in v)f[o]=v[o];f.MAX_ITERATIONS=2500,f.DEFAULT_EDGE_LENGTH=50,f.DEFAULT_SPRING_STRENGTH=0.45,f.DEFAULT_REPULSION_STRENGTH=4500,f.DEFAULT_GRAVITY_STRENGTH=0.4,f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,f.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,f.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,f.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,f.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,f.COOLING_ADAPTATION_FACTOR=0.33,f.ADAPTATION_LOWER_NODE_LIMIT=1000,f.ADAPTATION_UPPER_NODE_LIMIT=5000,f.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,f.MAX_NODE_DISPLACEMENT=f.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,f.CONVERGENCE_CHECK_PERIOD=100,f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,f.MIN_EDGE_LENGTH=1,f.GRID_CALCULATION_CHECK_PERIOD=10,w.exports=f},function(w,R,D){function v(f,o){if(f==null&&o==null)this.x=0,this.y=0;else this.x=f,this.y=o}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(f){this.x=f},v.prototype.setY=function(f){this.y=f},v.prototype.getDifference=function(f){return new DimensionD(this.x-f.x,this.y-f.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(f){return this.x+=f.width,this.y+=f.height,this},w.exports=v},function(w,R,D){var v=D(2),f=D(10),o=D(0),n=D(7),a=D(3),u=D(1),r=D(13),y=D(12),i=D(11);function e(d,c,x){if(v.call(this,x),this.estimatedSize=f.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,c!=null&&c instanceof n)this.graphManager=c;else if(c!=null&&c instanceof Layout)this.graphManager=c.graphManager}e.prototype=Object.create(v.prototype);for(var g in v)e[g]=v[g];e.prototype.getNodes=function(){return this.nodes},e.prototype.getEdges=function(){return this.edges},e.prototype.getGraphManager=function(){return this.graphManager},e.prototype.getParent=function(){return this.parent},e.prototype.getLeft=function(){return this.left},e.prototype.getRight=function(){return this.right},e.prototype.getTop=function(){return this.top},e.prototype.getBottom=function(){return this.bottom},e.prototype.isConnected=function(){return this.isConnected},e.prototype.add=function(d,c,x){if(c==null&&x==null){var T=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(T)>-1)throw"Node already in graph!";return T.owner=this,this.getNodes().push(T),T}else{var N=d;if(!(this.getNodes().indexOf(c)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(c.owner==x.owner&&c.owner==this))throw"Both owners must be this graph!";if(c.owner!=x.owner)return null;if(N.source=c,N.target=x,N.isInterGraph=!1,this.getEdges().push(N),c.edges.push(N),x!=c)x.edges.push(N);return N}},e.prototype.remove=function(d){var c=d;if(d instanceof a){if(c==null)throw"Node is null!";if(!(c.owner!=null&&c.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var x=c.edges.slice(),T,N=x.length;for(var O=0;O<N;O++)if(T=x[O],T.isInterGraph)this.graphManager.remove(T);else T.source.owner.remove(T);var X=this.nodes.indexOf(c);if(X==-1)throw"Node not in owner node list!";this.nodes.splice(X,1)}else if(d instanceof u){var T=d;if(T==null)throw"Edge is null!";if(!(T.source!=null&&T.target!=null))throw"Source and/or target is null!";if(!(T.source.owner!=null&&T.target.owner!=null&&T.source.owner==this&&T.target.owner==this))throw"Source and/or target owner is invalid!";var I=T.source.edges.indexOf(T),V=T.target.edges.indexOf(T);if(!(I>-1&&V>-1))throw"Source and/or target doesn't know this edge!";if(T.source.edges.splice(I,1),T.target!=T.source)T.target.edges.splice(V,1);var X=T.source.owner.getEdges().indexOf(T);if(X==-1)throw"Not in owner's edge list!";T.source.owner.getEdges().splice(X,1)}},e.prototype.updateLeftTop=function(){var{MAX_VALUE:d,MAX_VALUE:c}=f,x,T,N,O=this.getNodes(),X=O.length;for(var I=0;I<X;I++){var V=O[I];if(x=V.getTop(),T=V.getLeft(),d>x)d=x;if(c>T)c=T}if(d==f.MAX_VALUE)return null;if(O[0].getParent().paddingLeft!=null)N=O[0].getParent().paddingLeft;else N=this.margin;return this.left=c-N,this.top=d-N,new y(this.left,this.top)},e.prototype.updateBounds=function(d){var c=f.MAX_VALUE,x=-f.MAX_VALUE,T=f.MAX_VALUE,N=-f.MAX_VALUE,O,X,I,V,_,Q=this.nodes,lt=Q.length;for(var P=0;P<lt;P++){var tt=Q[P];if(d&&tt.child!=null)tt.updateBounds();if(O=tt.getLeft(),X=tt.getRight(),I=tt.getTop(),V=tt.getBottom(),c>O)c=O;if(x<X)x=X;if(T>I)T=I;if(N<V)N=V}var s=new r(c,T,x-c,N-T);if(c==f.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(Q[0].getParent().paddingLeft!=null)_=Q[0].getParent().paddingLeft;else _=this.margin;this.left=s.x-_,this.right=s.x+s.width+_,this.top=s.y-_,this.bottom=s.y+s.height+_},e.calculateBounds=function(d){var c=f.MAX_VALUE,x=-f.MAX_VALUE,T=f.MAX_VALUE,N=-f.MAX_VALUE,O,X,I,V,_=d.length;for(var Q=0;Q<_;Q++){var lt=d[Q];if(O=lt.getLeft(),X=lt.getRight(),I=lt.getTop(),V=lt.getBottom(),c>O)c=O;if(x<X)x=X;if(T>I)T=I;if(N<V)N=V}var P=new r(c,T,x-c,N-T);return P},e.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},e.prototype.getEstimatedSize=function(){if(this.estimatedSize==f.MIN_VALUE)throw"assert failed";return this.estimatedSize},e.prototype.calcEstimatedSize=function(){var d=0,c=this.nodes,x=c.length;for(var T=0;T<x;T++){var N=c[T];d+=N.calcEstimatedSize()}if(d==0)this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=d/Math.sqrt(this.nodes.length);return this.estimatedSize},e.prototype.updateConnected=function(){var d=this;if(this.nodes.length==0){this.isConnected=!0;return}var c=new i,x=new Set,T=this.nodes[0],N,O,X=T.withChildren();X.forEach(function(P){c.push(P),x.add(P)});while(c.length!==0){T=c.shift(),N=T.getEdges();var I=N.length;for(var V=0;V<I;V++){var _=N[V];if(O=_.getOtherEndInGraph(T,this),O!=null&&!x.has(O)){var Q=O.withChildren();Q.forEach(function(P){c.push(P),x.add(P)})}}}if(this.isConnected=!1,x.size>=this.nodes.length){var lt=0;if(x.forEach(function(P){if(P.owner==d)lt++}),lt==this.nodes.length)this.isConnected=!0}},w.exports=e},function(w,R,D){var v,f=D(1);function o(n){v=D(6),this.layout=n,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var n=this.layout.newGraph(),a=this.layout.newNode(null),u=this.add(n,a);return this.setRootGraph(u),this.rootGraph},o.prototype.add=function(n,a,u,r,y){if(u==null&&r==null&&y==null){if(n==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(n)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(n),n.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return n.parent=a,a.child=n,n}else{y=u,r=a,u=n;var i=r.getOwner(),e=y.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(e!=null&&e.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==e)return u.isInterGraph=!1,i.add(u,r,y);else{if(u.isInterGraph=!0,u.source=r,u.target=y,this.edges.indexOf(u)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(u),!(u.source!=null&&u.target!=null))throw"Edge source and/or target is null!";if(!(u.source.edges.indexOf(u)==-1&&u.target.edges.indexOf(u)==-1))throw"Edge already in source and/or target incidency list!";return u.source.edges.push(u),u.target.edges.push(u),u}}},o.prototype.remove=function(n){if(n instanceof v){var a=n;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var u=[];u=u.concat(a.getEdges());var r,y=u.length;for(var i=0;i<y;i++)r=u[i],a.remove(r);var e=[];e=e.concat(a.getNodes());var g;y=e.length;for(var i=0;i<y;i++)g=e[i],a.remove(g);if(a==this.rootGraph)this.setRootGraph(null);var d=this.graphs.indexOf(a);this.graphs.splice(d,1),a.parent=null}else if(n instanceof f){if(r=n,r==null)throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(!(r.source!=null&&r.target!=null))throw"Source and/or target is null!";if(!(r.source.edges.indexOf(r)!=-1&&r.target.edges.indexOf(r)!=-1))throw"Source and/or target doesn't know this edge!";var d=r.source.edges.indexOf(r);if(r.source.edges.splice(d,1),d=r.target.edges.indexOf(r),r.target.edges.splice(d,1),!(r.source.owner!=null&&r.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(r.source.owner.getGraphManager().edges.indexOf(r)==-1)throw"Not in owner graph manager's edge list!";var d=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(d,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){var n=[],a=this.getGraphs(),u=a.length;for(var r=0;r<u;r++)n=n.concat(a[r].getNodes());this.allNodes=n}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var n=[],a=this.getGraphs(),u=a.length;for(var r=0;r<a.length;r++)n=n.concat(a[r].getEdges());n=n.concat(this.edges),this.allEdges=n}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(n){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=n},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(n){if(n.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=n,n.parent==null)n.parent=this.layout.newNode("Root node")},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(n,a){if(!(n!=null&&a!=null))throw"assert failed";if(n==a)return!0;var u=n.getOwner(),r;do{if(r=u.getParent(),r==null)break;if(r==a)return!0;if(u=r.getOwner(),u==null)break}while(!0);u=a.getOwner();do{if(r=u.getParent(),r==null)break;if(r==n)return!0;if(u=r.getOwner(),u==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){var n,a,u,r,y,i=this.getAllEdges(),e=i.length;for(var g=0;g<e;g++){if(n=i[g],a=n.source,u=n.target,n.lca=null,n.sourceInLca=a,n.targetInLca=u,a==u){n.lca=a.getOwner();continue}r=a.getOwner();while(n.lca==null){n.targetInLca=u,y=u.getOwner();while(n.lca==null){if(y==r){n.lca=y;break}if(y==this.rootGraph)break;if(n.lca!=null)throw"assert failed";n.targetInLca=y.getParent(),y=n.targetInLca.getOwner()}if(r==this.rootGraph)break;if(n.lca==null)n.sourceInLca=r.getParent(),r=n.sourceInLca.getOwner()}if(n.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(n,a){if(n==a)return n.getOwner();var u=n.getOwner();do{if(u==null)break;var r=a.getOwner();do{if(r==null)break;if(r==u)return r;r=r.getParent().getOwner()}while(!0);u=u.getParent().getOwner()}while(!0);return u},o.prototype.calcInclusionTreeDepths=function(n,a){if(n==null&&a==null)n=this.rootGraph,a=1;var u,r=n.getNodes(),y=r.length;for(var i=0;i<y;i++)if(u=r[i],u.inclusionTreeDepth=a,u.child!=null)this.calcInclusionTreeDepths(u.child,a+1)},o.prototype.includesInvalidEdge=function(){var n,a=[],u=this.edges.length;for(var r=0;r<u;r++)if(n=this.edges[r],this.isOneAncestorOfOther(n.source,n.target))a.push(n);for(var r=0;r<a.length;r++)this.remove(a[r]);return!1},w.exports=o},function(w,R,D){var v=D(12);function f(){}f.calcSeparationAmount=function(o,n,a,u){if(!o.intersects(n))throw"assert failed";var r=[,,];if(this.decideDirectionsForOverlappingNodes(o,n,r),a[0]=Math.min(o.getRight(),n.getRight())-Math.max(o.x,n.x),a[1]=Math.min(o.getBottom(),n.getBottom())-Math.max(o.y,n.y),o.getX()<=n.getX()&&o.getRight()>=n.getRight())a[0]+=Math.min(n.getX()-o.getX(),o.getRight()-n.getRight());else if(n.getX()<=o.getX()&&n.getRight()>=o.getRight())a[0]+=Math.min(o.getX()-n.getX(),n.getRight()-o.getRight());if(o.getY()<=n.getY()&&o.getBottom()>=n.getBottom())a[1]+=Math.min(n.getY()-o.getY(),o.getBottom()-n.getBottom());else if(n.getY()<=o.getY()&&n.getBottom()>=o.getBottom())a[1]+=Math.min(o.getY()-n.getY(),n.getBottom()-o.getBottom());var y=Math.abs((n.getCenterY()-o.getCenterY())/(n.getCenterX()-o.getCenterX()));if(n.getCenterY()===o.getCenterY()&&n.getCenterX()===o.getCenterX())y=1;var i=y*a[0],e=a[1]/y;if(a[0]<e)e=a[0];else i=a[1];a[0]=-1*r[0]*(e/2+u),a[1]=-1*r[1]*(i/2+u)},f.decideDirectionsForOverlappingNodes=function(o,n,a){if(o.getCenterX()<n.getCenterX())a[0]=-1;else a[0]=1;if(o.getCenterY()<n.getCenterY())a[1]=-1;else a[1]=1},f.getIntersection2=function(o,n,a){var u=o.getCenterX(),r=o.getCenterY(),y=n.getCenterX(),i=n.getCenterY();if(o.intersects(n))return a[0]=u,a[1]=r,a[2]=y,a[3]=i,!0;var e=o.getX(),g=o.getY(),d=o.getRight(),c=o.getX(),x=o.getBottom(),T=o.getRight(),N=o.getWidthHalf(),O=o.getHeightHalf(),X=n.getX(),I=n.getY(),V=n.getRight(),_=n.getX(),Q=n.getBottom(),lt=n.getRight(),P=n.getWidthHalf(),tt=n.getHeightHalf(),s=!1,L=!1;if(u===y){if(r>i)return a[0]=u,a[1]=g,a[2]=y,a[3]=Q,!1;else if(r<i)return a[0]=u,a[1]=x,a[2]=y,a[3]=I,!1}else if(r===i){if(u>y)return a[0]=e,a[1]=r,a[2]=V,a[3]=i,!1;else if(u<y)return a[0]=d,a[1]=r,a[2]=X,a[3]=i,!1}else{var E=o.height/o.width,A=n.height/n.width,m=(i-r)/(y-u),U=void 0,b=void 0,k=void 0,B=void 0,W=void 0,st=void 0;if(-E===m)if(u>y)a[0]=c,a[1]=x,s=!0;else a[0]=d,a[1]=g,s=!0;else if(E===m)if(u>y)a[0]=e,a[1]=g,s=!0;else a[0]=T,a[1]=x,s=!0;if(-A===m)if(y>u)a[2]=_,a[3]=Q,L=!0;else a[2]=V,a[3]=I,L=!0;else if(A===m)if(y>u)a[2]=X,a[3]=I,L=!0;else a[2]=lt,a[3]=Q,L=!0;if(s&&L)return!1;if(u>y)if(r>i)U=this.getCardinalDirection(E,m,4),b=this.getCardinalDirection(A,m,2);else U=this.getCardinalDirection(-E,m,3),b=this.getCardinalDirection(-A,m,1);else if(r>i)U=this.getCardinalDirection(-E,m,1),b=this.getCardinalDirection(-A,m,3);else U=this.getCardinalDirection(E,m,2),b=this.getCardinalDirection(A,m,4);if(!s)switch(U){case 1:B=g,k=u+-O/m,a[0]=k,a[1]=B;break;case 2:k=T,B=r+N*m,a[0]=k,a[1]=B;break;case 3:B=x,k=u+O/m,a[0]=k,a[1]=B;break;case 4:k=c,B=r+-N*m,a[0]=k,a[1]=B;break}if(!L)switch(b){case 1:st=I,W=y+-tt/m,a[2]=W,a[3]=st;break;case 2:W=lt,st=i+P*m,a[2]=W,a[3]=st;break;case 3:st=Q,W=y+tt/m,a[2]=W,a[3]=st;break;case 4:W=_,st=i+-P*m,a[2]=W,a[3]=st;break}}return!1},f.getCardinalDirection=function(o,n,a){if(o>n)return a;else return 1+a%4},f.getIntersection=function(o,n,a,u){if(u==null)return this.getIntersection2(o,n,a);var{x:r,y}=o,{x:i,y:e}=n,{x:g,y:d}=a,{x:c,y:x}=u,T=void 0,N=void 0,O=void 0,X=void 0,I=void 0,V=void 0,_=void 0,Q=void 0,lt=void 0;if(O=e-y,I=r-i,_=i*y-r*e,X=x-d,V=g-c,Q=c*d-g*x,lt=O*V-X*I,lt===0)return null;return T=(I*Q-V*_)/lt,N=(X*_-O*Q)/lt,new v(T,N)},f.angleOfVector=function(o,n,a,u){var r=void 0;if(o!==a){if(r=Math.atan((u-n)/(a-o)),a<o)r+=Math.PI;else if(u<n)r+=this.TWO_PI}else if(u<n)r=this.ONE_AND_HALF_PI;else r=this.HALF_PI;return r},f.doIntersect=function(o,n,a,u){var{x:r,y}=o,{x:i,y:e}=n,{x:g,y:d}=a,{x:c,y:x}=u,T=(i-r)*(x-d)-(c-g)*(e-y);if(T===0)return!1;else{var N=((x-d)*(c-r)+(g-c)*(x-y))/T,O=((y-e)*(c-r)+(i-r)*(x-y))/T;return 0<N&&N<1&&0<O&&O<1}},f.findCircleLineIntersections=function(o,n,a,u,r,y,i){var e=(a-o)*(a-o)+(u-n)*(u-n),g=2*((o-r)*(a-o)+(n-y)*(u-n)),d=(o-r)*(o-r)+(n-y)*(n-y)-i*i,c=g*g-4*e*d;if(c>=0){var x=(-g+Math.sqrt(g*g-4*e*d))/(2*e),T=(-g-Math.sqrt(g*g-4*e*d))/(2*e),N=null;if(x>=0&&x<=1)return[x];if(T>=0&&T<=1)return[T];return N}else return null},f.HALF_PI=0.5*Math.PI,f.ONE_AND_HALF_PI=1.5*Math.PI,f.TWO_PI=2*Math.PI,f.THREE_PI=3*Math.PI,w.exports=f},function(w,R,D){function v(){}v.sign=function(f){if(f>0)return 1;else if(f<0)return-1;else return 0},v.floor=function(f){return f<0?Math.ceil(f):Math.floor(f)},v.ceil=function(f){return f<0?Math.floor(f):Math.ceil(f)},w.exports=v},function(w,R,D){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,w.exports=v},function(w,R,D){var v=function(){function r(y,i){for(var e=0;e<i.length;e++){var g=i[e];if(g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g)g.writable=!0;Object.defineProperty(y,g.key,g)}}return function(y,i,e){if(i)r(y.prototype,i);if(e)r(y,e);return y}}();function f(r,y){if(!(r instanceof y))throw TypeError("Cannot call a class as a function")}var o=function(y){return{value:y,next:null,prev:null}},n=function(y,i,e,g){if(y!==null)y.next=i;else g.head=i;if(e!==null)e.prev=i;else g.tail=i;return i.prev=y,i.next=e,g.length++,i},a=function(y,i){var{prev:e,next:g}=y;if(e!==null)e.next=g;else i.head=g;if(g!==null)g.prev=e;else i.tail=e;return y.prev=y.next=null,i.length--,y},u=function(){function r(y){var i=this;if(f(this,r),this.length=0,this.head=null,this.tail=null,y!=null)y.forEach(function(e){return i.push(e)})}return v(r,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(i,e){return n(e.prev,o(i),e,this)}},{key:"insertAfter",value:function(i,e){return n(e,o(i),e.next,this)}},{key:"insertNodeBefore",value:function(i,e){return n(e.prev,i,e,this)}},{key:"insertNodeAfter",value:function(i,e){return n(e,i,e.next,this)}},{key:"push",value:function(i){return n(this.tail,o(i),null,this)}},{key:"unshift",value:function(i){return n(null,o(i),this.head,this)}},{key:"remove",value:function(i){return a(i,this)}},{key:"pop",value:function(){return a(this.tail,this).value}},{key:"popNode",value:function(){return a(this.tail,this)}},{key:"shift",value:function(){return a(this.head,this).value}},{key:"shiftNode",value:function(){return a(this.head,this)}},{key:"get_object_at",value:function(i){if(i<=this.length()){var e=1,g=this.head;while(e<i)g=g.next,e++;return g.value}}},{key:"set_object_at",value:function(i,e){if(i<=this.length()){var g=1,d=this.head;while(g<i)d=d.next,g++;d.value=e}}}]),r}();w.exports=u},function(w,R,D){function v(f,o,n){if(this.x=null,this.y=null,f==null&&o==null&&n==null)this.x=0,this.y=0;else if(typeof f=="number"&&typeof o=="number"&&n==null)this.x=f,this.y=o;else if(f.constructor.name=="Point"&&o==null&&n==null)n=f,this.x=n.x,this.y=n.y}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.getLocation=function(){return new v(this.x,this.y)},v.prototype.setLocation=function(f,o,n){if(f.constructor.name=="Point"&&o==null&&n==null)n=f,this.setLocation(n.x,n.y);else if(typeof f=="number"&&typeof o=="number"&&n==null)if(parseInt(f)==f&&parseInt(o)==o)this.move(f,o);else this.x=Math.floor(f+0.5),this.y=Math.floor(o+0.5)},v.prototype.move=function(f,o){this.x=f,this.y=o},v.prototype.translate=function(f,o){this.x+=f,this.y+=o},v.prototype.equals=function(f){if(f.constructor.name=="Point"){var o=f;return this.x==o.x&&this.y==o.y}return this==f},v.prototype.toString=function(){return new v().constructor.name+"[x="+this.x+",y="+this.y+"]"},w.exports=v},function(w,R,D){function v(f,o,n,a){if(this.x=0,this.y=0,this.width=0,this.height=0,f!=null&&o!=null&&n!=null&&a!=null)this.x=f,this.y=o,this.width=n,this.height=a}v.prototype.getX=function(){return this.x},v.prototype.setX=function(f){this.x=f},v.prototype.getY=function(){return this.y},v.prototype.setY=function(f){this.y=f},v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(f){this.width=f},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(f){this.height=f},v.prototype.getRight=function(){return this.x+this.width},v.prototype.getBottom=function(){return this.y+this.height},v.prototype.intersects=function(f){if(this.getRight()<f.x)return!1;if(this.getBottom()<f.y)return!1;if(f.getRight()<this.x)return!1;if(f.getBottom()<this.y)return!1;return!0},v.prototype.getCenterX=function(){return this.x+this.width/2},v.prototype.getMinX=function(){return this.getX()},v.prototype.getMaxX=function(){return this.getX()+this.width},v.prototype.getCenterY=function(){return this.y+this.height/2},v.prototype.getMinY=function(){return this.getY()},v.prototype.getMaxY=function(){return this.getY()+this.height},v.prototype.getWidthHalf=function(){return this.width/2},v.prototype.getHeightHalf=function(){return this.height/2},w.exports=v},function(w,R,D){var v=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol==="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function f(){}f.lastID=0,f.createID=function(o){if(f.isPrimitive(o))return o;if(o.uniqueID!=null)return o.uniqueID;return o.uniqueID=f.getString(),f.lastID++,o.uniqueID},f.getString=function(o){if(o==null)o=f.lastID;return"Object#"+o},f.isPrimitive=function(o){var n=typeof o>"u"?"undefined":v(o);return o==null||n!="object"&&n!="function"},w.exports=f},function(w,R,D){function v(g){if(Array.isArray(g)){for(var d=0,c=Array(g.length);d<g.length;d++)c[d]=g[d];return c}else return Array.from(g)}var f=D(0),o=D(7),n=D(3),a=D(1),u=D(6),r=D(5),y=D(17),i=D(29);function e(g){if(i.call(this),this.layoutQuality=f.QUALITY,this.createBendsAsNeeded=f.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=f.DEFAULT_INCREMENTAL,this.animationOnLayout=f.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=f.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=f.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=f.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,g!=null)this.isRemoteUse=g}e.RANDOM_SEED=1,e.prototype=Object.create(i.prototype),e.prototype.getGraphManager=function(){return this.graphManager},e.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},e.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},e.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},e.prototype.newGraphManager=function(){var g=new o(this);return this.graphManager=g,g},e.prototype.newGraph=function(g){return new u(null,this.graphManager,g)},e.prototype.newNode=function(g){return new n(this.graphManager,g)},e.prototype.newEdge=function(g){return new a(null,null,g)},e.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},e.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var g;if(this.checkLayoutSuccess())g=!1;else g=this.layout();if(f.ANIMATE==="during")return!1;if(g){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,g},e.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},e.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var g,d=this.graphManager.getAllEdges();for(var c=0;c<d.length;c++)g=d[c];var x,T=this.graphManager.getRoot().getNodes();for(var c=0;c<T.length;c++)x=T[c];this.update(this.graphManager.getRoot())}},e.prototype.update=function(g){if(g==null)this.update2();else if(g instanceof n){var d=g;if(d.getChild()!=null){var c=d.getChild().getNodes();for(var x=0;x<c.length;x++)update(c[x])}if(d.vGraphObject!=null){var T=d.vGraphObject;T.update(d)}}else if(g instanceof a){var N=g;if(N.vGraphObject!=null){var O=N.vGraphObject;O.update(N)}}else if(g instanceof u){var X=g;if(X.vGraphObject!=null){var I=X.vGraphObject;I.update(X)}}},e.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=f.QUALITY,this.animationDuringLayout=f.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=f.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=f.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=f.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=f.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=f.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},e.prototype.transform=function(g){if(g==null)this.transform(new r(0,0));else{var d=new y,c=this.graphManager.getRoot().updateLeftTop();if(c!=null){d.setWorldOrgX(g.x),d.setWorldOrgY(g.y),d.setDeviceOrgX(c.x),d.setDeviceOrgY(c.y);var x=this.getAllNodes(),T;for(var N=0;N<x.length;N++)T=x[N],T.transform(d)}}},e.prototype.positionNodesRandomly=function(g){if(g==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var d,c,x=g.getNodes();for(var T=0;T<x.length;T++)if(d=x[T],c=d.getChild(),c==null)d.scatter();else if(c.getNodes().length==0)d.scatter();else this.positionNodesRandomly(c),d.updateBounds()}},e.prototype.getFlatForest=function(){var g=[],d=!0,c=this.graphManager.getRoot().getNodes(),x=!0;for(var T=0;T<c.length;T++)if(c[T].getChild()!=null)x=!1;if(!x)return g;var N=new Set,O=[],X=new Map,I=[];I=I.concat(c);while(I.length>0&&d){O.push(I[0]);while(O.length>0&&d){var V=O[0];O.splice(0,1),N.add(V);var _=V.getEdges();for(var T=0;T<_.length;T++){var Q=_[T].getOtherEnd(V);if(X.get(V)!=Q)if(!N.has(Q))O.push(Q),X.set(Q,V);else{d=!1;break}}}if(!d)g=[];else{var lt=[].concat(v(N));g.push(lt);for(var T=0;T<lt.length;T++){var P=lt[T],tt=I.indexOf(P);if(tt>-1)I.splice(tt,1)}N=new Set,X=new Map}}return g},e.prototype.createDummyNodesForBendpoints=function(g){var d=[],c=g.source,x=this.graphManager.calcLowestCommonAncestor(g.source,g.target);for(var T=0;T<g.bendpoints.length;T++){var N=this.newNode(null);N.setRect(new Point(0,0),new Dimension(1,1)),x.add(N);var O=this.newEdge(null);this.graphManager.add(O,c,N),d.add(N),c=N}var O=this.newEdge(null);if(this.graphManager.add(O,c,g.target),this.edgeToDummyNodes.set(g,d),g.isInterGraph())this.graphManager.remove(g);else x.remove(g);return d},e.prototype.createBendpointsFromDummyNodes=function(){var g=[];g=g.concat(this.graphManager.getAllEdges()),g=[].concat(v(this.edgeToDummyNodes.keys())).concat(g);for(var d=0;d<g.length;d++){var c=g[d];if(c.bendpoints.length>0){var x=this.edgeToDummyNodes.get(c);for(var T=0;T<x.length;T++){var N=x[T],O=new r(N.getCenterX(),N.getCenterY()),X=c.bendpoints.get(T);X.x=O.x,X.y=O.y,N.getOwner().remove(N)}this.graphManager.add(c,c.source,c.target)}}},e.transform=function(g,d,c,x){if(c!=null&&x!=null){var T=d;if(g<=50){var N=d/c;T-=(d-N)/50*(50-g)}else{var O=d*x;T+=(O-d)/50*(g-50)}return T}else{var X,I;if(g<=50)X=9*d/500,I=d/10;else X=9*d/50,I=-8*d;return X*g+I}},e.findCenterOfTree=function(g){var d=[];d=d.concat(g);var c=[],x=new Map,T=!1,N=null;if(d.length==1||d.length==2)T=!0,N=d[0];for(var O=0;O<d.length;O++){var X=d[O],I=X.getNeighborsList().size;if(x.set(X,X.getNeighborsList().size),I==1)c.push(X)}var V=[];V=V.concat(c);while(!T){var _=[];_=_.concat(V),V=[];for(var O=0;O<d.length;O++){var X=d[O],Q=d.indexOf(X);if(Q>=0)d.splice(Q,1);var lt=X.getNeighborsList();lt.forEach(function(s){if(c.indexOf(s)<0){var L=x.get(s),E=L-1;if(E==1)V.push(s);x.set(s,E)}})}if(c=c.concat(V),d.length==1||d.length==2)T=!0,N=d[0]}return N},e.prototype.setGraphManager=function(g){this.graphManager=g},w.exports=e},function(w,R,D){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},w.exports=v},function(w,R,D){var v=D(5);function f(o,n){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}f.prototype.getWorldOrgX=function(){return this.lworldOrgX},f.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},f.prototype.getWorldOrgY=function(){return this.lworldOrgY},f.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},f.prototype.getWorldExtX=function(){return this.lworldExtX},f.prototype.setWorldExtX=function(o){this.lworldExtX=o},f.prototype.getWorldExtY=function(){return this.lworldExtY},f.prototype.setWorldExtY=function(o){this.lworldExtY=o},f.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},f.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},f.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},f.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},f.prototype.getDeviceExtX=function(){return this.ldeviceExtX},f.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},f.prototype.getDeviceExtY=function(){return this.ldeviceExtY},f.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},f.prototype.transformX=function(o){var n=0,a=this.lworldExtX;if(a!=0)n=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/a;return n},f.prototype.transformY=function(o){var n=0,a=this.lworldExtY;if(a!=0)n=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/a;return n},f.prototype.inverseTransformX=function(o){var n=0,a=this.ldeviceExtX;if(a!=0)n=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/a;return n},f.prototype.inverseTransformY=function(o){var n=0,a=this.ldeviceExtY;if(a!=0)n=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/a;return n},f.prototype.inverseTransformPoint=function(o){var n=new v(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return n},w.exports=f},function(w,R,D){function v(i){if(Array.isArray(i)){for(var e=0,g=Array(i.length);e<i.length;e++)g[e]=i[e];return g}else return Array.from(i)}var f=D(15),o=D(4),n=D(0),a=D(8),u=D(9);function r(){f.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}r.prototype=Object.create(f.prototype);for(var y in f)r[y]=f[y];r.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},r.prototype.calcIdealEdgeLengths=function(){var i,e,g,d,c,x,T,N=this.getGraphManager().getAllEdges();for(var O=0;O<N.length;O++)if(i=N[O],e=i.idealLength,i.isInterGraph){if(d=i.getSource(),c=i.getTarget(),x=i.getSourceInLca().getEstimatedSize(),T=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)i.idealLength+=x+T-2*n.SIMPLE_NODE_SIZE;g=i.getLca().getInclusionTreeDepth(),i.idealLength+=e*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(d.getInclusionTreeDepth()+c.getInclusionTreeDepth()-2*g)}},r.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;if(this.incremental){if(i>o.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(i>o.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(i-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){var i=this.getAllEdges(),e;for(var g=0;g<i.length;g++)e=i[g],this.calcSpringForce(e,e.idealLength)},r.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g,d,c,x,T=this.getAllNodes(),N;if(this.useFRGridVariant){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&i)this.updateGrid();N=new Set;for(g=0;g<T.length;g++)c=T[g],this.calculateRepulsionForceOfANode(c,N,i,e),N.add(c)}else for(g=0;g<T.length;g++){c=T[g];for(d=g+1;d<T.length;d++){if(x=T[d],c.getOwner()!=x.getOwner())continue;this.calcRepulsionForce(c,x)}}},r.prototype.calcGravitationalForces=function(){var i,e=this.getAllNodesToApplyGravitation();for(var g=0;g<e.length;g++)i=e[g],this.calcGravitationalForce(i)},r.prototype.moveNodes=function(){var i=this.getAllNodes(),e;for(var g=0;g<i.length;g++)e=i[g],e.move()},r.prototype.calcSpringForce=function(i,e){var g=i.getSource(),d=i.getTarget(),c,x,T,N;if(this.uniformLeafNodeSizes&&g.getChild()==null&&d.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;if(c=i.getLength(),c==0)return;x=i.edgeElasticity*(c-e),T=x*(i.lengthX/c),N=x*(i.lengthY/c),g.springForceX+=T,g.springForceY+=N,d.springForceX-=T,d.springForceY-=N},r.prototype.calcRepulsionForce=function(i,e){var g=i.getRect(),d=e.getRect(),c=[,,],x=[,,,,],T,N,O,X,I,V,_;if(g.intersects(d)){a.calcSeparationAmount(g,d,c,o.DEFAULT_EDGE_LENGTH/2),V=2*c[0],_=2*c[1];var Q=i.noOfChildren*e.noOfChildren/(i.noOfChildren+e.noOfChildren);i.repulsionForceX-=Q*V,i.repulsionForceY-=Q*_,e.repulsionForceX+=Q*V,e.repulsionForceY+=Q*_}else{if(this.uniformLeafNodeSizes&&i.getChild()==null&&e.getChild()==null)T=d.getCenterX()-g.getCenterX(),N=d.getCenterY()-g.getCenterY();else a.getIntersection(g,d,x),T=x[2]-x[0],N=x[3]-x[1];if(Math.abs(T)<o.MIN_REPULSION_DIST)T=u.sign(T)*o.MIN_REPULSION_DIST;if(Math.abs(N)<o.MIN_REPULSION_DIST)N=u.sign(N)*o.MIN_REPULSION_DIST;O=T*T+N*N,X=Math.sqrt(O),I=(i.nodeRepulsion/2+e.nodeRepulsion/2)*i.noOfChildren*e.noOfChildren/O,V=I*T/X,_=I*N/X,i.repulsionForceX-=V,i.repulsionForceY-=_,e.repulsionForceX+=V,e.repulsionForceY+=_}},r.prototype.calcGravitationalForce=function(i){var e,g,d,c,x,T,N,O;if(e=i.getOwner(),g=(e.getRight()+e.getLeft())/2,d=(e.getTop()+e.getBottom())/2,c=i.getCenterX()-g,x=i.getCenterY()-d,T=Math.abs(c)+i.getWidth()/2,N=Math.abs(x)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()){if(O=e.getEstimatedSize()*this.gravityRangeFactor,T>O||N>O)i.gravitationForceX=-this.gravityConstant*c,i.gravitationForceY=-this.gravityConstant*x}else if(O=e.getEstimatedSize()*this.compoundGravityRangeFactor,T>O||N>O)i.gravitationForceX=-this.gravityConstant*c*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*x*this.compoundGravityConstant},r.prototype.isConverged=function(){var i,e=!1;if(this.totalIterations>this.maxIterations/3)e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||e},r.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},r.prototype.calcNoOfChildrenForAllNodes=function(){var i,e=this.graphManager.getAllNodes();for(var g=0;g<e.length;g++)i=e[g],i.noOfChildren=i.getNoOfChildren()},r.prototype.calcGrid=function(i){var e=0,g=0;e=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),g=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));var d=Array(e);for(var c=0;c<e;c++)d[c]=Array(g);for(var c=0;c<e;c++)for(var x=0;x<g;x++)d[c][x]=[];return d},r.prototype.addNodeToGrid=function(i,e,g){var d=0,c=0,x=0,T=0;d=parseInt(Math.floor((i.getRect().x-e)/this.repulsionRange)),c=parseInt(Math.floor((i.getRect().width+i.getRect().x-e)/this.repulsionRange)),x=parseInt(Math.floor((i.getRect().y-g)/this.repulsionRange)),T=parseInt(Math.floor((i.getRect().height+i.getRect().y-g)/this.repulsionRange));for(var N=d;N<=c;N++)for(var O=x;O<=T;O++)this.grid[N][O].push(i),i.setGridCoordinates(d,c,x,T)},r.prototype.updateGrid=function(){var i,e,g=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(i=0;i<g.length;i++)e=g[i],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},r.prototype.calculateRepulsionForceOfANode=function(i,e,g,d){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&g||d){var c=new Set;i.surrounding=[];var x,T=this.grid;for(var N=i.startX-1;N<i.finishX+2;N++)for(var O=i.startY-1;O<i.finishY+2;O++)if(!(N<0||O<0||N>=T.length||O>=T[0].length))for(var X=0;X<T[N][O].length;X++){if(x=T[N][O][X],i.getOwner()!=x.getOwner()||i==x)continue;if(!e.has(x)&&!c.has(x)){var I=Math.abs(i.getCenterX()-x.getCenterX())-(i.getWidth()/2+x.getWidth()/2),V=Math.abs(i.getCenterY()-x.getCenterY())-(i.getHeight()/2+x.getHeight()/2);if(I<=this.repulsionRange&&V<=this.repulsionRange)c.add(x)}}i.surrounding=[].concat(v(c))}for(N=0;N<i.surrounding.length;N++)this.calcRepulsionForce(i,i.surrounding[N])},r.prototype.calcRepulsionRange=function(){return 0},w.exports=r},function(w,R,D){var v=D(1),f=D(4);function o(a,u,r){v.call(this,a,u,r),this.idealLength=f.DEFAULT_EDGE_LENGTH,this.edgeElasticity=f.DEFAULT_SPRING_STRENGTH}o.prototype=Object.create(v.prototype);for(var n in v)o[n]=v[n];w.exports=o},function(w,R,D){var v=D(3),f=D(4);function o(a,u,r,y){v.call(this,a,u,r,y),this.nodeRepulsion=f.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}o.prototype=Object.create(v.prototype);for(var n in v)o[n]=v[n];o.prototype.setGridCoordinates=function(a,u,r,y){this.startX=a,this.finishX=u,this.startY=r,this.finishY=y},w.exports=o},function(w,R,D){function v(f,o){if(this.width=0,this.height=0,f!==null&&o!==null)this.height=o,this.width=f}v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(f){this.width=f},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(f){this.height=f},w.exports=v},function(w,R,D){var v=D(14);function f(){this.map={},this.keys=[]}f.prototype.put=function(o,n){var a=v.createID(o);if(!this.contains(a))this.map[a]=n,this.keys.push(o)},f.prototype.contains=function(o){var n=v.createID(o);return this.map[o]!=null},f.prototype.get=function(o){var n=v.createID(o);return this.map[n]},f.prototype.keySet=function(){return this.keys},w.exports=f},function(w,R,D){var v=D(14);function f(){this.set={}}f.prototype.add=function(o){var n=v.createID(o);if(!this.contains(n))this.set[n]=o},f.prototype.remove=function(o){delete this.set[v.createID(o)]},f.prototype.clear=function(){this.set={}},f.prototype.contains=function(o){return this.set[v.createID(o)]==o},f.prototype.isEmpty=function(){return this.size()===0},f.prototype.size=function(){return Object.keys(this.set).length},f.prototype.addAllTo=function(o){var n=Object.keys(this.set),a=n.length;for(var u=0;u<a;u++)o.push(this.set[n[u]])},f.prototype.size=function(){return Object.keys(this.set).length},f.prototype.addAll=function(o){var n=o.length;for(var a=0;a<n;a++){var u=o[a];this.add(u)}},w.exports=f},function(w,R,D){function v(){}v.multMat=function(f,o){var n=[];for(var a=0;a<f.length;a++){n[a]=[];for(var u=0;u<o[0].length;u++){n[a][u]=0;for(var r=0;r<f[0].length;r++)n[a][u]+=f[a][r]*o[r][u]}}return n},v.transpose=function(f){var o=[];for(var n=0;n<f[0].length;n++){o[n]=[];for(var a=0;a<f.length;a++)o[n][a]=f[a][n]}return o},v.multCons=function(f,o){var n=[];for(var a=0;a<f.length;a++)n[a]=f[a]*o;return n},v.minusOp=function(f,o){var n=[];for(var a=0;a<f.length;a++)n[a]=f[a]-o[a];return n},v.dotProduct=function(f,o){var n=0;for(var a=0;a<f.length;a++)n+=f[a]*o[a];return n},v.mag=function(f){return Math.sqrt(this.dotProduct(f,f))},v.normalize=function(f){var o=[],n=this.mag(f);for(var a=0;a<f.length;a++)o[a]=f[a]/n;return o},v.multGamma=function(f){var o=[],n=0;for(var a=0;a<f.length;a++)n+=f[a];n*=-1/f.length;for(var u=0;u<f.length;u++)o[u]=n+f[u];return o},v.multL=function(f,o,n){var a=[],u=[],r=[];for(var y=0;y<o[0].length;y++){var i=0;for(var e=0;e<o.length;e++)i+=-0.5*o[e][y]*f[e];u[y]=i}for(var g=0;g<n.length;g++){var d=0;for(var c=0;c<n.length;c++)d+=n[g][c]*u[c];r[g]=d}for(var x=0;x<o.length;x++){var T=0;for(var N=0;N<o[0].length;N++)T+=o[x][N]*r[N];a[x]=T}return a},w.exports=v},function(w,R,D){var v=function(){function a(u,r){for(var y=0;y<r.length;y++){var i=r[y];if(i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i)i.writable=!0;Object.defineProperty(u,i.key,i)}}return function(u,r,y){if(r)a(u.prototype,r);if(y)a(u,y);return u}}();function f(a,u){if(!(a instanceof u))throw TypeError("Cannot call a class as a function")}var o=D(11),n=function(){function a(u,r){if(f(this,a),r!==null||r!==void 0)this.compareFunction=this._defaultCompareFunction;var y=void 0;if(u instanceof o)y=u.size();else y=u.length;this._quicksort(u,0,y-1)}return v(a,[{key:"_quicksort",value:function(r,y,i){if(y<i){var e=this._partition(r,y,i);this._quicksort(r,y,e),this._quicksort(r,e+1,i)}}},{key:"_partition",value:function(r,y,i){var e=this._get(r,y),g=y,d=i;while(!0){while(this.compareFunction(e,this._get(r,d)))d--;while(this.compareFunction(this._get(r,g),e))g++;if(g<d)this._swap(r,g,d),g++,d--;else return d}}},{key:"_get",value:function(r,y){if(r instanceof o)return r.get_object_at(y);else return r[y]}},{key:"_set",value:function(r,y,i){if(r instanceof o)r.set_object_at(y,i);else r[y]=i}},{key:"_swap",value:function(r,y,i){var e=this._get(r,y);this._set(r,y,this._get(r,i)),this._set(r,i,e)}},{key:"_defaultCompareFunction",value:function(r,y){return y>r}}]),a}();w.exports=n},function(w,R,D){function v(){}v.svd=function(f){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=f.length,this.n=f[0].length;var o=Math.min(this.m,this.n);this.s=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(Math.min(this.m+1,this.n)),this.U=function(Wt){var bt=function oe($t){if($t.length==0)return 0;else{var jt=[];for(var ne=0;ne<$t[0];ne++)jt.push(oe($t.slice(1)));return jt}};return bt(Wt)}([this.m,o]),this.V=function(Wt){var bt=function oe($t){if($t.length==0)return 0;else{var jt=[];for(var ne=0;ne<$t[0];ne++)jt.push(oe($t.slice(1)));return jt}};return bt(Wt)}([this.n,this.n]);var n=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(this.n),a=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(this.m),u=!0,r=!0,y=Math.min(this.m-1,this.n),i=Math.max(0,Math.min(this.n-2,this.m));for(var e=0;e<Math.max(y,i);e++){if(e<y){this.s[e]=0;for(var g=e;g<this.m;g++)this.s[e]=v.hypot(this.s[e],f[g][e]);if(this.s[e]!==0){if(f[e][e]<0)this.s[e]=-this.s[e];for(var d=e;d<this.m;d++)f[d][e]/=this.s[e];f[e][e]+=1}this.s[e]=-this.s[e]}for(var c=e+1;c<this.n;c++){if(function(Wt,bt){return Wt&&bt}(e<y,this.s[e]!==0)){var x=0;for(var T=e;T<this.m;T++)x+=f[T][e]*f[T][c];x=-x/f[e][e];for(var N=e;N<this.m;N++)f[N][c]+=x*f[N][e]}n[c]=f[e][c]}if(function(Wt,bt){return Wt&&bt}(u,e<y))for(var O=e;O<this.m;O++)this.U[O][e]=f[O][e];if(e<i){n[e]=0;for(var X=e+1;X<this.n;X++)n[e]=v.hypot(n[e],n[X]);if(n[e]!==0){if(n[e+1]<0)n[e]=-n[e];for(var I=e+1;I<this.n;I++)n[I]/=n[e];n[e+1]+=1}if(n[e]=-n[e],function(Wt,bt){return Wt&&bt}(e+1<this.m,n[e]!==0)){for(var V=e+1;V<this.m;V++)a[V]=0;for(var _=e+1;_<this.n;_++)for(var Q=e+1;Q<this.m;Q++)a[Q]+=n[_]*f[Q][_];for(var lt=e+1;lt<this.n;lt++){var P=-n[lt]/n[e+1];for(var tt=e+1;tt<this.m;tt++)f[tt][lt]+=P*a[tt]}}if(r)for(var s=e+1;s<this.n;s++)this.V[s][e]=n[s]}}var L=Math.min(this.n,this.m+1);if(y<this.n)this.s[y]=f[y][y];if(this.m<L)this.s[L-1]=0;if(i+1<L)n[i]=f[i][L-1];if(n[L-1]=0,u){for(var E=y;E<o;E++){for(var A=0;A<this.m;A++)this.U[A][E]=0;this.U[E][E]=1}for(var m=y-1;m>=0;m--)if(this.s[m]!==0){for(var U=m+1;U<o;U++){var b=0;for(var k=m;k<this.m;k++)b+=this.U[k][m]*this.U[k][U];b=-b/this.U[m][m];for(var B=m;B<this.m;B++)this.U[B][U]+=b*this.U[B][m]}for(var W=m;W<this.m;W++)this.U[W][m]=-this.U[W][m];this.U[m][m]=1+this.U[m][m];for(var st=0;st<m-1;st++)this.U[st][m]=0}else{for(var dt=0;dt<this.m;dt++)this.U[dt][m]=0;this.U[m][m]=1}}if(r)for(var Z=this.n-1;Z>=0;Z--){if(function(Wt,bt){return Wt&&bt}(Z<i,n[Z]!==0))for(var ut=Z+1;ut<o;ut++){var nt=0;for(var S=Z+1;S<this.n;S++)nt+=this.V[S][Z]*this.V[S][ut];nt=-nt/this.V[Z+1][Z];for(var K=Z+1;K<this.n;K++)this.V[K][ut]+=nt*this.V[K][Z]}for(var et=0;et<this.n;et++)this.V[et][Z]=0;this.V[Z][Z]=1}var ct=L-1,Nt=0,Pt=Math.pow(2,-52),Bt=Math.pow(2,-966);while(L>0){var ft=void 0,Jt=void 0;for(ft=L-2;ft>=-1;ft--){if(ft===-1)break;if(Math.abs(n[ft])<=Bt+Pt*(Math.abs(this.s[ft])+Math.abs(this.s[ft+1]))){n[ft]=0;break}}if(ft===L-2)Jt=4;else{var Xt=void 0;for(Xt=L-1;Xt>=ft;Xt--){if(Xt===ft)break;var Et=(Xt!==L?Math.abs(n[Xt]):0)+(Xt!==ft+1?Math.abs(n[Xt-1]):0);if(Math.abs(this.s[Xt])<=Bt+Pt*Et){this.s[Xt]=0;break}}if(Xt===ft)Jt=3;else if(Xt===L-1)Jt=1;else Jt=2,ft=Xt}switch(ft++,Jt){case 1:{var vt=n[L-2];n[L-2]=0;for(var xt=L-2;xt>=ft;xt--){var Rt=v.hypot(this.s[xt],vt),Gt=this.s[xt]/Rt,St=vt/Rt;if(this.s[xt]=Rt,xt!==ft)vt=-St*n[xt-1],n[xt-1]=Gt*n[xt-1];if(r)for(var Ft=0;Ft<this.n;Ft++)Rt=Gt*this.V[Ft][xt]+St*this.V[Ft][L-1],this.V[Ft][L-1]=-St*this.V[Ft][xt]+Gt*this.V[Ft][L-1],this.V[Ft][xt]=Rt}}break;case 2:{var Ht=n[ft-1];n[ft-1]=0;for(var zt=ft;zt<L;zt++){var te=v.hypot(this.s[zt],Ht),qt=this.s[zt]/te,Kt=Ht/te;if(this.s[zt]=te,Ht=-Kt*n[zt],n[zt]=qt*n[zt],u)for(var kt=0;kt<this.m;kt++)te=qt*this.U[kt][zt]+Kt*this.U[kt][ft-1],this.U[kt][ft-1]=-Kt*this.U[kt][zt]+qt*this.U[kt][ft-1],this.U[kt][zt]=te}}break;case 3:{var J=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[L-1]),Math.abs(this.s[L-2])),Math.abs(n[L-2])),Math.abs(this.s[ft])),Math.abs(n[ft])),rt=this.s[L-1]/J,it=this.s[L-2]/J,at=n[L-2]/J,ot=this.s[ft]/J,gt=n[ft]/J,At=((it+rt)*(it-rt)+at*at)/2,Mt=rt*at*(rt*at),ht=0;if(function(Wt,bt){return Wt||bt}(At!==0,Mt!==0)){if(ht=Math.sqrt(At*At+Mt),At<0)ht=-ht;ht=Mt/(At+ht)}var Lt=(ot+rt)*(ot-rt)+ht,Ct=ot*gt;for(var pt=ft;pt<L-1;pt++){var Ot=v.hypot(Lt,Ct),Ut=Lt/Ot,Tt=Ct/Ot;if(pt!==ft)n[pt-1]=Ot;if(Lt=Ut*this.s[pt]+Tt*n[pt],n[pt]=Ut*n[pt]-Tt*this.s[pt],Ct=Tt*this.s[pt+1],this.s[pt+1]=Ut*this.s[pt+1],r)for(var yt=0;yt<this.n;yt++)Ot=Ut*this.V[yt][pt]+Tt*this.V[yt][pt+1],this.V[yt][pt+1]=-Tt*this.V[yt][pt]+Ut*this.V[yt][pt+1],this.V[yt][pt]=Ot;if(Ot=v.hypot(Lt,Ct),Ut=Lt/Ot,Tt=Ct/Ot,this.s[pt]=Ot,Lt=Ut*n[pt]+Tt*this.s[pt+1],this.s[pt+1]=-Tt*n[pt]+Ut*this.s[pt+1],Ct=Tt*n[pt+1],n[pt+1]=Ut*n[pt+1],u&&pt<this.m-1)for(var Dt=0;Dt<this.m;Dt++)Ot=Ut*this.U[Dt][pt]+Tt*this.U[Dt][pt+1],this.U[Dt][pt+1]=-Tt*this.U[Dt][pt]+Ut*this.U[Dt][pt+1],this.U[Dt][pt]=Ot}n[L-2]=Lt,Nt=Nt+1}break;case 4:{if(this.s[ft]<=0){if(this.s[ft]=this.s[ft]<0?-this.s[ft]:0,r)for(var mt=0;mt<=ct;mt++)this.V[mt][ft]=-this.V[mt][ft]}while(ft<ct){if(this.s[ft]>=this.s[ft+1])break;var wt=this.s[ft];if(this.s[ft]=this.s[ft+1],this.s[ft+1]=wt,r&&ft<this.n-1)for(var Zt=0;Zt<this.n;Zt++)wt=this.V[Zt][ft+1],this.V[Zt][ft+1]=this.V[Zt][ft],this.V[Zt][ft]=wt;if(u&&ft<this.m-1)for(var Vt=0;Vt<this.m;Vt++)wt=this.U[Vt][ft+1],this.U[Vt][ft+1]=this.U[Vt][ft],this.U[Vt][ft]=wt;ft++}Nt=0,L--}break}}var re={U:this.U,V:this.V,S:this.s};return re},v.hypot=function(f,o){var n=void 0;if(Math.abs(f)>Math.abs(o))n=o/f,n=Math.abs(f)*Math.sqrt(1+n*n);else if(o!=0)n=f/o,n=Math.abs(o)*Math.sqrt(1+n*n);else n=0;return n},w.exports=v},function(w,R,D){var v=function(){function n(a,u){for(var r=0;r<u.length;r++){var y=u[r];if(y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y)y.writable=!0;Object.defineProperty(a,y.key,y)}}return function(a,u,r){if(u)n(a.prototype,u);if(r)n(a,r);return a}}();function f(n,a){if(!(n instanceof a))throw TypeError("Cannot call a class as a function")}var o=function(){function n(a,u){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;f(this,n),this.sequence1=a,this.sequence2=u,this.match_score=r,this.mismatch_penalty=y,this.gap_penalty=i,this.iMax=a.length+1,this.jMax=u.length+1,this.grid=Array(this.iMax);for(var e=0;e<this.iMax;e++){this.grid[e]=Array(this.jMax);for(var g=0;g<this.jMax;g++)this.grid[e][g]=0}this.tracebackGrid=Array(this.iMax);for(var d=0;d<this.iMax;d++){this.tracebackGrid[d]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.tracebackGrid[d][c]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return v(n,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var u=1;u<this.jMax;u++)this.grid[0][u]=this.grid[0][u-1]+this.gap_penalty,this.tracebackGrid[0][u]=[!1,!1,!0];for(var r=1;r<this.iMax;r++)this.grid[r][0]=this.grid[r-1][0]+this.gap_penalty,this.tracebackGrid[r][0]=[!1,!0,!1];for(var y=1;y<this.iMax;y++)for(var i=1;i<this.jMax;i++){var e=void 0;if(this.sequence1[y-1]===this.sequence2[i-1])e=this.grid[y-1][i-1]+this.match_score;else e=this.grid[y-1][i-1]+this.mismatch_penalty;var g=this.grid[y-1][i]+this.gap_penalty,d=this.grid[y][i-1]+this.gap_penalty,c=[e,g,d],x=this.arrayAllMaxIndexes(c);this.grid[y][i]=c[x[0]],this.tracebackGrid[y][i]=[x.includes(0),x.includes(1),x.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var u=[];u.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(u[0]){var r=u[0],y=this.tracebackGrid[r.pos[0]][r.pos[1]];if(y[0])u.push({pos:[r.pos[0]-1,r.pos[1]-1],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(y[1])u.push({pos:[r.pos[0]-1,r.pos[1]],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:"-"+r.seq2});if(y[2])u.push({pos:[r.pos[0],r.pos[1]-1],seq1:"-"+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(r.pos[0]===0&&r.pos[1]===0)this.alignments.push({sequence1:r.seq1,sequence2:r.seq2});u.shift()}return this.alignments}},{key:"getAllIndexes",value:function(u,r){var y=[],i=-1;while((i=u.indexOf(r,i+1))!==-1)y.push(i);return y}},{key:"arrayAllMaxIndexes",value:function(u){return this.getAllIndexes(u,Math.max.apply(null,u))}}]),n}();w.exports=o},function(w,R,D){var v=function(){return};v.FDLayout=D(18),v.FDLayoutConstants=D(4),v.FDLayoutEdge=D(19),v.FDLayoutNode=D(20),v.DimensionD=D(21),v.HashMap=D(22),v.HashSet=D(23),v.IGeometry=D(8),v.IMath=D(9),v.Integer=D(10),v.Point=D(12),v.PointD=D(5),v.RandomSeed=D(16),v.RectangleD=D(13),v.Transform=D(17),v.UniqueIDGeneretor=D(14),v.Quicksort=D(25),v.LinkedList=D(11),v.LGraphObject=D(2),v.LGraph=D(6),v.LEdge=D(1),v.LGraphManager=D(7),v.LNode=D(3),v.Layout=D(15),v.LayoutConstants=D(0),v.NeedlemanWunsch=D(27),v.Matrix=D(24),v.SVD=D(26),w.exports=v},function(w,R,D){function v(){this.listeners=[]}var f=v.prototype;f.addListener=function(o,n){this.listeners.push({event:o,callback:n})},f.removeListener=function(o,n){for(var a=this.listeners.length;a>=0;a--){var u=this.listeners[a];if(u.event===o&&u.callback===n)this.listeners.splice(a,1)}},f.emit=function(o,n){for(var a=0;a<this.listeners.length;a++){var u=this.listeners[a];if(o===u.event)u.callback(n)}},w.exports=v}])})});var be=Nn(function(Te,Fe){(function(R,D){if(typeof Te==="object"&&typeof Fe==="object")Fe.exports=D(Se());else if(typeof define==="function"&&define.amd)define(["layout-base"],D);else if(typeof Te==="object")Te.coseBase=D(Se());else R.coseBase=D(R.layoutBase)})(Te,function(w){return(()=>{var R={45:(o,n,a)=>{var u={};u.layoutBase=a(551),u.CoSEConstants=a(806),u.CoSEEdge=a(767),u.CoSEGraph=a(880),u.CoSEGraphManager=a(578),u.CoSELayout=a(765),u.CoSENode=a(991),u.ConstraintHandler=a(902),o.exports=u},806:(o,n,a)=>{var u=a(551).FDLayoutConstants;function r(){}for(var y in u)r[y]=u[y];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,o.exports=r},767:(o,n,a)=>{var u=a(551).FDLayoutEdge;function r(i,e,g){u.call(this,i,e,g)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},880:(o,n,a)=>{var u=a(551).LGraph;function r(i,e,g){u.call(this,i,e,g)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},578:(o,n,a)=>{var u=a(551).LGraphManager;function r(i){u.call(this,i)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},765:(o,n,a)=>{var u=a(551).FDLayout,r=a(578),y=a(880),i=a(991),e=a(767),g=a(806),d=a(902),c=a(551).FDLayoutConstants,x=a(551).LayoutConstants,T=a(551).Point,N=a(551).PointD,O=a(551).DimensionD,X=a(551).Layout,I=a(551).Integer,V=a(551).IGeometry,_=a(551).LGraph,Q=a(551).Transform,lt=a(551).LinkedList;function P(){u.call(this),this.toBeTiled={},this.constraints={}}P.prototype=Object.create(u.prototype);for(var tt in u)P[tt]=u[tt];P.prototype.newGraphManager=function(){var s=new r(this);return this.graphManager=s,s},P.prototype.newGraph=function(s){return new y(null,this.graphManager,s)},P.prototype.newNode=function(s){return new i(this.graphManager,s)},P.prototype.newEdge=function(s){return new e(null,null,s)},P.prototype.initParameters=function(){if(u.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(g.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=g.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=g.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},P.prototype.initSpringEmbedder=function(){u.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},P.prototype.layout=function(){var s=x.DEFAULT_CREATE_BENDS_AS_NEEDED;if(s)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},P.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),!this.incremental){var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var L=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(A){return L.has(A)});this.graphManager.setAllNodesToApplyGravitation(E),this.positionNodesRandomly()}}else if(g.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var L=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(U){return L.has(U)});this.graphManager.setAllNodesToApplyGravitation(E)}if(Object.keys(this.constraints).length>0)d.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),g.APPLY_LAYOUT)this.runSpringEmbedder();return!0},P.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(this.layoutQuality==1)this.coolingAdjuster=this.coolingCycle/3;this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),L=this.nodesWithGravity.filter(function(m){return s.has(m)});if(this.graphManager.setAllNodesToApplyGravitation(L),this.graphManager.updateBounds(),this.updateGrid(),g.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();if(g.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var E=!this.isTreeGrowing&&!this.isGrowthFinished,A=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(E,A),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},P.prototype.getPositionsData=function(){var s=this.graphManager.getAllNodes(),L={};for(var E=0;E<s.length;E++){var A=s[E].rect,m=s[E].id;L[m]={id:m,x:A.getCenterX(),y:A.getCenterY(),w:A.width,h:A.height}}return L},P.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(c.ANIMATE==="during")this.emit("layoutstarted");else{while(!s)s=this.tick();this.graphManager.updateBounds()}},P.prototype.moveNodes=function(){var s=this.getAllNodes(),L;for(var E=0;E<s.length;E++)L=s[E],L.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var E=0;E<s.length;E++)L=s[E],L.move()},P.prototype.initConstraintVariables=function(){var s=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var L=this.graphManager.getAllNodes();for(var E=0;E<L.length;E++){var A=L[E];this.idToNodeMap.set(A.id,A)}var m=function S(K){var et=K.getChild().getNodes(),ct,Nt=0;for(var Pt=0;Pt<et.length;Pt++)if(ct=et[Pt],ct.getChild()==null){if(s.fixedNodeSet.has(ct.id))Nt+=100}else Nt+=S(ct);return Nt};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(et){s.fixedNodeSet.add(et.nodeId)});var L=this.graphManager.getAllNodes(),A;for(var E=0;E<L.length;E++)if(A=L[E],A.getChild()!=null){var U=m(A);if(U>0)A.fixedNodeWeight=U}}if(this.constraints.relativePlacementConstraint){var b=new Map,k=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(S){s.fixedNodesOnHorizontal.add(S),s.fixedNodesOnVertical.add(S)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var B=this.constraints.alignmentConstraint.vertical;for(var E=0;E<B.length;E++)this.dummyToNodeForVerticalAlignment.set("dummy"+E,[]),B[E].forEach(function(K){if(b.set(K,"dummy"+E),s.dummyToNodeForVerticalAlignment.get("dummy"+E).push(K),s.fixedNodeSet.has(K))s.fixedNodesOnHorizontal.add("dummy"+E)})}if(this.constraints.alignmentConstraint.horizontal){var W=this.constraints.alignmentConstraint.horizontal;for(var E=0;E<W.length;E++)this.dummyToNodeForHorizontalAlignment.set("dummy"+E,[]),W[E].forEach(function(K){if(k.set(K,"dummy"+E),s.dummyToNodeForHorizontalAlignment.get("dummy"+E).push(K),s.fixedNodeSet.has(K))s.fixedNodesOnVertical.add("dummy"+E)})}}if(g.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(S){var K,et,ct;for(ct=S.length-1;ct>=2*S.length/3;ct--)K=Math.floor(Math.random()*(ct+1)),et=S[ct],S[ct]=S[K],S[K]=et;return S},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(S){if(S.left){var K=b.has(S.left)?b.get(S.left):S.left,et=b.has(S.right)?b.get(S.right):S.right;if(!s.nodesInRelativeHorizontal.includes(K))if(s.nodesInRelativeHorizontal.push(K),s.nodeToRelativeConstraintMapHorizontal.set(K,[]),s.dummyToNodeForVerticalAlignment.has(K))s.nodeToTempPositionMapHorizontal.set(K,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(K)[0]).getCenterX());else s.nodeToTempPositionMapHorizontal.set(K,s.idToNodeMap.get(K).getCenterX());if(!s.nodesInRelativeHorizontal.includes(et))if(s.nodesInRelativeHorizontal.push(et),s.nodeToRelativeConstraintMapHorizontal.set(et,[]),s.dummyToNodeForVerticalAlignment.has(et))s.nodeToTempPositionMapHorizontal.set(et,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(et)[0]).getCenterX());else s.nodeToTempPositionMapHorizontal.set(et,s.idToNodeMap.get(et).getCenterX());s.nodeToRelativeConstraintMapHorizontal.get(K).push({right:et,gap:S.gap}),s.nodeToRelativeConstraintMapHorizontal.get(et).push({left:K,gap:S.gap})}else{var ct=k.has(S.top)?k.get(S.top):S.top,Nt=k.has(S.bottom)?k.get(S.bottom):S.bottom;if(!s.nodesInRelativeVertical.includes(ct))if(s.nodesInRelativeVertical.push(ct),s.nodeToRelativeConstraintMapVertical.set(ct,[]),s.dummyToNodeForHorizontalAlignment.has(ct))s.nodeToTempPositionMapVertical.set(ct,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(ct)[0]).getCenterY());else s.nodeToTempPositionMapVertical.set(ct,s.idToNodeMap.get(ct).getCenterY());if(!s.nodesInRelativeVertical.includes(Nt))if(s.nodesInRelativeVertical.push(Nt),s.nodeToRelativeConstraintMapVertical.set(Nt,[]),s.dummyToNodeForHorizontalAlignment.has(Nt))s.nodeToTempPositionMapVertical.set(Nt,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(Nt)[0]).getCenterY());else s.nodeToTempPositionMapVertical.set(Nt,s.idToNodeMap.get(Nt).getCenterY());s.nodeToRelativeConstraintMapVertical.get(ct).push({bottom:Nt,gap:S.gap}),s.nodeToRelativeConstraintMapVertical.get(Nt).push({top:ct,gap:S.gap})}});else{var st=new Map,dt=new Map;this.constraints.relativePlacementConstraint.forEach(function(S){if(S.left){var K=b.has(S.left)?b.get(S.left):S.left,et=b.has(S.right)?b.get(S.right):S.right;if(st.has(K))st.get(K).push(et);else st.set(K,[et]);if(st.has(et))st.get(et).push(K);else st.set(et,[K])}else{var ct=k.has(S.top)?k.get(S.top):S.top,Nt=k.has(S.bottom)?k.get(S.bottom):S.bottom;if(dt.has(ct))dt.get(ct).push(Nt);else dt.set(ct,[Nt]);if(dt.has(Nt))dt.get(Nt).push(ct);else dt.set(Nt,[ct])}});var Z=function(K,et){var ct=[],Nt=[],Pt=new lt,Bt=new Set,ft=0;return K.forEach(function(Jt,Xt){if(!Bt.has(Xt)){ct[ft]=[],Nt[ft]=!1;var Et=Xt;Pt.push(Et),Bt.add(Et),ct[ft].push(Et);while(Pt.length!=0){if(Et=Pt.shift(),et.has(Et))Nt[ft]=!0;var vt=K.get(Et);vt.forEach(function(xt){if(!Bt.has(xt))Pt.push(xt),Bt.add(xt),ct[ft].push(xt)})}ft++}}),{components:ct,isFixed:Nt}},ut=Z(st,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=ut.components,this.fixedComponentsOnHorizontal=ut.isFixed;var nt=Z(dt,s.fixedNodesOnVertical);this.componentsOnVertical=nt.components,this.fixedComponentsOnVertical=nt.isFixed}}},P.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(nt){var S=s.idToNodeMap.get(nt.nodeId);S.displacementX=0,S.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var L=this.constraints.alignmentConstraint.vertical;for(var E=0;E<L.length;E++){var A=0;for(var m=0;m<L[E].length;m++){if(this.fixedNodeSet.has(L[E][m])){A=0;break}A+=this.idToNodeMap.get(L[E][m]).displacementX}var U=A/L[E].length;for(var m=0;m<L[E].length;m++)this.idToNodeMap.get(L[E][m]).displacementX=U}}if(this.constraints.alignmentConstraint.horizontal){var b=this.constraints.alignmentConstraint.horizontal;for(var E=0;E<b.length;E++){var k=0;for(var m=0;m<b[E].length;m++){if(this.fixedNodeSet.has(b[E][m])){k=0;break}k+=this.idToNodeMap.get(b[E][m]).displacementY}var B=k/b[E].length;for(var m=0;m<b[E].length;m++)this.idToNodeMap.get(b[E][m]).displacementY=B}}}if(this.constraints.relativePlacementConstraint)if(g.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(nt){if(!s.fixedNodesOnHorizontal.has(nt)){var S=0;if(s.dummyToNodeForVerticalAlignment.has(nt))S=s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(nt)[0]).displacementX;else S=s.idToNodeMap.get(nt).displacementX;if(s.nodeToRelativeConstraintMapHorizontal.get(nt).forEach(function(K){if(K.right){var et=s.nodeToTempPositionMapHorizontal.get(K.right)-s.nodeToTempPositionMapHorizontal.get(nt)-S;if(et<K.gap)S-=K.gap-et}else{var et=s.nodeToTempPositionMapHorizontal.get(nt)-s.nodeToTempPositionMapHorizontal.get(K.left)+S;if(et<K.gap)S+=K.gap-et}}),s.nodeToTempPositionMapHorizontal.set(nt,s.nodeToTempPositionMapHorizontal.get(nt)+S),s.dummyToNodeForVerticalAlignment.has(nt))s.dummyToNodeForVerticalAlignment.get(nt).forEach(function(K){s.idToNodeMap.get(K).displacementX=S});else s.idToNodeMap.get(nt).displacementX=S}}),this.nodesInRelativeVertical.forEach(function(nt){if(!s.fixedNodesOnHorizontal.has(nt)){var S=0;if(s.dummyToNodeForHorizontalAlignment.has(nt))S=s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(nt)[0]).displacementY;else S=s.idToNodeMap.get(nt).displacementY;if(s.nodeToRelativeConstraintMapVertical.get(nt).forEach(function(K){if(K.bottom){var et=s.nodeToTempPositionMapVertical.get(K.bottom)-s.nodeToTempPositionMapVertical.get(nt)-S;if(et<K.gap)S-=K.gap-et}else{var et=s.nodeToTempPositionMapVertical.get(nt)-s.nodeToTempPositionMapVertical.get(K.top)+S;if(et<K.gap)S+=K.gap-et}}),s.nodeToTempPositionMapVertical.set(nt,s.nodeToTempPositionMapVertical.get(nt)+S),s.dummyToNodeForHorizontalAlignment.has(nt))s.dummyToNodeForHorizontalAlignment.get(nt).forEach(function(K){s.idToNodeMap.get(K).displacementY=S});else s.idToNodeMap.get(nt).displacementY=S}})}else{for(var E=0;E<this.componentsOnHorizontal.length;E++){var W=this.componentsOnHorizontal[E];if(this.fixedComponentsOnHorizontal[E])for(var m=0;m<W.length;m++)if(this.dummyToNodeForVerticalAlignment.has(W[m]))this.dummyToNodeForVerticalAlignment.get(W[m]).forEach(function(K){s.idToNodeMap.get(K).displacementX=0});else this.idToNodeMap.get(W[m]).displacementX=0;else{var st=0,dt=0;for(var m=0;m<W.length;m++)if(this.dummyToNodeForVerticalAlignment.has(W[m])){var Z=this.dummyToNodeForVerticalAlignment.get(W[m]);st+=Z.length*this.idToNodeMap.get(Z[0]).displacementX,dt+=Z.length}else st+=this.idToNodeMap.get(W[m]).displacementX,dt++;var ut=st/dt;for(var m=0;m<W.length;m++)if(this.dummyToNodeForVerticalAlignment.has(W[m]))this.dummyToNodeForVerticalAlignment.get(W[m]).forEach(function(K){s.idToNodeMap.get(K).displacementX=ut});else this.idToNodeMap.get(W[m]).displacementX=ut}}for(var E=0;E<this.componentsOnVertical.length;E++){var W=this.componentsOnVertical[E];if(this.fixedComponentsOnVertical[E])for(var m=0;m<W.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(W[m]))this.dummyToNodeForHorizontalAlignment.get(W[m]).forEach(function(et){s.idToNodeMap.get(et).displacementY=0});else this.idToNodeMap.get(W[m]).displacementY=0;else{var st=0,dt=0;for(var m=0;m<W.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(W[m])){var Z=this.dummyToNodeForHorizontalAlignment.get(W[m]);st+=Z.length*this.idToNodeMap.get(Z[0]).displacementY,dt+=Z.length}else st+=this.idToNodeMap.get(W[m]).displacementY,dt++;var ut=st/dt;for(var m=0;m<W.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(W[m]))this.dummyToNodeForHorizontalAlignment.get(W[m]).forEach(function(Pt){s.idToNodeMap.get(Pt).displacementY=ut});else this.idToNodeMap.get(W[m]).displacementY=ut}}}},P.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],L,E=this.graphManager.getGraphs(),A=E.length,m;for(m=0;m<A;m++)if(L=E[m],L.updateConnected(),!L.isConnected)s=s.concat(L.getNodes());return s},P.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var L=new Set,E;for(E=0;E<s.length;E++){var A=s[E];if(!L.has(A)){var m=A.getSource(),U=A.getTarget();if(m==U)A.getBendpoints().push(new N),A.getBendpoints().push(new N),this.createDummyNodesForBendpoints(A),L.add(A);else{var b=[];if(b=b.concat(m.getEdgeListToNode(U)),b=b.concat(U.getEdgeListToNode(m)),!L.has(b[0])){if(b.length>1){var k;for(k=0;k<b.length;k++){var B=b[k];B.getBendpoints().push(new N),this.createDummyNodesForBendpoints(B)}}b.forEach(function(W){L.add(W)})}}}if(L.size==s.length)break}},P.prototype.positionNodesRadially=function(s){var L=new T(0,0),E=Math.ceil(Math.sqrt(s.length)),A=0,m=0,U=0,b=new N(0,0);for(var k=0;k<s.length;k++){if(k%E==0){if(U=0,m=A,k!=0)m+=g.DEFAULT_COMPONENT_SEPERATION;A=0}var B=s[k],W=X.findCenterOfTree(B);if(L.x=U,L.y=m,b=P.radialLayout(B,W,L),b.y>A)A=Math.floor(b.y);U=Math.floor(b.x+g.DEFAULT_COMPONENT_SEPERATION)}this.transform(new N(x.WORLD_CENTER_X-b.x/2,x.WORLD_CENTER_Y-b.y/2))},P.radialLayout=function(s,L,E){var A=Math.max(this.maxDiagonalInTree(s),g.DEFAULT_RADIAL_SEPARATION);P.branchRadialLayout(L,null,0,359,0,A);var m=_.calculateBounds(s),U=new Q;U.setDeviceOrgX(m.getMinX()),U.setDeviceOrgY(m.getMinY()),U.setWorldOrgX(E.x),U.setWorldOrgY(E.y);for(var b=0;b<s.length;b++){var k=s[b];k.transform(U)}var B=new N(m.getMaxX(),m.getMaxY());return U.inverseTransformPoint(B)},P.branchRadialLayout=function(s,L,E,A,m,U){var b=(A-E+1)/2;if(b<0)b+=180;var k=(b+E)%360,B=k*V.TWO_PI/360,W=Math.cos(B),st=m*Math.cos(B),dt=m*Math.sin(B);s.setCenter(st,dt);var Z=[];Z=Z.concat(s.getEdges());var ut=Z.length;if(L!=null)ut--;var nt=0,S=Z.length,K,et=s.getEdgesBetween(L);while(et.length>1){var ct=et[0];et.splice(0,1);var Nt=Z.indexOf(ct);if(Nt>=0)Z.splice(Nt,1);S--,ut--}if(L!=null)K=(Z.indexOf(et[0])+1)%S;else K=0;var Pt=Math.abs(A-E)/ut;for(var Bt=K;nt!=ut;Bt=++Bt%S){var ft=Z[Bt].getOtherEnd(s);if(ft==L)continue;var Jt=(E+nt*Pt)%360,Xt=(Jt+Pt)%360;P.branchRadialLayout(ft,s,Jt,Xt,m+U,U),nt++}},P.maxDiagonalInTree=function(s){var L=I.MIN_VALUE;for(var E=0;E<s.length;E++){var A=s[E],m=A.getDiagonal();if(m>L)L=m}return L},P.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},P.prototype.groupZeroDegreeMembers=function(){var s=this,L={};this.memberGroups={},this.idToDummyNode={};var E=[],A=this.graphManager.getAllNodes();for(var m=0;m<A.length;m++){var U=A[m],b=U.getParent();if(this.getNodeDegreeWithChildren(U)===0&&(b.id==null||!this.getToBeTiled(b)))E.push(U)}for(var m=0;m<E.length;m++){var U=E[m],k=U.getParent().id;if(typeof L[k]>"u")L[k]=[];L[k]=L[k].concat(U)}Object.keys(L).forEach(function(B){if(L[B].length>1){var W="DummyCompound_"+B;s.memberGroups[W]=L[B];var st=L[B][0].getParent(),dt=new i(s.graphManager);dt.id=W,dt.paddingLeft=st.paddingLeft||0,dt.paddingRight=st.paddingRight||0,dt.paddingBottom=st.paddingBottom||0,dt.paddingTop=st.paddingTop||0,s.idToDummyNode[W]=dt;var Z=s.getGraphManager().add(s.newGraph(),dt),ut=st.getChild();ut.add(dt);for(var nt=0;nt<L[B].length;nt++){var S=L[B][nt];ut.remove(S),Z.add(S)}}})},P.prototype.clearCompounds=function(){var s={},L={};this.performDFSOnCompounds();for(var E=0;E<this.compoundOrder.length;E++)L[this.compoundOrder[E].id]=this.compoundOrder[E],s[this.compoundOrder[E].id]=[].concat(this.compoundOrder[E].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[E].getChild()),this.compoundOrder[E].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,L)},P.prototype.clearZeroDegreeMembers=function(){var s=this,L=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(E){var A=s.idToDummyNode[E];if(L[E]=s.tileNodes(s.memberGroups[E],A.paddingLeft+A.paddingRight),A.rect.width=L[E].width,A.rect.height=L[E].height,A.setCenter(L[E].centerX,L[E].centerY),A.labelMarginLeft=0,A.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var m=A.rect.width,U=A.rect.height;if(A.labelWidth){if(A.labelPosHorizontal=="left")A.rect.x-=A.labelWidth,A.setWidth(m+A.labelWidth),A.labelMarginLeft=A.labelWidth;else if(A.labelPosHorizontal=="center"&&A.labelWidth>m)A.rect.x-=(A.labelWidth-m)/2,A.setWidth(A.labelWidth),A.labelMarginLeft=(A.labelWidth-m)/2;else if(A.labelPosHorizontal=="right")A.setWidth(m+A.labelWidth)}if(A.labelHeight){if(A.labelPosVertical=="top")A.rect.y-=A.labelHeight,A.setHeight(U+A.labelHeight),A.labelMarginTop=A.labelHeight;else if(A.labelPosVertical=="center"&&A.labelHeight>U)A.rect.y-=(A.labelHeight-U)/2,A.setHeight(A.labelHeight),A.labelMarginTop=(A.labelHeight-U)/2;else if(A.labelPosVertical=="bottom")A.setHeight(U+A.labelHeight)}}})},P.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var L=this.compoundOrder[s],{id:E,paddingLeft:A,paddingTop:m,labelMarginLeft:U,labelMarginTop:b}=L;this.adjustLocations(this.tiledMemberPack[E],L.rect.x,L.rect.y,A,m,U,b)}},P.prototype.repopulateZeroDegreeMembers=function(){var s=this,L=this.tiledZeroDegreePack;Object.keys(L).forEach(function(E){var A=s.idToDummyNode[E],{paddingLeft:m,paddingTop:U,labelMarginLeft:b,labelMarginTop:k}=A;s.adjustLocations(L[E],A.rect.x,A.rect.y,m,U,b,k)})},P.prototype.getToBeTiled=function(s){var L=s.id;if(this.toBeTiled[L]!=null)return this.toBeTiled[L];var E=s.getChild();if(E==null)return this.toBeTiled[L]=!1,!1;var A=E.getNodes();for(var m=0;m<A.length;m++){var U=A[m];if(this.getNodeDegree(U)>0)return this.toBeTiled[L]=!1,!1;if(U.getChild()==null){this.toBeTiled[U.id]=!1;continue}if(!this.getToBeTiled(U))return this.toBeTiled[L]=!1,!1}return this.toBeTiled[L]=!0,!0},P.prototype.getNodeDegree=function(s){var L=s.id,E=s.getEdges(),A=0;for(var m=0;m<E.length;m++){var U=E[m];if(U.getSource().id!==U.getTarget().id)A=A+1}return A},P.prototype.getNodeDegreeWithChildren=function(s){var L=this.getNodeDegree(s);if(s.getChild()==null)return L;var E=s.getChild().getNodes();for(var A=0;A<E.length;A++){var m=E[A];L+=this.getNodeDegreeWithChildren(m)}return L},P.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},P.prototype.fillCompexOrderByDFS=function(s){for(var L=0;L<s.length;L++){var E=s[L];if(E.getChild()!=null)this.fillCompexOrderByDFS(E.getChild().getNodes());if(this.getToBeTiled(E))this.compoundOrder.push(E)}},P.prototype.adjustLocations=function(s,L,E,A,m,U,b){L+=A+U,E+=m+b;var k=L;for(var B=0;B<s.rows.length;B++){var W=s.rows[B];L=k;var st=0;for(var dt=0;dt<W.length;dt++){var Z=W[dt];if(Z.rect.x=L,Z.rect.y=E,L+=Z.rect.width+s.horizontalPadding,Z.rect.height>st)st=Z.rect.height}E+=st+s.verticalPadding}},P.prototype.tileCompoundMembers=function(s,L){var E=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(A){var m=L[A];if(E.tiledMemberPack[A]=E.tileNodes(s[A],m.paddingLeft+m.paddingRight),m.rect.width=E.tiledMemberPack[A].width,m.rect.height=E.tiledMemberPack[A].height,m.setCenter(E.tiledMemberPack[A].centerX,E.tiledMemberPack[A].centerY),m.labelMarginLeft=0,m.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var U=m.rect.width,b=m.rect.height;if(m.labelWidth){if(m.labelPosHorizontal=="left")m.rect.x-=m.labelWidth,m.setWidth(U+m.labelWidth),m.labelMarginLeft=m.labelWidth;else if(m.labelPosHorizontal=="center"&&m.labelWidth>U)m.rect.x-=(m.labelWidth-U)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-U)/2;else if(m.labelPosHorizontal=="right")m.setWidth(U+m.labelWidth)}if(m.labelHeight){if(m.labelPosVertical=="top")m.rect.y-=m.labelHeight,m.setHeight(b+m.labelHeight),m.labelMarginTop=m.labelHeight;else if(m.labelPosVertical=="center"&&m.labelHeight>b)m.rect.y-=(m.labelHeight-b)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-b)/2;else if(m.labelPosVertical=="bottom")m.setHeight(b+m.labelHeight)}}})},P.prototype.tileNodes=function(s,L){var E=this.tileNodesByFavoringDim(s,L,!0),A=this.tileNodesByFavoringDim(s,L,!1),m=this.getOrgRatio(E),U=this.getOrgRatio(A),b;if(U<m)b=A;else b=E;return b},P.prototype.getOrgRatio=function(s){var{width:L,height:E}=s,A=L/E;if(A<1)A=1/A;return A},P.prototype.calcIdealRowWidth=function(s,L){var{TILING_PADDING_VERTICAL:E,TILING_PADDING_HORIZONTAL:A}=g,m=s.length,U=0,b=0,k=0;s.forEach(function(nt){if(U+=nt.getWidth(),b+=nt.getHeight(),nt.getWidth()>k)k=nt.getWidth()});var B=U/m,W=b/m,st=Math.pow(E-A,2)+4*(B+A)*(W+E)*m,dt=(A-E+Math.sqrt(st))/(2*(B+A)),Z;if(L){if(Z=Math.ceil(dt),Z==dt)Z++}else Z=Math.floor(dt);var ut=Z*(B+A)-A;if(k>ut)ut=k;return ut+=A*2,ut},P.prototype.tileNodesByFavoringDim=function(s,L,E){var{TILING_PADDING_VERTICAL:A,TILING_PADDING_HORIZONTAL:m,TILING_COMPARE_BY:U}=g,b={rows:[],rowWidth:[],rowHeight:[],width:0,height:L,verticalPadding:A,horizontalPadding:m,centerX:0,centerY:0};if(U)b.idealRowWidth=this.calcIdealRowWidth(s,E);var k=function(S){return S.rect.width*S.rect.height},B=function(S,K){return k(K)-k(S)};s.sort(function(nt,S){var K=B;if(b.idealRowWidth)return K=U,K(nt.id,S.id);return K(nt,S)});var W=0,st=0;for(var dt=0;dt<s.length;dt++){var Z=s[dt];W+=Z.getCenterX(),st+=Z.getCenterY()}b.centerX=W/s.length,b.centerY=st/s.length;for(var dt=0;dt<s.length;dt++){var Z=s[dt];if(b.rows.length==0)this.insertNodeToRow(b,Z,0,L);else if(this.canAddHorizontal(b,Z.rect.width,Z.rect.height)){var ut=b.rows.length-1;if(!b.idealRowWidth)ut=this.getShortestRowIndex(b);this.insertNodeToRow(b,Z,ut,L)}else this.insertNodeToRow(b,Z,b.rows.length,L);this.shiftToLastRow(b)}return b},P.prototype.insertNodeToRow=function(s,L,E,A){var m=A;if(E==s.rows.length){var U=[];s.rows.push(U),s.rowWidth.push(m),s.rowHeight.push(0)}var b=s.rowWidth[E]+L.rect.width;if(s.rows[E].length>0)b+=s.horizontalPadding;if(s.rowWidth[E]=b,s.width<b)s.width=b;var k=L.rect.height;if(E>0)k+=s.verticalPadding;var B=0;if(k>s.rowHeight[E])B=s.rowHeight[E],s.rowHeight[E]=k,B=s.rowHeight[E]-B;s.height+=B,s.rows[E].push(L)},P.prototype.getShortestRowIndex=function(s){var L=-1,E=Number.MAX_VALUE;for(var A=0;A<s.rows.length;A++)if(s.rowWidth[A]<E)L=A,E=s.rowWidth[A];return L},P.prototype.getLongestRowIndex=function(s){var L=-1,E=Number.MIN_VALUE;for(var A=0;A<s.rows.length;A++)if(s.rowWidth[A]>E)L=A,E=s.rowWidth[A];return L},P.prototype.canAddHorizontal=function(s,L,E){if(s.idealRowWidth){var A=s.rows.length-1,m=s.rowWidth[A];return m+L+s.horizontalPadding<=s.idealRowWidth}var U=this.getShortestRowIndex(s);if(U<0)return!0;var b=s.rowWidth[U];if(b+s.horizontalPadding+L<=s.width)return!0;var k=0;if(s.rowHeight[U]<E){if(U>0)k=E+s.verticalPadding-s.rowHeight[U]}var B;if(s.width-b>=L+s.horizontalPadding)B=(s.height+k)/(b+L+s.horizontalPadding);else B=(s.height+k)/s.width;k=E+s.verticalPadding;var W;if(s.width<L)W=(s.height+k)/L;else W=(s.height+k)/s.width;if(W<1)W=1/W;if(B<1)B=1/B;return B<W},P.prototype.shiftToLastRow=function(s){var L=this.getLongestRowIndex(s),E=s.rowWidth.length-1,A=s.rows[L],m=A[A.length-1],U=m.width+s.horizontalPadding;if(s.width-s.rowWidth[E]>U&&L!=E){A.splice(-1,1),s.rows[E].push(m),s.rowWidth[L]=s.rowWidth[L]-U,s.rowWidth[E]=s.rowWidth[E]+U,s.width=s.rowWidth[instance.getLongestRowIndex(s)];var b=Number.MIN_VALUE;for(var k=0;k<A.length;k++)if(A[k].height>b)b=A[k].height;if(L>0)b+=s.verticalPadding;var B=s.rowHeight[L]+s.rowHeight[E];if(s.rowHeight[L]=b,s.rowHeight[E]<m.height+s.verticalPadding)s.rowHeight[E]=m.height+s.verticalPadding;var W=s.rowHeight[L]+s.rowHeight[E];s.height+=W-B,this.shiftToLastRow(s)}},P.prototype.tilingPreLayout=function(){if(g.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},P.prototype.tilingPostLayout=function(){if(g.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},P.prototype.reduceTrees=function(){var s=[],L=!0,E;while(L){var A=this.graphManager.getAllNodes(),m=[];L=!1;for(var U=0;U<A.length;U++)if(E=A[U],E.getEdges().length==1&&!E.getEdges()[0].isInterGraph&&E.getChild()==null){if(g.PURE_INCREMENTAL){var b=E.getEdges()[0].getOtherEnd(E),k=new O(E.getCenterX()-b.getCenterX(),E.getCenterY()-b.getCenterY());m.push([E,E.getEdges()[0],E.getOwner(),k])}else m.push([E,E.getEdges()[0],E.getOwner()]);L=!0}if(L==!0){var B=[];for(var W=0;W<m.length;W++)if(m[W][0].getEdges().length==1)B.push(m[W]),m[W][0].getOwner().remove(m[W][0]);s.push(B),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},P.prototype.growTree=function(s){var L=s.length,E=s[L-1],A;for(var m=0;m<E.length;m++)A=E[m],this.findPlaceforPrunedNode(A),A[2].add(A[0]),A[2].add(A[1],A[1].source,A[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},P.prototype.findPlaceforPrunedNode=function(s){var L,E,A=s[0];if(A==s[1].source)E=s[1].target;else E=s[1].source;if(g.PURE_INCREMENTAL)A.setCenter(E.getCenterX()+s[3].getWidth(),E.getCenterY()+s[3].getHeight());else{var m=E.startX,U=E.finishX,b=E.startY,k=E.finishY,B=0,W=0,st=0,dt=0,Z=[B,st,W,dt];if(b>0)for(var ut=m;ut<=U;ut++)Z[0]+=this.grid[ut][b-1].length+this.grid[ut][b].length-1;if(U<this.grid.length-1)for(var ut=b;ut<=k;ut++)Z[1]+=this.grid[U+1][ut].length+this.grid[U][ut].length-1;if(k<this.grid[0].length-1)for(var ut=m;ut<=U;ut++)Z[2]+=this.grid[ut][k+1].length+this.grid[ut][k].length-1;if(m>0)for(var ut=b;ut<=k;ut++)Z[3]+=this.grid[m-1][ut].length+this.grid[m][ut].length-1;var nt=I.MAX_VALUE,S,K;for(var et=0;et<Z.length;et++)if(Z[et]<nt)nt=Z[et],S=1,K=et;else if(Z[et]==nt)S++;if(S==3&&nt==0){if(Z[0]==0&&Z[1]==0&&Z[2]==0)L=1;else if(Z[0]==0&&Z[1]==0&&Z[3]==0)L=0;else if(Z[0]==0&&Z[2]==0&&Z[3]==0)L=3;else if(Z[1]==0&&Z[2]==0&&Z[3]==0)L=2}else if(S==2&&nt==0){var ct=Math.floor(Math.random()*2);if(Z[0]==0&&Z[1]==0)if(ct==0)L=0;else L=1;else if(Z[0]==0&&Z[2]==0)if(ct==0)L=0;else L=2;else if(Z[0]==0&&Z[3]==0)if(ct==0)L=0;else L=3;else if(Z[1]==0&&Z[2]==0)if(ct==0)L=1;else L=2;else if(Z[1]==0&&Z[3]==0)if(ct==0)L=1;else L=3;else if(ct==0)L=2;else L=3}else if(S==4&&nt==0){var ct=Math.floor(Math.random()*4);L=ct}else L=K;if(L==0)A.setCenter(E.getCenterX(),E.getCenterY()-E.getHeight()/2-c.DEFAULT_EDGE_LENGTH-A.getHeight()/2);else if(L==1)A.setCenter(E.getCenterX()+E.getWidth()/2+c.DEFAULT_EDGE_LENGTH+A.getWidth()/2,E.getCenterY());else if(L==2)A.setCenter(E.getCenterX(),E.getCenterY()+E.getHeight()/2+c.DEFAULT_EDGE_LENGTH+A.getHeight()/2);else A.setCenter(E.getCenterX()-E.getWidth()/2-c.DEFAULT_EDGE_LENGTH-A.getWidth()/2,E.getCenterY())}},o.exports=P},991:(o,n,a)=>{var u=a(551).FDLayoutNode,r=a(551).IMath;function y(e,g,d,c){u.call(this,e,g,d,c)}y.prototype=Object.create(u.prototype);for(var i in u)y[i]=u[i];y.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight)this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight;else this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement)this.displacementX=e.coolingFactor*e.maxNodeDisplacement*r.sign(this.displacementX);if(Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement)this.displacementY=e.coolingFactor*e.maxNodeDisplacement*r.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},y.prototype.propogateDisplacementToChildren=function(e,g){var d=this.getChild().getNodes(),c;for(var x=0;x<d.length;x++)if(c=d[x],c.getChild()==null)c.displacementX+=e,c.displacementY+=g;else c.propogateDisplacementToChildren(e,g)},y.prototype.move=function(){var e=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),e.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY);this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},y.prototype.setPred1=function(e){this.pred1=e},y.prototype.getPred1=function(){return pred1},y.prototype.getPred2=function(){return pred2},y.prototype.setNext=function(e){this.next=e},y.prototype.getNext=function(){return next},y.prototype.setProcessed=function(e){this.processed=e},y.prototype.isProcessed=function(){return processed},o.exports=y},902:(o,n,a)=>{function u(d){if(Array.isArray(d)){for(var c=0,x=Array(d.length);c<d.length;c++)x[c]=d[c];return x}else return Array.from(d)}var r=a(806),y=a(551).LinkedList,i=a(551).Matrix,e=a(551).SVD;function g(){}g.handleConstraints=function(d){var c={};c.fixedNodeConstraint=d.constraints.fixedNodeConstraint,c.alignmentConstraint=d.constraints.alignmentConstraint,c.relativePlacementConstraint=d.constraints.relativePlacementConstraint;var x=new Map,T=new Map,N=[],O=[],X=d.getAllNodes(),I=0;for(var V=0;V<X.length;V++){var _=X[V];if(_.getChild()==null)T.set(_.id,I++),N.push(_.getCenterX()),O.push(_.getCenterY()),x.set(_.id,_)}if(c.relativePlacementConstraint)c.relativePlacementConstraint.forEach(function(J){if(!J.gap&&J.gap!=0)if(J.left)J.gap=r.DEFAULT_EDGE_LENGTH+x.get(J.left).getWidth()/2+x.get(J.right).getWidth()/2;else J.gap=r.DEFAULT_EDGE_LENGTH+x.get(J.top).getHeight()/2+x.get(J.bottom).getHeight()/2});var Q=function(rt,it){return{x:rt.x-it.x,y:rt.y-it.y}},lt=function(rt){var it=0,at=0;return rt.forEach(function(ot){it+=N[T.get(ot)],at+=O[T.get(ot)]}),{x:it/rt.size,y:at/rt.size}},P=function(rt,it,at,ot,gt){function At(Tt,yt){var Dt=new Set(Tt),mt=!0,wt=!1,Zt=void 0;try{for(var Vt=yt[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;Dt.add(Wt)}}catch(bt){wt=!0,Zt=bt}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}return Dt}var Mt=new Map;rt.forEach(function(Tt,yt){Mt.set(yt,0)}),rt.forEach(function(Tt,yt){Tt.forEach(function(Dt){Mt.set(Dt.id,Mt.get(Dt.id)+1)})});var ht=new Map,Lt=new Map,Ct=new y;if(Mt.forEach(function(Tt,yt){if(Tt==0){if(Ct.push(yt),!at)if(it=="horizontal")ht.set(yt,T.has(yt)?N[T.get(yt)]:ot.get(yt));else ht.set(yt,T.has(yt)?O[T.get(yt)]:ot.get(yt))}else ht.set(yt,Number.NEGATIVE_INFINITY);if(at)Lt.set(yt,new Set([yt]))}),at)gt.forEach(function(Tt){var yt=[];if(Tt.forEach(function(wt){if(at.has(wt))yt.push(wt)}),yt.length>0){var Dt=0;yt.forEach(function(wt){if(it=="horizontal")ht.set(wt,T.has(wt)?N[T.get(wt)]:ot.get(wt)),Dt+=ht.get(wt);else ht.set(wt,T.has(wt)?O[T.get(wt)]:ot.get(wt)),Dt+=ht.get(wt)}),Dt=Dt/yt.length,Tt.forEach(function(wt){if(!at.has(wt))ht.set(wt,Dt)})}else{var mt=0;Tt.forEach(function(wt){if(it=="horizontal")mt+=T.has(wt)?N[T.get(wt)]:ot.get(wt);else mt+=T.has(wt)?O[T.get(wt)]:ot.get(wt)}),mt=mt/Tt.length,Tt.forEach(function(wt){ht.set(wt,mt)})}});var pt=function(){var yt=Ct.shift(),Dt=rt.get(yt);Dt.forEach(function(mt){if(ht.get(mt.id)<ht.get(yt)+mt.gap)if(at&&at.has(mt.id)){var wt=void 0;if(it=="horizontal")wt=T.has(mt.id)?N[T.get(mt.id)]:ot.get(mt.id);else wt=T.has(mt.id)?O[T.get(mt.id)]:ot.get(mt.id);if(ht.set(mt.id,wt),wt<ht.get(yt)+mt.gap){var Zt=ht.get(yt)+mt.gap-wt;Lt.get(yt).forEach(function(Vt){ht.set(Vt,ht.get(Vt)-Zt)})}}else ht.set(mt.id,ht.get(yt)+mt.gap);if(Mt.set(mt.id,Mt.get(mt.id)-1),Mt.get(mt.id)==0)Ct.push(mt.id);if(at)Lt.set(mt.id,At(Lt.get(yt),Lt.get(mt.id)))})};while(Ct.length!=0)pt();if(at){var Ot=new Set;rt.forEach(function(Tt,yt){if(Tt.length==0)Ot.add(yt)});var Ut=[];Lt.forEach(function(Tt,yt){if(Ot.has(yt)){var Dt=!1,mt=!0,wt=!1,Zt=void 0;try{for(var Vt=Tt[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;if(at.has(Wt))Dt=!0}}catch($t){wt=!0,Zt=$t}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}if(!Dt){var bt=!1,oe=void 0;if(Ut.forEach(function($t,jt){if($t.has([].concat(u(Tt))[0]))bt=!0,oe=jt}),!bt)Ut.push(new Set(Tt));else Tt.forEach(function($t){Ut[oe].add($t)})}}}),Ut.forEach(function(Tt,yt){var{POSITIVE_INFINITY:Dt,POSITIVE_INFINITY:mt,NEGATIVE_INFINITY:wt,NEGATIVE_INFINITY:Zt}=Number,Vt=!0,re=!1,Wt=void 0;try{for(var bt=Tt[Symbol.iterator](),oe;!(Vt=(oe=bt.next()).done);Vt=!0){var $t=oe.value,jt=void 0;if(it=="horizontal")jt=T.has($t)?N[T.get($t)]:ot.get($t);else jt=T.has($t)?O[T.get($t)]:ot.get($t);var ne=ht.get($t);if(jt<Dt)Dt=jt;if(jt>wt)wt=jt;if(ne<mt)mt=ne;if(ne>Zt)Zt=ne}}catch(de){re=!0,Wt=de}finally{try{if(!Vt&&bt.return)bt.return()}finally{if(re)throw Wt}}var Ce=(Dt+wt)/2-(mt+Zt)/2,le=!0,ce=!1,ge=void 0;try{for(var fe=Tt[Symbol.iterator](),we;!(le=(we=fe.next()).done);le=!0){var ue=we.value;ht.set(ue,ht.get(ue)+Ce)}}catch(de){ce=!0,ge=de}finally{try{if(!le&&fe.return)fe.return()}finally{if(ce)throw ge}}})}return ht},tt=function(rt){var it=0,at=0,ot=0,gt=0;if(rt.forEach(function(Lt){if(Lt.left)N[T.get(Lt.left)]-N[T.get(Lt.right)]>=0?it++:at++;else O[T.get(Lt.top)]-O[T.get(Lt.bottom)]>=0?ot++:gt++}),it>at&&ot>gt)for(var At=0;At<T.size;At++)N[At]=-1*N[At],O[At]=-1*O[At];else if(it>at)for(var Mt=0;Mt<T.size;Mt++)N[Mt]=-1*N[Mt];else if(ot>gt)for(var ht=0;ht<T.size;ht++)O[ht]=-1*O[ht]},s=function(rt){var it=[],at=new y,ot=new Set,gt=0;return rt.forEach(function(At,Mt){if(!ot.has(Mt)){it[gt]=[];var ht=Mt;at.push(ht),ot.add(ht),it[gt].push(ht);while(at.length!=0){ht=at.shift();var Lt=rt.get(ht);Lt.forEach(function(Ct){if(!ot.has(Ct.id))at.push(Ct.id),ot.add(Ct.id),it[gt].push(Ct.id)})}gt++}}),it},L=function(rt){var it=new Map;return rt.forEach(function(at,ot){it.set(ot,[])}),rt.forEach(function(at,ot){at.forEach(function(gt){it.get(ot).push(gt),it.get(gt.id).push({id:ot,gap:gt.gap,direction:gt.direction})})}),it},E=function(rt){var it=new Map;return rt.forEach(function(at,ot){it.set(ot,[])}),rt.forEach(function(at,ot){at.forEach(function(gt){it.get(gt.id).push({id:ot,gap:gt.gap,direction:gt.direction})})}),it},A=[],m=[],U=!1,b=!1,k=new Set,B=new Map,W=new Map,st=[];if(c.fixedNodeConstraint)c.fixedNodeConstraint.forEach(function(J){k.add(J.nodeId)});if(c.relativePlacementConstraint)c.relativePlacementConstraint.forEach(function(J){if(J.left){if(B.has(J.left))B.get(J.left).push({id:J.right,gap:J.gap,direction:"horizontal"});else B.set(J.left,[{id:J.right,gap:J.gap,direction:"horizontal"}]);if(!B.has(J.right))B.set(J.right,[])}else{if(B.has(J.top))B.get(J.top).push({id:J.bottom,gap:J.gap,direction:"vertical"});else B.set(J.top,[{id:J.bottom,gap:J.gap,direction:"vertical"}]);if(!B.has(J.bottom))B.set(J.bottom,[])}}),W=L(B),st=s(W);if(r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(c.fixedNodeConstraint&&c.fixedNodeConstraint.length>1)c.fixedNodeConstraint.forEach(function(J,rt){A[rt]=[J.position.x,J.position.y],m[rt]=[N[T.get(J.nodeId)],O[T.get(J.nodeId)]]}),U=!0;else if(c.alignmentConstraint)(function(){var J=0;if(c.alignmentConstraint.vertical){var rt=c.alignmentConstraint.vertical,it=function(ht){var Lt=new Set;rt[ht].forEach(function(Ot){Lt.add(Ot)});var Ct=new Set([].concat(u(Lt)).filter(function(Ot){return k.has(Ot)})),pt=void 0;if(Ct.size>0)pt=N[T.get(Ct.values().next().value)];else pt=lt(Lt).x;rt[ht].forEach(function(Ot){A[J]=[pt,O[T.get(Ot)]],m[J]=[N[T.get(Ot)],O[T.get(Ot)]],J++})};for(var at=0;at<rt.length;at++)it(at);U=!0}if(c.alignmentConstraint.horizontal){var ot=c.alignmentConstraint.horizontal,gt=function(ht){var Lt=new Set;ot[ht].forEach(function(Ot){Lt.add(Ot)});var Ct=new Set([].concat(u(Lt)).filter(function(Ot){return k.has(Ot)})),pt=void 0;if(Ct.size>0)pt=N[T.get(Ct.values().next().value)];else pt=lt(Lt).y;ot[ht].forEach(function(Ot){A[J]=[N[T.get(Ot)],pt],m[J]=[N[T.get(Ot)],O[T.get(Ot)]],J++})};for(var At=0;At<ot.length;At++)gt(At);U=!0}if(c.relativePlacementConstraint)b=!0})();else if(c.relativePlacementConstraint){var dt=0,Z=0;for(var ut=0;ut<st.length;ut++)if(st[ut].length>dt)dt=st[ut].length,Z=ut;if(dt<W.size/2)tt(c.relativePlacementConstraint),U=!1,b=!1;else{var nt=new Map,S=new Map,K=[];st[Z].forEach(function(J){B.get(J).forEach(function(rt){if(rt.direction=="horizontal"){if(nt.has(J))nt.get(J).push(rt);else nt.set(J,[rt]);if(!nt.has(rt.id))nt.set(rt.id,[]);K.push({left:J,right:rt.id})}else{if(S.has(J))S.get(J).push(rt);else S.set(J,[rt]);if(!S.has(rt.id))S.set(rt.id,[]);K.push({top:J,bottom:rt.id})}})}),tt(K),b=!1;var et=P(nt,"horizontal"),ct=P(S,"vertical");st[Z].forEach(function(J,rt){if(m[rt]=[N[T.get(J)],O[T.get(J)]],A[rt]=[],et.has(J))A[rt][0]=et.get(J);else A[rt][0]=N[T.get(J)];if(ct.has(J))A[rt][1]=ct.get(J);else A[rt][1]=O[T.get(J)]}),U=!0}}if(U){var Nt=void 0,Pt=i.transpose(A),Bt=i.transpose(m);for(var ft=0;ft<Pt.length;ft++)Pt[ft]=i.multGamma(Pt[ft]),Bt[ft]=i.multGamma(Bt[ft]);var Jt=i.multMat(Pt,i.transpose(Bt)),Xt=e.svd(Jt);Nt=i.multMat(Xt.V,i.transpose(Xt.U));for(var Et=0;Et<T.size;Et++){var vt=[N[Et],O[Et]],xt=[Nt[0][0],Nt[1][0]],Rt=[Nt[0][1],Nt[1][1]];N[Et]=i.dotProduct(vt,xt),O[Et]=i.dotProduct(vt,Rt)}if(b)tt(c.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(c.fixedNodeConstraint&&c.fixedNodeConstraint.length>0){var Gt={x:0,y:0};c.fixedNodeConstraint.forEach(function(J,rt){var it={x:N[T.get(J.nodeId)],y:O[T.get(J.nodeId)]},at=J.position,ot=Q(at,it);Gt.x+=ot.x,Gt.y+=ot.y}),Gt.x/=c.fixedNodeConstraint.length,Gt.y/=c.fixedNodeConstraint.length,N.forEach(function(J,rt){N[rt]+=Gt.x}),O.forEach(function(J,rt){O[rt]+=Gt.y}),c.fixedNodeConstraint.forEach(function(J){N[T.get(J.nodeId)]=J.position.x,O[T.get(J.nodeId)]=J.position.y})}if(c.alignmentConstraint){if(c.alignmentConstraint.vertical){var St=c.alignmentConstraint.vertical,Ft=function(rt){var it=new Set;St[rt].forEach(function(gt){it.add(gt)});var at=new Set([].concat(u(it)).filter(function(gt){return k.has(gt)})),ot=void 0;if(at.size>0)ot=N[T.get(at.values().next().value)];else ot=lt(it).x;it.forEach(function(gt){if(!k.has(gt))N[T.get(gt)]=ot})};for(var Ht=0;Ht<St.length;Ht++)Ft(Ht)}if(c.alignmentConstraint.horizontal){var zt=c.alignmentConstraint.horizontal,te=function(rt){var it=new Set;zt[rt].forEach(function(gt){it.add(gt)});var at=new Set([].concat(u(it)).filter(function(gt){return k.has(gt)})),ot=void 0;if(at.size>0)ot=O[T.get(at.values().next().value)];else ot=lt(it).y;it.forEach(function(gt){if(!k.has(gt))O[T.get(gt)]=ot})};for(var qt=0;qt<zt.length;qt++)te(qt)}}if(c.relativePlacementConstraint)(function(){var J=new Map,rt=new Map,it=new Map,at=new Map,ot=new Map,gt=new Map,At=new Set,Mt=new Set;if(k.forEach(function(Qt){At.add(Qt),Mt.add(Qt)}),c.alignmentConstraint){if(c.alignmentConstraint.vertical){var ht=c.alignmentConstraint.vertical,Lt=function(It){it.set("dummy"+It,[]),ht[It].forEach(function(Yt){if(J.set(Yt,"dummy"+It),it.get("dummy"+It).push(Yt),k.has(Yt))At.add("dummy"+It)}),ot.set("dummy"+It,N[T.get(ht[It][0])])};for(var Ct=0;Ct<ht.length;Ct++)Lt(Ct)}if(c.alignmentConstraint.horizontal){var pt=c.alignmentConstraint.horizontal,Ot=function(It){at.set("dummy"+It,[]),pt[It].forEach(function(Yt){if(rt.set(Yt,"dummy"+It),at.get("dummy"+It).push(Yt),k.has(Yt))Mt.add("dummy"+It)}),gt.set("dummy"+It,O[T.get(pt[It][0])])};for(var Ut=0;Ut<pt.length;Ut++)Ot(Ut)}}var Tt=new Map,yt=new Map,Dt=function(It){B.get(It).forEach(function(Yt){var se=void 0,ae=void 0;if(Yt.direction=="horizontal"){if(se=J.get(It)?J.get(It):It,J.get(Yt.id))ae={id:J.get(Yt.id),gap:Yt.gap,direction:Yt.direction};else ae=Yt;if(Tt.has(se))Tt.get(se).push(ae);else Tt.set(se,[ae]);if(!Tt.has(ae.id))Tt.set(ae.id,[])}else{if(se=rt.get(It)?rt.get(It):It,rt.get(Yt.id))ae={id:rt.get(Yt.id),gap:Yt.gap,direction:Yt.direction};else ae=Yt;if(yt.has(se))yt.get(se).push(ae);else yt.set(se,[ae]);if(!yt.has(ae.id))yt.set(ae.id,[])}})},mt=!0,wt=!1,Zt=void 0;try{for(var Vt=B.keys()[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;Dt(Wt)}}catch(Qt){wt=!0,Zt=Qt}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}var bt=L(Tt),oe=L(yt),$t=s(bt),jt=s(oe),ne=E(Tt),Ce=E(yt),le=[],ce=[];$t.forEach(function(Qt,It){le[It]=[],Qt.forEach(function(Yt){if(ne.get(Yt).length==0)le[It].push(Yt)})}),jt.forEach(function(Qt,It){ce[It]=[],Qt.forEach(function(Yt){if(Ce.get(Yt).length==0)ce[It].push(Yt)})});var ge=P(Tt,"horizontal",At,ot,le),fe=P(yt,"vertical",Mt,gt,ce),we=function(It){if(it.get(It))it.get(It).forEach(function(Yt){N[T.get(Yt)]=ge.get(It)});else N[T.get(It)]=ge.get(It)},ue=!0,de=!1,Xe=void 0;try{for(var Ae=ge.keys()[Symbol.iterator](),He;!(ue=(He=Ae.next()).done);ue=!0){var De=He.value;we(De)}}catch(Qt){de=!0,Xe=Qt}finally{try{if(!ue&&Ae.return)Ae.return()}finally{if(de)throw Xe}}var sr=function(It){if(at.get(It))at.get(It).forEach(function(Yt){O[T.get(Yt)]=fe.get(It)});else O[T.get(It)]=fe.get(It)},Oe=!0,We=!1,Ve=void 0;try{for(var xe=fe.keys()[Symbol.iterator](),ze;!(Oe=(ze=xe.next()).done);Oe=!0){var De=ze.value;sr(De)}}catch(Qt){We=!0,Ve=Qt}finally{try{if(!Oe&&xe.return)xe.return()}finally{if(We)throw Ve}}})()}for(var Kt=0;Kt<X.length;Kt++){var kt=X[Kt];if(kt.getChild()==null)kt.setCenter(N[T.get(kt.id)],O[T.get(kt.id)])}},o.exports=g},551:(o)=>{o.exports=w}},D={};function v(o){var n=D[o];if(n!==void 0)return n.exports;var a=D[o]={exports:{}};return R[o](a,a.exports,v),a.exports}var f=v(45);return f})()})});var $e=Nn(function(Ne,Pe){(function(R,D){if(typeof Ne==="object"&&typeof Pe==="object")Pe.exports=D(be());else if(typeof define==="function"&&define.amd)define(["cose-base"],D);else if(typeof Ne==="object")Ne.cytoscapeFcose=D(be());else R.cytoscapeFcose=D(R.coseBase)})(Ne,function(w){return(()=>{var R={658:(o)=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(n){for(var a=arguments.length,u=Array(a>1?a-1:0),r=1;r<a;r++)u[r-1]=arguments[r];return u.forEach(function(y){Object.keys(y).forEach(function(i){return n[i]=y[i]})}),n}},548:(o,n,a)=>{var u=function(){function i(e,g){var d=[],c=!0,x=!1,T=void 0;try{for(var N=e[Symbol.iterator](),O;!(c=(O=N.next()).done);c=!0)if(d.push(O.value),g&&d.length===g)break}catch(X){x=!0,T=X}finally{try{if(!c&&N.return)N.return()}finally{if(x)throw T}}return d}return function(e,g){if(Array.isArray(e))return e;else if(Symbol.iterator in Object(e))return i(e,g);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=a(140).layoutBase.LinkedList,y={};y.getTopMostNodes=function(i){var e={};for(var g=0;g<i.length;g++)e[i[g].id()]=!0;var d=i.filter(function(c,x){if(typeof c==="number")c=x;var T=c.parent()[0];while(T!=null){if(e[T.id()])return!1;T=T.parent()[0]}return!0});return d},y.connectComponents=function(i,e,g,d){var c=new r,x=new Set,T=[],N=void 0,O=void 0,X=void 0,I=!1,V=1,_=[],Q=[],lt=function(){var tt=i.collection();Q.push(tt);var s=g[0],L=i.collection();L.merge(s).merge(s.descendants().intersection(e)),T.push(s),L.forEach(function(m){c.push(m),x.add(m),tt.merge(m)});var E=function(){s=c.shift();var U=i.collection();s.neighborhood().nodes().forEach(function(W){if(e.intersection(s.edgesWith(W)).length>0)U.merge(W)});for(var b=0;b<U.length;b++){var k=U[b];if(N=g.intersection(k.union(k.ancestors())),N!=null&&!x.has(N[0])){var B=N.union(N.descendants());B.forEach(function(W){if(c.push(W),x.add(W),tt.merge(W),g.has(W))T.push(W)})}}};while(c.length!=0)E();if(tt.forEach(function(m){e.intersection(m.connectedEdges()).forEach(function(U){if(tt.has(U.source())&&tt.has(U.target()))tt.merge(U)})}),T.length==g.length)I=!0;if(!I||I&&V>1){O=T[0],X=O.connectedEdges().length,T.forEach(function(m){if(m.connectedEdges().length<X)X=m.connectedEdges().length,O=m}),_.push(O.id());var A=i.collection();A.merge(T[0]),T.forEach(function(m){A.merge(m)}),T=[],g=g.difference(A),V++}};do lt();while(!I);if(d){if(_.length>0)d.set("dummy"+(d.size+1),_)}return Q},y.relocateComponent=function(i,e,g){if(!g.fixedNodeConstraint){var{POSITIVE_INFINITY:d,NEGATIVE_INFINITY:c,POSITIVE_INFINITY:x,NEGATIVE_INFINITY:T}=Number;if(g.quality=="draft"){var N=!0,O=!1,X=void 0;try{for(var I=e.nodeIndexes[Symbol.iterator](),V;!(N=(V=I.next()).done);N=!0){var _=V.value,Q=u(_,2),lt=Q[0],P=Q[1],tt=g.cy.getElementById(lt);if(tt){var s=tt.boundingBox(),L=e.xCoords[P]-s.w/2,E=e.xCoords[P]+s.w/2,A=e.yCoords[P]-s.h/2,m=e.yCoords[P]+s.h/2;if(L<d)d=L;if(E>c)c=E;if(A<x)x=A;if(m>T)T=m}}}catch(W){O=!0,X=W}finally{try{if(!N&&I.return)I.return()}finally{if(O)throw X}}var U=i.x-(c+d)/2,b=i.y-(T+x)/2;e.xCoords=e.xCoords.map(function(W){return W+U}),e.yCoords=e.yCoords.map(function(W){return W+b})}else{Object.keys(e).forEach(function(W){var st=e[W],dt=st.getRect().x,Z=st.getRect().x+st.getRect().width,ut=st.getRect().y,nt=st.getRect().y+st.getRect().height;if(dt<d)d=dt;if(Z>c)c=Z;if(ut<x)x=ut;if(nt>T)T=nt});var k=i.x-(c+d)/2,B=i.y-(T+x)/2;Object.keys(e).forEach(function(W){var st=e[W];st.setCenter(st.getCenterX()+k,st.getCenterY()+B)})}}},y.calcBoundingBox=function(i,e,g,d){var{MAX_SAFE_INTEGER:c,MIN_SAFE_INTEGER:x,MAX_SAFE_INTEGER:T,MIN_SAFE_INTEGER:N}=Number,O=void 0,X=void 0,I=void 0,V=void 0,_=i.descendants().not(":parent"),Q=_.length;for(var lt=0;lt<Q;lt++){var P=_[lt];if(O=e[d.get(P.id())]-P.width()/2,X=e[d.get(P.id())]+P.width()/2,I=g[d.get(P.id())]-P.height()/2,V=g[d.get(P.id())]+P.height()/2,c>O)c=O;if(x<X)x=X;if(T>I)T=I;if(N<V)N=V}var tt={};return tt.topLeftX=c,tt.topLeftY=T,tt.width=x-c,tt.height=N-T,tt},y.calcParentsWithoutChildren=function(i,e){var g=i.collection();return e.nodes(":parent").forEach(function(d){var c=!1;if(d.children().forEach(function(x){if(x.css("display")!="none")c=!0}),!c)g.merge(d)}),g},o.exports=y},816:(o,n,a)=>{var u=a(548),r=a(140).CoSELayout,y=a(140).CoSENode,i=a(140).layoutBase.PointD,e=a(140).layoutBase.DimensionD,g=a(140).layoutBase.LayoutConstants,d=a(140).layoutBase.FDLayoutConstants,c=a(140).CoSEConstants,x=function(N,O){var{cy:X,eles:I}=N,V=I.nodes(),_=I.edges(),Q=void 0,lt=void 0,P=void 0,tt={};if(N.randomize)Q=O.nodeIndexes,lt=O.xCoords,P=O.yCoords;var s=function(W){return typeof W==="function"},L=function(W,st){if(s(W))return W(st);else return W},E=u.calcParentsWithoutChildren(X,I),A=function B(W,st,dt,Z){var ut=st.length;for(var nt=0;nt<ut;nt++){var S=st[nt],K=null;if(S.intersection(E).length==0)K=S.children();var et=void 0,ct=S.layoutDimensions({nodeDimensionsIncludeLabels:Z.nodeDimensionsIncludeLabels});if(S.outerWidth()!=null&&S.outerHeight()!=null)if(Z.randomize)if(!S.isParent())et=W.add(new y(dt.graphManager,new i(lt[Q.get(S.id())]-ct.w/2,P[Q.get(S.id())]-ct.h/2),new e(parseFloat(ct.w),parseFloat(ct.h))));else{var Nt=u.calcBoundingBox(S,lt,P,Q);if(S.intersection(E).length==0)et=W.add(new y(dt.graphManager,new i(Nt.topLeftX,Nt.topLeftY),new e(Nt.width,Nt.height)));else et=W.add(new y(dt.graphManager,new i(Nt.topLeftX,Nt.topLeftY),new e(parseFloat(ct.w),parseFloat(ct.h))))}else et=W.add(new y(dt.graphManager,new i(S.position("x")-ct.w/2,S.position("y")-ct.h/2),new e(parseFloat(ct.w),parseFloat(ct.h))));else et=W.add(new y(this.graphManager));if(et.id=S.data("id"),et.nodeRepulsion=L(Z.nodeRepulsion,S),et.paddingLeft=parseInt(S.css("padding")),et.paddingTop=parseInt(S.css("padding")),et.paddingRight=parseInt(S.css("padding")),et.paddingBottom=parseInt(S.css("padding")),Z.nodeDimensionsIncludeLabels)et.labelWidth=S.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,et.labelHeight=S.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,et.labelPosVertical=S.css("text-valign"),et.labelPosHorizontal=S.css("text-halign");if(tt[S.data("id")]=et,isNaN(et.rect.x))et.rect.x=0;if(isNaN(et.rect.y))et.rect.y=0;if(K!=null&&K.length>0){var Pt=void 0;Pt=dt.getGraphManager().add(dt.newGraph(),et),B(Pt,K,dt,Z)}}},m=function(W,st,dt){var Z=0,ut=0;for(var nt=0;nt<dt.length;nt++){var S=dt[nt],K=tt[S.data("source")],et=tt[S.data("target")];if(K&&et&&K!==et&&K.getEdgesBetween(et).length==0){var ct=st.add(W.newEdge(),K,et);ct.id=S.id(),ct.idealLength=L(N.idealEdgeLength,S),ct.edgeElasticity=L(N.edgeElasticity,S),Z+=ct.idealLength,ut++}}if(N.idealEdgeLength!=null){if(ut>0)c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=Z/ut;else if(!s(N.idealEdgeLength))c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=N.idealEdgeLength;else c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=50;c.MIN_REPULSION_DIST=d.MIN_REPULSION_DIST=d.DEFAULT_EDGE_LENGTH/10,c.DEFAULT_RADIAL_SEPARATION=d.DEFAULT_EDGE_LENGTH}},U=function(W,st){if(st.fixedNodeConstraint)W.constraints.fixedNodeConstraint=st.fixedNodeConstraint;if(st.alignmentConstraint)W.constraints.alignmentConstraint=st.alignmentConstraint;if(st.relativePlacementConstraint)W.constraints.relativePlacementConstraint=st.relativePlacementConstraint};if(N.nestingFactor!=null)c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=N.nestingFactor;if(N.gravity!=null)c.DEFAULT_GRAVITY_STRENGTH=d.DEFAULT_GRAVITY_STRENGTH=N.gravity;if(N.numIter!=null)c.MAX_ITERATIONS=d.MAX_ITERATIONS=N.numIter;if(N.gravityRange!=null)c.DEFAULT_GRAVITY_RANGE_FACTOR=d.DEFAULT_GRAVITY_RANGE_FACTOR=N.gravityRange;if(N.gravityCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=N.gravityCompound;if(N.gravityRangeCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=N.gravityRangeCompound;if(N.initialEnergyOnIncremental!=null)c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.DEFAULT_COOLING_FACTOR_INCREMENTAL=N.initialEnergyOnIncremental;if(N.tilingCompareBy!=null)c.TILING_COMPARE_BY=N.tilingCompareBy;if(N.quality=="proof")g.QUALITY=2;else g.QUALITY=0;if(c.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=N.nodeDimensionsIncludeLabels,c.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!N.randomize,c.ANIMATE=d.ANIMATE=g.ANIMATE=N.animate,c.TILE=N.tile,c.TILING_PADDING_VERTICAL=typeof N.tilingPaddingVertical==="function"?N.tilingPaddingVertical.call():N.tilingPaddingVertical,c.TILING_PADDING_HORIZONTAL=typeof N.tilingPaddingHorizontal==="function"?N.tilingPaddingHorizontal.call():N.tilingPaddingHorizontal,c.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!0,c.PURE_INCREMENTAL=!N.randomize,g.DEFAULT_UNIFORM_LEAF_NODE_SIZES=N.uniformNodeDimensions,N.step=="transformed")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!1;if(N.step=="enforced")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!1;if(N.step=="cose")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!0;if(N.step=="all"){if(N.randomize)c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!0}if(N.fixedNodeConstraint||N.alignmentConstraint||N.relativePlacementConstraint)c.TREE_REDUCTION_ON_INCREMENTAL=!1;else c.TREE_REDUCTION_ON_INCREMENTAL=!0;var b=new r,k=b.newGraphManager();return A(k.addRoot(),u.getTopMostNodes(V),b,N),m(b,k,_),U(b,N),b.runLayout(),tt};o.exports={coseLayout:x}},212:(o,n,a)=>{var u=function(){function N(O,X){for(var I=0;I<X.length;I++){var V=X[I];if(V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V)V.writable=!0;Object.defineProperty(O,V.key,V)}}return function(O,X,I){if(X)N(O.prototype,X);if(I)N(O,I);return O}}();function r(N,O){if(!(N instanceof O))throw TypeError("Cannot call a class as a function")}var y=a(658),i=a(548),e=a(657),g=e.spectralLayout,d=a(816),c=d.coseLayout,x=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1000,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:0.0000001,nodeRepulsion:function(O){return 4500},idealEdgeLength:function(O){return 50},edgeElasticity:function(O){return 0.45},nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),T=function(){function N(O){r(this,N),this.options=y({},x,O)}return u(N,[{key:"run",value:function(){var X=this,I=this.options,{cy:V,eles:_}=I,Q=[],lt=void 0,P=void 0,tt=[],s=void 0,L=[];if(I.fixedNodeConstraint&&(!Array.isArray(I.fixedNodeConstraint)||I.fixedNodeConstraint.length==0))I.fixedNodeConstraint=void 0;if(I.alignmentConstraint){if(I.alignmentConstraint.vertical&&(!Array.isArray(I.alignmentConstraint.vertical)||I.alignmentConstraint.vertical.length==0))I.alignmentConstraint.vertical=void 0;if(I.alignmentConstraint.horizontal&&(!Array.isArray(I.alignmentConstraint.horizontal)||I.alignmentConstraint.horizontal.length==0))I.alignmentConstraint.horizontal=void 0}if(I.relativePlacementConstraint&&(!Array.isArray(I.relativePlacementConstraint)||I.relativePlacementConstraint.length==0))I.relativePlacementConstraint=void 0;var E=I.fixedNodeConstraint||I.alignmentConstraint||I.relativePlacementConstraint;if(E)I.tile=!1,I.packComponents=!1;var A=void 0,m=!1;if(V.layoutUtilities&&I.packComponents){if(A=V.layoutUtilities("get"),!A)A=V.layoutUtilities();m=!0}if(_.nodes().length>0)if(!m){var U=I.eles.boundingBox();if(L.push({x:U.x1+U.w/2,y:U.y1+U.h/2}),I.randomize){var b=g(I);Q.push(b)}if(I.quality=="default"||I.quality=="proof")tt.push(c(I,Q[0])),i.relocateComponent(L[0],tt[0],I);else i.relocateComponent(L[0],Q[0],I)}else{var k=i.getTopMostNodes(I.eles.nodes());if(s=i.connectComponents(V,I.eles,k),s.forEach(function(Et){var vt=Et.boundingBox();L.push({x:vt.x1+vt.w/2,y:vt.y1+vt.h/2})}),I.randomize)s.forEach(function(Et){I.eles=Et,Q.push(g(I))});if(I.quality=="default"||I.quality=="proof"){var B=V.collection();if(I.tile){var W=new Map,st=[],dt=[],Z=0,ut={nodeIndexes:W,xCoords:st,yCoords:dt},nt=[];if(s.forEach(function(Et,vt){if(Et.edges().length==0)Et.nodes().forEach(function(xt,Rt){if(B.merge(Et.nodes()[Rt]),!xt.isParent())ut.nodeIndexes.set(Et.nodes()[Rt].id(),Z++),ut.xCoords.push(Et.nodes()[0].position().x),ut.yCoords.push(Et.nodes()[0].position().y)}),nt.push(vt)}),B.length>1){var S=B.boundingBox();L.push({x:S.x1+S.w/2,y:S.y1+S.h/2}),s.push(B),Q.push(ut);for(var K=nt.length-1;K>=0;K--)s.splice(nt[K],1),Q.splice(nt[K],1),L.splice(nt[K],1)}}s.forEach(function(Et,vt){I.eles=Et,tt.push(c(I,Q[vt])),i.relocateComponent(L[vt],tt[vt],I)})}else s.forEach(function(Et,vt){i.relocateComponent(L[vt],Q[vt],I)});var et=new Set;if(s.length>1){var ct=[],Nt=_.filter(function(Et){return Et.css("display")=="none"});s.forEach(function(Et,vt){var xt=void 0;if(I.quality=="draft")xt=Q[vt].nodeIndexes;if(Et.nodes().not(Nt).length>0){var Rt={};Rt.edges=[],Rt.nodes=[];var Gt=void 0;if(Et.nodes().not(Nt).forEach(function(St){if(I.quality=="draft")if(!St.isParent())Gt=xt.get(St.id()),Rt.nodes.push({x:Q[vt].xCoords[Gt]-St.boundingbox().w/2,y:Q[vt].yCoords[Gt]-St.boundingbox().h/2,width:St.boundingbox().w,height:St.boundingbox().h});else{var Ft=i.calcBoundingBox(St,Q[vt].xCoords,Q[vt].yCoords,xt);Rt.nodes.push({x:Ft.topLeftX,y:Ft.topLeftY,width:Ft.width,height:Ft.height})}else if(tt[vt][St.id()])Rt.nodes.push({x:tt[vt][St.id()].getLeft(),y:tt[vt][St.id()].getTop(),width:tt[vt][St.id()].getWidth(),height:tt[vt][St.id()].getHeight()})}),Et.edges().forEach(function(St){var Ft=St.source(),Ht=St.target();if(Ft.css("display")!="none"&&Ht.css("display")!="none"){if(I.quality=="draft"){var zt=xt.get(Ft.id()),te=xt.get(Ht.id()),qt=[],Kt=[];if(Ft.isParent()){var kt=i.calcBoundingBox(Ft,Q[vt].xCoords,Q[vt].yCoords,xt);qt.push(kt.topLeftX+kt.width/2),qt.push(kt.topLeftY+kt.height/2)}else qt.push(Q[vt].xCoords[zt]),qt.push(Q[vt].yCoords[zt]);if(Ht.isParent()){var J=i.calcBoundingBox(Ht,Q[vt].xCoords,Q[vt].yCoords,xt);Kt.push(J.topLeftX+J.width/2),Kt.push(J.topLeftY+J.height/2)}else Kt.push(Q[vt].xCoords[te]),Kt.push(Q[vt].yCoords[te]);Rt.edges.push({startX:qt[0],startY:qt[1],endX:Kt[0],endY:Kt[1]})}else if(tt[vt][Ft.id()]&&tt[vt][Ht.id()])Rt.edges.push({startX:tt[vt][Ft.id()].getCenterX(),startY:tt[vt][Ft.id()].getCenterY(),endX:tt[vt][Ht.id()].getCenterX(),endY:tt[vt][Ht.id()].getCenterY()})}}),Rt.nodes.length>0)ct.push(Rt),et.add(vt)}});var Pt=A.packComponents(ct,I.randomize).shifts;if(I.quality=="draft")Q.forEach(function(Et,vt){var xt=Et.xCoords.map(function(Gt){return Gt+Pt[vt].dx}),Rt=Et.yCoords.map(function(Gt){return Gt+Pt[vt].dy});Et.xCoords=xt,Et.yCoords=Rt});else{var Bt=0;et.forEach(function(Et){Object.keys(tt[Et]).forEach(function(vt){var xt=tt[Et][vt];xt.setCenter(xt.getCenterX()+Pt[Bt].dx,xt.getCenterY()+Pt[Bt].dy)}),Bt++})}}}var ft=function(vt,xt){if(I.quality=="default"||I.quality=="proof"){if(typeof vt==="number")vt=xt;var Rt=void 0,Gt=void 0,St=vt.data("id");if(tt.forEach(function(Ht){if(St in Ht)Rt={x:Ht[St].getRect().getCenterX(),y:Ht[St].getRect().getCenterY()},Gt=Ht[St]}),I.nodeDimensionsIncludeLabels){if(Gt.labelWidth){if(Gt.labelPosHorizontal=="left")Rt.x+=Gt.labelWidth/2;else if(Gt.labelPosHorizontal=="right")Rt.x-=Gt.labelWidth/2}if(Gt.labelHeight){if(Gt.labelPosVertical=="top")Rt.y+=Gt.labelHeight/2;else if(Gt.labelPosVertical=="bottom")Rt.y-=Gt.labelHeight/2}}if(Rt==null)Rt={x:vt.position("x"),y:vt.position("y")};return{x:Rt.x,y:Rt.y}}else{var Ft=void 0;if(Q.forEach(function(Ht){var zt=Ht.nodeIndexes.get(vt.id());if(zt!=null)Ft={x:Ht.xCoords[zt],y:Ht.yCoords[zt]}}),Ft==null)Ft={x:vt.position("x"),y:vt.position("y")};return{x:Ft.x,y:Ft.y}}};if(I.quality=="default"||I.quality=="proof"||I.randomize){var Jt=i.calcParentsWithoutChildren(V,_),Xt=_.filter(function(Et){return Et.css("display")=="none"});if(I.eles=_.not(Xt),_.nodes().not(":parent").not(Xt).layoutPositions(X,I,ft),Jt.length>0)Jt.forEach(function(Et){Et.position(ft(Et))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),N}();o.exports=T},657:(o,n,a)=>{var u=a(548),r=a(140).layoutBase.Matrix,y=a(140).layoutBase.SVD,i=function(g){var{cy:d,eles:c}=g,x=c.nodes(),T=c.nodes(":parent"),N=new Map,O=new Map,X=new Map,I=[],V=[],_=[],Q=[],lt=[],P=[],tt=[],s=[],L=void 0,E=void 0,A=1e8,m=0.000000001,{piTol:U,samplingType:b,nodeSeparation:k}=g,B=void 0,W=function(){var it=0,at=0,ot=!1;while(at<B){it=Math.floor(Math.random()*E),ot=!1;for(var gt=0;gt<at;gt++)if(Q[gt]==it){ot=!0;break}if(!ot)Q[at]=it,at++;else continue}},st=function(it,at,ot){var gt=[],At=0,Mt=0,ht=0,Lt=void 0,Ct=[],pt=0,Ot=1;for(var Ut=0;Ut<E;Ut++)Ct[Ut]=A;gt[Mt]=it,Ct[it]=0;while(Mt>=At){ht=gt[At++];var Tt=I[ht];for(var yt=0;yt<Tt.length;yt++)if(Lt=O.get(Tt[yt]),Ct[Lt]==A)Ct[Lt]=Ct[ht]+1,gt[++Mt]=Lt;P[ht][at]=Ct[ht]*k}if(ot){for(var Dt=0;Dt<E;Dt++)if(P[Dt][at]<lt[Dt])lt[Dt]=P[Dt][at];for(var mt=0;mt<E;mt++)if(lt[mt]>pt)pt=lt[mt],Ot=mt}return Ot},dt=function(it){var at=void 0;if(!it){W();for(var ot=0;ot<B;ot++)st(Q[ot],ot,it,!1)}else{at=Math.floor(Math.random()*E),L=at;for(var gt=0;gt<E;gt++)lt[gt]=A;for(var At=0;At<B;At++)Q[At]=at,at=st(at,At,it)}for(var Mt=0;Mt<E;Mt++)for(var ht=0;ht<B;ht++)P[Mt][ht]*=P[Mt][ht];for(var Lt=0;Lt<B;Lt++)tt[Lt]=[];for(var Ct=0;Ct<B;Ct++)for(var pt=0;pt<B;pt++)tt[Ct][pt]=P[Q[pt]][Ct]},Z=function(){var it=y.svd(tt),{S:at,U:ot,V:gt}=it,At=at[0]*at[0]*at[0],Mt=[];for(var ht=0;ht<B;ht++){Mt[ht]=[];for(var Lt=0;Lt<B;Lt++)if(Mt[ht][Lt]=0,ht==Lt)Mt[ht][Lt]=at[ht]/(at[ht]*at[ht]+At/(at[ht]*at[ht]))}s=r.multMat(r.multMat(gt,Mt),r.transpose(ot))},ut=function(){var it=void 0,at=void 0,ot=[],gt=[],At=[],Mt=[];for(var ht=0;ht<E;ht++)ot[ht]=Math.random(),gt[ht]=Math.random();ot=r.normalize(ot),gt=r.normalize(gt);var Lt=0,Ct=m,pt=m,Ot=void 0;while(!0){Lt++;for(var Ut=0;Ut<E;Ut++)At[Ut]=ot[Ut];if(ot=r.multGamma(r.multL(r.multGamma(At),P,s)),it=r.dotProduct(At,ot),ot=r.normalize(ot),Ct=r.dotProduct(At,ot),Ot=Math.abs(Ct/pt),Ot<=1+U&&Ot>=1)break;pt=Ct}for(var Tt=0;Tt<E;Tt++)At[Tt]=ot[Tt];Lt=0,pt=m;while(!0){Lt++;for(var yt=0;yt<E;yt++)Mt[yt]=gt[yt];if(Mt=r.minusOp(Mt,r.multCons(At,r.dotProduct(At,Mt))),gt=r.multGamma(r.multL(r.multGamma(Mt),P,s)),at=r.dotProduct(Mt,gt),gt=r.normalize(gt),Ct=r.dotProduct(Mt,gt),Ot=Math.abs(Ct/pt),Ot<=1+U&&Ot>=1)break;pt=Ct}for(var Dt=0;Dt<E;Dt++)Mt[Dt]=gt[Dt];V=r.multCons(At,Math.sqrt(Math.abs(it))),_=r.multCons(Mt,Math.sqrt(Math.abs(at)))};u.connectComponents(d,c,u.getTopMostNodes(x),N),T.forEach(function(rt){u.connectComponents(d,c,u.getTopMostNodes(rt.descendants().intersection(c)),N)});var nt=0;for(var S=0;S<x.length;S++)if(!x[S].isParent())O.set(x[S].id(),nt++);var K=!0,et=!1,ct=void 0;try{for(var Nt=N.keys()[Symbol.iterator](),Pt;!(K=(Pt=Nt.next()).done);K=!0){var Bt=Pt.value;O.set(Bt,nt++)}}catch(rt){et=!0,ct=rt}finally{try{if(!K&&Nt.return)Nt.return()}finally{if(et)throw ct}}for(var ft=0;ft<O.size;ft++)I[ft]=[];T.forEach(function(rt){var it=rt.children().intersection(c);while(it.nodes(":childless").length==0)it=it.nodes()[0].children().intersection(c);var at=0,ot=it.nodes(":childless")[0].connectedEdges().length;it.nodes(":childless").forEach(function(gt,At){if(gt.connectedEdges().length<ot)ot=gt.connectedEdges().length,at=At}),X.set(rt.id(),it.nodes(":childless")[at].id())}),x.forEach(function(rt){var it=void 0;if(rt.isParent())it=O.get(X.get(rt.id()));else it=O.get(rt.id());rt.neighborhood().nodes().forEach(function(at){if(c.intersection(rt.edgesWith(at)).length>0)if(at.isParent())I[it].push(X.get(at.id()));else I[it].push(at.id())})});var Jt=function(it){var at=O.get(it),ot=void 0;N.get(it).forEach(function(gt){if(d.getElementById(gt).isParent())ot=X.get(gt);else ot=gt;I[at].push(ot),I[O.get(ot)].push(it)})},Xt=!0,Et=!1,vt=void 0;try{for(var xt=N.keys()[Symbol.iterator](),Rt;!(Xt=(Rt=xt.next()).done);Xt=!0){var Gt=Rt.value;Jt(Gt)}}catch(rt){Et=!0,vt=rt}finally{try{if(!Xt&&xt.return)xt.return()}finally{if(Et)throw vt}}E=O.size;var St=void 0;if(E>2){B=E<g.sampleSize?E:g.sampleSize;for(var Ft=0;Ft<E;Ft++)P[Ft]=[];for(var Ht=0;Ht<B;Ht++)s[Ht]=[];if(g.quality=="draft"||g.step=="all")dt(b),Z(),ut(),St={nodeIndexes:O,xCoords:V,yCoords:_};else O.forEach(function(rt,it){V.push(d.getElementById(it).position("x")),_.push(d.getElementById(it).position("y"))}),St={nodeIndexes:O,xCoords:V,yCoords:_};return St}else{var zt=O.keys(),te=d.getElementById(zt.next().value),qt=te.position(),Kt=te.outerWidth();if(V.push(qt.x),_.push(qt.y),E==2){var kt=d.getElementById(zt.next().value),J=kt.outerWidth();V.push(qt.x+Kt/2+J/2+g.idealEdgeLength),_.push(qt.y)}return St={nodeIndexes:O,xCoords:V,yCoords:_},St}};o.exports={spectralLayout:i}},579:(o,n,a)=>{var u=a(212),r=function(i){if(!i)return;i("layout","fcose",u)};if(typeof cytoscape<"u")r(cytoscape);o.exports=r},140:(o)=>{o.exports=w}},D={};function v(o){var n=D[o];if(n!==void 0)return n.exports;var a=D[o]={exports:{}};return R[o](a,a.exports,v),a.exports}var f=v(579);return f})()})});var je=hn($e(),1);var Be={L:"left",R:"right",T:"top",B:"bottom"},Ze={L:t((w)=>`${w},${w/2} 0,${w} 0,0`,"L"),R:t((w)=>`0,${w/2} ${w},0 ${w},${w}`,"R"),T:t((w)=>`0,0 ${w},0 ${w/2},${w}`,"T"),B:t((w)=>`${w/2},0 ${w},${w} 0,${w}`,"B")},Me={L:t((w,R)=>w-R+2,"L"),R:t((w,R)=>w-2,"R"),T:t((w,R)=>w-R+2,"T"),B:t((w,R)=>w-2,"B")},hr=t(function(w){if(_t(w))return w==="L"?"R":"L";else return w==="T"?"B":"T"},"getOppositeArchitectureDirection"),ke=t(function(w){let R=w;return R==="L"||R==="R"||R==="T"||R==="B"},"isArchitectureDirection"),_t=t(function(w){let R=w;return R==="L"||R==="R"},"isArchitectureDirectionX"),he=t(function(w){let R=w;return R==="T"||R==="B"},"isArchitectureDirectionY"),Ye=t(function(w,R){let D=_t(w)&&he(R),v=he(w)&&_t(R);return D||v},"isArchitectureDirectionXY"),lr=t(function(w){let R=w[0],D=w[1],v=_t(R)&&he(D),f=he(R)&&_t(D);return v||f},"isArchitecturePairXY"),fr=t(function(w){return w!=="LL"&&w!=="RR"&&w!=="TT"&&w!=="BB"},"isValidArchitectureDirectionPair"),Ge=t(function(w,R){let D=`${w}${R}`;return fr(D)?D:void 0},"getArchitectureDirectionPair"),cr=t(function([w,R],D){let v=D[0],f=D[1];if(_t(v))if(he(f))return[w+(v==="L"?-1:1),R+(f==="T"?1:-1)];else return[w+(v==="L"?-1:1),R];else if(_t(f))return[w+(f==="L"?1:-1),R+(v==="T"?1:-1)];else return[w,R+(v==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),gr=t(function(w){if(w==="LT"||w==="TL")return[1,1];else if(w==="BL"||w==="LB")return[1,-1];else if(w==="BR"||w==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),ur=t(function(w,R){if(Ye(w,R))return"bend";else if(_t(w))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),vr=t(function(w){return w.type==="service"},"isArchitectureService"),pr=t(function(w){return w.type==="junction"},"isArchitectureJunction"),qe=t((w,R)=>{let[D,v]=[w,R].sort();return`${JSON.stringify(D)}-${JSON.stringify(v)}`},"architectureGroupAlignmentKey"),Qe=t((w)=>w.data(),"edgeData"),me=t((w)=>w.data(),"nodeData"),yr=Y.architecture,Je=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=M,this.getAccTitle=G,this.setDiagramTitle=H,this.getDiagramTitle=q,this.getAccDescription=j,this.setAccDescription=z,this.clear()}static{t(this,"ArchitectureDB")}setDiagramId(w){this.diagramId=w}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",F()}addService({id:w,icon:R,in:D,title:v,iconText:f}){if(this.registeredIds.has(w))throw Error(`The service id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(D!==void 0){if(w===D)throw Error(`The service [${w}] cannot be placed within itself`);if(!this.registeredIds.has(D))throw Error(`The service [${w}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(D)==="node")throw Error(`The service [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"service",icon:R,iconText:f,title:v,edges:[],in:D})}getServices(){return[...this.nodes.values()].filter(vr)}addJunction({id:w,in:R}){if(this.registeredIds.has(w))throw Error(`The junction id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(R!==void 0){if(w===R)throw Error(`The junction [${w}] cannot be placed within itself`);if(!this.registeredIds.has(R))throw Error(`The junction [${w}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(R)==="node")throw Error(`The junction [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"junction",edges:[],in:R})}getJunctions(){return[...this.nodes.values()].filter(pr)}getNodes(){return[...this.nodes.values()]}getNode(w){return this.nodes.get(w)??null}addGroup({id:w,icon:R,in:D,title:v}){if(this.registeredIds.has(w))throw Error(`The group id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(D!==void 0){if(w===D)throw Error(`The group [${w}] cannot be placed within itself`);if(!this.registeredIds.has(D))throw Error(`The group [${w}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(D)==="node")throw Error(`The group [${w}]'s parent is not a group`)}this.registeredIds.set(w,"group"),this.groups.set(w,{id:w,icon:R,title:v,in:D})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:w,rhsId:R,lhsDir:D,rhsDir:v,lhsInto:f,rhsInto:o,lhsGroup:n,rhsGroup:a,title:u}){if(!ke(D))throw Error(`Invalid direction given for left hand side of edge ${w}--${R}. Expected (L,R,T,B) got ${String(D)}`);if(!ke(v))throw Error(`Invalid direction given for right hand side of edge ${w}--${R}. Expected (L,R,T,B) got ${String(v)}`);if(!this.nodes.has(w)&&!this.groups.has(w))throw Error(`The left-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(R)&&!this.groups.has(R))throw Error(`The right-hand id [${R}] does not yet exist. Please create the service/group before declaring an edge to it.`);let r=this.nodes.get(w).in,y=this.nodes.get(R).in;if(n&&r&&y&&r==y)throw Error(`The left-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&r&&y&&r==y)throw Error(`The right-hand id [${R}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:w,lhsDir:D,lhsInto:f,lhsGroup:n,rhsId:R,rhsDir:v,rhsInto:o,rhsGroup:a,title:u};this.edges.push(i);let e=this.nodes.get(w),g=this.nodes.get(R);if(e&&g)e.edges.push(this.edges[this.edges.length-1]),g.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(w){if(w.members.length<2)throw Error(`An align directive requires at least two members; got ${w.members.length}`);let R=new Set;w.members.forEach((D)=>{if(this.registeredIds.get(D)!=="node")throw Error(`align ${w.direction} references [${D}], which is not a service or junction`);if(R.has(D))throw Error(`align ${w.direction} lists [${D}] more than once`);R.add(D)}),this.layoutHints.push(w)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let w=new Map,R=new Map;for(let[n,a]of this.nodes.entries()){let u=new Map;for(let r of a.edges){let y=this.getNode(r.lhsId)?.in,i=this.getNode(r.rhsId)?.in;if(y&&i&&y!==i){let e=ur(r.lhsDir,r.rhsDir);if(e!=="bend")w.set(qe(y,i),e)}if(r.lhsId===n){let e=Ge(r.lhsDir,r.rhsDir);if(e)u.set(e,r.rhsId)}else{let e=Ge(r.rhsDir,r.lhsDir);if(e)u.set(e,r.lhsId)}}R.set(n,u)}let D=new Set,v=new Set(R.keys()),f=t((n)=>{let a=new Map([[n,[0,0]]]),u=[n];while(u.length>0){let r=u.shift();if(r){D.add(r),v.delete(r);let y=R.get(r);if(!y)throw Error(`BFS error: adjacency list for id ${r} not found. Please report this as a bug.`);let i=a.get(r);if(!i)throw Error(`BFS error: position for id ${r} not found in spatial map. Please report this as a bug.`);let[e,g]=i;y.forEach((d,c)=>{if(!D.has(d))a.set(d,cr([e,g],c)),u.push(d)})}}return a},"BFS"),o=[];while(v.size>0){let n=v.values().next().value;o.push(f(n))}this.dataStructures={adjList:R,spatialMaps:o,groupAlignments:w}}return this.dataStructures}setElementForId(w,R){this.elements.set(w,R)}getElementById(w){return this.elements.get(w)}getConfig(){return ie({...yr,...C().architecture})}getConfigField(w){return this.getConfig()[w]}},mr=t((w,R)=>{ye(w,R),w.groups.map((D)=>R.addGroup(D)),w.services.map((D)=>R.addService({...D,type:"service"})),w.junctions.map((D)=>R.addJunction({...D,type:"junction"})),w.edges.map((D)=>R.addEdge(D)),w.alignments?.map((D)=>R.addLayoutHint({direction:D.direction,members:[...D.members]}))},"populateDb"),Ke={parser:{yy:void 0},parse:t(async(w)=>{let R=await Re("architecture",w);l.debug(R);let D=Ke.parser?.yy;if(!(D instanceof Je))throw Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");mr(R,D)},"parse")},Er=t((w)=>`
|
|
1
|
+
import{ke}from"./index-4n7t26ap.js";import{t,l,Y,C,ee,Hr,F,P,G,z,j,H,q,p,h,me,hg,Hi,pr,ie,Qn,mn}from"./index-aa3hmn6j.js";import{Pe}from"./index-dxnkwf39.js";import{jr}from"./index-a58rkn3f.js";import{bn,Fn}from"./index-g3rg6vsd.js";var Ie=Fn(function(ye,xe){(function(I,A){if(typeof ye==="object"&&typeof xe==="object")xe.exports=A();else if(typeof define==="function"&&define.amd)define([],A);else if(typeof ye==="object")ye.layoutBase=A();else I.layoutBase=A()})(ye,function(){return function(w){var I={};function A(v){if(I[v])return I[v].exports;var f=I[v]={i:v,l:!1,exports:{}};return w[v].call(f.exports,f,f.exports,A),f.l=!0,f.exports}return A.m=w,A.c=I,A.i=function(v){return v},A.d=function(v,f,o){if(!A.o(v,f))Object.defineProperty(v,f,{configurable:!1,enumerable:!0,get:o})},A.n=function(v){var f=v&&v.__esModule?function(){return v.default}:function(){return v};return A.d(f,"a",f),f},A.o=function(v,f){return Object.prototype.hasOwnProperty.call(v,f)},A.p="",A(A.s=28)}([function(w,I,A){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1000,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,w.exports=v},function(w,I,A){var v=A(2),f=A(8),o=A(9);function n(u,r,y){v.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=u,this.target=r}n.prototype=Object.create(v.prototype);for(var a in v)n[a]=v[a];n.prototype.getSource=function(){return this.source},n.prototype.getTarget=function(){return this.target},n.prototype.isInterGraph=function(){return this.isInterGraph},n.prototype.getLength=function(){return this.length},n.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},n.prototype.getBendpoints=function(){return this.bendpoints},n.prototype.getLca=function(){return this.lca},n.prototype.getSourceInLca=function(){return this.sourceInLca},n.prototype.getTargetInLca=function(){return this.targetInLca},n.prototype.getOtherEnd=function(u){if(this.source===u)return this.target;else if(this.target===u)return this.source;else throw"Node is not incident with this edge"},n.prototype.getOtherEndInGraph=function(u,r){var y=this.getOtherEnd(u),i=r.getGraphManager().getRoot();while(!0){if(y.getOwner()==r)return y;if(y.getOwner()==i)break;y=y.getOwner().getParent()}return null},n.prototype.updateLength=function(){var u=[,,,,];if(this.isOverlapingSourceAndTarget=f.getIntersection(this.target.getRect(),this.source.getRect(),u),!this.isOverlapingSourceAndTarget){if(this.lengthX=u[0]-u[2],this.lengthY=u[1]-u[3],Math.abs(this.lengthX)<1)this.lengthX=o.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=o.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},n.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=o.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=o.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},w.exports=n},function(w,I,A){function v(f){this.vGraphObject=f}w.exports=v},function(w,I,A){var v=A(2),f=A(10),o=A(13),n=A(0),a=A(16),u=A(5);function r(i,e,g,d){if(g==null&&d==null)d=e;if(v.call(this,d),i.graphManager!=null)i=i.graphManager;if(this.estimatedSize=f.MIN_VALUE,this.inclusionTreeDepth=f.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=i,g!=null&&e!=null)this.rect=new o(e.x,e.y,g.width,g.height);else this.rect=new o}r.prototype=Object.create(v.prototype);for(var y in v)r[y]=v[y];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(i){this.rect.width=i},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(i){this.rect.height=i},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new u(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new u(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(i,e){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=e.width,this.rect.height=e.height},r.prototype.setCenter=function(i,e){this.rect.x=i-this.rect.width/2,this.rect.y=e-this.rect.height/2},r.prototype.setLocation=function(i,e){this.rect.x=i,this.rect.y=e},r.prototype.moveBy=function(i,e){this.rect.x+=i,this.rect.y+=e},r.prototype.getEdgeListToNode=function(i){var e=[],g,d=this;return d.edges.forEach(function(c){if(c.target==i){if(c.source!=d)throw"Incorrect edge source!";e.push(c)}}),e},r.prototype.getEdgesBetween=function(i){var e=[],g,d=this;return d.edges.forEach(function(c){if(!(c.source==d||c.target==d))throw"Incorrect edge source and/or target";if(c.target==i||c.source==i)e.push(c)}),e},r.prototype.getNeighborsList=function(){var i=new Set,e=this;return e.edges.forEach(function(g){if(g.source==e)i.add(g.target);else{if(g.target!=e)throw"Incorrect incidency!";i.add(g.source)}}),i},r.prototype.withChildren=function(){var i=new Set,e,g;if(i.add(this),this.child!=null){var d=this.child.getNodes();for(var c=0;c<d.length;c++)e=d[c],g=e.withChildren(),g.forEach(function(O){i.add(O)})}return i},r.prototype.getNoOfChildren=function(){var i=0,e;if(this.child==null)i=1;else{var g=this.child.getNodes();for(var d=0;d<g.length;d++)e=g[d],i+=e.getNoOfChildren()}if(i==0)i=1;return i},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==f.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},r.prototype.scatter=function(){var i,e,g=-n.INITIAL_WORLD_BOUNDARY,d=n.INITIAL_WORLD_BOUNDARY;i=n.WORLD_CENTER_X+a.nextDouble()*(d-g)+g;var c=-n.INITIAL_WORLD_BOUNDARY,O=n.INITIAL_WORLD_BOUNDARY;e=n.WORLD_CENTER_Y+a.nextDouble()*(O-c)+c,this.rect.x=i,this.rect.y=e},r.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),n.NODE_DIMENSIONS_INCLUDE_LABELS){var e=i.getRight()-i.getLeft(),g=i.getBottom()-i.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(e+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>e)this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(e+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(g+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>g)this.rect.y-=(this.labelHeight-g)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(g+this.labelHeight)}}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==f.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(i){var e=this.rect.x;if(e>n.WORLD_BOUNDARY)e=n.WORLD_BOUNDARY;else if(e<-n.WORLD_BOUNDARY)e=-n.WORLD_BOUNDARY;var g=this.rect.y;if(g>n.WORLD_BOUNDARY)g=n.WORLD_BOUNDARY;else if(g<-n.WORLD_BOUNDARY)g=-n.WORLD_BOUNDARY;var d=new u(e,g),c=i.inverseTransformPoint(d);this.setLocation(c.x,c.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},w.exports=r},function(w,I,A){var v=A(0);function f(){}for(var o in v)f[o]=v[o];f.MAX_ITERATIONS=2500,f.DEFAULT_EDGE_LENGTH=50,f.DEFAULT_SPRING_STRENGTH=0.45,f.DEFAULT_REPULSION_STRENGTH=4500,f.DEFAULT_GRAVITY_STRENGTH=0.4,f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,f.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,f.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,f.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,f.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,f.COOLING_ADAPTATION_FACTOR=0.33,f.ADAPTATION_LOWER_NODE_LIMIT=1000,f.ADAPTATION_UPPER_NODE_LIMIT=5000,f.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,f.MAX_NODE_DISPLACEMENT=f.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,f.CONVERGENCE_CHECK_PERIOD=100,f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,f.MIN_EDGE_LENGTH=1,f.GRID_CALCULATION_CHECK_PERIOD=10,w.exports=f},function(w,I,A){function v(f,o){if(f==null&&o==null)this.x=0,this.y=0;else this.x=f,this.y=o}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(f){this.x=f},v.prototype.setY=function(f){this.y=f},v.prototype.getDifference=function(f){return new DimensionD(this.x-f.x,this.y-f.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(f){return this.x+=f.width,this.y+=f.height,this},w.exports=v},function(w,I,A){var v=A(2),f=A(10),o=A(0),n=A(7),a=A(3),u=A(1),r=A(13),y=A(12),i=A(11);function e(d,c,O){if(v.call(this,O),this.estimatedSize=f.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,c!=null&&c instanceof n)this.graphManager=c;else if(c!=null&&c instanceof Layout)this.graphManager=c.graphManager}e.prototype=Object.create(v.prototype);for(var g in v)e[g]=v[g];e.prototype.getNodes=function(){return this.nodes},e.prototype.getEdges=function(){return this.edges},e.prototype.getGraphManager=function(){return this.graphManager},e.prototype.getParent=function(){return this.parent},e.prototype.getLeft=function(){return this.left},e.prototype.getRight=function(){return this.right},e.prototype.getTop=function(){return this.top},e.prototype.getBottom=function(){return this.bottom},e.prototype.isConnected=function(){return this.isConnected},e.prototype.add=function(d,c,O){if(c==null&&O==null){var T=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(T)>-1)throw"Node already in graph!";return T.owner=this,this.getNodes().push(T),T}else{var N=d;if(!(this.getNodes().indexOf(c)>-1&&this.getNodes().indexOf(O)>-1))throw"Source or target not in graph!";if(!(c.owner==O.owner&&c.owner==this))throw"Both owners must be this graph!";if(c.owner!=O.owner)return null;if(N.source=c,N.target=O,N.isInterGraph=!1,this.getEdges().push(N),c.edges.push(N),O!=c)O.edges.push(N);return N}},e.prototype.remove=function(d){var c=d;if(d instanceof a){if(c==null)throw"Node is null!";if(!(c.owner!=null&&c.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var O=c.edges.slice(),T,N=O.length;for(var D=0;D<N;D++)if(T=O[D],T.isInterGraph)this.graphManager.remove(T);else T.source.owner.remove(T);var X=this.nodes.indexOf(c);if(X==-1)throw"Node not in owner node list!";this.nodes.splice(X,1)}else if(d instanceof u){var T=d;if(T==null)throw"Edge is null!";if(!(T.source!=null&&T.target!=null))throw"Source and/or target is null!";if(!(T.source.owner!=null&&T.target.owner!=null&&T.source.owner==this&&T.target.owner==this))throw"Source and/or target owner is invalid!";var x=T.source.edges.indexOf(T),V=T.target.edges.indexOf(T);if(!(x>-1&&V>-1))throw"Source and/or target doesn't know this edge!";if(T.source.edges.splice(x,1),T.target!=T.source)T.target.edges.splice(V,1);var X=T.source.owner.getEdges().indexOf(T);if(X==-1)throw"Not in owner's edge list!";T.source.owner.getEdges().splice(X,1)}},e.prototype.updateLeftTop=function(){var{MAX_VALUE:d,MAX_VALUE:c}=f,O,T,N,D=this.getNodes(),X=D.length;for(var x=0;x<X;x++){var V=D[x];if(O=V.getTop(),T=V.getLeft(),d>O)d=O;if(c>T)c=T}if(d==f.MAX_VALUE)return null;if(D[0].getParent().paddingLeft!=null)N=D[0].getParent().paddingLeft;else N=this.margin;return this.left=c-N,this.top=d-N,new y(this.left,this.top)},e.prototype.updateBounds=function(d){var c=f.MAX_VALUE,O=-f.MAX_VALUE,T=f.MAX_VALUE,N=-f.MAX_VALUE,D,X,x,V,_,Q=this.nodes,lt=Q.length;for(var b=0;b<lt;b++){var tt=Q[b];if(d&&tt.child!=null)tt.updateBounds();if(D=tt.getLeft(),X=tt.getRight(),x=tt.getTop(),V=tt.getBottom(),c>D)c=D;if(O<X)O=X;if(T>x)T=x;if(N<V)N=V}var s=new r(c,T,O-c,N-T);if(c==f.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(Q[0].getParent().paddingLeft!=null)_=Q[0].getParent().paddingLeft;else _=this.margin;this.left=s.x-_,this.right=s.x+s.width+_,this.top=s.y-_,this.bottom=s.y+s.height+_},e.calculateBounds=function(d){var c=f.MAX_VALUE,O=-f.MAX_VALUE,T=f.MAX_VALUE,N=-f.MAX_VALUE,D,X,x,V,_=d.length;for(var Q=0;Q<_;Q++){var lt=d[Q];if(D=lt.getLeft(),X=lt.getRight(),x=lt.getTop(),V=lt.getBottom(),c>D)c=D;if(O<X)O=X;if(T>x)T=x;if(N<V)N=V}var b=new r(c,T,O-c,N-T);return b},e.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},e.prototype.getEstimatedSize=function(){if(this.estimatedSize==f.MIN_VALUE)throw"assert failed";return this.estimatedSize},e.prototype.calcEstimatedSize=function(){var d=0,c=this.nodes,O=c.length;for(var T=0;T<O;T++){var N=c[T];d+=N.calcEstimatedSize()}if(d==0)this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=d/Math.sqrt(this.nodes.length);return this.estimatedSize},e.prototype.updateConnected=function(){var d=this;if(this.nodes.length==0){this.isConnected=!0;return}var c=new i,O=new Set,T=this.nodes[0],N,D,X=T.withChildren();X.forEach(function(b){c.push(b),O.add(b)});while(c.length!==0){T=c.shift(),N=T.getEdges();var x=N.length;for(var V=0;V<x;V++){var _=N[V];if(D=_.getOtherEndInGraph(T,this),D!=null&&!O.has(D)){var Q=D.withChildren();Q.forEach(function(b){c.push(b),O.add(b)})}}}if(this.isConnected=!1,O.size>=this.nodes.length){var lt=0;if(O.forEach(function(b){if(b.owner==d)lt++}),lt==this.nodes.length)this.isConnected=!0}},w.exports=e},function(w,I,A){var v,f=A(1);function o(n){v=A(6),this.layout=n,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var n=this.layout.newGraph(),a=this.layout.newNode(null),u=this.add(n,a);return this.setRootGraph(u),this.rootGraph},o.prototype.add=function(n,a,u,r,y){if(u==null&&r==null&&y==null){if(n==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(n)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(n),n.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return n.parent=a,a.child=n,n}else{y=u,r=a,u=n;var i=r.getOwner(),e=y.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(e!=null&&e.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==e)return u.isInterGraph=!1,i.add(u,r,y);else{if(u.isInterGraph=!0,u.source=r,u.target=y,this.edges.indexOf(u)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(u),!(u.source!=null&&u.target!=null))throw"Edge source and/or target is null!";if(!(u.source.edges.indexOf(u)==-1&&u.target.edges.indexOf(u)==-1))throw"Edge already in source and/or target incidency list!";return u.source.edges.push(u),u.target.edges.push(u),u}}},o.prototype.remove=function(n){if(n instanceof v){var a=n;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var u=[];u=u.concat(a.getEdges());var r,y=u.length;for(var i=0;i<y;i++)r=u[i],a.remove(r);var e=[];e=e.concat(a.getNodes());var g;y=e.length;for(var i=0;i<y;i++)g=e[i],a.remove(g);if(a==this.rootGraph)this.setRootGraph(null);var d=this.graphs.indexOf(a);this.graphs.splice(d,1),a.parent=null}else if(n instanceof f){if(r=n,r==null)throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(!(r.source!=null&&r.target!=null))throw"Source and/or target is null!";if(!(r.source.edges.indexOf(r)!=-1&&r.target.edges.indexOf(r)!=-1))throw"Source and/or target doesn't know this edge!";var d=r.source.edges.indexOf(r);if(r.source.edges.splice(d,1),d=r.target.edges.indexOf(r),r.target.edges.splice(d,1),!(r.source.owner!=null&&r.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(r.source.owner.getGraphManager().edges.indexOf(r)==-1)throw"Not in owner graph manager's edge list!";var d=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(d,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){var n=[],a=this.getGraphs(),u=a.length;for(var r=0;r<u;r++)n=n.concat(a[r].getNodes());this.allNodes=n}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var n=[],a=this.getGraphs(),u=a.length;for(var r=0;r<a.length;r++)n=n.concat(a[r].getEdges());n=n.concat(this.edges),this.allEdges=n}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(n){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=n},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(n){if(n.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=n,n.parent==null)n.parent=this.layout.newNode("Root node")},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(n,a){if(!(n!=null&&a!=null))throw"assert failed";if(n==a)return!0;var u=n.getOwner(),r;do{if(r=u.getParent(),r==null)break;if(r==a)return!0;if(u=r.getOwner(),u==null)break}while(!0);u=a.getOwner();do{if(r=u.getParent(),r==null)break;if(r==n)return!0;if(u=r.getOwner(),u==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){var n,a,u,r,y,i=this.getAllEdges(),e=i.length;for(var g=0;g<e;g++){if(n=i[g],a=n.source,u=n.target,n.lca=null,n.sourceInLca=a,n.targetInLca=u,a==u){n.lca=a.getOwner();continue}r=a.getOwner();while(n.lca==null){n.targetInLca=u,y=u.getOwner();while(n.lca==null){if(y==r){n.lca=y;break}if(y==this.rootGraph)break;if(n.lca!=null)throw"assert failed";n.targetInLca=y.getParent(),y=n.targetInLca.getOwner()}if(r==this.rootGraph)break;if(n.lca==null)n.sourceInLca=r.getParent(),r=n.sourceInLca.getOwner()}if(n.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(n,a){if(n==a)return n.getOwner();var u=n.getOwner();do{if(u==null)break;var r=a.getOwner();do{if(r==null)break;if(r==u)return r;r=r.getParent().getOwner()}while(!0);u=u.getParent().getOwner()}while(!0);return u},o.prototype.calcInclusionTreeDepths=function(n,a){if(n==null&&a==null)n=this.rootGraph,a=1;var u,r=n.getNodes(),y=r.length;for(var i=0;i<y;i++)if(u=r[i],u.inclusionTreeDepth=a,u.child!=null)this.calcInclusionTreeDepths(u.child,a+1)},o.prototype.includesInvalidEdge=function(){var n,a=[],u=this.edges.length;for(var r=0;r<u;r++)if(n=this.edges[r],this.isOneAncestorOfOther(n.source,n.target))a.push(n);for(var r=0;r<a.length;r++)this.remove(a[r]);return!1},w.exports=o},function(w,I,A){var v=A(12);function f(){}f.calcSeparationAmount=function(o,n,a,u){if(!o.intersects(n))throw"assert failed";var r=[,,];if(this.decideDirectionsForOverlappingNodes(o,n,r),a[0]=Math.min(o.getRight(),n.getRight())-Math.max(o.x,n.x),a[1]=Math.min(o.getBottom(),n.getBottom())-Math.max(o.y,n.y),o.getX()<=n.getX()&&o.getRight()>=n.getRight())a[0]+=Math.min(n.getX()-o.getX(),o.getRight()-n.getRight());else if(n.getX()<=o.getX()&&n.getRight()>=o.getRight())a[0]+=Math.min(o.getX()-n.getX(),n.getRight()-o.getRight());if(o.getY()<=n.getY()&&o.getBottom()>=n.getBottom())a[1]+=Math.min(n.getY()-o.getY(),o.getBottom()-n.getBottom());else if(n.getY()<=o.getY()&&n.getBottom()>=o.getBottom())a[1]+=Math.min(o.getY()-n.getY(),n.getBottom()-o.getBottom());var y=Math.abs((n.getCenterY()-o.getCenterY())/(n.getCenterX()-o.getCenterX()));if(n.getCenterY()===o.getCenterY()&&n.getCenterX()===o.getCenterX())y=1;var i=y*a[0],e=a[1]/y;if(a[0]<e)e=a[0];else i=a[1];a[0]=-1*r[0]*(e/2+u),a[1]=-1*r[1]*(i/2+u)},f.decideDirectionsForOverlappingNodes=function(o,n,a){if(o.getCenterX()<n.getCenterX())a[0]=-1;else a[0]=1;if(o.getCenterY()<n.getCenterY())a[1]=-1;else a[1]=1},f.getIntersection2=function(o,n,a){var u=o.getCenterX(),r=o.getCenterY(),y=n.getCenterX(),i=n.getCenterY();if(o.intersects(n))return a[0]=u,a[1]=r,a[2]=y,a[3]=i,!0;var e=o.getX(),g=o.getY(),d=o.getRight(),c=o.getX(),O=o.getBottom(),T=o.getRight(),N=o.getWidthHalf(),D=o.getHeightHalf(),X=n.getX(),x=n.getY(),V=n.getRight(),_=n.getX(),Q=n.getBottom(),lt=n.getRight(),b=n.getWidthHalf(),tt=n.getHeightHalf(),s=!1,L=!1;if(u===y){if(r>i)return a[0]=u,a[1]=g,a[2]=y,a[3]=Q,!1;else if(r<i)return a[0]=u,a[1]=O,a[2]=y,a[3]=x,!1}else if(r===i){if(u>y)return a[0]=e,a[1]=r,a[2]=V,a[3]=i,!1;else if(u<y)return a[0]=d,a[1]=r,a[2]=X,a[3]=i,!1}else{var E=o.height/o.width,M=n.height/n.width,m=(i-r)/(y-u),U=void 0,S=void 0,k=void 0,B=void 0,W=void 0,st=void 0;if(-E===m)if(u>y)a[0]=c,a[1]=O,s=!0;else a[0]=d,a[1]=g,s=!0;else if(E===m)if(u>y)a[0]=e,a[1]=g,s=!0;else a[0]=T,a[1]=O,s=!0;if(-M===m)if(y>u)a[2]=_,a[3]=Q,L=!0;else a[2]=V,a[3]=x,L=!0;else if(M===m)if(y>u)a[2]=X,a[3]=x,L=!0;else a[2]=lt,a[3]=Q,L=!0;if(s&&L)return!1;if(u>y)if(r>i)U=this.getCardinalDirection(E,m,4),S=this.getCardinalDirection(M,m,2);else U=this.getCardinalDirection(-E,m,3),S=this.getCardinalDirection(-M,m,1);else if(r>i)U=this.getCardinalDirection(-E,m,1),S=this.getCardinalDirection(-M,m,3);else U=this.getCardinalDirection(E,m,2),S=this.getCardinalDirection(M,m,4);if(!s)switch(U){case 1:B=g,k=u+-D/m,a[0]=k,a[1]=B;break;case 2:k=T,B=r+N*m,a[0]=k,a[1]=B;break;case 3:B=O,k=u+D/m,a[0]=k,a[1]=B;break;case 4:k=c,B=r+-N*m,a[0]=k,a[1]=B;break}if(!L)switch(S){case 1:st=x,W=y+-tt/m,a[2]=W,a[3]=st;break;case 2:W=lt,st=i+b*m,a[2]=W,a[3]=st;break;case 3:st=Q,W=y+tt/m,a[2]=W,a[3]=st;break;case 4:W=_,st=i+-b*m,a[2]=W,a[3]=st;break}}return!1},f.getCardinalDirection=function(o,n,a){if(o>n)return a;else return 1+a%4},f.getIntersection=function(o,n,a,u){if(u==null)return this.getIntersection2(o,n,a);var{x:r,y}=o,{x:i,y:e}=n,{x:g,y:d}=a,{x:c,y:O}=u,T=void 0,N=void 0,D=void 0,X=void 0,x=void 0,V=void 0,_=void 0,Q=void 0,lt=void 0;if(D=e-y,x=r-i,_=i*y-r*e,X=O-d,V=g-c,Q=c*d-g*O,lt=D*V-X*x,lt===0)return null;return T=(x*Q-V*_)/lt,N=(X*_-D*Q)/lt,new v(T,N)},f.angleOfVector=function(o,n,a,u){var r=void 0;if(o!==a){if(r=Math.atan((u-n)/(a-o)),a<o)r+=Math.PI;else if(u<n)r+=this.TWO_PI}else if(u<n)r=this.ONE_AND_HALF_PI;else r=this.HALF_PI;return r},f.doIntersect=function(o,n,a,u){var{x:r,y}=o,{x:i,y:e}=n,{x:g,y:d}=a,{x:c,y:O}=u,T=(i-r)*(O-d)-(c-g)*(e-y);if(T===0)return!1;else{var N=((O-d)*(c-r)+(g-c)*(O-y))/T,D=((y-e)*(c-r)+(i-r)*(O-y))/T;return 0<N&&N<1&&0<D&&D<1}},f.findCircleLineIntersections=function(o,n,a,u,r,y,i){var e=(a-o)*(a-o)+(u-n)*(u-n),g=2*((o-r)*(a-o)+(n-y)*(u-n)),d=(o-r)*(o-r)+(n-y)*(n-y)-i*i,c=g*g-4*e*d;if(c>=0){var O=(-g+Math.sqrt(g*g-4*e*d))/(2*e),T=(-g-Math.sqrt(g*g-4*e*d))/(2*e),N=null;if(O>=0&&O<=1)return[O];if(T>=0&&T<=1)return[T];return N}else return null},f.HALF_PI=0.5*Math.PI,f.ONE_AND_HALF_PI=1.5*Math.PI,f.TWO_PI=2*Math.PI,f.THREE_PI=3*Math.PI,w.exports=f},function(w,I,A){function v(){}v.sign=function(f){if(f>0)return 1;else if(f<0)return-1;else return 0},v.floor=function(f){return f<0?Math.ceil(f):Math.floor(f)},v.ceil=function(f){return f<0?Math.floor(f):Math.ceil(f)},w.exports=v},function(w,I,A){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,w.exports=v},function(w,I,A){var v=function(){function r(y,i){for(var e=0;e<i.length;e++){var g=i[e];if(g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g)g.writable=!0;Object.defineProperty(y,g.key,g)}}return function(y,i,e){if(i)r(y.prototype,i);if(e)r(y,e);return y}}();function f(r,y){if(!(r instanceof y))throw TypeError("Cannot call a class as a function")}var o=function(y){return{value:y,next:null,prev:null}},n=function(y,i,e,g){if(y!==null)y.next=i;else g.head=i;if(e!==null)e.prev=i;else g.tail=i;return i.prev=y,i.next=e,g.length++,i},a=function(y,i){var{prev:e,next:g}=y;if(e!==null)e.next=g;else i.head=g;if(g!==null)g.prev=e;else i.tail=e;return y.prev=y.next=null,i.length--,y},u=function(){function r(y){var i=this;if(f(this,r),this.length=0,this.head=null,this.tail=null,y!=null)y.forEach(function(e){return i.push(e)})}return v(r,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(i,e){return n(e.prev,o(i),e,this)}},{key:"insertAfter",value:function(i,e){return n(e,o(i),e.next,this)}},{key:"insertNodeBefore",value:function(i,e){return n(e.prev,i,e,this)}},{key:"insertNodeAfter",value:function(i,e){return n(e,i,e.next,this)}},{key:"push",value:function(i){return n(this.tail,o(i),null,this)}},{key:"unshift",value:function(i){return n(null,o(i),this.head,this)}},{key:"remove",value:function(i){return a(i,this)}},{key:"pop",value:function(){return a(this.tail,this).value}},{key:"popNode",value:function(){return a(this.tail,this)}},{key:"shift",value:function(){return a(this.head,this).value}},{key:"shiftNode",value:function(){return a(this.head,this)}},{key:"get_object_at",value:function(i){if(i<=this.length()){var e=1,g=this.head;while(e<i)g=g.next,e++;return g.value}}},{key:"set_object_at",value:function(i,e){if(i<=this.length()){var g=1,d=this.head;while(g<i)d=d.next,g++;d.value=e}}}]),r}();w.exports=u},function(w,I,A){function v(f,o,n){if(this.x=null,this.y=null,f==null&&o==null&&n==null)this.x=0,this.y=0;else if(typeof f=="number"&&typeof o=="number"&&n==null)this.x=f,this.y=o;else if(f.constructor.name=="Point"&&o==null&&n==null)n=f,this.x=n.x,this.y=n.y}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.getLocation=function(){return new v(this.x,this.y)},v.prototype.setLocation=function(f,o,n){if(f.constructor.name=="Point"&&o==null&&n==null)n=f,this.setLocation(n.x,n.y);else if(typeof f=="number"&&typeof o=="number"&&n==null)if(parseInt(f)==f&&parseInt(o)==o)this.move(f,o);else this.x=Math.floor(f+0.5),this.y=Math.floor(o+0.5)},v.prototype.move=function(f,o){this.x=f,this.y=o},v.prototype.translate=function(f,o){this.x+=f,this.y+=o},v.prototype.equals=function(f){if(f.constructor.name=="Point"){var o=f;return this.x==o.x&&this.y==o.y}return this==f},v.prototype.toString=function(){return new v().constructor.name+"[x="+this.x+",y="+this.y+"]"},w.exports=v},function(w,I,A){function v(f,o,n,a){if(this.x=0,this.y=0,this.width=0,this.height=0,f!=null&&o!=null&&n!=null&&a!=null)this.x=f,this.y=o,this.width=n,this.height=a}v.prototype.getX=function(){return this.x},v.prototype.setX=function(f){this.x=f},v.prototype.getY=function(){return this.y},v.prototype.setY=function(f){this.y=f},v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(f){this.width=f},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(f){this.height=f},v.prototype.getRight=function(){return this.x+this.width},v.prototype.getBottom=function(){return this.y+this.height},v.prototype.intersects=function(f){if(this.getRight()<f.x)return!1;if(this.getBottom()<f.y)return!1;if(f.getRight()<this.x)return!1;if(f.getBottom()<this.y)return!1;return!0},v.prototype.getCenterX=function(){return this.x+this.width/2},v.prototype.getMinX=function(){return this.getX()},v.prototype.getMaxX=function(){return this.getX()+this.width},v.prototype.getCenterY=function(){return this.y+this.height/2},v.prototype.getMinY=function(){return this.getY()},v.prototype.getMaxY=function(){return this.getY()+this.height},v.prototype.getWidthHalf=function(){return this.width/2},v.prototype.getHeightHalf=function(){return this.height/2},w.exports=v},function(w,I,A){var v=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol==="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function f(){}f.lastID=0,f.createID=function(o){if(f.isPrimitive(o))return o;if(o.uniqueID!=null)return o.uniqueID;return o.uniqueID=f.getString(),f.lastID++,o.uniqueID},f.getString=function(o){if(o==null)o=f.lastID;return"Object#"+o},f.isPrimitive=function(o){var n=typeof o>"u"?"undefined":v(o);return o==null||n!="object"&&n!="function"},w.exports=f},function(w,I,A){function v(g){if(Array.isArray(g)){for(var d=0,c=Array(g.length);d<g.length;d++)c[d]=g[d];return c}else return Array.from(g)}var f=A(0),o=A(7),n=A(3),a=A(1),u=A(6),r=A(5),y=A(17),i=A(29);function e(g){if(i.call(this),this.layoutQuality=f.QUALITY,this.createBendsAsNeeded=f.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=f.DEFAULT_INCREMENTAL,this.animationOnLayout=f.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=f.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=f.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=f.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,g!=null)this.isRemoteUse=g}e.RANDOM_SEED=1,e.prototype=Object.create(i.prototype),e.prototype.getGraphManager=function(){return this.graphManager},e.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},e.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},e.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},e.prototype.newGraphManager=function(){var g=new o(this);return this.graphManager=g,g},e.prototype.newGraph=function(g){return new u(null,this.graphManager,g)},e.prototype.newNode=function(g){return new n(this.graphManager,g)},e.prototype.newEdge=function(g){return new a(null,null,g)},e.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},e.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var g;if(this.checkLayoutSuccess())g=!1;else g=this.layout();if(f.ANIMATE==="during")return!1;if(g){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,g},e.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},e.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var g,d=this.graphManager.getAllEdges();for(var c=0;c<d.length;c++)g=d[c];var O,T=this.graphManager.getRoot().getNodes();for(var c=0;c<T.length;c++)O=T[c];this.update(this.graphManager.getRoot())}},e.prototype.update=function(g){if(g==null)this.update2();else if(g instanceof n){var d=g;if(d.getChild()!=null){var c=d.getChild().getNodes();for(var O=0;O<c.length;O++)update(c[O])}if(d.vGraphObject!=null){var T=d.vGraphObject;T.update(d)}}else if(g instanceof a){var N=g;if(N.vGraphObject!=null){var D=N.vGraphObject;D.update(N)}}else if(g instanceof u){var X=g;if(X.vGraphObject!=null){var x=X.vGraphObject;x.update(X)}}},e.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=f.QUALITY,this.animationDuringLayout=f.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=f.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=f.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=f.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=f.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=f.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},e.prototype.transform=function(g){if(g==null)this.transform(new r(0,0));else{var d=new y,c=this.graphManager.getRoot().updateLeftTop();if(c!=null){d.setWorldOrgX(g.x),d.setWorldOrgY(g.y),d.setDeviceOrgX(c.x),d.setDeviceOrgY(c.y);var O=this.getAllNodes(),T;for(var N=0;N<O.length;N++)T=O[N],T.transform(d)}}},e.prototype.positionNodesRandomly=function(g){if(g==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var d,c,O=g.getNodes();for(var T=0;T<O.length;T++)if(d=O[T],c=d.getChild(),c==null)d.scatter();else if(c.getNodes().length==0)d.scatter();else this.positionNodesRandomly(c),d.updateBounds()}},e.prototype.getFlatForest=function(){var g=[],d=!0,c=this.graphManager.getRoot().getNodes(),O=!0;for(var T=0;T<c.length;T++)if(c[T].getChild()!=null)O=!1;if(!O)return g;var N=new Set,D=[],X=new Map,x=[];x=x.concat(c);while(x.length>0&&d){D.push(x[0]);while(D.length>0&&d){var V=D[0];D.splice(0,1),N.add(V);var _=V.getEdges();for(var T=0;T<_.length;T++){var Q=_[T].getOtherEnd(V);if(X.get(V)!=Q)if(!N.has(Q))D.push(Q),X.set(Q,V);else{d=!1;break}}}if(!d)g=[];else{var lt=[].concat(v(N));g.push(lt);for(var T=0;T<lt.length;T++){var b=lt[T],tt=x.indexOf(b);if(tt>-1)x.splice(tt,1)}N=new Set,X=new Map}}return g},e.prototype.createDummyNodesForBendpoints=function(g){var d=[],c=g.source,O=this.graphManager.calcLowestCommonAncestor(g.source,g.target);for(var T=0;T<g.bendpoints.length;T++){var N=this.newNode(null);N.setRect(new Point(0,0),new Dimension(1,1)),O.add(N);var D=this.newEdge(null);this.graphManager.add(D,c,N),d.add(N),c=N}var D=this.newEdge(null);if(this.graphManager.add(D,c,g.target),this.edgeToDummyNodes.set(g,d),g.isInterGraph())this.graphManager.remove(g);else O.remove(g);return d},e.prototype.createBendpointsFromDummyNodes=function(){var g=[];g=g.concat(this.graphManager.getAllEdges()),g=[].concat(v(this.edgeToDummyNodes.keys())).concat(g);for(var d=0;d<g.length;d++){var c=g[d];if(c.bendpoints.length>0){var O=this.edgeToDummyNodes.get(c);for(var T=0;T<O.length;T++){var N=O[T],D=new r(N.getCenterX(),N.getCenterY()),X=c.bendpoints.get(T);X.x=D.x,X.y=D.y,N.getOwner().remove(N)}this.graphManager.add(c,c.source,c.target)}}},e.transform=function(g,d,c,O){if(c!=null&&O!=null){var T=d;if(g<=50){var N=d/c;T-=(d-N)/50*(50-g)}else{var D=d*O;T+=(D-d)/50*(g-50)}return T}else{var X,x;if(g<=50)X=9*d/500,x=d/10;else X=9*d/50,x=-8*d;return X*g+x}},e.findCenterOfTree=function(g){var d=[];d=d.concat(g);var c=[],O=new Map,T=!1,N=null;if(d.length==1||d.length==2)T=!0,N=d[0];for(var D=0;D<d.length;D++){var X=d[D],x=X.getNeighborsList().size;if(O.set(X,X.getNeighborsList().size),x==1)c.push(X)}var V=[];V=V.concat(c);while(!T){var _=[];_=_.concat(V),V=[];for(var D=0;D<d.length;D++){var X=d[D],Q=d.indexOf(X);if(Q>=0)d.splice(Q,1);var lt=X.getNeighborsList();lt.forEach(function(s){if(c.indexOf(s)<0){var L=O.get(s),E=L-1;if(E==1)V.push(s);O.set(s,E)}})}if(c=c.concat(V),d.length==1||d.length==2)T=!0,N=d[0]}return N},e.prototype.setGraphManager=function(g){this.graphManager=g},w.exports=e},function(w,I,A){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},w.exports=v},function(w,I,A){var v=A(5);function f(o,n){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}f.prototype.getWorldOrgX=function(){return this.lworldOrgX},f.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},f.prototype.getWorldOrgY=function(){return this.lworldOrgY},f.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},f.prototype.getWorldExtX=function(){return this.lworldExtX},f.prototype.setWorldExtX=function(o){this.lworldExtX=o},f.prototype.getWorldExtY=function(){return this.lworldExtY},f.prototype.setWorldExtY=function(o){this.lworldExtY=o},f.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},f.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},f.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},f.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},f.prototype.getDeviceExtX=function(){return this.ldeviceExtX},f.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},f.prototype.getDeviceExtY=function(){return this.ldeviceExtY},f.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},f.prototype.transformX=function(o){var n=0,a=this.lworldExtX;if(a!=0)n=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/a;return n},f.prototype.transformY=function(o){var n=0,a=this.lworldExtY;if(a!=0)n=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/a;return n},f.prototype.inverseTransformX=function(o){var n=0,a=this.ldeviceExtX;if(a!=0)n=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/a;return n},f.prototype.inverseTransformY=function(o){var n=0,a=this.ldeviceExtY;if(a!=0)n=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/a;return n},f.prototype.inverseTransformPoint=function(o){var n=new v(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return n},w.exports=f},function(w,I,A){function v(i){if(Array.isArray(i)){for(var e=0,g=Array(i.length);e<i.length;e++)g[e]=i[e];return g}else return Array.from(i)}var f=A(15),o=A(4),n=A(0),a=A(8),u=A(9);function r(){f.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}r.prototype=Object.create(f.prototype);for(var y in f)r[y]=f[y];r.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},r.prototype.calcIdealEdgeLengths=function(){var i,e,g,d,c,O,T,N=this.getGraphManager().getAllEdges();for(var D=0;D<N.length;D++)if(i=N[D],e=i.idealLength,i.isInterGraph){if(d=i.getSource(),c=i.getTarget(),O=i.getSourceInLca().getEstimatedSize(),T=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)i.idealLength+=O+T-2*n.SIMPLE_NODE_SIZE;g=i.getLca().getInclusionTreeDepth(),i.idealLength+=e*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(d.getInclusionTreeDepth()+c.getInclusionTreeDepth()-2*g)}},r.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;if(this.incremental){if(i>o.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(i>o.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(i-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){var i=this.getAllEdges(),e;for(var g=0;g<i.length;g++)e=i[g],this.calcSpringForce(e,e.idealLength)},r.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g,d,c,O,T=this.getAllNodes(),N;if(this.useFRGridVariant){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&i)this.updateGrid();N=new Set;for(g=0;g<T.length;g++)c=T[g],this.calculateRepulsionForceOfANode(c,N,i,e),N.add(c)}else for(g=0;g<T.length;g++){c=T[g];for(d=g+1;d<T.length;d++){if(O=T[d],c.getOwner()!=O.getOwner())continue;this.calcRepulsionForce(c,O)}}},r.prototype.calcGravitationalForces=function(){var i,e=this.getAllNodesToApplyGravitation();for(var g=0;g<e.length;g++)i=e[g],this.calcGravitationalForce(i)},r.prototype.moveNodes=function(){var i=this.getAllNodes(),e;for(var g=0;g<i.length;g++)e=i[g],e.move()},r.prototype.calcSpringForce=function(i,e){var g=i.getSource(),d=i.getTarget(),c,O,T,N;if(this.uniformLeafNodeSizes&&g.getChild()==null&&d.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;if(c=i.getLength(),c==0)return;O=i.edgeElasticity*(c-e),T=O*(i.lengthX/c),N=O*(i.lengthY/c),g.springForceX+=T,g.springForceY+=N,d.springForceX-=T,d.springForceY-=N},r.prototype.calcRepulsionForce=function(i,e){var g=i.getRect(),d=e.getRect(),c=[,,],O=[,,,,],T,N,D,X,x,V,_;if(g.intersects(d)){a.calcSeparationAmount(g,d,c,o.DEFAULT_EDGE_LENGTH/2),V=2*c[0],_=2*c[1];var Q=i.noOfChildren*e.noOfChildren/(i.noOfChildren+e.noOfChildren);i.repulsionForceX-=Q*V,i.repulsionForceY-=Q*_,e.repulsionForceX+=Q*V,e.repulsionForceY+=Q*_}else{if(this.uniformLeafNodeSizes&&i.getChild()==null&&e.getChild()==null)T=d.getCenterX()-g.getCenterX(),N=d.getCenterY()-g.getCenterY();else a.getIntersection(g,d,O),T=O[2]-O[0],N=O[3]-O[1];if(Math.abs(T)<o.MIN_REPULSION_DIST)T=u.sign(T)*o.MIN_REPULSION_DIST;if(Math.abs(N)<o.MIN_REPULSION_DIST)N=u.sign(N)*o.MIN_REPULSION_DIST;D=T*T+N*N,X=Math.sqrt(D),x=(i.nodeRepulsion/2+e.nodeRepulsion/2)*i.noOfChildren*e.noOfChildren/D,V=x*T/X,_=x*N/X,i.repulsionForceX-=V,i.repulsionForceY-=_,e.repulsionForceX+=V,e.repulsionForceY+=_}},r.prototype.calcGravitationalForce=function(i){var e,g,d,c,O,T,N,D;if(e=i.getOwner(),g=(e.getRight()+e.getLeft())/2,d=(e.getTop()+e.getBottom())/2,c=i.getCenterX()-g,O=i.getCenterY()-d,T=Math.abs(c)+i.getWidth()/2,N=Math.abs(O)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()){if(D=e.getEstimatedSize()*this.gravityRangeFactor,T>D||N>D)i.gravitationForceX=-this.gravityConstant*c,i.gravitationForceY=-this.gravityConstant*O}else if(D=e.getEstimatedSize()*this.compoundGravityRangeFactor,T>D||N>D)i.gravitationForceX=-this.gravityConstant*c*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*O*this.compoundGravityConstant},r.prototype.isConverged=function(){var i,e=!1;if(this.totalIterations>this.maxIterations/3)e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||e},r.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},r.prototype.calcNoOfChildrenForAllNodes=function(){var i,e=this.graphManager.getAllNodes();for(var g=0;g<e.length;g++)i=e[g],i.noOfChildren=i.getNoOfChildren()},r.prototype.calcGrid=function(i){var e=0,g=0;e=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),g=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));var d=Array(e);for(var c=0;c<e;c++)d[c]=Array(g);for(var c=0;c<e;c++)for(var O=0;O<g;O++)d[c][O]=[];return d},r.prototype.addNodeToGrid=function(i,e,g){var d=0,c=0,O=0,T=0;d=parseInt(Math.floor((i.getRect().x-e)/this.repulsionRange)),c=parseInt(Math.floor((i.getRect().width+i.getRect().x-e)/this.repulsionRange)),O=parseInt(Math.floor((i.getRect().y-g)/this.repulsionRange)),T=parseInt(Math.floor((i.getRect().height+i.getRect().y-g)/this.repulsionRange));for(var N=d;N<=c;N++)for(var D=O;D<=T;D++)this.grid[N][D].push(i),i.setGridCoordinates(d,c,O,T)},r.prototype.updateGrid=function(){var i,e,g=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(i=0;i<g.length;i++)e=g[i],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},r.prototype.calculateRepulsionForceOfANode=function(i,e,g,d){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&g||d){var c=new Set;i.surrounding=[];var O,T=this.grid;for(var N=i.startX-1;N<i.finishX+2;N++)for(var D=i.startY-1;D<i.finishY+2;D++)if(!(N<0||D<0||N>=T.length||D>=T[0].length))for(var X=0;X<T[N][D].length;X++){if(O=T[N][D][X],i.getOwner()!=O.getOwner()||i==O)continue;if(!e.has(O)&&!c.has(O)){var x=Math.abs(i.getCenterX()-O.getCenterX())-(i.getWidth()/2+O.getWidth()/2),V=Math.abs(i.getCenterY()-O.getCenterY())-(i.getHeight()/2+O.getHeight()/2);if(x<=this.repulsionRange&&V<=this.repulsionRange)c.add(O)}}i.surrounding=[].concat(v(c))}for(N=0;N<i.surrounding.length;N++)this.calcRepulsionForce(i,i.surrounding[N])},r.prototype.calcRepulsionRange=function(){return 0},w.exports=r},function(w,I,A){var v=A(1),f=A(4);function o(a,u,r){v.call(this,a,u,r),this.idealLength=f.DEFAULT_EDGE_LENGTH,this.edgeElasticity=f.DEFAULT_SPRING_STRENGTH}o.prototype=Object.create(v.prototype);for(var n in v)o[n]=v[n];w.exports=o},function(w,I,A){var v=A(3),f=A(4);function o(a,u,r,y){v.call(this,a,u,r,y),this.nodeRepulsion=f.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}o.prototype=Object.create(v.prototype);for(var n in v)o[n]=v[n];o.prototype.setGridCoordinates=function(a,u,r,y){this.startX=a,this.finishX=u,this.startY=r,this.finishY=y},w.exports=o},function(w,I,A){function v(f,o){if(this.width=0,this.height=0,f!==null&&o!==null)this.height=o,this.width=f}v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(f){this.width=f},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(f){this.height=f},w.exports=v},function(w,I,A){var v=A(14);function f(){this.map={},this.keys=[]}f.prototype.put=function(o,n){var a=v.createID(o);if(!this.contains(a))this.map[a]=n,this.keys.push(o)},f.prototype.contains=function(o){var n=v.createID(o);return this.map[o]!=null},f.prototype.get=function(o){var n=v.createID(o);return this.map[n]},f.prototype.keySet=function(){return this.keys},w.exports=f},function(w,I,A){var v=A(14);function f(){this.set={}}f.prototype.add=function(o){var n=v.createID(o);if(!this.contains(n))this.set[n]=o},f.prototype.remove=function(o){delete this.set[v.createID(o)]},f.prototype.clear=function(){this.set={}},f.prototype.contains=function(o){return this.set[v.createID(o)]==o},f.prototype.isEmpty=function(){return this.size()===0},f.prototype.size=function(){return Object.keys(this.set).length},f.prototype.addAllTo=function(o){var n=Object.keys(this.set),a=n.length;for(var u=0;u<a;u++)o.push(this.set[n[u]])},f.prototype.size=function(){return Object.keys(this.set).length},f.prototype.addAll=function(o){var n=o.length;for(var a=0;a<n;a++){var u=o[a];this.add(u)}},w.exports=f},function(w,I,A){function v(){}v.multMat=function(f,o){var n=[];for(var a=0;a<f.length;a++){n[a]=[];for(var u=0;u<o[0].length;u++){n[a][u]=0;for(var r=0;r<f[0].length;r++)n[a][u]+=f[a][r]*o[r][u]}}return n},v.transpose=function(f){var o=[];for(var n=0;n<f[0].length;n++){o[n]=[];for(var a=0;a<f.length;a++)o[n][a]=f[a][n]}return o},v.multCons=function(f,o){var n=[];for(var a=0;a<f.length;a++)n[a]=f[a]*o;return n},v.minusOp=function(f,o){var n=[];for(var a=0;a<f.length;a++)n[a]=f[a]-o[a];return n},v.dotProduct=function(f,o){var n=0;for(var a=0;a<f.length;a++)n+=f[a]*o[a];return n},v.mag=function(f){return Math.sqrt(this.dotProduct(f,f))},v.normalize=function(f){var o=[],n=this.mag(f);for(var a=0;a<f.length;a++)o[a]=f[a]/n;return o},v.multGamma=function(f){var o=[],n=0;for(var a=0;a<f.length;a++)n+=f[a];n*=-1/f.length;for(var u=0;u<f.length;u++)o[u]=n+f[u];return o},v.multL=function(f,o,n){var a=[],u=[],r=[];for(var y=0;y<o[0].length;y++){var i=0;for(var e=0;e<o.length;e++)i+=-0.5*o[e][y]*f[e];u[y]=i}for(var g=0;g<n.length;g++){var d=0;for(var c=0;c<n.length;c++)d+=n[g][c]*u[c];r[g]=d}for(var O=0;O<o.length;O++){var T=0;for(var N=0;N<o[0].length;N++)T+=o[O][N]*r[N];a[O]=T}return a},w.exports=v},function(w,I,A){var v=function(){function a(u,r){for(var y=0;y<r.length;y++){var i=r[y];if(i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i)i.writable=!0;Object.defineProperty(u,i.key,i)}}return function(u,r,y){if(r)a(u.prototype,r);if(y)a(u,y);return u}}();function f(a,u){if(!(a instanceof u))throw TypeError("Cannot call a class as a function")}var o=A(11),n=function(){function a(u,r){if(f(this,a),r!==null||r!==void 0)this.compareFunction=this._defaultCompareFunction;var y=void 0;if(u instanceof o)y=u.size();else y=u.length;this._quicksort(u,0,y-1)}return v(a,[{key:"_quicksort",value:function(r,y,i){if(y<i){var e=this._partition(r,y,i);this._quicksort(r,y,e),this._quicksort(r,e+1,i)}}},{key:"_partition",value:function(r,y,i){var e=this._get(r,y),g=y,d=i;while(!0){while(this.compareFunction(e,this._get(r,d)))d--;while(this.compareFunction(this._get(r,g),e))g++;if(g<d)this._swap(r,g,d),g++,d--;else return d}}},{key:"_get",value:function(r,y){if(r instanceof o)return r.get_object_at(y);else return r[y]}},{key:"_set",value:function(r,y,i){if(r instanceof o)r.set_object_at(y,i);else r[y]=i}},{key:"_swap",value:function(r,y,i){var e=this._get(r,y);this._set(r,y,this._get(r,i)),this._set(r,i,e)}},{key:"_defaultCompareFunction",value:function(r,y){return y>r}}]),a}();w.exports=n},function(w,I,A){function v(){}v.svd=function(f){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=f.length,this.n=f[0].length;var o=Math.min(this.m,this.n);this.s=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(Math.min(this.m+1,this.n)),this.U=function(Wt){var bt=function oe($t){if($t.length==0)return 0;else{var jt=[];for(var ne=0;ne<$t[0];ne++)jt.push(oe($t.slice(1)));return jt}};return bt(Wt)}([this.m,o]),this.V=function(Wt){var bt=function oe($t){if($t.length==0)return 0;else{var jt=[];for(var ne=0;ne<$t[0];ne++)jt.push(oe($t.slice(1)));return jt}};return bt(Wt)}([this.n,this.n]);var n=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(this.n),a=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(this.m),u=!0,r=!0,y=Math.min(this.m-1,this.n),i=Math.max(0,Math.min(this.n-2,this.m));for(var e=0;e<Math.max(y,i);e++){if(e<y){this.s[e]=0;for(var g=e;g<this.m;g++)this.s[e]=v.hypot(this.s[e],f[g][e]);if(this.s[e]!==0){if(f[e][e]<0)this.s[e]=-this.s[e];for(var d=e;d<this.m;d++)f[d][e]/=this.s[e];f[e][e]+=1}this.s[e]=-this.s[e]}for(var c=e+1;c<this.n;c++){if(function(Wt,bt){return Wt&&bt}(e<y,this.s[e]!==0)){var O=0;for(var T=e;T<this.m;T++)O+=f[T][e]*f[T][c];O=-O/f[e][e];for(var N=e;N<this.m;N++)f[N][c]+=O*f[N][e]}n[c]=f[e][c]}if(function(Wt,bt){return Wt&&bt}(u,e<y))for(var D=e;D<this.m;D++)this.U[D][e]=f[D][e];if(e<i){n[e]=0;for(var X=e+1;X<this.n;X++)n[e]=v.hypot(n[e],n[X]);if(n[e]!==0){if(n[e+1]<0)n[e]=-n[e];for(var x=e+1;x<this.n;x++)n[x]/=n[e];n[e+1]+=1}if(n[e]=-n[e],function(Wt,bt){return Wt&&bt}(e+1<this.m,n[e]!==0)){for(var V=e+1;V<this.m;V++)a[V]=0;for(var _=e+1;_<this.n;_++)for(var Q=e+1;Q<this.m;Q++)a[Q]+=n[_]*f[Q][_];for(var lt=e+1;lt<this.n;lt++){var b=-n[lt]/n[e+1];for(var tt=e+1;tt<this.m;tt++)f[tt][lt]+=b*a[tt]}}if(r)for(var s=e+1;s<this.n;s++)this.V[s][e]=n[s]}}var L=Math.min(this.n,this.m+1);if(y<this.n)this.s[y]=f[y][y];if(this.m<L)this.s[L-1]=0;if(i+1<L)n[i]=f[i][L-1];if(n[L-1]=0,u){for(var E=y;E<o;E++){for(var M=0;M<this.m;M++)this.U[M][E]=0;this.U[E][E]=1}for(var m=y-1;m>=0;m--)if(this.s[m]!==0){for(var U=m+1;U<o;U++){var S=0;for(var k=m;k<this.m;k++)S+=this.U[k][m]*this.U[k][U];S=-S/this.U[m][m];for(var B=m;B<this.m;B++)this.U[B][U]+=S*this.U[B][m]}for(var W=m;W<this.m;W++)this.U[W][m]=-this.U[W][m];this.U[m][m]=1+this.U[m][m];for(var st=0;st<m-1;st++)this.U[st][m]=0}else{for(var dt=0;dt<this.m;dt++)this.U[dt][m]=0;this.U[m][m]=1}}if(r)for(var Z=this.n-1;Z>=0;Z--){if(function(Wt,bt){return Wt&&bt}(Z<i,n[Z]!==0))for(var ut=Z+1;ut<o;ut++){var nt=0;for(var R=Z+1;R<this.n;R++)nt+=this.V[R][Z]*this.V[R][ut];nt=-nt/this.V[Z+1][Z];for(var K=Z+1;K<this.n;K++)this.V[K][ut]+=nt*this.V[K][Z]}for(var et=0;et<this.n;et++)this.V[et][Z]=0;this.V[Z][Z]=1}var ct=L-1,Nt=0,Pt=Math.pow(2,-52),Bt=Math.pow(2,-966);while(L>0){var ft=void 0,Jt=void 0;for(ft=L-2;ft>=-1;ft--){if(ft===-1)break;if(Math.abs(n[ft])<=Bt+Pt*(Math.abs(this.s[ft])+Math.abs(this.s[ft+1]))){n[ft]=0;break}}if(ft===L-2)Jt=4;else{var Xt=void 0;for(Xt=L-1;Xt>=ft;Xt--){if(Xt===ft)break;var Et=(Xt!==L?Math.abs(n[Xt]):0)+(Xt!==ft+1?Math.abs(n[Xt-1]):0);if(Math.abs(this.s[Xt])<=Bt+Pt*Et){this.s[Xt]=0;break}}if(Xt===ft)Jt=3;else if(Xt===L-1)Jt=1;else Jt=2,ft=Xt}switch(ft++,Jt){case 1:{var vt=n[L-2];n[L-2]=0;for(var xt=L-2;xt>=ft;xt--){var Rt=v.hypot(this.s[xt],vt),Gt=this.s[xt]/Rt,St=vt/Rt;if(this.s[xt]=Rt,xt!==ft)vt=-St*n[xt-1],n[xt-1]=Gt*n[xt-1];if(r)for(var Ft=0;Ft<this.n;Ft++)Rt=Gt*this.V[Ft][xt]+St*this.V[Ft][L-1],this.V[Ft][L-1]=-St*this.V[Ft][xt]+Gt*this.V[Ft][L-1],this.V[Ft][xt]=Rt}}break;case 2:{var Ht=n[ft-1];n[ft-1]=0;for(var zt=ft;zt<L;zt++){var te=v.hypot(this.s[zt],Ht),qt=this.s[zt]/te,Kt=Ht/te;if(this.s[zt]=te,Ht=-Kt*n[zt],n[zt]=qt*n[zt],u)for(var kt=0;kt<this.m;kt++)te=qt*this.U[kt][zt]+Kt*this.U[kt][ft-1],this.U[kt][ft-1]=-Kt*this.U[kt][zt]+qt*this.U[kt][ft-1],this.U[kt][zt]=te}}break;case 3:{var J=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[L-1]),Math.abs(this.s[L-2])),Math.abs(n[L-2])),Math.abs(this.s[ft])),Math.abs(n[ft])),rt=this.s[L-1]/J,it=this.s[L-2]/J,at=n[L-2]/J,ot=this.s[ft]/J,gt=n[ft]/J,At=((it+rt)*(it-rt)+at*at)/2,Mt=rt*at*(rt*at),ht=0;if(function(Wt,bt){return Wt||bt}(At!==0,Mt!==0)){if(ht=Math.sqrt(At*At+Mt),At<0)ht=-ht;ht=Mt/(At+ht)}var Lt=(ot+rt)*(ot-rt)+ht,Ct=ot*gt;for(var pt=ft;pt<L-1;pt++){var Ot=v.hypot(Lt,Ct),Ut=Lt/Ot,Tt=Ct/Ot;if(pt!==ft)n[pt-1]=Ot;if(Lt=Ut*this.s[pt]+Tt*n[pt],n[pt]=Ut*n[pt]-Tt*this.s[pt],Ct=Tt*this.s[pt+1],this.s[pt+1]=Ut*this.s[pt+1],r)for(var yt=0;yt<this.n;yt++)Ot=Ut*this.V[yt][pt]+Tt*this.V[yt][pt+1],this.V[yt][pt+1]=-Tt*this.V[yt][pt]+Ut*this.V[yt][pt+1],this.V[yt][pt]=Ot;if(Ot=v.hypot(Lt,Ct),Ut=Lt/Ot,Tt=Ct/Ot,this.s[pt]=Ot,Lt=Ut*n[pt]+Tt*this.s[pt+1],this.s[pt+1]=-Tt*n[pt]+Ut*this.s[pt+1],Ct=Tt*n[pt+1],n[pt+1]=Ut*n[pt+1],u&&pt<this.m-1)for(var Dt=0;Dt<this.m;Dt++)Ot=Ut*this.U[Dt][pt]+Tt*this.U[Dt][pt+1],this.U[Dt][pt+1]=-Tt*this.U[Dt][pt]+Ut*this.U[Dt][pt+1],this.U[Dt][pt]=Ot}n[L-2]=Lt,Nt=Nt+1}break;case 4:{if(this.s[ft]<=0){if(this.s[ft]=this.s[ft]<0?-this.s[ft]:0,r)for(var mt=0;mt<=ct;mt++)this.V[mt][ft]=-this.V[mt][ft]}while(ft<ct){if(this.s[ft]>=this.s[ft+1])break;var wt=this.s[ft];if(this.s[ft]=this.s[ft+1],this.s[ft+1]=wt,r&&ft<this.n-1)for(var Zt=0;Zt<this.n;Zt++)wt=this.V[Zt][ft+1],this.V[Zt][ft+1]=this.V[Zt][ft],this.V[Zt][ft]=wt;if(u&&ft<this.m-1)for(var Vt=0;Vt<this.m;Vt++)wt=this.U[Vt][ft+1],this.U[Vt][ft+1]=this.U[Vt][ft],this.U[Vt][ft]=wt;ft++}Nt=0,L--}break}}var re={U:this.U,V:this.V,S:this.s};return re},v.hypot=function(f,o){var n=void 0;if(Math.abs(f)>Math.abs(o))n=o/f,n=Math.abs(f)*Math.sqrt(1+n*n);else if(o!=0)n=f/o,n=Math.abs(o)*Math.sqrt(1+n*n);else n=0;return n},w.exports=v},function(w,I,A){var v=function(){function n(a,u){for(var r=0;r<u.length;r++){var y=u[r];if(y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y)y.writable=!0;Object.defineProperty(a,y.key,y)}}return function(a,u,r){if(u)n(a.prototype,u);if(r)n(a,r);return a}}();function f(n,a){if(!(n instanceof a))throw TypeError("Cannot call a class as a function")}var o=function(){function n(a,u){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;f(this,n),this.sequence1=a,this.sequence2=u,this.match_score=r,this.mismatch_penalty=y,this.gap_penalty=i,this.iMax=a.length+1,this.jMax=u.length+1,this.grid=Array(this.iMax);for(var e=0;e<this.iMax;e++){this.grid[e]=Array(this.jMax);for(var g=0;g<this.jMax;g++)this.grid[e][g]=0}this.tracebackGrid=Array(this.iMax);for(var d=0;d<this.iMax;d++){this.tracebackGrid[d]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.tracebackGrid[d][c]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return v(n,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var u=1;u<this.jMax;u++)this.grid[0][u]=this.grid[0][u-1]+this.gap_penalty,this.tracebackGrid[0][u]=[!1,!1,!0];for(var r=1;r<this.iMax;r++)this.grid[r][0]=this.grid[r-1][0]+this.gap_penalty,this.tracebackGrid[r][0]=[!1,!0,!1];for(var y=1;y<this.iMax;y++)for(var i=1;i<this.jMax;i++){var e=void 0;if(this.sequence1[y-1]===this.sequence2[i-1])e=this.grid[y-1][i-1]+this.match_score;else e=this.grid[y-1][i-1]+this.mismatch_penalty;var g=this.grid[y-1][i]+this.gap_penalty,d=this.grid[y][i-1]+this.gap_penalty,c=[e,g,d],O=this.arrayAllMaxIndexes(c);this.grid[y][i]=c[O[0]],this.tracebackGrid[y][i]=[O.includes(0),O.includes(1),O.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var u=[];u.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(u[0]){var r=u[0],y=this.tracebackGrid[r.pos[0]][r.pos[1]];if(y[0])u.push({pos:[r.pos[0]-1,r.pos[1]-1],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(y[1])u.push({pos:[r.pos[0]-1,r.pos[1]],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:"-"+r.seq2});if(y[2])u.push({pos:[r.pos[0],r.pos[1]-1],seq1:"-"+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(r.pos[0]===0&&r.pos[1]===0)this.alignments.push({sequence1:r.seq1,sequence2:r.seq2});u.shift()}return this.alignments}},{key:"getAllIndexes",value:function(u,r){var y=[],i=-1;while((i=u.indexOf(r,i+1))!==-1)y.push(i);return y}},{key:"arrayAllMaxIndexes",value:function(u){return this.getAllIndexes(u,Math.max.apply(null,u))}}]),n}();w.exports=o},function(w,I,A){var v=function(){return};v.FDLayout=A(18),v.FDLayoutConstants=A(4),v.FDLayoutEdge=A(19),v.FDLayoutNode=A(20),v.DimensionD=A(21),v.HashMap=A(22),v.HashSet=A(23),v.IGeometry=A(8),v.IMath=A(9),v.Integer=A(10),v.Point=A(12),v.PointD=A(5),v.RandomSeed=A(16),v.RectangleD=A(13),v.Transform=A(17),v.UniqueIDGeneretor=A(14),v.Quicksort=A(25),v.LinkedList=A(11),v.LGraphObject=A(2),v.LGraph=A(6),v.LEdge=A(1),v.LGraphManager=A(7),v.LNode=A(3),v.Layout=A(15),v.LayoutConstants=A(0),v.NeedlemanWunsch=A(27),v.Matrix=A(24),v.SVD=A(26),w.exports=v},function(w,I,A){function v(){this.listeners=[]}var f=v.prototype;f.addListener=function(o,n){this.listeners.push({event:o,callback:n})},f.removeListener=function(o,n){for(var a=this.listeners.length;a>=0;a--){var u=this.listeners[a];if(u.event===o&&u.callback===n)this.listeners.splice(a,1)}},f.emit=function(o,n){for(var a=0;a<this.listeners.length;a++){var u=this.listeners[a];if(o===u.event)u.callback(n)}},w.exports=v}])})});var Se=Fn(function(Ee,Re){(function(I,A){if(typeof Ee==="object"&&typeof Re==="object")Re.exports=A(Ie());else if(typeof define==="function"&&define.amd)define(["layout-base"],A);else if(typeof Ee==="object")Ee.coseBase=A(Ie());else I.coseBase=A(I.layoutBase)})(Ee,function(w){return(()=>{var I={45:(o,n,a)=>{var u={};u.layoutBase=a(551),u.CoSEConstants=a(806),u.CoSEEdge=a(767),u.CoSEGraph=a(880),u.CoSEGraphManager=a(578),u.CoSELayout=a(765),u.CoSENode=a(991),u.ConstraintHandler=a(902),o.exports=u},806:(o,n,a)=>{var u=a(551).FDLayoutConstants;function r(){}for(var y in u)r[y]=u[y];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,o.exports=r},767:(o,n,a)=>{var u=a(551).FDLayoutEdge;function r(i,e,g){u.call(this,i,e,g)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},880:(o,n,a)=>{var u=a(551).LGraph;function r(i,e,g){u.call(this,i,e,g)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},578:(o,n,a)=>{var u=a(551).LGraphManager;function r(i){u.call(this,i)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},765:(o,n,a)=>{var u=a(551).FDLayout,r=a(578),y=a(880),i=a(991),e=a(767),g=a(806),d=a(902),c=a(551).FDLayoutConstants,O=a(551).LayoutConstants,T=a(551).Point,N=a(551).PointD,D=a(551).DimensionD,X=a(551).Layout,x=a(551).Integer,V=a(551).IGeometry,_=a(551).LGraph,Q=a(551).Transform,lt=a(551).LinkedList;function b(){u.call(this),this.toBeTiled={},this.constraints={}}b.prototype=Object.create(u.prototype);for(var tt in u)b[tt]=u[tt];b.prototype.newGraphManager=function(){var s=new r(this);return this.graphManager=s,s},b.prototype.newGraph=function(s){return new y(null,this.graphManager,s)},b.prototype.newNode=function(s){return new i(this.graphManager,s)},b.prototype.newEdge=function(s){return new e(null,null,s)},b.prototype.initParameters=function(){if(u.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(g.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=g.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=g.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},b.prototype.initSpringEmbedder=function(){u.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},b.prototype.layout=function(){var s=O.DEFAULT_CREATE_BENDS_AS_NEEDED;if(s)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},b.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),!this.incremental){var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var L=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(M){return L.has(M)});this.graphManager.setAllNodesToApplyGravitation(E),this.positionNodesRandomly()}}else if(g.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var L=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(U){return L.has(U)});this.graphManager.setAllNodesToApplyGravitation(E)}if(Object.keys(this.constraints).length>0)d.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),g.APPLY_LAYOUT)this.runSpringEmbedder();return!0},b.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(this.layoutQuality==1)this.coolingAdjuster=this.coolingCycle/3;this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),L=this.nodesWithGravity.filter(function(m){return s.has(m)});if(this.graphManager.setAllNodesToApplyGravitation(L),this.graphManager.updateBounds(),this.updateGrid(),g.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();if(g.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var E=!this.isTreeGrowing&&!this.isGrowthFinished,M=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(E,M),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},b.prototype.getPositionsData=function(){var s=this.graphManager.getAllNodes(),L={};for(var E=0;E<s.length;E++){var M=s[E].rect,m=s[E].id;L[m]={id:m,x:M.getCenterX(),y:M.getCenterY(),w:M.width,h:M.height}}return L},b.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(c.ANIMATE==="during")this.emit("layoutstarted");else{while(!s)s=this.tick();this.graphManager.updateBounds()}},b.prototype.moveNodes=function(){var s=this.getAllNodes(),L;for(var E=0;E<s.length;E++)L=s[E],L.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var E=0;E<s.length;E++)L=s[E],L.move()},b.prototype.initConstraintVariables=function(){var s=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var L=this.graphManager.getAllNodes();for(var E=0;E<L.length;E++){var M=L[E];this.idToNodeMap.set(M.id,M)}var m=function R(K){var et=K.getChild().getNodes(),ct,Nt=0;for(var Pt=0;Pt<et.length;Pt++)if(ct=et[Pt],ct.getChild()==null){if(s.fixedNodeSet.has(ct.id))Nt+=100}else Nt+=R(ct);return Nt};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(et){s.fixedNodeSet.add(et.nodeId)});var L=this.graphManager.getAllNodes(),M;for(var E=0;E<L.length;E++)if(M=L[E],M.getChild()!=null){var U=m(M);if(U>0)M.fixedNodeWeight=U}}if(this.constraints.relativePlacementConstraint){var S=new Map,k=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(R){s.fixedNodesOnHorizontal.add(R),s.fixedNodesOnVertical.add(R)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var B=this.constraints.alignmentConstraint.vertical;for(var E=0;E<B.length;E++)this.dummyToNodeForVerticalAlignment.set("dummy"+E,[]),B[E].forEach(function(K){if(S.set(K,"dummy"+E),s.dummyToNodeForVerticalAlignment.get("dummy"+E).push(K),s.fixedNodeSet.has(K))s.fixedNodesOnHorizontal.add("dummy"+E)})}if(this.constraints.alignmentConstraint.horizontal){var W=this.constraints.alignmentConstraint.horizontal;for(var E=0;E<W.length;E++)this.dummyToNodeForHorizontalAlignment.set("dummy"+E,[]),W[E].forEach(function(K){if(k.set(K,"dummy"+E),s.dummyToNodeForHorizontalAlignment.get("dummy"+E).push(K),s.fixedNodeSet.has(K))s.fixedNodesOnVertical.add("dummy"+E)})}}if(g.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(R){var K,et,ct;for(ct=R.length-1;ct>=2*R.length/3;ct--)K=Math.floor(Math.random()*(ct+1)),et=R[ct],R[ct]=R[K],R[K]=et;return R},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(R){if(R.left){var K=S.has(R.left)?S.get(R.left):R.left,et=S.has(R.right)?S.get(R.right):R.right;if(!s.nodesInRelativeHorizontal.includes(K))if(s.nodesInRelativeHorizontal.push(K),s.nodeToRelativeConstraintMapHorizontal.set(K,[]),s.dummyToNodeForVerticalAlignment.has(K))s.nodeToTempPositionMapHorizontal.set(K,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(K)[0]).getCenterX());else s.nodeToTempPositionMapHorizontal.set(K,s.idToNodeMap.get(K).getCenterX());if(!s.nodesInRelativeHorizontal.includes(et))if(s.nodesInRelativeHorizontal.push(et),s.nodeToRelativeConstraintMapHorizontal.set(et,[]),s.dummyToNodeForVerticalAlignment.has(et))s.nodeToTempPositionMapHorizontal.set(et,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(et)[0]).getCenterX());else s.nodeToTempPositionMapHorizontal.set(et,s.idToNodeMap.get(et).getCenterX());s.nodeToRelativeConstraintMapHorizontal.get(K).push({right:et,gap:R.gap}),s.nodeToRelativeConstraintMapHorizontal.get(et).push({left:K,gap:R.gap})}else{var ct=k.has(R.top)?k.get(R.top):R.top,Nt=k.has(R.bottom)?k.get(R.bottom):R.bottom;if(!s.nodesInRelativeVertical.includes(ct))if(s.nodesInRelativeVertical.push(ct),s.nodeToRelativeConstraintMapVertical.set(ct,[]),s.dummyToNodeForHorizontalAlignment.has(ct))s.nodeToTempPositionMapVertical.set(ct,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(ct)[0]).getCenterY());else s.nodeToTempPositionMapVertical.set(ct,s.idToNodeMap.get(ct).getCenterY());if(!s.nodesInRelativeVertical.includes(Nt))if(s.nodesInRelativeVertical.push(Nt),s.nodeToRelativeConstraintMapVertical.set(Nt,[]),s.dummyToNodeForHorizontalAlignment.has(Nt))s.nodeToTempPositionMapVertical.set(Nt,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(Nt)[0]).getCenterY());else s.nodeToTempPositionMapVertical.set(Nt,s.idToNodeMap.get(Nt).getCenterY());s.nodeToRelativeConstraintMapVertical.get(ct).push({bottom:Nt,gap:R.gap}),s.nodeToRelativeConstraintMapVertical.get(Nt).push({top:ct,gap:R.gap})}});else{var st=new Map,dt=new Map;this.constraints.relativePlacementConstraint.forEach(function(R){if(R.left){var K=S.has(R.left)?S.get(R.left):R.left,et=S.has(R.right)?S.get(R.right):R.right;if(st.has(K))st.get(K).push(et);else st.set(K,[et]);if(st.has(et))st.get(et).push(K);else st.set(et,[K])}else{var ct=k.has(R.top)?k.get(R.top):R.top,Nt=k.has(R.bottom)?k.get(R.bottom):R.bottom;if(dt.has(ct))dt.get(ct).push(Nt);else dt.set(ct,[Nt]);if(dt.has(Nt))dt.get(Nt).push(ct);else dt.set(Nt,[ct])}});var Z=function(K,et){var ct=[],Nt=[],Pt=new lt,Bt=new Set,ft=0;return K.forEach(function(Jt,Xt){if(!Bt.has(Xt)){ct[ft]=[],Nt[ft]=!1;var Et=Xt;Pt.push(Et),Bt.add(Et),ct[ft].push(Et);while(Pt.length!=0){if(Et=Pt.shift(),et.has(Et))Nt[ft]=!0;var vt=K.get(Et);vt.forEach(function(xt){if(!Bt.has(xt))Pt.push(xt),Bt.add(xt),ct[ft].push(xt)})}ft++}}),{components:ct,isFixed:Nt}},ut=Z(st,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=ut.components,this.fixedComponentsOnHorizontal=ut.isFixed;var nt=Z(dt,s.fixedNodesOnVertical);this.componentsOnVertical=nt.components,this.fixedComponentsOnVertical=nt.isFixed}}},b.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(nt){var R=s.idToNodeMap.get(nt.nodeId);R.displacementX=0,R.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var L=this.constraints.alignmentConstraint.vertical;for(var E=0;E<L.length;E++){var M=0;for(var m=0;m<L[E].length;m++){if(this.fixedNodeSet.has(L[E][m])){M=0;break}M+=this.idToNodeMap.get(L[E][m]).displacementX}var U=M/L[E].length;for(var m=0;m<L[E].length;m++)this.idToNodeMap.get(L[E][m]).displacementX=U}}if(this.constraints.alignmentConstraint.horizontal){var S=this.constraints.alignmentConstraint.horizontal;for(var E=0;E<S.length;E++){var k=0;for(var m=0;m<S[E].length;m++){if(this.fixedNodeSet.has(S[E][m])){k=0;break}k+=this.idToNodeMap.get(S[E][m]).displacementY}var B=k/S[E].length;for(var m=0;m<S[E].length;m++)this.idToNodeMap.get(S[E][m]).displacementY=B}}}if(this.constraints.relativePlacementConstraint)if(g.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(nt){if(!s.fixedNodesOnHorizontal.has(nt)){var R=0;if(s.dummyToNodeForVerticalAlignment.has(nt))R=s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(nt)[0]).displacementX;else R=s.idToNodeMap.get(nt).displacementX;if(s.nodeToRelativeConstraintMapHorizontal.get(nt).forEach(function(K){if(K.right){var et=s.nodeToTempPositionMapHorizontal.get(K.right)-s.nodeToTempPositionMapHorizontal.get(nt)-R;if(et<K.gap)R-=K.gap-et}else{var et=s.nodeToTempPositionMapHorizontal.get(nt)-s.nodeToTempPositionMapHorizontal.get(K.left)+R;if(et<K.gap)R+=K.gap-et}}),s.nodeToTempPositionMapHorizontal.set(nt,s.nodeToTempPositionMapHorizontal.get(nt)+R),s.dummyToNodeForVerticalAlignment.has(nt))s.dummyToNodeForVerticalAlignment.get(nt).forEach(function(K){s.idToNodeMap.get(K).displacementX=R});else s.idToNodeMap.get(nt).displacementX=R}}),this.nodesInRelativeVertical.forEach(function(nt){if(!s.fixedNodesOnHorizontal.has(nt)){var R=0;if(s.dummyToNodeForHorizontalAlignment.has(nt))R=s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(nt)[0]).displacementY;else R=s.idToNodeMap.get(nt).displacementY;if(s.nodeToRelativeConstraintMapVertical.get(nt).forEach(function(K){if(K.bottom){var et=s.nodeToTempPositionMapVertical.get(K.bottom)-s.nodeToTempPositionMapVertical.get(nt)-R;if(et<K.gap)R-=K.gap-et}else{var et=s.nodeToTempPositionMapVertical.get(nt)-s.nodeToTempPositionMapVertical.get(K.top)+R;if(et<K.gap)R+=K.gap-et}}),s.nodeToTempPositionMapVertical.set(nt,s.nodeToTempPositionMapVertical.get(nt)+R),s.dummyToNodeForHorizontalAlignment.has(nt))s.dummyToNodeForHorizontalAlignment.get(nt).forEach(function(K){s.idToNodeMap.get(K).displacementY=R});else s.idToNodeMap.get(nt).displacementY=R}})}else{for(var E=0;E<this.componentsOnHorizontal.length;E++){var W=this.componentsOnHorizontal[E];if(this.fixedComponentsOnHorizontal[E])for(var m=0;m<W.length;m++)if(this.dummyToNodeForVerticalAlignment.has(W[m]))this.dummyToNodeForVerticalAlignment.get(W[m]).forEach(function(K){s.idToNodeMap.get(K).displacementX=0});else this.idToNodeMap.get(W[m]).displacementX=0;else{var st=0,dt=0;for(var m=0;m<W.length;m++)if(this.dummyToNodeForVerticalAlignment.has(W[m])){var Z=this.dummyToNodeForVerticalAlignment.get(W[m]);st+=Z.length*this.idToNodeMap.get(Z[0]).displacementX,dt+=Z.length}else st+=this.idToNodeMap.get(W[m]).displacementX,dt++;var ut=st/dt;for(var m=0;m<W.length;m++)if(this.dummyToNodeForVerticalAlignment.has(W[m]))this.dummyToNodeForVerticalAlignment.get(W[m]).forEach(function(K){s.idToNodeMap.get(K).displacementX=ut});else this.idToNodeMap.get(W[m]).displacementX=ut}}for(var E=0;E<this.componentsOnVertical.length;E++){var W=this.componentsOnVertical[E];if(this.fixedComponentsOnVertical[E])for(var m=0;m<W.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(W[m]))this.dummyToNodeForHorizontalAlignment.get(W[m]).forEach(function(et){s.idToNodeMap.get(et).displacementY=0});else this.idToNodeMap.get(W[m]).displacementY=0;else{var st=0,dt=0;for(var m=0;m<W.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(W[m])){var Z=this.dummyToNodeForHorizontalAlignment.get(W[m]);st+=Z.length*this.idToNodeMap.get(Z[0]).displacementY,dt+=Z.length}else st+=this.idToNodeMap.get(W[m]).displacementY,dt++;var ut=st/dt;for(var m=0;m<W.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(W[m]))this.dummyToNodeForHorizontalAlignment.get(W[m]).forEach(function(Pt){s.idToNodeMap.get(Pt).displacementY=ut});else this.idToNodeMap.get(W[m]).displacementY=ut}}}},b.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],L,E=this.graphManager.getGraphs(),M=E.length,m;for(m=0;m<M;m++)if(L=E[m],L.updateConnected(),!L.isConnected)s=s.concat(L.getNodes());return s},b.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var L=new Set,E;for(E=0;E<s.length;E++){var M=s[E];if(!L.has(M)){var m=M.getSource(),U=M.getTarget();if(m==U)M.getBendpoints().push(new N),M.getBendpoints().push(new N),this.createDummyNodesForBendpoints(M),L.add(M);else{var S=[];if(S=S.concat(m.getEdgeListToNode(U)),S=S.concat(U.getEdgeListToNode(m)),!L.has(S[0])){if(S.length>1){var k;for(k=0;k<S.length;k++){var B=S[k];B.getBendpoints().push(new N),this.createDummyNodesForBendpoints(B)}}S.forEach(function(W){L.add(W)})}}}if(L.size==s.length)break}},b.prototype.positionNodesRadially=function(s){var L=new T(0,0),E=Math.ceil(Math.sqrt(s.length)),M=0,m=0,U=0,S=new N(0,0);for(var k=0;k<s.length;k++){if(k%E==0){if(U=0,m=M,k!=0)m+=g.DEFAULT_COMPONENT_SEPERATION;M=0}var B=s[k],W=X.findCenterOfTree(B);if(L.x=U,L.y=m,S=b.radialLayout(B,W,L),S.y>M)M=Math.floor(S.y);U=Math.floor(S.x+g.DEFAULT_COMPONENT_SEPERATION)}this.transform(new N(O.WORLD_CENTER_X-S.x/2,O.WORLD_CENTER_Y-S.y/2))},b.radialLayout=function(s,L,E){var M=Math.max(this.maxDiagonalInTree(s),g.DEFAULT_RADIAL_SEPARATION);b.branchRadialLayout(L,null,0,359,0,M);var m=_.calculateBounds(s),U=new Q;U.setDeviceOrgX(m.getMinX()),U.setDeviceOrgY(m.getMinY()),U.setWorldOrgX(E.x),U.setWorldOrgY(E.y);for(var S=0;S<s.length;S++){var k=s[S];k.transform(U)}var B=new N(m.getMaxX(),m.getMaxY());return U.inverseTransformPoint(B)},b.branchRadialLayout=function(s,L,E,M,m,U){var S=(M-E+1)/2;if(S<0)S+=180;var k=(S+E)%360,B=k*V.TWO_PI/360,W=Math.cos(B),st=m*Math.cos(B),dt=m*Math.sin(B);s.setCenter(st,dt);var Z=[];Z=Z.concat(s.getEdges());var ut=Z.length;if(L!=null)ut--;var nt=0,R=Z.length,K,et=s.getEdgesBetween(L);while(et.length>1){var ct=et[0];et.splice(0,1);var Nt=Z.indexOf(ct);if(Nt>=0)Z.splice(Nt,1);R--,ut--}if(L!=null)K=(Z.indexOf(et[0])+1)%R;else K=0;var Pt=Math.abs(M-E)/ut;for(var Bt=K;nt!=ut;Bt=++Bt%R){var ft=Z[Bt].getOtherEnd(s);if(ft==L)continue;var Jt=(E+nt*Pt)%360,Xt=(Jt+Pt)%360;b.branchRadialLayout(ft,s,Jt,Xt,m+U,U),nt++}},b.maxDiagonalInTree=function(s){var L=x.MIN_VALUE;for(var E=0;E<s.length;E++){var M=s[E],m=M.getDiagonal();if(m>L)L=m}return L},b.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},b.prototype.groupZeroDegreeMembers=function(){var s=this,L={};this.memberGroups={},this.idToDummyNode={};var E=[],M=this.graphManager.getAllNodes();for(var m=0;m<M.length;m++){var U=M[m],S=U.getParent();if(this.getNodeDegreeWithChildren(U)===0&&(S.id==null||!this.getToBeTiled(S)))E.push(U)}for(var m=0;m<E.length;m++){var U=E[m],k=U.getParent().id;if(typeof L[k]>"u")L[k]=[];L[k]=L[k].concat(U)}Object.keys(L).forEach(function(B){if(L[B].length>1){var W="DummyCompound_"+B;s.memberGroups[W]=L[B];var st=L[B][0].getParent(),dt=new i(s.graphManager);dt.id=W,dt.paddingLeft=st.paddingLeft||0,dt.paddingRight=st.paddingRight||0,dt.paddingBottom=st.paddingBottom||0,dt.paddingTop=st.paddingTop||0,s.idToDummyNode[W]=dt;var Z=s.getGraphManager().add(s.newGraph(),dt),ut=st.getChild();ut.add(dt);for(var nt=0;nt<L[B].length;nt++){var R=L[B][nt];ut.remove(R),Z.add(R)}}})},b.prototype.clearCompounds=function(){var s={},L={};this.performDFSOnCompounds();for(var E=0;E<this.compoundOrder.length;E++)L[this.compoundOrder[E].id]=this.compoundOrder[E],s[this.compoundOrder[E].id]=[].concat(this.compoundOrder[E].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[E].getChild()),this.compoundOrder[E].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,L)},b.prototype.clearZeroDegreeMembers=function(){var s=this,L=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(E){var M=s.idToDummyNode[E];if(L[E]=s.tileNodes(s.memberGroups[E],M.paddingLeft+M.paddingRight),M.rect.width=L[E].width,M.rect.height=L[E].height,M.setCenter(L[E].centerX,L[E].centerY),M.labelMarginLeft=0,M.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var m=M.rect.width,U=M.rect.height;if(M.labelWidth){if(M.labelPosHorizontal=="left")M.rect.x-=M.labelWidth,M.setWidth(m+M.labelWidth),M.labelMarginLeft=M.labelWidth;else if(M.labelPosHorizontal=="center"&&M.labelWidth>m)M.rect.x-=(M.labelWidth-m)/2,M.setWidth(M.labelWidth),M.labelMarginLeft=(M.labelWidth-m)/2;else if(M.labelPosHorizontal=="right")M.setWidth(m+M.labelWidth)}if(M.labelHeight){if(M.labelPosVertical=="top")M.rect.y-=M.labelHeight,M.setHeight(U+M.labelHeight),M.labelMarginTop=M.labelHeight;else if(M.labelPosVertical=="center"&&M.labelHeight>U)M.rect.y-=(M.labelHeight-U)/2,M.setHeight(M.labelHeight),M.labelMarginTop=(M.labelHeight-U)/2;else if(M.labelPosVertical=="bottom")M.setHeight(U+M.labelHeight)}}})},b.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var L=this.compoundOrder[s],{id:E,paddingLeft:M,paddingTop:m,labelMarginLeft:U,labelMarginTop:S}=L;this.adjustLocations(this.tiledMemberPack[E],L.rect.x,L.rect.y,M,m,U,S)}},b.prototype.repopulateZeroDegreeMembers=function(){var s=this,L=this.tiledZeroDegreePack;Object.keys(L).forEach(function(E){var M=s.idToDummyNode[E],{paddingLeft:m,paddingTop:U,labelMarginLeft:S,labelMarginTop:k}=M;s.adjustLocations(L[E],M.rect.x,M.rect.y,m,U,S,k)})},b.prototype.getToBeTiled=function(s){var L=s.id;if(this.toBeTiled[L]!=null)return this.toBeTiled[L];var E=s.getChild();if(E==null)return this.toBeTiled[L]=!1,!1;var M=E.getNodes();for(var m=0;m<M.length;m++){var U=M[m];if(this.getNodeDegree(U)>0)return this.toBeTiled[L]=!1,!1;if(U.getChild()==null){this.toBeTiled[U.id]=!1;continue}if(!this.getToBeTiled(U))return this.toBeTiled[L]=!1,!1}return this.toBeTiled[L]=!0,!0},b.prototype.getNodeDegree=function(s){var L=s.id,E=s.getEdges(),M=0;for(var m=0;m<E.length;m++){var U=E[m];if(U.getSource().id!==U.getTarget().id)M=M+1}return M},b.prototype.getNodeDegreeWithChildren=function(s){var L=this.getNodeDegree(s);if(s.getChild()==null)return L;var E=s.getChild().getNodes();for(var M=0;M<E.length;M++){var m=E[M];L+=this.getNodeDegreeWithChildren(m)}return L},b.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},b.prototype.fillCompexOrderByDFS=function(s){for(var L=0;L<s.length;L++){var E=s[L];if(E.getChild()!=null)this.fillCompexOrderByDFS(E.getChild().getNodes());if(this.getToBeTiled(E))this.compoundOrder.push(E)}},b.prototype.adjustLocations=function(s,L,E,M,m,U,S){L+=M+U,E+=m+S;var k=L;for(var B=0;B<s.rows.length;B++){var W=s.rows[B];L=k;var st=0;for(var dt=0;dt<W.length;dt++){var Z=W[dt];if(Z.rect.x=L,Z.rect.y=E,L+=Z.rect.width+s.horizontalPadding,Z.rect.height>st)st=Z.rect.height}E+=st+s.verticalPadding}},b.prototype.tileCompoundMembers=function(s,L){var E=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(M){var m=L[M];if(E.tiledMemberPack[M]=E.tileNodes(s[M],m.paddingLeft+m.paddingRight),m.rect.width=E.tiledMemberPack[M].width,m.rect.height=E.tiledMemberPack[M].height,m.setCenter(E.tiledMemberPack[M].centerX,E.tiledMemberPack[M].centerY),m.labelMarginLeft=0,m.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var U=m.rect.width,S=m.rect.height;if(m.labelWidth){if(m.labelPosHorizontal=="left")m.rect.x-=m.labelWidth,m.setWidth(U+m.labelWidth),m.labelMarginLeft=m.labelWidth;else if(m.labelPosHorizontal=="center"&&m.labelWidth>U)m.rect.x-=(m.labelWidth-U)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-U)/2;else if(m.labelPosHorizontal=="right")m.setWidth(U+m.labelWidth)}if(m.labelHeight){if(m.labelPosVertical=="top")m.rect.y-=m.labelHeight,m.setHeight(S+m.labelHeight),m.labelMarginTop=m.labelHeight;else if(m.labelPosVertical=="center"&&m.labelHeight>S)m.rect.y-=(m.labelHeight-S)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-S)/2;else if(m.labelPosVertical=="bottom")m.setHeight(S+m.labelHeight)}}})},b.prototype.tileNodes=function(s,L){var E=this.tileNodesByFavoringDim(s,L,!0),M=this.tileNodesByFavoringDim(s,L,!1),m=this.getOrgRatio(E),U=this.getOrgRatio(M),S;if(U<m)S=M;else S=E;return S},b.prototype.getOrgRatio=function(s){var{width:L,height:E}=s,M=L/E;if(M<1)M=1/M;return M},b.prototype.calcIdealRowWidth=function(s,L){var{TILING_PADDING_VERTICAL:E,TILING_PADDING_HORIZONTAL:M}=g,m=s.length,U=0,S=0,k=0;s.forEach(function(nt){if(U+=nt.getWidth(),S+=nt.getHeight(),nt.getWidth()>k)k=nt.getWidth()});var B=U/m,W=S/m,st=Math.pow(E-M,2)+4*(B+M)*(W+E)*m,dt=(M-E+Math.sqrt(st))/(2*(B+M)),Z;if(L){if(Z=Math.ceil(dt),Z==dt)Z++}else Z=Math.floor(dt);var ut=Z*(B+M)-M;if(k>ut)ut=k;return ut+=M*2,ut},b.prototype.tileNodesByFavoringDim=function(s,L,E){var{TILING_PADDING_VERTICAL:M,TILING_PADDING_HORIZONTAL:m,TILING_COMPARE_BY:U}=g,S={rows:[],rowWidth:[],rowHeight:[],width:0,height:L,verticalPadding:M,horizontalPadding:m,centerX:0,centerY:0};if(U)S.idealRowWidth=this.calcIdealRowWidth(s,E);var k=function(R){return R.rect.width*R.rect.height},B=function(R,K){return k(K)-k(R)};s.sort(function(nt,R){var K=B;if(S.idealRowWidth)return K=U,K(nt.id,R.id);return K(nt,R)});var W=0,st=0;for(var dt=0;dt<s.length;dt++){var Z=s[dt];W+=Z.getCenterX(),st+=Z.getCenterY()}S.centerX=W/s.length,S.centerY=st/s.length;for(var dt=0;dt<s.length;dt++){var Z=s[dt];if(S.rows.length==0)this.insertNodeToRow(S,Z,0,L);else if(this.canAddHorizontal(S,Z.rect.width,Z.rect.height)){var ut=S.rows.length-1;if(!S.idealRowWidth)ut=this.getShortestRowIndex(S);this.insertNodeToRow(S,Z,ut,L)}else this.insertNodeToRow(S,Z,S.rows.length,L);this.shiftToLastRow(S)}return S},b.prototype.insertNodeToRow=function(s,L,E,M){var m=M;if(E==s.rows.length){var U=[];s.rows.push(U),s.rowWidth.push(m),s.rowHeight.push(0)}var S=s.rowWidth[E]+L.rect.width;if(s.rows[E].length>0)S+=s.horizontalPadding;if(s.rowWidth[E]=S,s.width<S)s.width=S;var k=L.rect.height;if(E>0)k+=s.verticalPadding;var B=0;if(k>s.rowHeight[E])B=s.rowHeight[E],s.rowHeight[E]=k,B=s.rowHeight[E]-B;s.height+=B,s.rows[E].push(L)},b.prototype.getShortestRowIndex=function(s){var L=-1,E=Number.MAX_VALUE;for(var M=0;M<s.rows.length;M++)if(s.rowWidth[M]<E)L=M,E=s.rowWidth[M];return L},b.prototype.getLongestRowIndex=function(s){var L=-1,E=Number.MIN_VALUE;for(var M=0;M<s.rows.length;M++)if(s.rowWidth[M]>E)L=M,E=s.rowWidth[M];return L},b.prototype.canAddHorizontal=function(s,L,E){if(s.idealRowWidth){var M=s.rows.length-1,m=s.rowWidth[M];return m+L+s.horizontalPadding<=s.idealRowWidth}var U=this.getShortestRowIndex(s);if(U<0)return!0;var S=s.rowWidth[U];if(S+s.horizontalPadding+L<=s.width)return!0;var k=0;if(s.rowHeight[U]<E){if(U>0)k=E+s.verticalPadding-s.rowHeight[U]}var B;if(s.width-S>=L+s.horizontalPadding)B=(s.height+k)/(S+L+s.horizontalPadding);else B=(s.height+k)/s.width;k=E+s.verticalPadding;var W;if(s.width<L)W=(s.height+k)/L;else W=(s.height+k)/s.width;if(W<1)W=1/W;if(B<1)B=1/B;return B<W},b.prototype.shiftToLastRow=function(s){var L=this.getLongestRowIndex(s),E=s.rowWidth.length-1,M=s.rows[L],m=M[M.length-1],U=m.width+s.horizontalPadding;if(s.width-s.rowWidth[E]>U&&L!=E){M.splice(-1,1),s.rows[E].push(m),s.rowWidth[L]=s.rowWidth[L]-U,s.rowWidth[E]=s.rowWidth[E]+U,s.width=s.rowWidth[instance.getLongestRowIndex(s)];var S=Number.MIN_VALUE;for(var k=0;k<M.length;k++)if(M[k].height>S)S=M[k].height;if(L>0)S+=s.verticalPadding;var B=s.rowHeight[L]+s.rowHeight[E];if(s.rowHeight[L]=S,s.rowHeight[E]<m.height+s.verticalPadding)s.rowHeight[E]=m.height+s.verticalPadding;var W=s.rowHeight[L]+s.rowHeight[E];s.height+=W-B,this.shiftToLastRow(s)}},b.prototype.tilingPreLayout=function(){if(g.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},b.prototype.tilingPostLayout=function(){if(g.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},b.prototype.reduceTrees=function(){var s=[],L=!0,E;while(L){var M=this.graphManager.getAllNodes(),m=[];L=!1;for(var U=0;U<M.length;U++)if(E=M[U],E.getEdges().length==1&&!E.getEdges()[0].isInterGraph&&E.getChild()==null){if(g.PURE_INCREMENTAL){var S=E.getEdges()[0].getOtherEnd(E),k=new D(E.getCenterX()-S.getCenterX(),E.getCenterY()-S.getCenterY());m.push([E,E.getEdges()[0],E.getOwner(),k])}else m.push([E,E.getEdges()[0],E.getOwner()]);L=!0}if(L==!0){var B=[];for(var W=0;W<m.length;W++)if(m[W][0].getEdges().length==1)B.push(m[W]),m[W][0].getOwner().remove(m[W][0]);s.push(B),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},b.prototype.growTree=function(s){var L=s.length,E=s[L-1],M;for(var m=0;m<E.length;m++)M=E[m],this.findPlaceforPrunedNode(M),M[2].add(M[0]),M[2].add(M[1],M[1].source,M[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},b.prototype.findPlaceforPrunedNode=function(s){var L,E,M=s[0];if(M==s[1].source)E=s[1].target;else E=s[1].source;if(g.PURE_INCREMENTAL)M.setCenter(E.getCenterX()+s[3].getWidth(),E.getCenterY()+s[3].getHeight());else{var m=E.startX,U=E.finishX,S=E.startY,k=E.finishY,B=0,W=0,st=0,dt=0,Z=[B,st,W,dt];if(S>0)for(var ut=m;ut<=U;ut++)Z[0]+=this.grid[ut][S-1].length+this.grid[ut][S].length-1;if(U<this.grid.length-1)for(var ut=S;ut<=k;ut++)Z[1]+=this.grid[U+1][ut].length+this.grid[U][ut].length-1;if(k<this.grid[0].length-1)for(var ut=m;ut<=U;ut++)Z[2]+=this.grid[ut][k+1].length+this.grid[ut][k].length-1;if(m>0)for(var ut=S;ut<=k;ut++)Z[3]+=this.grid[m-1][ut].length+this.grid[m][ut].length-1;var nt=x.MAX_VALUE,R,K;for(var et=0;et<Z.length;et++)if(Z[et]<nt)nt=Z[et],R=1,K=et;else if(Z[et]==nt)R++;if(R==3&&nt==0){if(Z[0]==0&&Z[1]==0&&Z[2]==0)L=1;else if(Z[0]==0&&Z[1]==0&&Z[3]==0)L=0;else if(Z[0]==0&&Z[2]==0&&Z[3]==0)L=3;else if(Z[1]==0&&Z[2]==0&&Z[3]==0)L=2}else if(R==2&&nt==0){var ct=Math.floor(Math.random()*2);if(Z[0]==0&&Z[1]==0)if(ct==0)L=0;else L=1;else if(Z[0]==0&&Z[2]==0)if(ct==0)L=0;else L=2;else if(Z[0]==0&&Z[3]==0)if(ct==0)L=0;else L=3;else if(Z[1]==0&&Z[2]==0)if(ct==0)L=1;else L=2;else if(Z[1]==0&&Z[3]==0)if(ct==0)L=1;else L=3;else if(ct==0)L=2;else L=3}else if(R==4&&nt==0){var ct=Math.floor(Math.random()*4);L=ct}else L=K;if(L==0)M.setCenter(E.getCenterX(),E.getCenterY()-E.getHeight()/2-c.DEFAULT_EDGE_LENGTH-M.getHeight()/2);else if(L==1)M.setCenter(E.getCenterX()+E.getWidth()/2+c.DEFAULT_EDGE_LENGTH+M.getWidth()/2,E.getCenterY());else if(L==2)M.setCenter(E.getCenterX(),E.getCenterY()+E.getHeight()/2+c.DEFAULT_EDGE_LENGTH+M.getHeight()/2);else M.setCenter(E.getCenterX()-E.getWidth()/2-c.DEFAULT_EDGE_LENGTH-M.getWidth()/2,E.getCenterY())}},o.exports=b},991:(o,n,a)=>{var u=a(551).FDLayoutNode,r=a(551).IMath;function y(e,g,d,c){u.call(this,e,g,d,c)}y.prototype=Object.create(u.prototype);for(var i in u)y[i]=u[i];y.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight)this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight;else this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement)this.displacementX=e.coolingFactor*e.maxNodeDisplacement*r.sign(this.displacementX);if(Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement)this.displacementY=e.coolingFactor*e.maxNodeDisplacement*r.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},y.prototype.propogateDisplacementToChildren=function(e,g){var d=this.getChild().getNodes(),c;for(var O=0;O<d.length;O++)if(c=d[O],c.getChild()==null)c.displacementX+=e,c.displacementY+=g;else c.propogateDisplacementToChildren(e,g)},y.prototype.move=function(){var e=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),e.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY);this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},y.prototype.setPred1=function(e){this.pred1=e},y.prototype.getPred1=function(){return pred1},y.prototype.getPred2=function(){return pred2},y.prototype.setNext=function(e){this.next=e},y.prototype.getNext=function(){return next},y.prototype.setProcessed=function(e){this.processed=e},y.prototype.isProcessed=function(){return processed},o.exports=y},902:(o,n,a)=>{function u(d){if(Array.isArray(d)){for(var c=0,O=Array(d.length);c<d.length;c++)O[c]=d[c];return O}else return Array.from(d)}var r=a(806),y=a(551).LinkedList,i=a(551).Matrix,e=a(551).SVD;function g(){}g.handleConstraints=function(d){var c={};c.fixedNodeConstraint=d.constraints.fixedNodeConstraint,c.alignmentConstraint=d.constraints.alignmentConstraint,c.relativePlacementConstraint=d.constraints.relativePlacementConstraint;var O=new Map,T=new Map,N=[],D=[],X=d.getAllNodes(),x=0;for(var V=0;V<X.length;V++){var _=X[V];if(_.getChild()==null)T.set(_.id,x++),N.push(_.getCenterX()),D.push(_.getCenterY()),O.set(_.id,_)}if(c.relativePlacementConstraint)c.relativePlacementConstraint.forEach(function(J){if(!J.gap&&J.gap!=0)if(J.left)J.gap=r.DEFAULT_EDGE_LENGTH+O.get(J.left).getWidth()/2+O.get(J.right).getWidth()/2;else J.gap=r.DEFAULT_EDGE_LENGTH+O.get(J.top).getHeight()/2+O.get(J.bottom).getHeight()/2});var Q=function(rt,it){return{x:rt.x-it.x,y:rt.y-it.y}},lt=function(rt){var it=0,at=0;return rt.forEach(function(ot){it+=N[T.get(ot)],at+=D[T.get(ot)]}),{x:it/rt.size,y:at/rt.size}},b=function(rt,it,at,ot,gt){function At(Tt,yt){var Dt=new Set(Tt),mt=!0,wt=!1,Zt=void 0;try{for(var Vt=yt[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;Dt.add(Wt)}}catch(bt){wt=!0,Zt=bt}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}return Dt}var Mt=new Map;rt.forEach(function(Tt,yt){Mt.set(yt,0)}),rt.forEach(function(Tt,yt){Tt.forEach(function(Dt){Mt.set(Dt.id,Mt.get(Dt.id)+1)})});var ht=new Map,Lt=new Map,Ct=new y;if(Mt.forEach(function(Tt,yt){if(Tt==0){if(Ct.push(yt),!at)if(it=="horizontal")ht.set(yt,T.has(yt)?N[T.get(yt)]:ot.get(yt));else ht.set(yt,T.has(yt)?D[T.get(yt)]:ot.get(yt))}else ht.set(yt,Number.NEGATIVE_INFINITY);if(at)Lt.set(yt,new Set([yt]))}),at)gt.forEach(function(Tt){var yt=[];if(Tt.forEach(function(wt){if(at.has(wt))yt.push(wt)}),yt.length>0){var Dt=0;yt.forEach(function(wt){if(it=="horizontal")ht.set(wt,T.has(wt)?N[T.get(wt)]:ot.get(wt)),Dt+=ht.get(wt);else ht.set(wt,T.has(wt)?D[T.get(wt)]:ot.get(wt)),Dt+=ht.get(wt)}),Dt=Dt/yt.length,Tt.forEach(function(wt){if(!at.has(wt))ht.set(wt,Dt)})}else{var mt=0;Tt.forEach(function(wt){if(it=="horizontal")mt+=T.has(wt)?N[T.get(wt)]:ot.get(wt);else mt+=T.has(wt)?D[T.get(wt)]:ot.get(wt)}),mt=mt/Tt.length,Tt.forEach(function(wt){ht.set(wt,mt)})}});var pt=function(){var yt=Ct.shift(),Dt=rt.get(yt);Dt.forEach(function(mt){if(ht.get(mt.id)<ht.get(yt)+mt.gap)if(at&&at.has(mt.id)){var wt=void 0;if(it=="horizontal")wt=T.has(mt.id)?N[T.get(mt.id)]:ot.get(mt.id);else wt=T.has(mt.id)?D[T.get(mt.id)]:ot.get(mt.id);if(ht.set(mt.id,wt),wt<ht.get(yt)+mt.gap){var Zt=ht.get(yt)+mt.gap-wt;Lt.get(yt).forEach(function(Vt){ht.set(Vt,ht.get(Vt)-Zt)})}}else ht.set(mt.id,ht.get(yt)+mt.gap);if(Mt.set(mt.id,Mt.get(mt.id)-1),Mt.get(mt.id)==0)Ct.push(mt.id);if(at)Lt.set(mt.id,At(Lt.get(yt),Lt.get(mt.id)))})};while(Ct.length!=0)pt();if(at){var Ot=new Set;rt.forEach(function(Tt,yt){if(Tt.length==0)Ot.add(yt)});var Ut=[];Lt.forEach(function(Tt,yt){if(Ot.has(yt)){var Dt=!1,mt=!0,wt=!1,Zt=void 0;try{for(var Vt=Tt[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;if(at.has(Wt))Dt=!0}}catch($t){wt=!0,Zt=$t}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}if(!Dt){var bt=!1,oe=void 0;if(Ut.forEach(function($t,jt){if($t.has([].concat(u(Tt))[0]))bt=!0,oe=jt}),!bt)Ut.push(new Set(Tt));else Tt.forEach(function($t){Ut[oe].add($t)})}}}),Ut.forEach(function(Tt,yt){var{POSITIVE_INFINITY:Dt,POSITIVE_INFINITY:mt,NEGATIVE_INFINITY:wt,NEGATIVE_INFINITY:Zt}=Number,Vt=!0,re=!1,Wt=void 0;try{for(var bt=Tt[Symbol.iterator](),oe;!(Vt=(oe=bt.next()).done);Vt=!0){var $t=oe.value,jt=void 0;if(it=="horizontal")jt=T.has($t)?N[T.get($t)]:ot.get($t);else jt=T.has($t)?D[T.get($t)]:ot.get($t);var ne=ht.get($t);if(jt<Dt)Dt=jt;if(jt>wt)wt=jt;if(ne<mt)mt=ne;if(ne>Zt)Zt=ne}}catch(de){re=!0,Wt=de}finally{try{if(!Vt&&bt.return)bt.return()}finally{if(re)throw Wt}}var Me=(Dt+wt)/2-(mt+Zt)/2,le=!0,ce=!1,ge=void 0;try{for(var fe=Tt[Symbol.iterator](),Le;!(le=(Le=fe.next()).done);le=!0){var ue=Le.value;ht.set(ue,ht.get(ue)+Me)}}catch(de){ce=!0,ge=de}finally{try{if(!le&&fe.return)fe.return()}finally{if(ce)throw ge}}})}return ht},tt=function(rt){var it=0,at=0,ot=0,gt=0;if(rt.forEach(function(Lt){if(Lt.left)N[T.get(Lt.left)]-N[T.get(Lt.right)]>=0?it++:at++;else D[T.get(Lt.top)]-D[T.get(Lt.bottom)]>=0?ot++:gt++}),it>at&&ot>gt)for(var At=0;At<T.size;At++)N[At]=-1*N[At],D[At]=-1*D[At];else if(it>at)for(var Mt=0;Mt<T.size;Mt++)N[Mt]=-1*N[Mt];else if(ot>gt)for(var ht=0;ht<T.size;ht++)D[ht]=-1*D[ht]},s=function(rt){var it=[],at=new y,ot=new Set,gt=0;return rt.forEach(function(At,Mt){if(!ot.has(Mt)){it[gt]=[];var ht=Mt;at.push(ht),ot.add(ht),it[gt].push(ht);while(at.length!=0){ht=at.shift();var Lt=rt.get(ht);Lt.forEach(function(Ct){if(!ot.has(Ct.id))at.push(Ct.id),ot.add(Ct.id),it[gt].push(Ct.id)})}gt++}}),it},L=function(rt){var it=new Map;return rt.forEach(function(at,ot){it.set(ot,[])}),rt.forEach(function(at,ot){at.forEach(function(gt){it.get(ot).push(gt),it.get(gt.id).push({id:ot,gap:gt.gap,direction:gt.direction})})}),it},E=function(rt){var it=new Map;return rt.forEach(function(at,ot){it.set(ot,[])}),rt.forEach(function(at,ot){at.forEach(function(gt){it.get(gt.id).push({id:ot,gap:gt.gap,direction:gt.direction})})}),it},M=[],m=[],U=!1,S=!1,k=new Set,B=new Map,W=new Map,st=[];if(c.fixedNodeConstraint)c.fixedNodeConstraint.forEach(function(J){k.add(J.nodeId)});if(c.relativePlacementConstraint)c.relativePlacementConstraint.forEach(function(J){if(J.left){if(B.has(J.left))B.get(J.left).push({id:J.right,gap:J.gap,direction:"horizontal"});else B.set(J.left,[{id:J.right,gap:J.gap,direction:"horizontal"}]);if(!B.has(J.right))B.set(J.right,[])}else{if(B.has(J.top))B.get(J.top).push({id:J.bottom,gap:J.gap,direction:"vertical"});else B.set(J.top,[{id:J.bottom,gap:J.gap,direction:"vertical"}]);if(!B.has(J.bottom))B.set(J.bottom,[])}}),W=L(B),st=s(W);if(r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(c.fixedNodeConstraint&&c.fixedNodeConstraint.length>1)c.fixedNodeConstraint.forEach(function(J,rt){M[rt]=[J.position.x,J.position.y],m[rt]=[N[T.get(J.nodeId)],D[T.get(J.nodeId)]]}),U=!0;else if(c.alignmentConstraint)(function(){var J=0;if(c.alignmentConstraint.vertical){var rt=c.alignmentConstraint.vertical,it=function(ht){var Lt=new Set;rt[ht].forEach(function(Ot){Lt.add(Ot)});var Ct=new Set([].concat(u(Lt)).filter(function(Ot){return k.has(Ot)})),pt=void 0;if(Ct.size>0)pt=N[T.get(Ct.values().next().value)];else pt=lt(Lt).x;rt[ht].forEach(function(Ot){M[J]=[pt,D[T.get(Ot)]],m[J]=[N[T.get(Ot)],D[T.get(Ot)]],J++})};for(var at=0;at<rt.length;at++)it(at);U=!0}if(c.alignmentConstraint.horizontal){var ot=c.alignmentConstraint.horizontal,gt=function(ht){var Lt=new Set;ot[ht].forEach(function(Ot){Lt.add(Ot)});var Ct=new Set([].concat(u(Lt)).filter(function(Ot){return k.has(Ot)})),pt=void 0;if(Ct.size>0)pt=N[T.get(Ct.values().next().value)];else pt=lt(Lt).y;ot[ht].forEach(function(Ot){M[J]=[N[T.get(Ot)],pt],m[J]=[N[T.get(Ot)],D[T.get(Ot)]],J++})};for(var At=0;At<ot.length;At++)gt(At);U=!0}if(c.relativePlacementConstraint)S=!0})();else if(c.relativePlacementConstraint){var dt=0,Z=0;for(var ut=0;ut<st.length;ut++)if(st[ut].length>dt)dt=st[ut].length,Z=ut;if(dt<W.size/2)tt(c.relativePlacementConstraint),U=!1,S=!1;else{var nt=new Map,R=new Map,K=[];st[Z].forEach(function(J){B.get(J).forEach(function(rt){if(rt.direction=="horizontal"){if(nt.has(J))nt.get(J).push(rt);else nt.set(J,[rt]);if(!nt.has(rt.id))nt.set(rt.id,[]);K.push({left:J,right:rt.id})}else{if(R.has(J))R.get(J).push(rt);else R.set(J,[rt]);if(!R.has(rt.id))R.set(rt.id,[]);K.push({top:J,bottom:rt.id})}})}),tt(K),S=!1;var et=b(nt,"horizontal"),ct=b(R,"vertical");st[Z].forEach(function(J,rt){if(m[rt]=[N[T.get(J)],D[T.get(J)]],M[rt]=[],et.has(J))M[rt][0]=et.get(J);else M[rt][0]=N[T.get(J)];if(ct.has(J))M[rt][1]=ct.get(J);else M[rt][1]=D[T.get(J)]}),U=!0}}if(U){var Nt=void 0,Pt=i.transpose(M),Bt=i.transpose(m);for(var ft=0;ft<Pt.length;ft++)Pt[ft]=i.multGamma(Pt[ft]),Bt[ft]=i.multGamma(Bt[ft]);var Jt=i.multMat(Pt,i.transpose(Bt)),Xt=e.svd(Jt);Nt=i.multMat(Xt.V,i.transpose(Xt.U));for(var Et=0;Et<T.size;Et++){var vt=[N[Et],D[Et]],xt=[Nt[0][0],Nt[1][0]],Rt=[Nt[0][1],Nt[1][1]];N[Et]=i.dotProduct(vt,xt),D[Et]=i.dotProduct(vt,Rt)}if(S)tt(c.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(c.fixedNodeConstraint&&c.fixedNodeConstraint.length>0){var Gt={x:0,y:0};c.fixedNodeConstraint.forEach(function(J,rt){var it={x:N[T.get(J.nodeId)],y:D[T.get(J.nodeId)]},at=J.position,ot=Q(at,it);Gt.x+=ot.x,Gt.y+=ot.y}),Gt.x/=c.fixedNodeConstraint.length,Gt.y/=c.fixedNodeConstraint.length,N.forEach(function(J,rt){N[rt]+=Gt.x}),D.forEach(function(J,rt){D[rt]+=Gt.y}),c.fixedNodeConstraint.forEach(function(J){N[T.get(J.nodeId)]=J.position.x,D[T.get(J.nodeId)]=J.position.y})}if(c.alignmentConstraint){if(c.alignmentConstraint.vertical){var St=c.alignmentConstraint.vertical,Ft=function(rt){var it=new Set;St[rt].forEach(function(gt){it.add(gt)});var at=new Set([].concat(u(it)).filter(function(gt){return k.has(gt)})),ot=void 0;if(at.size>0)ot=N[T.get(at.values().next().value)];else ot=lt(it).x;it.forEach(function(gt){if(!k.has(gt))N[T.get(gt)]=ot})};for(var Ht=0;Ht<St.length;Ht++)Ft(Ht)}if(c.alignmentConstraint.horizontal){var zt=c.alignmentConstraint.horizontal,te=function(rt){var it=new Set;zt[rt].forEach(function(gt){it.add(gt)});var at=new Set([].concat(u(it)).filter(function(gt){return k.has(gt)})),ot=void 0;if(at.size>0)ot=D[T.get(at.values().next().value)];else ot=lt(it).y;it.forEach(function(gt){if(!k.has(gt))D[T.get(gt)]=ot})};for(var qt=0;qt<zt.length;qt++)te(qt)}}if(c.relativePlacementConstraint)(function(){var J=new Map,rt=new Map,it=new Map,at=new Map,ot=new Map,gt=new Map,At=new Set,Mt=new Set;if(k.forEach(function(Qt){At.add(Qt),Mt.add(Qt)}),c.alignmentConstraint){if(c.alignmentConstraint.vertical){var ht=c.alignmentConstraint.vertical,Lt=function(It){it.set("dummy"+It,[]),ht[It].forEach(function(Yt){if(J.set(Yt,"dummy"+It),it.get("dummy"+It).push(Yt),k.has(Yt))At.add("dummy"+It)}),ot.set("dummy"+It,N[T.get(ht[It][0])])};for(var Ct=0;Ct<ht.length;Ct++)Lt(Ct)}if(c.alignmentConstraint.horizontal){var pt=c.alignmentConstraint.horizontal,Ot=function(It){at.set("dummy"+It,[]),pt[It].forEach(function(Yt){if(rt.set(Yt,"dummy"+It),at.get("dummy"+It).push(Yt),k.has(Yt))Mt.add("dummy"+It)}),gt.set("dummy"+It,D[T.get(pt[It][0])])};for(var Ut=0;Ut<pt.length;Ut++)Ot(Ut)}}var Tt=new Map,yt=new Map,Dt=function(It){B.get(It).forEach(function(Yt){var se=void 0,ae=void 0;if(Yt.direction=="horizontal"){if(se=J.get(It)?J.get(It):It,J.get(Yt.id))ae={id:J.get(Yt.id),gap:Yt.gap,direction:Yt.direction};else ae=Yt;if(Tt.has(se))Tt.get(se).push(ae);else Tt.set(se,[ae]);if(!Tt.has(ae.id))Tt.set(ae.id,[])}else{if(se=rt.get(It)?rt.get(It):It,rt.get(Yt.id))ae={id:rt.get(Yt.id),gap:Yt.gap,direction:Yt.direction};else ae=Yt;if(yt.has(se))yt.get(se).push(ae);else yt.set(se,[ae]);if(!yt.has(ae.id))yt.set(ae.id,[])}})},mt=!0,wt=!1,Zt=void 0;try{for(var Vt=B.keys()[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;Dt(Wt)}}catch(Qt){wt=!0,Zt=Qt}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}var bt=L(Tt),oe=L(yt),$t=s(bt),jt=s(oe),ne=E(Tt),Me=E(yt),le=[],ce=[];$t.forEach(function(Qt,It){le[It]=[],Qt.forEach(function(Yt){if(ne.get(Yt).length==0)le[It].push(Yt)})}),jt.forEach(function(Qt,It){ce[It]=[],Qt.forEach(function(Yt){if(Me.get(Yt).length==0)ce[It].push(Yt)})});var ge=b(Tt,"horizontal",At,ot,le),fe=b(yt,"vertical",Mt,gt,ce),Le=function(It){if(it.get(It))it.get(It).forEach(function(Yt){N[T.get(Yt)]=ge.get(It)});else N[T.get(It)]=ge.get(It)},ue=!0,de=!1,Ye=void 0;try{for(var Ce=ge.keys()[Symbol.iterator](),Xe;!(ue=(Xe=Ce.next()).done);ue=!0){var Ae=Xe.value;Le(Ae)}}catch(Qt){de=!0,Ye=Qt}finally{try{if(!ue&&Ce.return)Ce.return()}finally{if(de)throw Ye}}var sr=function(It){if(at.get(It))at.get(It).forEach(function(Yt){D[T.get(Yt)]=fe.get(It)});else D[T.get(It)]=fe.get(It)},De=!0,He=!1,We=void 0;try{for(var Oe=fe.keys()[Symbol.iterator](),Ve;!(De=(Ve=Oe.next()).done);De=!0){var Ae=Ve.value;sr(Ae)}}catch(Qt){He=!0,We=Qt}finally{try{if(!De&&Oe.return)Oe.return()}finally{if(He)throw We}}})()}for(var Kt=0;Kt<X.length;Kt++){var kt=X[Kt];if(kt.getChild()==null)kt.setCenter(N[T.get(kt.id)],D[T.get(kt.id)])}},o.exports=g},551:(o)=>{o.exports=w}},A={};function v(o){var n=A[o];if(n!==void 0)return n.exports;var a=A[o]={exports:{}};return I[o](a,a.exports,v),a.exports}var f=v(45);return f})()})});var ze=Fn(function(Te,Fe){(function(I,A){if(typeof Te==="object"&&typeof Fe==="object")Fe.exports=A(Se());else if(typeof define==="function"&&define.amd)define(["cose-base"],A);else if(typeof Te==="object")Te.cytoscapeFcose=A(Se());else I.cytoscapeFcose=A(I.coseBase)})(Te,function(w){return(()=>{var I={658:(o)=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(n){for(var a=arguments.length,u=Array(a>1?a-1:0),r=1;r<a;r++)u[r-1]=arguments[r];return u.forEach(function(y){Object.keys(y).forEach(function(i){return n[i]=y[i]})}),n}},548:(o,n,a)=>{var u=function(){function i(e,g){var d=[],c=!0,O=!1,T=void 0;try{for(var N=e[Symbol.iterator](),D;!(c=(D=N.next()).done);c=!0)if(d.push(D.value),g&&d.length===g)break}catch(X){O=!0,T=X}finally{try{if(!c&&N.return)N.return()}finally{if(O)throw T}}return d}return function(e,g){if(Array.isArray(e))return e;else if(Symbol.iterator in Object(e))return i(e,g);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=a(140).layoutBase.LinkedList,y={};y.getTopMostNodes=function(i){var e={};for(var g=0;g<i.length;g++)e[i[g].id()]=!0;var d=i.filter(function(c,O){if(typeof c==="number")c=O;var T=c.parent()[0];while(T!=null){if(e[T.id()])return!1;T=T.parent()[0]}return!0});return d},y.connectComponents=function(i,e,g,d){var c=new r,O=new Set,T=[],N=void 0,D=void 0,X=void 0,x=!1,V=1,_=[],Q=[],lt=function(){var tt=i.collection();Q.push(tt);var s=g[0],L=i.collection();L.merge(s).merge(s.descendants().intersection(e)),T.push(s),L.forEach(function(m){c.push(m),O.add(m),tt.merge(m)});var E=function(){s=c.shift();var U=i.collection();s.neighborhood().nodes().forEach(function(W){if(e.intersection(s.edgesWith(W)).length>0)U.merge(W)});for(var S=0;S<U.length;S++){var k=U[S];if(N=g.intersection(k.union(k.ancestors())),N!=null&&!O.has(N[0])){var B=N.union(N.descendants());B.forEach(function(W){if(c.push(W),O.add(W),tt.merge(W),g.has(W))T.push(W)})}}};while(c.length!=0)E();if(tt.forEach(function(m){e.intersection(m.connectedEdges()).forEach(function(U){if(tt.has(U.source())&&tt.has(U.target()))tt.merge(U)})}),T.length==g.length)x=!0;if(!x||x&&V>1){D=T[0],X=D.connectedEdges().length,T.forEach(function(m){if(m.connectedEdges().length<X)X=m.connectedEdges().length,D=m}),_.push(D.id());var M=i.collection();M.merge(T[0]),T.forEach(function(m){M.merge(m)}),T=[],g=g.difference(M),V++}};do lt();while(!x);if(d){if(_.length>0)d.set("dummy"+(d.size+1),_)}return Q},y.relocateComponent=function(i,e,g){if(!g.fixedNodeConstraint){var{POSITIVE_INFINITY:d,NEGATIVE_INFINITY:c,POSITIVE_INFINITY:O,NEGATIVE_INFINITY:T}=Number;if(g.quality=="draft"){var N=!0,D=!1,X=void 0;try{for(var x=e.nodeIndexes[Symbol.iterator](),V;!(N=(V=x.next()).done);N=!0){var _=V.value,Q=u(_,2),lt=Q[0],b=Q[1],tt=g.cy.getElementById(lt);if(tt){var s=tt.boundingBox(),L=e.xCoords[b]-s.w/2,E=e.xCoords[b]+s.w/2,M=e.yCoords[b]-s.h/2,m=e.yCoords[b]+s.h/2;if(L<d)d=L;if(E>c)c=E;if(M<O)O=M;if(m>T)T=m}}}catch(W){D=!0,X=W}finally{try{if(!N&&x.return)x.return()}finally{if(D)throw X}}var U=i.x-(c+d)/2,S=i.y-(T+O)/2;e.xCoords=e.xCoords.map(function(W){return W+U}),e.yCoords=e.yCoords.map(function(W){return W+S})}else{Object.keys(e).forEach(function(W){var st=e[W],dt=st.getRect().x,Z=st.getRect().x+st.getRect().width,ut=st.getRect().y,nt=st.getRect().y+st.getRect().height;if(dt<d)d=dt;if(Z>c)c=Z;if(ut<O)O=ut;if(nt>T)T=nt});var k=i.x-(c+d)/2,B=i.y-(T+O)/2;Object.keys(e).forEach(function(W){var st=e[W];st.setCenter(st.getCenterX()+k,st.getCenterY()+B)})}}},y.calcBoundingBox=function(i,e,g,d){var{MAX_SAFE_INTEGER:c,MIN_SAFE_INTEGER:O,MAX_SAFE_INTEGER:T,MIN_SAFE_INTEGER:N}=Number,D=void 0,X=void 0,x=void 0,V=void 0,_=i.descendants().not(":parent"),Q=_.length;for(var lt=0;lt<Q;lt++){var b=_[lt];if(D=e[d.get(b.id())]-b.width()/2,X=e[d.get(b.id())]+b.width()/2,x=g[d.get(b.id())]-b.height()/2,V=g[d.get(b.id())]+b.height()/2,c>D)c=D;if(O<X)O=X;if(T>x)T=x;if(N<V)N=V}var tt={};return tt.topLeftX=c,tt.topLeftY=T,tt.width=O-c,tt.height=N-T,tt},y.calcParentsWithoutChildren=function(i,e){var g=i.collection();return e.nodes(":parent").forEach(function(d){var c=!1;if(d.children().forEach(function(O){if(O.css("display")!="none")c=!0}),!c)g.merge(d)}),g},o.exports=y},816:(o,n,a)=>{var u=a(548),r=a(140).CoSELayout,y=a(140).CoSENode,i=a(140).layoutBase.PointD,e=a(140).layoutBase.DimensionD,g=a(140).layoutBase.LayoutConstants,d=a(140).layoutBase.FDLayoutConstants,c=a(140).CoSEConstants,O=function(N,D){var{cy:X,eles:x}=N,V=x.nodes(),_=x.edges(),Q=void 0,lt=void 0,b=void 0,tt={};if(N.randomize)Q=D.nodeIndexes,lt=D.xCoords,b=D.yCoords;var s=function(W){return typeof W==="function"},L=function(W,st){if(s(W))return W(st);else return W},E=u.calcParentsWithoutChildren(X,x),M=function B(W,st,dt,Z){var ut=st.length;for(var nt=0;nt<ut;nt++){var R=st[nt],K=null;if(R.intersection(E).length==0)K=R.children();var et=void 0,ct=R.layoutDimensions({nodeDimensionsIncludeLabels:Z.nodeDimensionsIncludeLabels});if(R.outerWidth()!=null&&R.outerHeight()!=null)if(Z.randomize)if(!R.isParent())et=W.add(new y(dt.graphManager,new i(lt[Q.get(R.id())]-ct.w/2,b[Q.get(R.id())]-ct.h/2),new e(parseFloat(ct.w),parseFloat(ct.h))));else{var Nt=u.calcBoundingBox(R,lt,b,Q);if(R.intersection(E).length==0)et=W.add(new y(dt.graphManager,new i(Nt.topLeftX,Nt.topLeftY),new e(Nt.width,Nt.height)));else et=W.add(new y(dt.graphManager,new i(Nt.topLeftX,Nt.topLeftY),new e(parseFloat(ct.w),parseFloat(ct.h))))}else et=W.add(new y(dt.graphManager,new i(R.position("x")-ct.w/2,R.position("y")-ct.h/2),new e(parseFloat(ct.w),parseFloat(ct.h))));else et=W.add(new y(this.graphManager));if(et.id=R.data("id"),et.nodeRepulsion=L(Z.nodeRepulsion,R),et.paddingLeft=parseInt(R.css("padding")),et.paddingTop=parseInt(R.css("padding")),et.paddingRight=parseInt(R.css("padding")),et.paddingBottom=parseInt(R.css("padding")),Z.nodeDimensionsIncludeLabels)et.labelWidth=R.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,et.labelHeight=R.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,et.labelPosVertical=R.css("text-valign"),et.labelPosHorizontal=R.css("text-halign");if(tt[R.data("id")]=et,isNaN(et.rect.x))et.rect.x=0;if(isNaN(et.rect.y))et.rect.y=0;if(K!=null&&K.length>0){var Pt=void 0;Pt=dt.getGraphManager().add(dt.newGraph(),et),B(Pt,K,dt,Z)}}},m=function(W,st,dt){var Z=0,ut=0;for(var nt=0;nt<dt.length;nt++){var R=dt[nt],K=tt[R.data("source")],et=tt[R.data("target")];if(K&&et&&K!==et&&K.getEdgesBetween(et).length==0){var ct=st.add(W.newEdge(),K,et);ct.id=R.id(),ct.idealLength=L(N.idealEdgeLength,R),ct.edgeElasticity=L(N.edgeElasticity,R),Z+=ct.idealLength,ut++}}if(N.idealEdgeLength!=null){if(ut>0)c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=Z/ut;else if(!s(N.idealEdgeLength))c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=N.idealEdgeLength;else c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=50;c.MIN_REPULSION_DIST=d.MIN_REPULSION_DIST=d.DEFAULT_EDGE_LENGTH/10,c.DEFAULT_RADIAL_SEPARATION=d.DEFAULT_EDGE_LENGTH}},U=function(W,st){if(st.fixedNodeConstraint)W.constraints.fixedNodeConstraint=st.fixedNodeConstraint;if(st.alignmentConstraint)W.constraints.alignmentConstraint=st.alignmentConstraint;if(st.relativePlacementConstraint)W.constraints.relativePlacementConstraint=st.relativePlacementConstraint};if(N.nestingFactor!=null)c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=N.nestingFactor;if(N.gravity!=null)c.DEFAULT_GRAVITY_STRENGTH=d.DEFAULT_GRAVITY_STRENGTH=N.gravity;if(N.numIter!=null)c.MAX_ITERATIONS=d.MAX_ITERATIONS=N.numIter;if(N.gravityRange!=null)c.DEFAULT_GRAVITY_RANGE_FACTOR=d.DEFAULT_GRAVITY_RANGE_FACTOR=N.gravityRange;if(N.gravityCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=N.gravityCompound;if(N.gravityRangeCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=N.gravityRangeCompound;if(N.initialEnergyOnIncremental!=null)c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.DEFAULT_COOLING_FACTOR_INCREMENTAL=N.initialEnergyOnIncremental;if(N.tilingCompareBy!=null)c.TILING_COMPARE_BY=N.tilingCompareBy;if(N.quality=="proof")g.QUALITY=2;else g.QUALITY=0;if(c.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=N.nodeDimensionsIncludeLabels,c.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!N.randomize,c.ANIMATE=d.ANIMATE=g.ANIMATE=N.animate,c.TILE=N.tile,c.TILING_PADDING_VERTICAL=typeof N.tilingPaddingVertical==="function"?N.tilingPaddingVertical.call():N.tilingPaddingVertical,c.TILING_PADDING_HORIZONTAL=typeof N.tilingPaddingHorizontal==="function"?N.tilingPaddingHorizontal.call():N.tilingPaddingHorizontal,c.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!0,c.PURE_INCREMENTAL=!N.randomize,g.DEFAULT_UNIFORM_LEAF_NODE_SIZES=N.uniformNodeDimensions,N.step=="transformed")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!1;if(N.step=="enforced")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!1;if(N.step=="cose")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!0;if(N.step=="all"){if(N.randomize)c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!0}if(N.fixedNodeConstraint||N.alignmentConstraint||N.relativePlacementConstraint)c.TREE_REDUCTION_ON_INCREMENTAL=!1;else c.TREE_REDUCTION_ON_INCREMENTAL=!0;var S=new r,k=S.newGraphManager();return M(k.addRoot(),u.getTopMostNodes(V),S,N),m(S,k,_),U(S,N),S.runLayout(),tt};o.exports={coseLayout:O}},212:(o,n,a)=>{var u=function(){function N(D,X){for(var x=0;x<X.length;x++){var V=X[x];if(V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V)V.writable=!0;Object.defineProperty(D,V.key,V)}}return function(D,X,x){if(X)N(D.prototype,X);if(x)N(D,x);return D}}();function r(N,D){if(!(N instanceof D))throw TypeError("Cannot call a class as a function")}var y=a(658),i=a(548),e=a(657),g=e.spectralLayout,d=a(816),c=d.coseLayout,O=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1000,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:0.0000001,nodeRepulsion:function(D){return 4500},idealEdgeLength:function(D){return 50},edgeElasticity:function(D){return 0.45},nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),T=function(){function N(D){r(this,N),this.options=y({},O,D)}return u(N,[{key:"run",value:function(){var X=this,x=this.options,{cy:V,eles:_}=x,Q=[],lt=void 0,b=void 0,tt=[],s=void 0,L=[];if(x.fixedNodeConstraint&&(!Array.isArray(x.fixedNodeConstraint)||x.fixedNodeConstraint.length==0))x.fixedNodeConstraint=void 0;if(x.alignmentConstraint){if(x.alignmentConstraint.vertical&&(!Array.isArray(x.alignmentConstraint.vertical)||x.alignmentConstraint.vertical.length==0))x.alignmentConstraint.vertical=void 0;if(x.alignmentConstraint.horizontal&&(!Array.isArray(x.alignmentConstraint.horizontal)||x.alignmentConstraint.horizontal.length==0))x.alignmentConstraint.horizontal=void 0}if(x.relativePlacementConstraint&&(!Array.isArray(x.relativePlacementConstraint)||x.relativePlacementConstraint.length==0))x.relativePlacementConstraint=void 0;var E=x.fixedNodeConstraint||x.alignmentConstraint||x.relativePlacementConstraint;if(E)x.tile=!1,x.packComponents=!1;var M=void 0,m=!1;if(V.layoutUtilities&&x.packComponents){if(M=V.layoutUtilities("get"),!M)M=V.layoutUtilities();m=!0}if(_.nodes().length>0)if(!m){var U=x.eles.boundingBox();if(L.push({x:U.x1+U.w/2,y:U.y1+U.h/2}),x.randomize){var S=g(x);Q.push(S)}if(x.quality=="default"||x.quality=="proof")tt.push(c(x,Q[0])),i.relocateComponent(L[0],tt[0],x);else i.relocateComponent(L[0],Q[0],x)}else{var k=i.getTopMostNodes(x.eles.nodes());if(s=i.connectComponents(V,x.eles,k),s.forEach(function(Et){var vt=Et.boundingBox();L.push({x:vt.x1+vt.w/2,y:vt.y1+vt.h/2})}),x.randomize)s.forEach(function(Et){x.eles=Et,Q.push(g(x))});if(x.quality=="default"||x.quality=="proof"){var B=V.collection();if(x.tile){var W=new Map,st=[],dt=[],Z=0,ut={nodeIndexes:W,xCoords:st,yCoords:dt},nt=[];if(s.forEach(function(Et,vt){if(Et.edges().length==0)Et.nodes().forEach(function(xt,Rt){if(B.merge(Et.nodes()[Rt]),!xt.isParent())ut.nodeIndexes.set(Et.nodes()[Rt].id(),Z++),ut.xCoords.push(Et.nodes()[0].position().x),ut.yCoords.push(Et.nodes()[0].position().y)}),nt.push(vt)}),B.length>1){var R=B.boundingBox();L.push({x:R.x1+R.w/2,y:R.y1+R.h/2}),s.push(B),Q.push(ut);for(var K=nt.length-1;K>=0;K--)s.splice(nt[K],1),Q.splice(nt[K],1),L.splice(nt[K],1)}}s.forEach(function(Et,vt){x.eles=Et,tt.push(c(x,Q[vt])),i.relocateComponent(L[vt],tt[vt],x)})}else s.forEach(function(Et,vt){i.relocateComponent(L[vt],Q[vt],x)});var et=new Set;if(s.length>1){var ct=[],Nt=_.filter(function(Et){return Et.css("display")=="none"});s.forEach(function(Et,vt){var xt=void 0;if(x.quality=="draft")xt=Q[vt].nodeIndexes;if(Et.nodes().not(Nt).length>0){var Rt={};Rt.edges=[],Rt.nodes=[];var Gt=void 0;if(Et.nodes().not(Nt).forEach(function(St){if(x.quality=="draft")if(!St.isParent())Gt=xt.get(St.id()),Rt.nodes.push({x:Q[vt].xCoords[Gt]-St.boundingbox().w/2,y:Q[vt].yCoords[Gt]-St.boundingbox().h/2,width:St.boundingbox().w,height:St.boundingbox().h});else{var Ft=i.calcBoundingBox(St,Q[vt].xCoords,Q[vt].yCoords,xt);Rt.nodes.push({x:Ft.topLeftX,y:Ft.topLeftY,width:Ft.width,height:Ft.height})}else if(tt[vt][St.id()])Rt.nodes.push({x:tt[vt][St.id()].getLeft(),y:tt[vt][St.id()].getTop(),width:tt[vt][St.id()].getWidth(),height:tt[vt][St.id()].getHeight()})}),Et.edges().forEach(function(St){var Ft=St.source(),Ht=St.target();if(Ft.css("display")!="none"&&Ht.css("display")!="none"){if(x.quality=="draft"){var zt=xt.get(Ft.id()),te=xt.get(Ht.id()),qt=[],Kt=[];if(Ft.isParent()){var kt=i.calcBoundingBox(Ft,Q[vt].xCoords,Q[vt].yCoords,xt);qt.push(kt.topLeftX+kt.width/2),qt.push(kt.topLeftY+kt.height/2)}else qt.push(Q[vt].xCoords[zt]),qt.push(Q[vt].yCoords[zt]);if(Ht.isParent()){var J=i.calcBoundingBox(Ht,Q[vt].xCoords,Q[vt].yCoords,xt);Kt.push(J.topLeftX+J.width/2),Kt.push(J.topLeftY+J.height/2)}else Kt.push(Q[vt].xCoords[te]),Kt.push(Q[vt].yCoords[te]);Rt.edges.push({startX:qt[0],startY:qt[1],endX:Kt[0],endY:Kt[1]})}else if(tt[vt][Ft.id()]&&tt[vt][Ht.id()])Rt.edges.push({startX:tt[vt][Ft.id()].getCenterX(),startY:tt[vt][Ft.id()].getCenterY(),endX:tt[vt][Ht.id()].getCenterX(),endY:tt[vt][Ht.id()].getCenterY()})}}),Rt.nodes.length>0)ct.push(Rt),et.add(vt)}});var Pt=M.packComponents(ct,x.randomize).shifts;if(x.quality=="draft")Q.forEach(function(Et,vt){var xt=Et.xCoords.map(function(Gt){return Gt+Pt[vt].dx}),Rt=Et.yCoords.map(function(Gt){return Gt+Pt[vt].dy});Et.xCoords=xt,Et.yCoords=Rt});else{var Bt=0;et.forEach(function(Et){Object.keys(tt[Et]).forEach(function(vt){var xt=tt[Et][vt];xt.setCenter(xt.getCenterX()+Pt[Bt].dx,xt.getCenterY()+Pt[Bt].dy)}),Bt++})}}}var ft=function(vt,xt){if(x.quality=="default"||x.quality=="proof"){if(typeof vt==="number")vt=xt;var Rt=void 0,Gt=void 0,St=vt.data("id");if(tt.forEach(function(Ht){if(St in Ht)Rt={x:Ht[St].getRect().getCenterX(),y:Ht[St].getRect().getCenterY()},Gt=Ht[St]}),x.nodeDimensionsIncludeLabels){if(Gt.labelWidth){if(Gt.labelPosHorizontal=="left")Rt.x+=Gt.labelWidth/2;else if(Gt.labelPosHorizontal=="right")Rt.x-=Gt.labelWidth/2}if(Gt.labelHeight){if(Gt.labelPosVertical=="top")Rt.y+=Gt.labelHeight/2;else if(Gt.labelPosVertical=="bottom")Rt.y-=Gt.labelHeight/2}}if(Rt==null)Rt={x:vt.position("x"),y:vt.position("y")};return{x:Rt.x,y:Rt.y}}else{var Ft=void 0;if(Q.forEach(function(Ht){var zt=Ht.nodeIndexes.get(vt.id());if(zt!=null)Ft={x:Ht.xCoords[zt],y:Ht.yCoords[zt]}}),Ft==null)Ft={x:vt.position("x"),y:vt.position("y")};return{x:Ft.x,y:Ft.y}}};if(x.quality=="default"||x.quality=="proof"||x.randomize){var Jt=i.calcParentsWithoutChildren(V,_),Xt=_.filter(function(Et){return Et.css("display")=="none"});if(x.eles=_.not(Xt),_.nodes().not(":parent").not(Xt).layoutPositions(X,x,ft),Jt.length>0)Jt.forEach(function(Et){Et.position(ft(Et))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),N}();o.exports=T},657:(o,n,a)=>{var u=a(548),r=a(140).layoutBase.Matrix,y=a(140).layoutBase.SVD,i=function(g){var{cy:d,eles:c}=g,O=c.nodes(),T=c.nodes(":parent"),N=new Map,D=new Map,X=new Map,x=[],V=[],_=[],Q=[],lt=[],b=[],tt=[],s=[],L=void 0,E=void 0,M=1e8,m=0.000000001,{piTol:U,samplingType:S,nodeSeparation:k}=g,B=void 0,W=function(){var it=0,at=0,ot=!1;while(at<B){it=Math.floor(Math.random()*E),ot=!1;for(var gt=0;gt<at;gt++)if(Q[gt]==it){ot=!0;break}if(!ot)Q[at]=it,at++;else continue}},st=function(it,at,ot){var gt=[],At=0,Mt=0,ht=0,Lt=void 0,Ct=[],pt=0,Ot=1;for(var Ut=0;Ut<E;Ut++)Ct[Ut]=M;gt[Mt]=it,Ct[it]=0;while(Mt>=At){ht=gt[At++];var Tt=x[ht];for(var yt=0;yt<Tt.length;yt++)if(Lt=D.get(Tt[yt]),Ct[Lt]==M)Ct[Lt]=Ct[ht]+1,gt[++Mt]=Lt;b[ht][at]=Ct[ht]*k}if(ot){for(var Dt=0;Dt<E;Dt++)if(b[Dt][at]<lt[Dt])lt[Dt]=b[Dt][at];for(var mt=0;mt<E;mt++)if(lt[mt]>pt)pt=lt[mt],Ot=mt}return Ot},dt=function(it){var at=void 0;if(!it){W();for(var ot=0;ot<B;ot++)st(Q[ot],ot,it,!1)}else{at=Math.floor(Math.random()*E),L=at;for(var gt=0;gt<E;gt++)lt[gt]=M;for(var At=0;At<B;At++)Q[At]=at,at=st(at,At,it)}for(var Mt=0;Mt<E;Mt++)for(var ht=0;ht<B;ht++)b[Mt][ht]*=b[Mt][ht];for(var Lt=0;Lt<B;Lt++)tt[Lt]=[];for(var Ct=0;Ct<B;Ct++)for(var pt=0;pt<B;pt++)tt[Ct][pt]=b[Q[pt]][Ct]},Z=function(){var it=y.svd(tt),{S:at,U:ot,V:gt}=it,At=at[0]*at[0]*at[0],Mt=[];for(var ht=0;ht<B;ht++){Mt[ht]=[];for(var Lt=0;Lt<B;Lt++)if(Mt[ht][Lt]=0,ht==Lt)Mt[ht][Lt]=at[ht]/(at[ht]*at[ht]+At/(at[ht]*at[ht]))}s=r.multMat(r.multMat(gt,Mt),r.transpose(ot))},ut=function(){var it=void 0,at=void 0,ot=[],gt=[],At=[],Mt=[];for(var ht=0;ht<E;ht++)ot[ht]=Math.random(),gt[ht]=Math.random();ot=r.normalize(ot),gt=r.normalize(gt);var Lt=0,Ct=m,pt=m,Ot=void 0;while(!0){Lt++;for(var Ut=0;Ut<E;Ut++)At[Ut]=ot[Ut];if(ot=r.multGamma(r.multL(r.multGamma(At),b,s)),it=r.dotProduct(At,ot),ot=r.normalize(ot),Ct=r.dotProduct(At,ot),Ot=Math.abs(Ct/pt),Ot<=1+U&&Ot>=1)break;pt=Ct}for(var Tt=0;Tt<E;Tt++)At[Tt]=ot[Tt];Lt=0,pt=m;while(!0){Lt++;for(var yt=0;yt<E;yt++)Mt[yt]=gt[yt];if(Mt=r.minusOp(Mt,r.multCons(At,r.dotProduct(At,Mt))),gt=r.multGamma(r.multL(r.multGamma(Mt),b,s)),at=r.dotProduct(Mt,gt),gt=r.normalize(gt),Ct=r.dotProduct(Mt,gt),Ot=Math.abs(Ct/pt),Ot<=1+U&&Ot>=1)break;pt=Ct}for(var Dt=0;Dt<E;Dt++)Mt[Dt]=gt[Dt];V=r.multCons(At,Math.sqrt(Math.abs(it))),_=r.multCons(Mt,Math.sqrt(Math.abs(at)))};u.connectComponents(d,c,u.getTopMostNodes(O),N),T.forEach(function(rt){u.connectComponents(d,c,u.getTopMostNodes(rt.descendants().intersection(c)),N)});var nt=0;for(var R=0;R<O.length;R++)if(!O[R].isParent())D.set(O[R].id(),nt++);var K=!0,et=!1,ct=void 0;try{for(var Nt=N.keys()[Symbol.iterator](),Pt;!(K=(Pt=Nt.next()).done);K=!0){var Bt=Pt.value;D.set(Bt,nt++)}}catch(rt){et=!0,ct=rt}finally{try{if(!K&&Nt.return)Nt.return()}finally{if(et)throw ct}}for(var ft=0;ft<D.size;ft++)x[ft]=[];T.forEach(function(rt){var it=rt.children().intersection(c);while(it.nodes(":childless").length==0)it=it.nodes()[0].children().intersection(c);var at=0,ot=it.nodes(":childless")[0].connectedEdges().length;it.nodes(":childless").forEach(function(gt,At){if(gt.connectedEdges().length<ot)ot=gt.connectedEdges().length,at=At}),X.set(rt.id(),it.nodes(":childless")[at].id())}),O.forEach(function(rt){var it=void 0;if(rt.isParent())it=D.get(X.get(rt.id()));else it=D.get(rt.id());rt.neighborhood().nodes().forEach(function(at){if(c.intersection(rt.edgesWith(at)).length>0)if(at.isParent())x[it].push(X.get(at.id()));else x[it].push(at.id())})});var Jt=function(it){var at=D.get(it),ot=void 0;N.get(it).forEach(function(gt){if(d.getElementById(gt).isParent())ot=X.get(gt);else ot=gt;x[at].push(ot),x[D.get(ot)].push(it)})},Xt=!0,Et=!1,vt=void 0;try{for(var xt=N.keys()[Symbol.iterator](),Rt;!(Xt=(Rt=xt.next()).done);Xt=!0){var Gt=Rt.value;Jt(Gt)}}catch(rt){Et=!0,vt=rt}finally{try{if(!Xt&&xt.return)xt.return()}finally{if(Et)throw vt}}E=D.size;var St=void 0;if(E>2){B=E<g.sampleSize?E:g.sampleSize;for(var Ft=0;Ft<E;Ft++)b[Ft]=[];for(var Ht=0;Ht<B;Ht++)s[Ht]=[];if(g.quality=="draft"||g.step=="all")dt(S),Z(),ut(),St={nodeIndexes:D,xCoords:V,yCoords:_};else D.forEach(function(rt,it){V.push(d.getElementById(it).position("x")),_.push(d.getElementById(it).position("y"))}),St={nodeIndexes:D,xCoords:V,yCoords:_};return St}else{var zt=D.keys(),te=d.getElementById(zt.next().value),qt=te.position(),Kt=te.outerWidth();if(V.push(qt.x),_.push(qt.y),E==2){var kt=d.getElementById(zt.next().value),J=kt.outerWidth();V.push(qt.x+Kt/2+J/2+g.idealEdgeLength),_.push(qt.y)}return St={nodeIndexes:D,xCoords:V,yCoords:_},St}};o.exports={spectralLayout:i}},579:(o,n,a)=>{var u=a(212),r=function(i){if(!i)return;i("layout","fcose",u)};if(typeof cytoscape<"u")r(cytoscape);o.exports=r},140:(o)=>{o.exports=w}},A={};function v(o){var n=A[o];if(n!==void 0)return n.exports;var a=A[o]={exports:{}};return I[o](a,a.exports,v),a.exports}var f=v(579);return f})()})});var je=bn(ze(),1);var $e={L:"left",R:"right",T:"top",B:"bottom"},Be={L:t((w)=>`${w},${w/2} 0,${w} 0,0`,"L"),R:t((w)=>`0,${w/2} ${w},0 ${w},${w}`,"R"),T:t((w)=>`0,0 ${w},0 ${w/2},${w}`,"T"),B:t((w)=>`${w/2},0 ${w},${w} 0,${w}`,"B")},we={L:t((w,I)=>w-I+2,"L"),R:t((w,I)=>w-2,"R"),T:t((w,I)=>w-I+2,"T"),B:t((w,I)=>w-2,"B")},hr=t(function(w){if(_t(w))return w==="L"?"R":"L";else return w==="T"?"B":"T"},"getOppositeArchitectureDirection"),Ze=t(function(w){let I=w;return I==="L"||I==="R"||I==="T"||I==="B"},"isArchitectureDirection"),_t=t(function(w){let I=w;return I==="L"||I==="R"},"isArchitectureDirectionX"),he=t(function(w){let I=w;return I==="T"||I==="B"},"isArchitectureDirectionY"),Ue=t(function(w,I){let A=_t(w)&&he(I),v=he(w)&&_t(I);return A||v},"isArchitectureDirectionXY"),lr=t(function(w){let I=w[0],A=w[1],v=_t(I)&&he(A),f=he(I)&&_t(A);return v||f},"isArchitecturePairXY"),fr=t(function(w){return w!=="LL"&&w!=="RR"&&w!=="TT"&&w!=="BB"},"isValidArchitectureDirectionPair"),be=t(function(w,I){let A=`${w}${I}`;return fr(A)?A:void 0},"getArchitectureDirectionPair"),cr=t(function([w,I],A){let v=A[0],f=A[1];if(_t(v))if(he(f))return[w+(v==="L"?-1:1),I+(f==="T"?1:-1)];else return[w+(v==="L"?-1:1),I];else if(_t(f))return[w+(f==="L"?1:-1),I+(v==="T"?1:-1)];else return[w,I+(v==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),gr=t(function(w){if(w==="LT"||w==="TL")return[1,1];else if(w==="BL"||w==="LB")return[1,-1];else if(w==="BR"||w==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),ur=t(function(w,I){if(Ue(w,I))return"bend";else if(_t(w))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),dr=t(function(w){return w.type==="service"},"isArchitectureService"),vr=t(function(w){return w.type==="junction"},"isArchitectureJunction"),qe=t((w,I)=>{let[A,v]=[w,I].sort();return`${JSON.stringify(A)}-${JSON.stringify(v)}`},"architectureGroupAlignmentKey"),Qe=t((w)=>w.data(),"edgeData"),pe=t((w)=>w.data(),"nodeData"),yr=Y.architecture,Je=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=P,this.getAccTitle=G,this.setDiagramTitle=H,this.getDiagramTitle=q,this.getAccDescription=j,this.setAccDescription=z,this.clear()}static{t(this,"ArchitectureDB")}setDiagramId(w){this.diagramId=w}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",F()}addService({id:w,icon:I,in:A,title:v,iconText:f}){if(this.registeredIds.has(w))throw Error(`The service id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(A!==void 0){if(w===A)throw Error(`The service [${w}] cannot be placed within itself`);if(!this.registeredIds.has(A))throw Error(`The service [${w}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(A)==="node")throw Error(`The service [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"service",icon:I,iconText:f,title:v,edges:[],in:A})}getServices(){return[...this.nodes.values()].filter(dr)}addJunction({id:w,in:I}){if(this.registeredIds.has(w))throw Error(`The junction id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(I!==void 0){if(w===I)throw Error(`The junction [${w}] cannot be placed within itself`);if(!this.registeredIds.has(I))throw Error(`The junction [${w}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(I)==="node")throw Error(`The junction [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"junction",edges:[],in:I})}getJunctions(){return[...this.nodes.values()].filter(vr)}getNodes(){return[...this.nodes.values()]}getNode(w){return this.nodes.get(w)??null}addGroup({id:w,icon:I,in:A,title:v}){if(this.registeredIds.has(w))throw Error(`The group id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(A!==void 0){if(w===A)throw Error(`The group [${w}] cannot be placed within itself`);if(!this.registeredIds.has(A))throw Error(`The group [${w}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(A)==="node")throw Error(`The group [${w}]'s parent is not a group`)}this.registeredIds.set(w,"group"),this.groups.set(w,{id:w,icon:I,title:v,in:A})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:w,rhsId:I,lhsDir:A,rhsDir:v,lhsInto:f,rhsInto:o,lhsGroup:n,rhsGroup:a,title:u}){if(!Ze(A))throw Error(`Invalid direction given for left hand side of edge ${w}--${I}. Expected (L,R,T,B) got ${String(A)}`);if(!Ze(v))throw Error(`Invalid direction given for right hand side of edge ${w}--${I}. Expected (L,R,T,B) got ${String(v)}`);if(!this.nodes.has(w)&&!this.groups.has(w))throw Error(`The left-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(I)&&!this.groups.has(I))throw Error(`The right-hand id [${I}] does not yet exist. Please create the service/group before declaring an edge to it.`);let r=this.nodes.get(w).in,y=this.nodes.get(I).in;if(n&&r&&y&&r==y)throw Error(`The left-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&r&&y&&r==y)throw Error(`The right-hand id [${I}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:w,lhsDir:A,lhsInto:f,lhsGroup:n,rhsId:I,rhsDir:v,rhsInto:o,rhsGroup:a,title:u};this.edges.push(i);let e=this.nodes.get(w),g=this.nodes.get(I);if(e&&g)e.edges.push(this.edges[this.edges.length-1]),g.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(w){if(w.members.length<2)throw Error(`An align directive requires at least two members; got ${w.members.length}`);let I=new Set;w.members.forEach((A)=>{if(this.registeredIds.get(A)!=="node")throw Error(`align ${w.direction} references [${A}], which is not a service or junction`);if(I.has(A))throw Error(`align ${w.direction} lists [${A}] more than once`);I.add(A)}),this.layoutHints.push(w)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let w=new Map,I=new Map;for(let[n,a]of this.nodes.entries()){let u=new Map;for(let r of a.edges){let y=this.getNode(r.lhsId)?.in,i=this.getNode(r.rhsId)?.in;if(y&&i&&y!==i){let e=ur(r.lhsDir,r.rhsDir);if(e!=="bend")w.set(qe(y,i),e)}if(r.lhsId===n){let e=be(r.lhsDir,r.rhsDir);if(e)u.set(e,r.rhsId)}else{let e=be(r.rhsDir,r.lhsDir);if(e)u.set(e,r.lhsId)}}I.set(n,u)}let A=new Set,v=new Set(I.keys()),f=t((n)=>{let a=new Map([[n,[0,0]]]),u=[n];while(u.length>0){let r=u.shift();if(r){A.add(r),v.delete(r);let y=I.get(r);if(!y)throw Error(`BFS error: adjacency list for id ${r} not found. Please report this as a bug.`);let i=a.get(r);if(!i)throw Error(`BFS error: position for id ${r} not found in spatial map. Please report this as a bug.`);let[e,g]=i;y.forEach((d,c)=>{if(!A.has(d))a.set(d,cr([e,g],c)),u.push(d)})}}return a},"BFS"),o=[];while(v.size>0){let n=v.values().next().value;o.push(f(n))}this.dataStructures={adjList:I,spatialMaps:o,groupAlignments:w}}return this.dataStructures}setElementForId(w,I){this.elements.set(w,I)}getElementById(w){return this.elements.get(w)}getConfig(){return ie({...yr,...C().architecture})}getConfigField(w){return this.getConfig()[w]}},mr=t((w,I)=>{ke(w,I),w.groups.map((A)=>I.addGroup(A)),w.services.map((A)=>I.addService({...A,type:"service"})),w.junctions.map((A)=>I.addJunction({...A,type:"junction"})),w.edges.map((A)=>I.addEdge(A)),w.alignments?.map((A)=>I.addLayoutHint({direction:A.direction,members:[...A.members]}))},"populateDb"),Ke={parser:{yy:void 0},parse:t(async(w)=>{let I=await Pe("architecture",w);l.debug(I);let A=Ke.parser?.yy;if(!(A instanceof Je))throw Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");mr(I,A)},"parse")},Er=t((w)=>`
|
|
2
2
|
.edge {
|
|
3
3
|
stroke-width: ${w.archEdgeWidth};
|
|
4
4
|
stroke: ${w.archEdgeColor};
|
|
@@ -29,8 +29,8 @@ import{ye}from"./index-x9hfvbz6.js";import{t,l,Y,C,ee,Ur,F,M,G,z,j,H,q,p,h,pe,og
|
|
|
29
29
|
display: -webkit-box;
|
|
30
30
|
-webkit-box-orient: vertical;
|
|
31
31
|
}
|
|
32
|
-
`,"getStyles"),Tr=Er;function
|
|
33
|
-
translate(${
|
|
34
|
-
translate(${m*
|
|
35
|
-
rotate(${-1*m*U*45}, 0, ${
|
|
36
|
-
`)}}}}}))},"drawEdges"),Lr=t(async function(w,R,D,v){let o=D.getConfigField("padding")*0.75,n=D.getConfigField("fontSize"),u=D.getConfigField("iconSize")/2;await Promise.all(R.nodes().map(async(r)=>{let y=me(r);if(y.type==="group"){let{h:i,w:e,x1:g,y1:d}=r.boundingBox(),c=w.append("rect");c.attr("id",`${v}-group-${y.id}`).attr("x",g+u).attr("y",d+u).attr("width",e).attr("height",i).attr("class","node-bkg");let x=w.append("g"),T=g,N=d;if(y.icon){let O=x.append("g");O.html(`<g>${await dr(y.icon,{height:o,width:o,fallbackPrefix:Le.prefix})}</g>`),O.attr("transform","translate("+(T+u+1)+", "+(N+u+1)+")"),T+=o,N+=n/2-1-2}if(y.label){let O=x.append("g");await dn(O,y.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},p()),O.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),O.attr("transform","translate("+(T+u+4)+", "+(N+u+2)+")")}D.setElementForId(y.id,c)}}))},"drawGroups"),wr=t(async function(w,R,D,v){let f=p();for(let o of D){let n=R.append("g"),a=w.getConfigField("iconSize");if(o.title){let i=n.append("g");await dn(i,o.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},f),i.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),i.attr("transform","translate("+a/2+", "+a+")")}let u=n.append("g");if(o.icon)u.html(`<g>${await dr(o.icon,{height:a,width:a,fallbackPrefix:Le.prefix})}</g>`);else if(o.iconText){u.html(`<g>${await dr("blank",{height:a,width:a,fallbackPrefix:Le.prefix})}</g>`);let g=u.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(ee(o.iconText,f)),d=parseInt(window.getComputedStyle(g.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;g.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/d)};`)}else u.append("path").attr("class","node-bkg").attr("id",`${v}-node-${o.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);n.attr("id",`${v}-service-${o.id}`).attr("class","architecture-service");let{width:r,height:y}=n.node().getBBox();o.width=r,o.height=y,w.setElementForId(o.id,n)}return 0},"drawServices"),Mr=t(function(w,R,D,v){D.forEach((f)=>{let o=R.append("g"),n=w.getConfigField("iconSize");o.append("g").append("rect").attr("id",`${v}-node-${f.id}`).attr("fill-opacity","0").attr("width",n).attr("height",n),o.attr("class","architecture-junction");let{width:u,height:r}=o._groups[0][0].getBBox();o.width=u,o.height=r,w.setElementForId(f.id,o)})},"drawJunctions");Ui([{name:Le.prefix,icons:Le}]);$r.use(je.default);function _e(w,R,D){w.forEach((v)=>{R.add({group:"nodes",data:{type:"service",id:v.id,icon:v.icon,label:v.title,parent:v.in,width:D.getConfigField("iconSize"),height:D.getConfigField("iconSize")},classes:"node-service"})})}t(_e,"addServices");function tr(w,R,D){w.forEach((v)=>{R.add({group:"nodes",data:{type:"junction",id:v.id,parent:v.in,width:D.getConfigField("iconSize"),height:D.getConfigField("iconSize")},classes:"node-junction"})})}t(tr,"addJunctions");function er(w,R){R.nodes().map((D)=>{let v=me(D);if(v.type==="group")return;v.x=D.position().x,v.y=D.position().y,w.getElementById(v.id).attr("transform","translate("+(v.x||0)+","+(v.y||0)+")")})}t(er,"positionNodes");function rr(w,R){w.forEach((D)=>{R.add({group:"nodes",data:{type:"group",id:D.id,icon:D.icon,label:D.title,parent:D.in},classes:"node-group"})})}t(rr,"addGroups");function ir(w,R){w.forEach((D)=>{let{lhsId:v,rhsId:f,lhsInto:o,lhsGroup:n,rhsInto:a,lhsDir:u,rhsDir:r,rhsGroup:y,title:i}=D,e=Ye(D.lhsDir,D.rhsDir)?"segments":"straight",g={id:`${v}-${f}`,label:i,source:v,sourceDir:u,sourceArrow:o,sourceGroup:n,sourceEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%",target:f,targetDir:r,targetArrow:a,targetGroup:y,targetEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%"};R.add({group:"edges",data:g,classes:e})})}t(ir,"addEdges");function nr(w,R,D,v=[]){let f=t((e,g)=>{let d=new Map;for(let[c,x]of e.entries()){let T=`${c}`,N=0,O=[...x.entries()];if(O.length===1){d.set(T,O[0][1]);continue}for(let X=0;X<O.length-1;X++)for(let I=X+1;I<O.length;I++){let[V,_]=O[X],[Q,lt]=O[I];if(D.get(qe(V,Q))===g)d.set(T,[...d.get(T)??[],..._,...lt]);else if(V==="default"||Q==="default")d.set(T,[...d.get(T)??[],..._,...lt]);else{let tt=`${T}-${N++}`;d.set(tt,_);let s=`${T}-${N++}`;d.set(s,lt)}}}return d},"flattenAlignments"),o=R.map((e)=>{let g=new Map,d=new Map;return e.forEach(([c,x],T)=>{let N=w.getNode(T)?.in??"default",O=g.get(x)??new Map;if(!g.has(x))g.set(x,O);let X=d.get(c)??new Map;if(!d.has(c))d.set(c,X);for(let I of[O,X]){let V=I.get(N)??[];if(!I.has(N))I.set(N,V);V.push(T)}}),{horiz:[...f(g,"horizontal").values()].filter((c)=>c.length>1),vert:[...f(d,"vertical").values()].filter((c)=>c.length>1)}}),[n,a]=o.reduce(([e,g],{horiz:d,vert:c})=>[[...e,...d],[...g,...c]],[[],[]]),u=new Set;v.forEach((e)=>e.members.forEach((g)=>u.add(g)));let r=t((e)=>e.filter((g)=>!g.some((d)=>u.has(d))),"dropOverlapping"),y=r(n),i=r(a);return v.forEach((e)=>{if(e.members.length<2)return;if(e.direction==="row")y.push([...e.members]);else i.push([...e.members])}),{horizontal:y,vertical:i}}t(nr,"getAlignments");function ar(w,R,D=[]){let v=[],f=R.getConfigField("iconSize"),o=R.getConfigField("idealEdgeLengthMultiplier"),n=o*f,a=new Set;D.forEach((y)=>{for(let i=0;i<y.members.length-1;i++){let e=y.members[i],g=y.members[i+1];if(a.add(`${e}|${g}`),a.add(`${g}|${e}`),y.direction==="row")v.push({left:e,right:g,gap:n});else v.push({top:e,bottom:g,gap:n})}});let u=t((y)=>`${y[0]},${y[1]}`,"posToStr"),r=t((y)=>y.split(",").map((i)=>parseInt(i)),"strToPos");return w.forEach((y)=>{let i=new Map([...y.entries()].map(([c,x])=>[u(x),c])),e=[u([0,0])],g={},d={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(e.length>0){let c=e.shift();if(c){g[c]=1;let x=i.get(c);if(x){let T=r(c);Object.entries(d).forEach(([N,O])=>{let X=u([T[0]+O[0],T[1]+O[1]]),I=i.get(X);if(I&&!g[X]){if(e.push(X),a.has(`${x}|${I}`))return;v.push({[Be[N]]:I,[Be[hr(N)]]:x,gap:o*f})}})}}}}),v}t(ar,"getRelativeConstraints");function or(w,R,D,v,f,{spatialMaps:o,groupAlignments:n}){return new Promise((a)=>{let u=h("body").append("div").attr("id","cy").attr("style","display:none"),r=$r({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[0.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${f.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${f.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});u.remove(),rr(D,r),_e(w,r,f),tr(R,r,f),ir(v,r);let y=f.getLayoutHints(),i=nr(f,o,n,y),e=ar(o,f,y),g=f.getConfigField("iconSize"),d=f.getConfigField("idealEdgeLengthMultiplier")*g,c=0.5*g,x=f.getConfigField("edgeElasticity"),T=f.getConfigField("seed"),N=r.layout({name:"fcose",quality:"proof",randomize:f.getConfigField("randomize"),nodeSeparation:f.getConfigField("nodeSeparation"),numIter:f.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(O){let[X,I]=O.connectedNodes(),{parent:V}=me(X),{parent:_}=me(I);return V===_?d:c},edgeElasticity(O){let[X,I]=O.connectedNodes(),{parent:V}=me(X),{parent:_}=me(I);return V===_?x:0.001},alignmentConstraint:i,relativePlacementConstraint:e});N.one("layoutstop",()=>{function O(X,I,V,_){let Q,lt,{x:P,y:tt}=X,{x:s,y:L}=I;lt=(_-tt+(P-V)*(tt-L)/(P-s))/Math.sqrt(1+Math.pow((tt-L)/(P-s),2)),Q=Math.sqrt(Math.pow(_-tt,2)+Math.pow(V-P,2)-Math.pow(lt,2));let E=Math.sqrt(Math.pow(s-P,2)+Math.pow(L-tt,2));Q=Q/E;let A=(s-P)*(_-tt)-(L-tt)*(V-P);switch(!0){case A>=0:A=1;break;case A<0:A=-1;break}let m=(s-P)*(V-P)+(L-tt)*(_-tt);switch(!0){case m>=0:m=1;break;case m<0:m=-1;break}return lt=Math.abs(lt)*A,Q=Q*m,{distances:lt,weights:Q}}t(O,"getSegmentWeights"),r.startBatch();for(let X of Object.values(r.edges()))if(X.data?.()){let{x:I,y:V}=X.source().position(),{x:_,y:Q}=X.target().position();if(I!==_&&V!==Q){let lt=X.sourceEndpoint(),P=X.targetEndpoint(),{sourceDir:tt}=Qe(X),[s,L]=he(tt)?[lt.x,P.y]:[P.x,lt.y],{weights:E,distances:A}=O(lt,P,s,L);X.style("segment-distances",A),X.style("segment-weights",E)}}r.endBatch(),Ue(T,()=>N.run())});try{Ue(T,()=>N.run())}catch(O){if(O instanceof RangeError&&O.message.includes("Invalid array length"))throw Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.");throw O}r.ready((O)=>{l.info("Ready",O),a(r)})})}t(or,"layoutArchitecture");var Cr=t(async(w,R,D,v)=>{let f=v.db;f.setDiagramId(R);let o=f.getServices(),n=f.getJunctions(),a=f.getGroups(),u=f.getEdges(),r=f.getDataStructures(),y=pe(R),i=y.append("g");i.attr("class","architecture-edges");let e=y.append("g");e.attr("class","architecture-services");let g=y.append("g");g.attr("class","architecture-groups"),await wr(f,e,o,R),Mr(f,e,n,R);let d=await or(o,n,a,u,f,r);await Nr(i,d,f,R),await Lr(g,d,f,R),er(f,d),Ur(void 0,y,f.getConfigField("padding"),f.getConfigField("useMaxWidth"))},"draw"),Ar={draw:Cr},Xr={parser:Ke,get db(){return new Je},renderer:Ar,styles:Tr};export{Xr as diagram};
|
|
32
|
+
`,"getStyles"),Tr=Er;function Ge(w,I){if(w===0)return I();let A=Math.random,v=w>>>0;Math.random=function(){v=v+1831565813>>>0;let f=v;return f=Math.imul(f^f>>>15,f|1),f^=f+Math.imul(f^f>>>7,f|61),((f^f>>>14)>>>0)/4294967296};try{return I()}finally{Math.random=A}}t(Ge,"withSeededRandom");var ve=t((w)=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${w}</g>`,"wrapIcon"),Ne={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:ve('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:ve('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:ve('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:ve('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:ve('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:hg,blank:{body:ve("")}}},Nr=t(async function(w,I,A,v){let f=A.getConfigField("padding"),o=A.getConfigField("iconSize"),n=o/2,a=o/6,u=a/2;await Promise.all(I.edges().map(async(r)=>{let{source:y,sourceDir:i,sourceArrow:e,sourceGroup:g,target:d,targetDir:c,targetArrow:O,targetGroup:T,label:N}=Qe(r),{x:D,y:X}=r[0].sourceEndpoint(),{x,y:V}=r[0].midpoint(),{x:_,y:Q}=r[0].targetEndpoint(),lt=f+4;if(g)if(_t(i))D+=i==="L"?-lt:lt;else X+=i==="T"?-lt:lt+18;if(T)if(_t(c))_+=c==="L"?-lt:lt;else Q+=c==="T"?-lt:lt+18;if(!g&&A.getNode(y)?.type==="junction")if(_t(i))D+=i==="L"?n:-n;else X+=i==="T"?n:-n;if(!T&&A.getNode(d)?.type==="junction")if(_t(c))_+=c==="L"?n:-n;else Q+=c==="T"?n:-n;if(r[0]._private.rscratch){let b=w.insert("g");if(b.insert("path").attr("d",`M ${D},${X} L ${x},${V} L${_},${Q} `).attr("class","edge").attr("id",`${v}-${Qn(y,d,{prefix:"L"})}`),e){let tt=_t(i)?we[i](D,a):D-u,s=he(i)?we[i](X,a):X-u;b.insert("polygon").attr("points",Be[i](a)).attr("transform",`translate(${tt},${s})`).attr("class","arrow")}if(O){let tt=_t(c)?we[c](_,a):_-u,s=he(c)?we[c](Q,a):Q-u;b.insert("polygon").attr("points",Be[c](a)).attr("transform",`translate(${tt},${s})`).attr("class","arrow")}if(N){let tt=!Ue(i,c)?_t(i)?"X":"Y":"XY",s=0;if(tt==="X")s=Math.abs(D-_);else if(tt==="Y")s=Math.abs(X-Q)/1.5;else s=Math.abs(D-_)/2;let L=b.append("g");if(await mn(L,N,{useHtmlLabels:!1,width:s,classes:"architecture-service-label"},p()),L.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),tt==="X")L.attr("transform","translate("+x+", "+V+")");else if(tt==="Y")L.attr("transform","translate("+x+", "+V+") rotate(-90)");else if(tt==="XY"){let E=be(i,c);if(E&&lr(E)){let M=L.node().getBoundingClientRect(),[m,U]=gr(E);L.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*m*U*45})`);let S=L.node().getBoundingClientRect();L.attr("transform",`
|
|
33
|
+
translate(${x}, ${V-M.height/2})
|
|
34
|
+
translate(${m*S.width/2}, ${U*S.height/2})
|
|
35
|
+
rotate(${-1*m*U*45}, 0, ${M.height/2})
|
|
36
|
+
`)}}}}}))},"drawEdges"),Lr=t(async function(w,I,A,v){let o=A.getConfigField("padding")*0.75,n=A.getConfigField("fontSize"),u=A.getConfigField("iconSize")/2;await Promise.all(I.nodes().map(async(r)=>{let y=pe(r);if(y.type==="group"){let{h:i,w:e,x1:g,y1:d}=r.boundingBox(),c=w.append("rect");c.attr("id",`${v}-group-${y.id}`).attr("x",g+u).attr("y",d+u).attr("width",e).attr("height",i).attr("class","node-bkg");let O=w.append("g"),T=g,N=d;if(y.icon){let D=O.append("g");D.html(`<g>${await pr(y.icon,{height:o,width:o,fallbackPrefix:Ne.prefix})}</g>`),D.attr("transform","translate("+(T+u+1)+", "+(N+u+1)+")"),T+=o,N+=n/2-1-2}if(y.label){let D=O.append("g");await mn(D,y.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},p()),D.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),D.attr("transform","translate("+(T+u+4)+", "+(N+u+2)+")")}A.setElementForId(y.id,c)}}))},"drawGroups"),wr=t(async function(w,I,A,v){let f=p();for(let o of A){let n=I.append("g"),a=w.getConfigField("iconSize");if(o.title){let i=n.append("g");await mn(i,o.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},f),i.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),i.attr("transform","translate("+a/2+", "+a+")")}let u=n.append("g");if(o.icon)u.html(`<g>${await pr(o.icon,{height:a,width:a,fallbackPrefix:Ne.prefix})}</g>`);else if(o.iconText){u.html(`<g>${await pr("blank",{height:a,width:a,fallbackPrefix:Ne.prefix})}</g>`);let g=u.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(ee(o.iconText,f)),d=parseInt(window.getComputedStyle(g.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;g.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/d)};`)}else u.append("path").attr("class","node-bkg").attr("id",`${v}-node-${o.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);n.attr("id",`${v}-service-${o.id}`).attr("class","architecture-service");let{width:r,height:y}=n.node().getBBox();o.width=r,o.height=y,w.setElementForId(o.id,n)}return 0},"drawServices"),Mr=t(function(w,I,A,v){A.forEach((f)=>{let o=I.append("g"),n=w.getConfigField("iconSize");o.append("g").append("rect").attr("id",`${v}-node-${f.id}`).attr("fill-opacity","0").attr("width",n).attr("height",n),o.attr("class","architecture-junction");let{width:u,height:r}=o._groups[0][0].getBBox();o.width=u,o.height=r,w.setElementForId(f.id,o)})},"drawJunctions");Hi([{name:Ne.prefix,icons:Ne}]);jr.use(je.default);function _e(w,I,A){w.forEach((v)=>{I.add({group:"nodes",data:{type:"service",id:v.id,icon:v.icon,label:v.title,parent:v.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-service"})})}t(_e,"addServices");function tr(w,I,A){w.forEach((v)=>{I.add({group:"nodes",data:{type:"junction",id:v.id,parent:v.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-junction"})})}t(tr,"addJunctions");function er(w,I){I.nodes().map((A)=>{let v=pe(A);if(v.type==="group")return;v.x=A.position().x,v.y=A.position().y,w.getElementById(v.id).attr("transform","translate("+(v.x||0)+","+(v.y||0)+")")})}t(er,"positionNodes");function rr(w,I){w.forEach((A)=>{I.add({group:"nodes",data:{type:"group",id:A.id,icon:A.icon,label:A.title,parent:A.in},classes:"node-group"})})}t(rr,"addGroups");function ir(w,I){w.forEach((A)=>{let{lhsId:v,rhsId:f,lhsInto:o,lhsGroup:n,rhsInto:a,lhsDir:u,rhsDir:r,rhsGroup:y,title:i}=A,e=Ue(A.lhsDir,A.rhsDir)?"segments":"straight",g={id:`${v}-${f}`,label:i,source:v,sourceDir:u,sourceArrow:o,sourceGroup:n,sourceEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%",target:f,targetDir:r,targetArrow:a,targetGroup:y,targetEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%"};I.add({group:"edges",data:g,classes:e})})}t(ir,"addEdges");function nr(w,I,A,v=[]){let f=t((e,g)=>{let d=new Map;for(let[c,O]of e.entries()){let T=`${c}`,N=0,D=[...O.entries()];if(D.length===1){d.set(T,D[0][1]);continue}for(let X=0;X<D.length-1;X++)for(let x=X+1;x<D.length;x++){let[V,_]=D[X],[Q,lt]=D[x];if(A.get(qe(V,Q))===g)d.set(T,[...d.get(T)??[],..._,...lt]);else if(V==="default"||Q==="default")d.set(T,[...d.get(T)??[],..._,...lt]);else{let tt=`${T}-${N++}`;d.set(tt,_);let s=`${T}-${N++}`;d.set(s,lt)}}}return d},"flattenAlignments"),o=I.map((e)=>{let g=new Map,d=new Map;return e.forEach(([c,O],T)=>{let N=w.getNode(T)?.in??"default",D=g.get(O)??new Map;if(!g.has(O))g.set(O,D);let X=d.get(c)??new Map;if(!d.has(c))d.set(c,X);for(let x of[D,X]){let V=x.get(N)??[];if(!x.has(N))x.set(N,V);V.push(T)}}),{horiz:[...f(g,"horizontal").values()].filter((c)=>c.length>1),vert:[...f(d,"vertical").values()].filter((c)=>c.length>1)}}),[n,a]=o.reduce(([e,g],{horiz:d,vert:c})=>[[...e,...d],[...g,...c]],[[],[]]),u=new Set;v.forEach((e)=>e.members.forEach((g)=>u.add(g)));let r=t((e)=>e.filter((g)=>!g.some((d)=>u.has(d))),"dropOverlapping"),y=r(n),i=r(a);return v.forEach((e)=>{if(e.members.length<2)return;if(e.direction==="row")y.push([...e.members]);else i.push([...e.members])}),{horizontal:y,vertical:i}}t(nr,"getAlignments");function ar(w,I,A=[]){let v=[],f=I.getConfigField("iconSize"),o=I.getConfigField("idealEdgeLengthMultiplier"),n=o*f,a=new Set;A.forEach((y)=>{for(let i=0;i<y.members.length-1;i++){let e=y.members[i],g=y.members[i+1];if(a.add(`${e}|${g}`),a.add(`${g}|${e}`),y.direction==="row")v.push({left:e,right:g,gap:n});else v.push({top:e,bottom:g,gap:n})}});let u=t((y)=>`${y[0]},${y[1]}`,"posToStr"),r=t((y)=>y.split(",").map((i)=>parseInt(i)),"strToPos");return w.forEach((y)=>{let i=new Map([...y.entries()].map(([c,O])=>[u(O),c])),e=[u([0,0])],g={},d={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(e.length>0){let c=e.shift();if(c){g[c]=1;let O=i.get(c);if(O){let T=r(c);Object.entries(d).forEach(([N,D])=>{let X=u([T[0]+D[0],T[1]+D[1]]),x=i.get(X);if(x&&!g[X]){if(e.push(X),a.has(`${O}|${x}`))return;v.push({[$e[N]]:x,[$e[hr(N)]]:O,gap:o*f})}})}}}}),v}t(ar,"getRelativeConstraints");function or(w,I,A,v,f,{spatialMaps:o,groupAlignments:n}){return new Promise((a)=>{let u=h("body").append("div").attr("id","cy").attr("style","display:none"),r=jr({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[0.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${f.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${f.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});u.remove(),rr(A,r),_e(w,r,f),tr(I,r,f),ir(v,r);let y=f.getLayoutHints(),i=nr(f,o,n,y),e=ar(o,f,y),g=f.getConfigField("iconSize"),d=f.getConfigField("idealEdgeLengthMultiplier")*g,c=0.5*g,O=f.getConfigField("edgeElasticity"),T=f.getConfigField("seed"),N=r.layout({name:"fcose",quality:"proof",randomize:f.getConfigField("randomize"),nodeSeparation:f.getConfigField("nodeSeparation"),numIter:f.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(D){let[X,x]=D.connectedNodes(),{parent:V}=pe(X),{parent:_}=pe(x);return V===_?d:c},edgeElasticity(D){let[X,x]=D.connectedNodes(),{parent:V}=pe(X),{parent:_}=pe(x);return V===_?O:0.001},alignmentConstraint:i,relativePlacementConstraint:e});N.one("layoutstop",()=>{function D(X,x,V,_){let Q,lt,{x:b,y:tt}=X,{x:s,y:L}=x;lt=(_-tt+(b-V)*(tt-L)/(b-s))/Math.sqrt(1+Math.pow((tt-L)/(b-s),2)),Q=Math.sqrt(Math.pow(_-tt,2)+Math.pow(V-b,2)-Math.pow(lt,2));let E=Math.sqrt(Math.pow(s-b,2)+Math.pow(L-tt,2));Q=Q/E;let M=(s-b)*(_-tt)-(L-tt)*(V-b);switch(!0){case M>=0:M=1;break;case M<0:M=-1;break}let m=(s-b)*(V-b)+(L-tt)*(_-tt);switch(!0){case m>=0:m=1;break;case m<0:m=-1;break}return lt=Math.abs(lt)*M,Q=Q*m,{distances:lt,weights:Q}}t(D,"getSegmentWeights"),r.startBatch();for(let X of Object.values(r.edges()))if(X.data?.()){let{x,y:V}=X.source().position(),{x:_,y:Q}=X.target().position();if(x!==_&&V!==Q){let lt=X.sourceEndpoint(),b=X.targetEndpoint(),{sourceDir:tt}=Qe(X),[s,L]=he(tt)?[lt.x,b.y]:[b.x,lt.y],{weights:E,distances:M}=D(lt,b,s,L);X.style("segment-distances",M),X.style("segment-weights",E)}}r.endBatch(),Ge(T,()=>N.run())});try{Ge(T,()=>N.run())}catch(D){if(D instanceof RangeError&&D.message.includes("Invalid array length"))throw Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.");throw D}r.ready((D)=>{l.info("Ready",D),a(r)})})}t(or,"layoutArchitecture");var Cr=t(async(w,I,A,v)=>{let f=v.db;f.setDiagramId(I);let o=f.getServices(),n=f.getJunctions(),a=f.getGroups(),u=f.getEdges(),r=f.getDataStructures(),y=me(I),i=y.append("g");i.attr("class","architecture-edges");let e=y.append("g");e.attr("class","architecture-services");let g=y.append("g");g.attr("class","architecture-groups"),await wr(f,e,o,I),Mr(f,e,n,I);let d=await or(o,n,a,u,f,r);await Nr(i,d,f,I),await Lr(g,d,f,I),er(f,d),Hr(void 0,y,f.getConfigField("padding"),f.getConfigField("useMaxWidth"))},"draw"),Ar={draw:Cr},Yr={parser:Ke,get db(){return new Je},renderer:Ar,styles:Tr};export{Yr as diagram};
|