@miles-huang/cove 0.0.0-stage → 0.1.2
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/.env.example +14 -0
- package/README.md +103 -2
- package/bin/cove.js +15 -0
- package/package.json +31 -4
- package/server/agent/messages.js +126 -0
- package/server/agent/prompt.js +9 -0
- package/server/agent/provider-store.js +667 -0
- package/server/agent/runtime.js +134 -0
- package/server/agent/session-hub.js +647 -0
- package/server/app.js +113 -0
- package/server/auth.js +96 -0
- package/server/cli.js +174 -0
- package/server/config.js +48 -0
- package/server/index.js +22 -0
- package/server/kernel/registry.js +52 -0
- package/server/kernel/types.js +1 -0
- package/server/plugins/index.js +10 -0
- package/server/plugins/persona.js +13 -0
- package/server/plugins/time-context.js +18 -0
- package/server/routes/auth.js +128 -0
- package/server/routes/meta.js +17 -0
- package/server/routes/providers.js +107 -0
- package/server/routes/sessions.js +190 -0
- package/server/server.js +74 -0
- package/shared/protocol.js +44 -0
- package/web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/web/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/web/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/web/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/web/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/web/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/web/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/web/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/web/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/web/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/web/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/web/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/web/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/web/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/web/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/web/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/web/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/web/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/web/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/web/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/web/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/web/assets/abap-BdImnpbu.js +1 -0
- package/web/assets/abnfDiagram-VCTEODGH-BvfDeUDt.js +1 -0
- package/web/assets/actionscript-3-B3316cI-.js +1 -0
- package/web/assets/ada-BIOnG6TC.js +1 -0
- package/web/assets/ahk-BrbAagtO.js +1 -0
- package/web/assets/ahk2-8Zs4aa1G.js +1 -0
- package/web/assets/andromeeda-C4gqWexZ.js +1 -0
- package/web/assets/angular-html-D_SYSyRt.js +1 -0
- package/web/assets/angular-ts-D3VmPfRk.js +1 -0
- package/web/assets/apache-Pmp26Uib.js +1 -0
- package/web/assets/apex-DhZFqWV2.js +1 -0
- package/web/assets/apl-letVarKo.js +1 -0
- package/web/assets/applescript-Co6uUVPk.js +1 -0
- package/web/assets/ara-BRHolxvo.js +1 -0
- package/web/assets/architectureDiagram-5GKGNRK7-B6x-Vdta.js +36 -0
- package/web/assets/asciidoc-CSVQ5wI8.js +1 -0
- package/web/assets/asm-D_Q5rh1f.js +1 -0
- package/web/assets/astro-DTjqU0_L.js +1 -0
- package/web/assets/aurora-x-D-2ljcwZ.js +1 -0
- package/web/assets/awk-DMzUqQB5.js +1 -0
- package/web/assets/ayu-dark-DYE7WIF3.js +1 -0
- package/web/assets/ayu-light-BA47KaF1.js +1 -0
- package/web/assets/ayu-mirage-32ctXXKs.js +1 -0
- package/web/assets/ballerina-BFfxhgS-.js +1 -0
- package/web/assets/bat-CickPsom.js +1 -0
- package/web/assets/beancount-BgSHGh8x.js +1 -0
- package/web/assets/berry-uYugtg8r.js +1 -0
- package/web/assets/bibtex-CHM0blh-.js +1 -0
- package/web/assets/bicep-Bmn6On1c.js +1 -0
- package/web/assets/bird2-Bx8U0n9b.js +1 -0
- package/web/assets/blade-BwhxDVYc.js +1 -0
- package/web/assets/blockDiagram-I7D4REHJ-DSdow19J.js +129 -0
- package/web/assets/bsl-DlhNcFeZ.js +1 -0
- package/web/assets/c-BIGW1oBm.js +1 -0
- package/web/assets/c3-Dp5svz6Z.js +1 -0
- package/web/assets/c4Diagram-7LVT6UL2-DNANA_BY.js +38 -0
- package/web/assets/cadence-Bv_4Rxtq.js +1 -0
- package/web/assets/cairo-KRGpt6FW.js +1 -0
- package/web/assets/catppuccin-frappe-CZL1YF0i.js +1 -0
- package/web/assets/catppuccin-latte-DH-8KZSZ.js +1 -0
- package/web/assets/catppuccin-macchiato-B7yYVSCf.js +1 -0
- package/web/assets/catppuccin-mocha-Ct7hS0mc.js +1 -0
- package/web/assets/channel-CyEPAFBz.js +1 -0
- package/web/assets/chapel-DTp_pixX.js +1 -0
- package/web/assets/chunk-2Q5K7J3B-DQhKxJim.js +1 -0
- package/web/assets/chunk-5VM5RSS4-CxYuf8nJ.js +15 -0
- package/web/assets/chunk-F27PBJKO-pm7TdZp3.js +1 -0
- package/web/assets/chunk-IMKFNOWR-BOUFtEzN.js +231 -0
- package/web/assets/chunk-JWPE2WC7-AmPhkmIF.js +1 -0
- package/web/assets/chunk-POPQ4Y6H-DAjm7eYi.js +1 -0
- package/web/assets/chunk-SVP7TREG-CPIhAIng.js +88 -0
- package/web/assets/chunk-TICWLB2K-zdUNYXIa.js +206 -0
- package/web/assets/chunk-XXDRQBXY-HxMWsKyb.js +1 -0
- package/web/assets/clarity-Dn5IMItf.js +1 -0
- package/web/assets/classDiagram-ZZMXUADV-DqTY3X0j.js +1 -0
- package/web/assets/classDiagram-v2-VYDZK3BY-BSxiMdF_.js +1 -0
- package/web/assets/clojure-P80f7IUj.js +1 -0
- package/web/assets/cmake-D1j8_8rp.js +1 -0
- package/web/assets/cobol-DiPxIqjf.js +1 -0
- package/web/assets/codeowners-Bp6g37R7.js +1 -0
- package/web/assets/codeql-DsOJ9woJ.js +1 -0
- package/web/assets/coffee-Ch7k5sss.js +1 -0
- package/web/assets/common-lisp-Cg-RD9OK.js +1 -0
- package/web/assets/coq-BqXF5kFF.js +1 -0
- package/web/assets/cose-bilkent-JH36ORCC-lYmJLW2h.js +1 -0
- package/web/assets/cpp-B1Bc8hPr.js +1 -0
- package/web/assets/crystal-BkfSfsaI.js +1 -0
- package/web/assets/csharp-B_TYUkTI.js +1 -0
- package/web/assets/css-Z72CF80r.js +1 -0
- package/web/assets/csv-fuZLfV_i.js +1 -0
- package/web/assets/cue-D82EKSYY.js +1 -0
- package/web/assets/cynefin-OW5HDTMX-C8UcJePz.js +178 -0
- package/web/assets/cynefinDiagram-5FMLGOSQ-Dt1tZqyf.js +62 -0
- package/web/assets/cypher-COkxafJQ.js +1 -0
- package/web/assets/cytoscape.esm-Di_ihNId.js +332 -0
- package/web/assets/d-85-TOEBH.js +1 -0
- package/web/assets/d3-scale-DlYbYB9H.js +1 -0
- package/web/assets/dagre-GXQ25YYZ-Y0qiXkMO.js +4 -0
- package/web/assets/dark-plus-C3mMm8J8.js +1 -0
- package/web/assets/dart-CtKP3W-j.js +1 -0
- package/web/assets/dax-CEL-wOlO.js +1 -0
- package/web/assets/desktop-BmXAJ9_W.js +1 -0
- package/web/assets/diagram-S7CK7UJ4-BtcdW_SA.js +30 -0
- package/web/assets/diagram-UQ7AKVKN-DMwC8JNI.js +41 -0
- package/web/assets/diagram-VSXAHHWV-BVU0Bm6u.js +3 -0
- package/web/assets/diagram-VX7I27RA-BYlx-nH2.js +24 -0
- package/web/assets/diagram-Z3DM3KII-C_oAUIPq.js +24 -0
- package/web/assets/diff-D97Zzqfu.js +1 -0
- package/web/assets/docker-BcOcwvcX.js +1 -0
- package/web/assets/dotenv-De0Btta0.js +1 -0
- package/web/assets/dracula-BzJJZx-M.js +1 -0
- package/web/assets/dracula-soft-BXkSAIEj.js +1 -0
- package/web/assets/dream-maker-BtqSS_iP.js +1 -0
- package/web/assets/ebnfDiagram-PWID7BFC-D9eTa0_d.js +1 -0
- package/web/assets/edge-CCtj-YOb.js +1 -0
- package/web/assets/elixir-C_cCwZu9.js +1 -0
- package/web/assets/elm-Bkz02s37.js +1 -0
- package/web/assets/emacs-lisp-DaIrSCgJ.js +1 -0
- package/web/assets/erDiagram-RLTQ6QDP-Cn00lD_I.js +99 -0
- package/web/assets/erb-BRUY13DM.js +1 -0
- package/web/assets/erlang-DsQrWhSR.js +1 -0
- package/web/assets/everforest-dark-BgDCqdQA.js +1 -0
- package/web/assets/everforest-light-C8M2exoo.js +1 -0
- package/web/assets/fennel-BYunw83y.js +1 -0
- package/web/assets/fish-BvzEVeQv.js +1 -0
- package/web/assets/flowDiagram-HODETNUW-CBjFObVm.js +168 -0
- package/web/assets/fluent-C4IJs8-o.js +1 -0
- package/web/assets/fortran-fixed-form-CkoXwp7k.js +1 -0
- package/web/assets/fortran-free-form-BxgE0vQu.js +1 -0
- package/web/assets/fsharp-CXgrBDvD.js +1 -0
- package/web/assets/ganttDiagram-EL5Y4UJY-BrJFpYUI.js +292 -0
- package/web/assets/gdresource-TyuKm33G.js +1 -0
- package/web/assets/gdscript-DqcFQ5yU.js +1 -0
- package/web/assets/gdshader-DkwncUOv.js +1 -0
- package/web/assets/genie-D0YGMca9.js +1 -0
- package/web/assets/gherkin-DyxjwDmM.js +1 -0
- package/web/assets/git-commit-F4YmCXRG.js +1 -0
- package/web/assets/git-rebase-r7XF79zn.js +1 -0
- package/web/assets/gitGraphDiagram-WWUBYQGX-CgDCGY4x.js +106 -0
- package/web/assets/github-dark-DHJKELXO.js +1 -0
- package/web/assets/github-dark-default-Cuk6v7N8.js +1 -0
- package/web/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
- package/web/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
- package/web/assets/github-light-DAi9KRSo.js +1 -0
- package/web/assets/github-light-default-D7oLnXFd.js +1 -0
- package/web/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
- package/web/assets/gleam-BspZqrRM.js +1 -0
- package/web/assets/glimmer-js-CaqPms03.js +1 -0
- package/web/assets/glimmer-ts-Cjj4HdsC.js +1 -0
- package/web/assets/glsl-DplSGwfg.js +1 -0
- package/web/assets/gn-8iBmfbXw.js +1 -0
- package/web/assets/gnuplot-DdkO51Og.js +1 -0
- package/web/assets/go-C27-OAKa.js +1 -0
- package/web/assets/graphql-ChdNCCLP.js +1 -0
- package/web/assets/groovy-gcz8RCvz.js +1 -0
- package/web/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
- package/web/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
- package/web/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
- package/web/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
- package/web/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
- package/web/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
- package/web/assets/hack-C5OnKm5w.js +1 -0
- package/web/assets/haml-GN_XdMnF.js +1 -0
- package/web/assets/handlebars-KATH2Zxj.js +1 -0
- package/web/assets/haskell-Df6bDoY_.js +1 -0
- package/web/assets/haxe-CfZj7gIn.js +1 -0
- package/web/assets/hcl-BWvSN4gD.js +1 -0
- package/web/assets/highlighted-body-6RAV4W6J-BaouqEZW.js +1 -0
- package/web/assets/hjson-D5-asLiD.js +1 -0
- package/web/assets/hlsl-D3lLCCz7.js +1 -0
- package/web/assets/horizon-BUw7H-hv.js +1 -0
- package/web/assets/horizon-bright-CUuTKBJd.js +1 -0
- package/web/assets/houston-DnULxvSX.js +1 -0
- package/web/assets/html-BlS82ilI.js +1 -0
- package/web/assets/html-derivative-iznVdfoQ.js +1 -0
- package/web/assets/http-BlVO0h-L.js +1 -0
- package/web/assets/hurl-wuWS7Vud.js +1 -0
- package/web/assets/hxml-2-FPmUDs.js +1 -0
- package/web/assets/hy-DFXneXwc.js +1 -0
- package/web/assets/imba-DGztddWO.js +1 -0
- package/web/assets/index-4qPcqjHt.js +1259 -0
- package/web/assets/index-5AGKaJhL.css +1 -0
- package/web/assets/infoDiagram-27XIBGKW-4GAuy2r7.js +2 -0
- package/web/assets/ini-BEwlwnbL.js +1 -0
- package/web/assets/ishikawaDiagram-5VMMS53U-CDZ9dPA6.js +70 -0
- package/web/assets/java-CylS5w8V.js +1 -0
- package/web/assets/javascript-wDzz0qaB.js +1 -0
- package/web/assets/jinja-D9YHlL8E.js +1 -0
- package/web/assets/jison-wvAkD_A8.js +1 -0
- package/web/assets/journeyDiagram-3NMN7TZE-D0uXeMh-.js +139 -0
- package/web/assets/json-Cp-IABpG.js +1 -0
- package/web/assets/json5-C9tS-k6U.js +1 -0
- package/web/assets/jsonc-Des-eS-w.js +1 -0
- package/web/assets/jsonl-DcaNXYhu.js +1 -0
- package/web/assets/jsonnet-DFQXde-d.js +1 -0
- package/web/assets/jssm-C2t-YnRu.js +1 -0
- package/web/assets/jsx-g9-lgVsj.js +1 -0
- package/web/assets/julia-rfGPo8aM.js +1 -0
- package/web/assets/just-MNqw5g8A.js +1 -0
- package/web/assets/kanagawa-dragon-BuwD2xS4.js +1 -0
- package/web/assets/kanagawa-lotus-C3DzagqV.js +1 -0
- package/web/assets/kanagawa-wave-DFGoQZhC.js +1 -0
- package/web/assets/kanban-definition-UXKFOSKX-C4H7MD6w.js +89 -0
- package/web/assets/kdl-DV7GczEv.js +1 -0
- package/web/assets/kotlin-BdnUsdx6.js +1 -0
- package/web/assets/kusto-wEQ09or8.js +1 -0
- package/web/assets/laserwave-DUszq2jm.js +1 -0
- package/web/assets/latex-Do8IdHCR.js +1 -0
- package/web/assets/layout-BFfV8fTs.js +1 -0
- package/web/assets/lean-BZvkOJ9d.js +1 -0
- package/web/assets/less-B1dDrJ26.js +1 -0
- package/web/assets/light-plus-B7mTdjB0.js +1 -0
- package/web/assets/liquid-1M0BrJcN.js +1 -0
- package/web/assets/llvm-BZoOZj88.js +1 -0
- package/web/assets/log-2UxHyX5q.js +1 -0
- package/web/assets/logo-BtOb2qkB.js +1 -0
- package/web/assets/lua-BaeVxFsk.js +1 -0
- package/web/assets/luau-nOZpfvQi.js +1 -0
- package/web/assets/make-CHLpvVh8.js +1 -0
- package/web/assets/markdown-Cvjx9yec.js +1 -0
- package/web/assets/marko-C-2cCTH6.js +1 -0
- package/web/assets/material-theme-D5KoaKCx.js +1 -0
- package/web/assets/material-theme-darker-BfHTSMKl.js +1 -0
- package/web/assets/material-theme-lighter-B0m2ddpp.js +1 -0
- package/web/assets/material-theme-ocean-CyktbL80.js +1 -0
- package/web/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
- package/web/assets/matlab-D7o27uSR.js +1 -0
- package/web/assets/mdc-DnYHWGKv.js +1 -0
- package/web/assets/mdx-Cmh6b_Ma.js +1 -0
- package/web/assets/mermaid-CQcHuHx7.js +1 -0
- package/web/assets/min-dark-CafNBF8u.js +1 -0
- package/web/assets/min-light-CTRr51gU.js +1 -0
- package/web/assets/mindmap-definition-YA3MSWOX-Dd7Obl6F.js +96 -0
- package/web/assets/mipsasm-CKIfxQSi.js +1 -0
- package/web/assets/mojo-DJz3ZmWd.js +1 -0
- package/web/assets/monokai-CR4piiQ-.js +1 -0
- package/web/assets/moonbit-Bag4Rp_g.js +1 -0
- package/web/assets/move-el3G9tDJ.js +1 -0
- package/web/assets/narrat-DRg8JJMk.js +1 -0
- package/web/assets/nextflow-BCxp2Aob.js +1 -0
- package/web/assets/nextflow-groovy-CedDknKX.js +1 -0
- package/web/assets/nginx-CSSVpBpD.js +1 -0
- package/web/assets/night-owl-C39BiMTA.js +1 -0
- package/web/assets/night-owl-light-CMTm3GFP.js +1 -0
- package/web/assets/nim-B40a1DJO.js +1 -0
- package/web/assets/nix-CwoSXNpI.js +1 -0
- package/web/assets/nord-Ddv68eIx.js +1 -0
- package/web/assets/nsis-BlV79W_Q.js +1 -0
- package/web/assets/nushell-BXD5iret.js +1 -0
- package/web/assets/objective-c-DXmwc3jG.js +1 -0
- package/web/assets/objective-cpp-CLxacb5B.js +1 -0
- package/web/assets/ocaml-C0hk2d4L.js +1 -0
- package/web/assets/odin-BBf5iR-q.js +1 -0
- package/web/assets/one-dark-pro-CxGP3dtY.js +1 -0
- package/web/assets/one-light-C3Wv6jpd.js +1 -0
- package/web/assets/openscad-C4EeE6gA.js +1 -0
- package/web/assets/org-CZpqap1G.js +1 -0
- package/web/assets/pascal-D93ZcfNL.js +1 -0
- package/web/assets/pegDiagram-XKGWAZYB-nDep-Xjv.js +1 -0
- package/web/assets/perl-R_Lrwz4r.js +1 -0
- package/web/assets/php-zqm3lk1U.js +1 -0
- package/web/assets/pieDiagram-E7YTZNPT-C8783QQe.js +39 -0
- package/web/assets/pkl-u5AG7uiY.js +1 -0
- package/web/assets/plastic-3e1v2bzS.js +1 -0
- package/web/assets/plsql-ChMvpjG-.js +1 -0
- package/web/assets/po-BTJTHyun.js +1 -0
- package/web/assets/poimandres-CS3Unz2-.js +1 -0
- package/web/assets/polar-C0HS_06l.js +1 -0
- package/web/assets/postcss-CXtECtnM.js +1 -0
- package/web/assets/powerquery-CEu0bR-o.js +1 -0
- package/web/assets/powershell-Dd0kTxKP.js +1 -0
- package/web/assets/prisma-Vru482bI.js +1 -0
- package/web/assets/prolog-CbFg5uaA.js +1 -0
- package/web/assets/proto-C7zT0LnQ.js +1 -0
- package/web/assets/pug-BLo06W3w.js +1 -0
- package/web/assets/puppet-BMWR74SV.js +1 -0
- package/web/assets/purescript-CklMAg4u.js +1 -0
- package/web/assets/python-B6aJPvgy.js +1 -0
- package/web/assets/qml-3beO22l8.js +1 -0
- package/web/assets/qmldir-C8lEn-DE.js +1 -0
- package/web/assets/qss-IeuSbFQv.js +1 -0
- package/web/assets/quadrantDiagram-AXDQQJYC-CH5o8mIt.js +7 -0
- package/web/assets/r-Cf5RLm7j.js +1 -0
- package/web/assets/racket-BqYA7rlc.js +1 -0
- package/web/assets/railroadDiagram-O6MQD6OU-QPxQi08o.js +1 -0
- package/web/assets/raku-DXvB9xmW.js +1 -0
- package/web/assets/razor-AHpzBwfu.js +1 -0
- package/web/assets/rbs-CpoqiR4B.js +1 -0
- package/web/assets/red-DMbB5_pp.js +1 -0
- package/web/assets/reg-C-SQnVFl.js +1 -0
- package/web/assets/regexp-CDVJQ6XC.js +1 -0
- package/web/assets/rel-C3B-1QV4.js +1 -0
- package/web/assets/requirementDiagram-BXWQKSXE-DVr0s9y9.js +84 -0
- package/web/assets/riscv-BM1_JUlF.js +1 -0
- package/web/assets/ron-D8l8udqQ.js +1 -0
- package/web/assets/rose-pine-5qJOZa0Y.js +1 -0
- package/web/assets/rose-pine-dawn-zx0QlTCp.js +1 -0
- package/web/assets/rose-pine-moon-C9pEdX9L.js +1 -0
- package/web/assets/rosmsg-BJDFO7_C.js +1 -0
- package/web/assets/rst-DJNgKBWS.js +1 -0
- package/web/assets/ruby-BSIpSb0K.js +1 -0
- package/web/assets/rust-DPvrY3IQ.js +1 -0
- package/web/assets/sankeyDiagram-P5KCCOFB-Bq3TJeq8.js +40 -0
- package/web/assets/sas-BGn39htG.js +1 -0
- package/web/assets/sass-Cj5Yp3dK.js +1 -0
- package/web/assets/scala-CqE71os6.js +1 -0
- package/web/assets/scheme-C98Dy4si.js +1 -0
- package/web/assets/scss-Cw6XMfVs.js +1 -0
- package/web/assets/sdbl-DVxCFoDh.js +1 -0
- package/web/assets/sequenceDiagram-WJ2MYXX4-VWpvqhZf.js +162 -0
- package/web/assets/shaderlab-Dg9Lc6iA.js +1 -0
- package/web/assets/shellscript-Yzrsuije.js +1 -0
- package/web/assets/shellsession-BADoaaVG.js +1 -0
- package/web/assets/sizeCapture-INFHLROL-1n-6h_CN.js +1 -0
- package/web/assets/slack-dark-BthQWCQV.js +1 -0
- package/web/assets/slack-ochin-DqwNpetd.js +1 -0
- package/web/assets/smalltalk-BOQMe2GC.js +1 -0
- package/web/assets/smithy-cds9vsN8.js +1 -0
- package/web/assets/snazzy-light-Bw305WKR.js +1 -0
- package/web/assets/solarized-dark-UcubFVte.js +1 -0
- package/web/assets/solarized-light-DCG28T6R.js +1 -0
- package/web/assets/solidity-DijEV5ha.js +1 -0
- package/web/assets/soy-C95mk6hV.js +1 -0
- package/web/assets/sparql-rVzFXLq3.js +1 -0
- package/web/assets/splunk-BtCnVYZw.js +1 -0
- package/web/assets/sql-DkvoVjww.js +1 -0
- package/web/assets/ssh-config-_ykCGR6B.js +1 -0
- package/web/assets/stata-DACIj5bg.js +1 -0
- package/web/assets/stateDiagram-D77RDMKH-cmZfkPUb.js +1 -0
- package/web/assets/stateDiagram-v2-MP3YSRHH-wEaM0KsS.js +1 -0
- package/web/assets/stylus-BEDo0Tqx.js +1 -0
- package/web/assets/surrealql-Cjom0U5J.js +1 -0
- package/web/assets/svelte-D84K1R2Q.js +1 -0
- package/web/assets/swift-C2oV4EkX.js +1 -0
- package/web/assets/swimlanes-42K2YHIH-BqTB27WF.js +1 -0
- package/web/assets/swimlanesDiagram-VR7AAH4N-CjIKX5n2.js +8 -0
- package/web/assets/synthwave-84-CbfX1IO0.js +1 -0
- package/web/assets/system-verilog-0hqHdDBg.js +1 -0
- package/web/assets/systemd-4A_iFExJ.js +1 -0
- package/web/assets/talonscript-CkByrt1z.js +1 -0
- package/web/assets/tasl-QIJgUcNo.js +1 -0
- package/web/assets/tcl-dwOrl1Do.js +1 -0
- package/web/assets/templ-Vpw5XpSW.js +1 -0
- package/web/assets/terraform-BETggiCN.js +1 -0
- package/web/assets/tex-D96PA37w.js +1 -0
- package/web/assets/timeline-definition-24CTP7MA--BCgTKxF.js +120 -0
- package/web/assets/tokyo-night-hegEt444.js +1 -0
- package/web/assets/toml-vGWfd6FD.js +1 -0
- package/web/assets/ts-tags-DzdQZkE0.js +1 -0
- package/web/assets/tsv-B_m7g4N7.js +1 -0
- package/web/assets/tsx-COt5Ahok.js +1 -0
- package/web/assets/turtle-BsS91CYL.js +1 -0
- package/web/assets/twig-Bu9wxGzj.js +1 -0
- package/web/assets/typescript-BPQ3VLAy.js +1 -0
- package/web/assets/typespec-ClX509-Q.js +1 -0
- package/web/assets/typst-DgI3MVa7.js +1 -0
- package/web/assets/v-BGw2Nkan.js +1 -0
- package/web/assets/vala-CsfeWuGM.js +1 -0
- package/web/assets/vb-Cu-pLBUe.js +1 -0
- package/web/assets/vennDiagram-4TSXK5OY-BJaPku01.js +34 -0
- package/web/assets/verilog-nZwndyjY.js +1 -0
- package/web/assets/vesper-DRje8inN.js +1 -0
- package/web/assets/vhdl-CeAyd5Ju.js +1 -0
- package/web/assets/viml-CJc9bBzg.js +1 -0
- package/web/assets/vitesse-black-Bkuqu6BP.js +1 -0
- package/web/assets/vitesse-dark-D0r3Knsf.js +1 -0
- package/web/assets/vitesse-light-CVO1_9PV.js +1 -0
- package/web/assets/vue-DJFFWMPK.js +1 -0
- package/web/assets/vue-html-AaS7Mt5G.js +1 -0
- package/web/assets/vue-vine-DVhaIbcH.js +1 -0
- package/web/assets/vyper-CDx5xZoG.js +1 -0
- package/web/assets/wardleyDiagram-VM6X3IG4-n2YbPRWQ.js +78 -0
- package/web/assets/wasm-Cey7Y6ql.js +1 -0
- package/web/assets/wasm-MzD3tlZU.js +1 -0
- package/web/assets/wenyan-BV7otONQ.js +1 -0
- package/web/assets/wgsl-Dx-B1_4e.js +1 -0
- package/web/assets/wikitext-BhOHFoWU.js +1 -0
- package/web/assets/wit-5i3qLPDT.js +1 -0
- package/web/assets/wolfram-lXgVvXCa.js +1 -0
- package/web/assets/xml-sdJ4AIDG.js +1 -0
- package/web/assets/xsl-DYctLLhM.js +1 -0
- package/web/assets/xychartDiagram-S5SC5T6Z-CQpktgwa.js +7 -0
- package/web/assets/yaml-Buea-lGh.js +1 -0
- package/web/assets/zenscript-DVFEvuxE.js +1 -0
- package/web/assets/zig-VOosw3JB.js +1 -0
- package/web/index.html +26 -0
- package/web/logo.jpg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=Object.freeze(JSON.parse('{"displayName":"Swift","fileTypes":["swift"],"firstLineMatch":"^#!/.*\\\\bswift","name":"swift","patterns":[{"include":"#root"}],"repository":{"async-throws":{"captures":{"1":{"name":"invalid.illegal.await-must-precede-throws.swift"},"2":{"name":"storage.modifier.exception.swift"},"3":{"name":"storage.modifier.async.swift"}},"match":"\\\\b(?:((?:throws\\\\s+|rethrows\\\\s+)async)|((?:|re)throws)|(async))\\\\b"},"attributes":{"patterns":[{"begin":"((@)available)(\\\\()","beginCaptures":{"1":{"name":"storage.modifier.attribute.swift"},"2":{"name":"punctuation.definition.attribute.swift"},"3":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"name":"meta.attribute.available.swift","patterns":[{"captures":{"1":{"name":"keyword.other.platform.os.swift"},"2":{"name":"constant.numeric.swift"}},"match":"\\\\b(swift|(?:iOS|macOS|OSX|watchOS|tvOS|visionOS|UIKitForMac)(?:ApplicationExtension)?)\\\\b(?:\\\\s+([0-9]+(?:\\\\.[0-9]+)*)\\\\b)?"},{"begin":"\\\\b((?:introduc|deprecat|obsolet)ed)\\\\s*(:)\\\\s*","beginCaptures":{"1":{"name":"keyword.other.swift"},"2":{"name":"punctuation.separator.key-value.swift"}},"end":"(?!\\\\G)","patterns":[{"match":"\\\\b[0-9]+(?:\\\\.[0-9]+)*\\\\b","name":"constant.numeric.swift"}]},{"begin":"\\\\b(message|renamed)\\\\s*(:)\\\\s*(?=\\")","beginCaptures":{"1":{"name":"keyword.other.swift"},"2":{"name":"punctuation.separator.key-value.swift"}},"end":"(?!\\\\G)","patterns":[{"include":"#literals"}]},{"captures":{"1":{"name":"keyword.other.platform.all.swift"},"2":{"name":"keyword.other.swift"},"3":{"name":"invalid.illegal.character-not-allowed-here.swift"}},"match":"(?:(\\\\*)|\\\\b(deprecated|unavailable|noasync)\\\\b)\\\\s*(.*?)(?=[),])"}]},{"begin":"((@)objc)(\\\\()","beginCaptures":{"1":{"name":"storage.modifier.attribute.swift"},"2":{"name":"punctuation.definition.attribute.swift"},"3":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"name":"meta.attribute.objc.swift","patterns":[{"captures":{"1":{"name":"invalid.illegal.missing-colon-after-selector-piece.swift"}},"match":"\\\\w*(?::(?:\\\\w*:)*(\\\\w*))?","name":"entity.name.function.swift"}]},{"begin":"(@)(?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>)","beginCaptures":{"0":{"name":"storage.modifier.attribute.swift"},"1":{"name":"punctuation.definition.attribute.swift"},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"}},"end":"(?!\\\\G\\\\()","name":"meta.attribute.swift","patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"name":"meta.arguments.attribute.swift","patterns":[{"include":"#expressions"}]}]}]},"builtin-functions":{"patterns":[{"match":"(?<=\\\\.)(?:s(?:ort(?:ed)?|plit)|contains|index|partition|f(?:i(?:lter|rst)|orEach|latMap)|with(?:MutableCharacters|CString|U(?:nsafe(?:Mutable(?:BufferPointer|Pointer(?:s|To(?:Header|Elements)))|BufferPointer)|TF8Buffer))|m(?:in|a[px]))(?=\\\\s*[({])\\\\b","name":"support.function.swift"},{"match":"(?<=\\\\.)(?:s(?:ymmetricDifference|t(?:oreBytes|arts|ride)|ortInPlace|u(?:ccessor|ffix|btract(?:ing|InPlace|WithOverflow)?)|quareRoot|amePosition)|h(?:oldsUnique(?:|OrPinned)Reference|as(?:Suf|Pre)fix)|ne(?:gated?|xt)|c(?:o(?:untByEnumerating|py(?:Bytes)?)|lamp(?:ed)?|reate)|t(?:o(?:IntMax|Opaque|UIntMax)|ake(?:R|Unr)etainedValue|r(?:uncatingRemainder|a(?:nscodedLength|ilSurrogate)))|i(?:s(?:MutableAndUniquelyReferenced(?:OrPinned)?|S(?:trictSu(?:perset(?:Of)?|bset(?:Of)?)|u(?:perset(?:Of)?|bset(?:Of)?))|Continuation|T(?:otallyOrdered|railSurrogate)|Disjoint(?:With)?|Unique(?:Reference|lyReferenced(?:OrPinned)?)|Equal|Le(?:ss(?:ThanOrEqualTo)?|adSurrogate))|n(?:sert(?:ContentsOf)?|tersect(?:ion|InPlace)?|itialize(?:Memory|From)?|dex(?:Of|ForKey)))|o(?:verlaps|bjectAt)|d(?:i(?:stance(?:To)?|vide(?:d|WithOverflow)?)|e(?:s(?:cendant|troy)|code(?:CString)?|initialize|alloc(?:ate(?:Capacity)?)?)|rop(?:First|Last))|u(?:n(?:ion(?:InPlace)?|derestimateCount|wrappedOrError)|p(?:date(?:Value)?|percased))|join(?:ed|WithSeparator)|p(?:op(?:First|Last)|ass(?:R|Unr)etained|re(?:decessor|fix))|e(?:scaped?|n(?:code|umerated?)|lementsEqual|xclusiveOr(?:InPlace)?)|f(?:orm(?:Remainder|S(?:ymmetricDifference|quareRoot)|TruncatingRemainder|In(?:tersection|dex)|Union)|latten|rom(?:CString(?:RepairingIllFormedUTF8)?|Opaque))|w(?:i(?:thMemoryRebound|dth)|rite(?:To)?)|l(?:o(?:wercased|ad)|e(?:adSurrogate|xicographical(?:Compare|lyPrecedes)))|a(?:ss(?:ign(?:(?:Backward|)From)?|umingMemoryBound)|d(?:d(?:ing(?:Product)?|Product|WithOverflow)?|vanced(?:By)?)|utorelease|ppend(?:ContentsOf)?|lloc(?:ate)?|bs)|r(?:ound(?:ed)?|e(?:serveCapacity|tain|duce|place(?:(?:R|Subr)ange)?|versed?|quest(?:Native|UniqueMutableBacking)Buffer|lease|m(?:ove(?:Range|Subrange|Value(?:ForKey)?|First|Last|A(?:tIndex|ll))?|ainder(?:WithOverflow)?)))|ge(?:nerate|t(?:Objects|Element))|m(?:in(?:imum(?:Magnitude)?|Element)|ove(?:Initialize(?:Memory|BackwardFrom|From)?|Assign(?:From)?)?|ultipl(?:y(?:WithOverflow)?|ied)|easure|a(?:ke(?:Iterator|Description)|x(?:imum(?:Magnitude)?|Element)))|bindMemory)(?=\\\\s*\\\\()","name":"support.function.swift"},{"match":"(?<=\\\\.)(?:s(?:uperclassMirror|amePositionIn|tartsWith)|nextObject|c(?:haracterAtIndex|o(?:untByEnumeratingWithState|pyWithZone)|ustom(?:Mirror|PlaygroundQuickLook))|is(?:EmptyInput|ASCII)|object(?:Enumerator|ForKey|AtIndex)|join|put|keyEnumerator|withUnsafeMutablePointerToValue|length|getMirror|m(?:oveInitializeAssignFrom|ember))(?=\\\\s*\\\\()","name":"support.function.swift"}]},"builtin-global-functions":{"patterns":[{"begin":"\\\\b(type)(\\\\()\\\\s*(of)(:)","beginCaptures":{"1":{"name":"support.function.dynamic-type.swift"},"2":{"name":"punctuation.definition.arguments.begin.swift"},"3":{"name":"support.variable.parameter.swift"},"4":{"name":"punctuation.separator.argument-label.begin.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"patterns":[{"include":"#expressions"}]},{"match":"\\\\ba(?:nyGenerator|utoreleasepool)(?=\\\\s*[({])\\\\b","name":"support.function.swift"},{"match":"\\\\b(?:s(?:tride(?:of(?:Value)?)?|izeof(?:Value)?|equence|wap)|numericCast|transcode|is(?:UniquelyReferenced(?:NonObjC)?|KnownUniquelyReferenced)|zip|d(?:ump|ebugPrint)|unsafe(?:BitCast|Downcast|Unwrap|Address(?:Of)?)|pr(?:int|econdition(?:Failure)?)|fatalError|with(?:Unsafe(?:Mutable|)Pointer|ExtendedLifetime|VaList)|a(?:ssert(?:ionFailure)?|lignof(?:Value)?|bs)|re(?:peatElement|adLine)|getVaList|m(?:in|ax))(?=\\\\s*\\\\()","name":"support.function.swift"},{"match":"\\\\b(?:s(?:ort|uffix|pli(?:ce|t))|insert|overlaps|d(?:istance|rop(?:First|Last))|join|prefix|extend|withUnsafe(?:Mutable|)Pointers|lazy|advance|re(?:flect|move(?:Range|Last|A(?:tIndex|ll))))(?=\\\\s*\\\\()","name":"support.function.swift"}]},"builtin-properties":{"patterns":[{"match":"(?<=(?:^|\\\\W)(?:Process\\\\.|CommandLine\\\\.))(arguments|argc|unsafeArgv)","name":"support.variable.swift"},{"match":"(?<=\\\\.)(?:s(?:t(?:artIndex|ri(?:ngValue|de))|i(?:ze|gn(?:BitIndex|ificand(?:Bit(?:Count|Pattern)|Width)?|alingNaN)?)|u(?:perclassMirror|mmary|bscriptBaseAddress))|h(?:eader|as(?:hValue|PointerRepresentation))|n(?:ulTerminatedUTF8|ext(?:Down|Up)|a(?:n|tiveOwner))|c(?:haracters|ount(?:TrailingZeros)?|ustom(?:Mirror|PlaygroundQuickLook)|apacity)|i(?:s(?:S(?:ign(?:Minus|aling(?:NaN)?)|ubnormal)|N(?:ormal|aN)|Canonical|Infinite|Zero|Empty|Finite|ASCII)|n(?:dices|finity)|dentity)|owner|de(?:|bugDe)scription|u(?:n(?:safelyUnwrapped|icodeScalars?|derestimatedCount)|tf(?:16|8(?:Start|C(?:String|odeUnitCount))?)|intValue|ppercaseString|lp(?:OfOne)?)|p(?:i|ointee)|e(?:ndIndex|lements|xponent(?:Bit(?:Count|Pattern))?)|values?|keys|quietNaN|f(?:irst(?:ElementAddress(?:IfContiguous)?)?|loatingPointClass)|l(?:ittleEndian|owercaseString|eastNo(?:nzero|rmal)Magnitude|a(?:st|zy))|a(?:l(?:ignment|l(?:ocatedElementCount|Zeros))|rray(?:PropertyIsNativeTypeChecked)?)|ra(?:dix|wValue)|greatestFiniteMagnitude|m(?:in|emory|ax)|b(?:yteS(?:ize|wapped)|i(?:nade|tPattern|gEndian)|uffer|ase(?:Address)?))\\\\b","name":"support.variable.swift"},{"match":"(?<=\\\\.)(?:boolValue|disposition|end|objectIdentifier|quickLookObject|start|valueType)\\\\b","name":"support.variable.swift"},{"match":"(?<=\\\\.)(?:s(?:calarValue|i(?:ze|gnalingNaN)|o(?:und|me)|uppressed|prite|et)|n(?:one|egative(?:Subnormal|Normal|Infinity|Zero))|c(?:ol(?:or|lection)|ustomized)|t(?:o(?:NearestOr(?:Even|AwayFromZero)|wardZero)|uple|ext)|i(?:nt|mage)|optional|d(?:ictionary|o(?:uble|wn))|u(?:Int|p|rl)|p(?:o(?:sitive(?:Subnormal|Normal|Infinity|Zero)|int)|lus)|e(?:rror|mptyInput)|view|quietNaN|float|a(?:ttributedString|wayFromZero)|r(?:ectangle|ange)|generated|minus|b(?:ool|ezierPath))\\\\b","name":"support.variable.swift"}]},"builtin-types":{"patterns":[{"include":"#builtin-types-builtin-class-type"},{"include":"#builtin-types-builtin-enum-type"},{"include":"#builtin-types-builtin-protocol-type"},{"include":"#builtin-types-builtin-struct-type"},{"include":"#builtin-types-builtin-typealias"},{"match":"\\\\bAny\\\\b","name":"support.type.any.swift"}]},"builtin-types-builtin-class-type":{"match":"\\\\b(Managed((?:|Proto)Buffer)|NonObjectiveCBase|AnyGenerator)\\\\b","name":"support.class.swift"},"builtin-types-builtin-enum-type":{"patterns":[{"match":"\\\\b(?:CommandLine|Process(?=\\\\.))\\\\b","name":"support.constant.swift"},{"match":"\\\\bNever\\\\b","name":"support.constant.never.swift"},{"match":"\\\\b(?:ImplicitlyUnwrappedOptional|Representation|MemoryLayout|FloatingPointClassification|SetIndexRepresentation|SetIteratorRepresentation|FloatingPointRoundingRule|UnicodeDecodingResult|Optional|DictionaryIndexRepresentation|AncestorRepresentation|DisplayStyle|PlaygroundQuickLook|Never|FloatingPointSign|Bit|DictionaryIteratorRepresentation)\\\\b","name":"support.type.swift"},{"match":"\\\\b(?:MirrorDisposition|QuickLookObject)\\\\b","name":"support.type.swift"}]},"builtin-types-builtin-protocol-type":{"patterns":[{"match":"\\\\bActor\\\\b","name":"support.type.swift"},{"match":"\\\\b(?:Ra(?:n(?:domAccess(?:Collection|Indexable)|geReplaceable(?:Collection|Indexable))|wRepresentable)|M(?:irrorPath|utable(?:Collection|Indexable))|Bi(?:naryFloatingPoint|twiseOperations|directional(?:Collection|Indexable))|S(?:tr(?:ide|eam)able|igned(?:Number|Integer)|e(?:tAlgebra|quence))|Hashable|C(?:o(?:llection|mparable)|ustom(?:Reflecta|StringConverti|DebugStringConverti|PlaygroundQuickLooka|LeafReflecta)ble|VarArg)|TextOutputStream|I(?:n(?:teger(?:Arithmetic)?|dexable(?:Base)?)|teratorProtocol)|OptionSet|Un(?:signedInteger|icodeCodec)|E(?:quatable|rror|xpressibleBy(?:BooleanLiteral|String(?:Interpolation|Literal)|NilLiteral|IntegerLiteral|DictionaryLiteral|UnicodeScalarLiteral|ExtendedGraphemeClusterLiteral|FloatLiteral|ArrayLiteral))|FloatingPoint|L(?:osslessStringConvertible|azy(?:Sequence|Collection)Protocol)|A(?:nyObject|bsoluteValuable))\\\\b","name":"support.type.swift"},{"match":"\\\\b(?:Ran(?:domAccessIndex|geReplaceableCollection)Type|GeneratorType|M(?:irror(?:|Path)Type|utable(?:Sliceable|CollectionType))|B(?:i(?:twiseOperations|directionalIndex)Type|oolean(?:Type|LiteralConvertible))|S(?:tring(?:Interpolation|Literal)Convertible|i(?:nk|gned(?:Numb|Integ)er)Type|e(?:tAlgebra|quence)Type|liceable)|NilLiteralConvertible|C(?:ollection|VarArg)Type|Inte(?:rvalType|ger(?:Type|LiteralConvertible|ArithmeticType))|O(?:utputStream|ptionSet)Type|DictionaryLiteralConvertible|Un(?:signedIntegerType|icode(?:ScalarLiteralConvertible|CodecType))|E(?:rrorType|xten(?:sibleCollectionType|dedGraphemeClusterLiteralConvertible))|F(?:orwardIndexType|loat(?:ingPointType|LiteralConvertible))|A(?:nyCollectionType|rrayLiteralConvertible))\\\\b","name":"support.type.swift"}]},"builtin-types-builtin-struct-type":{"patterns":[{"match":"\\\\b(?:R(?:e(?:peat(?:ed)?|versed(?:RandomAccess(?:Collection|Index)|Collection|Index))|an(?:domAccessSlice|ge(?:Replaceable(?:RandomAccess|Bidirectional|)Slice|Generator)?))|Generator(?:Sequence|OfOne)|M(?:irror|utable(?:Ran(?:domAccess|geReplaceable(?:RandomAccess|Bidirectional|))|Bidirectional|)Slice|anagedBufferPointer)|B(?:idirectionalSlice|ool)|S(?:t(?:aticString|ri(?:ng|deT(?:hrough(?:(?:Gen|It)erator)?|o(?:(?:Gen|It)erator)?)))|et(?:I(?:ndex|terator))?|lice)|HalfOpenInterval|C(?:haracter(?:View)?|o(?:ntiguousArray|untable(?:|Closed)Range|llectionOfOne)|OpaquePointer|losed(?:Range(?:I(?:ndex|terator))?|Interval)|VaListPointer)|I(?:n(?:t(?:16|8|32|64)?|d(?:ices|ex(?:ing(?:Gen|It)erator)?))|terator(?:Sequence|OverOne)?)|Zip2(?:Sequence|Iterator)|O(?:paquePointer|bjectIdentifier)|D(?:ictionary(?:I(?:ndex|terator)|Literal)?|ouble|efault(?:RandomAccess|Bidirectional|)Indices)|U(?:n(?:safe(?:RawPointer|Mutable(?:Raw|Buffer|)Pointer|BufferPointer(?:(?:Gen|It)erator)?|Pointer)|icodeScalar(?:View)?|foldSequence|managed)|TF(?:16(?:View)?|8(?:View)?|32)|Int(?:16|8|32|64)?)|Join(?:Generator|ed(?:Sequence|Iterator))|PermutationGenerator|E(?:numerate(?:Generator|Sequence|d(?:Sequence|Iterator))|mpty(?:Generator|Collection|Iterator))|Fl(?:oat(?:80)?|atten(?:Generator|BidirectionalCollection(?:Index)?|Sequence|Collection(?:Index)?|Iterator))|L(?:egacyChildren|azy(?:RandomAccessCollection|Map(?:RandomAccessCollection|Generator|BidirectionalCollection|Sequence|Collection|Iterator)|BidirectionalCollection|Sequence|Collection|Filter(?:Generator|BidirectionalCollection|Sequence|Collection|I(?:ndex|terator))))|A(?:ny(?:RandomAccessCollection|Generator|BidirectionalCollection|Sequence|Hashable|Collection|I(?:ndex|terator))|utoreleasingUnsafeMutablePointer|rray(?:Slice)?))\\\\b","name":"support.type.swift"},{"match":"\\\\b(?:R(?:everse(?:RandomAccess(?:Collection|Index)|Collection|Index)|awByte)|Map(?:Generator|Sequence|Collection)|S(?:inkOf|etGenerator)|Zip2Generator|DictionaryGenerator|Filter(?:Generator|Sequence|Collection(?:Index)?)|LazyForwardCollection|Any(?:RandomAccessIndex|BidirectionalIndex|Forward(?:Collection|Index)))\\\\b","name":"support.type.swift"}]},"builtin-types-builtin-typealias":{"patterns":[{"match":"\\\\b(?:Raw(?:Significand|Exponent|Value)|B(?:ooleanLiteralType|uffer|ase)|S(?:t(?:orage|r(?:i(?:ngLiteralType|de)|eam[12]))|ubSequence)|NativeBuffer|C(?:hild(?:ren)?|Bool|S(?:hort|ignedChar)|odeUnit|Char(?:16|32)?|Int|Double|Unsigned(?:Short|Char|Int|Long(?:Long)?)|Float|WideChar|Long(?:Long)?)|I(?:n(?:t(?:Max|egerLiteralType)|d(?:ices|ex(?:Distance)?))|terator)|Distance|U(?:n(?:icodeScalar(?:Type|Index|View|LiteralType)|foldFirstSequence)|TF(?:16(?:Index|View)|8Index)|IntMax)|E(?:lements?|x(?:tendedGraphemeCluster(?:|Literal)Type|ponent))|V(?:oid|alue)|Key|Float(?:32|LiteralType|64)|AnyClass)\\\\b","name":"support.type.swift"},{"match":"\\\\b(?:Generator|PlaygroundQuickLook|UWord|Word)\\\\b","name":"support.type.swift"}]},"code-block":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.scope.begin.swift"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.scope.end.swift"}},"patterns":[{"include":"$self"}]},"comments":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.comment.swift"}},"match":"\\\\A^(#!).*$\\\\n?","name":"comment.line.number-sign.swift"},{"begin":"/\\\\*\\\\*(?!/)","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.swift"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.swift"}},"name":"comment.block.documentation.swift","patterns":[{"include":"#comments-nested"}]},{"begin":"/\\\\*:","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.swift"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.swift"}},"name":"comment.block.documentation.playground.swift","patterns":[{"include":"#comments-nested"}]},{"begin":"/\\\\*","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.swift"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.swift"}},"name":"comment.block.swift","patterns":[{"include":"#comments-nested"}]},{"match":"\\\\*/","name":"invalid.illegal.unexpected-end-of-block-comment.swift"},{"begin":"(^[\\\\t ]+)?(?=//)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.swift"}},"end":"(?!\\\\G)","patterns":[{"begin":"///","beginCaptures":{"0":{"name":"punctuation.definition.comment.swift"}},"end":"$","name":"comment.line.triple-slash.documentation.swift"},{"begin":"//:","beginCaptures":{"0":{"name":"punctuation.definition.comment.swift"}},"end":"$","name":"comment.line.double-slash.documentation.swift"},{"begin":"//","beginCaptures":{"0":{"name":"punctuation.definition.comment.swift"}},"end":"$","name":"comment.line.double-slash.swift"}]}]},"comments-nested":{"begin":"/\\\\*","end":"\\\\*/","patterns":[{"include":"#comments-nested"}]},"compiler-control":{"patterns":[{"begin":"^\\\\s*(#)(if|elseif)\\\\s+(false)\\\\b.*?(?=$|//|/\\\\*)","beginCaptures":{"0":{"name":"meta.preprocessor.conditional.swift"},"1":{"name":"punctuation.definition.preprocessor.swift"},"2":{"name":"keyword.control.import.preprocessor.conditional.swift"},"3":{"name":"constant.language.boolean.swift"}},"contentName":"comment.block.preprocessor.swift","end":"(?=^\\\\s*(#(e(?:lseif|lse|ndif)))\\\\b)"},{"begin":"^\\\\s*(#)(if|elseif)\\\\s+","captures":{"1":{"name":"punctuation.definition.preprocessor.swift"},"2":{"name":"keyword.control.import.preprocessor.conditional.swift"}},"end":"(?=\\\\s*/[*/])|$","name":"meta.preprocessor.conditional.swift","patterns":[{"match":"(&&|\\\\|\\\\|)","name":"keyword.operator.logical.swift"},{"match":"\\\\b(true|false)\\\\b","name":"constant.language.boolean.swift"},{"captures":{"1":{"name":"keyword.other.condition.swift"},"2":{"name":"punctuation.definition.parameters.begin.swift"},"3":{"name":"support.constant.platform.architecture.swift"},"4":{"name":"punctuation.definition.parameters.end.swift"}},"match":"\\\\b(arch)\\\\s*(\\\\()\\\\s*(?:(arm|arm64|powerpc64|powerpc64le|i386|x86_64|s390x)|\\\\w+)\\\\s*(\\\\))"},{"captures":{"1":{"name":"keyword.other.condition.swift"},"2":{"name":"punctuation.definition.parameters.begin.swift"},"3":{"name":"support.constant.platform.os.swift"},"4":{"name":"punctuation.definition.parameters.end.swift"}},"match":"\\\\b(os)\\\\s*(\\\\()\\\\s*(?:(macOS|OSX|iOS|tvOS|watchOS|visionOS|Android|Linux|FreeBSD|Windows|PS4)|\\\\w+)\\\\s*(\\\\))"},{"captures":{"1":{"name":"keyword.other.condition.swift"},"2":{"name":"punctuation.definition.parameters.begin.swift"},"3":{"name":"entity.name.type.module.swift"},"4":{"name":"punctuation.definition.parameters.end.swift"}},"match":"\\\\b(canImport)\\\\s*(\\\\()([_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*)(\\\\))"},{"begin":"\\\\b(targetEnvironment)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"keyword.other.condition.swift"},"2":{"name":"punctuation.definition.parameters.begin.swift"}},"end":"(\\\\))|$","endCaptures":{"1":{"name":"punctuation.definition.parameters.end.swift"}},"patterns":[{"match":"\\\\b(simulator|UIKitForMac)\\\\b","name":"support.constant.platform.environment.swift"}]},{"begin":"\\\\b(swift|compiler)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"keyword.other.condition.swift"},"2":{"name":"punctuation.definition.parameters.begin.swift"}},"end":"(\\\\))|$","endCaptures":{"1":{"name":"punctuation.definition.parameters.end.swift"}},"patterns":[{"match":">=|<","name":"keyword.operator.comparison.swift"},{"match":"\\\\b[0-9]+(?:\\\\.[0-9]+)*\\\\b","name":"constant.numeric.swift"}]}]},{"captures":{"1":{"name":"punctuation.definition.preprocessor.swift"},"2":{"name":"keyword.control.import.preprocessor.conditional.swift"},"3":{"patterns":[{"match":"\\\\S+","name":"invalid.illegal.character-not-allowed-here.swift"}]}},"match":"^\\\\s*(#)(e(?:lse|ndif))(.*?)(?=$|//|/\\\\*)","name":"meta.preprocessor.conditional.swift"},{"captures":{"1":{"name":"punctuation.definition.preprocessor.swift"},"2":{"name":"keyword.control.import.preprocessor.sourcelocation.swift"},"4":{"name":"punctuation.definition.parameters.begin.swift"},"5":{"patterns":[{"begin":"(file)\\\\s*(:)\\\\s*(?=\\")","beginCaptures":{"1":{"name":"support.variable.parameter.swift"},"2":{"name":"punctuation.separator.key-value.swift"}},"end":"(?!\\\\G)","patterns":[{"include":"#literals"}]},{"captures":{"1":{"name":"support.variable.parameter.swift"},"2":{"name":"punctuation.separator.key-value.swift"},"3":{"name":"constant.numeric.integer.swift"}},"match":"(line)\\\\s*(:)\\\\s*([0-9]+)"},{"match":",","name":"punctuation.separator.parameters.swift"},{"match":"\\\\S+","name":"invalid.illegal.character-not-allowed-here.swift"}]},"6":{"name":"punctuation.definition.parameters.begin.swift"},"7":{"patterns":[{"match":"\\\\S+","name":"invalid.illegal.character-not-allowed-here.swift"}]}},"match":"^\\\\s*(#)(sourceLocation)((\\\\()([^)]*)(\\\\)))(.*?)(?=$|//|/\\\\*)","name":"meta.preprocessor.sourcelocation.swift"}]},"conditionals":{"patterns":[{"begin":"(?<!\\\\.)\\\\b(if|guard|switch|for)\\\\b","beginCaptures":{"1":{"patterns":[{"include":"#keywords"}]}},"end":"(?=\\\\{)","patterns":[{"include":"#expressions-without-trailing-closures"}]},{"begin":"(?<!\\\\.)\\\\b(while)\\\\b","beginCaptures":{"1":{"patterns":[{"include":"#keywords"}]}},"end":"(?=\\\\{)|$","patterns":[{"include":"#expressions-without-trailing-closures"}]}]},"declarations":{"patterns":[{"include":"#declarations-function"},{"include":"#declarations-function-initializer"},{"include":"#declarations-function-subscript"},{"include":"#declarations-typed-variable-declaration"},{"include":"#declarations-import"},{"include":"#declarations-operator"},{"include":"#declarations-precedencegroup"},{"include":"#declarations-protocol"},{"include":"#declarations-type"},{"include":"#declarations-extension"},{"include":"#declarations-typealias"},{"include":"#declarations-macro"}]},"declarations-available-types":{"patterns":[{"include":"#comments"},{"include":"#builtin-types"},{"include":"#attributes"},{"match":"\\\\basync\\\\b","name":"storage.modifier.async.swift"},{"match":"\\\\b(?:|re)throws\\\\b","name":"storage.modifier.exception.swift"},{"match":"\\\\bsome\\\\b","name":"keyword.other.operator.type.opaque.swift"},{"match":"\\\\bany\\\\b","name":"keyword.other.operator.type.existential.swift"},{"match":"\\\\b(?:repeat|each)\\\\b","name":"keyword.control.loop.swift"},{"match":"\\\\b(?:inout|isolated|borrowing|consuming)\\\\b","name":"storage.modifier.swift"},{"match":"\\\\bnonisolated(?:\\\\(nonsending\\\\)|\\\\b)","name":"storage.modifier.swift"},{"match":"\\\\bSelf\\\\b","name":"variable.language.swift"},{"captures":{"1":{"name":"keyword.operator.type.function.swift"}},"match":"(?<![-!%\\\\&*+./<=>^|~])(->)(?![-!%\\\\&*+./<=>^|~])"},{"captures":{"1":{"name":"keyword.operator.type.composition.swift"}},"match":"(?<![-!%\\\\&*+./<=>^|~])(&)(?![-!%\\\\&*+./<=>^|~])"},{"match":"[!?]","name":"keyword.operator.type.optional.swift"},{"match":"\\\\.\\\\.\\\\.","name":"keyword.operator.function.variadic-parameter.swift"},{"match":"\\\\bprotocol\\\\b","name":"keyword.other.type.composition.swift"},{"match":"(?<=\\\\.)(?:Protocol|Type)\\\\b","name":"keyword.other.type.metatype.swift"},{"include":"#declarations-available-types-tuple-type"},{"include":"#declarations-available-types-collection-type"},{"include":"#declarations-generic-argument-clause"}]},"declarations-available-types-collection-type":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.section.collection-type.begin.swift"}},"end":"]|(?=[)>{}])","endCaptures":{"0":{"name":"punctuation.section.collection-type.end.swift"}},"patterns":[{"include":"#declarations-available-types"},{"include":"#literals-numeric"},{"match":"\\\\b_\\\\b","name":"support.variable.inferred.swift"},{"match":"(?<=\\\\s)\\\\bof\\\\b(?=\\\\s+[(\\\\[_\\\\p{L}\\\\d\\\\p{N}\\\\p{M}])","name":"keyword.other.inline-array.swift"},{"begin":":","beginCaptures":{"0":{"name":"punctuation.separator.key-value.swift"}},"end":"(?=[])>{}])","patterns":[{"match":":","name":"invalid.illegal.extra-colon-in-dictionary-type.swift"},{"include":"#declarations-available-types"}]}]},"declarations-available-types-tuple-type":{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.tuple-type.begin.swift"}},"end":"\\\\)|(?=[]>{}])","endCaptures":{"0":{"name":"punctuation.section.tuple-type.end.swift"}},"patterns":[{"include":"#declarations-available-types"}]},"declarations-extension":{"begin":"\\\\b(extension)\\\\s+","beginCaptures":{"1":{"name":"storage.type.$1.swift"}},"end":"(?<=})","name":"meta.definition.type.$1.swift","patterns":[{"begin":"\\\\G(?!\\\\s*[\\\\n:{])","end":"(?=\\\\s*[\\\\n:{])|(?!\\\\G)(?=\\\\s*where\\\\b)","name":"entity.name.type.swift","patterns":[{"include":"#declarations-available-types"}]},{"include":"#comments"},{"include":"#declarations-generic-where-clause"},{"include":"#declarations-inheritance-clause"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.type.begin.swift"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.type.end.swift"}},"name":"meta.definition.type.body.swift","patterns":[{"include":"$self"}]}]},"declarations-function":{"begin":"\\\\b(func)\\\\s+((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>)|(?:((?<oph>[-!%\\\\&*+/<-?^|~¡-§©«¬®°±¶»¿×÷‖‗†-‧‰-‾⁁-⁓⁕-⁞←-⏿─-❵➔-⯿⸀-、。〃〈-〰])(\\\\g<oph>|(?<opc>[̀-ͯ᷀-᷿⃐-︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))*)|(\\\\.(\\\\g<oph>|\\\\g<opc>|\\\\.)+)))\\\\s*(?=[(<])","beginCaptures":{"1":{"name":"storage.type.function.swift"},"2":{"name":"entity.name.function.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"(?<=})|$","name":"meta.definition.function.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#declarations-function-result"},{"include":"#async-throws"},{"include":"#declarations-generic-where-clause"},{"begin":"(\\\\{)","beginCaptures":{"1":{"name":"punctuation.section.function.begin.swift"}},"end":"(})","endCaptures":{"1":{"name":"punctuation.section.function.end.swift"}},"name":"meta.definition.function.body.swift","patterns":[{"include":"$self"}]}]},"declarations-function-initializer":{"begin":"(?<!\\\\.)\\\\b(init[!?]*)\\\\s*(?=[(<])","beginCaptures":{"1":{"name":"storage.type.function.swift","patterns":[{"match":"(?<=[!?])[!?]+","name":"invalid.illegal.character-not-allowed-here.swift"}]}},"end":"(?<=})|$","name":"meta.definition.function.initializer.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#async-throws"},{"include":"#declarations-generic-where-clause"},{"begin":"(\\\\{)","beginCaptures":{"1":{"name":"punctuation.section.function.begin.swift"}},"end":"(})","endCaptures":{"1":{"name":"punctuation.section.function.end.swift"}},"name":"meta.definition.function.body.swift","patterns":[{"include":"$self"}]}]},"declarations-function-result":{"begin":"(?<![-!%\\\\&*+./<=>^|~])(->)(?![-!%\\\\&*+./<=>^|~])\\\\s*","beginCaptures":{"1":{"name":"keyword.operator.function-result.swift"}},"end":"(?!\\\\G)(?=\\\\{|\\\\bwhere\\\\b|[;=])|$","name":"meta.function-result.swift","patterns":[{"match":"\\\\bsending\\\\b","name":"storage.modifier.swift"},{"include":"#declarations-available-types"}]},"declarations-function-subscript":{"begin":"(?<!\\\\.)\\\\b(subscript)\\\\s*(?=[(<])","beginCaptures":{"1":{"name":"storage.type.function.swift"}},"end":"(?<=})|$","name":"meta.definition.function.subscript.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#declarations-function-result"},{"include":"#async-throws"},{"include":"#declarations-generic-where-clause"},{"begin":"(\\\\{)","beginCaptures":{"1":{"name":"punctuation.section.function.begin.swift"}},"end":"(})","endCaptures":{"1":{"name":"punctuation.section.function.end.swift"}},"name":"meta.definition.function.body.swift","patterns":[{"include":"$self"}]}]},"declarations-generic-argument-clause":{"begin":"<","beginCaptures":{"0":{"name":"punctuation.separator.generic-argument-clause.begin.swift"}},"end":">|(?=[]){}])","endCaptures":{"0":{"name":"punctuation.separator.generic-argument-clause.end.swift"}},"name":"meta.generic-argument-clause.swift","patterns":[{"include":"#literals-numeric"},{"include":"#declarations-available-types"}]},"declarations-generic-parameter-clause":{"begin":"<","beginCaptures":{"0":{"name":"punctuation.separator.generic-parameter-clause.begin.swift"}},"end":">|(?=[^\\\\&,:<=>`\\\\w\\\\d\\\\s])","endCaptures":{"0":{"name":"punctuation.separator.generic-parameter-clause.end.swift"}},"name":"meta.generic-parameter-clause.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-where-clause"},{"match":"\\\\blet\\\\b","name":"keyword.other.declaration-specifier.swift"},{"match":"\\\\beach\\\\b","name":"keyword.control.loop.swift"},{"captures":{"1":{"name":"variable.language.generic-parameter.swift"}},"match":"\\\\b((?!\\\\d)\\\\w[\\\\w\\\\d]*)\\\\b"},{"match":",","name":"punctuation.separator.generic-parameters.swift"},{"begin":"(:)\\\\s*","beginCaptures":{"1":{"name":"punctuation.separator.generic-parameter-constraint.swift"}},"end":"(?=[,>]|(?!\\\\G)\\\\bwhere\\\\b)","name":"meta.generic-parameter-constraint.swift","patterns":[{"begin":"\\\\G","end":"(?=[,>]|(?!\\\\G)\\\\bwhere\\\\b)","name":"entity.other.inherited-class.swift","patterns":[{"include":"#declarations-type-identifier"},{"include":"#declarations-type-operators"}]}]}]},"declarations-generic-where-clause":{"begin":"\\\\b(where)\\\\b\\\\s*","beginCaptures":{"1":{"name":"keyword.other.generic-constraint-introducer.swift"}},"end":"(?!\\\\G)$|(?=[\\\\n;>{}]|//|/\\\\*)","name":"meta.generic-where-clause.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-where-clause-requirement-list"}]},"declarations-generic-where-clause-requirement-list":{"begin":"\\\\G|,\\\\s*","end":"(?=[\\\\n,;>{}]|//|/\\\\*)","patterns":[{"include":"#comments"},{"include":"#constraint"},{"include":"#declarations-available-types"},{"begin":"(?<![-!%\\\\&*+./<=>^|~])(==)(?![-!%\\\\&*+./<=>^|~])","beginCaptures":{"1":{"name":"keyword.operator.generic-constraint.same-type.swift"}},"end":"(?=\\\\s*[\\\\n,;>{}]|//|/\\\\*)","name":"meta.generic-where-clause.same-type-requirement.swift","patterns":[{"include":"#declarations-available-types"}]},{"begin":"(?<![-!%\\\\&*+./<=>^|~])(:)(?![-!%\\\\&*+./<=>^|~])","beginCaptures":{"1":{"name":"keyword.operator.generic-constraint.conforms-to.swift"}},"end":"(?=\\\\s*[\\\\n,;>{}]|//|/\\\\*)","name":"meta.generic-where-clause.conformance-requirement.swift","patterns":[{"begin":"\\\\G\\\\s*","contentName":"entity.other.inherited-class.swift","end":"(?=\\\\s*[\\\\n,;>{}]|//|/\\\\*)","patterns":[{"include":"#declarations-available-types"}]}]}]},"declarations-import":{"begin":"(?<!\\\\.)\\\\b(import)\\\\s+","beginCaptures":{"1":{"name":"keyword.control.import.swift"}},"end":"(;)|$\\\\n?|(?=/[*/])","endCaptures":{"1":{"name":"punctuation.terminator.statement.swift"}},"name":"meta.import.swift","patterns":[{"begin":"\\\\G(?!;|$|//|/\\\\*)(?:(typealias|struct|class|actor|enum|protocol|var|func)\\\\s+)?","beginCaptures":{"1":{"name":"storage.modifier.swift"}},"end":"(?=;|$|//|/\\\\*)","patterns":[{"captures":{"1":{"name":"punctuation.definition.identifier.swift"},"2":{"name":"punctuation.definition.identifier.swift"}},"match":"(?<=\\\\G|\\\\.)(?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>)","name":"entity.name.type.swift"},{"match":"(?<=\\\\G|\\\\.)\\\\$[0-9]+","name":"entity.name.type.swift"},{"captures":{"1":{"patterns":[{"match":"\\\\.","name":"invalid.illegal.dot-not-allowed-here.swift"}]}},"match":"(?<=\\\\G|\\\\.)(?:((?<oph>[-!%\\\\&*+/<-?^|~¡-§©«¬®°±¶»¿×÷‖‗†-‧‰-‾⁁-⁓⁕-⁞←-⏿─-❵➔-⯿⸀-、。〃〈-〰])(\\\\g<oph>|(?<opc>[̀-ͯ᷀-᷿⃐-︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))*)|(\\\\.(\\\\g<oph>|\\\\g<opc>|\\\\.)+))(?=[.;]|$|//|/\\\\*|\\\\s)","name":"entity.name.type.swift"},{"match":"\\\\.","name":"punctuation.separator.import.swift"},{"begin":"(?!\\\\s*(;|$|//|/\\\\*))","end":"(?=\\\\s*(;|$|//|/\\\\*))","name":"invalid.illegal.character-not-allowed-here.swift"}]}]},"declarations-inheritance-clause":{"begin":"(:)(?=\\\\s*\\\\{)|(:)\\\\s*","beginCaptures":{"1":{"name":"invalid.illegal.empty-inheritance-clause.swift"},"2":{"name":"punctuation.separator.inheritance-clause.swift"}},"end":"(?!\\\\G)$|(?=[={}]|(?!\\\\G)\\\\bwhere\\\\b)","name":"meta.inheritance-clause.swift","patterns":[{"begin":"\\\\bclass\\\\b","beginCaptures":{"0":{"name":"storage.type.class.swift"}},"end":"(?=[={}]|(?!\\\\G)\\\\bwhere\\\\b)","patterns":[{"include":"#comments"},{"include":"#declarations-inheritance-clause-more-types"}]},{"begin":"\\\\G","end":"(?!\\\\G)$|(?=[={}]|(?!\\\\G)\\\\bwhere\\\\b)","patterns":[{"include":"#attributes"},{"include":"#comments"},{"include":"#declarations-inheritance-clause-inherited-type"},{"include":"#declarations-inheritance-clause-more-types"},{"include":"#declarations-type-operators"}]}]},"declarations-inheritance-clause-inherited-type":{"begin":"(?=[_`\\\\p{L}])","end":"(?!\\\\G)","name":"entity.other.inherited-class.swift","patterns":[{"include":"#declarations-type-identifier"}]},"declarations-inheritance-clause-more-types":{"begin":",\\\\s*","end":"(?!\\\\G)(?!/[*/])|(?=[,={}]|(?!\\\\G)\\\\bwhere\\\\b)","name":"meta.inheritance-list.more-types","patterns":[{"include":"#attributes"},{"include":"#comments"},{"include":"#declarations-inheritance-clause-inherited-type"},{"include":"#declarations-inheritance-clause-more-types"},{"include":"#declarations-type-operators"}]},"declarations-macro":{"begin":"\\\\b(macro)\\\\s+((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*(?=[(<=])","beginCaptures":{"1":{"name":"storage.type.function.swift"},"2":{"name":"entity.name.function.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"$|(?=;|//|/\\\\*|[=}])","name":"meta.definition.macro.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#declarations-function-result"},{"include":"#async-throws"},{"include":"#declarations-generic-where-clause"}]},"declarations-operator":{"begin":"(?:\\\\b((?:pre|in|post)fix)\\\\s+)?\\\\b(operator)\\\\s+(((?<oph>[-!%\\\\&*+/<-?^|~¡-§©«¬®°±¶»¿×÷‖‗†-‧‰-‾⁁-⁓⁕-⁞←-⏿─-❵➔-⯿⸀-、。〃〈-〰])(\\\\g<oph>|\\\\.|(?<opc>[̀-ͯ᷀-᷿⃐-︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))*+)|(\\\\.(\\\\g<oph>|\\\\g<opc>|\\\\.)++))\\\\s*","beginCaptures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"storage.type.function.operator.swift"},"3":{"name":"entity.name.function.operator.swift"},"4":{"name":"entity.name.function.operator.swift","patterns":[{"match":"\\\\.","name":"invalid.illegal.dot-not-allowed-here.swift"}]}},"end":"(;)|$\\\\n?|(?=/[*/])","endCaptures":{"1":{"name":"punctuation.terminator.statement.swift"}},"name":"meta.definition.operator.swift","patterns":[{"include":"#declarations-operator-swift2"},{"include":"#declarations-operator-swift3"},{"match":"((?!$|;|//|/\\\\*)\\\\S)+","name":"invalid.illegal.character-not-allowed-here.swift"}]},"declarations-operator-swift2":{"begin":"\\\\G(\\\\{)","beginCaptures":{"1":{"name":"punctuation.definition.operator.begin.swift"}},"end":"(})","endCaptures":{"1":{"name":"punctuation.definition.operator.end.swift"}},"patterns":[{"include":"#comments"},{"captures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"keyword.other.operator.associativity.swift"}},"match":"\\\\b(associativity)\\\\s+(left|right)\\\\b"},{"captures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"constant.numeric.integer.swift"}},"match":"\\\\b(precedence)\\\\s+([0-9]+)\\\\b"},{"captures":{"1":{"name":"storage.modifier.swift"}},"match":"\\\\b(assignment)\\\\b"}]},"declarations-operator-swift3":{"captures":{"2":{"name":"entity.other.inherited-class.swift","patterns":[{"include":"#declarations-types-precedencegroup"}]},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"match":"\\\\G(:)\\\\s*((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))"},"declarations-parameter-clause":{"begin":"(\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.parameters.begin.swift"}},"end":"(\\\\))(?:\\\\s*(async)\\\\b)?","endCaptures":{"1":{"name":"punctuation.definition.parameters.end.swift"},"2":{"name":"storage.modifier.async.swift"}},"name":"meta.parameter-clause.swift","patterns":[{"include":"#declarations-parameter-list"}]},"declarations-parameter-list":{"patterns":[{"captures":{"1":{"name":"entity.name.function.swift"},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"variable.parameter.function.swift"},"5":{"name":"punctuation.definition.identifier.swift"},"6":{"name":"punctuation.definition.identifier.swift"}},"match":"((?<q1>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q1>))\\\\s+((?<q2>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q2>))(?=\\\\s*:)"},{"captures":{"1":{"name":"variable.parameter.function.swift"},"2":{"name":"entity.name.function.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"match":"(((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>)))(?=\\\\s*:)"},{"begin":":\\\\s*(?!\\\\s)","end":"(?=[),])","patterns":[{"match":"\\\\bsending\\\\b","name":"storage.modifier.swift"},{"include":"#declarations-available-types"},{"match":":","name":"invalid.illegal.extra-colon-in-parameter-list.swift"},{"begin":"=","beginCaptures":{"0":{"name":"keyword.operator.assignment.swift"}},"end":"(?=[),])","patterns":[{"include":"#expressions"}]}]}]},"declarations-precedencegroup":{"begin":"\\\\b(precedencegroup)\\\\s+((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*(?=\\\\{)","beginCaptures":{"1":{"name":"storage.type.precedencegroup.swift"},"2":{"name":"entity.name.type.precedencegroup.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"(?!\\\\G)","name":"meta.definition.precedencegroup.swift","patterns":[{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.precedencegroup.begin.swift"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.precedencegroup.end.swift"}},"patterns":[{"include":"#comments"},{"captures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"entity.other.inherited-class.swift","patterns":[{"include":"#declarations-types-precedencegroup"}]},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"match":"\\\\b((?:high|low)erThan)\\\\s*:\\\\s*((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))"},{"captures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"keyword.other.operator.associativity.swift"}},"match":"\\\\b(associativity)\\\\b(?:\\\\s*:\\\\s*(right|left|none)\\\\b)?"},{"captures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"constant.language.boolean.swift"}},"match":"\\\\b(assignment)\\\\b(?:\\\\s*:\\\\s*(true|false)\\\\b)?"}]}]},"declarations-protocol":{"begin":"\\\\b(protocol)\\\\s+((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))","beginCaptures":{"1":{"name":"storage.type.$1.swift"},"2":{"name":"entity.name.type.$1.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"(?<=})","name":"meta.definition.type.protocol.swift","patterns":[{"include":"#comments"},{"include":"#declarations-inheritance-clause"},{"include":"#declarations-generic-where-clause"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.type.begin.swift"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.type.end.swift"}},"name":"meta.definition.type.body.swift","patterns":[{"include":"#declarations-protocol-protocol-method"},{"include":"#declarations-protocol-protocol-initializer"},{"include":"#declarations-protocol-associated-type"},{"include":"$self"}]}]},"declarations-protocol-associated-type":{"begin":"\\\\b(associatedtype)\\\\s+((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*","beginCaptures":{"1":{"name":"keyword.other.declaration-specifier.swift"},"2":{"name":"variable.language.associatedtype.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"(?!\\\\G)$|(?=[;}]|$)","name":"meta.definition.associatedtype.swift","patterns":[{"include":"#declarations-inheritance-clause"},{"include":"#declarations-generic-where-clause"},{"include":"#declarations-typealias-assignment"}]},"declarations-protocol-protocol-initializer":{"begin":"(?<!\\\\.)\\\\b(init[!?]*)\\\\s*(?=[(<])","beginCaptures":{"1":{"name":"storage.type.function.swift","patterns":[{"match":"(?<=[!?])[!?]+","name":"invalid.illegal.character-not-allowed-here.swift"}]}},"end":"$|(?=;|//|/\\\\*|})","name":"meta.definition.function.initializer.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#async-throws"},{"include":"#declarations-generic-where-clause"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.function.begin.swift"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.function.end.swift"}},"name":"invalid.illegal.function-body-not-allowed-in-protocol.swift","patterns":[{"include":"$self"}]}]},"declarations-protocol-protocol-method":{"begin":"\\\\b(func)\\\\s+((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>)|(?:((?<oph>[-!%\\\\&*+/<-?^|~¡-§©«¬®°±¶»¿×÷‖‗†-‧‰-‾⁁-⁓⁕-⁞←-⏿─-❵➔-⯿⸀-、。〃〈-〰])(\\\\g<oph>|(?<opc>[̀-ͯ᷀-᷿⃐-︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))*)|(\\\\.(\\\\g<oph>|\\\\g<opc>|\\\\.)+)))\\\\s*(?=[(<])","beginCaptures":{"1":{"name":"storage.type.function.swift"},"2":{"name":"entity.name.function.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"$|(?=;|//|/\\\\*|})","name":"meta.definition.function.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#declarations-function-result"},{"include":"#async-throws"},{"include":"#declarations-generic-where-clause"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.function.begin.swift"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.function.end.swift"}},"name":"invalid.illegal.function-body-not-allowed-in-protocol.swift","patterns":[{"include":"$self"}]}]},"declarations-type":{"patterns":[{"begin":"\\\\b(class(?!\\\\s+(?:func|var|let)\\\\b)|struct|actor)\\\\b\\\\s*((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))","beginCaptures":{"1":{"name":"storage.type.$1.swift"},"2":{"name":"entity.name.type.$1.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"(?<=})","name":"meta.definition.type.$1.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-generic-where-clause"},{"include":"#declarations-inheritance-clause"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.type.begin.swift"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.type.end.swift"}},"name":"meta.definition.type.body.swift","patterns":[{"include":"$self"}]}]},{"include":"#declarations-type-enum"}]},"declarations-type-enum":{"begin":"\\\\b(enum)\\\\s+((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))","beginCaptures":{"1":{"name":"storage.type.$1.swift"},"2":{"name":"entity.name.type.$1.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"(?<=})","name":"meta.definition.type.$1.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-generic-where-clause"},{"include":"#declarations-inheritance-clause"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.type.begin.swift"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.type.end.swift"}},"name":"meta.definition.type.body.swift","patterns":[{"include":"#declarations-type-enum-enum-case-clause"},{"include":"$self"}]}]},"declarations-type-enum-associated-values":{"begin":"\\\\G\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.parameters.begin.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.swift"}},"patterns":[{"include":"#comments"},{"begin":"(?:(_)|((?<q1>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*\\\\k<q1>))\\\\s+(((?<q2>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*\\\\k<q2>))\\\\s*(:)","beginCaptures":{"1":{"name":"entity.name.function.swift"},"2":{"name":"invalid.illegal.distinct-labels-not-allowed.swift"},"5":{"name":"variable.parameter.function.swift"},"7":{"name":"punctuation.separator.argument-label.swift"}},"end":"(?=[]),])","patterns":[{"include":"#declarations-available-types"}]},{"begin":"(((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*\\\\k<q>))\\\\s*(:)","beginCaptures":{"1":{"name":"entity.name.function.swift"},"2":{"name":"variable.parameter.function.swift"},"4":{"name":"punctuation.separator.argument-label.swift"}},"end":"(?=[]),])","patterns":[{"include":"#declarations-available-types"}]},{"begin":"(?![]),])(?=\\\\S)","end":"(?=[]),])","patterns":[{"include":"#declarations-available-types"},{"match":":","name":"invalid.illegal.extra-colon-in-parameter-list.swift"}]}]},"declarations-type-enum-enum-case":{"begin":"((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*","beginCaptures":{"1":{"name":"variable.other.enummember.swift"}},"end":"(?<=\\\\))|(?![(=])","patterns":[{"include":"#comments"},{"include":"#declarations-type-enum-associated-values"},{"include":"#declarations-type-enum-raw-value-assignment"}]},"declarations-type-enum-enum-case-clause":{"begin":"\\\\b(case)\\\\b\\\\s*","beginCaptures":{"1":{"name":"storage.type.enum.case.swift"}},"end":"(?=[;}])|(?!\\\\G)(?!/[*/])(?=[^,\\\\s])","patterns":[{"include":"#comments"},{"include":"#declarations-type-enum-enum-case"},{"include":"#declarations-type-enum-more-cases"}]},"declarations-type-enum-more-cases":{"begin":",\\\\s*","end":"(?!\\\\G)(?!/[*/])(?=[;}[^,\\\\s]])","name":"meta.enum-case.more-cases","patterns":[{"include":"#comments"},{"include":"#declarations-type-enum-enum-case"},{"include":"#declarations-type-enum-more-cases"}]},"declarations-type-enum-raw-value-assignment":{"begin":"(=)\\\\s*","beginCaptures":{"1":{"name":"keyword.operator.assignment.swift"}},"end":"(?!\\\\G)","patterns":[{"include":"#comments"},{"include":"#literals"}]},"declarations-type-identifier":{"begin":"((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*","beginCaptures":{"1":{"name":"meta.type-name.swift","patterns":[{"include":"#builtin-types"}]},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"}},"end":"(?!<)","patterns":[{"begin":"(?=<)","end":"(?!\\\\G)","patterns":[{"include":"#declarations-generic-argument-clause"}]}]},"declarations-type-operators":{"patterns":[{"captures":{"1":{"name":"keyword.operator.type.composition.swift"}},"match":"(?<![-!%\\\\&*+./<=>^|~])(&)(?![-!%\\\\&*+./<=>^|~])"},{"captures":{"1":{"name":"keyword.operator.type.requirement-suppression.swift"}},"match":"(?<![-!%\\\\&*+./<=>^|~])(~)(?![-!%\\\\&*+./<=>^|~])"}]},"declarations-typealias":{"begin":"\\\\b(typealias)\\\\s+((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*","beginCaptures":{"1":{"name":"keyword.other.declaration-specifier.swift"},"2":{"name":"entity.name.type.typealias.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"(?!\\\\G)$|(?=;|//|/\\\\*|$)","name":"meta.definition.typealias.swift","patterns":[{"begin":"\\\\G(?=<)","end":"(?!\\\\G)","patterns":[{"include":"#declarations-generic-parameter-clause"}]},{"include":"#declarations-typealias-assignment"}]},"declarations-typealias-assignment":{"begin":"(=)\\\\s*","beginCaptures":{"1":{"name":"keyword.operator.assignment.swift"}},"end":"(?!\\\\G)$|(?=;|//|/\\\\*|$)","patterns":[{"include":"#declarations-available-types"}]},"declarations-typed-variable-declaration":{"begin":"\\\\b(?:(async)\\\\s+)?(let|var)\\\\b\\\\s+(?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>)\\\\s*:","beginCaptures":{"1":{"name":"storage.modifier.async.swift"},"2":{"name":"keyword.other.declaration-specifier.swift"}},"end":"(?=$|[={])","patterns":[{"include":"#declarations-available-types"}]},"declarations-types-precedencegroup":{"patterns":[{"match":"\\\\b(?:BitwiseShift|Assignment|RangeFormation|Casting|Addition|NilCoalescing|Comparison|LogicalConjunction|LogicalDisjunction|Default|Ternary|Multiplication|FunctionArrow)Precedence\\\\b","name":"support.type.swift"}]},"expressions":{"patterns":[{"include":"#expressions-without-trailing-closures-or-member-references"},{"include":"#expressions-trailing-closure"},{"include":"#member-reference"}]},"expressions-trailing-closure":{"patterns":[{"captures":{"1":{"name":"support.function.any-method.swift"},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"}},"match":"(#?(?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))(?=\\\\s*\\\\{)","name":"meta.function-call.trailing-closure-only.swift"},{"captures":{"1":{"name":"support.function.any-method.trailing-closure-label.swift"},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.separator.argument-label.swift"}},"match":"((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*(:)(?=\\\\s*\\\\{)"}]},"expressions-without-trailing-closures":{"patterns":[{"include":"#expressions-without-trailing-closures-or-member-references"},{"include":"#member-references"}]},"expressions-without-trailing-closures-or-member-references":{"patterns":[{"include":"#comments"},{"include":"#code-block"},{"include":"#attributes"},{"include":"#expressions-without-trailing-closures-or-member-references-closure-parameter"},{"include":"#literals"},{"include":"#operators"},{"include":"#builtin-types"},{"include":"#builtin-functions"},{"include":"#builtin-global-functions"},{"include":"#builtin-properties"},{"include":"#expressions-without-trailing-closures-or-member-references-compound-name"},{"include":"#conditionals"},{"include":"#keywords"},{"include":"#expressions-without-trailing-closures-or-member-references-availability-condition"},{"include":"#expressions-without-trailing-closures-or-member-references-function-or-macro-call-expression"},{"include":"#expressions-without-trailing-closures-or-member-references-macro-expansion"},{"include":"#expressions-without-trailing-closures-or-member-references-subscript-expression"},{"include":"#expressions-without-trailing-closures-or-member-references-parenthesized-expression"},{"match":"\\\\b_\\\\b","name":"support.variable.discard-value.swift"}]},"expressions-without-trailing-closures-or-member-references-availability-condition":{"begin":"\\\\B(#(?:un)?available)(\\\\()","beginCaptures":{"1":{"name":"support.function.availability-condition.swift"},"2":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"patterns":[{"captures":{"1":{"name":"keyword.other.platform.os.swift"},"2":{"name":"constant.numeric.swift"}},"match":"\\\\s*\\\\b((?:iOS|macOS|OSX|watchOS|tvOS|visionOS|UIKitForMac)(?:ApplicationExtension)?)\\\\b\\\\s+([0-9]+(?:\\\\.[0-9]+)*)\\\\b"},{"captures":{"1":{"name":"keyword.other.platform.all.swift"},"2":{"name":"invalid.illegal.character-not-allowed-here.swift"}},"match":"(\\\\*)\\\\s*(.*?)(?=[),])"},{"match":"[^),\\\\s]+","name":"invalid.illegal.character-not-allowed-here.swift"}]},"expressions-without-trailing-closures-or-member-references-closure-parameter":{"match":"\\\\$[0-9]+","name":"variable.language.closure-parameter.swift"},"expressions-without-trailing-closures-or-member-references-compound-name":{"captures":{"1":{"name":"entity.name.function.compound-name.swift"},"2":{"name":"punctuation.definition.entity.swift"},"3":{"name":"punctuation.definition.entity.swift"},"4":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.entity.swift"},"2":{"name":"punctuation.definition.entity.swift"}},"match":"(?<q>`?)(?!_:)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>):","name":"entity.name.function.compound-name.swift"}]}},"match":"((?<q1>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q1>))\\\\(((((?<q2>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q2>)):)+)\\\\)"},"expressions-without-trailing-closures-or-member-references-expression-element-list":{"patterns":[{"include":"#comments"},{"begin":"((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*(:)","beginCaptures":{"1":{"name":"support.function.any-method.swift"},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.separator.argument-label.swift"}},"end":"(?=[]),])","patterns":[{"include":"#expressions"}]},{"begin":"(?![]),])(?=\\\\S)","end":"(?=[]),])","patterns":[{"include":"#expressions"}]}]},"expressions-without-trailing-closures-or-member-references-function-or-macro-call-expression":{"patterns":[{"begin":"(#?(?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*(\\\\()","beginCaptures":{"1":{"name":"support.function.any-method.swift"},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"name":"meta.function-call.swift","patterns":[{"include":"#expressions-without-trailing-closures-or-member-references-expression-element-list"}]},{"begin":"(?<=[])>_`}\\\\p{L}\\\\p{N}\\\\p{M}])\\\\s*(\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"name":"meta.function-call.swift","patterns":[{"include":"#expressions-without-trailing-closures-or-member-references-expression-element-list"}]}]},"expressions-without-trailing-closures-or-member-references-macro-expansion":{"match":"(#(?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))","name":"support.function.any-method.swift"},"expressions-without-trailing-closures-or-member-references-parenthesized-expression":{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.tuple.begin.swift"}},"end":"(\\\\))\\\\s*((?:\\\\b(?:async|throws|rethrows)\\\\s)*)","endCaptures":{"1":{"name":"punctuation.section.tuple.end.swift"},"2":{"patterns":[{"match":"\\\\brethrows\\\\b","name":"invalid.illegal.rethrows-only-allowed-on-function-declarations.swift"},{"include":"#async-throws"}]}},"patterns":[{"include":"#expressions-without-trailing-closures-or-member-references-expression-element-list"}]},"expressions-without-trailing-closures-or-member-references-subscript-expression":{"begin":"(?<=[_`\\\\p{L}\\\\p{N}\\\\p{M}])\\\\s*(\\\\[)","beginCaptures":{"1":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"name":"meta.subscript-expression.swift","patterns":[{"include":"#expressions-without-trailing-closures-or-member-references-expression-element-list"}]},"keywords":{"patterns":[{"match":"(?<!\\\\.)\\\\b(?:if|else|guard|where|switch|case|default|fallthrough)\\\\b","name":"keyword.control.branch.swift"},{"match":"(?<!\\\\.)\\\\b(?:continue|break|fallthrough|return|yield)\\\\b","name":"keyword.control.transfer.swift"},{"match":"(?<!\\\\.)\\\\b(?:while|for|in|each)\\\\b","name":"keyword.control.loop.swift"},{"match":"(?<=\\\\s)\\\\bof\\\\b(?=\\\\s+[(\\\\[_\\\\p{L}\\\\d\\\\p{N}\\\\p{M}])","name":"keyword.other.inline-array.swift"},{"match":"\\\\bany\\\\b(?=\\\\s*`?[_\\\\p{L}])","name":"keyword.other.operator.type.existential.swift"},{"captures":{"1":{"name":"keyword.control.loop.swift"},"2":{"name":"punctuation.whitespace.trailing.repeat.swift"}},"match":"(?<!\\\\.)\\\\b(repeat)\\\\b(\\\\s*)"},{"match":"(?<!\\\\.)\\\\bdefer\\\\b","name":"keyword.control.defer.swift"},{"captures":{"1":{"name":"invalid.illegal.try-must-precede-await.swift"},"2":{"name":"keyword.control.await.swift"}},"match":"(?<!\\\\.)\\\\b(?:(await\\\\s+try)|(await))\\\\b"},{"match":"(?<!\\\\.)\\\\b(?:catch|throw|try)\\\\b|\\\\btry[!?]\\\\B","name":"keyword.control.exception.swift"},{"match":"(?<!\\\\.)\\\\b(?:|re)throws\\\\b","name":"storage.modifier.exception.swift"},{"captures":{"1":{"name":"keyword.control.exception.swift"},"2":{"name":"punctuation.whitespace.trailing.do.swift"}},"match":"(?<!\\\\.)\\\\b(do)\\\\b(\\\\s*)"},{"captures":{"1":{"name":"storage.modifier.async.swift"},"2":{"name":"keyword.other.declaration-specifier.swift"}},"match":"(?<!\\\\.)\\\\b(?:(async)\\\\s+)?(let|var)\\\\b"},{"match":"(?<!\\\\.)\\\\b(?:associatedtype|operator|typealias)\\\\b","name":"keyword.other.declaration-specifier.swift"},{"match":"(?<!\\\\.)\\\\b(class|enum|extension|precedencegroup|protocol|struct|actor)\\\\b(?=\\\\s*`?[_\\\\p{L}])","name":"storage.type.$1.swift"},{"match":"(?<!\\\\.)\\\\b(?:inout|static|final|lazy|mutating|nonmutating|optional|indirect|required|override|dynamic|convenience|infix|prefix|postfix|distributed|borrowing|consuming)\\\\b","name":"storage.modifier.swift"},{"match":"(?<!\\\\.)\\\\bnonisolated(?:\\\\(nonsending\\\\)|\\\\b)","name":"storage.modifier.swift"},{"match":"\\\\binit[!?]|\\\\binit\\\\b|(?<!\\\\.)\\\\b(?:func|deinit|subscript|didSet|set|willSet|yielding\\\\s+borrow|yielding\\\\s+mutate)\\\\b","name":"storage.type.function.swift"},{"captures":{"1":{"name":"storage.type.function.swift"},"2":{"name":"invalid.illegal.async-must-precede-throws.swift"},"3":{"name":"storage.modifier.async.swift"},"4":{"name":"storage.modifier.exception.swift"}},"match":"\\\\b(get)(?:\\\\s+(throws\\\\s+async)|\\\\s+(async)(?:\\\\s+(throws))?)?\\\\b"},{"match":"(?<!\\\\.)\\\\b(?:fileprivate|private|internal|public|open|package)\\\\b","name":"keyword.other.declaration-specifier.accessibility.swift"},{"match":"(?<!\\\\.)\\\\bunowned\\\\((?:|un)safe\\\\)|(?<!\\\\.)\\\\b(?:weak|unowned)\\\\b","name":"keyword.other.capture-specifier.swift"},{"captures":{"1":{"name":"keyword.other.type.swift"},"2":{"name":"keyword.other.type.metatype.swift"}},"match":"(?<=\\\\.)(?:(dynamicType|self)|(Protocol|Type))\\\\b"},{"match":"(?<!\\\\.)\\\\b(?:super|self|Self)\\\\b","name":"variable.language.swift"},{"match":"(?:\\\\B#(?:file|filePath|fileID|line|column|function|dsohandle|isolation)|\\\\b__(?:FILE|LINE|COLUMN|FUNCTION|DSO_HANDLE)__)\\\\b","name":"support.variable.swift"},{"match":"(?<!\\\\.)\\\\bimport\\\\b","name":"keyword.control.import.swift"},{"match":"(?<!\\\\.)\\\\bconsume(?=\\\\s+`?[_\\\\p{L}])","name":"keyword.control.consume.swift"},{"match":"(?<!\\\\.)\\\\bcopy(?=\\\\s+`?[_\\\\p{L}])","name":"keyword.control.copy.swift"}]},"literals":{"patterns":[{"include":"#literals-boolean"},{"include":"#literals-numeric"},{"include":"#literals-string"},{"match":"\\\\bnil\\\\b","name":"constant.language.nil.swift"},{"match":"\\\\B#((?:color|image|file)Literal)\\\\b","name":"support.function.object-literal.swift"},{"match":"\\\\B#externalMacro\\\\b","name":"support.function.builtin-macro.swift"},{"match":"\\\\B#keyPath\\\\b","name":"support.function.key-path.swift"},{"begin":"\\\\B(#selector)(\\\\()(?:\\\\s*([gs]etter)\\\\s*(:))?","beginCaptures":{"1":{"name":"support.function.selector-reference.swift"},"2":{"name":"punctuation.definition.arguments.begin.swift"},"3":{"name":"support.variable.parameter.swift"},"4":{"name":"punctuation.separator.argument-label.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"patterns":[{"include":"#expressions"}]},{"include":"#literals-regular-expression-literal"}]},"literals-boolean":{"match":"\\\\b(true|false)\\\\b","name":"constant.language.boolean.swift"},"literals-numeric":{"patterns":[{"match":"(\\\\B-|\\\\b)(?<![]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)[0-9][0-9_]*(?=\\\\.[0-9]|[Ee])(?:\\\\.[0-9][0-9_]*)?(?:[Ee][-+]?[0-9][0-9_]*)?\\\\b(?!\\\\.[0-9])","name":"constant.numeric.float.decimal.swift"},{"match":"(\\\\B-|\\\\b)(?<![]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)(0x\\\\h[_\\\\h]*)(?:\\\\.\\\\h[_\\\\h]*)?[Pp][-+]?[0-9][0-9_]*\\\\b(?!\\\\.[0-9])","name":"constant.numeric.float.hexadecimal.swift"},{"match":"(\\\\B-|\\\\b)(?<![]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)(0x\\\\h[_\\\\h]*)(?:\\\\.\\\\h[_\\\\h]*)?[Pp][-+]?\\\\w*\\\\b(?!\\\\.[0-9])","name":"invalid.illegal.numeric.float.invalid-exponent.swift"},{"match":"(\\\\B-|\\\\b)(?<![]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)(0x\\\\h[_\\\\h]*)\\\\.[0-9][.\\\\w]*","name":"invalid.illegal.numeric.float.missing-exponent.swift"},{"match":"(?<=\\\\s|^)-?\\\\.[0-9][.\\\\w]*","name":"invalid.illegal.numeric.float.missing-leading-zero.swift"},{"match":"(\\\\B-|\\\\b)0[box]_[_\\\\h]*(?:[EPep][-+]?\\\\w+)?[.\\\\w]+","name":"invalid.illegal.numeric.leading-underscore.swift"},{"match":"(?<=[]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)[0-9]+\\\\b"},{"match":"(\\\\B-|\\\\b)(?<![]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)0b[01][01_]*\\\\b(?!\\\\.[0-9])","name":"constant.numeric.integer.binary.swift"},{"match":"(\\\\B-|\\\\b)(?<![]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)0o[0-7][0-7_]*\\\\b(?!\\\\.[0-9])","name":"constant.numeric.integer.octal.swift"},{"match":"(\\\\B-|\\\\b)(?<![]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)[0-9][0-9_]*\\\\b(?!\\\\.[0-9])","name":"constant.numeric.integer.decimal.swift"},{"match":"(\\\\B-|\\\\b)(?<![]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)0x\\\\h[_\\\\h]*\\\\b(?!\\\\.[0-9])","name":"constant.numeric.integer.hexadecimal.swift"},{"match":"(\\\\B-|\\\\b)[0-9][.\\\\w]*","name":"invalid.illegal.numeric.other.swift"}]},"literals-regular-expression-literal":{"patterns":[{"begin":"(#+)/\\\\n","end":"/\\\\1","name":"string.regexp.block.swift","patterns":[{"include":"#literals-regular-expression-literal-regex-guts"},{"include":"#literals-regular-expression-literal-line-comment"}]},{"captures":{"0":{"patterns":[{"include":"#literals-regular-expression-literal-regex-guts"}]},"1":{"name":"punctuation.definition.string.begin.regexp.swift"},"3":{"name":"punctuation.definition.string.end.regexp.swift"}},"match":"(/)(?!\\\\s)(?!/)(?:\\\\\\\\\\\\s(?=/)|(?<guts>(?>(?:\\\\\\\\Q(?:(?!\\\\\\\\E)(?!/).)*+(?:\\\\\\\\E|(?=/))|\\\\\\\\.|\\\\(\\\\?#[^)]*\\\\)|\\\\(\\\\?(?>\\\\{(?:[^{].*?|\\\\{[^{].*?}|\\\\{\\\\{[^{].*?}}|\\\\{\\\\{\\\\{[^{].*?}}}|\\\\{\\\\{\\\\{\\\\{[^{].*?}}}}|\\\\{\\\\{\\\\{\\\\{\\\\{.+?}}}}})})(?:\\\\[(?!\\\\d)\\\\w+])?[<>X]?\\\\)|\\\\[(?:\\\\\\\\.|[^]\\\\[\\\\\\\\]|\\\\[(?:\\\\\\\\.|[^]\\\\[\\\\\\\\]|\\\\[(?:\\\\\\\\.|[^]\\\\[\\\\\\\\]|\\\\[(?:\\\\\\\\.|[^]\\\\[\\\\\\\\])+])+])+])+]|\\\\(\\\\g<guts>?+\\\\)|(?:(?!/)[^()\\\\[\\\\\\\\])+)+))?+(?<!\\\\s))(/)","name":"string.regexp.line.swift"},{"captures":{"0":{"patterns":[{"include":"#literals-regular-expression-literal-regex-guts"}]},"1":{"name":"punctuation.definition.string.begin.regexp.swift"},"4":{"name":"punctuation.definition.string.end.regexp.swift"},"5":{"name":"invalid.illegal.returns-not-allowed.regexp"}},"match":"((#+)/)(?<guts>(?>(?:\\\\\\\\Q(?:(?!\\\\\\\\E)(?!/\\\\2).)*+(?:\\\\\\\\E|(?=/\\\\2))|\\\\\\\\.|\\\\(\\\\?#[^)]*\\\\)|\\\\(\\\\?(?>\\\\{(?:[^{].*?|\\\\{[^{].*?}|\\\\{\\\\{[^{].*?}}|\\\\{\\\\{\\\\{[^{].*?}}}|\\\\{\\\\{\\\\{\\\\{[^{].*?}}}}|\\\\{\\\\{\\\\{\\\\{\\\\{.+?}}}}})})(?:\\\\[(?!\\\\d)\\\\w+])?[<>X]?\\\\)|\\\\[(?:\\\\\\\\.|[^]\\\\[\\\\\\\\]|\\\\[(?:\\\\\\\\.|[^]\\\\[\\\\\\\\]|\\\\[(?:\\\\\\\\.|[^]\\\\[\\\\\\\\]|\\\\[(?:\\\\\\\\.|[^]\\\\[\\\\\\\\])+])+])+])+]|\\\\(\\\\g<guts>?+\\\\)|(?:(?!/\\\\2)[^()\\\\[\\\\\\\\])+)+))?+(/\\\\2)|#+/.+(\\\\n)","name":"string.regexp.line.extended.swift"}]},"literals-regular-expression-literal-backreference-or-subpattern":{"patterns":[{"captures":{"1":{"name":"constant.character.escape.backslash.regexp"},"2":{"name":"variable.other.group-name.regexp"},"3":{"name":"keyword.operator.recursion-level.regexp"},"4":{"name":"constant.numeric.integer.decimal.regexp"},"5":{"name":"constant.numeric.integer.decimal.regexp"},"6":{"name":"keyword.operator.recursion-level.regexp"},"7":{"name":"constant.numeric.integer.decimal.regexp"},"8":{"name":"constant.character.escape.backslash.regexp"}},"match":"(\\\\\\\\g\\\\{)(?:((?!\\\\d)\\\\w+)(?:([-+])(\\\\d+))?|([-+]?\\\\d+)(?:([-+])(\\\\d+))?)(})"},{"captures":{"1":{"name":"constant.character.escape.backslash.regexp"},"2":{"name":"constant.numeric.integer.decimal.regexp"},"3":{"name":"keyword.operator.recursion-level.regexp"},"4":{"name":"constant.numeric.integer.decimal.regexp"}},"match":"(\\\\\\\\g)([-+]?\\\\d+)(?:([-+])(\\\\d+))?"},{"captures":{"1":{"name":"constant.character.escape.backslash.regexp"},"2":{"name":"variable.other.group-name.regexp"},"3":{"name":"keyword.operator.recursion-level.regexp"},"4":{"name":"constant.numeric.integer.decimal.regexp"},"5":{"name":"constant.numeric.integer.decimal.regexp"},"6":{"name":"keyword.operator.recursion-level.regexp"},"7":{"name":"constant.numeric.integer.decimal.regexp"},"8":{"name":"constant.character.escape.backslash.regexp"}},"match":"(\\\\\\\\[gk]<)(?:((?!\\\\d)\\\\w+)(?:([-+])(\\\\d+))?|([-+]?\\\\d+)(?:([-+])(\\\\d+))?)(>)"},{"captures":{"1":{"name":"constant.character.escape.backslash.regexp"},"2":{"name":"variable.other.group-name.regexp"},"3":{"name":"keyword.operator.recursion-level.regexp"},"4":{"name":"constant.numeric.integer.decimal.regexp"},"5":{"name":"constant.numeric.integer.decimal.regexp"},"6":{"name":"keyword.operator.recursion-level.regexp"},"7":{"name":"constant.numeric.integer.decimal.regexp"},"8":{"name":"constant.character.escape.backslash.regexp"}},"match":"(\\\\\\\\[gk]\')(?:((?!\\\\d)\\\\w+)(?:([-+])(\\\\d+))?|([-+]?\\\\d+)(?:([-+])(\\\\d+))?)(\')"},{"captures":{"1":{"name":"constant.character.escape.backslash.regexp"},"2":{"name":"variable.other.group-name.regexp"},"3":{"name":"keyword.operator.recursion-level.regexp"},"4":{"name":"constant.numeric.integer.decimal.regexp"},"5":{"name":"constant.character.escape.backslash.regexp"}},"match":"(\\\\\\\\k\\\\{)((?!\\\\d)\\\\w+)(?:([-+])(\\\\d+))?(})"},{"match":"\\\\\\\\[1-9][0-9]+","name":"keyword.other.back-reference.regexp"},{"captures":{"1":{"name":"keyword.other.back-reference.regexp"},"2":{"name":"variable.other.group-name.regexp"},"3":{"name":"keyword.operator.recursion-level.regexp"},"4":{"name":"constant.numeric.integer.decimal.regexp"},"5":{"name":"keyword.other.back-reference.regexp"}},"match":"(\\\\(\\\\?(?:P[=>]|&))((?!\\\\d)\\\\w+)(?:([-+])(\\\\d+))?(\\\\))"},{"match":"\\\\(\\\\?R\\\\)","name":"keyword.other.back-reference.regexp"},{"captures":{"1":{"name":"keyword.other.back-reference.regexp"},"2":{"name":"constant.numeric.integer.decimal.regexp"},"3":{"name":"keyword.operator.recursion-level.regexp"},"4":{"name":"constant.numeric.integer.decimal.regexp"},"5":{"name":"keyword.other.back-reference.regexp"}},"match":"(\\\\(\\\\?)([-+]?\\\\d+)(?:([-+])(\\\\d+))?(\\\\))"}]},"literals-regular-expression-literal-backtracking-directive-or-global-matching-option":{"captures":{"1":{"name":"keyword.control.directive.regexp"},"2":{"name":"keyword.control.directive.regexp"},"3":{"name":"keyword.control.directive.regexp"},"4":{"name":"variable.language.tag.regexp"},"5":{"name":"keyword.control.directive.regexp"},"6":{"name":"keyword.operator.assignment.regexp"},"7":{"name":"constant.numeric.integer.decimal.regexp"},"8":{"name":"keyword.control.directive.regexp"},"9":{"name":"keyword.control.directive.regexp"}},"match":"(\\\\(\\\\*)(?:(ACCEPT|FAIL|F|MARK(?=:)|(?=:)|COMMIT|PRUNE|SKIP|THEN)(?:(:)([^)]+))?|(LIMIT_(?:DEPTH|HEAP|MATCH))(=)(\\\\d+)|(CRLF|CR|ANYCRLF|ANY|LF|NUL|BSR_ANYCRLF|BSR_UNICODE|NOTEMPTY_ATSTART|NOTEMPTY|NO_AUTO_POSSESS|NO_DOTSTAR_ANCHOR|NO_JIT|NO_START_OPT|UTF|UCP))(\\\\))"},"literals-regular-expression-literal-callout":{"captures":{"1":{"name":"punctuation.definition.group.regexp"},"2":{"name":"keyword.control.callout.regexp"},"3":{"name":"constant.numeric.integer.decimal.regexp"},"4":{"name":"entity.name.function.callout.regexp"},"5":{"name":"entity.name.function.callout.regexp"},"6":{"name":"entity.name.function.callout.regexp"},"7":{"name":"entity.name.function.callout.regexp"},"8":{"name":"entity.name.function.callout.regexp"},"9":{"name":"entity.name.function.callout.regexp"},"10":{"name":"entity.name.function.callout.regexp"},"11":{"name":"entity.name.function.callout.regexp"},"12":{"name":"punctuation.definition.group.regexp"},"13":{"name":"punctuation.definition.group.regexp"},"14":{"name":"keyword.control.callout.regexp"},"15":{"name":"entity.name.function.callout.regexp"},"16":{"name":"variable.language.tag-name.regexp"},"17":{"name":"punctuation.definition.group.regexp"},"18":{"name":"punctuation.definition.group.regexp"},"19":{"name":"keyword.control.callout.regexp"},"21":{"name":"variable.language.tag-name.regexp"},"22":{"name":"keyword.control.callout.regexp"},"23":{"name":"punctuation.definition.group.regexp"}},"match":"(\\\\()(?<keyw>\\\\?C)(?:(?<num>\\\\d+)|`(?<name>(?:[^`]|``)*)`|\'(?<name>(?:[^\']|\'\')*)\'|\\"(?<name>(?:[^\\"]|\\"\\")*)\\"|\\\\^(?<name>(?:[^^]|\\\\^\\\\^)*)\\\\^|%(?<name>(?:[^%]|%%)*)%|#(?<name>(?:[^#]|##)*)#|\\\\$(?<name>(?:[^$]|\\\\$\\\\$)*)\\\\$|\\\\{(?<name>(?:[^}]|}})*)})?(\\\\))|(\\\\()(?<keyw>\\\\*)(?<name>(?!\\\\d)\\\\w+)(?:\\\\[(?<tag>(?!\\\\d)\\\\w+)])?(?:\\\\{[^,}]+(?:,[^,}]+)*})?(\\\\))|(\\\\()(?<keyw>\\\\?)(?>(\\\\{(?:\\\\g<20>|(?!\\\\{).*?)}))(?:\\\\[(?<tag>(?!\\\\d)\\\\w+)])?(?<keyw>[<>X]?)(\\\\))","name":"meta.callout.regexp"},"literals-regular-expression-literal-character-properties":{"captures":{"1":{"name":"support.variable.character-property.regexp"},"2":{"name":"punctuation.definition.character-class.regexp"},"3":{"name":"support.variable.character-property.regexp"},"4":{"name":"punctuation.definition.character-class.regexp"}},"match":"\\\\\\\\[Pp]\\\\{([-\\\\s\\\\w]+(?:=[-\\\\s\\\\w]+)?)}|(\\\\[:)([-\\\\s\\\\w]+(?:=[-\\\\s\\\\w]+)?)(:])","name":"constant.other.character-class.set.regexp"},"literals-regular-expression-literal-custom-char-class":{"patterns":[{"begin":"(\\\\[)(\\\\^)?","beginCaptures":{"1":{"name":"punctuation.definition.character-class.regexp"},"2":{"name":"keyword.operator.negation.regexp"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.character-class.regexp"}},"name":"constant.other.character-class.set.regexp","patterns":[{"include":"#literals-regular-expression-literal-custom-char-class-members"}]}]},"literals-regular-expression-literal-custom-char-class-members":{"patterns":[{"match":"\\\\\\\\b","name":"constant.character.escape.backslash.regexp"},{"include":"#literals-regular-expression-literal-custom-char-class"},{"include":"#literals-regular-expression-literal-quote"},{"include":"#literals-regular-expression-literal-set-operators"},{"include":"#literals-regular-expression-literal-unicode-scalars"},{"include":"#literals-regular-expression-literal-character-properties"}]},"literals-regular-expression-literal-group-option-toggle":{"match":"\\\\(\\\\?(?:\\\\^(?:[DJPSUWimnswx]|xx|y\\\\{[gw]})*|(?:[DJPSUWimnswx]|xx|y\\\\{[gw]})+|(?:[DJPSUWimnswx]|xx|y\\\\{[gw]})*-(?:[DJPSUWimnswx]|xx|y\\\\{[gw]})*)\\\\)","name":"keyword.other.option-toggle.regexp"},"literals-regular-expression-literal-group-or-conditional":{"patterns":[{"begin":"(\\\\()(\\\\?~)","beginCaptures":{"1":{"name":"punctuation.definition.group.regexp"},"2":{"name":"keyword.control.conditional.absent.regexp"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.regexp"}},"name":"meta.group.absent.regexp","patterns":[{"include":"#literals-regular-expression-literal-regex-guts"}]},{"begin":"(\\\\()(?<cond>\\\\?\\\\()(?:(?<NumberRef>(?<num>[-+]?\\\\d+)(?:(?<op>[-+])(?<num>\\\\d+))?)|(?<cond>R)\\\\g<NumberRef>?|(?<cond>R&)(?<NamedRef>(?<name>(?!\\\\d)\\\\w+)(?:(?<op>[-+])(?<num>\\\\d+))?)|(?<cond><)(?:\\\\g<NamedRef>|\\\\g<NumberRef>)(?<cond>>)|(?<cond>\')(?:\\\\g<NamedRef>|\\\\g<NumberRef>)(?<cond>\')|(?<cond>DEFINE)|(?<cond>VERSION)(?<compar>>?=)(?<num>\\\\d+\\\\.\\\\d+))(?<cond>\\\\))|(\\\\()(?<cond>\\\\?)(?=\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.group.regexp"},"2":{"name":"keyword.control.conditional.regexp"},"4":{"name":"constant.numeric.integer.decimal.regexp"},"5":{"name":"keyword.operator.recursion-level.regexp"},"6":{"name":"constant.numeric.integer.decimal.regexp"},"7":{"name":"keyword.control.conditional.regexp"},"8":{"name":"keyword.control.conditional.regexp"},"10":{"name":"variable.other.group-name.regexp"},"11":{"name":"keyword.operator.recursion-level.regexp"},"12":{"name":"constant.numeric.integer.decimal.regexp"},"13":{"name":"keyword.control.conditional.regexp"},"14":{"name":"keyword.control.conditional.regexp"},"15":{"name":"keyword.control.conditional.regexp"},"16":{"name":"keyword.control.conditional.regexp"},"17":{"name":"keyword.control.conditional.regexp"},"18":{"name":"keyword.control.conditional.regexp"},"19":{"name":"keyword.operator.comparison.regexp"},"20":{"name":"constant.numeric.integer.decimal.regexp"},"21":{"name":"keyword.control.conditional.regexp"},"22":{"name":"punctuation.definition.group.regexp"},"23":{"name":"keyword.control.conditional.regexp"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.regexp"}},"name":"meta.group.conditional.regexp","patterns":[{"include":"#literals-regular-expression-literal-regex-guts"}]},{"begin":"(\\\\()((\\\\?)(?:([!*:=>|]|<[!*=])|P?<(?:((?!\\\\d)\\\\w+)(-))?((?!\\\\d)\\\\w+)>|\'(?:((?!\\\\d)\\\\w+)(-))?((?!\\\\d)\\\\w+)\'|(?:\\\\^(?:[DJPSUWimnswx]|xx|y\\\\{[gw]})*|(?:[DJPSUWimnswx]|xx|y\\\\{[gw]})+|(?:[DJPSUWimnswx]|xx|y\\\\{[gw]})*-(?:[DJPSUWimnswx]|xx|y\\\\{[gw]})*):)|\\\\*(atomic|pla|positive_lookahead|nla|negative_lookahead|plb|positive_lookbehind|nlb|negative_lookbehind|napla|non_atomic_positive_lookahead|naplb|non_atomic_positive_lookbehind|sr|script_run|asr|atomic_script_run):)?+","beginCaptures":{"1":{"name":"punctuation.definition.group.regexp"},"2":{"name":"keyword.other.group-options.regexp"},"3":{"name":"punctuation.definition.group.regexp"},"4":{"name":"punctuation.definition.group.regexp"},"5":{"name":"variable.other.group-name.regexp"},"6":{"name":"keyword.operator.balancing-group.regexp"},"7":{"name":"variable.other.group-name.regexp"},"8":{"name":"variable.other.group-name.regexp"},"9":{"name":"keyword.operator.balancing-group.regexp"},"10":{"name":"variable.other.group-name.regexp"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.regexp"}},"name":"meta.group.regexp","patterns":[{"include":"#literals-regular-expression-literal-regex-guts"}]}]},"literals-regular-expression-literal-line-comment":{"captures":{"1":{"name":"punctuation.definition.comment.regexp"}},"match":"(#).*$","name":"comment.line.regexp"},"literals-regular-expression-literal-quote":{"begin":"\\\\\\\\Q","beginCaptures":{"0":{"name":"constant.character.escape.backslash.regexp"}},"end":"\\\\\\\\E|(\\\\n)","endCaptures":{"0":{"name":"constant.character.escape.backslash.regexp"},"1":{"name":"invalid.illegal.returns-not-allowed.regexp"}},"name":"string.quoted.other.regexp.swift"},"literals-regular-expression-literal-regex-guts":{"patterns":[{"include":"#literals-regular-expression-literal-quote"},{"begin":"\\\\(\\\\?#","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.regexp"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.comment.end.regexp"}},"name":"comment.block.regexp"},{"begin":"<\\\\{","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.regexp"}},"end":"}>","endCaptures":{"0":{"name":"punctuation.section.embedded.end.regexp"}},"name":"meta.embedded.expression.regexp"},{"include":"#literals-regular-expression-literal-unicode-scalars"},{"include":"#literals-regular-expression-literal-character-properties"},{"match":"[$^]|\\\\\\\\[ABGYZbyz]|\\\\\\\\K","name":"keyword.control.anchor.regexp"},{"include":"#literals-regular-expression-literal-backtracking-directive-or-global-matching-option"},{"include":"#literals-regular-expression-literal-callout"},{"include":"#literals-regular-expression-literal-backreference-or-subpattern"},{"match":"\\\\.|\\\\\\\\[CDHNORSVWXdhsvw]","name":"constant.character.character-class.regexp"},{"match":"\\\\\\\\c.","name":"constant.character.entity.control-character.regexp"},{"match":"\\\\\\\\[^c]","name":"constant.character.escape.backslash.regexp"},{"match":"\\\\|","name":"keyword.operator.or.regexp"},{"match":"[*+?]","name":"keyword.operator.quantifier.regexp"},{"match":"\\\\{(?:\\\\s*\\\\d+\\\\s*(?:,\\\\s*\\\\d*\\\\s*)?}|\\\\s*,\\\\s*\\\\d+\\\\s*})","name":"keyword.operator.quantifier.regexp"},{"include":"#literals-regular-expression-literal-custom-char-class"},{"include":"#literals-regular-expression-literal-group-option-toggle"},{"include":"#literals-regular-expression-literal-group-or-conditional"}]},"literals-regular-expression-literal-set-operators":{"patterns":[{"match":"&&","name":"keyword.operator.intersection.regexp.swift"},{"match":"--","name":"keyword.operator.subtraction.regexp.swift"},{"match":"~~","name":"keyword.operator.symmetric-difference.regexp.swift"}]},"literals-regular-expression-literal-unicode-scalars":{"match":"\\\\\\\\(?:u\\\\{\\\\s*(?:\\\\h+\\\\s*)+}|u\\\\h{4}|x\\\\{\\\\h+}|x\\\\h{0,2}|U\\\\h{8}|o\\\\{[0-7]+}|0[0-7]{0,3}|N\\\\{(?:U\\\\+\\\\h{1,8}|[-\\\\s\\\\w]+)})","name":"constant.character.numeric.regexp"},"literals-string":{"patterns":[{"begin":"\\"\\"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.swift"}},"end":"\\"\\"\\"(#*)","endCaptures":{"0":{"name":"punctuation.definition.string.end.swift"},"1":{"name":"invalid.illegal.extra-closing-delimiter.swift"}},"name":"string.quoted.double.block.swift","patterns":[{"match":"\\\\G(?:.+(?=\\"\\"\\")|.+)","name":"invalid.illegal.content-after-opening-delimiter.swift"},{"match":"\\\\\\\\\\\\s*\\\\n","name":"constant.character.escape.newline.swift"},{"include":"#literals-string-string-guts"},{"match":"\\\\S((?!\\\\\\\\\\\\().)*(?=\\"\\"\\")","name":"invalid.illegal.content-before-closing-delimiter.swift"}]},{"begin":"#\\"\\"\\"(?!#)(?=(?:[^\\"]|\\"(?!#))*$)","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.swift"}},"end":"\\"\\"\\"#(#*)","endCaptures":{"0":{"name":"punctuation.definition.string.end.swift"},"1":{"name":"invalid.illegal.extra-closing-delimiter.swift"}},"name":"string.quoted.double.block.raw.swift","patterns":[{"match":"\\\\G(?:.+(?=\\"\\"\\")|.+)","name":"invalid.illegal.content-after-opening-delimiter.swift"},{"match":"\\\\\\\\#\\\\s*\\\\n","name":"constant.character.escape.newline.swift"},{"include":"#literals-string-raw-string-guts"},{"match":"\\\\S((?!\\\\\\\\#\\\\().)*(?=\\"\\"\\")","name":"invalid.illegal.content-before-closing-delimiter.swift"}]},{"begin":"(?<!#)(##+)\\"\\"\\"(?!\\\\1)(?=(?:[^\\"]|\\"(?!\\\\1))*$)","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.swift"}},"end":"\\"\\"\\"\\\\1(#*)","endCaptures":{"0":{"name":"punctuation.definition.string.end.swift"},"1":{"name":"invalid.illegal.extra-closing-delimiter.swift"}},"name":"string.quoted.double.block.raw.swift","patterns":[{"match":"\\\\G(?:.+(?=\\"\\"\\")|.+)","name":"invalid.illegal.content-after-opening-delimiter.swift"}]},{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.swift"}},"end":"\\"(#*)","endCaptures":{"0":{"name":"punctuation.definition.string.end.swift"},"1":{"name":"invalid.illegal.extra-closing-delimiter.swift"}},"name":"string.quoted.double.single-line.swift","patterns":[{"match":"[\\\\n\\\\r]","name":"invalid.illegal.returns-not-allowed.swift"},{"include":"#literals-string-string-guts"}]},{"begin":"(?<!#)(##+)\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.raw.swift"}},"end":"\\"\\\\1(#*)","endCaptures":{"0":{"name":"punctuation.definition.string.end.raw.swift"},"1":{"name":"invalid.illegal.extra-closing-delimiter.swift"}},"name":"string.quoted.double.single-line.raw.swift","patterns":[{"match":"[\\\\n\\\\r]","name":"invalid.illegal.returns-not-allowed.swift"}]},{"begin":"#\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.raw.swift"}},"end":"\\"#(#*)","endCaptures":{"0":{"name":"punctuation.definition.string.end.raw.swift"},"1":{"name":"invalid.illegal.extra-closing-delimiter.swift"}},"name":"string.quoted.double.single-line.raw.swift","patterns":[{"match":"[\\\\n\\\\r]","name":"invalid.illegal.returns-not-allowed.swift"},{"include":"#literals-string-raw-string-guts"}]}]},"literals-string-raw-string-guts":{"patterns":[{"match":"\\\\\\\\#[\\"\'0\\\\\\\\nrt]","name":"constant.character.escape.swift"},{"match":"\\\\\\\\#u\\\\{\\\\h{1,8}}","name":"constant.character.escape.unicode.swift"},{"begin":"\\\\\\\\#\\\\(","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.swift"}},"contentName":"source.swift","end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.embedded.end.swift"}},"name":"meta.embedded.line.swift","patterns":[{"include":"$self"},{"begin":"\\\\(","end":"\\\\)"}]},{"match":"\\\\\\\\#.","name":"invalid.illegal.escape-not-recognized"}]},"literals-string-string-guts":{"patterns":[{"match":"\\\\\\\\[\\"\'0\\\\\\\\nrt]","name":"constant.character.escape.swift"},{"match":"\\\\\\\\u\\\\{\\\\h{1,8}}","name":"constant.character.escape.unicode.swift"},{"begin":"\\\\\\\\\\\\(","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.swift"}},"contentName":"source.swift","end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.embedded.end.swift"}},"name":"meta.embedded.line.swift","patterns":[{"include":"$self"},{"begin":"\\\\(","end":"\\\\)"}]},{"match":"\\\\\\\\.","name":"invalid.illegal.escape-not-recognized"}]},"member-reference":{"patterns":[{"captures":{"1":{"name":"variable.other.swift"},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"}},"match":"(?<=\\\\.)((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))"}]},"operators":{"patterns":[{"match":"\\\\b(is\\\\b|as([!?]\\\\B|\\\\b))","name":"keyword.operator.type-casting.swift"},{"begin":"(?=(?<oph>[-!%\\\\&*+/<-?^|~¡-§©«¬®°±¶»¿×÷‖‗†-‧‰-‾⁁-⁓⁕-⁞←-⏿─-❵➔-⯿⸀-、。〃〈-〰])|\\\\.(\\\\g<oph>|[.̀-ͯ᷀-᷿⃐-︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))","end":"(?!\\\\G)","patterns":[{"captures":{"0":{"patterns":[{"match":"\\\\G(\\\\+\\\\+|--)$","name":"keyword.operator.increment-or-decrement.swift"},{"match":"\\\\G([-+])$","name":"keyword.operator.arithmetic.unary.swift"},{"match":"\\\\G!$","name":"keyword.operator.logical.not.swift"},{"match":"\\\\G~$","name":"keyword.operator.bitwise.not.swift"},{"match":".+","name":"keyword.operator.custom.prefix.swift"}]}},"match":"\\\\G(?<=^|[(,:;\\\\[{\\\\s])((?!(//|/\\\\*|\\\\*/))([-!%\\\\&*+/<-?^|~¡-§©«¬®°±¶»¿×÷̀-ͯ᷀-᷿‖‗†-‧‰-‾⁁-⁓⁕-⁞⃐-←-⏿─-❵➔-⯿⸀-、。〃〈-〰︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))++(?![]),:;}\\\\s]|\\\\z)"},{"captures":{"0":{"patterns":[{"match":"\\\\G(\\\\+\\\\+|--)$","name":"keyword.operator.increment-or-decrement.swift"},{"match":"\\\\G!$","name":"keyword.operator.increment-or-decrement.swift"},{"match":".+","name":"keyword.operator.custom.postfix.swift"}]}},"match":"\\\\G(?<!^|[(,:;\\\\[{\\\\s])((?!(//|/\\\\*|\\\\*/))([-!%\\\\&*+/<-?^|~¡-§©«¬®°±¶»¿×÷̀-ͯ᷀-᷿‖‗†-‧‰-‾⁁-⁓⁕-⁞⃐-←-⏿─-❵➔-⯿⸀-、。〃〈-〰︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))++(?=[]),:;}\\\\s]|\\\\z)"},{"captures":{"0":{"patterns":[{"match":"\\\\G=$","name":"keyword.operator.assignment.swift"},{"match":"\\\\G([-%*+/]|<<|>>|[\\\\&^|]|&&|\\\\|\\\\|)=$","name":"keyword.operator.assignment.compound.swift"},{"match":"\\\\G([-*+/])$","name":"keyword.operator.arithmetic.swift"},{"match":"\\\\G&([-*+])$","name":"keyword.operator.arithmetic.overflow.swift"},{"match":"\\\\G%$","name":"keyword.operator.arithmetic.remainder.swift"},{"match":"\\\\G(==|!=|[<>]|>=|<=|~=)$","name":"keyword.operator.comparison.swift"},{"match":"\\\\G\\\\?\\\\?$","name":"keyword.operator.coalescing.swift"},{"match":"\\\\G(&&|\\\\|\\\\|)$","name":"keyword.operator.logical.swift"},{"match":"\\\\G([\\\\&^|]|<<|>>)$","name":"keyword.operator.bitwise.swift"},{"match":"\\\\G([!=]==)$","name":"keyword.operator.bitwise.swift"},{"match":"\\\\G\\\\?$","name":"keyword.operator.ternary.swift"},{"match":".+","name":"keyword.operator.custom.infix.swift"}]}},"match":"\\\\G((?!(//|/\\\\*|\\\\*/))([-!%\\\\&*+/<-?^|~¡-§©«¬®°±¶»¿×÷̀-ͯ᷀-᷿‖‗†-‧‰-‾⁁-⁓⁕-⁞⃐-←-⏿─-❵➔-⯿⸀-、。〃〈-〰︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))++"},{"captures":{"0":{"patterns":[{"match":".+","name":"keyword.operator.custom.prefix.dot.swift"}]}},"match":"\\\\G(?<=^|[(,:;\\\\[{\\\\s])\\\\.((?!(//|/\\\\*|\\\\*/))([-!%\\\\&*+./<-?^|~¡-§©«¬®°±¶»¿×÷̀-ͯ᷀-᷿‖‗†-‧‰-‾⁁-⁓⁕-⁞⃐-←-⏿─-❵➔-⯿⸀-、。〃〈-〰︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))++(?![]),:;}\\\\s]|\\\\z)"},{"captures":{"0":{"patterns":[{"match":".+","name":"keyword.operator.custom.postfix.dot.swift"}]}},"match":"\\\\G(?<!^|[(,:;\\\\[{\\\\s])\\\\.((?!(//|/\\\\*|\\\\*/))([-!%\\\\&*+./<-?^|~¡-§©«¬®°±¶»¿×÷̀-ͯ᷀-᷿‖‗†-‧‰-‾⁁-⁓⁕-⁞⃐-←-⏿─-❵➔-⯿⸀-、。〃〈-〰︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))++(?=[]),:;}\\\\s]|\\\\z)"},{"captures":{"0":{"patterns":[{"match":"\\\\G\\\\.\\\\.[.<]$","name":"keyword.operator.range.swift"},{"match":".+","name":"keyword.operator.custom.infix.dot.swift"}]}},"match":"\\\\G\\\\.((?!(//|/\\\\*|\\\\*/))([-!%\\\\&*+./<-?^|~¡-§©«¬®°±¶»¿×÷̀-ͯ᷀-᷿‖‗†-‧‰-‾⁁-⁓⁕-⁞⃐-←-⏿─-❵➔-⯿⸀-、。〃〈-〰︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))++"}]},{"match":":","name":"keyword.operator.ternary.swift"}]},"root":{"patterns":[{"include":"#compiler-control"},{"include":"#declarations"},{"include":"#expressions"}]}},"scopeName":"source.swift"}')),t=[e];export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aj as Tr,l as Ln,c as d,au as No}from"./index-4qPcqjHt.js";var Oo=5,ze=1e-5,Ve=1e-6;function Je(t){const e=[];for(let n=0;n<t.length-1;n++)e.push({a:t[n],b:t[n+1]});return e}d(Je,"buildSegmentList");function Do(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,f=o.x-n.x,a=o.y-n.y,l=s*a-r*f;if(l===0)return null;const c=n.x-t.x,g=n.y-t.y,p=(c*a-g*f)/l,I=(c*r-g*s)/l;return p<=Ve||p>=1-Ve||I<=Ve||I>=1-Ve?null:{point:{x:t.x+p*s,y:t.y+p*r},tA:p,tB:I}}d(Do,"segmentIntersection");function En(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}d(En,"isHorizontalSeg");function Ho(t){const e=[];for(let n=0;n<t.length;n++){const o=t[n],s=Je(o.points);for(let r=n+1;r<t.length;r++){const f=t[r],a=Je(f.points);for(const[l,c]of s.entries())for(const[g,p]of a.entries()){const I=Do(c.a,c.b,p.a,p.b);if(!I)continue;const u=En(c),h=En(p);(u!==h?u:!1)?e.push({jumpEdgeId:o.id,otherEdgeId:f.id,segIndex:l,t:I.tA,point:I.point}):e.push({jumpEdgeId:f.id,otherEdgeId:o.id,segIndex:g,t:I.tB,point:I.point})}}}return e}d(Ho,"findEdgeIntersections");function le(t){const e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}d(le,"fmt");function Oe(t){return`${le(t.x)},${le(t.y)}`}d(Oe,"pointToString");function Xo(t){const e=t.b.x-t.a.x,n=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(n)?e>=0?1:0:n>=0?1:0}d(Xo,"getArcSweepFlag");var Ar=.001;function Yo(t,e){if(t.length<2)return t.map(r=>({...r}));const n=t.map(r=>({...r})),o=e.arrowTypeStart&&No[e.arrowTypeStart];if(o){const r=t[0],f=t[1],a=Math.atan2(f.y-r.y,f.x-r.x);n[0].x=r.x+o*Math.cos(a),n[0].y=r.y+o*Math.sin(a)}const s=e.arrowTypeEnd&&No[e.arrowTypeEnd];if(s){const r=t.length,f=t[r-2],a=t[r-1],l=Math.atan2(a.y-f.y,a.x-f.x);n[r-1].x=a.x-s*Math.cos(l),n[r-1].y=a.y-s*Math.sin(l)}return n}d(Yo,"applyMarkerOffsets");function Go(t,e,n,o,s){const r=t.point.x,f=t.point.y,a={x:r-e*t.r,y:f-n*t.r},l={x:r+e*t.r,y:f+n*t.r},c=[`L${Oe(a)}`];return s==="arc"?c.push(`A${le(t.r)},${le(t.r)} 0 0 ${o} ${Oe(l)}`):c.push(`M${Oe(l)}`),c}d(Go,"emitJump");function Tn(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,f=n.x-e.x,a=n.y-e.y,l=Math.hypot(s,r),c=Math.hypot(f,a);if(l<ze||c<ze)return null;const g=s/l,p=r/l,I=f/c,u=a/c,h=g*I+p*u,i=Math.max(-1,Math.min(1,h)),x=Math.acos(i);if(x<ze||Math.abs(Math.PI-x)<ze)return null;const C=Math.min(o/Math.sin(x/2),l/2,c/2);return{startX:e.x-g*C,startY:e.y-p*C,endX:e.x+I*C,endY:e.y+u*C,ctrlX:e.x,ctrlY:e.y,cutLen:C}}d(Tn,"computeRoundedCorner");function $o(t,e,n){const o=t.points;if(o.length<2)return"";const s=Yo(o,t),r=t.curve==="rounded",f=Je(s),a=new Map;for(const c of e){const g=f[c.segIndex];if(!g)continue;const p=Math.hypot(g.b.x-g.a.x,g.b.y-g.a.y),I=a.get(c.segIndex)??[];I.push({t:c.t,point:c.point,d:c.t*p,r:n.jumpRadius}),a.set(c.segIndex,I)}const l=[`M${Oe(s[0])}`];for(let c=0;c<f.length;c++){const g=f[c],p=Math.hypot(g.b.x-g.a.x,g.b.y-g.a.y),I=p===0?0:(g.b.x-g.a.x)/p,u=p===0?0:(g.b.y-g.a.y)/p,h=Xo(g);let i=0;if(r&&c>0){const v=Tn(s[c-1],s[c],s[c+1]??s[c],Oo);v&&(i=v.cutLen)}let x=p,C=null;r&&c<f.length-1&&(C=Tn(s[c],s[c+1],s[c+2]??s[c+1],Oo),C&&(x=p-C.cutLen));const b=[...a.get(c)??[]].sort((v,L)=>v.t-L.t);for(const v of b)v.r=Math.min(v.r,v.d-i,x-v.d);for(let v=0;v<b.length-1;v++){const L=b[v+1].d-b[v].d;if(b[v].r+b[v+1].r>L){const y=L/2;b[v].r=Math.min(b[v].r,y),b[v+1].r=Math.min(b[v+1].r,y)}}for(const v of b)v.r<Ar||l.push(...Go(v,I,u,h,n.jumpStyle));r&&C?(l.push(`L${le(C.startX)},${le(C.startY)}`),l.push(`Q${le(C.ctrlX)},${le(C.ctrlY)} ${le(C.endX)},${le(C.endY)}`)):l.push(`L${Oe(g.b)}`)}return l.join(" ")}d($o,"rewriteEdgePath");function zo(t){return/^[\d\s+,.LMelm-]*$/.test(t)}d(zo,"isStraightPath");function Vo(t){return t?t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter":!0}d(Vo,"curveSupportsLineHops");function jo(t){if(!t)return null;try{const e=typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString(),n=JSON.parse(e);if(!Array.isArray(n))return null;const o=[];for(const s of n)s&&typeof s.x=="number"&&typeof s.y=="number"&&o.push({x:s.x,y:s.y});return o.length>=2?o:null}catch{return null}}d(jo,"decodeDataPoints");function Uo(t,e,n){if(!n.enabled)return;const o=t.node();if(!o)return;const s=new Map;for(const c of e)s.set(c.id,c);const r=[],f=new Map;for(const c of e){const g=typeof CSS<"u"&&CSS.escape?CSS.escape(c.id):c.id,p=o.querySelector(`path[data-id="${g}"]`);if(!p)continue;f.set(c.id,p);const u=jo(p.getAttribute("data-points"))??c.points;r.push({...c,points:u})}const a=Ho(r);if(a.length===0)return;const l=new Map;for(const c of a){const g=l.get(c.jumpEdgeId)??[];g.push(c),l.set(c.jumpEdgeId,g)}for(const c of r){const g=l.get(c.id);if(!g||g.length===0)continue;const p=s.get(c.id),I=p==null?void 0:p.curve;if(I!==void 0&&!Vo(I))continue;const u=f.get(c.id);if(!u)continue;if(I===void 0){const v=u.getAttribute("d")??"";if(!zo(v))continue}const h=u.getAttribute("style")??"",i=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(h),x=i?Number.parseFloat(i[1]):null,C=i?Number.parseFloat(i[2]):null,b=$o(c,g,n);if(u.setAttribute("d",b),x!==null&&C!==null&&typeof u.getTotalLength=="function"){const v=u.getTotalLength(),L=Math.max(0,v-x-C),y=`0 ${x} ${L} ${C}`,M=h.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${y};`).replace(/;\s*;+/g,";");u.setAttribute("style",M)}}}d(Uo,"applyLineJumpsToSvg");function Wo(t,{measure:e}){var r,f;const n=(f=(r=t.config)==null?void 0:r.swimlane)==null?void 0:f.lineHops;if(n===!1)return;const o=n==="gap"?"gap":"arc",s=t.edges.filter(a=>Array.isArray(a.points)&&a.points.length>=2).map(a=>({id:a.id,points:a.points,curve:a.curve,arrowTypeStart:a.arrowTypeStart,arrowTypeEnd:a.arrowTypeEnd}));Uo(e.groups.edgePaths,s,{enabled:!0,jumpRadius:6,jumpStyle:o})}d(Wo,"applySwimlaneLineJumps");var In="__swimlane_default__",wr=21,Po=20;function An(t){return Math.max(t.padding??Po,Po)}d(An,"topLaneHorizontalPadding");function Ko(t){const{x:e,y:n,width:o,height:s}=t,r=t.swimlaneContentTop;if(typeof e!="number"||typeof n!="number"||typeof o!="number"||typeof s!="number"||typeof r!="number"||!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(r)||o<=0||s<=0){delete t.groupTitleRect;return}const f=n-s/2,a=Math.min(r,n+s/2),l=Math.min(wr,Math.max(0,a-f)),c=f+l;if(c<=f){delete t.groupTitleRect;return}t.groupTitleRect={left:e-o/2,right:e+o/2,top:f,bottom:c}}d(Ko,"assignTopLaneTitleRect");function qo(t){const e=t.direction,n=t.nodes??(t.nodes=[]);for(const r of t.nodes??[])r.isGroup&&!r.parentId&&(r.shape="swimlane",e&&(r.direction=e));const o=n.filter(r=>!r.isGroup&&!r.parentId);if(o.length===0)return;let s=n.find(r=>r.id===In);s?s.isGroup&&(s.shape="swimlane",e&&(s.direction=e)):(s={id:In,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},n.push(s));for(const r of o)r.parentId=In}d(qo,"prepareLayoutForSwimlanes");function Jo(t){const e=new Map;for(const l of t.nodes??[])e.set(l.id,l);const n=[];for(const l of t.edges??[]){const c=typeof l.start=="string"?l.start:void 0,g=typeof l.end=="string"?l.end:void 0;!c||!g||l.labelNodeId||n.push({id:l.id,src:c,dst:g,ref:l})}const o=t.nodes??[],s=o.filter(l=>l.isGroup),r=o.filter(l=>!l.isGroup);return{nodes:[...[...s].reverse(),...r].map(l=>l.id),edges:n,layout:t,nodeById:e}}d(Jo,"toGraphView");function Zo(t,e,n,o){const{layout:s}=t,r=t.nodeById,f=(o==null?void 0:o.layerGap)??100,a=(o==null?void 0:o.nodeGap)??40;let l=0;for(const I of e.layers){let u=0;for(const h of I){const i=r.get(h);if(!i){u++;continue}i.layer=l,i.order=u;const x=n.x[h]??u*a,C=n.y[h]??l*f;i.x=x,i.y=C,u++}l++}const c=s.nodes??[],g=new Map,p=[];for(const I of c){if(!(I!=null&&I.isGroup))continue;I.parentId||p.push(I);const u=c.filter(b=>b.parentId===I.id);let h=1/0,i=-1/0,x=1/0,C=-1/0;for(const b of u){const v=b.x??n.x[b.id],L=b.y??n.y[b.id],y=b.width??0,M=b.height??0;v!=null&&L!=null&&(h=Math.min(h,v-y/2),i=Math.max(i,v+y/2),x=Math.min(x,L-M/2),C=Math.max(C,L+M/2))}if(h===1/0||x===1/0)I.x=I.x??0,I.y=I.y??0,I.width=I.width??0,I.height=I.height??0;else{const b=I.padding??20,v=I.parentId?b:2*An(I),L=b,y=Math.max(0,i-h)+v,M=Math.max(0,C-x)+L,E=(h+i)/2,w=(x+C)/2;I.x=E,I.y=w,I.width=y,I.height=M,g.set(I.id,{minX:h,maxX:i,minY:x,maxY:C})}}if(p.length>0&&g.size>0){let I=1/0,u=-1/0,h=0;for(const i of p){const x=i.padding??20;x>h&&(h=x);const C=g.get(i.id);C&&(I=Math.min(I,C.minY),u=Math.max(u,C.maxY))}if(I!==1/0&&u!==-1/0){const i=Math.max(0,u-I),C=Math.max(h,36),b=i+2*C,v=(I+u)/2;for(const B of p)B.y=v,B.height=b,B.swimlaneContentTop=I;const L=[...p].sort((B,O)=>{const k=B.x??0,H=O.x??0;return k-H}),y=[],M=[],E=[];for(const B of L){const O=g.get(B.id);if(!O)continue;const k=Math.max(0,O.maxX-O.minX)+2*An(B),H=(O.minX+O.maxX)/2;y.push(B.id),M.push(H),E.push(k)}const w=y.length;if(w>0){const B=new Map;if(w===1)B.set(y[0],E[0]);else{const O=[];for(let j=0;j<w-1;j++)O.push(M[j+1]-M[j]);const k=new Array(w);k[0]=0;for(let j=0;j<w-1;j++)k[j+1]=2*O[j]-k[j];let H=0,P=Number.POSITIVE_INFINITY;for(let j=0;j<w;j++){const tt=E[j];j%2===0?H=Math.max(H,tt-k[j]):P=Math.min(P,k[j]-tt)}let G=H;H<=P?G=(H+P)/2:G=H;for(let j=0;j<w;j++){const tt=k[j]+(j%2===0?G:-G),ft=Math.max(E[j],tt);B.set(y[j],ft)}}for(const O of p){const k=B.get(O.id);k!=null&&(O.width=k),Ko(O)}}}}}d(Zo,"writeBackToLayoutData");var Rr="[EdgeLabelNodes]";function Qo(t){const e=[],n=[],o=new Map;for(const f of t.nodes)o.set(f.id,f);for(const f of t.edges){if(!f.label||f.label.length===0||f.isLayoutOnly||f.labelNodeId)continue;const a=f.start?o.get(f.start):void 0,l=f.end?o.get(f.end):void 0;if(!a||!l){Ln.warn(Rr,`Edge ${f.id} has missing source or target node`);continue}const c=`edge-label-${f.start}-${f.end}-${f.id}`,p=a.parentId!==l.parentId?l.parentId:a.parentId,I={id:c,label:f.label,edgeStart:f.start??"",edgeEnd:f.end??"",shape:"labelRect",width:0,height:0,isEdgeLabel:!0,isDummy:!0,parentId:p,isGroup:!1,labelStyle:Array.isArray(f.labelStyle)?f.labelStyle[0]:f.labelStyle??"",...a.dir?{dir:a.dir}:{}};e.push(I),f.labelNodeId=c,f.label=void 0,f.text=void 0;const u={id:`${f.id}-to-label`,start:f.start,end:c,type:"normal",isLayoutOnly:!0},h={id:`${f.id}-from-label`,start:c,end:f.end,type:"normal",isLayoutOnly:!0};n.push(u,h)}const s=[...t.nodes,...e],r=[...t.edges,...n];return{...t,nodes:s,edges:r}}d(Qo,"createEdgeLabelNodes");var Yt=.001;function ro(t){const e=t.x??0,n=t.y??0,o=t.width??0,s=t.height??0;return o>0&&s>0?{cx:e,cy:n,rect:Pe(e,n,o,s)}:void 0}d(ro,"measuredNodeRect");function io(t){if(t.isGroup)return;const e=ro(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}d(io,"nodeBoundsInfoFor");function ce(t,e,n=Yt){return Math.abs(t.x-e.x)<n&&Math.abs(t.y-e.y)<n}d(ce,"samePoint");function gt(t,e,n=Yt){return Math.abs(t.x-e.x)<n}d(gt,"sameX");function yt(t,e,n=Yt){return Math.abs(t.y-e.y)<n}d(yt,"sameY");function Nt(t,e,n=Yt){return yt(t,e,n)&&Math.abs(t.x-e.x)>n}d(Nt,"isHorizontalSegment");function Ot(t,e,n=Yt){return gt(t,e,n)&&Math.abs(t.y-e.y)>n}d(Ot,"isVerticalSegment");function Wt(t,e,n,o){return Math.max(0,Math.min(Math.max(t,e),Math.max(n,o))-Math.max(Math.min(t,e),Math.min(n,o)))}d(Wt,"overlapLength");function de(t,e,n=Yt){return t.horizontal&&e.horizontal&&yt(t.a,e.a,n)?Wt(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&>(t.a,e.a,n)?Wt(t.a.y,t.b.y,e.a.y,e.b.y):0}d(de,"sameAxisSegmentOverlapLength");function Be(t,e=Yt){const n=[];for(let o=0;o<t.length-1;o++){const s=t[o],r=t[o+1],f=Nt(s,r,e),a=Ot(s,r,e);(f||a)&&n.push({index:o,a:s,b:r,horizontal:f,vertical:a})}return n}d(Be,"orthogonalSegmentsForPoints");function oe(t,e=Yt){const n=Be(t,e);let o=0;for(let s=1;s<n.length;s++)n[s-1].horizontal!==n[s].horizontal&&o++;return o}d(oe,"countOrthogonalBends");function xt(t,e=Yt){const n=[];for(const o of t){const s=n.length>0?n[n.length-1]:void 0;(!s||!ce(s,o,e))&&n.push({x:o.x,y:o.y})}return n}d(xt,"dedupeConsecutivePoints");function co(t,e=Yt){if(!t||t.length!==4)return;const[n,o,s,r]=t;return Nt(n,o,e)&&Ot(o,s,e)&&Nt(s,r,e)?{kind:"HVH",p0:n,p1:o,p2:s,p3:r}:Ot(n,o,e)&&Nt(o,s,e)&&Ot(s,r,e)?{kind:"VHV",p0:n,p1:o,p2:s,p3:r}:void 0}d(co,"classifyThreeSegmentRoute");function an(t,e,n,o=0){const s=Math.min(t.x,e.x),r=Math.max(t.x,e.x),f=Math.min(t.y,e.y),a=Math.max(t.y,e.y);return r>n.left-o&&s<n.right+o&&a>n.top-o&&f<n.bottom+o}d(an,"segmentBoundsOverlapRect");function ao(t,e,n=0){return t.x>e.left+n&&t.x<e.right-n&&t.y>e.top+n&&t.y<e.bottom-n}d(ao,"pointInsideRect");function ts(t,e){return t.left<=e.left&&t.right>=e.right&&t.top<=e.top&&t.bottom>=e.bottom}d(ts,"rectContainsRect");function Ze(t,e){return t.left<e.right&&t.right>e.left&&t.top<e.bottom&&t.bottom>e.top}d(Ze,"rectsOverlap");function wn(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}d(wn,"inflateRect");function Pe(t,e,n,o){return{left:t-n/2,right:t+n/2,top:e-o/2,bottom:e+o/2}}d(Pe,"rectFromCenterSize");function te(t){var e;return(e=ro(t))==null?void 0:e.rect}d(te,"rectOfNodeBounds");function Le(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}d(Le,"portForRectSide");function lo(t,e,n,o,s,r=Yt){const f=e==="left"||e==="right",a=o==="left"||o==="right";if(f&&a){if(e==="right"&&o==="left"&&t.x<n.x||e==="left"&&o==="right"&&t.x>n.x){if(yt(t,n,r))return[t,n];const p=(t.x+n.x)/2;return[t,{x:p,y:t.y},{x:p,y:n.y},n]}if(e===o){if(yt(t,n,r))return;const p=e==="left"?Math.min(t.x,n.x)-s:Math.max(t.x,n.x)+s;return[t,{x:p,y:t.y},{x:p,y:n.y},n]}return}if(!f&&!a){if(e===o){if(gt(t,n,r))return;const I=e==="top"?Math.min(t.y,n.y)-s:Math.max(t.y,n.y)+s;return[t,{x:t.x,y:I},{x:n.x,y:I},n]}if(!(e==="bottom"&&o==="top"&&t.y<n.y||e==="top"&&o==="bottom"&&t.y>n.y))return;if(gt(t,n,r))return[t,n];const p=(t.y+n.y)/2;return[t,{x:t.x,y:p},{x:n.x,y:p},n]}if(f&&!a){const g=e==="right"&&n.x>t.x||e==="left"&&n.x<t.x,p=o==="top"&&t.y<n.y||o==="bottom"&&t.y>n.y;return g&&p?[t,{x:n.x,y:t.y},n]:void 0}const l=e==="bottom"&&n.y>t.y||e==="top"&&n.y<t.y,c=o==="left"&&t.x<n.x||o==="right"&&t.x>n.x;return l&&c?[t,{x:t.x,y:n.y},n]:void 0}d(lo,"buildOrthogonalPortPath");function fo(t,e,n,o){return e==="left"||e==="right"?[t,{x:o,y:t.y},{x:o,y:n.y},n]:[t,{x:t.x,y:o},{x:n.x,y:o},n]}d(fo,"buildSameSideTrackPath");function ln(t){const e=new Map,n=[];for(const o of t){if(o.isEdgeLabel)continue;const s=io(o);s&&(e.set(s.id,s),n.push({id:s.id,rect:s.rect}))}return{nodeInfoById:e,realNodeRects:n}}d(ln,"collectRealNodeBounds");function Me(t){const e=[],n=[];for(const o of t){const s=io(o);if(!s)continue;const r={id:s.id,rect:s.rect};o.isEdgeLabel?n.push(r):e.push(r)}return{realNodeRects:e,labelNodeRects:n}}d(Me,"collectNodeRectEntries");function es(t,{includeEdgeLabels:e=!0}={}){const n=[];for(const o of t){if(o.isGroup||!e&&o.isEdgeLabel)continue;const s=o.x??0,r=o.y??0,f=o.width??0,a=o.height??0;n.push({nodeId:o.id,...Pe(s,r,f,a)})}return n}d(es,"collectLayoutNodeRects");function uo(t,e,n=Yt){const o=t.start,s=t.end;if(!o||!s)return;const r=e.get(o),f=e.get(s);if(!(!r||!f))return{srcId:o,dstId:s,srcInfo:r,dstInfo:f,collinearX:Math.abs(r.cx-f.cx)<n,collinearY:Math.abs(r.cy-f.cy)<n}}d(uo,"getNodePairGeometry");function Pt(t,e,n,o=[],s=0){for(const r of n)if(!o.includes(r.id)&&an(t,e,r.rect,-s))return!0;return!1}d(Pt,"segmentHitsAnyRect");function ho(t,e,n,o,s=Yt,r=1e-6){const f=yt(t,e,s),a=gt(t,e,s),l=yt(n,o,s),c=gt(n,o,s);if(f&&l||a&&c||!(f||a)||!(l||c))return!1;const g=f?{a:t,b:e}:{a:n,b:o},p=a?{a:t,b:e}:{a:n,b:o},I=g.a.y,u=Math.min(g.a.x,g.b.x),h=Math.max(g.a.x,g.b.x),i=p.a.x,x=Math.min(p.a.y,p.b.y),C=Math.max(p.a.y,p.b.y);if(i<u||i>h||I<x||I>C)return!1;const b=Math.abs(i-g.a.x)<r&&Math.abs(I-g.a.y)<r||Math.abs(i-g.b.x)<r&&Math.abs(I-g.b.y)<r,v=Math.abs(i-p.a.x)<r&&Math.abs(I-p.a.y)<r||Math.abs(i-p.b.x)<r&&Math.abs(I-p.b.y)<r;return!(b&&v)}d(ho,"orthogonalSegmentsCross");function ns(t,e,n,o,s=Yt){const r=yt(t,e,s),f=gt(t,e,s),a=yt(n,o,s),l=gt(n,o,s);return f&&l&>(t,n,s)?Wt(t.y,e.y,n.y,o.y)>s:r&&a&&yt(t,n,s)?Wt(t.x,e.x,n.x,o.x)>s:!1}d(ns,"sameAxisSegmentsOverlap");function Qe(t,e,n,o,{epsilon:s=Yt,skipDegenerateOther:r=!1}={}){for(const f of n){if(f===o||f.isLayoutOnly)continue;const a=f.points;if(!(!a||a.length<2))for(let l=0;l<a.length-1;l++){const c=a[l],g=a[l+1];if(!(r&&ce(c,g,s))&&(ho(t,e,c,g,s)||ns(t,e,c,g,s)))return!0}}return!1}d(Qe,"segmentConflictsWithAnyEdge");function he(t,e,n,o,s=Yt){const r=yt(t,e,s),f=gt(t,e,s),a=yt(n,o,s),l=gt(n,o,s);if(!(r&&l||f&&a))return!1;const c=r?{a:t,b:e}:{a:n,b:o},g=r?{a:n,b:o}:{a:t,b:e},p=c.a.y,I=Math.min(c.a.x,c.b.x),u=Math.max(c.a.x,c.b.x),h=g.a.x,i=Math.min(g.a.y,g.b.y),x=Math.max(g.a.y,g.b.y);return h>I+s&&h<u-s&&p>i+s&&p<x-s}d(he,"orthogonalSegmentsStrictlyCross");function Rn(t,e,n){const o=Math.min(e,n),s=Math.max(e,n);return t>o+Yt&&t<s-Yt}d(Rn,"strictlyBetween");function os(t,e,n){return gt(t,e)&>(e,n)?Rn(e.y,t.y,n.y):yt(t,e)&&yt(e,n)?Rn(e.x,t.x,n.x):!1}d(os,"isCollinearIntermediate");function ss(t){let e=!1;const n=[];for(let o=0;o<t.length;o++){const s=n[n.length-1],r=t[o],f=o+1<t.length?t[o+1]:void 0;if(s&&f){if(ce(s,f)){o++,e=!0;continue}if(os(s,r,f)){e=!0;continue}}n.push(r)}return{points:n,changed:e}}d(ss,"simplifyPolylineOnce");function tn(t){const e=[t[0]];for(let o=1;o<t.length;o++){const s=e[e.length-1],r=t[o];if(!gt(s,r)&&!yt(s,r)){const f=e.length>=2?e[e.length-2]:void 0,l=(f?gt(f,s):!1)?{x:s.x,y:r.y}:{x:r.x,y:s.y};e.push(l)}e.push(r)}const n=[];for(const o of e){const s=n[n.length-1];(!s||!ce(s,o))&&n.push(o)}return n}d(tn,"orthogonalizePolyline");function ue(t){if(t.length<3)return t;let e=[...t];for(let n=0;n<32;n++){const o=ss(e);if(e=o.points,!o.changed)break}return e}d(ue,"simplifyPolyline");var it=.001,Nr=.5,Bo=4;function go(t,e,n){const o=t;if(o.isLayoutOnly||!o.points||o.points.length<n)return;const s=o.start?e.get(o.start):void 0,r=o.end?e.get(o.end):void 0;return{edge:o,points:o.points,srcRect:s?te(s):void 0,dstRect:r?te(r):void 0}}d(go,"endpointContextFor");function rs(t,e,n){if(yt(t,e,it))return{x:t.x<n.left?n.left:n.right,y:t.y};if(gt(t,e,it)){const o=t.y<n.top?n.top:n.bottom;return{x:t.x,y:o}}return{x:Math.min(n.right,Math.max(n.left,t.x)),y:Math.min(n.bottom,Math.max(n.top,t.y))}}d(rs,"segmentEnterPoint");function Nn(t,e,n){const o=n?1:-1;let s=n?0:t.length-1;for(;s>=0&&s<t.length&&ao(t[s],e,Nr);)s+=o;if(s<0||s>=t.length)return t;const r=s-o;if(r<0||r>=t.length)return t;const f=rs(t[s],t[r],e);return n?[f,...t.slice(s)]:[...t.slice(0,s+1),f]}d(Nn,"clipEndpoint");function is(t,e){for(const n of t){const o=go(n,e,2);if(!o)continue;let s=[...o.points];o.srcRect&&(s=Nn(s,o.srcRect,!0)),o.dstRect&&(s=Nn(s,o.dstRect,!1)),s=ue(tn(s)),s=mo(s,o.srcRect,o.dstRect),o.edge.points=ue(tn(s))}}d(is,"clipEdgeEndpointsToNodeBoundaries");function On(t,e,n,o=!1){if(yt(t,e,it)){if(e.y<n.top-it||e.y>n.bottom+it)return e;if(o){if(t.x<n.left-it)return{x:n.left,y:t.y};if(t.x>n.right+it)return{x:n.right,y:t.y}}return{x:Math.abs(e.x-n.left)<=Math.abs(e.x-n.right)?n.left:n.right,y:t.y}}if(gt(t,e,it)){if(e.x<n.left-it||e.x>n.right+it)return e;if(o){if(t.y<n.top-it)return{x:t.x,y:n.top};if(t.y>n.bottom+it)return{x:t.x,y:n.bottom}}const s=Math.abs(e.y-n.top)<=Math.abs(e.y-n.bottom);return{x:t.x,y:s?n.top:n.bottom}}return e}d(On,"snapEndpointToBoundary");function en(t,e,n){const o=t[e];for(let s=e+n;s>=0&&s<t.length;s+=n){const r=t[s];if(!ce(r,o,it))return r}return t[e+n]}d(en,"firstDistinctAdjacent");function nn(t,e){const n=t+Bo,o=e-Bo;return n<=o?{lo:n,hi:o}:{lo:(t+e)/2,hi:(t+e)/2}}d(nn,"cornerClearanceRange");function Pn(t,e,n){const{lo:o,hi:s}=nn(e,n);return Math.min(s,Math.max(o,t))}d(Pn,"clampToCornerClearance");function cs(t){const e=Math.max(...t.map(o=>o.lo)),n=Math.min(...t.map(o=>o.hi));if(!(e>n))return{lo:e,hi:n}}d(cs,"intersectRanges");function Bn(t,e){return e==="left"||e==="right"?nn(t.top,t.bottom):nn(t.left,t.right)}d(Bn,"clearanceRangeForSide");function on(t,e,n){const o=t.y>=n.top-it&&t.y<=n.bottom+it,s=t.x>=n.left-it&&t.x<=n.right+it;if(yt(t,e,it)&&o){if(Math.abs(t.x-n.left)<it)return"left";if(Math.abs(t.x-n.right)<it)return"right"}if(gt(t,e,it)&&s){if(Math.abs(t.y-n.top)<it)return"top";if(Math.abs(t.y-n.bottom)<it)return"bottom"}}d(on,"terminalSideForSegment");function Fe(t){return t==="left"||t==="right"}d(Fe,"isHorizontalSide");function as(t,e,n,o,s){const r=[],f=n?on(t,e,n):void 0,a=o?on(e,t,o):void 0;return n&&f&&Fe(f)===s&&r.push(Bn(n,f)),o&&a&&Fe(a)===s&&r.push(Bn(o,a)),r.length>0?cs(r):void 0}d(as,"straightClearanceRange");function kn(t,e,n,o,s){const r=as(t,e,n,o,s);if(!r)return;const f=s?t.y:t.x,a=Math.min(r.hi,Math.max(r.lo,f));if(!(Math.abs(a-f)<it))return s?[{x:t.x,y:a},{x:e.x,y:a}]:[{x:a,y:t.y},{x:a,y:e.y}]}d(kn,"clearStraightEndpointCornerAxis");function mo(t,e,n){if(t.length!==2)return t;const[o,s]=t;return yt(o,s,it)?kn(o,s,e,n,!0)??t:gt(o,s,it)?kn(o,s,e,n,!1)??t:t}d(mo,"clearStraightEndpointCornerConnections");function ls(t,e,n){return Fe(n)?{x:t.x,y:Pn(t.y,e.top,e.bottom)}:{x:Pn(t.x,e.left,e.right),y:t.y}}d(ls,"cornerClearedEndpoint");function fs(t,e,n,o,s,r){const f=t.map(a=>({...a}));for(let a=e;a>=0&&a<t.length;a+=n){const l=t[a];if(r&&!yt(l,o,it)||!r&&!gt(l,o,it))break;r?f[a].y=s.y:f[a].x=s.x}return f}d(fs,"moveCollinearEndpointRun");function Fn(t,e,n){if(t.length<2)return t;const o=n?0:t.length-1,s=n?1:-1,r=t[o],f=en(t,o,s);if(!f)return t;const a=on(r,f,e);if(!a)return t;const l=Fe(a),c=ls(r,e,a);return ce(r,c,it)?t:fs(t,o,s,r,c,l)}d(Fn,"clearEndpointCornerConnection");function _n(t,e,n){const o=Math.min(t.x,e.x)>=n.left-it&&Math.max(t.x,e.x)<=n.right+it,s=Math.min(t.y,e.y)>=n.top-it&&Math.max(t.y,e.y)<=n.bottom+it;if(Math.abs(t.y-n.top)<it&&Math.abs(e.y-n.top)<it&&o)return"top";if(Math.abs(t.y-n.bottom)<it&&Math.abs(e.y-n.bottom)<it&&o)return"bottom";if(Math.abs(t.x-n.left)<it&&Math.abs(e.x-n.left)<it&&s)return"left";if(Math.abs(t.x-n.right)<it&&Math.abs(e.x-n.right)<it&&s)return"right"}d(_n,"borderSideForSegment");function Dn(t,e,n,o){switch(t){case"top":return gt(e,n,it)&&n.y<o.top-it;case"bottom":return gt(e,n,it)&&n.y>o.bottom+it;case"left":return yt(e,n,it)&&n.x<o.left-it;case"right":return yt(e,n,it)&&n.x>o.right+it}}d(Dn,"leavesOutward");function Hn(t,e,n){if(t.length<3)return t;if(n){const r=_n(t[0],t[1],e);return r&&Dn(r,t[1],t[2],e)?t.slice(1):t}const o=t.length-1,s=_n(t[o-1],t[o],e);return s&&Dn(s,t[o-1],t[o-2],e)?t.slice(0,o):t}d(Hn,"collapseOwnBorderStub");function ds(t,e,n){let o=t;if(e){const r=en(o,0,1);if(r){const f=On(r,o[0],e);f!==o[0]&&(o=[f,...o.slice(1)])}o=Hn(o,e,!0)}if(n){const r=o.length-1,f=en(o,r,-1);if(f){const a=On(f,o[r],n,!0);a!==o[r]&&(o=[...o.slice(0,r),a])}o=Hn(o,n,!1)}const s=mo(o,e,n);return s!==o||o.length===2?s:(e&&(o=Fn(o,e,!0)),n&&(o=Fn(o,n,!1)),o)}d(ds,"snapAndCollapseEndpoints");function Xn(t,e){for(const n of t){const o=go(n,e,2);if(!o)continue;const s=xt(o.points,it),r=ds(s,o.srcRect,o.dstRect);if(r.length<3){o.edge.points=r;continue}const f=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];o.edge.points=f}}d(Xn,"prepareEdgeEndpointsForRenderer");function yo(t){return new Map(t.map(e=>[e.id,e]))}d(yo,"buildNodeMap");function us(t,e){let n=t.parentId,o=null;for(;n;){const s=e.get(n);if(!(s!=null&&s.isGroup))break;o=s.id,n=s.parentId}return o}d(us,"resolveTopLevelGroupId");function Yn(t,e){let n=0,o=t.parentId;for(;o;){const s=e.get(o);if(!(s!=null&&s.isGroup))break;n++,o=s.parentId}return n}d(Yn,"groupDepth");function po(t){let e=1/0,n=-1/0,o=1/0,s=-1/0;for(const r of t){const f=r.x,a=r.y;if(typeof f!="number"||typeof a!="number")continue;const l=r.width??0,c=r.height??0;e=Math.min(e,f-l/2),n=Math.max(n,f+l/2),o=Math.min(o,a-c/2),s=Math.max(s,a+c/2)}return e===1/0||o===1/0?null:{minX:e,maxX:n,minY:o,maxY:s}}d(po,"boundsForChildren");function hs(t,e){const n=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+n,t.height=Math.max(0,e.maxY-e.minY)+n}d(hs,"applyGroupBounds");function gs(t){const e=yo(t),n=t.filter(o=>o.isGroup&&o.parentId).sort((o,s)=>Yn(s,e)-Yn(o,e));for(const o of n){const s=t.filter(f=>f.parentId===o.id),r=po(s);r&&hs(o,r)}}d(gs,"recomputeNestedGroupBounds");function sn(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(l=>!l.isGroup);let r=1/0,f=-1/0;for(const l of s){const c=l[e];typeof c=="number"&&(r=Math.min(r,c),f=Math.max(f,c))}if(!Number.isFinite(r)||!Number.isFinite(f))return!1;const a=d(l=>r+f-l,"mirror");for(const l of n){const c=l[e];typeof c=="number"&&(l[e]=a(c));const g=l.groupTitleRect;g&&(l.groupTitleRect=e==="x"?{...g,left:a(g.right),right:a(g.left)}:{...g,top:a(g.bottom),bottom:a(g.top)})}for(const l of o)for(const c of l.points??[])c[e]=a(c[e]);return!0}d(sn,"mirrorAxis");function ms(t){return(t.nodes??[]).some(n=>!n.isGroup)?sn(t,"y"):!0}d(ms,"applyBtDirectionTransform");function ys(t,e="LR"){const n=t.nodes??[],o=t.edges??[],s=n.filter(P=>!P.isGroup);let r=1/0,f=1/0;for(const P of s){const G=P.x??0,j=P.y??0;G<r&&(r=G),j<f&&(f=j)}if(!Number.isFinite(r)||!Number.isFinite(f))return!1;const a=36;let l=0,c=0;for(const P of s)l+=P.width??0,c+=P.height??0;const g=l/s.length,p=c/s.length,I=p>0?Math.max(1,g/p):1;for(const P of s){const G=P.x??0,tt=((P.y??0)-f)*I+a,ft=G-r;P.x=tt,P.y=ft}for(const P of o)if(P.points)for(const G of P.points){const j=G.x,ft=(G.y-f)*I+a,Mt=j-r;G.x=ft,G.y=Mt}gs(n);const u=n.filter(P=>P.isGroup&&!P.parentId);if(u.length===0)return e==="RL"&&sn(t,"x"),!0;const h=yo(n),i=new Map;for(const P of n){if(P.isGroup)continue;const G=us(P,h);if(!G)continue;const j=i.get(G)??[];j.push(P),i.set(G,j)}let x=0;for(const P of u){const G=P.padding??0;G>x&&(x=G)}const C=[];let b=1/0,v=-1/0;for(const P of u){const G=i.get(P.id)??[],j=po(G);j&&(b=Math.min(b,j.minX),v=Math.max(v,j.maxX),C.push({lane:P,contentTop:j.minY,contentBottom:j.maxY,centerY:(j.minY+j.maxY)/2}))}if(b===1/0||v===-1/0)return!0;const L=Math.max(0,v-b),y=Math.max(x,10),M=L+2*y,E=a+M,O=(b+v)/2-M/2-a,k=O+E/2,H=Math.max(x,a);C.sort((P,G)=>P.centerY-G.centerY);for(let P=0;P<C.length;P++){const G=C[P];let j,tt;if(P===0?j=G.contentTop-H:j=(C[P-1].contentBottom+G.contentTop)/2,P===C.length-1)tt=G.contentBottom+H;else{const Ht=C[P+1];tt=(G.contentBottom+Ht.contentTop)/2}const ft=Math.max(0,tt-j),Mt=(j+tt)/2;G.lane.x=k,G.lane.y=Mt,G.lane.width=E,G.lane.height=ft,G.lane.swimlaneContentTop=G.contentTop,G.lane.groupTitleRect={left:O,right:O+a,top:j,bottom:tt}}return e==="RL"&&sn(t,"x"),!0}d(ys,"applyLrDirectionTransform");var ae=1e-6,Or=8,je=Or,Pr=[0,je,-je,2*je,-2*je];function ps(t,e){const{nodeInfoById:n,realNodeRects:o}=ln(e);for(const s of t){if(s.isLayoutOnly)continue;const r=s.points;if(!r||r.length<4)continue;const f=co(xt(r,ae),ae);if(!f)continue;const{p3:a}=f,l=f.kind==="HVH",c=uo(s,n,ae);if(!c)continue;const{srcId:g,dstId:p,srcInfo:I,dstInfo:u,collinearX:h,collinearY:i}=c;if(h||i)continue;let x;const C=I.rect;for(const b of Pr){let v,L,y;if(l){const k=u.cy>I.cy?C.bottom:C.top,H=I.cx+b;if(H<=C.left+ae||H>=C.right-ae)continue;v={x:H,y:k},L={x:H,y:a.y},y={x:a.x,y:a.y}}else{const k=u.cx>I.cx?C.right:C.left,H=I.cy+b;if(H<=C.top+ae||H>=C.bottom-ae)continue;v={x:k,y:H},L={x:a.x,y:H},y={x:a.x,y:a.y}}const M=ce(v,L,ae),E=ce(L,y,ae);if(M&&E||!M&&Pt(v,L,o,[g],1)||!E&&Pt(L,y,o,[p],1))continue;const w=!M&&Qe(v,L,t,s,{epsilon:ae,skipDegenerateOther:!0}),B=!E&&Qe(L,y,t,s,{epsilon:ae,skipDegenerateOther:!0});if(!(w||B)){M?x=[L,y]:E?x=[v,L]:x=[v,L,y];break}}x&&(s.points=x)}}d(ps,"portSwapToLShape");function xs(t,e){const{realNodeRects:r,labelNodeRects:f}=Me(e.values());for(const a of t){if(a.isLayoutOnly)continue;const l=a.points;if(!l||l.length<4)continue;const c=xt(l,.001);if(c.length<4)continue;const g=c.length-1,p=c[g],I=c[g-1],u=c[g-2],h=p.x-I.x,i=p.y-I.y,x=Math.hypot(h,i);if(x>=10||x<.001)continue;const C=I.x-u.x,b=I.y-u.y;if(Math.hypot(C,b)<.001)continue;const L=Nt(I,p,.001),y=Ot(I,p,.001),M=Nt(u,I,.001),E=Ot(u,I,.001);if(!(L&&E||y&&M))continue;const w=a.end,B=a.start,O=w?e.get(w):void 0;if(!O)continue;const k=O.x??0,H=O.y??0,P=te(O);if(!P)continue;let G,j;if(E){const J=b<0;G={x:k,y:u.y},j={x:k,y:J?P.bottom:P.top}}else{const J=C>0;G={x:u.x,y:H},j={x:J?P.right:P.left,y:H}}if(Pt(G,j,r,w?[w]:[],-2)||Pt(G,j,f,[],-2))continue;if(B){const J=e.get(B),rt=J?te(J):void 0;if(rt&&ao(G,rt,2))continue}const tt=d((J,rt)=>`${J.x.toFixed(3)},${J.y.toFixed(3)}|${rt.x.toFixed(3)},${rt.y.toFixed(3)}`,"ownSegmentKey"),ft=new Set;for(let J=0;J<c.length-1;J++)ft.add(tt(c[J],c[J+1]));const Mt=d((J,rt)=>{for(const ut of t){if(ut===a||ut.isLayoutOnly)continue;const pt=ut.points;if(!(!pt||pt.length<2))for(let St=0;St<pt.length-1;St++){const At=pt[St],Kt=pt[St+1];if(!ft.has(tt(At,Kt))&&he(J,rt,At,Kt,.001))return!0}}return!1},"segmentCrossesOtherEdge");if(Mt(G,j))continue;if(g-3>=0){const J=c[g-3],rt=[B,w].filter(ut=>!!ut);if(Pt(J,G,r,rt,-2)||Mt(J,G))continue}const _t=[...c.slice(0,g-2),G,j];a.points=_t;const nt=a.labelNodeId;if(nt){const J=e.get(nt);if(J){const rt=J.width??0,ut=J.height??0;if(rt>0&&ut>0){let pt,St,At=-1;for(let Kt=0;Kt<_t.length-1;Kt++){const qt=_t[Kt],Jt=_t[Kt+1],se=Math.hypot(Jt.x-qt.x,Jt.y-qt.y),Ee=yt(qt,Jt,.001),me=gt(qt,Jt,.001);(Ee&&se>=rt+2||me&&se>=ut+2)&&se>At&&(At=se,pt=(qt.x+Jt.x)/2,St=(qt.y+Jt.y)/2)}pt!==void 0&&St!==void 0&&(J.x=pt,J.y=St)}}}}}d(xs,"collapseShortTerminalStub");var et=.001,Xt=8,at=Be,Sn=d((t,e)=>gt(t,e,et)||yt(t,e,et),"orthogonallyAligned");function bs(t,e){const s=d((u,h)=>{const i=u.x??0,x=u.y??0,C=h.x-i,b=h.y-x;let v=(u.width??0)/2,L=(u.height??0)/2;return Math.abs(b)*v>Math.abs(C)*L?(b<0&&(L=-L),{x:i+(b===0?0:L*C/b),y:x+L}):(C<0&&(v=-v),{x:i+v,y:x+(C===0?0:v*b/C)})},"rectIntersect"),r=d((u,h)=>{const i=xt(u.points??[]);if(i.length<2)return;const x=h?u.start:u.end,C=x?e.get(x):void 0,b=C?te(C):void 0;if(!C||!x||!b)return;const v=h?i[0]:i[i.length-1],L=h?i[1]:i[i.length-2],y=s(C,v);let M=v;if(Sn(L,y)&&(M=L),gt(y,M,et))return{edge:u,edgeId:String(u.id??""),nodeId:x,atStart:h,orientation:"V",coord:y.x,min:Math.min(y.y,M.y),max:Math.max(y.y,M.y),boundary:y,railEnd:M,rect:b};if(yt(y,M,et))return{edge:u,edgeId:String(u.id??""),nodeId:x,atStart:h,orientation:"H",coord:y.y,min:Math.min(y.x,M.x),max:Math.max(y.x,M.x),boundary:y,railEnd:M,rect:b}},"terminalLaneFor"),f=d((u,h)=>Math.max(0,Math.min(u.max,h.max)-Math.max(u.min,h.min)),"projectedOverlapLength"),a=d((u,h)=>u.nodeId!==h.nodeId||u.orientation!==h.orientation?!1:u.orientation==="H"?(Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1)&>(u.boundary,h.boundary,1):(Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1)&&yt(u.boundary,h.boundary,1),"sameTerminalFace"),l=d((u,h)=>u.nodeId!==h.nodeId||u.orientation!==h.orientation?!1:f(u,h)>=Xt&&Math.abs(u.coord-h.coord)<.5,"exactTerminalLaneConflict"),c=d((u,h)=>{if(u.nodeId!==h.nodeId||u.orientation!==h.orientation||u.orientation!=="H"||u.atStart===h.atStart)return!1;const i=f(u,h);if(i<Xt)return!1;const x=u.rect.bottom-u.rect.top;return i<x||i>2*x?!1:a(u,h)&&Math.abs(u.coord-h.coord)<16},"nearTerminalLaneConflict"),g=d((u,h)=>{const i=xt(u.edge.points??[]);if(i.length<2)return;const x=u.orientation==="V"?{x:u.boundary.x+h,y:u.boundary.y}:{x:u.boundary.x,y:u.boundary.y+h},C=u.orientation==="V"?{x:u.railEnd.x+h,y:u.railEnd.y}:{x:u.railEnd.x,y:u.railEnd.y+h};if(!d(()=>Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1?yt(x,u.boundary,et)&&x.x>=u.rect.left+1&&x.x<=u.rect.right-1:Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1?gt(x,u.boundary,et)&&x.y>=u.rect.top+1&&x.y<=u.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(u.atStart){const M=i.length>1&&ce(i[1],u.railEnd,et),E=i.slice(M?2:1),w=E[0];return w&&!Sn(w,C)?void 0:[x,C,...E]}const v=i.length>1&&ce(i[i.length-2],u.railEnd,et),L=i.slice(0,v?-2:-1),y=L[L.length-1];if(!(y&&!Sn(y,C)))return[...L,C,x]},"shiftedCandidate"),p=d(u=>{const h=u.edge,i=xt(h.points??[]);if(i.length!==2)return!1;const x=h.start,C=h.end,b=x?e.get(x):void 0,v=C?e.get(C):void 0;if(!b||!v)return!1;const L=b.x??0,y=b.y??0,M=v.x??0,E=v.y??0,[w,B]=i;return yt(w,B,et)&&Math.abs(y-E)<1&&Math.abs(L-M)>1||gt(w,B,et)&&Math.abs(L-M)<1&&Math.abs(y-E)>1},"laneIsStraightCollinearConnector"),I=[-7,7,-2*7,2*7,-3*7,3*7];for(let u=0;u<8;u++){const h=t.filter(x=>!x.isLayoutOnly).flatMap(x=>[r(x,!0),r(x,!1)]).filter(x=>!!x);let i=!1;for(let x=0;x<h.length&&!i;x++)for(let C=x+1;C<h.length&&!i;C++){const b=h[x],v=h[C];if(b.edge===v.edge||!(l(b,v)||c(b,v)))continue;const L=!l(b,v),y=[b,v].sort((M,E)=>{const w=p(M),B=p(E);return w!==B?Number(w)-Number(B):+!E.atStart-+!M.atStart});for(const M of y){for(const E of I){const w=g(M,E);if(!w)continue;const B=r({...M.edge,points:w},M.atStart);if(!(!B||h.some(O=>O.edge!==M.edge&&(l(B,O)||L&&c(B,O))))){M.edge.points=w,i=!0;break}}if(i)break}}if(!i)return}}d(bs,"separateSharedRenderedTerminalLanes");function Ms(t,e){const{realNodeRects:o,labelNodeRects:s}=Me(e.values()),r=d((a,l)=>{const c=a.start,g=a.end,p=at(l);if(p.length!==l.length-1)return!1;const I=[c,g].filter(u=>!!u);for(const u of p)if(Pt(u.a,u.b,o,I,-2)||Pt(u.a,u.b,s,[],-2))return!1;for(const u of t){if(u===a||u.isLayoutOnly)continue;const h=u.points;if(!(!h||h.length<2)){for(const i of p)for(const x of at(xt(h)))if(de(i,x,.5)>=Xt||he(i.a,i.b,x.a,x.b,et))return!1}}return!0},"candidateIsSafe"),f=d((a,l)=>{if(l+4>=a.length)return;const c=a[l],g=a[l+1],p=a[l+2],I=a[l+3],u=a[l+4],h=Nt(c,g)&&Ot(g,p)&&Nt(p,I)&&Ot(I,u)&>(c,I,et)&>(c,u,et)&>(g,p,et)&&(g.x-c.x)*(I.x-p.x)<0,i=Ot(c,g)&&Nt(g,p)&&Ot(p,I)&&Nt(I,u)&&yt(c,I,et)&&yt(c,u,et)&&yt(g,p,et)&&(g.y-c.y)*(I.y-p.y)<0;if(h||i)return xt([...a.slice(0,l+1),u,...a.slice(l+5)]);if(l+5>=a.length)return;const x=a[l+5],C=Ot(c,g)&&Nt(g,p)&&Ot(p,I)&&Nt(I,u)&&Ot(u,x)&>(c,u,et)&>(c,x,et)&>(p,I,et)&&(p.x-g.x)*(u.x-I.x)<0,b=Nt(c,g)&&Ot(g,p)&&Nt(p,I)&&Ot(I,u)&&Nt(u,x)&&yt(c,u,et)&&yt(c,x,et)&&yt(p,I,et)&&(p.y-g.y)*(u.y-I.y)<0;if(!(!C&&!b))return xt([...a.slice(0,l+1),x,...a.slice(l+6)])},"withoutDogleg");for(let a=0;a<8;a++){let l=!1;for(const c of t){if(c.isLayoutOnly)continue;const g=xt(c.points??[]);for(let p=0;p<=g.length-5;p++){const I=f(g,p);if(!(!I||!r(c,I))){c.points=I,l=!0;break}}if(l)break}if(!l)return}}d(Ms,"collapseRedundantRectangularDoglegs");function Gn(t,e){const{realNodeRects:r,labelNodeRects:f}=Me(e.values()),a=t.filter(h=>!h.isLayoutOnly),l=d((h,i,x)=>xt(h===i?x??[]:h.points??[]),"pointsFor"),c=d((h,i)=>{let x=0;for(let C=0;C<a.length;C++){const b=at(l(a[C],h,i));for(let v=C+1;v<a.length;v++){const L=at(l(a[v],h,i));for(const y of b)for(const M of L)he(y.a,y.b,M.a,M.b,et)&&x++}}return x},"strictCrossingCount"),g=d(h=>{const i=at(h);if(i.length!==3)return;const x=i[1];if(!(i[0].horizontal===x.horizontal||i[2].horizontal===x.horizontal))return{index:x.index,horizontal:x.horizontal,vertical:x.vertical,segment:x}},"middleRail"),p=d((h,i)=>{const x=[h.start,h.end].filter(C=>!!C);return r.filter(C=>{if(x.includes(C.id))return!1;const b=C.rect;return i.horizontal?Wt(i.a.x,i.b.x,b.left,b.right)>=Xt&&i.a.y>=b.top-2&&i.a.y<=b.bottom+2:Wt(i.a.y,i.b.y,b.top,b.bottom)>=Xt&&i.a.x>=b.left-2&&i.a.x<=b.right+2})},"blockingRectsFor"),I=d((h,i,x)=>{const C=h.map(v=>({...v}));if(i.horizontal)C[i.index].y=x,C[i.index+1].y=x;else if(i.vertical)C[i.index].x=x,C[i.index+1].x=x;else return;const b=ue(xt(C));return at(b).length===b.length-1?b:void 0},"candidateByMovingRail"),u=d((h,i,x)=>{const C=[h.start,h.end].filter(v=>!!v),b=at(i);if(b.length!==i.length-1)return!1;for(const v of b)if(Pt(v.a,v.b,r,C,-2)||Pt(v.a,v.b,f,[],-2))return!1;for(const v of a)if(v!==h){for(const L of b)for(const y of at(l(v)))if(de(L,y,.5)>=Xt)return!1}return c(h,i)<=x},"candidateIsSafe");for(let h=0;h<8;h++){const i=c();let x=!1;for(const C of a){const b=l(C),v=g(b);if(!v)continue;const L=p(C,v.segment);if(L.length===0)continue;const y=v.horizontal?[Math.min(...L.map(M=>M.rect.top))-20,Math.max(...L.map(M=>M.rect.bottom))+20]:[Math.min(...L.map(M=>M.rect.left))-20,Math.max(...L.map(M=>M.rect.right))+20];for(const M of y){const E=I(b,v.segment,M);if(!(!E||!u(C,E,i))){C.points=E,x=!0;break}}if(x)break}if(!x)return}}d(Gn,"liftObstacleHuggingSameSideRails");function $n(t,e){const o=d(l=>{const c=l.groupTitleRect;if(!(!c||typeof c.left!="number"||typeof c.right!="number"||typeof c.top!="number"||typeof c.bottom!="number"||!Number.isFinite(c.left)||!Number.isFinite(c.right)||!Number.isFinite(c.top)||!Number.isFinite(c.bottom)||c.right<=c.left||c.bottom<=c.top))return{left:c.left,right:c.right,top:c.top,bottom:c.bottom}},"validTitleRect"),s=d(l=>{if(!l.isGroup||l.parentId)return;const c=l.direction,g=typeof c=="string"?c.toUpperCase():"";if(g==="LR"||g==="RL"||g==="BT")return;const p=o(l),I=l.y,u=l.height;if(!p||typeof I!="number"||typeof u!="number"||!Number.isFinite(I)||!Number.isFinite(u)||u<=0)return;const h=p.right-p.left,i=p.bottom-p.top;if(!(i<=0||h<i))return{node:l,rect:p}},"topLaneTitleFor"),r=d((l,c)=>{if(!l.horizontal)return!1;const g=l.a.y;return g<=c.top+et||g>=c.bottom-et?!1:Wt(l.a.x,l.b.x,c.left,c.right)>=Xt},"horizontalSegmentIntersectsTitle"),f=[...e.values()].map(s).filter(l=>!!l);if(f.length===0)return;let a=0;for(const l of t){if(l.isLayoutOnly)continue;const c=xt(l.points??[]);for(const g of at(c))for(const p of f)r(g,p.rect)&&(a=Math.max(a,p.rect.bottom-g.a.y+4))}if(!(a<=et))for(const l of f){const c=l.node.y,g=l.node.height;typeof c!="number"||typeof g!="number"||!Number.isFinite(c)||!Number.isFinite(g)||g<=0||(l.node.y=c-a/2,l.node.height=g+a,l.node.groupTitleRect={...l.rect,top:l.rect.top-a,bottom:l.rect.bottom-a})}}d($n,"liftTopLaneTitleBandsAboveRails");function zn(t,e){const o=d(c=>{const g=c.groupTitleRect;if(!(!g||typeof g.left!="number"||typeof g.right!="number"||typeof g.top!="number"||typeof g.bottom!="number"||!Number.isFinite(g.left)||!Number.isFinite(g.right)||!Number.isFinite(g.top)||!Number.isFinite(g.bottom)||g.right<=g.left||g.bottom<=g.top))return{left:g.left,right:g.right,top:g.top,bottom:g.bottom}},"validTitleRect"),s=d(c=>{if(!c.isGroup||c.parentId||c.direction!=="LR")return;const p=o(c),I=c.x,u=c.width;if(!p||typeof I!="number"||typeof u!="number"||!Number.isFinite(I)||!Number.isFinite(u)||u<=0)return;const h=p.right-p.left,i=p.bottom-p.top;if(!(h<=0||i<h))return{node:c,rect:p}},"leftLaneTitleFor"),r=d((c,g)=>{if(!c.vertical)return!1;const p=c.a.x;return p<=g.left+et||p>=g.right-et?!1:Wt(c.a.y,c.b.y,g.top,g.bottom)>=Xt},"verticalSegmentIntersectsTitle"),f=d((c,g)=>{if(!c.horizontal)return!1;const p=c.a.y;return p<=g.top+et||p>=g.bottom-et?!1:Wt(c.a.x,c.b.x,g.left,g.right)>=Xt},"horizontalSegmentIntersectsTitle"),a=[...e.values()].map(s).filter(c=>!!c);if(a.length===0)return;let l=0;for(const c of t){if(c.isLayoutOnly)continue;const g=xt(c.points??[]);for(const p of at(g))for(const I of a)if(r(p,I.rect))l=Math.max(l,I.rect.right-p.a.x+4);else if(f(p,I.rect)){const u=Math.min(p.a.x,p.b.x);l=Math.max(l,I.rect.right-u+4)}}if(!(l<=et))for(const c of a){const g=c.node.x,p=c.node.width;typeof g!="number"||typeof p!="number"||!Number.isFinite(g)||!Number.isFinite(p)||p<=0||(c.node.x=g-l/2,c.node.width=p+l,c.node.groupTitleRect={...c.rect,left:c.rect.left-l,right:c.rect.right-l})}}d(zn,"shiftLeftLaneTitleBandsLeftOfRails");function Is(t,e){const{realNodeRects:o}=Me(e.values()),s=t.filter(h=>!h.isLayoutOnly),r=d((h,i=new Map)=>xt(i.get(h)??h.points??[]),"replacementPointsFor"),f=d((h=new Map)=>{let i=0;for(let x=0;x<s.length;x++){const C=at(r(s[x],h));for(let b=x+1;b<s.length;b++){const v=at(r(s[b],h));for(const L of C)for(const y of v)he(L.a,L.b,y.a,y.b,et)&&i++}}return i},"crossingCount"),a=d((h=new Map)=>s.reduce((i,x)=>i+oe(r(x,h)),0),"totalBends"),l=d(h=>{const i=r(h);if(i.length<4)return;const x=i[i.length-2],C=i[i.length-1];if(!(!Nt(x,C,et)&&!Ot(x,C,et)))return{tailStart:x,terminal:C}},"terminalTailFor"),c=d((h,i)=>{const x=r(h);if(x.length<3)return;const C=x[0],b=x[1];let v;if(Nt(C,b,et))v={x:b.x,y:i.tailStart.y};else if(Ot(C,b,et))v={x:i.tailStart.x,y:b.y};else return;const L=ue(xt([C,b,v,i.tailStart,i.terminal]));return at(L).length===L.length-1?L:void 0},"candidateWithDestinationTail"),g=d((h,i)=>{const x=[h.start,h.end].filter(C=>!!C);for(const C of at(i))if(Pt(C.a,C.b,o,x,-2))return!0;return!1},"pathHasNodeHit"),p=d((h,i,x)=>{for(const C of s)if(C!==h){for(const b of at(i))for(const v of at(r(C,x)))if(de(b,v,.5)>=Xt)return!0}return!1},"pathHasSharedTrack"),I=d((h,i,x)=>!g(h,i)&&!p(h,i,x),"candidateIsSafe"),u=d(()=>{const h=new Map;for(const i of s){const x=i.end;if(!x||!e.has(x)||r(i).length<4)continue;const b=h.get(x)??[];b.push(i),h.set(x,b)}return h},"edgesByDestination");for(let h=0;h<4;h++){const i=f();if(i===0)return;const x=a();let C,b=i,v=x;for(const L of u().values())for(let y=0;y<L.length;y++)for(let M=y+1;M<L.length;M++){const E=L[y],w=L[M],B=l(E),O=l(w);if(!B||!O)continue;const k=c(E,O),H=c(w,B);if(!k||!H)continue;const P=new Map([[E,k],[w,H]]);if(!I(E,k,P)||!I(w,H,P))continue;const G=f(P),j=a(P);G>=i||G>b||G===b&&j>=v||(C=P,b=G,v=j)}if(!C)return;for(const[L,y]of C)L.points=y}}d(Is,"swapDestinationTerminalTailsToReduceCrossings");function Ss(t,e){const{realNodeRects:r,labelNodeRects:f}=Me(e.values()),a=t.filter(L=>!L.isLayoutOnly),l=d((L,y=new Map)=>xt(y.get(L)??L.points??[]),"replacementPointsFor"),c=d((L=new Map)=>{let y=0;for(let M=0;M<a.length;M++){const E=at(l(a[M],L));for(let w=M+1;w<a.length;w++){const B=at(l(a[w],L));for(const O of E)for(const k of B)he(O.a,O.b,k.a,k.b,et)&&y++}}return y},"strictCrossingCount"),g=d((L=new Map)=>a.reduce((y,M)=>y+oe(l(M,L)),0),"totalBends"),p=d(L=>{const y=L.start,M=L.end,E=y?e.get(y):void 0,w=M?e.get(M):void 0,B=E?te(E):void 0,O=w?te(w):void 0;return B&&O?{src:B,dst:O}:void 0},"endpointRectsFor"),I=d((L,y,M)=>{if(M.index<=0||M.index+1>=y.length-1)return;const E=p(L);if(E){if(M.vertical){const w=M.a.x,B=Math.min(E.src.left,E.dst.left),O=Math.max(E.src.right,E.dst.right),k=w<B-et?"left":w>O+et?"right":void 0;return k?{edge:L,points:y,segmentIndex:M.index,axis:"vertical",side:k,coord:w,min:Math.min(M.a.y,M.b.y),max:Math.max(M.a.y,M.b.y)}:void 0}if(M.horizontal){const w=M.a.y,B=Math.min(E.src.top,E.dst.top),O=Math.max(E.src.bottom,E.dst.bottom),k=w<B-et?"top":w>O+et?"bottom":void 0;return k?{edge:L,points:y,segmentIndex:M.index,axis:"horizontal",side:k,coord:w,min:Math.min(M.a.x,M.b.x),max:Math.max(M.a.x,M.b.x)}:void 0}}},"externalRailForSegment"),u=d(()=>{const L=[];for(const y of a){const M=l(y);for(const E of at(M)){const w=I(y,M,E);w&&L.push(w)}}return L},"collectExternalRails"),h=d((L,y)=>L.edge!==y.edge&&L.axis===y.axis&&L.side===y.side&&Wt(L.min,L.max,y.min,y.max)>=Xt,"railsInteract"),i=d(L=>{const y=[],M=new Set;for(const E of L){if(M.has(E))continue;const w=[E],B=[];for(M.add(E);w.length>0;){const O=w.pop();B.push(O);for(const k of L)!M.has(k)&&h(O,k)&&(M.add(k),w.push(k))}B.length>1&&y.push(B)}return y},"connectedComponents"),x=d(L=>{const y=[];for(const M of L)y.some(E=>Math.abs(E-M.coord)<et)||y.push(M.coord);for(;y.length<L.length;){const M=Math.min(...y),E=Math.max(...y),w=L[0].side;y.push(w==="left"||w==="top"?M-12*(L.length-y.length):E+12*(L.length-y.length))}return y},"uniqueCoordsFor"),C=d(L=>{const y=L.map(w=>w.coord),M=x(L),E=[];if(L.length<=6){const w=new Array(M.length).fill(!1),B=[],O=d(()=>{if(B.length===L.length){B.some((k,H)=>Math.abs(k-y[H])>=et)&&E.push([...B]);return}for(const[k,H]of M.entries())w[k]||(w[k]=!0,B.push(H),O(),B.pop(),w[k]=!1)},"visit");return O(),E}for(let w=0;w<y.length;w++)for(let B=w+1;B<y.length;B++){const O=[...y];[O[w],O[B]]=[O[B],O[w]],E.push(O)}return E},"coordinateAssignmentsFor"),b=d((L,y)=>{const M=new Map;for(const[w,B]of L.entries()){const O=y[w],k=M.get(B.edge)??B.points.map(H=>({x:H.x,y:H.y}));B.axis==="vertical"?(k[B.segmentIndex].x=O,k[B.segmentIndex+1].x=O):(k[B.segmentIndex].y=O,k[B.segmentIndex+1].y=O),M.set(B.edge,k)}const E=new Map;for(const[w,B]of M){const O=ue(xt(B));if(at(O).length!==O.length-1)return;E.set(w,O)}return E},"replacementsForAssignment"),v=d(L=>{for(const[y,M]of L){const E=[y.start,y.end].filter(w=>!!w);for(const w of at(M))if(Pt(w.a,w.b,r,E,-2)||Pt(w.a,w.b,f,[],-2))return!1}for(let y=0;y<a.length;y++){const M=a[y],E=L.has(M),w=at(l(M,L));for(let B=y+1;B<a.length;B++){const O=a[B];if(!E&&!L.has(O))continue;const k=at(l(O,L));for(const H of w)for(const P of k)if(de(H,P,.5)>=Xt)return!1}}return!0},"candidateIsSafe");for(let L=0;L<4;L++){const y=c();if(y===0)return;let M,E=y,w=g(),B=Number.POSITIVE_INFINITY;for(const O of i(u()))for(const k of C(O)){const H=b(O,k);if(!H||!v(H))continue;const P=c(H);if(P>=y)continue;const G=g(H),j=O.reduce((tt,ft,Mt)=>tt+Math.abs(k[Mt]-ft.coord),0);P>E||P===E&&(G>w||G===w&&j>=B)||(M=H,E=P,w=G,B=j)}if(!M)return;for(const[O,k]of M)O.points=k}}d(Ss,"reassignCrossingExternalRailChannels");function Cs(t,e){const{realNodeRects:o,labelNodeRects:s}=Me(e.values()),r=t.filter(u=>!u.isLayoutOnly),f=d((u,h,i)=>xt(u===h?i??[]:u.points??[]),"pointsFor"),a=d(u=>at(u).reduce((h,i)=>{const x=i.a.x-i.b.x,C=i.a.y-i.b.y;return h+Math.hypot(x,C)},0),"pathLength"),l=d((u,h)=>{let i=0;for(let x=0;x<r.length;x++){const C=at(f(r[x],u,h));for(let b=x+1;b<r.length;b++){const v=at(f(r[b],u,h));for(const L of C)for(const y of v)he(L.a,L.b,y.a,y.b,et)&&i++}}return i},"strictCrossingCount"),c=d((u,h)=>{if(u.horizontal){const i=u.a.y;return(Math.abs(i-h.top)<1||Math.abs(i-h.bottom)<1)&&Wt(u.a.x,u.b.x,h.left,h.right)>=Xt}if(u.vertical){const i=u.a.x;return(Math.abs(i-h.left)<1||Math.abs(i-h.right)<1)&&Wt(u.a.y,u.b.y,h.top,h.bottom)>=Xt}return!1},"segmentRunsAlongRectBorder"),g=d(u=>{const h=[u.start,u.end].filter(x=>!!x),i=[];for(const x of h){const C=e.get(x),b=C?te(C):void 0;b&&i.push(b)}return i},"endpointRectsFor"),p=d((u,h)=>{if(h+3>=u.length)return[];const i=u[h],x=u[h+1],C=u[h+2],b=u[h+3],v=Nt(i,x,et)&&Ot(x,C,et)&&Nt(C,b,et),L=Ot(i,x,et)&&Nt(x,C,et)&&Ot(C,b,et);if(!v&&!L)return[];if(!(v?Math.sign(x.x-i.x)!==Math.sign(b.x-C.x):Math.sign(x.y-i.y)!==Math.sign(b.y-C.y)))return[];const M=gt(i,b,et)||yt(i,b,et)?[]:[{x:i.x,y:b.y},{x:b.x,y:i.y}],E=M.length===0?[[...u.slice(0,h+1),...u.slice(h+3)]]:M.map(B=>[...u.slice(0,h+1),B,...u.slice(h+3)]),w=new Set;return E.map(B=>ue(xt(B))).filter(B=>{if(at(B).length!==B.length-1||!B.some(k=>ce(k,b,et)))return!1;const O=B.map(k=>`${k.x.toFixed(3)},${k.y.toFixed(3)}`).join("|");return w.has(O)?!1:(w.add(O),!0)})},"shortcutCandidatesAt"),I=d((u,h,i)=>{const x=[u.start,u.end].filter(b=>!!b),C=g(u);for(const b of at(h))if(Pt(b.a,b.b,o,x,-2)||Pt(b.a,b.b,s,[],-2)||C.some(v=>c(b,v)))return!1;for(const b of r)if(b!==u){for(const v of at(h))for(const L of at(f(b)))if(de(v,L,.5)>=Xt)return!1}return l(u,h)<=i},"candidateIsSafe");for(let u=0;u<8;u++){const h=l();let i,x,C=h,b=Number.POSITIVE_INFINITY,v=Number.POSITIVE_INFINITY;for(const L of r){const y=f(L),M=oe(y,et),E=a(y);for(let w=0;w<=y.length-4;w++)for(const B of p(y,w)){const O=oe(B,et),k=a(B);if(!(O<M||O===M&&k<E-et)||!I(L,B,h))continue;const P=l(L,B);P>C||P===C&&(O>b||O===b&&k>=v)||(i=L,x=B,C=P,b=O,v=k)}}if(!i||!x)return;i.points=x}}d(Cs,"shortcutRedundantOrthogonalJogs");function vs(t,e){const f=[];for(const R of e.values()){if(R.isGroup||R.isEdgeLabel)continue;const F=R.x??0,_=R.y??0,V=te(R);V&&f.push({id:String(R.id??""),cx:F,cy:_,rect:V})}if(f.length===0)return;const a=new Map(f.map(R=>[R.id,R])),l=f.map(R=>({id:R.id,rect:R.rect})),c=["top","bottom","left","right"],g={top:Math.min(...f.map(R=>R.rect.top))-20,bottom:Math.max(...f.map(R=>R.rect.bottom))+20,left:Math.min(...f.map(R=>R.rect.left))-20,right:Math.max(...f.map(R=>R.rect.right))+20},p=t.filter(R=>!R.isLayoutOnly),I=new Map(p.map((R,F)=>[R,F])),u=d(R=>{const F=R==="left"||R==="top"?-1:1,_=[];for(let V=0;V<=2;V++)_.push(g[R]+F*20*V);return _},"outwardTracksForSide"),h=d((R,F=new Map)=>xt(F.get(R)??R.points??[]),"replacementPointsFor"),i=d((R,F)=>{let _=0;for(const V of R)for(const K of F)he(V.a,V.b,K.a,K.b,et)&&_++;return _},"crossingCountBetweenSegments"),x=d((R,F)=>i(at(R),at(F)),"crossingCountBetweenPaths"),C=d((R=new Map)=>{let F=0;const _=[],V=new Set,K=[],Z=d(Y=>{V.has(Y)||(V.add(Y),K.push(Y))},"addEdge");for(let Y=0;Y<p.length;Y++){const q=p[Y],m=h(q,R);for(let S=Y+1;S<p.length;S++){const A=p[S],T=x(m,h(A,R));T>0&&(F+=T,_.push({first:q,second:A,count:T}),Z(q),Z(A))}}return K.sort((Y,q)=>(I.get(Y)??0)-(I.get(q)??0)),{count:F,pairs:_,edgeSet:V,edges:K}},"crossingSnapshot"),b=d((R,F)=>{const _=new Set(F.keys());if(_.size===0)return R.count;let V=0;for(const Z of R.pairs)(_.has(Z.first)||_.has(Z.second))&&(V+=Z.count);let K=0;for(let Z=0;Z<p.length;Z++){const Y=p[Z],q=_.has(Y),m=h(Y,F);for(let S=Z+1;S<p.length;S++){const A=p[S];!q&&!_.has(A)||(K+=x(m,h(A,F)))}}return R.count-V+K},"crossingCountWithReplacements"),v=d(R=>{const F=new Map;for(const K of R.pairs){const Z=F.get(K.first)??new Set;Z.add(K.second),F.set(K.first,Z);const Y=F.get(K.second)??new Set;Y.add(K.first),F.set(K.second,Y)}const _=[],V=new Set;for(const K of R.edges){if(V.has(K))continue;const Z=[K],Y=[];for(V.add(K);Z.length>0;){const q=Z.pop();Y.push(q);for(const m of F.get(q)??[])V.has(m)||(V.add(m),Z.push(m))}Y.sort((q,m)=>(I.get(q)??0)-(I.get(m)??0)),Y.length>1&&_.push(Y)}return _},"crossingComponents"),L=d(R=>[R.start,R.end].filter(F=>!!F),"endpointIdsFor"),y=d(R=>{const F=[];for(const _ of v(R)){const V=new Set(_),K=new Set(_.flatMap(Y=>L(Y))),Z=[..._];for(const Y of p)V.has(Y)||L(Y).some(q=>K.has(q))&&Z.push(Y);Z.sort((Y,q)=>(I.get(Y)??0)-(I.get(q)??0)),F.push(Z)}return F},"pairSearchGroups"),M=d((R,F,_)=>b(R,new Map([[F,_]])),"crossingCountWithSingleReplacement"),E=d(R=>{const F=new Map;for(const _ of R.pairs)F.set(_.first,(F.get(_.first)??0)+_.count),F.set(_.second,(F.get(_.second)??0)+_.count);return F},"currentCrossingsByEdge"),w=d(R=>R.slice(1).reduce((F,_,V)=>{const K=R[V];return F+Math.abs(_.x-K.x)+Math.abs(_.y-K.y)},0),"pathLength"),B=d((R=new Map)=>p.reduce((F,_)=>F+oe(h(_,R)),0),"totalBends"),O=d((R=new Map)=>p.reduce((F,_)=>F+w(h(_,R)),0),"totalLength"),k=d((R,F,_=new Map)=>{const V=at(F);for(const K of p)if(K!==R){for(const Z of V)for(const Y of at(h(K,_)))if(de(Z,Y,.5)>=Xt)return!0}return!1},"pathHasSegmentConflict"),H=d((R,F)=>{const _=[R.start,R.end].filter(V=>!!V);for(const V of at(F))if(Pt(V.a,V.b,l,_,-2))return!0;return!1},"pathHitsNode"),P=d((R,F)=>{const _=ue(xt(F));at(_).length===_.length-1&&R.push(_)},"pushOrthogonalCandidate"),G=d(R=>R==="left"||R==="right","sideIsHorizontal"),j=d((R,F,_)=>{switch(F){case"left":return Math.min(R.x,_.x)-20;case"right":return Math.max(R.x,_.x)+20;case"top":return Math.min(R.y,_.y)-20;case"bottom":return Math.max(R.y,_.y)+20}},"localTrackForSameSide"),tt=d((R,F,_,V)=>{const K=_==="left"||_==="top"?-1:1,Z=[j(F,_,V),g[_]];for(const Y of Z)for(let q=0;q<=2;q++)P(R,fo(F,_,V,Y+K*20*q))},"addSameSideCandidates"),ft=d((R,F,_,V,K)=>{for(const Z of u(_))for(const Y of u(K))P(R,[F,{x:Z,y:F.y},{x:Z,y:Y},{x:V.x,y:Y},V])},"addHorizontalToVerticalCandidates"),Mt=d((R,F,_,V,K)=>{for(const Z of u(_))for(const Y of u(K))P(R,[F,{x:F.x,y:Z},{x:Y,y:Z},{x:Y,y:V.y},V])},"addVerticalToHorizontalCandidates"),Ht=d((R,F,_,V,K)=>{const Z=[...u("top"),...u("bottom")];for(const Y of u(_))for(const q of u(K))for(const m of Z)P(R,[F,{x:Y,y:F.y},{x:Y,y:m},{x:q,y:m},{x:q,y:V.y},V])},"addHorizontalPairCandidates"),_t=d((R,F,_,V,K)=>{const Z=[...u("left"),...u("right")];for(const Y of u(_))for(const q of u(K))for(const m of Z)P(R,[F,{x:F.x,y:Y},{x:m,y:Y},{x:m,y:q},{x:V.x,y:q},V])},"addVerticalPairCandidates"),nt=d(R=>{const F=new Set;return R.map(_=>xt(_)).filter(_=>{const V=_.map(K=>`${K.x.toFixed(3)},${K.y.toFixed(3)}`).join("|");return F.has(V)||_.length<2?!1:(F.add(V),!0)})},"dedupeCandidatePaths"),J=d((R,F,_,V)=>{const K=[],Z=lo(R,F,_,V,20,et);Z&&P(K,Z),F===V&&tt(K,R,F,_);const Y=G(F),q=G(V);return Y&&!q?ft(K,R,F,_,V):!Y&&q?Mt(K,R,F,_,V):Y?Ht(K,R,F,_,V):_t(K,R,F,_,V),nt(K)},"buildCandidatesForSides"),rt=d((R,F,_,V)=>{const K=[...u("left"),...u("right")],Z=[...u("top"),...u("bottom")];for(const Y of c){const q=Le(V,Y),m=Y==="top"||Y==="bottom"?u(Y):Z;for(const S of K){P(R,[F,_,{x:S,y:_.y},{x:S,y:q.y},q]);for(const A of m)P(R,[F,_,{x:S,y:_.y},{x:S,y:A},{x:q.x,y:A},q])}}},"addVerticalDepartureOuterTrackCandidates"),ut=d((R,F,_,V)=>{const K=[...u("left"),...u("right")],Z=[...u("top"),...u("bottom")];for(const Y of c){const q=Le(V,Y),m=Y==="left"||Y==="right"?u(Y):K;for(const S of Z){P(R,[F,_,{x:_.x,y:S},{x:q.x,y:S},q]);for(const A of m)P(R,[F,_,{x:_.x,y:S},{x:A,y:S},{x:A,y:q.y},q])}}},"addHorizontalDepartureOuterTrackCandidates"),pt=d(R=>{const F=R.start,_=R.end,V=_?a.get(_):void 0;if(!F||!V)return[];const K=xt(R.points??[]);if(K.length<4)return[];const Z=K[0],Y=K[1],q=[];return Ot(Z,Y,et)?rt(q,Z,Y,V):Nt(Z,Y,et)&&ut(q,Z,Y,V),q},"terminalPreservingOuterTrackCandidates"),St=d(R=>{const F=R.start,_=R.end,V=F?a.get(F):void 0,K=_?a.get(_):void 0;if(!V||!K)return[];const Z=[];for(const Y of c){const q=Le(V,Y);for(const m of c)Z.push(...J(q,Y,Le(K,m),m))}return Z.push(...pt(R)),Z},"candidatePathsFor"),At=d(()=>new Map(p.map(R=>[R,at(h(R))])),"currentSegmentsByEdge"),Kt=d((R,F,_)=>{const V=new Set;for(const K of p){if(K===R)continue;const Z=_.get(K)??at(h(K));F.some(Y=>Z.some(q=>de(Y,q,.5)>=Xt))&&V.add(K)}return V},"sharedTrackConflictsFor"),qt=d((R,F,_,V)=>{const K=new Set;return St(R).map(Y=>ue(xt(Y))).filter(Y=>{if(H(R,Y))return!1;const q=Y.map(m=>`${m.x.toFixed(3)},${m.y.toFixed(3)}`).join("|");return K.has(q)||Y.length<2?!1:(K.add(q),!0)}).map(Y=>{const q=at(Y);let m=0;for(const S of p)S!==R&&(m+=i(q,_.get(S)??at(h(S))));return{candidate:Y,candidateSegments:q,crossings:F.count-(V.get(R)??0)+m,bends:oe(Y,et),totalBends:oe(Y),length:w(Y)}}).filter(({crossings:Y})=>Y<=F.count).sort((Y,q)=>Y.crossings-q.crossings||Y.bends-q.bends||Y.length-q.length).slice(0,48).map(Y=>({path:Y.candidate,segments:Y.candidateSegments,sharedTrackConflicts:Kt(R,Y.candidateSegments,_),totalBends:Y.totalBends,length:Y.length}))},"pairCandidatesFor"),Jt=d((R,F,_,V,K,Z)=>{let Y=0;for(const m of R.pairs)(m.first===F||m.second===F||m.first===V||m.second===V)&&(Y+=m.count);let q=i(_.segments,K.segments);for(const m of p){if(m===F||m===V)continue;const S=Z.get(m)??at(h(m));q+=i(_.segments,S)+i(K.segments,S)}return R.count-Y+q},"pairCrossingCount"),se=d((R,F)=>{for(const _ of R.sharedTrackConflicts)if(_!==F)return!1;return!0},"conflictsOnlyWith"),Ee=d((R,F)=>R.segments.some(_=>F.segments.some(V=>de(_,V,.5)>=Xt)),"candidatesShareTrack"),me=d((R,F,_,V)=>se(F,_.edge)&&se(V,R.edge)&&!Ee(F,V),"pairCandidatesAreCompatible"),Te=d((R,F,_,V,K)=>{const Z=Jt(R.current,F.edge,_,V.edge,K,R.baseSegments);if(!(Z>=R.current.count))return{replacements:new Map([[F.edge,_.path],[V.edge,K.path]]),crossings:Z,bends:R.currentBends-(R.baseBendsByEdge.get(F.edge)??0)-(R.baseBendsByEdge.get(V.edge)??0)+_.totalBends+K.totalBends,length:R.currentLength-(R.baseLengthByEdge.get(F.edge)??0)-(R.baseLengthByEdge.get(V.edge)??0)+_.length+K.length}},"scorePairReplacement"),un=d((R,F)=>R.crossings<F.crossings||R.crossings===F.crossings&&(R.bends<F.bends||R.bends===F.bends&&R.length<F.length),"pairScoreIsBetter"),hn=d((R,F,_,V)=>{let K=V;for(const Z of F.candidates)for(const Y of _.candidates){if(!me(F,Z,_,Y))continue;const q=Te(R,F,Z,_,Y);q&&un(q,K)&&(K=q)}return K},"bestScoreForOptionPair"),gn=d(R=>{const F=B(),_=O(),V=At(),K=E(R),Z=new Map(p.map(T=>[T,oe(h(T))])),Y=new Map(p.map(T=>[T,w(h(T))])),q=new Map,m=y(R);for(const T of m)for(const N of T){if(q.has(N))continue;const D=qt(N,R,V,K);D.length>0&&q.set(N,{edge:N,candidates:D})}let S={replacements:new Map,crossings:R.count,bends:F,length:_};const A={current:R,currentBends:F,currentLength:_,baseBendsByEdge:Z,baseLengthByEdge:Y,baseSegments:V};for(const T of m){const N=new Set(T.filter(W=>R.edgeSet.has(W))),D=T.map(W=>q.get(W)).filter(W=>!!W);for(let W=0;W<D.length;W++){const ot=D[W];for(let U=W+1;U<D.length;U++){const z=D[U];!N.has(ot.edge)&&!N.has(z.edge)||(S=hn(A,ot,z,S))}}}return S.replacements.size>0?S.replacements:void 0},"bestPairedReplacement");for(let R=0;R<4;R++){const F=C(),_=F.count;if(_===0)return;let V,K,Z=_,Y=Number.POSITIVE_INFINITY;for(const m of F.edges){const S=oe(h(m),et);for(const A of St(m)){const T=H(m,A),N=!T&&k(m,A),D=M(F,m,A),W=oe(A,et);T||N||!(D<_||D===_&&W<S)||D>Z||D===Z&&W>=Y||(V=m,K=A,Z=D,Y=W)}}if(V&&K){V.points=K;continue}const q=gn(F);if(!q)return;for(const[m,S]of q)m.points=S}}d(vs,"resolveRenderedOrthogonalCrossings");var be=.001,Br=8;function Ls(t,e){const{nodeInfoById:n,realNodeRects:o}=ln(e),s=["top","bottom","left","right"],r=20,f={top:Math.min(...o.map(i=>i.rect.top))-r,bottom:Math.max(...o.map(i=>i.rect.bottom))+r,left:Math.min(...o.map(i=>i.rect.left))-r,right:Math.max(...o.map(i=>i.rect.right))+r},a=d((i,x,C,b)=>{const v=[],L=lo(i,x,C,b,r,be);return L&&v.push(L),x===b&&v.push(fo(i,x,C,f[x])),v},"buildOrthogonalPathCandidates"),l=d((i,x)=>{for(let C=0;C<i.length-1;C++){const b=i[C],v=i[C+1];if(Pt(b,v,o,x,1))return!0}return!1},"pathHitsNode"),c=d((i,x,C=!1)=>{let b=0;const v=Be(i,be),L=x.start,y=x.end;for(const M of t){if(M===x||M.isLayoutOnly)continue;const E=M.start,w=M.end;if(!C&&L&&y&&(E===L||E===y||w===L||w===y))continue;const B=M.points;if(!(!B||B.length<2))for(const O of v)for(const k of Be(B,be)){if(ho(O.a,O.b,k.a,k.b,be,be)){b++;continue}de(O,k,be)>=Br&&b++}}return b},"pathConflictCount"),g=4,p=d((i,x)=>{const C=Math.abs(i.y-x.rect.top),b=Math.abs(i.y-x.rect.bottom),v=Math.abs(i.x-x.rect.left),L=Math.abs(i.x-x.rect.right);let y="top",M=C;return b<M&&(y="bottom",M=b),v<M&&(y="left",M=v),L<M&&(y="right",M=L),y},"nearestSideOfRect"),I=new Map,u=d((i,x,C)=>{const b=I.get(i)??[];b.push({side:x,edgeId:C}),I.set(i,b)},"addFaceClaim");for(const i of t){if(i.isLayoutOnly)continue;const x=i.points??[];if(x.length<1)continue;const C=i.id??"",b=i.start,v=i.end;if(b){const L=n.get(b);L&&u(b,p(x[0],L),C)}if(v){const L=n.get(v);L&&u(v,p(x[x.length-1],L),C)}}const h=d((i,x,C)=>{var b;return((b=I.get(i))==null?void 0:b.some(v=>v.edgeId!==C&&v.side===x))??!1},"faceIsClaimed");for(const i of t){if(i.isLayoutOnly)continue;const x=i.points;if(!x||x.length<2)continue;const C=oe(x,be);if(C<g)continue;const b=i.start,v=i.end;if(!b||!v)continue;const L=n.get(b),y=n.get(v);if(!L||!y)continue;const M=i.id??"",E=c(x,i,!0),w=c(x,i);let B,O=E,k=C;for(const H of s){if(h(b,H,M))continue;const P=Le(L,H);for(const G of s){if(h(v,G,M))continue;const j=Le(y,G);for(const tt of a(P,H,j,G)){if(l(tt,[b,v]))continue;const ft=oe(tt,be);if(E>0){const Mt=c(tt,i,!0);if(Mt>O||Mt===O&&ft>=k)continue;O=Mt,k=ft,B=tt;continue}c(tt,i)>w||ft<k&&(k=ft,B=tt)}}}if(B){i.points=B;const H=I.get(b);H&&I.set(b,H.filter(G=>G.edgeId!==M));const P=I.get(v);P&&I.set(v,P.filter(G=>G.edgeId!==M)),u(b,p(B[0],L),M),u(v,p(B[B.length-1],y),M)}}}d(Ls,"simplifyDetouredEdges");var Qt=.001,ko=10,Ue=7;function Vn(t,e){const n=e?0:t.length-1,o=e?1:-1,s=t[n],r=t[n+o];if(!s||!r)return;const f=r.x-s.x,a=r.y-s.y;if(!(Math.abs(f)+Math.abs(a)<Qt)){if(Math.abs(a)<=Qt){const c=s.x+Math.sign(f)*ko;return{left:Math.min(s.x,c),right:Math.max(s.x,c),top:s.y-Ue,bottom:s.y+Ue}}if(Math.abs(f)<=Qt){const c=s.y+Math.sign(a)*ko;return{left:s.x-Ue,right:s.x+Ue,top:Math.min(s.y,c),bottom:Math.max(s.y,c)}}return{left:Math.min(s.x,r.x),right:Math.max(s.x,r.x),top:Math.min(s.y,r.y),bottom:Math.max(s.y,r.y)}}}d(Vn,"markerClearanceRectFor");function Es(t){return{left:Math.min(t.left,t.right),right:Math.max(t.left,t.right),top:Math.min(t.top,t.bottom),bottom:Math.max(t.top,t.bottom)}}d(Es,"normalizeRect");function jn(t,e){const n=xt(e),o=Vn(n,!0),s=Vn(n,!1);return[o,s].some(r=>r&&Ze(t,Es(r)))}d(jn,"labelOverlapsOwnMarker");function Ke(t,e){const n=[];for(const h of t){if(h.isLayoutOnly)continue;const i=h.points;if(!(!i||i.length<2))for(let x=0;x<i.length-1;x++)n.push({edgeId:h.id,p1:i[x],p2:i[x+1]})}const o=[],s=[];for(const h of e.values()){const i=h.isGroup,x=h.parentId;if(i&&!x){const b=te(h);b&&s.push({id:h.id,rect:b});continue}if(i||h.isEdgeLabel)continue;const C=te(h);C&&o.push({nodeId:h.id,rect:C})}const r=3,f=1,a=12,l=d((h,i)=>{const x=wn(i,r);for(const{nodeId:C,rect:b}of o)if(C!==h&&Ze(x,b))return!0;return!1},"labelOverlapsForeignNode"),c=d((h,i)=>{const x=wn(i,r);for(const C of n)if(C.edgeId!==h&&an(C.p1,C.p2,x))return!0;return!1},"labelOverlapsForeignEdge"),g=d((h,i,x)=>l(h,x)||c(i,x),"labelOverlapsAnything"),p=[],I=d(h=>{for(const{id:i,rect:x}of s)if(ts(x,h))return i},"findContainingLane"),u=d((h,i)=>p.some(x=>x.labelId!==h&&Ze(i,x.rect)),"overlapsPlacedLabel");for(const h of t){if(h.isLayoutOnly)continue;const i=h.labelNodeId;if(!i)continue;const x=e.get(i);if(!x)continue;const C=h.points;if(!C||C.length<2)continue;const b=x.width??0,v=x.height??0;if(b<=0||v<=0)continue;const L=[];for(let nt=0;nt<C.length-1;nt++){const J=C[nt],rt=C[nt+1],ut=Math.abs(J.x-rt.x),pt=Math.abs(J.y-rt.y);ut<Qt&&pt<Qt||ut>=Qt&&pt>=Qt||L.push({idx:nt,length:ut+pt,orientation:ut>=Qt?"horizontal":"vertical",midX:(J.x+rt.x)/2,midY:(J.y+rt.y)/2})}if(L.length===0)continue;const y=L.length>=3?L.filter(nt=>nt.idx>0&&nt.idx<L.length-1):L,M=y.length>0?y:L,E=b>=v?"horizontal":"vertical",w=d(nt=>[...nt].sort((J,rt)=>{const ut=J.orientation===E,pt=rt.orientation===E;if(ut!==pt)return ut?-1:1;const St=J.length>=(J.orientation==="horizontal"?b:v)+2,At=rt.length>=(rt.orientation==="horizontal"?b:v)+2;return St!==At?St?-1:1:rt.length-J.length}),"rankSegments"),B=L[0],O=L[L.length-1],k=[.5,.25,.75,.05,.95,.15,.85,.1,.9],H=d((nt,J)=>{const rt=C[nt.idx],ut=C[nt.idx+1];return{midX:rt.x+(ut.x-rt.x)*J,midY:rt.y+(ut.y-rt.y)*J}},"anchorAtT"),P=d((nt,J,rt)=>Math.min(rt,Math.max(J,nt)),"clamp"),G=d((nt,J)=>nt.midX>=J.left-Qt&&nt.midX<=J.right+Qt&&nt.midY>=J.top-Qt&&nt.midY<=J.bottom+Qt,"pointInsideRectInclusive"),j=d(nt=>{const J=Pe(nt.midX,nt.midY,b,v),rt=I(J);if(rt)return{laneId:rt,anchor:nt,rect:J};const ut=s.find(({rect:se})=>G(nt,se));if(!ut)return;const pt=ut.rect.left+b/2+f,St=ut.rect.right-b/2-f,At=ut.rect.top+v/2+f,Kt=ut.rect.bottom-v/2-f;if(pt>St||At>Kt)return;const qt={midX:P(nt.midX,pt,St),midY:P(nt.midY,At,Kt)},Jt=Pe(qt.midX,qt.midY,b,v);return G(nt,Jt)?{laneId:ut.id,anchor:qt,rect:Jt}:void 0},"placementForAnchor"),tt=d((nt,J,rt)=>nt.orientation==="horizontal"?Math.abs(J.midX-rt.x):Math.abs(J.midY-rt.y),"distanceAlongSegment"),ft=d((nt,J)=>{const ut=(nt.orientation==="horizontal"?b/2:v/2)+a;if(nt===B){const pt=C[nt.idx];if(tt(nt,J,pt)+Qt<ut)return!1}if(nt===O){const pt=C[nt.idx+1];if(tt(nt,J,pt)+Qt<ut)return!1}return!0},"labelClearsTerminalEndpoints"),Mt=d(nt=>{const J=w(nt);for(const rt of J)for(const ut of k){const pt=H(rt,ut);if(!ft(rt,pt))continue;const St=j(pt);if(St&&!jn(St.rect,C)&&!u(i,St.rect)&&!g(i,h.id,St.rect))return{laneId:St.laneId,anchor:St.anchor}}},"tryPool"),Ht=d((nt,J,rt=!1)=>{const ut=w(nt);for(const pt of ut){const St={midX:pt.midX,midY:pt.midY};if(J&&!ft(pt,St))continue;const At=j(St);if(At&&!jn(At.rect,C)&&!u(i,At.rect)&&!l(i,At.rect)&&(rt||!c(h.id,At.rect)))return{laneId:At.laneId,anchor:At.anchor}}},"findLaneContainingFallback"),_t=Mt(M)??(M.length<L.length?Mt(L):void 0)??Ht(L,!0)??Ht(L,!1)??Ht(L,!1,!0);if(_t){x.x=_t.anchor.midX,x.y=_t.anchor.midY,x.parentId=_t.laneId;const nt=Pe(_t.anchor.midX,_t.anchor.midY,b,v),J=p.findIndex(rt=>rt.labelId===i);J>=0?p[J]={labelId:i,rect:nt}:p.push({labelId:i,rect:nt})}}}d(Ke,"anchorLabelsToPolyline");var Cn=1e-6,kr=8,Fo=kr/2,Fr=3;function Un(t,e){return t<e?`${t}::${e}`:`${e}::${t}`}d(Un,"pairKey");function Ts(t,e){const{nodeInfoById:n,realNodeRects:o}=ln(e),s=new Map;for(const f of e){const a=f.id;if(!f.isGroup&&f.isEdgeLabel){s.set(a,{w:f.width??0,h:f.height??0});continue}}const r=d((f,a,l,c)=>{const g=Un(a,l);let p=0;const I=d(u=>{if(!u)return;const h=s.get(u);if(!h)return;const i=c==="x"?h.w/2:h.h/2;i>p&&(p=i)},"consider");I(f.labelNodeId);for(const u of t){if(u===f||u.isLayoutOnly)continue;const h=u.start,i=u.end;!h||!i||Un(h,i)===g&&I(u.labelNodeId)}return p>0?p+Fr:0},"labelClearanceFor");for(const f of t){if(f.isLayoutOnly)continue;const a=f.points;if(!co(a,Cn))continue;const l=uo(f,n,Cn);if(!l)continue;const{srcId:c,dstId:g,srcInfo:p,dstInfo:I,collinearX:u,collinearY:h}=l;if(u===h)continue;let i,x;if(u){const y=I.cy>p.cy;i={x:p.cx,y:y?p.rect.bottom:p.rect.top},x={x:I.cx,y:y?I.rect.top:I.rect.bottom}}else{const y=I.cx>p.cx;i={x:y?p.rect.right:p.rect.left,y:p.cy},x={x:y?I.rect.left:I.rect.right,y:I.cy}}if(Pt(i,x,o,[c,g],1))continue;const b=r(f,c,g,u?"x":"y"),v=b>Fo?b:Fo,L=[0,v,-v];for(const y of L){const M={...i},E={...x};if(u){if(M.x+=y,E.x+=y,M.x<=p.rect.left||M.x>=p.rect.right||E.x<=I.rect.left||E.x>=I.rect.right)continue}else if(M.y+=y,E.y+=y,M.y<=p.rect.top||M.y>=p.rect.bottom||E.y<=I.rect.top||E.y>=I.rect.bottom)continue;if(!Pt(M,E,o,[c,g],1)&&!Qe(M,E,t,f,{epsilon:Cn})){f.points=[M,E];break}}}}d(Ts,"straightenCollinearSiblingDetours");function Wn(t,e){const{realNodeRects:l,labelNodeRects:c}=Me(e.values()),g=d((y,M)=>Be(M,.001).map(E=>({...E,edge:y,interior:E.index>=1&&E.index<=M.length-3})),"segmentsFor"),p=d(()=>{const y=[];for(const M of t){if(M.isLayoutOnly)continue;const E=M.points;!E||E.length<2||y.push(...g(M,xt(E)))}return y},"allSegments"),I=d((y,M)=>y.horizontal&&M.horizontal?Wt(y.a.x,y.b.x,M.a.x,M.b.x)>=8&&Math.abs(y.a.y-M.a.y)<7:y.vertical&&M.vertical?Wt(y.a.y,y.b.y,M.a.y,M.b.y)>=8&&Math.abs(y.a.x-M.a.x)<7:!1,"hasCrowdedParallelTrack"),u=d((y,M)=>{const E=y.start,w=y.end,B=g(y,M);if(B.length!==M.length-1)return!1;const O=[E,w].filter(H=>!!H),k=y.labelNodeId?[y.labelNodeId]:[];for(const H of B)if(Pt(H.a,H.b,l,O,-2)||Pt(H.a,H.b,c,k,-2))return!1;for(const H of t){if(H===y||H.isLayoutOnly)continue;const P=H.points;if(!(!P||P.length<2)){for(const G of B)for(const j of g(H,xt(P)))if(I(G,j)||he(G.a,G.b,j.a,j.b,.001))return!1}}return!0},"candidateIsSafe"),h=d((y,M)=>{const E=xt(y.edge.points??[]);if(E.length<4||y.index>=E.length-1)return;const w=E.map(B=>({...B}));if(y.horizontal)w[y.index].y+=M,w[y.index+1].y+=M;else if(y.vertical)w[y.index].x+=M,w[y.index+1].x+=M;else return;return g(y.edge,w).length===w.length-1?w:void 0},"shiftedCandidate"),i=d((y,M)=>({x:y.x??(M.left+M.right)/2,y:y.y??(M.top+M.bottom)/2}),"nodeCenter"),x=d(y=>{const M=y.edge,E=xt(M.points??[]);if(E.length!==4||y.index!==1)return;const w=M.start?e.get(M.start):void 0,B=M.end?e.get(M.end):void 0,O=w?te(w):void 0,k=B?te(B):void 0,H=E.slice(y.index+2);if(!(!w||!B||!O||!k||H.length===0))return{sourceCenter:i(w,O),targetCenter:i(B,k),sourceRect:O,tail:H}},"sourceDetourContextFor"),C=d((y,M,E,w,B,O)=>{const k=w.y>=E.y,H=k?B.bottom:B.top,P=H+(k?20:-20);if(k&&y.b.y<=P+.001||!k&&y.b.y>=P-.001)return;const G=y.a.x+M;return xt([{x:E.x,y:H},{x:E.x,y:P},{x:G,y:P},{x:G,y:y.b.y},...O],.001)},"verticalSourceDetour"),b=d((y,M,E,w,B,O)=>{const k=w.x>=E.x,H=k?B.right:B.left,P=H+(k?20:-20);if(k&&y.b.x<=P+.001||!k&&y.b.x>=P-.001)return;const G=y.a.y+M;return xt([{x:H,y:E.y},{x:P,y:E.y},{x:P,y:G},{x:y.b.x,y:G},...O],.001)},"horizontalSourceDetour"),v=d((y,M)=>{const E=x(y);if(E){if(y.vertical)return C(y,M,E.sourceCenter,E.targetCenter,E.sourceRect,E.tail);if(y.horizontal)return b(y,M,E.sourceCenter,E.targetCenter,E.sourceRect,E.tail)}},"sourceDetourCandidate"),L=[-7,7,-2*7,2*7,-3*7,3*7];for(let y=0;y<12;y++){const M=p();let E=!1;for(let w=0;w<M.length&&!E;w++)for(let B=w+1;B<M.length&&!E;B++){const O=M[w],k=M[B];if(O.edge===k.edge||!I(O,k))continue;const H=[O,k].filter(P=>P.interior);for(const P of H){for(const G of L){const j=h(P,G);if(j&&u(P.edge,j)){P.edge.points=j,E=!0;break}const tt=v(P,G);if(tt&&u(P.edge,tt)){P.edge.points=tt,E=!0;break}}if(E)break}}if(!E)return}}d(Wn,"nudgeSharedInteriorSubpaths");function As(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,f=o.x-n.x,a=o.y-n.y,l=s*a-r*f;if(Math.abs(l)<1e-10)return!1;const c=n.x-t.x,g=n.y-t.y,p=(c*a-g*f)/l,I=(c*r-g*s)/l,u=.01;return p>u&&p<1-u&&I>u&&I<1-u}d(As,"segmentsIntersect");function ws(t){const e=t.nodes??[],n=t.edges??[],o=[];if(!n.length||!e.length)return o;const s=es(e),r=[];for(const a of n){if(a.isLayoutOnly)continue;const l=a.points;if(!l||l.length<2)continue;const c=a.start,g=a.end,p=a.labelNodeId,I=a.id??`${c}->${g}`;for(const u of s)if(!(u.nodeId===c||u.nodeId===g)&&!(p&&u.nodeId===p)){for(let h=0;h<l.length-1;h++)if(an(l[h],l[h+1],u,-1)){o.push({type:"edge-node-overlap",edgeId:I,targetId:u.nodeId,detail:`segment ${h} passes through node "${u.nodeId}"`});break}}for(let u=0;u<l.length-1;u++)r.push({edgeId:I,start:c,end:g,p1:l[u],p2:l[u+1]})}const f=new Set;for(let a=0;a<r.length;a++)for(let l=a+1;l<r.length;l++){const c=r[a],g=r[l];if(c.edgeId!==g.edgeId&&!(c.start===g.start||c.start===g.end||c.end===g.start||c.end===g.end)&&As(c.p1,c.p2,g.p1,g.p2)){const p=c.edgeId<g.edgeId?`${c.edgeId}|${g.edgeId}`:`${g.edgeId}|${c.edgeId}`;f.has(p)||(f.add(p),o.push({type:"edge-edge-crossing",edgeId:c.edgeId,targetId:g.edgeId,detail:`edges "${c.edgeId}" and "${g.edgeId}" cross`}))}}if(o.length>0){const a=o.filter(c=>c.type==="edge-node-overlap").length,l=o.filter(c=>c.type==="edge-edge-crossing").length;Ln.warn(`[SWIMLANE_VALIDATE] ${o.length} issue(s) detected: ${a} edge-node overlap(s), ${l} edge crossing(s)`);for(const c of o)Ln.warn(`[SWIMLANE_VALIDATE] ${c.type}: ${c.detail}`)}return o}d(ws,"validateSwimlanesLayout");function Rs(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(a=>!a.isGroup);if((e==="LR"||e==="RL")&&s.length>0&&!ys(t,e)||e==="BT"&&s.length>0&&!ms(t))return;for(const a of o){if(a.isLayoutOnly)continue;const l=a.points;!l||l.length<2||(a.points=ue(tn(l)))}Ls(o,n),Ts(o,n),ps(o,n);const r=new Map;for(const a of n)r.set(String(a.id),a);Ke(o,r),is(o,r),xs(o,r),Wn(o,r),bs(o,r),Ms(o,r),Gn(o,r),Is(o,r);const f=d(()=>{vs(o,r),Ss(o,r),Cs(o,r),Ke(o,r),Xn(o,r),Gn(o,r),Ke(o,r),Xn(o,r)},"finalizeRenderedEdges");f(),Wn(o,r),f(),$n(o,r),zn(o,r),$n(o,r),zn(o,r)}d(Rs,"postProcessSwimlaneLayout");function Ie(t){const e=new Map(t.nodeById),n=new Set,o=[];for(const r of t.edges){if(!e.has(r.src)||!e.has(r.dst))continue;const f=`${r.id}:${r.src}->${r.dst}`;n.has(f)||(n.add(f),o.push(r))}return{nodes:[...e.keys()],edges:o,layout:t.layout,nodeById:e}}d(Ie,"normalizeGraph");function xo(t,e){return t.edges.filter(n=>n.dst===e)}d(xo,"incoming");function Ns(t){const e=new Map;for(const n of t.nodes)e.set(n,[]);for(const n of t.edges)e.get(n.src).push(n.dst);return e}d(Ns,"buildSuccessorMap");function bo(t){const e=Ns(t);for(const n of e.values())n.sort((o,s)=>o.localeCompare(s));return e}d(bo,"buildSortedSuccessorMap");function Mo(t){const e=new Map;for(const n of t.nodes)e.set(n,0);for(const n of t.edges)e.set(n.dst,(e.get(n.dst)??0)+1);return e}d(Mo,"buildInDegreeMap");function Io(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,n)=>e.localeCompare(n))}d(Io,"sortedZeroInDegreeNodes");function fn(t,e=()=>!0){const n=new Map,o=new Map;for(const s of t.nodes)n.set(s,[]),o.set(s,[]);for(const s of t.edges)e(s)&&(o.get(s.src).push(s.dst),n.get(s.dst).push(s.src));return{preds:n,succs:o}}d(fn,"buildPredecessorSuccessorMaps");function So(t,e,n,o){var f,a;let s=0;for(const l of t.nodes)o!=null&&o.skipGroups&&((f=t.nodeById.get(l))!=null&&f.isGroup)||(s=Math.max(s,n[l]??0));const r=Array.from({length:s+1},()=>[]);for(const l of e)o!=null&&o.skipGroups&&((a=t.nodeById.get(l))!=null&&a.isGroup)||r[Math.max(0,n[l]??0)].push(l);return r}d(So,"buildLayersFromRanks");function _e(t){const e=Mo(t),n=Io(e),o=[],s=bo(t);for(;n.length;){const r=n.shift();o.push(r);for(const f of s.get(r)??[])if(e.set(f,(e.get(f)??0)-1),(e.get(f)??0)===0){let a=0;for(;a<n.length&&n[a]<f;)a++;n.splice(a,0,f)}}return o.length===t.nodes.length?o:null}d(_e,"topoSortIfAcyclic");function ke(t){const e=new Map;let n=0;for(const o of t)e.set(o,n),n++;return e}d(ke,"buildLayerIndex");function Co(t){const e=new Array(t.length),n=d((o,s)=>{if(s-o<=1)return 0;const r=o+s>>1;let f=n(o,r)+n(r,s),a=o,l=r,c=o;for(;a<r||l<s;)l>=s||a<r&&t[a]<=t[l]?e[c++]=t[a++]:(e[c++]=t[l++],f+=r-a);for(let g=o;g<s;g++)t[g]=e[g];return f},"count");return n(0,t.length)}d(Co,"countInversions");function Os(t){const e=Ie(t),n=new Map;for(const g of e.nodes)n.set(g,[]);for(const g of e.edges)n.get(g.src).push(g);for(const g of n.values())g.sort((p,I)=>p.dst===I.dst?p.id.localeCompare(I.id):p.dst.localeCompare(I.dst));const o=Object.create(null);for(const g of e.nodes)o[g]=0;const s=[],r=d(g=>{o[g]=1;for(const p of n.get(g)??[]){const I=p.dst;o[I]===0?r(I):o[I]===1&&s.push(p)}o[g]=2},"dfs"),f=[...e.nodes].sort((g,p)=>g.localeCompare(p));for(const g of f)o[g]===0&&r(g);const a=new Set(s.map(g=>`${g.id}:${g.src}->${g.dst}`)),l=e.edges.map(g=>a.has(`${g.id}:${g.src}->${g.dst}`)?{id:g.id,src:g.dst,dst:g.src,weight:g.weight,ref:g.ref}:g);return{acyclic:{nodes:[...e.nodes],edges:l,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:s}}d(Os,"removeCycles_DFS");function Ps(t){const e=new Map,n=d(o=>{if(e.has(o))return e.get(o);const s=t.nodeById.get(o);if(!s)return e.set(o,null),null;const r=s.parentId;if(!r)return e.set(o,null),null;const a=n(r)??r;return e.set(o,a),a},"resolve");for(const o of t.nodes)n(o);return e}d(Ps,"buildTopLaneMap");function ge(t){const e=Ps(t);return n=>e.get(n)??null}d(ge,"createTopLaneResolver");function dn(t){const e=[];for(const n of t.layout.nodes??[])n.isGroup&&!n.parentId&&e.push(n.id);return[...new Set(e)].reverse()}d(dn,"buildTopLaneOrder");function vo(t,e){const n=dn(t);if(!e||e.length===0)return n;const o=new Set(n),s=new Set,r=[];for(const f of e)!o.has(f)||s.has(f)||(s.add(f),r.push(f));for(const f of n)s.has(f)||r.push(f);return r}d(vo,"resolveTopLaneOrder");var _r={EPSILON:1e-6},rn={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},_o={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Bs(t,e){const n=Ie(t),o=(e==null?void 0:e.laneOf)??(()=>null),s=e==null?void 0:e.rankHint,{preds:r}=fn(n);for(const y of r.values())y.sort((M,E)=>M.localeCompare(E));const f=_e(n)??[...n.nodes].sort((y,M)=>y.localeCompare(M)),a=new Map;for(const[y,M]of f.entries())a.set(M,y);const l=new Map,c=new Map;for(const y of n.nodes)c.set(y,[]);for(const y of f){const M=(r.get(y)??[]).filter(E=>l.has(E));if(M.length>0){const E=ks(y,M,{laneOf:o,rankHint:s,topoIndex:a});l.set(y,E),c.get(E).push(y)}else l.has(y)||l.set(y,null)}for(const y of n.nodes)l.has(y)||l.set(y,null);const g=new Set;for(const y of n.nodes)(l.get(y)??null)===null&&g.add(y);const p=[...g].sort((y,M)=>{const E=a.get(y)??0,w=a.get(M)??0;return E===w?y.localeCompare(M):E-w}),I=Fs(n),u=new Map;for(const[y,M]of I.entries())u.set(y,[...M].sort((E,w)=>E.localeCompare(w)));const h=_s(u),i=Ds(u),x=new Map;for(const y of n.nodes)x.set(y,[]);for(const y of i)for(const M of y.nodes){const E=x.get(M);E?E.push(y.id):x.set(M,[y.id])}const C=[],b=[],v=new Set,L=d(y=>{if(!v.has(y)){v.add(y),C.push(y);for(const M of c.get(y)??[])L(M);b.push(y)}},"walk");for(const y of p)L(y);for(const y of f)L(y);return{parent:l,children:c,roots:p,componentOf:h,blocks:i,nodeBlocks:x,adjacency:u,preorder:C,postorder:b,topologicalOrder:f}}d(Bs,"buildDrivingTree");function ks(t,e,n){const o=n.laneOf(t);return[...e].sort((r,f)=>{var i,x;const a=n.laneOf(r),l=n.laneOf(f),c=a!=null&&a===o,g=l!=null&&l===o;if(c!==g)return c?-1:1;const p=(i=n.rankHint)==null?void 0:i[r],I=(x=n.rankHint)==null?void 0:x[f];if(p!=null&&I!=null&&p!==I)return I-p;const u=n.topoIndex.get(r)??0,h=n.topoIndex.get(f)??0;return u!==h?u-h:r.localeCompare(f)})[0]}d(ks,"chooseParent");function Fs(t){const e=new Map;for(const n of t.nodes)e.set(n,new Set);for(const n of t.edges)e.get(n.src).add(n.dst),e.get(n.dst).add(n.src);return e}d(Fs,"buildAdjacency");function _s(t){const e=new Map;let n=0;for(const o of t.keys()){if(e.has(o))continue;const s=[o];for(;s.length>0;){const r=s.pop();if(!e.has(r)){e.set(r,n);for(const f of t.get(r)??[])e.has(f)||s.push(f)}}n++}return e}d(_s,"assignComponents");function Ds(t){const e=new Map,n=new Map,o=[],s=[];let r=0;const f=d((a,l)=>{e.set(a,++r),n.set(a,r);for(const c of t.get(a)??[])c!==l&&(e.has(c)?(e.get(c)??0)<(e.get(a)??0)&&(o.push([a,c]),n.set(a,Math.min(n.get(a)??r,e.get(c)??r))):(o.push([a,c]),f(c,a),n.set(a,Math.min(n.get(a)??r,n.get(c)??r)),(n.get(c)??0)>=(e.get(a)??0)&&s.push(Hs(a,c,o,s.length))))},"visit");for(const a of t.keys())e.has(a)||f(a,null);return s}d(Ds,"computeBlocks");function Hs(t,e,n,o){const s=[],r=new Set;for(;n.length>0;){const f=n.pop();if(s.push(f),r.add(f[0]),r.add(f[1]),f[0]===t&&f[1]===e||f[0]===e&&f[1]===t)break}return{id:o,edges:s,nodes:[...r]}}d(Hs,"popBlock");function Xs(t,e,n){const o=[...t.nodes],s=new Map;for(const[b,v]of o.entries())s.set(v,b);const r=o.length,f=new Array(r).fill(-1),a=new Array(r).fill(0),l=[],c=new Set;for(const b of o){const v=n.parent.get(b)??null,L=s.get(b);L!=null&&v==null&&(f[L]=-1,a[L]=0,c.has(b)||(c.add(b),l.push(b)))}for(;l.length>0;){const b=l.shift(),v=s.get(b);if(v==null)continue;const L=n.children.get(b)??[];for(const y of L){if(c.has(y))continue;const M=s.get(y);M!=null&&(f[M]=v,a[M]=a[v]+1,c.add(y),l.push(y))}}for(const b of o){if(c.has(b))continue;const v=s.get(b);v!=null&&(f[v]=-1,a[v]=0,c.add(b))}const g=Math.max(1,Math.ceil(Math.log2(Math.max(1,r)))+1),p=Array.from({length:g},()=>new Array(r).fill(-1));for(let b=0;b<r;b++)p[0][b]=f[b];for(let b=1;b<g;b++)for(let v=0;v<r;v++){const L=p[b-1][v];p[b][v]=L===-1?-1:p[b-1][L]}const I=d((b,v)=>{if(b===-1||v===-1)return-1;a[b]<a[v]&&([b,v]=[v,b]);const L=a[b]-a[v];for(let y=0;y<g;y++)if(L>>y&1&&(b=p[y][b],b===-1))return-1;if(b===v)return b;for(let y=g-1;y>=0;y--){const M=p[y][b],E=p[y][v];M===-1||E===-1||M!==E&&(b=M,v=E)}return p[0][b]},"lcaIndex"),u=Array.from({length:r},()=>new Map);for(const b of t.edges){let v=b.src,L=b.dst,y=e[v],M=e[L];if(y==null||M==null||(y>M&&([v,L]=[L,v],[y,M]=[M,y]),y==null||M==null||y===M))continue;const E=s.get(v),w=s.get(L);if(E==null||w==null)continue;const B=I(E,w);if(B===-1)continue;const O=u[B];for(let k=y;k<M;k++)O.set(k,(O.get(k)??0)+1)}const h=new Map,i=d((b,v)=>{if(v.size!==0)for(const[L,y]of v)b.set(L,(b.get(L)??0)+y)},"mergeInto"),x=new Set,C=d(b=>{const v=s.get(b);x.add(b);const L=v==null?void 0:u[v],y=L?new Map(L):new Map,M=n.children.get(b)??[];for(const E of M){const w=C(E),B=e[b];if(B!=null){let O=h.get(b);O||(O=new Map,h.set(b,O));let k=w.get(B)??0;const H=e[E];H!=null&&H>B&&(k+=1),O.set(E,k)}i(y,w)}return y},"dfs");for(const b of n.roots)x.has(b)||C(b);for(const b of o)x.has(b)||C(b);return h}d(Xs,"computeSubtreeCrossCounts");function Ys(t,e,n){const o=new Map,s=d(r=>{let f=n[r]??0;const a=[...e.get(r)??[]];a.sort(Lo(n));for(const l of a){s(l);const c=o.get(l);c!=null&&(f=Math.min(f,c))}o.set(r,f)},"annotate");for(const r of t)s(r);return o}d(Ys,"annotateMinimumLayers");function Lo(t){return(e,n)=>{const o=t[e]??0,s=t[n]??0;return o===s?e.localeCompare(n):o-s}}d(Lo,"compareByRankThenId");function Gs(t,e,n,o){let s=0;for(const l of e){const c=n[l]??0;c>s&&(s=c)}const r=Array.from({length:s+1},()=>[]),f=new Set,a=d(l=>{if(f.has(l))return;f.add(l);const c=n[l]??0;r[c]||(r[c]=[]),r[c].push(l);for(const g of o(l))a(g)},"emit");for(const l of t)a(l);for(const l of e)if(!f.has(l)){const c=n[l]??0;r[c]||(r[c]=[]),r[c].push(l),f.add(l)}return r}d(Gs,"emitNodesInTreeOrder");function $s(t){const e=[];for(const n of t){const o=new Set,s=[];for(const r of n)o.has(r)||(o.add(r),s.push(r));e.push(s)}return e}d($s,"deduplicateLayers");function zs(t,e,n,o){return s=>{const r=t.get(s)??[];if(r.length===0)return[];const f=e[s]??0,a=[],l=[],c=n.get(s);for(const g of r){const p=o.get(g)??f;p>f?a.push({child:g,min:p}):l.push(g)}return a.sort((g,p)=>g.min===p.min?g.child.localeCompare(p.child):g.min-p.min),l.sort((g,p)=>{const I=(c==null?void 0:c.get(g))??0,u=(c==null?void 0:c.get(p))??0;if(I!==u)return I-u;const h=o.get(g)??f,i=o.get(p)??f;return h!==i?h-i:g.localeCompare(p)}),[...a.map(g=>g.child),...l]}}d(zs,"createChildOrderer");function cn(t,e,n){const o=Bs(t,{rankHint:e,laneOf:n}),{children:s,roots:r}=o;for(const p of t.nodes)s.has(p)||s.set(p,[]);const f=Xs(t,e,o),a=[...r].sort(Lo(e)),l=Ys(a,s,e),c=zs(s,e,f,l);let g=Gs(a,t.nodes,e,c);return g=$s(g),g}d(cn,"buildMultitreeLayerOrder");function Vs(t,e,n){const o=new Set(t),s=new Set(e),r=ke(e),f=[];for(const a of n)o.has(a.src)&&s.has(a.dst)&&f.push(r.get(a.dst));return Co(f)}d(Vs,"countCrossingsBetweenAdjacent");function Kn(t,e,n){const o=[];for(const r of e){const f=n[r.src],a=n[r.dst];if(f==null||a==null||f===a)continue;let l=r.src,c=r.dst,g=f,p=a;f>a&&(l=r.dst,c=r.src,g=a,p=f);for(let I=g;I<p;I++)o.push({id:`${r.id}@${I}`,src:l,dst:c,ref:r.ref})}let s=0;for(let r=0;r+1<t.length;r++)s+=Vs(t[r],t[r+1],o);return s}d(Kn,"totalCrossings");function js(t,e){const n={...e},{preds:o}=fn(t),s=ge(t),r=cn(t,n,s);let f=Kn(r,t.edges,n);const a=rn.MAX_CROSSING_OPTIMIZATION_PASSES;for(let l=0;l<a;l++){let c=!1;const g=[...t.nodes].sort((p,I)=>(n[I]??0)-(n[p]??0));for(const p of g){const I=n[p]??0;if(I===0)continue;let u=0;for(const C of o.get(p)??[])u=Math.max(u,(n[C]??0)+1);if(u>=I)continue;const h=I;n[p]=u;const i=cn(t,n,s),x=Kn(i,t.edges,n);x<f?(f=x,c=!0):n[p]=h}if(!c)break}return n}d(js,"optimizeRanksByCrossings");function Us(t,e){const n=ge(t),o=[...t.nodes].sort((s,r)=>(e[s]??0)-(e[r]??0)||s.localeCompare(r));for(const s of o){const r=n(s);if(!r)continue;const f=t.edges.filter(i=>i.src===s);if(f.length===0)continue;let a=!1,l=0;for(const i of f){const x=n(i.dst);x==null||x===r?a=!0:l++}if(l===0||a)continue;let c=0,g=!1;for(const i of t.edges){if(i.dst!==s)continue;const x=n(i.src);x&&(x===r?g=!0:c++)}if(c>0||!g)continue;const p=e[s]??0,I=p+l;let u=0;for(const i of t.edges)i.dst===s&&(u=Math.max(u,(e[i.src]??0)+1));const h=Math.max(p,u,I);h!==p&&(e[s]=h)}}d(Us,"adjustCrossLaneSources");function Ws(t,e){const n=Ie(t),o=_e(n)??[...n.nodes].sort(),s=(e==null?void 0:e.compactSingleInput)??!1,r=ge(n);let f=Object.create(null);for(const l of o){const c=xo(n,l),g=e!=null&&e.ignoreCrossLaneEdges?c.filter(p=>{const I=r(p.src),u=r(l);return!I||!u?!0:I===u}):c;if(g.length===0)f[l]=0;else if(s&&g.length===1){const p=g[0].src,I=r(p),u=r(l);I!==u?f[l]=f[p]??0:f[l]=(f[p]??0)+1}else{let p=-1/0;for(const I of g)p=Math.max(p,(f[I.src]??0)+1);f[l]=p===-1/0?0:p}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(f=js(n,f)),e!=null&&e.ignoreCrossLaneEdges&&Us(n,f),{layers:cn(n,f,r),rankOf:f,dummy:new Set}}d(Ws,"assignLayers_LongestPath");function Ks(t,e){const n=Ie(t),s={...Ws(n,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},r=ge(n),{preds:f,succs:a}=fn(n,h=>{if(e!=null&&e.ignoreCrossLaneEdges){const i=r(h.src),x=r(h.dst);if(i&&x&&i!==x)return!1}return!0}),l=_e(n)??[...n.nodes],c=[...l].reverse(),g=d((h,i)=>{let x=0;for(const v of f.get(h)??[])x=Math.max(x,(s[v]??0)+1);let C=Number.POSITIVE_INFINITY;const b=a.get(h)??[];return b.length>0&&(C=Math.min(...b.map(v=>(s[v]??0)-1))),Number.isFinite(C)||(C=Math.max(x,i)),Math.min(Math.max(i,x),C)},"clampFeasible"),p=rn.GRAVITY_ITERATIONS,I=d(h=>{let i=!1;for(const x of h){const C=f.get(x)??[],b=a.get(x)??[];if(C.length===0&&b.length===0)continue;const v=C.length>0?C.reduce((E,w)=>E+(s[w]??0)+1,0)/C.length:s[x]??0,L=b.length>0?b.reduce((E,w)=>E+(s[w]??0)-1,0)/b.length:s[x]??0,y=Math.round((v+L)/2),M=g(x,y);M!==s[x]&&(s[x]=M,i=!0)}return i},"relaxOrder");for(let h=0;h<p;h++){const i=I(l),x=I(c);if(!i&&!x)break}for(const h of l){let i=0;for(const x of f.get(h)??[])i=Math.max(i,(s[x]??0)+1);(s[h]??0)<i&&(s[h]=i)}for(const h of c){const i=a.get(h)??[];if(i.length>0){const x=Math.min(...i.map(C=>(s[C]??0)-1));(s[h]??0)>x&&(s[h]=x)}}return{layers:So(n,l,s),rankOf:s,dummy:new Set}}d(Ks,"assignLayers_Gravity");function qs(t){const e=Mo(t),n=bo(t);let o=Io(e);const s=[];for(;o.length>0;){const r=[];for(const f of o){s.push(f);for(const a of n.get(f)??[])e.set(a,(e.get(a)??0)-1),(e.get(a)??0)===0&&r.push(a)}o=r.sort((f,a)=>f.localeCompare(a))}return s.length===t.nodes.length?s:null}d(qs,"topoSortByGenerationIfAcyclic");function Js(t,e){const n=Ie(t),o=(e==null?void 0:e.direction)==="LR"?qs(n)??[...n.nodes].sort():_e(n)??[...n.nodes].sort(),s=ge(n),r=d(g=>s(g)??g,"laneOf"),f=Object.create(null),a=new Map,l=d((g,p)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?r(g)===r(p)?1:0:1,"edgeWeight");for(const g of o){const p=n.nodeById.get(g);if(p!=null&&p.isGroup)continue;const I=xo(n,g);let u=0;if(I.length>0)for(const C of I){const b=C.src,v=f[b]??0;u=Math.max(u,v+l(b,g))}const h=r(g),i=a.get(h)??0,x=Math.max(u,i);f[g]=x,a.set(h,x+1)}return{layers:So(n,o,f,{skipGroups:!0}),rankOf:f,dummy:new Set}}d(Js,"assignLayers_LaneAwareCompact");function Zs(t,e){const n=Ie(e),{rankOf:o}=t,s=t.layers.map(u=>[...u]),r=new Set(t.dummy?[...t.dummy]:[]);let f=0;const a=new Map(n.nodeById),l=d(u=>{const h=`placeholder-${f++}`,i={id:h,isGroup:!1,isDummy:!0,width:0,height:0};for(a.set(h,i),r.add(h);s.length<=u;)s.push([]);return s[u].push(h),o[h]=u,h},"addDummyAt"),c=[...n.edges].sort((u,h)=>u.id===h.id?u.src===h.src?u.dst.localeCompare(h.dst):u.src.localeCompare(h.src):u.id.localeCompare(h.id)),g=[];for(const u of c){const h=o[u.src]??0,i=o[u.dst]??0;if(i-h<=1){g.push(u);continue}let x=u.src;for(let b=h+1,v=0;b<i;b++,v++){const L=l(b);g.push({id:`${u.id}#${v}`,src:x,dst:L,weight:u.weight,ref:u.ref}),x=L}const C=i-h-2;g.push({id:`${u.id}#${Math.max(C+1,0)}`,src:x,dst:u.dst,weight:u.weight,ref:u.ref})}const I={nodes:[...n.nodes,...[...r].filter(u=>!n.nodes.includes(u))],edges:g,layout:n.layout,nodeById:a};return{layering:{layers:s,rankOf:o,dummy:r},graphWithDummies:I}}d(Zs,"makeProperLayering");function qn(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const n=[...t].sort((o,s)=>o-s);return e%2===1?n[(e-1)/2]:.5*(n[e/2-1]+n[e/2])}d(qn,"median");function Jn(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((n,o)=>n+o,0)/t.length}d(Jn,"barycenter");function Qs(t,e,n,o){const s=new Map;for(const r of t)s.set(r,[]);for(const r of n)o==="down"?e.has(r.src)&&s.has(r.dst)&&s.get(r.dst).push(e.get(r.src)):e.has(r.dst)&&s.has(r.src)&&s.get(r.src).push(e.get(r.dst));return s}d(Qs,"neighborPositionsFor");function tr(t,e,n){const o=n.get(t)??0,s=n.get(e)??0;return o!==s?o-s:t.localeCompare(e)}d(tr,"currentOrderTieBreak");function Zn(t,e,n){const o=new Set(t),s=new Set(e),r=ke(t),f=ke(e),a=[];for(const c of n)o.has(c.src)&&s.has(c.dst)&&a.push({u:r.get(c.src),v:f.get(c.dst)});a.sort((c,g)=>c.u===g.u?c.v-g.v:c.u-g.u);const l=a.map(c=>c.v);return Co(l)}d(Zn,"countCrossingsBetweenAdjacent");function qe(t,e,n){return[...t].sort((o,s)=>{const r=qn(e.get(o)??[]),f=qn(e.get(s)??[]);return r===f?tr(o,s,n):isFinite(r)?isFinite(f)?r-f:-1:1})}d(qe,"sortByHeuristic");function Qn(t,e,n,o,s,r){const f=ke(t),a=ke(e),l=Qs(e,f,n,o);if(!s||!r||r.length===0)return qe(e,l,a);const c=new Map;for(const I of e){const u=s(I),h=c.get(u)??[];h.push(I),c.set(u,h)}const g=[];for(const I of r){const u=c.get(I);if(!u||u.length===0)continue;const h=qe(u,l,a);g.push(...h)}const p=c.get(null);if(p&&p.length>0){const I=qe(p,l,a);for(const u of I){const h=Jn(l.get(u)??[]);let i=g.length;if(isFinite(h))for(const[x,C]of g.entries()){const b=Jn(l.get(C)??[]);if(h<b){i=x;break}}g.splice(i,0,u)}}return g}d(Qn,"reorderLayer");function to(t,e,n,o,s){const r=[...e],f=new Set(t),a=new Set(e),l=o?new Set(o):null,c=n.filter(i=>f.has(i.src)&&a.has(i.dst)),g=l?n.filter(i=>a.has(i.src)&&l.has(i.dst)):void 0,p=d(i=>{let x=Zn(t,i,c);return g&&o&&(x+=Zn(i,o,g)),x},"crossingScore"),I=s?new Map:null;if(s&&I)for(const i of e)I.set(i,s(i));let u=!0,h=p(r);for(;u;){u=!1;for(let i=0;i+1<r.length;i++){if(I){const b=I.get(r[i]),v=I.get(r[i+1]);if(b!==v)continue}const x=h;[r[i],r[i+1]]=[r[i+1],r[i]];const C=p(r);C<x?(h=C,u=!0):[r[i],r[i+1]]=[r[i+1],r[i]]}}return r}d(to,"transposeImprove");function er(t,e,n){const o=t.layers.map(a=>[...a]),s=e.edges,r=ge(e),f=vo(e,n==null?void 0:n.laneOrder);for(let a=0;a<3;a++){for(let l=1;l<o.length;l++)o[l]=Qn(o[l-1],o[l],s,"down",r,f),o[l]=to(o[l-1],o[l],s,o[l+1],r);for(let l=o.length-2;l>=0;l--)o[l]=Qn(o[l+1],o[l],s,"up",r,f),o[l]=to(o[l+1],o[l],s,o[l-1],r)}return{layers:o}}d(er,"orderLayers");function nr(t,e,n){const o=(n==null?void 0:n.layerGap)??_o.DEFAULT_LAYER_GAP,s=(n==null?void 0:n.nodeGap)??_o.DEFAULT_NODE_GAP,r=(n==null?void 0:n.laneGap)??s*2,f=(n==null?void 0:n.direction)??"TB",a=f==="LR"||f==="RL",l=t.layers,c=Object.create(null),g=Object.create(null),p=d(O=>e.nodeById.get(O),"getNode"),I=d(O=>{var k;return((k=p(O))==null?void 0:k.width)??0},"getWidth"),u=d(O=>{var k;return((k=p(O))==null?void 0:k.height)??0},"getHeight"),h=ge(e),i=vo(e,n==null?void 0:n.laneOrder),x=l.map(O=>O.reduce((k,H)=>Math.max(k,u(H)),0)),C=[];if(a)for(let O=0;O+1<l.length;O++){const k=l[O].reduce((Mt,Ht)=>Math.max(Mt,I(Ht)),0),H=l[O+1].reduce((Mt,Ht)=>Math.max(Mt,I(Ht)),0),P=x[O],G=x[O+1],j=P/2+G/2,tt=(k+H)/2,ft=Math.max(0,tt-j-o);C.push(ft)}const b=new Set;for(const O of l)for(const k of O)b.add(h(k));const v=b.has(null),L=i.filter(O=>b.has(O)),y=[...v?[null]:[],...L],M=Object.create(null);for(const O of L)M[O]=0;v&&(M.null=0);for(const O of l){const k=Object.create(null),H=[];for(const P of O){const G=h(P);G===null?H.push(P):(k[G]||(k[G]=[])).push(P)}for(const[P,G]of Object.entries(k)){const j=G.reduce((tt,ft)=>tt+I(ft),0)+s*Math.max(0,G.length-1);M[P]=Math.max(M[P]??0,j)}if(v&&H.length){const P=H.reduce((G,j)=>G+I(j),0)+s*Math.max(0,H.length-1);M.null=Math.max(M.null??0,P)}}const E=new Map;{const O=y.map(P=>(P===null?M.null:M[P])??0);let H=-(O.reduce((P,G)=>P+G,0)+r*Math.max(0,y.length-1))/2;for(let P=0;P<y.length;P++){const G=y[P],j=O[P]??0,tt=H+j/2;E.set(G,tt),H+=j,P<y.length-1&&(H+=r)}}let w=0;for(const[O,k]of l.entries()){const H=x[O]??0,P=new Map;for(const j of k){const tt=h(j),ft=P.get(tt)??[];ft.push(j),P.set(tt,ft)}for(const j of y){const tt=P.get(j)??[];if(tt.length===0)continue;const ft=E.get(j);if(tt.length===1){const Mt=tt[0];c[Mt]=ft,g[Mt]=w+H/2}else{const Mt=tt.map(nt=>I(nt)),Ht=Mt.reduce((nt,J)=>nt+J,0)+s*(tt.length-1);let _t=ft-Ht/2;for(const[nt,J]of tt.entries()){const rt=Mt[nt];c[J]=_t+rt/2,g[J]=w+H/2,_t+=rt+s}}}const G=C[O]??0;w+=H+o+G}const B=new Map;for(const O of e.edges){const k=O.ref.id;B.has(k)||B.set(k,[]),B.get(k).push(O)}for(const[,O]of B){if(O.length===0)continue;const k=O[0].ref,H=k.start,P=k.end;if(H==null||P==null)continue;const G=Math.round(((c[H]??0)+(c[P]??0))/2),j=new Set;for(const tt of O)j.add(tt.src),j.add(tt.dst);for(const tt of j){if(tt===H||tt===P)continue;const ft=e.nodeById.get(tt);ft!=null&&ft.isDummy&&(c[tt]=G)}}return{x:c,y:g}}d(nr,"assignCoordinates");var or=8;function sr(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return e>>>0}d(sr,"hashString");function rr(t){let e=t>>>0;return()=>{e+=1831565813;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}d(rr,"mulberry32");function ir(t,e){const n=[...t],o=rr(e);for(let s=n.length-1;s>0;s--){const r=Math.floor(o()*(s+1));[n[s],n[r]]=[n[r],n[s]]}return n}d(ir,"deterministicShuffle");function cr(t,e){let n=0;for(const[o,s]of t.entries())n+=Math.abs(o-(e.get(s)??o));return n}d(cr,"sourceDistance");function eo(t,e){const n=new Map;for(const[s,r]of t.entries())n.set(r,s);let o=0;for(const{a:s,b:r,weight:f}of e){const a=n.get(s),l=n.get(r);a==null||l==null||(o+=f*Math.abs(a-l))}return o}d(eo,"laneArrangementCost");function ar(t){const e=dn(t);if(e.length<2)return[];const n=new Map(e.map((r,f)=>[r,f])),o=ge(t),s=new Map;for(const r of t.layout.edges??[]){if(r.isLayoutOnly)continue;const f=typeof r.start=="string"?r.start:void 0,a=typeof r.end=="string"?r.end:void 0;if(!f||!a||!t.nodeById.has(f)||!t.nodeById.has(a))continue;const l=o(f),c=o(a);if(!l||!c||l===c)continue;const g=n.get(l),p=n.get(c);if(g==null||p==null)continue;const[I,u]=g<=p?[l,c]:[c,l],h=`${I}\0${u}`,i=s.get(h);i?i.weight++:s.set(h,{a:I,b:u,weight:1})}return[...s.values()]}d(ar,"buildWeightedLaneEdges");function no(t,e,n){const o=[...t];let s=eo(o,e),r=!0,f=0;const a=Math.max(1,o.length);for(;r&&f<a;){r=!1,f++;for(let l=0;l+1<o.length;l++){[o[l],o[l+1]]=[o[l+1],o[l]];const c=eo(o,e);c<s?(s=c,r=!0):[o[l],o[l+1]]=[o[l+1],o[l]]}}return{order:o,cost:s,sourceDistance:cr(o,n)}}d(no,"greedySwitch");function lr(t,e){return t.cost!==e.cost?t.cost<e.cost:t.sourceDistance<e.sourceDistance}d(lr,"isBetterCandidate");function fr(t,e,n){const o=[...e].sort((s,r)=>s.a===r.a?s.b.localeCompare(r.b):s.a.localeCompare(r.a)).map(({a:s,b:r,weight:f})=>`${s}:${r}:${f}`).join("|");return sr(`${t.join("|")}#${o}#${n}`)}d(fr,"seedForRestart");function dr(t,e={}){const n=dn(t);if(n.length<2)return n;const o=ar(t);if(o.length===0)return n;const s=new Map(n.map((a,l)=>[a,l]));let r=no(n,o,s);const f=Math.max(0,e.restarts??or);for(let a=0;a<f;a++){const l=fr(n,o,a),c=ir(n,l),g=no(c,o,s);lr(g,r)&&(r=g)}return r.order}d(dr,"optimizeTopLaneOrder");function ur(t,e){const n=(e==null?void 0:e.ignoreCrossLaneEdges)??!0,o=(e==null?void 0:e.optimizeRanksByCrossings)??!0,s=Ie(t),r=e!=null&&e.automaticLaneOrdering?dr(s,{restarts:or}):void 0,f=Os(s),a=f.acyclic,l=n?Js(a,{compactSingleInput:(e==null?void 0:e.compactSingleInput)??rn.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!0,direction:e==null?void 0:e.direction}):Ks(a,{compactSingleInput:(e==null?void 0:e.compactSingleInput)??rn.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!1,optimizeRanksByCrossings:o}),{layering:c,graphWithDummies:g}=Zs(l,a),p=er(c,g,{laneOrder:r}),I=nr(p,g,{layerGap:e==null?void 0:e.layerGap,nodeGap:e==null?void 0:e.nodeGap,direction:e==null?void 0:e.direction,laneOrder:r});return{acyclic:a,reversed:f.reversed,layering:c,ordered:p,coordinates:I}}d(ur,"sugiyamaLayout");var lt=_r.EPSILON,Dr=8,Ce=15,Ne=15,We=25,ie=20,vn=10;function oo(t,e,n){const o=t.x??0,s=t.y??0,r=e.x-o,f=e.y-s,a=Math.abs(r),l=Math.abs(f);return a<lt&&l<lt?n:l>lt&&l*3>=a?f>0?"bottom":"top":a>lt?r>0?"right":"left":n}d(oo,"chooseOrthogonalSide");function so(t,e){return Math.abs(t.to-e.from)<lt||Math.abs(t.to-e.to)<lt?t.to:t.from}d(so,"sharedLineEndpointCoord");function ve(t,e){return t.orient==="vertical"?{x:t.coord,y:e}:{x:e,y:t.coord}}d(ve,"pointOnLine");function hr(t,e){var K,Z,Y,q;const n=t.nodes??[],o=t.edges??[],s=[];for(const m of o)m.isLayoutOnly||s.push({...m,__originalEdge:m});const r=new Map,f=new Map,a=[],l=e==="LR";for(const m of n)r.set(m.id,m);const c=n.filter(m=>m.isGroup&&!m.parentId);for(const m of c){const S={id:m.id},A=d(T=>{f.set(T.id,S),n.filter(N=>N.parentId===T.id).forEach(A)},"assignLane");A(m)}const g=n.filter(m=>!m.isGroup&&!m.isEdgeLabel).map(m=>{const S=m.width??10,A=m.height??10,T=m.x??0,N=m.y??0,D=Dr;return{nodeId:m.id,minX:T-S/2-D,maxX:T+S/2+D,minY:N-A/2-D,maxY:N+A/2+D,visualXHalfExtent:l?A/2+D:S/2+D}}),p=d((m,S,A,T)=>{let N=a.find(D=>D.orientation===m&&Math.abs(D.coord-S)<1);return N||(N={id:`pipe-${m}-${S.toFixed(0)}`,orientation:m,coord:S,spanMin:A,spanMax:T,tracks:[]},a.push(N)),N.spanMin=Math.min(N.spanMin,A),N.spanMax=Math.max(N.spanMax,T),N},"getOrAddPipe"),I=d((m,S)=>{const A=m.width??10,T=m.height??10,N=m.x??0,D=m.y??0;switch(S){case"top":return{x:N,y:D-T/2};case"bottom":return{x:N,y:D+T/2};case"left":return{x:N-A/2,y:D};case"right":return{x:N+A/2,y:D}}},"portForSide"),u=d((m,S,A)=>I(m,oo(m,S,A?"bottom":"top")),"getOrthogonalPort"),h=[],i=[],x=new Set,C=1e3,b=d((m,S,A)=>{if(h.length===0)return 0;const T=Math.abs(S.y-A.y)<lt,N=Math.abs(S.x-A.x)<lt;if(!T&&!N)return 0;let D=0;if(T){const W=S.y,ot=Math.min(S.x,A.x)-lt,U=Math.max(S.x,A.x)+lt;if(U<=ot)return 0;for(const z of h)z.edgeIndex===m||z.orientation!=="vertical"||z.pipe.coord<ot||z.pipe.coord>U||z.from-lt<=W&&z.to+lt>=W&&(D+=C)}else if(N){const W=S.x,ot=Math.min(S.y,A.y)-lt,U=Math.max(S.y,A.y)+lt;if(U<=ot)return 0;for(const z of h)z.edgeIndex===m||z.orientation!=="horizontal"||z.pipe.coord<ot||z.pipe.coord>U||z.from-lt<=W&&z.to+lt>=W&&(D+=C)}return D},"crossingPenalty"),v=s.map((m,S)=>{if(!m.start||!m.end)return{idx:S,crossLane:0,dx:0,dy:0};const A=r.get(m.start),T=r.get(m.end),N=f.get(m.start),D=f.get(m.end),W=N&&D&&N.id!==D.id?1:0,ot=A&&T?Math.abs((T.x??0)-(A.x??0)):0,U=A&&T?Math.abs((T.y??0)-(A.y??0)):0;return{idx:S,crossLane:W,dx:ot,dy:U}}).sort((m,S)=>{if(m.crossLane!==S.crossLane)return S.crossLane-m.crossLane;const A=m.dx+m.dy,T=S.dx+S.dy;return Math.abs(A-T)>1?A-T:m.idx-S.idx}).map(m=>m.idx),L=d((m,S,A,T)=>{const N=Math.min(m.x,S.x),D=Math.max(m.x,S.x),W=Math.min(m.y,S.y),ot=Math.max(m.y,S.y);return!!g.find(z=>A&&z.nodeId===A||T&&z.nodeId===T?!1:Math.abs(m.x-S.x)>lt?z.minY<m.y&&z.maxY>m.y&&z.maxX>N&&z.minX<D:z.minX<m.x&&z.maxX>m.x&&z.maxY>W&&z.minY<ot)},"isSegmentBlocked"),y=new Map,M=new Map;for(const m of s)!m.start||!m.end||m.start===m.end||(M.set(m.start,(M.get(m.start)??0)+1),M.set(m.end,(M.get(m.end)??0)+1));const E=d((m,S)=>oo(m,S,"bottom"),"determineSide"),w=new Map;for(const[m,S]of s.entries()){if(!S.start||!S.end||S.start===S.end||S.points&&S.points.length>0)continue;const A=r.get(S.start),T=r.get(S.end);if(!A||!T)continue;const N=(T.x??0)-(A.x??0),D=(T.y??0)-(A.y??0);w.set(m,{edgeIdx:m,srcId:S.start,dstId:S.end,srcSide:E(A,{x:T.x??0,y:T.y??0}),dstSide:E(T,{x:A.x??0,y:A.y??0}),absDx:Math.abs(N),absDy:Math.abs(D),dxSign:Math.sign(N),dySign:Math.sign(D)})}const B=d(m=>m.srcSide==="top"||m.srcSide==="bottom"?m.absDx===0?1/0:m.absDy/m.absDx:m.absDy===0?1/0:m.absDx/m.absDy,"preferenceStrength"),O=d(m=>m.srcSide==="top"||m.srcSide==="bottom"?m.dxSign>=0?"right":"left":m.dySign>=0?"bottom":"top","secondarySide"),k=new Map;for(const m of w.values()){const S=`${m.srcId}:${m.srcSide}`;k.has(S)||k.set(S,[]),k.get(S).push(m)}const H=new Map,P=d((m,S)=>`${m}:${S}`,"loadKey");for(const m of w.values())H.set(P(m.srcId,m.srcSide),(H.get(P(m.srcId,m.srcSide))??0)+1),H.set(P(m.dstId,m.dstSide),(H.get(P(m.dstId,m.dstSide))??0)+1);for(const m of k.values())if(!(m.length<2)){m.sort((S,A)=>{const T=B(S),N=B(A);return Math.abs(T-N)>1e-9?N-T:S.edgeIdx-A.edgeIdx});for(let S=1;S<m.length;S++){const A=m[S],T=O(A),N=H.get(P(A.srcId,A.srcSide))??0,D=H.get(P(A.srcId,T))??0;D>=N||(H.set(P(A.srcId,A.srcSide),N-1),H.set(P(A.srcId,T),D+1),A.srcSide=T)}}const G=d(m=>{const S=m==null?void 0:m.shape;return S==="question"||S==="diamond"},"isDiamondNode"),j=new Map;for(const m of w.values())j.has(m.dstId)||j.set(m.dstId,new Set),j.get(m.dstId).add(m.dstSide);for(const m of w.values()){if(!G(r.get(m.srcId)))continue;const S=j.get(m.srcId);if(!(S!=null&&S.has(m.srcSide)))continue;const A=O(m);if(S.has(A)||(H.get(P(m.srcId,A))??0)>0)continue;const T=H.get(P(m.srcId,m.srcSide))??0;H.set(P(m.srcId,m.srcSide),Math.max(0,T-1)),H.set(P(m.srcId,A),1),m.srcSide=A}for(const m of w.values()){const{edgeIdx:S,srcId:A,dstId:T,srcSide:N,dstSide:D}=m,W=r.get(A),ot=r.get(T),U=`${A}:${N}:src`,z=N==="top"||N==="bottom"?ot.x??0:ot.y??0;y.has(U)||y.set(U,[]),y.get(U).push({edgeIdx:S,oppositeCoord:z});const bt=`${T}:${D}:dst`,dt=D==="top"||D==="bottom"?W.x??0:W.y??0;y.has(bt)||y.set(bt,[]),y.get(bt).push({edgeIdx:S,oppositeCoord:dt})}const tt=new Map,ft=8;for(const[m,S]of y){if(S.length<2)continue;S.sort((wt,Gt)=>wt.oppositeCoord-Gt.oppositeCoord);const A=m.split(":"),T=A.slice(0,-2).join(":"),N=A[A.length-2],D=A[A.length-1],W=r.get(T);if(!W)continue;const U=N==="left"||N==="right"?W.height??10:W.width??10,z=W.shape,dt=z==="question"||z==="diamond"?U*.3:U,st=Math.min(20,Math.max(ft,dt/(S.length+1))),Bt=-(st*(S.length-1))/2;for(const[wt,Gt]of S.entries()){const ee=Bt+wt*st,mn=`${Gt.edgeIdx}:${D}`;tt.set(mn,ee)}}const Mt=d(m=>{var S;return!!((S=s[m])!=null&&S.labelNodeId)},"edgeHasLabelNode"),Ht=d((m,S)=>m?(y.get(`${m}:${S}:src`)??[]).some(({edgeIdx:A})=>Mt(A))||(y.get(`${m}:${S}:dst`)??[]).some(({edgeIdx:A})=>Mt(A)):!1,"faceHasLabelNode"),_t=d((m,S,A)=>S==="top"||S==="bottom"?{x:m.x+A,y:m.y}:{x:m.x,y:m.y+A},"applyPortOffset"),nt=d((m,S,A)=>{const T=w.get(m),N={x:A.x??0,y:A.y??0},D={x:S.x??0,y:S.y??0},W=(T==null?void 0:T.srcSide)??E(S,N),ot=(T==null?void 0:T.dstSide)??E(A,D);let U=T?I(S,T.srcSide):u(S,N,!0),z=T?I(A,T.dstSide):u(A,D,!1);const bt=tt.get(`${m}:src`),dt=tt.get(`${m}:dst`);return bt!==void 0&&(U=_t(U,W,bt)),dt!==void 0&&(z=_t(z,ot,dt)),{pSrcPort:U,pDstPort:z,srcSide:W,dstSide:ot}},"portsForEdge");for(const m of v){const S=s[m];if(i[m]=[],!S.start||!S.end||S.points&&S.points.length>0||S.start===S.end)continue;const A=r.get(S.start),T=r.get(S.end);if(!A||!T)continue;const{pSrcPort:N,pDstPort:D,srcSide:W,dstSide:ot}=nt(m,A,T),U={...N},z={...D},bt=W==="top"||W==="bottom",dt=ot==="top"||ot==="bottom";if(bt){const X=N.y>(A.y??0);U.y=X?N.y+ie:N.y-ie}else{const X=N.x>(A.x??0);U.x=X?N.x+ie:N.x-ie}if(dt){const X=D.y>(T.y??0);z.y=X?D.y+ie:D.y-ie}else{const X=D.x>(T.x??0);z.x=X?D.x+ie:D.x-ie}const ct=d((X,$)=>{for(const Q of g)if(!$.includes(Q.nodeId)&&X.x>Q.minX&&X.x<Q.maxX&&X.y>Q.minY&&X.y<Q.maxY)return{inside:!0,obstacle:Q};return{inside:!1}},"isPointInObstacle"),st=d((X,$,Q,ht,Tt)=>{if(Tt){const kt=X.y>($.y??0);return{x:(Q.x??0)>=X.x?ht.maxX+Ce:ht.minX-Ce,y:kt?ht.maxY+Ne:ht.minY-Ne,leavesPositiveSide:kt}}const Ct=X.x>($.x??0),Rt=(Q.y??0)>=X.y;return{x:Ct?ht.maxX+Ce:ht.minX-Ce,y:Rt?ht.maxY+Ne:ht.minY-Ne,leavesPositiveSide:Ct}},"obstacleDetour");let It=[];const Bt=[S.start,S.end],wt=ct(U,Bt);if(wt.inside&&wt.obstacle){const X=wt.obstacle;if(bt){const $=st(N,A,T,X,!0);U.x=$.x,U.y=$.y;const Q=$.leavesPositiveSide?Math.min(X.minY-2,N.y+ie):Math.max(X.maxY+2,N.y-ie);It=[{x:N.x,y:Q},{x:$.x,y:Q},{x:$.x,y:$.y}]}else{const $=st(N,A,T,X,!1),Q=$.leavesPositiveSide?Math.min(X.minX-2,N.x+ie):Math.max(X.maxX+2,N.x-ie);U.x=$.x,U.y=$.y,It=[{x:Q,y:N.y},{x:Q,y:$.y},{x:$.x,y:$.y}]}}let Gt=[];const ee=ct(z,Bt);if(ee.inside&&ee.obstacle){const X=ee.obstacle;if(dt){const $=st(D,T,A,X,!0);z.x=$.x,z.y=$.y,Gt=[{x:$.x,y:$.y},{x:D.x,y:$.y}]}else{const $=st(D,T,A,X,!1);z.x=$.x,z.y=$.y,Gt=[{x:$.x,y:$.y},{x:$.x,y:D.y}]}}if(It.length===0&&Gt.length===0){const X=Ce,$=Math.abs(U.x-z.x)<X,Q=Math.abs(U.y-z.y)<X,ht=tt.get(`${m}:src`)!==void 0||tt.get(`${m}:dst`)!==void 0,Tt=(((K=y.get(`${S.start??""}:${W}:src`))==null?void 0:K.length)??0)+(((Z=y.get(`${S.start??""}:${W}:dst`))==null?void 0:Z.length)??0),Ct=(((Y=y.get(`${S.end??""}:${ot}:src`))==null?void 0:Y.length)??0)+(((q=y.get(`${S.end??""}:${ot}:dst`))==null?void 0:q.length)??0),Rt=Tt>1||Ct>1,kt=M.get(S.start??"")??0,mt=M.get(S.end??"")??0,Vt=Tt>1&&Ht(S.start,W)||Ct>1&&Ht(S.end,ot),re=Tt<=1||kt<=2,Dt=Ct<=1||mt<=2;if(($||Q)&&!ht&&(!Rt||Rt&&!Vt&&re&&Dt)&&!L(N,D,S.start,S.end)){S.points=[{...N},{...U},{...z},{...D}],x.add(m);const vt=Q?"horizontal":"vertical",Ut=Q?N.y:N.x,Lt=Q?Math.min(N.x,D.x):Math.min(N.y,D.y),Et=Q?Math.max(N.x,D.x):Math.max(N.y,D.y),Zt={id:`fast-path-${vt}-${Ut.toFixed(0)}-${m}`,orientation:vt,coord:Ut,spanMin:Lt,spanMax:Et,tracks:[]};h.push({edgeIndex:m,segmentIndex:0,orientation:vt,pipe:Zt,trackIndex:0,from:Lt,to:Et});continue}}const mn=p("vertical",U.x,U.y,U.y);U.x=mn.coord;const pr=p("vertical",z.x,z.y,z.y);z.x=pr.coord;let ye=Math.min(U.x,z.x)-50,pe=Math.max(U.x,z.x)+50,Ae=Math.min(U.y,z.y)-50,we=Math.max(U.y,z.y)+50;for(const X of g){const $=Math.min(U.x,z.x),Q=Math.max(U.x,z.x),ht=Math.min(U.y,z.y),Tt=Math.max(U.y,z.y);X.minX<Q&&X.maxX>$&&X.minY<Tt&&X.maxY>ht&&(ye=Math.min(ye,X.minX-We),pe=Math.max(pe,X.maxX+We),Ae=Math.min(Ae,X.minY-We),we=Math.max(we,X.maxY+We))}for(const X of g){if(X.maxX<ye||X.minX>pe||X.maxY<Ae||X.minY>we)continue;const $=Ce;p("horizontal",X.minY-$,ye,pe),p("horizontal",X.maxY+$,ye,pe);const Q=Ne;p("vertical",X.minX-Q,Ae,we),p("vertical",X.maxX+Q,Ae,we)}p("horizontal",U.y,ye,pe),p("horizontal",z.y,ye,pe);const xr=a.filter(X=>X.orientation==="horizontal"&&X.coord>=Ae&&X.coord<=we),br=a.filter(X=>X.orientation==="vertical"&&X.coord>=ye&&X.coord<=pe),De=d((X,$)=>`${X.toFixed(1)},${$.toFixed(1)}`,"getKey"),He=De(U.x,U.y),Eo=De(z.x,z.y),Xe=new Map,yn=new Map,pn=new Map,Ye=new Set,Se=[];Xe.set(He,0),pn.set(He,"n"),Se.push({key:He,f:Math.hypot(z.x-U.x,z.y-U.y),pt:U}),Ye.add(He);let $t=[];const xe=d((X,$)=>L(X,$,S.start,S.end),"checkSegmentBlocked"),xn={x:z.x,y:U.y},Mr=xe(U,xn),Ir=xe(xn,z),Sr=Mr||Ir,bn={x:U.x,y:z.y},Cr=xe(U,bn),vr=xe(bn,z);if(Sr?Cr||vr||(Math.abs(U.x-z.x)<lt?$t=[U,z]:$t=[U,bn,z]):Math.abs(U.y-z.y)<lt||Math.abs(U.x-z.x)<lt?$t=[U,z]:$t=[U,xn,z],$t.length===0)for(;Se.length>0;){Se.sort((mt,Vt)=>mt.f-Vt.f);const X=Se.shift();if(Ye.delete(X.key),X.key===Eo){let mt=Eo,Vt=z;for($t=[Vt];yn.has(mt);){const re=yn.get(mt);$t.unshift(re),Vt=re,mt=De(re.x,re.y)}break}const $=X.pt.x,Q=X.pt.y,ht=br.sort((mt,Vt)=>mt.coord-Vt.coord),Tt=ht.findIndex(mt=>Math.abs(mt.coord-$)<1),Ct=xr.sort((mt,Vt)=>mt.coord-Vt.coord),Rt=Ct.findIndex(mt=>Math.abs(mt.coord-Q)<1),kt=[];Tt>0&&kt.push({x:ht[Tt-1].coord,y:Q}),Tt>=0&&Tt<ht.length-1&&kt.push({x:ht[Tt+1].coord,y:Q}),Rt>0&&kt.push({x:$,y:Ct[Rt-1].coord}),Rt>=0&&Rt<Ct.length-1&&kt.push({x:$,y:Ct[Rt+1].coord});for(const mt of kt){const Vt=Math.min($,mt.x),re=Math.max($,mt.x),Dt=Math.min(Q,mt.y),jt=Math.max(Q,mt.y);if(g.some(ne=>ne.nodeId===S.start||ne.nodeId===S.end?!1:Vt!==re?ne.minY<Q&&ne.maxY>Q&&ne.maxX>Vt&&ne.minX<re:ne.minX<$&&ne.maxX>$&&ne.maxY>Dt&&ne.minY<jt))continue;const vt=De(mt.x,mt.y),Ut=Math.abs(mt.x-$)+Math.abs(mt.y-Q),Lt=b(m,X.pt,mt);let Et=0;const Zt=z.x-U.x,Re=z.y-U.y,Ge=mt.x-$,Mn=mt.y-Q;(Re>10&&Mn<-5||Re<-10&&Mn>5)&&(Et=Math.abs(Mn)*100),(Zt>10&&Ge<-5||Zt<-10&&Ge>5)&&(Et+=Math.abs(Ge)*50);let To=0;const Ao=pn.get(X.key)??"n",wo=Math.abs(Ge)>lt?"h":"v";Ao!=="n"&&Ao!==wo&&(To=50);const Lr=Ut+Lt+Et+To,$e=(Xe.get(X.key)??1/0)+Lr,Ro=Math.abs(z.x-mt.x)+Math.abs(z.y-mt.y);if($e<(Xe.get(vt)??1/0))if(yn.set(vt,X.pt),Xe.set(vt,$e),pn.set(vt,wo),!Ye.has(vt))Se.push({key:vt,f:$e+Ro,pt:mt}),Ye.add(vt);else{const ne=Se.findIndex(Er=>Er.key===vt);ne!==-1&&(Se[ne].f=$e+Ro)}}}if($t.length===0&&($t=[U,{x:U.x,y:z.y},z]),$t.length>4){const X=$t[0],$=$t[$t.length-1];let Q=Math.min(X.x,$.x),ht=Math.max(X.x,$.x),Tt=Math.min(X.y,$.y),Ct=Math.max(X.y,$.y);for(const Dt of $t)Q=Math.min(Q,Dt.x),ht=Math.max(ht,Dt.x),Tt=Math.min(Tt,Dt.y),Ct=Math.max(Ct,Dt.y);const Rt=ht>Math.max(X.x,$.x),kt=Q<Math.min(X.x,$.x);if(l){const Dt=Ne;if(Rt){const jt=Math.max(X.x,$.x),Ft=Math.min(X.y,$.y),vt=Math.max(X.y,$.y),Ut=g.filter(Lt=>Lt.minX<jt&&Lt.maxX>jt&&Lt.minY<vt&&Lt.maxY>Ft);if(Ut.length>0){let Lt=Math.max(X.x,$.x);for(const Et of Ut){const Zt=(Et.minX+Et.maxX)/2;if(Et.visualXHalfExtent===void 0||isNaN(Et.visualXHalfExtent))continue;const Re=Zt+Et.visualXHalfExtent+Dt;Lt=Math.max(Lt,Re)}isNaN(Lt)||(ht=Lt)}}if(kt){const jt=g.filter(Ft=>Ft.minX<Math.min(X.x,$.x)+Dt&&Ft.minY<Math.max(X.y,$.y)&&Ft.maxY>Math.min(X.y,$.y));if(jt.length>0){let Ft=Math.min(X.x,$.x);for(const vt of jt){const Lt=(vt.minX+vt.maxX)/2-vt.visualXHalfExtent-Dt;Ft=Math.min(Ft,Lt)}Q=Ft}}}const mt=d(Dt=>{const jt=$.y>X.y,Ft=g.filter(Lt=>{const Et=Math.min(X.x,$.x)<Lt.maxX&&Math.max(X.x,$.x)>Lt.minX,Zt=Math.min(X.y,$.y)<Lt.maxY&&Math.max(X.y,$.y)>Lt.minY;return Et&&Zt});let vt=Ft;if(l&&Ft.length>0){const Lt=Ft.filter(Et=>Et.minX<Dt&&Et.maxX>Dt);Lt.length>0&&(vt=Lt)}if(vt.length===0)return $.y;const Ut=Ce;if(jt){const Et=Math.max(...vt.map(Zt=>Zt.maxY))+Ut;if(Et<$.y-lt)return Et}else{const Et=Math.min(...vt.map(Zt=>Zt.minY))-Ut;if(Et>$.y+lt)return Et}return $.y},"findBestReturnY"),Vt=d(Dt=>{const jt=mt(Dt),Ft={x:Dt,y:X.y},vt={x:Dt,y:jt},Ut={x:$.x,y:jt},Lt=xe(X,Ft),Et=xe(Ft,vt),Zt=xe(vt,Ut),Re=jt!==$.y?xe(Ut,$):!1;return!Lt&&!Et&&!Zt&&!Re?Math.abs(jt-$.y)<lt?[X,Ft,vt,$]:[X,Ft,vt,Ut,$]:null},"trySimplifyWithDetourX"),re=Rt&&!kt?Vt(ht):kt&&!Rt?Vt(Q):null;re&&($t=re)}const zt=[N,...It,...$t,...Gt.reverse(),D];if(zt.length>=3){const X=zt[zt.length-1],$=zt[zt.length-2],Q=zt[zt.length-3],ht=Math.abs(Q.y-$.y)<lt&&Math.abs($.y-X.y)<lt,Tt=Math.abs(Q.x-$.x)<lt&&Math.abs($.x-X.x)<lt;if(ht){const Ct=Math.sign($.x-Q.x),Rt=Math.sign(X.x-Q.x);Ct!==0&&Ct===Rt&&Math.abs($.x-Q.x)>Math.abs(X.x-Q.x)&&zt.splice(-2,1)}else if(Tt){const Ct=Math.sign($.y-Q.y),Rt=Math.sign(X.y-Q.y);Ct!==0&&Ct===Rt&&Math.abs($.y-Q.y)>Math.abs(X.y-Q.y)&&zt.splice(-2,1)}}const fe=[zt[0]];for(let X=1;X<zt.length-1;X++){if(X===1){fe.push(zt[X]);continue}const $=fe[fe.length-1],Q=zt[X],ht=zt[X+1];if(Math.abs($.y-Q.y)<lt&&Math.abs(Q.y-ht.y)<lt){const Tt=Q.x>$.x,Ct=ht.x>Q.x;if(Tt!==Ct){fe.push(Q);continue}continue}if(Math.abs($.x-Q.x)<lt&&Math.abs(Q.x-ht.x)<lt){const Tt=Q.y>$.y,Ct=ht.y>Q.y;if(Tt!==Ct){fe.push(Q);continue}continue}fe.push(Q)}fe.push(zt[zt.length-1]);for(let X=0;X<fe.length-1;X++){const $=fe[X],Q=fe[X+1],ht=Math.abs($.x-Q.x)<lt?"vertical":"horizontal",Tt=ht==="vertical"?$.x:$.y,Ct=ht==="vertical"?Math.min($.y,Q.y):Math.min($.x,Q.x),Rt=ht==="vertical"?Math.max($.y,Q.y):Math.max($.x,Q.x),kt=p(ht,Tt,Ct,Rt),mt={edgeIndex:m,segmentIndex:X,orientation:ht,pipe:kt,trackIndex:0,from:Ct,to:Rt};h.push(mt),i[m].push(h.length-1),kt.tracks[0]||(kt.tracks[0]={index:0,coord:kt.coord,segments:[]}),kt.tracks[0].segments.push({edgeIndex:m,segmentIndex:X,from:Ct,to:Rt})}}const J=d((m,S)=>m.from<S.to&&S.from<m.to,"segmentsOverlap"),rt=d((m,S,A,T)=>{const N=!T.segments.some(W=>(W.edgeIndex!==S.edgeIndex||W.segmentIndex!==S.segmentIndex)&&J(W,m)),D=!A.segments.some(W=>(W.edgeIndex!==m.edgeIndex||W.segmentIndex!==m.segmentIndex)&&J(W,S));return N&&D?(m.trackIndex=T.index,S.trackIndex=A.index,A.segments=[...A.segments.filter(W=>W.edgeIndex!==m.edgeIndex||W.segmentIndex!==m.segmentIndex),{edgeIndex:S.edgeIndex,segmentIndex:S.segmentIndex,from:S.from,to:S.to}],T.segments=[...T.segments.filter(W=>W.edgeIndex!==S.edgeIndex||W.segmentIndex!==S.segmentIndex),{edgeIndex:m.edgeIndex,segmentIndex:m.segmentIndex,from:m.from,to:m.to}],!0):!1},"trySwapSegmentsAcrossTracks"),ut=d(m=>{const S=m.tracks.length;return m.tracks[S]={index:S,coord:m.coord,segments:[]},S},"createNewTrack"),pt=d((m,S)=>{const A=m.pipe.tracks[m.trackIndex];A.segments=A.segments.filter(N=>N.edgeIndex!==m.edgeIndex||N.segmentIndex!==m.segmentIndex),m.trackIndex=S,m.pipe.tracks[S].segments.push({edgeIndex:m.edgeIndex,segmentIndex:m.segmentIndex,from:m.from,to:m.to})},"moveSegmentToTrack"),St=d((m,S)=>{const A=i[m.edgeIndex];for(const T of A){const N=h[T];N.pipe===m.pipe&&pt(N,S)}},"moveSegmentChainToTrack"),At=d(m=>{const S=i[m.edgeIndex],A=S.indexOf(h.indexOf(m)),T=[];return A>0&&T.push(h[S[A-1]]),A<S.length-1&&T.push(h[S[A+1]]),T},"getAdjacentSegmentsAlongEdge"),Kt=d((m,S)=>{if(m.orientation===S.orientation)return!1;const A=m.orientation==="horizontal"?m:S,T=m.orientation==="horizontal"?S:m;return T.pipe.coord>A.from&&T.pipe.coord<A.to&&A.pipe.coord>T.from&&A.pipe.coord<T.to},"haveAnyCrossing"),qt=d((m,S)=>{for(const A of m.tracks)if(!A.segments.some(N=>(N.edgeIndex!==S.edgeIndex||N.segmentIndex!==S.segmentIndex)&&J(N,S)))return A.index;return-1},"findAvailableTrack"),Jt=d((m,S)=>{if(m.trackIndex===S.trackIndex)return J(m,S);const A=At(m),T=At(S);return A.some(N=>T.some(D=>Kt(N,D)))},"segmentsConflict"),se=d((m,S,A)=>{if(rt(m,S,m.pipe.tracks[m.trackIndex],S.pipe.tracks[S.trackIndex]))return;const T=qt(m.pipe,S);A(S,T!==-1?T:ut(m.pipe))},"resolveTrackConflict"),Ee=d(m=>{let S=0;for(let A=0;A<m.length;A++)for(let T=A+1;T<m.length;T++){const N=m[A],D=m[T];N.pipe===D.pipe&&Jt(N,D)&&(S++,se(N,D,St))}return S},"resolveHandleConflicts"),me=new Map,Te=d(m=>{if(me.has(m))return me.get(m);const S=i[m];if(S.length===0){const ot={dest:0,deviation:0,base:0,delta:0};return me.set(m,ot),ot}const T=h[S[0]].pipe.coord;let N=T;for(let ot=1;ot<S.length;ot++){const U=h[S[ot]];if(U.orientation==="horizontal"){const z=U.from,bt=U.to;N=Math.abs(z-T)>Math.abs(bt-T)?z:bt;break}}const D=Math.abs(N-T),W={dest:N,deviation:D,base:T,delta:N-T};return me.set(m,W),W},"getDestInfo"),un=d(()=>{let m=0;const S=new Map;for(const[T,N]of s.entries())i[T].length!==0&&N.start&&(S.has(N.start)||S.set(N.start,[]),S.get(N.start).push(T));const A=d(T=>{const N=s[T];if(!N.start||!N.end)return 0;const D=r.get(N.start),W=r.get(N.end);if(!D||!W)return 0;const ot=(W.x??0)-(D.x??0),U=(W.y??0)-(D.y??0);return Math.abs(ot)+Math.abs(U)},"getEdgeDistance");for(const T of S.values()){T.sort((D,W)=>{const ot=Te(D),U=Te(W);if(Math.abs(ot.deviation-U.deviation)>1)return ot.deviation-U.deviation;if(Math.abs(ot.dest-U.dest)>1)return ot.dest-U.dest;const z=A(D),bt=A(W);if(Math.abs(z-bt)>1)return bt-z;const dt=i[D].length,ct=i[W].length;if(dt!==ct)return dt-ct;if(dt===1){const st=i[D][0],It=i[W][0];if(h[st]&&h[It]){const Bt=h[st],wt=h[It],Gt=Math.abs(Bt.to-Bt.from),ee=Math.abs(wt.to-wt.from);if(Math.abs(Gt-ee)>1)return Gt-ee}}return 0});const N=T.map(D=>h[i[D][0]]);m+=Ee(N)}return m},"fixSourceHandleCrossings"),hn=d(()=>{let m=0;const S=new Map;for(const[A,T]of s.entries())i[A].length!==0&&T.end&&(S.has(T.end)||S.set(T.end,[]),S.get(T.end).push(A));for(const A of S.values()){A.sort((N,D)=>{const W=d(z=>{const bt=i[z];if(bt.length<2)return 0;const dt=h[bt[bt.length-2]];return Math.abs(dt.to-dt.from)},"getDist"),ot=W(N),U=W(D);return Math.abs(ot-U)>.1?ot-U:N-D});const T=A.map(N=>h[i[N][i[N].length-1]]);m+=Ee(T)}return m},"fixTargetHandleCrossings"),gn=d(()=>{let m=0;for(const S of a){const A=[];for(const T of S.tracks)for(const N of T.segments){const D=i[N.edgeIndex].find(W=>h[W].segmentIndex===N.segmentIndex);D!==void 0&&A.push(h[D])}A.sort((T,N)=>T.edgeIndex-N.edgeIndex||T.segmentIndex-N.segmentIndex);for(let T=0;T<A.length;T++)for(let N=T+1;N<A.length;N++){const D=A[T],W=A[N];Jt(D,W)&&(m++,se(D,W,pt))}}return m},"fixPipeCrossings");let R=0;const F=10;for(;R<F;){let m=0;if(m+=un(),m+=hn(),m+=gn(),m===0)break;R++}const _=new Map;for(const m of a){const S=[];m.tracks.forEach(T=>{T.segments.forEach(N=>{S.push({edgeIndex:N.edgeIndex,segmentIndex:N.segmentIndex,trackIndex:T.index,from:N.from,to:N.to})})}),S.sort((T,N)=>T.from-N.from);const A=[];if(S.length>0){let T=[S[0]],N=S[0].to;for(let D=1;D<S.length;D++){const W=S[D];W.from<N?(T.push(W),N=Math.max(N,W.to)):(A.push(T),T=[W],N=W.to)}A.push(T)}for(const T of A){const N=new Set;T.forEach(st=>N.add(st.trackIndex));const D=new Map;T.forEach(st=>{const It=Te(st.edgeIndex);D.set(st.trackIndex,(D.get(st.trackIndex)??0)+It.delta)});const W=[...N].filter(st=>(D.get(st)??0)<-1),ot=[...N].filter(st=>(D.get(st)??0)>1),U=[...N].filter(st=>Math.abs(D.get(st)??0)<=1);W.sort((st,It)=>(D.get(It)??0)-(D.get(st)??0)),ot.sort((st,It)=>(D.get(st)??0)-(D.get(It)??0));const z=d((st,It)=>{T.filter(Bt=>Bt.trackIndex===st).forEach(Bt=>{const wt=x.has(Bt.edgeIndex)?m.coord:It;_.set(`${Bt.edgeIndex}-${Bt.segmentIndex}`,wt)})},"assignCoord");let bt=0;for(const st of W)bt++,z(st,m.coord-bt*vn);if(U.length===0&&N.size>0){const st=[...N].sort((wt,Gt)=>Math.abs(D.get(wt)??0)-Math.abs(D.get(Gt)??0))[0],It=W.indexOf(st);It!==-1&&W.splice(It,1);const Bt=ot.indexOf(st);Bt!==-1&&ot.splice(Bt,1),U.push(st)}let dt=0;for(const st of U){if(dt===0)z(st,m.coord);else{const It=dt%2===1?1:-1,Bt=Math.ceil(dt/2);z(st,m.coord+It*Bt*vn*.5)}dt++}let ct=0;for(const st of ot)ct++,z(st,m.coord+ct*vn)}}for(const[m,S]of s.entries()){const A=i[m]??[];if(A.length===0)continue;const T=[],N=r.get(S.start),D=r.get(S.end),{pSrcPort:W,pDstPort:ot}=nt(m,N,D),U=A.map(dt=>{const ct=h[dt],st=_.get(`${ct.edgeIndex}-${ct.segmentIndex}`)??ct.pipe.coord;return{orient:ct.orientation,coord:st,from:ct.from,to:ct.to}});T.push(W);for(let dt=0;dt<U.length;dt++){const ct=U[dt],st=T[T.length-1],It=ct.orient==="vertical"?st.y:st.x,Bt=ct.orient==="vertical"?st.x:st.y,wt=U[dt+1],Gt=dt<U.length-1;if(Math.abs(Bt-ct.coord)>lt&&T.push(ve(ct,It)),Gt&&wt.orient===ct.orient)if(Math.abs(ct.coord-wt.coord)>lt){const ee=ct.orient==="vertical"?(It+wt.from)/2:so(ct,wt);T.push(ve(ct,ee),ve(wt,ee))}else(dt===0||dt===U.length-2)&&T.push(ve(ct,so(ct,wt)));else if(Gt)T.push(ve(ct,wt.coord));else{const ee=Math.abs(ct.from-It)<Math.abs(ct.to-It)?ct.to:ct.from;T.push(ve(ct,ee))}}const z=T[T.length-1];(Math.abs(z.x-ot.x)>lt||Math.abs(z.y-ot.y)>lt)&&T.push(ot);const bt=[];T.length>0&&bt.push(T[0]);for(let dt=1;dt<T.length;dt++){const ct=T[dt],st=bt[bt.length-1];(Math.abs(ct.x-st.x)>lt||Math.abs(ct.y-st.y)>lt)&&bt.push(ct)}S.points=bt}for(const m of s){const S=m.__originalEdge;S&&m.points&&(S.points=m.points)}t.edges=(t.edges??[]).filter(m=>!m.isLayoutOnly);const V=d((m,S)=>{const A=S.x??0,T=S.y??0,N=S.width??0,D=S.height??0;if(N<=0||D<=0)return m;const W=A-N/2,ot=A+N/2,U=T-D/2,z=T+D/2;if(m.x<W||m.x>ot||m.y<U||m.y>z)return m;const bt=m.x-W,dt=ot-m.x,ct=m.y-U,st=z-m.y,It=Math.min(bt,dt,ct,st);return It===bt?{x:W,y:m.y}:It===dt?{x:ot,y:m.y}:It===ct?{x:m.x,y:U}:{x:m.x,y:z}},"nodeBoundaryClamp");for(const m of t.edges){const S=m.points;if(!S||S.length<2)continue;const A=m.start,T=m.end,N=A?r.get(A):void 0,D=T?r.get(T):void 0;N&&(S[0]=V(S[0],N)),D&&(S[S.length-1]=V(S[S.length-1],D))}return t}d(hr,"routeEdgesOrthogonal");function gr(t){return t.direction??"TB"}d(gr,"getSwimlaneDirection");function mr(t){var g,p,I,u,h;const e=Jo(t),n=((g=t.config.flowchart)==null?void 0:g.nodeSpacing)??40,o=((p=t.config.flowchart)==null?void 0:p.rankSpacing)??100,s=((I=t.config.swimlane)==null?void 0:I.ignoreCrossLaneEdges)??!0,r=((u=t.config.swimlane)==null?void 0:u.optimizeRanksByCrossings)??!0,f=((h=t.config.swimlane)==null?void 0:h.automaticLaneOrdering)??!1,a=gr(t),{ordered:l,coordinates:c}=ur(e,{nodeGap:n,layerGap:o,ignoreCrossLaneEdges:s,optimizeRanksByCrossings:r,automaticLaneOrdering:f,direction:a});Zo(e,l,c,{nodeGap:n,layerGap:o});for(const i of t.edges??[])delete i.points;hr(t,a);for(const i of t.edges??[])(!i.curve||i.curve==="basis")&&(i.curve="rounded");return Rs(t,a),ws(t),a}d(mr,"runSwimlaneLayoutCore");function yr(t){qo(t);const e=Qo(t);t.nodes=e.nodes,t.edges=e.edges}d(yr,"prepareSwimlaneLayout");var Yr=Tr({prepareLayout:yr,runLayoutCore:mr,afterPaint:Wo});export{Yr as render};
|