@kabmo-labs/kabmo 0.57.1 → 0.58.1

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.
Files changed (570) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +540 -510
  3. package/dist/client/static/js/Body-ysmhxbvk.js +3 -0
  4. package/dist/client/static/js/{CsvGrid-563qmmmr.js → CsvGrid-w90pxyn2.js} +2 -2
  5. package/dist/client/static/js/{DocxView-5j69q3s0.js → DocxView-evxn6kaq.js} +2 -2
  6. package/dist/client/static/js/{DrawioView-gd6k3hvn.js → DrawioView-tmdevwf4.js} +2 -2
  7. package/dist/client/static/js/{HtmlPreview-6gnktzzp.js → HtmlPreview-bpsn2z9p.js} +1 -1
  8. package/dist/client/static/js/ImageView-ssazqckj.js +1 -0
  9. package/dist/client/static/js/LayoutWrapper-qwpfq4dq.js +2 -0
  10. package/dist/client/static/js/MergeDiffView-en6aazw8.js +1 -0
  11. package/dist/client/static/js/Modal-zjnhj9nb.js +60 -0
  12. package/dist/client/static/js/{PdfView-n1zq27td.js → PdfView-txxn6qff.js} +1 -1
  13. package/dist/client/static/js/SessionsView-eryjtmb2.js +1 -0
  14. package/dist/client/static/js/{SheetView-nes7j86v.js → SheetView-52b33e6f.js} +11 -11
  15. package/dist/client/static/js/{SvgPreview-vv0qzkt7.js → SvgPreview-hrk4pfm1.js} +1 -1
  16. package/dist/client/static/js/{abnfDiagram-O67JEVCF-02g96sn6.js → abnfDiagram-O67JEVCF-at77sybc.js} +1 -1
  17. package/dist/client/static/js/architecture-7GRP2DOG-v05ap4e3.js +1 -0
  18. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-7qj2fpwt.js → architectureDiagram-NJMV4G6O-raw33jgg.js} +11 -11
  19. package/dist/client/static/js/{astro-asmathwv.js → astro-qha7sceh.js} +1 -1
  20. package/dist/client/static/js/bash-n5d0esqg.js +1 -0
  21. package/dist/client/static/js/{blockDiagram-BEXU5L5S-grdr1j2h.js → blockDiagram-BEXU5L5S-b6e90fbk.js} +7 -7
  22. package/dist/client/static/js/c-pk766wx0.js +1 -0
  23. package/dist/client/static/js/{c4Diagram-YGBWAQC7-7y980xpx.js → c4Diagram-YGBWAQC7-msg9y1c6.js} +2 -2
  24. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-29ag4js1.js → classDiagram-v2-NBCMYWYE-jmrd1h8r.js} +5 -5
  25. package/dist/client/static/js/{cose-bilkent-JH36ORCC-e5dvgehd.js → cose-bilkent-JH36ORCC-na65ebq3.js} +1 -1
  26. package/dist/client/static/js/cpp-3pt91jvm.js +1 -0
  27. package/dist/client/static/js/css-q2k6afe3.js +1 -0
  28. package/dist/client/static/js/css-sp1cgdbr.js +1 -0
  29. package/dist/client/static/js/cynefin-OW5HDTMX-sqv0ze38.js +1 -0
  30. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-eq6fmx0b.js → cynefinDiagram-VND7K2PF-9xkkw71m.js} +2 -2
  31. package/dist/client/static/js/{dagre-6A5THRUB-xfhwp8ha.js → dagre-6A5THRUB-p59f19tv.js} +2 -2
  32. package/dist/client/static/js/{diagram-22UHCM2B-1bw6x6zt.js → diagram-22UHCM2B-2e2rcvn7.js} +14 -14
  33. package/dist/client/static/js/{diagram-3UASUU5V-076ej5n5.js → diagram-3UASUU5V-r9ds8vgr.js} +2 -2
  34. package/dist/client/static/js/{diagram-ATOU4E4O-cvf9fhdq.js → diagram-ATOU4E4O-jgwxv7v8.js} +3 -3
  35. package/dist/client/static/js/{diagram-CDSNMT55-hn1wdx54.js → diagram-CDSNMT55-20m35eqq.js} +5 -5
  36. package/dist/client/static/js/{diagram-MLGK6HIB-76gk27b5.js → diagram-MLGK6HIB-vt3kxt2m.js} +2 -2
  37. package/dist/client/static/js/{diagram-MPIPVDR6-0cbajhpx.js → diagram-MPIPVDR6-c47rgxf1.js} +2 -2
  38. package/dist/client/static/js/{dockerfile-7atfjhnf.js → dockerfile-gtcyey0q.js} +1 -1
  39. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-n0g3b9m2.js → ebnfDiagram-ZINNZB2B-aszw3xy3.js} +1 -1
  40. package/dist/client/static/js/{elixir-7q2k61zb.js → elixir-w92v180e.js} +1 -1
  41. package/dist/client/static/js/{elk-276RUBZZ-f6wrjcv9.js → elk-276RUBZZ-gbvr3gry.js} +1 -1
  42. package/dist/client/static/js/{erDiagram-OPXOYQCR-jz622yrg.js → erDiagram-OPXOYQCR-1hqca8qe.js} +5 -5
  43. package/dist/client/static/js/{erlang-tjsd7n4d.js → erlang-v7344938.js} +1 -1
  44. package/dist/client/static/js/eventmodeling-NTZA5JFV-t4dzf5s7.js +1 -0
  45. package/dist/client/static/js/flowDiagram-KWPJA3E3-c16xmjyv.js +1 -0
  46. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-2ex4nxyg.js → ganttDiagram-FUAMR5RP-07v22te5.js} +4 -4
  47. package/dist/client/static/js/gitGraph-4MIJSDKK-0jq8y0qd.js +1 -0
  48. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-38eyay6g.js → gitGraphDiagram-X574FWY7-y068jtz9.js} +18 -18
  49. package/dist/client/static/js/graphql-qx4tt6ze.js +1 -0
  50. package/dist/client/static/js/html-5e0g8664.js +1 -0
  51. package/dist/client/static/js/index-007sewcn.js +2 -0
  52. package/dist/client/static/js/{index-tksrpqkh.js → index-1e0rt7c6.js} +5 -5
  53. package/dist/client/static/js/index-1e710snk.js +1 -0
  54. package/dist/client/static/js/{index-8pqx5n2p.js → index-2s17netq.js} +2 -2
  55. package/dist/client/static/js/index-374xq5a4.js +1 -0
  56. package/dist/client/static/js/{index-j9y4tjk0.js → index-3m1dksmy.js} +2 -2
  57. package/dist/client/static/js/{index-668fc1df.js → index-3p732mvs.js} +2 -2
  58. package/dist/client/static/js/{index-3x88t8g9.js → index-3ymw778n.js} +2 -2
  59. package/dist/client/static/js/index-4ddgpqm0.css +1 -0
  60. package/dist/client/static/js/index-5g2j626a.js +1 -0
  61. package/dist/client/static/js/{index-rbkvw2xs.js → index-5hvt233n.js} +2 -2
  62. package/dist/client/static/js/{index-tdryzzy9.js → index-5xxbbzqa.js} +6 -6
  63. package/dist/client/static/js/{index-25zpywv7.js → index-6x0kn8pb.js} +2 -2
  64. package/dist/client/static/js/{index-e4yj4kbe.js → index-7sq6cjt1.js} +12 -12
  65. package/dist/client/static/js/{index-my856e49.js → index-7ynf3s2w.js} +2 -2
  66. package/dist/client/static/js/{index-q0k1am0g.js → index-80kx6dm6.js} +2 -2
  67. package/dist/client/static/js/index-8d8ce00v.js +2 -0
  68. package/dist/client/static/js/{index-63mk2qk6.js → index-94d416ee.js} +2 -2
  69. package/dist/client/static/js/{index-db7vsjkd.js → index-an7fq7f6.js} +1 -1
  70. package/dist/client/static/js/{index-zzggk17b.js → index-azz46nwc.js} +2 -2
  71. package/dist/client/static/js/index-c9aqx3ht.js +1 -0
  72. package/dist/client/static/js/index-cc7qbfvn.js +477 -0
  73. package/dist/client/static/js/{index-cwwg7k5f.js → index-cmjyet7w.js} +49 -49
  74. package/dist/client/static/js/{index-55v3qv04.js → index-cpp43af3.js} +22 -22
  75. package/dist/client/static/js/{index-jaxhfk9x.js → index-dxq1tbwm.js} +2 -2
  76. package/dist/client/static/js/index-e0kahttb.js +1 -0
  77. package/dist/client/static/js/index-e4nge3f4.js +1 -0
  78. package/dist/client/static/js/{index-wxs0x3g1.js → index-ewryzs4g.js} +2 -2
  79. package/dist/client/static/js/index-f27wvdky.js +4 -0
  80. package/dist/client/static/js/{index-zv8wrvha.js → index-f61c25vn.js} +3 -3
  81. package/dist/client/static/js/{index-g2e0m757.js → index-fe92hqmb.js} +8 -8
  82. package/dist/client/static/js/{index-nnqyew8n.js → index-fhtnvqgf.js} +2 -2
  83. package/dist/client/static/js/{index-ep99arz1.js → index-fv7nybnf.js} +2 -2
  84. package/dist/client/static/js/{index-396g4zz4.js → index-gaa39w5q.js} +2 -2
  85. package/dist/client/static/js/{index-xfnjwhan.js → index-gqrt766t.js} +91 -91
  86. package/dist/client/static/js/index-hb7a7m9m.js +1 -0
  87. package/dist/client/static/js/{index-zynbvm7x.js → index-j830qk07.js} +2 -2
  88. package/dist/client/static/js/{index-0prwdwyb.js → index-jxsha63v.js} +2 -2
  89. package/dist/client/static/js/{index-8444mec5.js → index-kzzvrqnv.js} +2 -2
  90. package/dist/client/static/js/{index-6z30g3ha.js → index-m5n0zsft.js} +2 -2
  91. package/dist/client/static/js/{index-1q934wfk.js → index-medk4f18.js} +2 -2
  92. package/dist/client/static/js/index-nptbz7sv.js +2 -0
  93. package/dist/client/static/js/index-qefssj0m.js +1 -0
  94. package/dist/client/static/js/{index-mpyd7qxj.js → index-r8d4bk86.js} +2 -2
  95. package/dist/client/static/js/{index-hge0y4vn.js → index-rqt8mem9.js} +2 -2
  96. package/dist/client/static/js/{index-y1j18rha.js → index-rxt8sf9a.js} +2 -2
  97. package/dist/client/static/js/index-s4dpkds5.js +2 -0
  98. package/dist/client/static/js/index-s9k82stc.js +2 -0
  99. package/dist/client/static/js/index-skwem10a.js +2 -0
  100. package/dist/client/static/js/{index-rsyqf691.js → index-sxag9ptg.js} +2 -2
  101. package/dist/client/static/js/{index-m6eh5g1q.js → index-tdg7hz80.js} +2 -2
  102. package/dist/client/static/js/{index-nt17ejrm.js → index-th61y26d.js} +2 -2
  103. package/dist/client/static/js/{index-ms80nne4.js → index-tq3t3qm4.js} +2 -2
  104. package/dist/client/static/js/index-tv9rn2nd.js +2 -0
  105. package/dist/client/static/js/{index-xtrsvm0d.js → index-v8xhgfeq.js} +2 -2
  106. package/dist/client/static/js/{index-60g0e74a.js → index-vny4ymjf.js} +1 -1
  107. package/dist/client/static/js/{index-4cff0zg2.js → index-vw8b29ek.js} +1 -1
  108. package/dist/client/static/js/{index-9gfn1a3h.js → index-wn28m9h7.js} +8 -8
  109. package/dist/client/static/js/index-wxqcnsrq.js +2 -0
  110. package/dist/client/static/js/index-xmg1x6zv.js +9 -0
  111. package/dist/client/static/js/{index-kt7c42n7.js → index-y0f3wbc3.js} +2 -2
  112. package/dist/client/static/js/{index-ewst55j2.js → index-zhgh7a31.js} +2 -2
  113. package/dist/client/static/js/index-zs7kw0be.js +4 -0
  114. package/dist/client/static/js/info-A6RAGUB7-szttx3v5.js +1 -0
  115. package/dist/client/static/js/{infoDiagram-VRGFBTTK-c55t0tvd.js → infoDiagram-VRGFBTTK-1x83h4k4.js} +2 -2
  116. package/dist/client/static/js/ini-bdk46a3d.js +1 -0
  117. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-r9kg5kg5.js → ishikawaDiagram-OU5B5YK6-et6z3c28.js} +3 -3
  118. package/dist/client/static/js/java-3g3925cf.js +1 -0
  119. package/dist/client/static/js/javascript-av46zx4c.js +1 -0
  120. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-zmmst4v8.js → journeyDiagram-ZHPQQLJL-sw669e7a.js} +4 -4
  121. package/dist/client/static/js/json-hdyzmffz.js +1 -0
  122. package/dist/client/static/js/jsx-y8r9mrdq.js +1 -0
  123. package/dist/client/static/js/{julia-d18zhpyp.js → julia-z14p8jsx.js} +1 -1
  124. package/dist/client/static/js/{kanban-definition-PNTS6WVX-3tt6sc9a.js → kanban-definition-PNTS6WVX-aqxg95kx.js} +6 -6
  125. package/dist/client/static/js/lua-wf5k6p3r.js +1 -0
  126. package/dist/client/static/js/markdown-9bf16dx7.js +1 -0
  127. package/dist/client/static/js/{mermaid.core-pkrs8zp5.js → mermaid.core-6cgqsgcf.js} +8 -8
  128. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-b4c6gxg4.js → mindmap-definition-NLK3R4M7-530anpc4.js} +7 -7
  129. package/dist/client/static/js/one-dark-pro-9hnhtkpr.js +1 -0
  130. package/dist/client/static/js/one-light-2n5y8592.js +1 -0
  131. package/dist/client/static/js/packet-AYTQ26CC-401149bv.js +1 -0
  132. package/dist/client/static/js/{pegDiagram-GJSIUBJH-9jkat1mz.js → pegDiagram-GJSIUBJH-5zar6hvy.js} +1 -1
  133. package/dist/client/static/js/{perl-sns2qvmf.js → perl-1na2x6yd.js} +1 -1
  134. package/dist/client/static/js/{php-3q6v9eey.js → php-x75tt7w3.js} +1 -1
  135. package/dist/client/static/js/pie-WAS4IAKB-bgfv8tfz.js +1 -0
  136. package/dist/client/static/js/{pieDiagram-5QR66LMP-6pbchjh7.js → pieDiagram-5QR66LMP-3bx8syvw.js} +2 -2
  137. package/dist/client/static/js/properties-xk4dn00p.js +1 -0
  138. package/dist/client/static/js/python-7sgz05n4.js +1 -0
  139. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-p9brea19.js → quadrantDiagram-O4NWA36T-yaarpr2e.js} +6 -6
  140. package/dist/client/static/js/r-w4qxm0pv.js +1 -0
  141. package/dist/client/static/js/radar-RG4KPBEZ-pw720590.js +1 -0
  142. package/dist/client/static/js/railroad-74A4TZTK-n2a30ngs.js +1 -0
  143. package/dist/client/static/js/railroad-abnf-HS5TGJTU-rn5rx9qt.js +1 -0
  144. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-t4yryhtd.js +1 -0
  145. package/dist/client/static/js/railroad-peg-WCYAUIDC-c4ebgvrr.js +1 -0
  146. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-3cep8css.js → railroadDiagram-XR7U4H2S-ag41q4nt.js} +1 -1
  147. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-x1yjgsrr.js → requirementDiagram-PLB6GJNP-g8sr48h4.js} +12 -12
  148. package/dist/client/static/js/{ruby-f9k99tfq.js → ruby-3h22qahv.js} +1 -1
  149. package/dist/client/static/js/{rust-yy8gekx8.js → rust-r27demr5.js} +1 -1
  150. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-23wzf4aj.js → sankeyDiagram-IPEJSGJF-t1wbd1hh.js} +4 -4
  151. package/dist/client/static/js/{sass-2syegq28.js → sass-8bq5r2tz.js} +1 -1
  152. package/dist/client/static/js/{scss-9wz47c6t.js → scss-c04ezwnn.js} +1 -1
  153. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-w4wr3zzr.js → sequenceDiagram-PO4LG4MO-407mjqty.js} +21 -21
  154. package/dist/client/static/js/{sizeCapture-INFHLROL-aabfesnr.js → sizeCapture-INFHLROL-w38zb9ky.js} +1 -1
  155. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-t0n288xw.js → stateDiagram-v2-GCMORJYK-4cvgymkc.js} +3 -3
  156. package/dist/client/static/js/{svelte-mm3jfpje.js → svelte-egg3x4tw.js} +1 -1
  157. package/dist/client/static/js/{swimlanes-2SLR337P-1nnm0p7h.js → swimlanes-2SLR337P-w7ts2rzw.js} +1 -1
  158. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-v82nym6b.js +8 -0
  159. package/dist/client/static/js/{timeline-definition-EJHVYXUP-8pyssn0q.js → timeline-definition-EJHVYXUP-nq46nzy9.js} +7 -7
  160. package/dist/client/static/js/treeView-Q6P3EWNA-bxgt5yhm.js +1 -0
  161. package/dist/client/static/js/treemap-WGGIJYW6-hh3595m0.js +1 -0
  162. package/dist/client/static/js/tsx-h5yzg80q.js +1 -0
  163. package/dist/client/static/js/typescript-qy1sbhea.js +1 -0
  164. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-vveepvt6.js → usecaseDiagram-POWQR4AR-q144snzb.js} +45 -45
  165. package/dist/client/static/js/{vennDiagram-UO4OBE2U-tqyvmqxc.js → vennDiagram-UO4OBE2U-2wemak2p.js} +8 -8
  166. package/dist/client/static/js/{vue-e8e3q3hj.js → vue-d7p4wv35.js} +1 -1
  167. package/dist/client/static/js/wardley-WFR3VGLG-6bza7h1b.js +1 -0
  168. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-p8rs34em.js → wardleyDiagram-VNRHLVJA-bb2qvvgr.js} +5 -5
  169. package/dist/client/static/js/xml-mrk4xakv.js +1 -0
  170. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-pgnvxtps.js → xychartDiagram-PMCCYNJV-9dr05fdq.js} +6 -6
  171. package/dist/client/static/js/yaml-xaza6dra.js +1 -0
  172. package/package.json +6 -6
  173. package/src/client/bootstrap.d.ts +11 -0
  174. package/src/client/borders.css +3 -4
  175. package/src/client/components/auth/login-screen/index.tsx +1 -1
  176. package/src/client/components/common/ComposerPicker.tsx +1 -1
  177. package/src/client/components/common/CopyButton.tsx +1 -1
  178. package/src/client/components/common/FolderPicker.tsx +1 -1
  179. package/src/client/components/common/SubagentStatusIcon.tsx +2 -2
  180. package/src/client/components/common/ViewportSelector.tsx +2 -2
  181. package/src/client/components/common/anchored-menu/index.tsx +11 -4
  182. package/src/client/components/common/batch-selection/BatchActionBar.tsx +1 -1
  183. package/src/client/components/common/batch-selection/BatchDeleteModal.tsx +4 -4
  184. package/src/client/components/common/checkbox/style.ts +1 -1
  185. package/src/client/components/common/context-usage-button/McpSection.tsx +3 -2
  186. package/src/client/components/common/file-icon/index.tsx +3 -3
  187. package/src/client/components/common/harness-glyph/index.tsx +4 -3
  188. package/src/client/components/common/image-viewer/fullscreen.tsx +1 -1
  189. package/src/client/components/common/image-viewer/index.tsx +2 -2
  190. package/src/client/components/common/markdown-review/ReviewPopover.tsx +2 -2
  191. package/src/client/components/common/markdown-review/ReviewSummary.tsx +3 -3
  192. package/src/client/components/common/plugin-render-boundary/index.tsx +1 -1
  193. package/src/client/components/common/server-control/Panel.tsx +1 -1
  194. package/src/client/components/common/server-control/Row.tsx +3 -3
  195. package/src/client/components/common/session-actions-menu/MenuItem.tsx +2 -2
  196. package/src/client/components/common/session-branch/SubagentRow.tsx +1 -1
  197. package/src/client/components/common/session-delete-modal/index.tsx +4 -4
  198. package/src/client/components/common/session-row/StatusSlot.tsx +1 -1
  199. package/src/client/components/common/session-row/TrailingSlot.tsx +6 -2
  200. package/src/client/components/common/session-row/index.tsx +56 -2
  201. package/src/client/components/common/session-row/session-row.test.tsx +84 -3
  202. package/src/client/components/common/shell-update-button/Modal.tsx +1 -1
  203. package/src/client/components/common/todo-row/index.tsx +1 -1
  204. package/src/client/components/common/window-controls/index.tsx +1 -1
  205. package/src/client/components/common/workspace-options-menu/index.tsx +4 -4
  206. package/src/client/components/layout/session-sidebar/Toolbar.tsx +2 -2
  207. package/src/client/components/layout/session-sidebar/WorktreeBadge.tsx +1 -1
  208. package/src/client/components/layout/session-sidebar/about-modal/UpdateLogDialog.tsx +1 -1
  209. package/src/client/components/layout/session-sidebar/about-modal/UpdateSection.tsx +3 -3
  210. package/src/client/components/layout/session-sidebar/about-modal/index.tsx +1 -1
  211. package/src/client/components/layout/session-sidebar/modern/FilterChips.tsx +1 -1
  212. package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +24 -3
  213. package/src/client/components/layout/session-sidebar/modern/workspace-header.test.tsx +20 -0
  214. package/src/client/components/layout/session-sidebar/new-workspace-modal/DirectoryList.tsx +2 -2
  215. package/src/client/components/layout/session-sidebar/new-workspace-modal/index.tsx +1 -1
  216. package/src/client/components/layout/session-sidebar/scheduler-modal/ModelFields.tsx +1 -1
  217. package/src/client/components/layout/session-sidebar/scheduler-modal/TaskForm.tsx +1 -1
  218. package/src/client/components/layout/session-sidebar/scheduler-modal/TaskList.tsx +4 -4
  219. package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +1 -1
  220. package/src/client/components/layout/update-popup/Actions.tsx +1 -1
  221. package/src/client/components/mobile/mobile-right-sidebar/Action.tsx +1 -1
  222. package/src/client/components/mobile/mobile-right-sidebar/Header.tsx +3 -3
  223. package/src/client/components/mobile/mobile-right-sidebar/MissingFileBanner.tsx +2 -2
  224. package/src/client/components/mobile/mobile-right-sidebar/PreviewScroller.tsx +2 -2
  225. package/src/client/components/mobile/mobile-right-sidebar/StatusBar.tsx +2 -2
  226. package/src/client/components/mobile/mobile-session-sidebar/Toolbar.tsx +3 -3
  227. package/src/client/components/settings/Modal.tsx +8 -3
  228. package/src/client/components/settings/SettingsSidebarList.tsx +2 -2
  229. package/src/client/components/settings/Sidebar.tsx +3 -3
  230. package/src/client/components/settings/apply-side-effects.test.ts +46 -0
  231. package/src/client/components/settings/apply-side-effects.ts +8 -0
  232. package/src/client/components/settings/categories/BehaviorSettings.tsx +1 -1
  233. package/src/client/components/settings/categories/OmpSettings.tsx +3 -3
  234. package/src/client/components/settings/categories/UsageSettings.tsx +3 -3
  235. package/src/client/components/settings/categories/agent-settings/DetailPane.tsx +5 -5
  236. package/src/client/components/settings/categories/appearance-settings/CustomThemeEditor.tsx +177 -0
  237. package/src/client/components/settings/categories/appearance-settings/CustomThemeSection.test.tsx +136 -0
  238. package/src/client/components/settings/categories/appearance-settings/CustomThemeSection.tsx +180 -0
  239. package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +1 -1
  240. package/src/client/components/settings/categories/appearance-settings/ThemeGrid.tsx +6 -5
  241. package/src/client/components/settings/categories/appearance-settings/ThemePreview.tsx +106 -0
  242. package/src/client/components/settings/categories/appearance-settings/ThemeSection.tsx +7 -3
  243. package/src/client/components/settings/categories/behavior-settings/Editor.tsx +1 -1
  244. package/src/client/components/settings/categories/chat-settings/ToolRenderSection.tsx +1 -1
  245. package/src/client/components/settings/categories/command-settings/DetailPane.tsx +4 -4
  246. package/src/client/components/settings/categories/dictation-settings/ExternalSection.tsx +1 -1
  247. package/src/client/components/settings/categories/git-settings/CommitMessageSection.tsx +1 -1
  248. package/src/client/components/settings/categories/git-settings/IdentitySection.tsx +2 -2
  249. package/src/client/components/settings/categories/harness-settings/AccountLoginPanel.tsx +3 -3
  250. package/src/client/components/settings/categories/harness-settings/AccountsPanel.tsx +13 -83
  251. package/src/client/components/settings/categories/harness-settings/HarnessImportControls.tsx +1 -1
  252. package/src/client/components/settings/categories/mcp-settings/ConnectionTest.tsx +1 -1
  253. package/src/client/components/settings/categories/mcp-settings/DetailPane.tsx +5 -5
  254. package/src/client/components/settings/categories/mcp-settings/ImportModal.tsx +1 -1
  255. package/src/client/components/settings/categories/mcp-settings/KeyValueSection.tsx +1 -1
  256. package/src/client/components/settings/categories/mcp-settings/SidebarList.tsx +2 -2
  257. package/src/client/components/settings/categories/omp-settings/ConfigTabs.tsx +4 -4
  258. package/src/client/components/settings/categories/omp-settings/OrderedChips.tsx +1 -1
  259. package/src/client/components/settings/categories/omp-settings/PresetBar.tsx +3 -3
  260. package/src/client/components/settings/categories/omp-settings/RoleEditor.tsx +2 -2
  261. package/src/client/components/settings/categories/omp-settings/RowEditor.tsx +2 -2
  262. package/src/client/components/settings/categories/panel-plugins/GitFreshness.tsx +2 -2
  263. package/src/client/components/settings/categories/panel-plugins/InstallForm.tsx +3 -3
  264. package/src/client/components/settings/categories/panel-plugins/InstalledList.tsx +1 -1
  265. package/src/client/components/settings/categories/panel-plugins/Meta.tsx +1 -1
  266. package/src/client/components/settings/categories/panel-plugins/PluginCard.tsx +5 -5
  267. package/src/client/components/settings/categories/panel-plugins/ReadmeModal.tsx +1 -1
  268. package/src/client/components/settings/categories/panel-plugins/Registries.tsx +4 -4
  269. package/src/client/components/settings/categories/panel-plugins/Section.tsx +3 -3
  270. package/src/client/components/settings/categories/panel-plugins/SettingsModal.tsx +2 -2
  271. package/src/client/components/settings/categories/panel-plugins/SyncBlockedNotice.tsx +2 -2
  272. package/src/client/components/settings/categories/panel-plugins/Toolbar.tsx +1 -1
  273. package/src/client/components/settings/categories/plugin-settings/DetailPane.tsx +2 -2
  274. package/src/client/components/settings/categories/plugin-settings/MarketplacePane.tsx +4 -4
  275. package/src/client/components/settings/categories/plugin-settings/SettingsSection.tsx +1 -1
  276. package/src/client/components/settings/categories/plugin-settings/SidebarList.tsx +4 -4
  277. package/src/client/components/settings/categories/project-settings/AddProjectModal.tsx +1 -1
  278. package/src/client/components/settings/categories/project-settings/DeleteProjectModal.tsx +3 -3
  279. package/src/client/components/settings/categories/project-settings/DetailsHeader.tsx +1 -1
  280. package/src/client/components/settings/categories/project-settings/IconGrid.tsx +3 -3
  281. package/src/client/components/settings/categories/project-settings/SidebarList.tsx +1 -1
  282. package/src/client/components/settings/categories/project-settings/WorktreeSettings.tsx +2 -2
  283. package/src/client/components/settings/categories/provider-settings/AddModelModal.tsx +3 -3
  284. package/src/client/components/settings/categories/provider-settings/AddProviderModal.tsx +2 -2
  285. package/src/client/components/settings/categories/provider-settings/AuthSection.tsx +3 -3
  286. package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +3 -3
  287. package/src/client/components/settings/categories/provider-settings/EntryAdvanced.tsx +1 -1
  288. package/src/client/components/settings/categories/provider-settings/EntryModal.tsx +2 -2
  289. package/src/client/components/settings/categories/provider-settings/LoginModal.tsx +2 -2
  290. package/src/client/components/settings/categories/provider-settings/LogoutProviderModal.tsx +3 -3
  291. package/src/client/components/settings/categories/provider-settings/ModelCapabilitiesModal.tsx +1 -1
  292. package/src/client/components/settings/categories/provider-settings/PriceFields.tsx +1 -1
  293. package/src/client/components/settings/categories/skill-catalog/GitImportPanel.tsx +1 -1
  294. package/src/client/components/settings/categories/skill-catalog/SkillCard.tsx +1 -1
  295. package/src/client/components/settings/categories/skill-catalog/SourceRail.tsx +1 -1
  296. package/src/client/components/settings/categories/skill-settings/DetailHeader.tsx +7 -7
  297. package/src/client/components/settings/categories/skill-settings/DetailPane.tsx +1 -1
  298. package/src/client/components/settings/categories/skill-settings/SidebarList.tsx +2 -2
  299. package/src/client/components/settings/categories/usage-settings/ProviderCard.tsx +1 -1
  300. package/src/client/components/settings/categories/usage-settings/SavedResetsSection.tsx +2 -2
  301. package/src/client/components/settings/categories/usage-settings/SidebarList.tsx +1 -1
  302. package/src/client/components/settings/categories/usage-settings/TokenHarborCard.tsx +1 -1
  303. package/src/client/components/settings/categories/voice-settings/speech/EndpointSection.tsx +2 -2
  304. package/src/client/components/settings/categories/voice-settings/speech/EngineSection.tsx +5 -5
  305. package/src/client/components/settings/categories/voice-settings/speech/ModelsSection.tsx +4 -4
  306. package/src/client/components/workspace/browser-panel/ActivityToasts.tsx +2 -2
  307. package/src/client/components/workspace/browser-panel/EngineNotice.tsx +1 -1
  308. package/src/client/components/workspace/browser-panel/index.tsx +2 -2
  309. package/src/client/components/workspace/browser-toolbar/clusters.tsx +2 -2
  310. package/src/client/components/workspace/btw-panel/Messages.tsx +2 -2
  311. package/src/client/components/workspace/btw-panel/TopicMenu.tsx +1 -1
  312. package/src/client/components/workspace/chat-timeline/AiMessageFooterSheet.tsx +1 -1
  313. package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.tsx +7 -7
  314. package/src/client/components/workspace/chat-timeline/ChatOverlays.tsx +1 -0
  315. package/src/client/components/workspace/chat-timeline/ComposerDock.tsx +2 -2
  316. package/src/client/components/workspace/chat-timeline/IrcNotice.tsx +2 -2
  317. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +3 -3
  318. package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +5 -0
  319. package/src/client/components/workspace/chat-timeline/OrchestrationNotice.tsx +81 -162
  320. package/src/client/components/workspace/chat-timeline/QueueList.tsx +1 -1
  321. package/src/client/components/workspace/chat-timeline/SubagentControls.tsx +1 -1
  322. package/src/client/components/workspace/chat-timeline/SystemNotice.tsx +12 -8
  323. package/src/client/components/workspace/chat-timeline/TaskResultContent.tsx +1 -1
  324. package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +12 -4
  325. package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +1 -1
  326. package/src/client/components/workspace/chat-timeline/ToolCallingSection.tsx +1 -0
  327. package/src/client/components/workspace/chat-timeline/UndoConfirmModal.tsx +1 -1
  328. package/src/client/components/workspace/chat-timeline/UserTurn.test.tsx +24 -6
  329. package/src/client/components/workspace/chat-timeline/UserTurn.tsx +17 -4
  330. package/src/client/components/workspace/chat-timeline/block-chrome.test.tsx +18 -2
  331. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +66 -10
  332. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +103 -41
  333. package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +1 -1
  334. package/src/client/components/workspace/chat-timeline/chat-input/ComposerNotice.tsx +2 -2
  335. package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +4 -2
  336. package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.tsx +11 -11
  337. package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.tsx +3 -3
  338. package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.test.tsx +2 -2
  339. package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.tsx +54 -35
  340. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.test.tsx +110 -0
  341. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +51 -32
  342. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +62 -0
  343. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +17 -5
  344. package/src/client/components/workspace/chat-timeline/chat-input/VoiceNotice.tsx +1 -1
  345. package/src/client/components/workspace/chat-timeline/chat-input/access-capability.test.tsx +151 -0
  346. package/src/client/components/workspace/chat-timeline/chat-input/modes-props.ts +5 -0
  347. package/src/client/components/workspace/chat-timeline/chat-input/props.ts +3 -3
  348. package/src/client/components/workspace/chat-timeline/fork-preview.test.tsx +1 -1
  349. package/src/client/components/workspace/chat-timeline/plan-review/index.tsx +1 -1
  350. package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.test.tsx +21 -5
  351. package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.tsx +100 -71
  352. package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.test.tsx +9 -9
  353. package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +83 -66
  354. package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.test.tsx +3 -3
  355. package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +38 -17
  356. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk.tsx +1 -1
  357. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.tsx +1 -1
  358. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionCard.tsx +2 -2
  359. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/SwipeDeck.tsx +7 -7
  360. package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/ApprovalBody.tsx +1 -1
  361. package/src/client/components/workspace/chat-timeline/tool-renderers/hashline-patch/index.tsx +3 -3
  362. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AstEdit.tsx +5 -5
  363. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.tsx +9 -9
  364. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Debug.tsx +5 -5
  365. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Edit.tsx +5 -5
  366. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Eval.tsx +6 -6
  367. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/FileMatches.tsx +2 -2
  368. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Github.tsx +7 -7
  369. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Goal.tsx +5 -5
  370. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/GoalRecord.tsx +5 -5
  371. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Lsp.tsx +9 -9
  372. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ManageSkill.tsx +3 -3
  373. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.tsx +8 -8
  374. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Resolve.tsx +3 -3
  375. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/SecurityScan.tsx +6 -6
  376. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/TaskResult.tsx +2 -2
  377. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Todo.tsx +1 -1
  378. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +7 -7
  379. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip.tsx +8 -4
  380. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/DiffView.tsx +2 -2
  381. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/EnvelopeHeader.tsx +3 -3
  382. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolCardShell.tsx +4 -4
  383. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolFactChips.tsx +5 -5
  384. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions.tsx +11 -3
  385. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/status-glyph.tsx +3 -3
  386. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Card.tsx +2 -2
  387. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Compact.tsx +11 -6
  388. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Minimal.tsx +2 -2
  389. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Trace.tsx +2 -2
  390. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.test.tsx +37 -9
  391. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +35 -23
  392. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/parity.test.tsx +50 -2
  393. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/props.ts +2 -0
  394. package/src/client/components/workspace/context-panel/RawJsonViewer.tsx +2 -2
  395. package/src/client/components/workspace/diff-panel/ConflictBanner.tsx +3 -3
  396. package/src/client/components/workspace/diff-panel/Toolbar.tsx +3 -3
  397. package/src/client/components/workspace/diff-panel/index.tsx +3 -3
  398. package/src/client/components/workspace/diff-panel/toolbar-git-actions.tsx +1 -1
  399. package/src/client/components/workspace/editor/ConflictStrip.tsx +2 -2
  400. package/src/client/components/workspace/editor/ExternalChangeStrip.tsx +2 -2
  401. package/src/client/components/workspace/editor/FilePane.tsx +6 -6
  402. package/src/client/components/workspace/editor/FindWidget.tsx +2 -2
  403. package/src/client/components/workspace/editor/GoToLineModal.tsx +1 -1
  404. package/src/client/components/workspace/editor/SaveAsModal.tsx +3 -3
  405. package/src/client/components/workspace/editor/SaveDeletedFileModal.tsx +2 -2
  406. package/src/client/components/workspace/editor/StatusBar.tsx +1 -1
  407. package/src/client/components/workspace/editor/Tabs.test.ts +3 -3
  408. package/src/client/components/workspace/editor/Tabs.tsx +6 -6
  409. package/src/client/components/workspace/editor/Toolbar.tsx +4 -4
  410. package/src/client/components/workspace/editor/toolbar-clusters.tsx +1 -1
  411. package/src/client/components/workspace/editor/viewers/DataGrid.tsx +1 -1
  412. package/src/client/components/workspace/editor/viewers/GridToolbar.tsx +2 -2
  413. package/src/client/components/workspace/editor/viewers/SheetView.tsx +2 -2
  414. package/src/client/components/workspace/editor/viewers/ViewerError.tsx +2 -2
  415. package/src/client/components/workspace/file-explorer/ArchiveModals.tsx +1 -1
  416. package/src/client/components/workspace/file-explorer/ContextMenu.tsx +3 -3
  417. package/src/client/components/workspace/file-explorer/Modals.tsx +3 -3
  418. package/src/client/components/workspace/file-explorer/RowLabel.test.tsx +2 -2
  419. package/src/client/components/workspace/git-panel/BranchToolbar.tsx +2 -2
  420. package/src/client/components/workspace/git-panel/ChangesList.tsx +3 -3
  421. package/src/client/components/workspace/git-panel/ConflictItem.tsx +3 -3
  422. package/src/client/components/workspace/git-panel/FileItem.tsx +1 -1
  423. package/src/client/components/workspace/git-panel/Modals.tsx +1 -1
  424. package/src/client/components/workspace/git-panel/OperationBar.tsx +4 -4
  425. package/src/client/components/workspace/git-panel/StashSection.tsx +1 -1
  426. package/src/client/components/workspace/git-panel/TreeItem.tsx +2 -2
  427. package/src/client/components/workspace/git-panel/branch-modal/BranchRow.tsx +2 -2
  428. package/src/client/components/workspace/git-panel/branch-modal/DeleteDialog.tsx +2 -2
  429. package/src/client/components/workspace/git-panel/branch-modal/index.tsx +2 -2
  430. package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +31 -76
  431. package/src/client/components/workspace/model-dropdown/Item.tsx +2 -2
  432. package/src/client/components/workspace/model-dropdown/Panel.tsx +15 -9
  433. package/src/client/components/workspace/model-dropdown/Section.tsx +1 -1
  434. package/src/client/components/workspace/model-dropdown/harness-tabs.test.tsx +12 -83
  435. package/src/client/components/workspace/model-dropdown/index.tsx +2 -2
  436. package/src/client/components/workspace/model-dropdown/picker-close.test.tsx +16 -2
  437. package/src/client/components/workspace/plan-panel/PageView.tsx +2 -2
  438. package/src/client/components/workspace/plan-panel/index.tsx +2 -2
  439. package/src/client/components/workspace/plugin-panel/Error.tsx +1 -1
  440. package/src/client/components/workspace/repo-picker/Modal.tsx +3 -3
  441. package/src/client/components/workspace/repo-picker/Row.tsx +5 -5
  442. package/src/client/components/workspace/search-panel/Body.tsx +2 -2
  443. package/src/client/components/workspace/terminal-panel/Header.tsx +3 -3
  444. package/src/client/components/workspace/terminal-panel/KeyBar.tsx +2 -2
  445. package/src/client/components/workspace/terminal-panel/QuickActions.tsx +1 -1
  446. package/src/client/components/workspace/terminal-panel/RealtimeTerminalView.tsx +1 -1
  447. package/src/client/components/workspace/terminal-panel/index.tsx +1 -1
  448. package/src/client/components/workspace/usage-panel/index.tsx +3 -3
  449. package/src/client/components/workspace/user-browser-panel/AddressBar.tsx +1 -1
  450. package/src/client/components/workspace/wiki-panel/PageView.tsx +2 -2
  451. package/src/client/components/workspace/wiki-panel/index.tsx +2 -2
  452. package/src/client/components/workspace/worktree-modal/index.tsx +1 -1
  453. package/src/client/data/settings/omp-schema.json +27 -7
  454. package/src/client/hooks/chat/timeline/access-ladder-wiring.test.ts +111 -0
  455. package/src/client/hooks/chat/timeline/access-ladder.test.ts +66 -0
  456. package/src/client/hooks/chat/timeline/access-ladder.ts +72 -0
  457. package/src/client/hooks/chat/timeline/access-mode.ts +11 -1
  458. package/src/client/hooks/chat/timeline/index.ts +4 -5
  459. package/src/client/hooks/chat/timeline/modes-contract.ts +10 -1
  460. package/src/client/hooks/chat/timeline/modes.ts +10 -2
  461. package/src/client/hooks/chat/timeline/session-harness.ts +2 -1
  462. package/src/client/hooks/editor/use-unload-guard.tsx +2 -2
  463. package/src/client/hooks/models/use-harness-accounts-panel.ts +142 -0
  464. package/src/client/hooks/ui/border-style.test.ts +1 -2
  465. package/src/client/hooks/ui/theme.ts +23 -2
  466. package/src/client/main.tsx +7 -1
  467. package/src/client/tailwind-contrast.test.ts +22 -7
  468. package/src/client/tailwind.css +115 -18
  469. package/src/server/lib/assets/theme-css.server.test.ts +31 -1
  470. package/src/server/lib/assets/theme-css.server.ts +15 -1
  471. package/src/server/lib/harness/accounts.test.ts +5 -3
  472. package/src/server/lib/harness/acp/acp-todos.test.ts +23 -0
  473. package/src/server/lib/omp/session/delete.server.ts +4 -0
  474. package/src/server/lib/realtime/topics/session-data.server.ts +64 -1
  475. package/src/server/lib/realtime/topics/session-data.test.ts +189 -0
  476. package/src/server/lib/tray/runtime.server.ts +5 -0
  477. package/src/server/plugins/ssr.ts +16 -4
  478. package/src/server/routes/settings/root.ts +11 -0
  479. package/src/server/routes/settings/settings-store-routes.test.ts +37 -0
  480. package/src/shared/lib/chat/orchestration/outcome-markdown.test.ts +57 -0
  481. package/src/shared/lib/chat/orchestration/outcome-markdown.ts +74 -0
  482. package/src/shared/lib/chat/timeline/block-chrome.ts +2 -2
  483. package/src/shared/lib/chat/todo/flat-list.test.ts +81 -0
  484. package/src/shared/lib/chat/todo/flat-list.ts +29 -0
  485. package/src/shared/lib/chat/todo/parser.ts +7 -53
  486. package/src/shared/lib/chat/todo/progress.test.ts +3 -3
  487. package/src/shared/lib/chat/todo/progress.ts +3 -3
  488. package/src/shared/lib/fs/git-status.test.ts +22 -22
  489. package/src/shared/lib/fs/git-status.ts +31 -31
  490. package/src/shared/lib/icons/icon-paint-authority.ts +5 -4
  491. package/src/shared/lib/omp/config/schema-releases-19-4.test.ts +20 -3
  492. package/src/shared/lib/settings/defaults.ts +1 -0
  493. package/src/shared/lib/theme/catalog.test.ts +42 -0
  494. package/src/shared/lib/theme/catalog.ts +66 -11
  495. package/src/shared/lib/theme/css.ts +25 -1
  496. package/src/shared/lib/theme/custom.test.ts +156 -0
  497. package/src/shared/lib/theme/custom.ts +260 -0
  498. package/src/shared/lib/theme/ink-scale.test.ts +83 -2
  499. package/src/shared/lib/theme/ink-scale.ts +74 -9
  500. package/src/shared/lib/theme/shell-palette.ts +3 -3
  501. package/src/shared/lib/theme/theme.test.ts +28 -13
  502. package/src/shared/types/settings/state.ts +11 -3
  503. package/tsconfig.json +6 -0
  504. package/dist/client/static/js/Body-p6zwk0nx.js +0 -3
  505. package/dist/client/static/js/ImageView-fkfq3fwv.js +0 -1
  506. package/dist/client/static/js/LayoutWrapper-mdb1qm26.js +0 -2
  507. package/dist/client/static/js/MergeDiffView-7kpjxcg9.js +0 -1
  508. package/dist/client/static/js/Modal-0p9cr2tn.js +0 -60
  509. package/dist/client/static/js/SessionsView-gptt0rq8.js +0 -1
  510. package/dist/client/static/js/architecture-7GRP2DOG-3hkq8grc.js +0 -1
  511. package/dist/client/static/js/bash-n7wcmq3s.js +0 -1
  512. package/dist/client/static/js/c-20y64hcp.js +0 -1
  513. package/dist/client/static/js/cpp-ty6n0dg9.js +0 -1
  514. package/dist/client/static/js/css-9gak6bze.js +0 -1
  515. package/dist/client/static/js/css-ncvxaxt0.js +0 -1
  516. package/dist/client/static/js/cynefin-OW5HDTMX-9m18e6m5.js +0 -1
  517. package/dist/client/static/js/eventmodeling-NTZA5JFV-d4egnv9v.js +0 -1
  518. package/dist/client/static/js/flowDiagram-KWPJA3E3-5bvd5k2t.js +0 -1
  519. package/dist/client/static/js/gitGraph-4MIJSDKK-grqv890n.js +0 -1
  520. package/dist/client/static/js/graphql-6rwdfcnf.js +0 -1
  521. package/dist/client/static/js/html-p76eszt9.js +0 -1
  522. package/dist/client/static/js/index-28wv94gz.js +0 -2
  523. package/dist/client/static/js/index-3wgjtp2k.js +0 -9
  524. package/dist/client/static/js/index-7trfm17d.js +0 -2
  525. package/dist/client/static/js/index-ays8t3t3.js +0 -4
  526. package/dist/client/static/js/index-cxe75e06.js +0 -2
  527. package/dist/client/static/js/index-dmb1pykr.js +0 -1
  528. package/dist/client/static/js/index-fqc1snjw.js +0 -1
  529. package/dist/client/static/js/index-jsn2kedv.js +0 -1
  530. package/dist/client/static/js/index-n1xmkf2g.js +0 -2
  531. package/dist/client/static/js/index-pe4d9wht.js +0 -1
  532. package/dist/client/static/js/index-pjf5wak8.js +0 -2
  533. package/dist/client/static/js/index-sm8gpk3g.js +0 -4
  534. package/dist/client/static/js/index-st6a8q5z.js +0 -470
  535. package/dist/client/static/js/index-stmwbavz.js +0 -1
  536. package/dist/client/static/js/index-swaveqxg.css +0 -1
  537. package/dist/client/static/js/index-t82q5t6m.js +0 -1
  538. package/dist/client/static/js/index-t9zjfxvc.js +0 -1
  539. package/dist/client/static/js/index-tdbcp70z.js +0 -2
  540. package/dist/client/static/js/index-v38j2zxn.js +0 -2
  541. package/dist/client/static/js/index-x17y7xdr.js +0 -2
  542. package/dist/client/static/js/index-xrb4kjr3.js +0 -1
  543. package/dist/client/static/js/info-A6RAGUB7-rzpg7qk1.js +0 -1
  544. package/dist/client/static/js/ini-kjcpgebh.js +0 -1
  545. package/dist/client/static/js/java-0bcyv1jt.js +0 -1
  546. package/dist/client/static/js/javascript-0mqgcvps.js +0 -1
  547. package/dist/client/static/js/json-xha2drny.js +0 -1
  548. package/dist/client/static/js/jsx-8p6dqgpq.js +0 -1
  549. package/dist/client/static/js/lua-njwwdj4s.js +0 -1
  550. package/dist/client/static/js/markdown-8gbyxxjd.js +0 -1
  551. package/dist/client/static/js/one-dark-pro-sstqnzcf.js +0 -1
  552. package/dist/client/static/js/one-light-6fpxxq2j.js +0 -1
  553. package/dist/client/static/js/packet-AYTQ26CC-eac14hsq.js +0 -1
  554. package/dist/client/static/js/pie-WAS4IAKB-a9xqvysf.js +0 -1
  555. package/dist/client/static/js/properties-d5bwhgwz.js +0 -1
  556. package/dist/client/static/js/python-fdwwjjhh.js +0 -1
  557. package/dist/client/static/js/r-4d2ygtfj.js +0 -1
  558. package/dist/client/static/js/radar-RG4KPBEZ-jv2pm0fe.js +0 -1
  559. package/dist/client/static/js/railroad-74A4TZTK-j74sc0b6.js +0 -1
  560. package/dist/client/static/js/railroad-abnf-HS5TGJTU-eaf19baz.js +0 -1
  561. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-d4j5nq31.js +0 -1
  562. package/dist/client/static/js/railroad-peg-WCYAUIDC-ba862a9p.js +0 -1
  563. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-cx3f29mq.js +0 -8
  564. package/dist/client/static/js/treeView-Q6P3EWNA-e8yb44pd.js +0 -1
  565. package/dist/client/static/js/treemap-WGGIJYW6-zvdv84vp.js +0 -1
  566. package/dist/client/static/js/tsx-dk8rpgtw.js +0 -1
  567. package/dist/client/static/js/typescript-5txwpd9t.js +0 -1
  568. package/dist/client/static/js/wardley-WFR3VGLG-hbv0cg4s.js +0 -1
  569. package/dist/client/static/js/xml-8516fzfp.js +0 -1
  570. package/dist/client/static/js/yaml-6k1tmwtm.js +0 -1
@@ -1,4 +1,4 @@
1
- import{t,l,m,W,xa,sh,na,So,Ca,ul,To}from"./index-xfnjwhan.js";import{Wt,Rn,mr,ln,Kr,yo,Ce,Tt,_r,vo,Sr,Xl,Tp,Dp,Np,zi,ha,Qp,Ui,Ln,Gi,Ja,ba,ji,ko,Hi,Rp,Lp,ec,Kt,Fp,qi,xo,Wi,tc,nc,wo,Mp,rc,Pp,sd,Vr,ac,Op,$p,zp,tr,oc,ic,Ki,Up,sc,v,fr,Yr,Vt,Co,Je}from"./index-hge0y4vn.js";import{Bp,Ip,ve,al,VA,_p,oi}from"./index-ep99arz1.js";import{Sn}from"./index-8pqx5n2p.js";var ur={};Sn(ur,{default:()=>Z});var Nn=/\s/;function Pn(r){var e=r.length;while(e--&&Nn.test(r.charAt(e)));return e}var Jr=Pn;var kn=/^\s+/;function Tn(r){return r?r.slice(0,Jr(r)+1).replace(kn,""):r}var Zr=Tn;var $r=NaN,Cn=/^[-+]0x[0-9a-f]+$/i,An=/^0b[01]+$/i,Mn=/^0o[0-7]+$/i,jn=parseInt;function Bn(r){if(typeof r=="number")return r;if(Kr(r))return $r;if(Tt(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Tt(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=Zr(r);var n=An.test(r);return n||Mn.test(r)?jn(r.slice(2),n?2:8):Cn.test(r)?$r:+r}var Qr=Bn;var re=1/0,Dn=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function Fn(r){if(!r)return r===0?r:0;if(r=Qr(r),r===re||r===-re){var e=r<0?-1:1;return e*Dn}return r===r?r:0}var U=Fn;function Gn(r){var e=U(r),n=e%1;return e===e?n?e-n:e:0}var ee=Gn;var te=Object.create,Xn=function(){function r(){}return function(e){if(!Tt(e))return{};if(te)return te(e);r.prototype=e;var n=new r;return r.prototype=void 0,n}}(),ne=Xn;function Un(r,e){var n=-1,o=r.length;e||(e=Array(o));while(++n<o)e[n]=r[n];return e}var ar=Un;function Vn(r,e,n){if(e=="__proto__"&&Xl)Xl(r,e,{configurable:!0,enumerable:!0,value:n,writable:!0});else r[e]=n}var R=Vn;var Yn=Object.prototype,zn=Yn.hasOwnProperty;function Wn(r,e,n){var o=r[e];if(!(zn.call(r,e)&&ha(o,n))||n===void 0&&!(e in r))R(r,e,n)}var M=Wn;function qn(r,e,n,o){var i=!n;n||(n={});var a=-1,f=e.length;while(++a<f){var s=e[a],u=o?o(n[s],r[s],s,n,r):void 0;if(u===void 0)u=r[s];if(i)R(n,s,u);else M(n,s,u)}return n}var P=qn;function Hn(r,e,n){if(!Tt(n))return!1;var o=typeof e;if(o=="number"?Ln(n)&&zi(e,n.length):o=="string"&&(e in n))return ha(n[e],r);return!1}var T=Hn;function Kn(r){return Ui(function(e,n){var o=-1,i=n.length,a=i>1?n[i-1]:void 0,f=i>2?n[2]:void 0;if(a=r.length>3&&typeof a=="function"?(i--,a):void 0,f&&T(n[0],n[1],f))a=i<3?void 0:a,i=1;e=Object(e);while(++o<i){var s=n[o];if(s)r(e,s,o,a)}return e})}var oe=Kn;function Jn(r){var e=[];if(r!=null)for(var n in Object(r))e.push(n);return e}var ie=Jn;var Zn=Object.prototype,$n=Zn.hasOwnProperty;function Qn(r){if(!Tt(r))return ie(r);var e=Gi(r),n=[];for(var o in r)if(!(o=="constructor"&&(e||!$n.call(r,o))))n.push(o);return n}var ae=Qn;function ro(r){return Ln(r)?Rp(r,!0):ae(r)}var L=ro;function eo(r){var e=r==null?0:r.length;return e?nc(r,1):[]}var S=eo;function to(r){return Tp(Qp(r,void 0,S),r+"")}var fe=to;var no=Lp(Object.getPrototypeOf,Object),V=no;var oo="[object Object]",io=Function.prototype,ao=Object.prototype,se=io.toString,fo=ao.hasOwnProperty,so=se.call(Object);function uo(r){if(!ln(r)||mr(r)!=oo)return!1;var e=V(r);if(e===null)return!0;var n=fo.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&se.call(n)==so}var ue=uo;var co="\\ud800-\\udfff",po="\\u0300-\\u036f",lo="\\ufe20-\\ufe2f",mo="\\u20d0-\\u20ff",ho=po+lo+mo,go="\\ufe0e\\ufe0f",bo="\\u200d",_o=RegExp("["+bo+co+ho+go+"]");function Eo(r){return _o.test(r)}var de=Eo;function Oo(r,e){return r&&P(e,Kt(e),r)}var ce=Oo;function Lo(r,e){return r&&P(e,L(e),r)}var pe=Lo;var ge=typeof ur=="object"&&ur&&!ur.nodeType&&ur,le=ge&&typeof sr=="object"&&sr&&!sr.nodeType&&sr,Io=le&&le.exports===ge,me=Io?Wt.Buffer:void 0,he=me?me.allocUnsafe:void 0;function No(r,e){if(e)return r.slice();var n=r.length,o=he?he(n):new r.constructor(n);return r.copy(o),o}var Z=No;function Po(r,e){return P(r,rc(r),e)}var be=Po;var Ao=Object.getOwnPropertySymbols,Ro=!Ao?Mp:function(r){var e=[];while(r)tc(e,rc(r)),r=V(r);return e},dr=Ro;function Mo(r,e){return P(r,dr(r),e)}var ye=Mo;function jo(r){return Pp(r,L,dr)}var we=jo;var Bo=Object.prototype,Do=Bo.hasOwnProperty;function Fo(r){var e=r.length,n=new r.constructor(e);if(e&&typeof r[0]=="string"&&Do.call(r,"index"))n.index=r.index,n.input=r.input;return n}var _e=Fo;function Go(r){var e=new r.constructor(r.byteLength);return new ac(e).set(new ac(r)),e}var Y=Go;function Xo(r,e){var n=e?Y(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.byteLength)}var Ee=Xo;var Uo=/\w*$/;function Vo(r){var e=new r.constructor(r.source,Uo.exec(r));return e.lastIndex=r.lastIndex,e}var xe=Vo;var Oe=Rn?Rn.prototype:void 0,Le=Oe?Oe.valueOf:void 0;function Yo(r){return Le?Object(Le.call(r)):{}}var Ie=Yo;function zo(r,e){var n=e?Y(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.length)}var cr=zo;var Wo="[object Boolean]",qo="[object Date]",Ho="[object Map]",Ko="[object Number]",Jo="[object RegExp]",Zo="[object Set]",$o="[object String]",Qo="[object Symbol]",ri="[object ArrayBuffer]",ei="[object DataView]",ti="[object Float32Array]",ni="[object Float64Array]",ii="[object Int8Array]",ai="[object Int16Array]",fi="[object Int32Array]",si="[object Uint8Array]",ui="[object Uint8ClampedArray]",di="[object Uint16Array]",ci="[object Uint32Array]";function pi(r,e,n){var o=r.constructor;switch(e){case ri:return Y(r);case Wo:case qo:return new o(+r);case ei:return Ee(r,n);case ti:case ni:case ii:case ai:case fi:case si:case ui:case di:case ci:return cr(r,n);case Ho:return new o;case Ko:case $o:return new o(r);case Jo:return xe(r);case Zo:return new o;case Qo:return Ie(r)}}var Se=pi;function li(r){return typeof r.constructor=="function"&&!Gi(r)?ne(V(r)):{}}var pr=li;var mi="[object Map]";function hi(r){return ln(r)&&Vr(r)==mi}var Ne=hi;var Pe=ko&&ko.isMap,gi=Pe?ji(Pe):Ne,ke=gi;var vi="[object Set]";function bi(r){return ln(r)&&Vr(r)==vi}var Te=bi;var Ae=ko&&ko.isSet,yi=Ae?ji(Ae):Te,Re=yi;var wi=1,_i=2,Ei=4,Me="[object Arguments]",xi="[object Array]",Oi="[object Boolean]",Li="[object Date]",Ii="[object Error]",je="[object Function]",Si="[object GeneratorFunction]",Ni="[object Map]",Pi="[object Number]",Be="[object Object]",ki="[object RegExp]",Ti="[object Set]",Ci="[object String]",Ai="[object Symbol]",Ri="[object WeakMap]",Mi="[object ArrayBuffer]",Bi="[object DataView]",Di="[object Float32Array]",Fi="[object Float64Array]",Xi="[object Int8Array]",Vi="[object Int16Array]",Yi="[object Int32Array]",Ji="[object Uint8Array]",Zi="[object Uint8ClampedArray]",$i="[object Uint16Array]",Qi="[object Uint32Array]",x={};x[Me]=x[xi]=x[Mi]=x[Bi]=x[Oi]=x[Li]=x[Di]=x[Fi]=x[Xi]=x[Vi]=x[Yi]=x[Ni]=x[Pi]=x[Be]=x[ki]=x[Ti]=x[Ci]=x[Ai]=x[Ji]=x[Zi]=x[$i]=x[Qi]=!0;x[Ii]=x[je]=x[Ri]=!1;function lr(r,e,n,o,i,a){var f,s=e&wi,u=e&_i,d=e&Ei;if(n)f=i?n(r,o,i,a):n(r);if(f!==void 0)return f;if(!Tt(r))return r;var c=Ce(r);if(c){if(f=_e(r),!s)return ar(r,f)}else{var p=Vr(r),h=p==je||p==Si;if(ba(r))return Z(r,s);if(p==Be||p==Me||h&&!i){if(f=u||h?{}:pr(r),!s)return u?ye(r,pe(f,r)):be(r,ce(f,r))}else{if(!x[p])return i?r:{};f=Se(r,p,s)}}a||(a=new wo);var b=a.get(r);if(b)return b;if(a.set(r,f),Re(r))r.forEach(function(g){f.add(lr(g,e,n,g,r,a))});else if(ke(r))r.forEach(function(g,_){f.set(_,lr(g,e,n,_,r,a))});var w=d?u?we:sd:u?L:Kt,y=c?void 0:w(r);return Dp(y||r,function(g,_){if(y)_=g,g=r[_];M(f,_,lr(g,e,n,_,r,a))}),f}var De=lr;var ra=1,ea=4;function ta(r){return De(r,ra|ea)}var Fe=ta;var oa=function(){return Wt.Date.now()},Er=oa;var Ge=Object.prototype,ia=Ge.hasOwnProperty,aa=Ui(function(r,e){r=Object(r);var n=-1,o=e.length,i=o>2?e[2]:void 0;if(i&&T(e[0],e[1],i))o=1;while(++n<o){var a=e[n],f=L(a),s=-1,u=f.length;while(++s<u){var d=f[s],c=r[d];if(c===void 0||ha(c,Ge[d])&&!ia.call(r,d))r[d]=a[d]}}return r}),Xe=aa;function fa(r,e,n){if(n!==void 0&&!ha(r[e],n)||n===void 0&&!(e in r))R(r,e,n)}var Q=fa;function sa(r,e){if(e==="constructor"&&typeof r[e]==="function")return;if(e=="__proto__")return;return r[e]}var rr=sa;function ua(r){return P(r,L(r))}var Ue=ua;function da(r,e,n,o,i,a,f){var s=rr(r,n),u=rr(e,n),d=f.get(u);if(d){Q(r,n,d);return}var c=a?a(s,u,n+"",r,e,f):void 0,p=c===void 0;if(p){var h=Ce(u),b=!h&&ba(u),w=!h&&!b&&Hi(u);if(c=u,h||b||w)if(Ce(s))c=s;else if(Up(s))c=ar(s);else if(b)p=!1,c=Z(u,!0);else if(w)p=!1,c=cr(u,!0);else c=[];else if(ue(u)||Ja(u)){if(c=s,Ja(s))c=Ue(s);else if(!Tt(s)||vo(s))c=pr(u)}else p=!1}if(p)f.set(u,c),i(c,u,o,a,f),f.delete(u);Q(r,n,c)}var Ve=da;function Ye(r,e,n,o,i){if(r===e)return;oc(e,function(a,f){if(i||(i=new wo),Tt(a))Ve(r,e,f,n,Ye,o,i);else{var s=o?o(rr(r,f),a,f+"",r,e,i):void 0;if(s===void 0)s=a;Q(r,f,s)}},L)}var ze=Ye;function ca(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var G=ca;function pa(r){return function(e,n,o){var i=Object(e);if(!Ln(e)){var a=tr(n,3);e=Kt(e),n=function(s){return a(i[s],s,i)}}var f=r(e,n,o);return f>-1?i[a?e[f]:f]:void 0}}var We=pa;var la=Math.max;function ma(r,e,n){var o=r==null?0:r.length;if(!o)return-1;var i=n==null?0:ee(n);if(i<0)i=la(o+i,0);return Np(r,tr(e,3),i)}var qe=ma;var ga=We(qe),er=ga;function va(r,e){var n=-1,o=Ln(r)?Array(r.length):[];return Ki(r,function(i,a,f){o[++n]=e(i,a,f)}),o}var hr=va;function ya(r,e){var n=Ce(r)?yo:hr;return n(r,tr(e,3))}var E=ya;function wa(r,e){return r==null?r:oc(r,sc(e),L)}var He=wa;function _a(r,e){return r&&ic(r,sc(e))}var Ke=_a;function Ea(r,e){return r>e}var Ze=Ea;var Oa=Object.prototype,La=Oa.hasOwnProperty;function Ia(r,e){return r!=null&&La.call(r,e)}var $e=Ia;function Sa(r,e){return r!=null&&Op(r,e,$e)}var gr=Sa;var Na="[object String]";function Pa(r){return typeof r=="string"||!Ce(r)&&ln(r)&&mr(r)==Na}var Qe=Pa;function ka(r,e){return r<e}var vr=ka;function Ta(r,e){var n={};return e=tr(e,3),ic(r,function(o,i,a){R(n,i,e(o,i,a))}),n}var z=Ta;function Aa(r,e,n){var o=-1,i=r.length;while(++o<i){var a=r[o],f=e(a);if(f!=null&&(s===void 0?f===f&&!Kr(f):n(f,s)))var s=f,u=a}return u}var q=Aa;function Ra(r){return r&&r.length?q(r,_r,Ze):void 0}var I=Ra;var Ma=oe(function(r,e,n){ze(r,e,n)}),nr=Ma;function ja(r){return r&&r.length?q(r,_r,vr):void 0}var j=ja;function Ba(r,e){return r&&r.length?q(r,tr(e,2),vr):void 0}var H=Ba;function Da(r,e,n,o){if(!Tt(r))return r;e=qi(e,r);var i=-1,a=e.length,f=a-1,s=r;while(s!=null&&++i<a){var u=xo(e[i]),d=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return r;if(i!=f){var c=s[u];if(d=o?o(c,u,s):void 0,d===void 0)d=Tt(c)?c:zi(e[i+1])?[]:{}}M(s,u,d),s=s[u]}return r}var rt=Da;function Fa(r,e,n){var o=-1,i=e.length,a={};while(++o<i){var f=e[o],s=Wi(r,f);if(n(s,f))rt(a,qi(f,r),s)}return a}var et=Fa;function Ga(r,e){var n=r.length;r.sort(e);while(n--)r[n]=r[n].value;return r}var tt=Ga;function Xa(r,e){if(r!==e){var n=r!==void 0,o=r===null,i=r===r,a=Kr(r),f=e!==void 0,s=e===null,u=e===e,d=Kr(e);if(!s&&!d&&!a&&r>e||a&&f&&u&&!s&&!d||o&&f&&u||!n&&u||!i)return 1;if(!o&&!a&&!d&&r<e||d&&n&&i&&!o&&!a||s&&n&&i||!f&&i||!u)return-1}return 0}var nt=Xa;function Ua(r,e,n){var o=-1,i=r.criteria,a=e.criteria,f=i.length,s=n.length;while(++o<f){var u=nt(i[o],a[o]);if(u){if(o>=s)return u;var d=n[o];return u*(d=="desc"?-1:1)}}return r.index-e.index}var ot=Ua;function Va(r,e,n){if(e.length)e=yo(e,function(a){if(Ce(a))return function(f){return Wi(f,a.length===1?a[0]:a)};return a});else e=[_r];var o=-1;e=yo(e,ji(tr));var i=hr(r,function(a,f,s){var u=yo(e,function(d){return d(a)});return{criteria:u,index:++o,value:a}});return tt(i,function(a,f){return ot(a,f,n)})}var it=Va;var Ya=zp("length"),at=Ya;var st="\\ud800-\\udfff",za="\\u0300-\\u036f",Wa="\\ufe20-\\ufe2f",qa="\\u20d0-\\u20ff",Ha=za+Wa+qa,Ka="\\ufe0e\\ufe0f",Za="["+st+"]",xr="["+Ha+"]",Or="\\ud83c[\\udffb-\\udfff]",$a="(?:"+xr+"|"+Or+")",ut="[^"+st+"]",dt="(?:\\ud83c[\\udde6-\\uddff]){2}",ct="[\\ud800-\\udbff][\\udc00-\\udfff]",Qa="\\u200d",pt=$a+"?",lt="["+Ka+"]?",rf="(?:"+Qa+"(?:"+[ut,dt,ct].join("|")+")"+lt+pt+")*",ef=lt+pt+rf,tf="(?:"+[ut+xr+"?",xr,dt,ct,Za].join("|")+")",ft=RegExp(Or+"(?="+Or+")|"+tf+ef,"g");function nf(r){var e=ft.lastIndex=0;while(ft.test(r))++e;return e}var mt=nf;function of(r){return de(r)?mt(r):at(r)}var ht=of;function af(r,e){return et(r,e,function(n,o){return $p(r,o)})}var gt=af;var ff=fe(function(r,e){return r==null?{}:gt(r,e)}),K=ff;var{ceil:sf,max:uf}=Math;function df(r,e,n,o){var i=-1,a=uf(sf((e-r)/(n||1)),0),f=Array(a);while(a--)f[o?a:++i]=r,r+=n;return f}var vt=df;function cf(r){return function(e,n,o){if(o&&typeof o!="number"&&T(e,n,o))n=o=void 0;if(e=U(e),n===void 0)n=e,e=0;else n=U(n);return o=o===void 0?e<n?1:-1:U(o),vt(e,n,o,r)}}var bt=cf;var pf=bt(),N=pf;var lf="[object Map]",mf="[object Set]";function hf(r){if(r==null)return 0;if(Ln(r))return Qe(r)?ht(r):r.length;var e=Vr(r);if(e==lf||e==mf)return r.size;return ec(r).length}var yt=hf;var gf=Ui(function(r,e){if(r==null)return[];var n=e.length;if(n>1&&T(r,e[0],e[1]))e=[];else if(n>2&&T(e[0],e[1],e[2]))e=[e[0]];return it(r,nc(e,1),[])}),C=gf;var vf=0;function bf(r){var e=++vf;return Fp(r)+e}var J=bf;function yf(r,e,n){var o=-1,i=r.length,a=e.length,f={};while(++o<i){var s=o<a?e[o]:void 0;n(f,r[o],s)}return f}var wt=yf;function wf(r,e){return wt(r||[],e||[],M)}var Lr=wf;class Ir{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,e=r._prev;if(e!==r)return _t(e),e}enqueue(r){var e=this._sentinel;if(r._prev&&r._next)_t(r);r._next=e._next,e._next._prev=r,e._next=r,r._prev=e}toString(){var r=[],e=this._sentinel,n=e._prev;while(n!==e)r.push(JSON.stringify(n,_f)),n=n._prev;return"["+r.join(", ")+"]"}}function _t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function _f(r,e){if(r!=="_next"&&r!=="_prev")return e}var Ef=Sr(1);function Et(r,e){if(r.nodeCount()<=1)return[];var n=Of(r,e||Ef),o=xf(n.graph,n.buckets,n.zeroIdx);return S(E(o,function(i){return r.outEdges(i.v,i.w)}))}function xf(r,e,n){var o=[],i=e[e.length-1],a=e[0],f;while(r.nodeCount()){while(f=a.dequeue())Nr(r,e,n,f);while(f=i.dequeue())Nr(r,e,n,f);if(r.nodeCount()){for(var s=e.length-2;s>0;--s)if(f=e[s].dequeue(),f){o=o.concat(Nr(r,e,n,f,!0));break}}}return o}function Nr(r,e,n,o,i){var a=i?[]:void 0;return v(r.inEdges(o.v),function(f){var s=r.edge(f),u=r.node(f.v);if(i)a.push({v:f.v,w:f.w});u.out-=s,Pr(e,n,u)}),v(r.outEdges(o.v),function(f){var s=r.edge(f),u=f.w,d=r.node(u);d.in-=s,Pr(e,n,d)}),r.removeNode(o.v),a}function Of(r,e){var n=new Je,o=0,i=0;v(r.nodes(),function(s){n.setNode(s,{v:s,in:0,out:0})}),v(r.edges(),function(s){var u=n.edge(s.v,s.w)||0,d=e(s),c=u+d;n.setEdge(s.v,s.w,c),i=Math.max(i,n.node(s.v).out+=d),o=Math.max(o,n.node(s.w).in+=d)});var a=N(i+o+3).map(function(){return new Ir}),f=o+1;return v(n.nodes(),function(s){Pr(a,f,n.node(s))}),{graph:n,buckets:a,zeroIdx:f}}function Pr(r,e,n){if(!n.out)r[0].enqueue(n);else if(!n.in)r[r.length-1].enqueue(n);else r[n.out-n.in+e].enqueue(n)}function xt(r){var e=r.graph().acyclicer==="greedy"?Et(r,n(r)):Lf(r);v(e,function(o){var i=r.edge(o);r.removeEdge(o),i.forwardName=o.name,i.reversed=!0,r.setEdge(o.w,o.v,i,J("rev"))});function n(o){return function(i){return o.edge(i).weight}}}function Lf(r){var e=[],n={},o={};function i(a){if(Object.prototype.hasOwnProperty.call(o,a))return;o[a]=!0,n[a]=!0,v(r.outEdges(a),function(f){if(Object.prototype.hasOwnProperty.call(n,f.w))e.push(f);else i(f.w)}),delete n[a]}return v(r.nodes(),i),e}function Ot(r){v(r.edges(),function(e){var n=r.edge(e);if(n.reversed){r.removeEdge(e);var o=n.forwardName;delete n.reversed,delete n.forwardName,r.setEdge(e.w,e.v,n,o)}})}function k(r,e,n,o){var i;do i=J(o);while(r.hasNode(i));return n.dummy=e,r.setNode(i,n),i}function It(r){var e=new Je().setGraph(r.graph());return v(r.nodes(),function(n){e.setNode(n,r.node(n))}),v(r.edges(),function(n){var o=e.edge(n.v,n.w)||{weight:0,minlen:1},i=r.edge(n);e.setEdge(n.v,n.w,{weight:o.weight+i.weight,minlen:Math.max(o.minlen,i.minlen)})}),e}function br(r){var e=new Je({multigraph:r.isMultigraph()}).setGraph(r.graph());return v(r.nodes(),function(n){if(!r.children(n).length)e.setNode(n,r.node(n))}),v(r.edges(),function(n){e.setEdge(n,r.edge(n))}),e}function kr(r,e){var{x:n,y:o}=r,i=e.x-n,a=e.y-o,f=r.width/2,s=r.height/2;if(!i&&!a)throw Error("Not possible to find intersection inside of the rectangle");var u,d;if(Math.abs(a)*f>Math.abs(i)*s){if(a<0)s=-s;u=s*i/a,d=s}else{if(i<0)f=-f;u=f,d=f*a/i}return{x:n+u,y:o+d}}function B(r){var e=E(N(Cr(r)+1),function(){return[]});return v(r.nodes(),function(n){var o=r.node(n),i=o.rank;if(!Vt(i))e[i][o.order]=n}),e}function St(r){var e=j(E(r.nodes(),function(n){return r.node(n).rank}));v(r.nodes(),function(n){var o=r.node(n);if(gr(o,"rank"))o.rank-=e})}function Nt(r){var e=j(E(r.nodes(),function(a){return r.node(a).rank})),n=[];v(r.nodes(),function(a){var f=r.node(a).rank-e;if(!n[f])n[f]=[];n[f].push(a)});var o=0,i=r.graph().nodeRankFactor;v(n,function(a,f){if(Vt(a)&&f%i!==0)--o;else if(o)v(a,function(s){r.node(s).rank+=o})})}function Tr(r,e,n,o){var i={width:0,height:0};if(arguments.length>=4)i.rank=n,i.order=o;return k(r,"border",i,e)}function Cr(r){return I(E(r.nodes(),function(e){var n=r.node(e).rank;if(!Vt(n))return n}))}function Pt(r,e){var n={lhs:[],rhs:[]};return v(r,function(o){if(e(o))n.lhs.push(o);else n.rhs.push(o)}),n}function kt(r,e){var n=Er();try{return e()}finally{console.log(r+" time: "+(Er()-n)+"ms")}}function Ct(r,e){return e()}function Rt(r){function e(n){var o=r.children(n),i=r.node(n);if(o.length)v(o,e);if(Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,f=i.maxRank+1;a<f;++a)At(r,"borderLeft","_bl",n,i,a),At(r,"borderRight","_br",n,i,a)}}v(r.children(),e)}function At(r,e,n,o,i,a){var f={width:0,height:0,rank:a,borderType:e},s=i[e][a-1],u=k(r,"border",f,n);if(i[e][a]=u,r.setParent(u,o),s)r.setEdge(s,u,{weight:1})}function jt(r){var e=r.graph().rankdir.toLowerCase();if(e==="lr"||e==="rl")Dt(r)}function Bt(r){var e=r.graph().rankdir.toLowerCase();if(e==="bt"||e==="rl")If(r);if(e==="lr"||e==="rl")Sf(r),Dt(r)}function Dt(r){v(r.nodes(),function(e){Mt(r.node(e))}),v(r.edges(),function(e){Mt(r.edge(e))})}function Mt(r){var e=r.width;r.width=r.height,r.height=e}function If(r){v(r.nodes(),function(e){Ar(r.node(e))}),v(r.edges(),function(e){var n=r.edge(e);if(v(n.points,Ar),Object.prototype.hasOwnProperty.call(n,"y"))Ar(n)})}function Ar(r){r.y=-r.y}function Sf(r){v(r.nodes(),function(e){Rr(r.node(e))}),v(r.edges(),function(e){var n=r.edge(e);if(v(n.points,Rr),Object.prototype.hasOwnProperty.call(n,"x"))Rr(n)})}function Rr(r){var e=r.x;r.x=r.y,r.y=e}function Ft(r){r.graph().dummyChains=[],v(r.edges(),function(e){Pf(r,e)})}function Pf(r,e){var n=e.v,o=r.node(n).rank,i=e.w,a=r.node(i).rank,f=e.name,s=r.edge(e),u=s.labelRank;if(a===o+1)return;r.removeEdge(e);var d=void 0,c,p;for(p=0,++o;o<a;++p,++o){if(s.points=[],d={width:0,height:0,edgeLabel:s,edgeObj:e,rank:o},c=k(r,"edge",d,"_d"),o===u)d.width=s.width,d.height=s.height,d.dummy="edge-label",d.labelpos=s.labelpos;if(r.setEdge(n,c,{weight:s.weight},f),p===0)r.graph().dummyChains.push(c);n=c}r.setEdge(n,i,{weight:s.weight},f)}function Gt(r){v(r.graph().dummyChains,function(e){var n=r.node(e),o=n.edgeLabel,i;r.setEdge(n.edgeObj,o);while(n.dummy){if(i=r.successors(e)[0],r.removeNode(e),o.points.push({x:n.x,y:n.y}),n.dummy==="edge-label")o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height;e=i,n=r.node(e)}})}function or(r){var e={};function n(o){var i=r.node(o);if(Object.prototype.hasOwnProperty.call(e,o))return i.rank;e[o]=!0;var a=j(E(r.outEdges(o),function(f){return n(f.w)-r.edge(f).minlen}));if(a===Number.POSITIVE_INFINITY||a===void 0||a===null)a=0;return i.rank=a}v(r.sources(),n)}function X(r,e){return r.node(e.w).rank-r.node(e.v).rank-r.edge(e).minlen}function yr(r){var e=new Je({directed:!1}),n=r.nodes()[0],o=r.nodeCount();e.setNode(n,{});var i,a;while(kf(e,r)<o)i=Tf(e,r),a=e.hasNode(i.v)?X(r,i):-X(r,i),Cf(e,r,a);return e}function kf(r,e){function n(o){v(e.nodeEdges(o),function(i){var a=i.v,f=o===a?i.w:a;if(!r.hasNode(f)&&!X(e,i))r.setNode(f,{}),r.setEdge(o,f,{}),n(f)})}return v(r.nodes(),n),r.nodeCount()}function Tf(r,e){return H(e.edges(),function(n){if(r.hasNode(n.v)!==r.hasNode(n.w))return X(e,n)})}function Cf(r,e,n){v(r.nodes(),function(o){e.node(o).rank+=n})}var fh=Sr(1);var hh=Sr(1);Mr.CycleException=ir;function Mr(r){var e={},n={},o=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new ir;if(!Object.prototype.hasOwnProperty.call(e,a))n[a]=!0,e[a]=!0,v(r.predecessors(a),i),delete n[a],o.push(a)}if(v(r.sinks(),i),yt(e)!==r.nodeCount())throw new ir;return o}function ir(){}ir.prototype=Error();function wr(r,e,n){if(!Ce(e))e=[e];var o=(r.isDirected()?r.successors:r.neighbors).bind(r),i=[],a={};return v(e,function(f){if(!r.hasNode(f))throw Error("Graph does not have node: "+f);Ut(r,f,n==="post",a,o,i)}),i}function Ut(r,e,n,o,i,a){if(!Object.prototype.hasOwnProperty.call(o,e)){if(o[e]=!0,!n)a.push(e);if(v(i(e),function(f){Ut(r,f,n,o,i,a)}),n)a.push(e)}}function jr(r,e){return wr(r,e,"post")}function Br(r,e){return wr(r,e,"pre")}F.initLowLimValues=Fr;F.initCutValues=Dr;F.calcCutValue=zt;F.leaveEdge=Ht;F.enterEdge=Jt;F.exchangeEdges=Zt;function F(r){r=It(r),or(r);var e=yr(r);Fr(e),Dr(e,r);var n,o;while(n=Ht(e))o=Jt(e,r,n),Zt(e,r,n,o)}function Dr(r,e){var n=jr(r,r.nodes());n=n.slice(0,n.length-1),v(n,function(o){Bf(r,e,o)})}function Bf(r,e,n){var o=r.node(n),i=o.parent;r.edge(n,i).cutvalue=zt(r,e,n)}function zt(r,e,n){var o=r.node(n),i=o.parent,a=!0,f=e.edge(n,i),s=0;if(!f)a=!1,f=e.edge(i,n);return s=f.weight,v(e.nodeEdges(n),function(u){var d=u.v===n,c=d?u.w:u.v;if(c!==i){var p=d===a,h=e.edge(u).weight;if(s+=p?h:-h,Ff(r,n,c)){var b=r.edge(n,c).cutvalue;s+=p?-b:b}}}),s}function Fr(r,e){if(arguments.length<2)e=r.nodes()[0];qt(r,{},1,e)}function qt(r,e,n,o,i){var a=n,f=r.node(o);if(e[o]=!0,v(r.neighbors(o),function(s){if(!Object.prototype.hasOwnProperty.call(e,s))n=qt(r,e,n,s,o)}),f.low=a,f.lim=n++,i)f.parent=i;else delete f.parent;return n}function Ht(r){return er(r.edges(),function(e){return r.edge(e).cutvalue<0})}function Jt(r,e,n){var{v:o,w:i}=n;if(!e.hasEdge(o,i))o=n.w,i=n.v;var a=r.node(o),f=r.node(i),s=a,u=!1;if(a.lim>f.lim)s=f,u=!0;var d=fr(e.edges(),function(c){return u===Yt(r,r.node(c.v),s)&&u!==Yt(r,r.node(c.w),s)});return H(d,function(c){return X(e,c)})}function Zt(r,e,n,o){var{v:i,w:a}=n;r.removeEdge(i,a),r.setEdge(o.v,o.w,{}),Fr(r),Dr(r,e),Df(r,e)}function Df(r,e){var n=er(r.nodes(),function(i){return!e.node(i).parent}),o=Br(r,n);o=o.slice(1),v(o,function(i){var a=r.node(i).parent,f=e.edge(i,a),s=!1;if(!f)f=e.edge(a,i),s=!0;e.node(i).rank=e.node(a).rank+(s?f.minlen:-f.minlen)})}function Ff(r,e,n){return r.hasEdge(e,n)}function Yt(r,e,n){return n.low<=e.lim&&e.lim<=n.lim}function Gr(r){switch(r.graph().ranker){case"network-simplex":$t(r);break;case"tight-tree":Xf(r);break;case"longest-path":Gf(r);break;default:$t(r)}}var Gf=or;function Xf(r){or(r),yr(r)}function $t(r){F(r)}function Qt(r){var e=k(r,"root",{},"_root"),n=Uf(r),o=I(Yr(n))-1,i=2*o+1;r.graph().nestingRoot=e,v(r.edges(),function(f){r.edge(f).minlen*=i});var a=Vf(r)+1;v(r.children(),function(f){rn(r,e,i,a,o,n,f)}),r.graph().nodeRankFactor=i}function rn(r,e,n,o,i,a,f){var s=r.children(f);if(!s.length){if(f!==e)r.setEdge(e,f,{weight:0,minlen:n});return}var u=Tr(r,"_bt"),d=Tr(r,"_bb"),c=r.node(f);if(r.setParent(u,f),c.borderTop=u,r.setParent(d,f),c.borderBottom=d,v(s,function(p){rn(r,e,n,o,i,a,p);var h=r.node(p),b=h.borderTop?h.borderTop:p,w=h.borderBottom?h.borderBottom:p,y=h.borderTop?o:2*o,g=b!==w?1:i-a[f]+1;r.setEdge(u,b,{weight:y,minlen:g,nestingEdge:!0}),r.setEdge(w,d,{weight:y,minlen:g,nestingEdge:!0})}),!r.parent(f))r.setEdge(e,u,{weight:0,minlen:i+a[f]})}function Uf(r){var e={};function n(o,i){var a=r.children(o);if(a&&a.length)v(a,function(f){n(f,i+1)});e[o]=i}return v(r.children(),function(o){n(o,1)}),e}function Vf(r){return Co(r.edges(),function(e,n){return e+r.edge(n).weight},0)}function en(r){var e=r.graph();r.removeNode(e.nestingRoot),delete e.nestingRoot,v(r.edges(),function(n){var o=r.edge(n);if(o.nestingEdge)r.removeEdge(n)})}function tn(r,e,n){var o={},i;v(n,function(a){var f=r.parent(a),s,u;while(f){if(s=r.parent(f),s)u=o[s],o[s]=f;else u=i,i=f;if(u&&u!==f){e.setEdge(u,f);return}f=s}})}function nn(r,e,n){var o=zf(r),i=new Je({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(a){return r.node(a)});return v(r.nodes(),function(a){var f=r.node(a),s=r.parent(a);if(f.rank===e||f.minRank<=e&&e<=f.maxRank){if(i.setNode(a),i.setParent(a,s||o),v(r[n](a),function(u){var d=u.v===a?u.w:u.v,c=i.edge(d,a),p=!Vt(c)?c.weight:0;i.setEdge(d,a,{weight:r.edge(u).weight+p})}),Object.prototype.hasOwnProperty.call(f,"minRank"))i.setNode(a,{borderLeft:f.borderLeft[e],borderRight:f.borderRight[e]})}}),i}function zf(r){var e;while(r.hasNode(e=J("_root")));return e}function on(r,e){var n=0;for(var o=1;o<e.length;++o)n+=Wf(r,e[o-1],e[o]);return n}function Wf(r,e,n){var o=Lr(n,E(n,function(d,c){return c})),i=S(E(e,function(d){return C(E(r.outEdges(d),function(c){return{pos:o[c.w],weight:r.edge(c).weight}}),"pos")})),a=1;while(a<n.length)a<<=1;var f=2*a-1;a-=1;var s=E(Array(f),function(){return 0}),u=0;return v(i.forEach(function(d){var c=d.pos+a;s[c]+=d.weight;var p=0;while(c>0){if(c%2)p+=s[c+1];c=c-1>>1,s[c]+=d.weight}u+=d.weight*p})),u}function an(r){var e={},n=fr(r.nodes(),function(s){return!r.children(s).length}),o=I(E(n,function(s){return r.node(s).rank})),i=E(N(o+1),function(){return[]});function a(s){if(gr(e,s))return;e[s]=!0;var u=r.node(s);i[u.rank].push(s),v(r.successors(s),a)}var f=C(n,function(s){return r.node(s).rank});return v(f,a),i}function fn(r,e){return E(e,function(n){var o=r.inEdges(n);if(!o.length)return{v:n};else{var i=Co(o,function(a,f){var s=r.edge(f),u=r.node(f.v);return{sum:a.sum+s.weight*u.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:i.sum/i.weight,weight:i.weight}}})}function sn(r,e){var n={};v(r,function(i,a){var f=n[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};if(!Vt(i.barycenter))f.barycenter=i.barycenter,f.weight=i.weight}),v(e.edges(),function(i){var a=n[i.v],f=n[i.w];if(!Vt(a)&&!Vt(f))f.indegree++,a.out.push(n[i.w])});var o=fr(n,function(i){return!i.indegree});return qf(o)}function qf(r){var e=[];function n(a){return function(f){if(f.merged)return;if(Vt(f.barycenter)||Vt(a.barycenter)||f.barycenter>=a.barycenter)Hf(a,f)}}function o(a){return function(f){if(f.in.push(a),--f.indegree===0)r.push(f)}}while(r.length){var i=r.pop();e.push(i),v(i.in.reverse(),n(i)),v(i.out,o(i))}return E(fr(e,function(a){return!a.merged}),function(a){return K(a,["vs","i","barycenter","weight"])})}function Hf(r,e){var n=0,o=0;if(r.weight)n+=r.barycenter*r.weight,o+=r.weight;if(e.weight)n+=e.barycenter*e.weight,o+=e.weight;r.vs=e.vs.concat(r.vs),r.barycenter=n/o,r.weight=o,r.i=Math.min(e.i,r.i),e.merged=!0}function dn(r,e){var n=Pt(r,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),o=n.lhs,i=C(n.rhs,function(c){return-c.i}),a=[],f=0,s=0,u=0;o.sort(Kf(!!e)),u=un(a,i,u),v(o,function(c){u+=c.vs.length,a.push(c.vs),f+=c.barycenter*c.weight,s+=c.weight,u=un(a,i,u)});var d={vs:S(a)};if(s)d.barycenter=f/s,d.weight=s;return d}function un(r,e,n){var o;while(e.length&&(o=G(e)).i<=n)e.pop(),r.push(o.vs),n++;return n}function Kf(r){return function(e,n){if(e.barycenter<n.barycenter)return-1;else if(e.barycenter>n.barycenter)return 1;return!r?e.i-n.i:n.i-e.i}}function Xr(r,e,n,o){var i=r.children(e),a=r.node(e),f=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,u={};if(f)i=fr(i,function(w){return w!==f&&w!==s});var d=fn(r,i);v(d,function(w){if(r.children(w.v).length){var y=Xr(r,w.v,n,o);if(u[w.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter"))Zf(w,y)}});var c=sn(d,n);Jf(c,u);var p=dn(c,o);if(f){if(p.vs=S([f,p.vs,s]),r.predecessors(f).length){var h=r.node(r.predecessors(f)[0]),b=r.node(r.predecessors(s)[0]);if(!Object.prototype.hasOwnProperty.call(p,"barycenter"))p.barycenter=0,p.weight=0;p.barycenter=(p.barycenter*p.weight+h.order+b.order)/(p.weight+2),p.weight+=2}}return p}function Jf(r,e){v(r,function(n){n.vs=S(n.vs.map(function(o){if(e[o])return e[o].vs;return o}))})}function Zf(r,e){if(!Vt(r.barycenter))r.barycenter=(r.barycenter*r.weight+e.barycenter*e.weight)/(r.weight+e.weight),r.weight+=e.weight;else r.barycenter=e.barycenter,r.weight=e.weight}function mn(r){var e=Cr(r),n=cn(r,N(1,e+1),"inEdges"),o=cn(r,N(e-1,-1,-1),"outEdges"),i=an(r);pn(r,i);var a=Number.POSITIVE_INFINITY,f;for(var s=0,u=0;u<4;++s,++u){$f(s%2?n:o,s%4>=2),i=B(r);var d=on(r,i);if(d<a)u=0,f=Fe(i),a=d}pn(r,f)}function cn(r,e,n){return E(e,function(o){return nn(r,o,n)})}function $f(r,e){var n=new Je;v(r,function(o){var i=o.graph().root,a=Xr(o,i,n,e);v(a.vs,function(f,s){o.node(f).order=s}),tn(o,n,a.vs)})}function pn(r,e){v(e,function(n){v(n,function(o,i){r.node(o).order=i})})}function hn(r){var e=rs(r);v(r.graph().dummyChains,function(n){var o=r.node(n),i=o.edgeObj,a=Qf(r,e,i.v,i.w),{path:f,lca:s}=a,u=0,d=f[u],c=!0;while(n!==i.w){if(o=r.node(n),c){while((d=f[u])!==s&&r.node(d).maxRank<o.rank)u++;if(d===s)c=!1}if(!c){while(u<f.length-1&&r.node(d=f[u+1]).minRank<=o.rank)u++;d=f[u]}r.setParent(n,d),n=r.successors(n)[0]}})}function Qf(r,e,n,o){var i=[],a=[],f=Math.min(e[n].low,e[o].low),s=Math.max(e[n].lim,e[o].lim),u,d;u=n;do u=r.parent(u),i.push(u);while(u&&(e[u].low>f||s>e[u].lim));d=u,u=o;while((u=r.parent(u))!==d)a.push(u);return{path:i.concat(a.reverse()),lca:d}}function rs(r){var e={},n=0;function o(i){var a=n;v(r.children(i),o),e[i]={low:a,lim:n++}}return v(r.children(),o),e}function es(r,e){var n={};function o(i,a){var f=0,s=0,u=i.length,d=G(a);return v(a,function(c,p){var h=ns(r,c),b=h?r.node(h).order:u;if(h||c===d)v(a.slice(s,p+1),function(w){v(r.predecessors(w),function(y){var g=r.node(y),_=g.order;if((_<f||b<_)&&!(g.dummy&&r.node(w).dummy))gn(n,y,w)})}),s=p+1,f=b}),a}return Co(e,o),n}function ts(r,e){var n={};function o(a,f,s,u,d){var c;v(N(f,s),function(p){if(c=a[p],r.node(c).dummy)v(r.predecessors(c),function(h){var b=r.node(h);if(b.dummy&&(b.order<u||b.order>d))gn(n,h,c)})})}function i(a,f){var s=-1,u,d=0;return v(f,function(c,p){if(r.node(c).dummy==="border"){var h=r.predecessors(c);if(h.length)u=r.node(h[0]).order,o(f,d,p,s,u),d=p,s=u}o(f,d,f.length,u,a.length)}),f}return Co(e,i),n}function ns(r,e){if(r.node(e).dummy)return er(r.predecessors(e),function(n){return r.node(n).dummy})}function gn(r,e,n){if(e>n){var o=e;e=n,n=o}if(!Object.prototype.hasOwnProperty.call(r,e))Object.defineProperty(r,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=r[e];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function os(r,e,n){if(e>n){var o=e;e=n,n=o}return!!r[e]&&Object.prototype.hasOwnProperty.call(r[e],n)}function is(r,e,n,o){var i={},a={},f={};return v(e,function(s){v(s,function(u,d){i[u]=u,a[u]=u,f[u]=d})}),v(e,function(s){var u=-1;v(s,function(d){var c=o(d);if(c.length){c=C(c,function(y){return f[y]});var p=(c.length-1)/2;for(var h=Math.floor(p),b=Math.ceil(p);h<=b;++h){var w=c[h];if(a[d]===d&&u<f[w]&&!os(n,d,w))a[w]=d,a[d]=i[d]=i[w],u=f[w]}}})}),{root:i,align:a}}function as(r,e,n,o,i){var a={},f=fs(r,e,n,i),s=i?"borderLeft":"borderRight";function u(p,h){var b=f.nodes(),w=b.pop(),y={};while(w){if(y[w])p(w);else y[w]=!0,b.push(w),b=b.concat(h(w));w=b.pop()}}function d(p){a[p]=f.inEdges(p).reduce(function(h,b){return Math.max(h,a[b.v]+f.edge(b))},0)}function c(p){var h=f.outEdges(p).reduce(function(w,y){return Math.min(w,a[y.w]-f.edge(y))},Number.POSITIVE_INFINITY),b=r.node(p);if(h!==Number.POSITIVE_INFINITY&&b.borderType!==s)a[p]=Math.max(a[p],h)}return u(d,f.predecessors.bind(f)),u(c,f.successors.bind(f)),v(o,function(p){a[p]=a[n[p]]}),a}function fs(r,e,n,o){var i=new Je,a=r.graph(),f=cs(a.nodesep,a.edgesep,o);return v(e,function(s){var u;v(s,function(d){var c=n[d];if(i.setNode(c),u){var p=n[u],h=i.edge(p,c);i.setEdge(p,c,Math.max(f(r,d,u),h||0))}u=d})}),i}function ss(r,e){return H(Yr(e),function(n){var{NEGATIVE_INFINITY:o,POSITIVE_INFINITY:i}=Number;return He(n,function(a,f){var s=ps(r,f)/2;o=Math.max(a+s,o),i=Math.min(a-s,i)}),o-i})}function us(r,e){var n=Yr(e),o=j(n),i=I(n);v(["u","d"],function(a){v(["l","r"],function(f){var s=a+f,u=r[s],d;if(u===e)return;var c=Yr(u);if(d=f==="l"?o-j(c):i-I(c),d)r[s]=z(u,function(p){return p+d})})})}function ds(r,e){return z(r.ul,function(n,o){if(e)return r[e.toLowerCase()][o];else{var i=C(E(r,o));return(i[1]+i[2])/2}})}function vn(r){var e=B(r),n=nr(es(r,e),ts(r,e)),o={},i;v(["u","d"],function(f){i=f==="u"?e:Yr(e).reverse(),v(["l","r"],function(s){if(s==="r")i=E(i,function(p){return Yr(p).reverse()});var u=(f==="u"?r.predecessors:r.successors).bind(r),d=is(r,i,n,u),c=as(r,i,d.root,d.align,s==="r");if(s==="r")c=z(c,function(p){return-p});o[f+s]=c})});var a=ss(r,o);return us(o,a),ds(o,r.graph().align)}function cs(r,e,n){return function(o,i,a){var f=o.node(i),s=o.node(a),u=0,d;if(u+=f.width/2,Object.prototype.hasOwnProperty.call(f,"labelpos"))switch(f.labelpos.toLowerCase()){case"l":d=-f.width/2;break;case"r":d=f.width/2;break}if(d)u+=n?d:-d;if(d=0,u+=(f.dummy?e:r)/2,u+=(s.dummy?e:r)/2,u+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":d=s.width/2;break;case"r":d=-s.width/2;break}if(d)u+=n?d:-d;return d=0,u}}function ps(r,e){return r.node(e).width}function bn(r){r=br(r),ls(r),Ke(vn(r),function(e,n){r.node(n).x=e})}function ls(r){var e=B(r),n=r.graph().ranksep,o=0;v(e,function(i){var a=I(E(i,function(f){return r.node(f).height}));v(i,function(f){r.node(f).y=o+a/2}),o+=a+n})}function Wr(r,e){var n=e&&e.debugTiming?kt:Ct;n("layout",()=>{var o=n(" buildLayoutGraph",()=>Os(r));n(" runLayout",()=>ms(o,n)),n(" updateInputGraph",()=>hs(r,o))})}function ms(r,e){e(" makeSpaceForEdgeLabels",()=>Ls(r)),e(" removeSelfEdges",()=>Rs(r)),e(" acyclic",()=>xt(r)),e(" nestingGraph.run",()=>Qt(r)),e(" rank",()=>Gr(br(r))),e(" injectEdgeLabelProxies",()=>Is(r)),e(" removeEmptyRanks",()=>Nt(r)),e(" nestingGraph.cleanup",()=>en(r)),e(" normalizeRanks",()=>St(r)),e(" assignRankMinMax",()=>Ss(r)),e(" removeEdgeLabelProxies",()=>Ns(r)),e(" normalize.run",()=>Ft(r)),e(" parentDummyChains",()=>hn(r)),e(" addBorderSegments",()=>Rt(r)),e(" order",()=>mn(r)),e(" insertSelfEdges",()=>Ms(r)),e(" adjustCoordinateSystem",()=>jt(r)),e(" position",()=>bn(r)),e(" positionSelfEdges",()=>js(r)),e(" removeBorderNodes",()=>As(r)),e(" normalize.undo",()=>Gt(r)),e(" fixupEdgeLabelCoords",()=>Ts(r)),e(" undoCoordinateSystem",()=>Bt(r)),e(" translateGraph",()=>Ps(r)),e(" assignNodeIntersects",()=>ks(r)),e(" reversePoints",()=>Cs(r)),e(" acyclic.undo",()=>Ot(r))}function hs(r,e){v(r.nodes(),function(n){var o=r.node(n),i=e.node(n);if(o){if(o.x=i.x,o.y=i.y,e.children(n).length)o.width=i.width,o.height=i.height}}),v(r.edges(),function(n){var o=r.edge(n),i=e.edge(n);if(o.points=i.points,Object.prototype.hasOwnProperty.call(i,"x"))o.x=i.x,o.y=i.y}),r.graph().width=e.graph().width,r.graph().height=e.graph().height}var gs=["nodesep","edgesep","ranksep","marginx","marginy"],vs={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},bs=["acyclicer","ranker","rankdir","align"],ys=["width","height"],ws={width:0,height:0},_s=["minlen","weight","width","height","labeloffset"],Es={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},xs=["labelpos"];function Os(r){var e=new Je({multigraph:!0,compound:!0}),n=zr(r.graph());return e.setGraph(nr({},vs,Ur(n,gs),K(n,bs))),v(r.nodes(),function(o){var i=zr(r.node(o));e.setNode(o,Xe(Ur(i,ys),ws)),e.setParent(o,r.parent(o))}),v(r.edges(),function(o){var i=zr(r.edge(o));e.setEdge(o,nr({},Es,Ur(i,_s),K(i,xs)))}),e}function Ls(r){var e=r.graph();e.ranksep/=2,v(r.edges(),function(n){var o=r.edge(n);if(o.minlen*=2,o.labelpos.toLowerCase()!=="c")if(e.rankdir==="TB"||e.rankdir==="BT")o.width+=o.labeloffset;else o.height+=o.labeloffset})}function Is(r){v(r.edges(),function(e){var n=r.edge(e);if(n.width&&n.height){var o=r.node(e.v),i=r.node(e.w),a={rank:(i.rank-o.rank)/2+o.rank,e};k(r,"edge-proxy",a,"_ep")}})}function Ss(r){var e=0;v(r.nodes(),function(n){var o=r.node(n);if(o.borderTop)o.minRank=r.node(o.borderTop).rank,o.maxRank=r.node(o.borderBottom).rank,e=I(e,o.maxRank)}),r.graph().maxRank=e}function Ns(r){v(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="edge-proxy")r.edge(n.e).labelRank=n.rank,r.removeNode(e)})}function Ps(r){var e=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,i=0,a=r.graph(),f=a.marginx||0,s=a.marginy||0;function u(d){var{x:c,y:p,width:h,height:b}=d;e=Math.min(e,c-h/2),n=Math.max(n,c+h/2),o=Math.min(o,p-b/2),i=Math.max(i,p+b/2)}v(r.nodes(),function(d){u(r.node(d))}),v(r.edges(),function(d){var c=r.edge(d);if(Object.prototype.hasOwnProperty.call(c,"x"))u(c)}),e-=f,o-=s,v(r.nodes(),function(d){var c=r.node(d);c.x-=e,c.y-=o}),v(r.edges(),function(d){var c=r.edge(d);if(v(c.points,function(p){p.x-=e,p.y-=o}),Object.prototype.hasOwnProperty.call(c,"x"))c.x-=e;if(Object.prototype.hasOwnProperty.call(c,"y"))c.y-=o}),a.width=n-e+f,a.height=i-o+s}function ks(r){v(r.edges(),function(e){var n=r.edge(e),o=r.node(e.v),i=r.node(e.w),a,f;if(!n.points)n.points=[],a=i,f=o;else a=n.points[0],f=n.points[n.points.length-1];n.points.unshift(kr(o,a)),n.points.push(kr(i,f))})}function Ts(r){v(r.edges(),function(e){var n=r.edge(e);if(Object.prototype.hasOwnProperty.call(n,"x")){if(n.labelpos==="l"||n.labelpos==="r")n.width-=n.labeloffset;switch(n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}}})}function Cs(r){v(r.edges(),function(e){var n=r.edge(e);if(n.reversed)n.points.reverse()})}function As(r){v(r.nodes(),function(e){if(r.children(e).length){var n=r.node(e),o=r.node(n.borderTop),i=r.node(n.borderBottom),a=r.node(G(n.borderLeft)),f=r.node(G(n.borderRight));n.width=Math.abs(f.x-a.x),n.height=Math.abs(i.y-o.y),n.x=a.x+n.width/2,n.y=o.y+n.height/2}}),v(r.nodes(),function(e){if(r.node(e).dummy==="border")r.removeNode(e)})}function Rs(r){v(r.edges(),function(e){if(e.v===e.w){var n=r.node(e.v);if(!n.selfEdges)n.selfEdges=[];n.selfEdges.push({e,label:r.edge(e)}),r.removeEdge(e)}})}function Ms(r){var e=B(r);v(e,function(n){var o=0;v(n,function(i,a){var f=r.node(i);f.order=a+o,v(f.selfEdges,function(s){k(r,"selfedge",{width:s.label.width,height:s.label.height,rank:f.rank,order:a+ ++o,e:s.e,label:s.label},"_se")}),delete f.selfEdges})})}function js(r){v(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="selfedge"){var o=r.node(n.e.v),i=o.x+o.width/2,a=o.y,f=n.x-i,s=o.height/2;r.setEdge(n.e,n.label),r.removeNode(e),n.label.points=[{x:i+2*f/3,y:a-s},{x:i+5*f/6,y:a-s},{x:i+f,y:a},{x:i+5*f/6,y:a+s},{x:i+2*f/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Ur(r,e){return z(K(r,e),Number)}function zr(r){var e={};return v(r,function(n,o){e[o.toLowerCase()]=n}),e}var yn=t((r,e,n)=>Math.max(e,Math.min(n,r)),"clamp"),wn=t((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),Bs=t((r)=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),Ds=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Fs=t((r,e,n,o,i)=>{let a=[],f=new Set;if(n.forEach(({start:c,end:p})=>{if(c!==o)f.add(c);if(p!==o)f.add(p)}),f.forEach((c)=>{let p=r.node(c);if(typeof p?.x==="number"&&typeof p?.y==="number")a.push(p)}),a.length===0)n.forEach(({edge:c})=>{(c.points??[]).forEach((p)=>{if(typeof p?.x==="number"&&typeof p?.y==="number")a.push(p)})});if(a.length===0)return wn(i);let s=a.reduce((c,p)=>({x:c.x+p.x/a.length,y:c.y+p.y/a.length}),{x:0,y:0}),u=s.x-e.x,d=s.y-e.y;if(Math.abs(u)>Math.abs(d))return u>0?"right":"left";if(Math.abs(d)>0)return d>0?"bottom":"top";return wn(i)},"getSelfLoopSide"),Gs=t((r,e="top",n=0,o=0)=>{let i=r.x,a=r.y-n,f=r.width/2,s=r.height/2,u=Math.max(36,Math.min(100,r.width*0.8)),d=yn(Math.max(o,r.width*0.35),36,u),c=yn(Math.min(r.width,r.height)*0.45,24,48);switch(e){case"bottom":{let p=a+s;return[{x:i-d/2,y:p},{x:i-d/2,y:p+c},{x:i+d/2,y:p+c},{x:i+d/2,y:p}]}case"right":{let p=i+f;return[{x:p,y:a-d/2},{x:p+c,y:a-d/2},{x:p+c,y:a+d/2},{x:p,y:a+d/2}]}case"left":{let p=i-f;return[{x:p,y:a-d/2},{x:p-c,y:a-d/2},{x:p-c,y:a+d/2},{x:p,y:a+d/2}]}case"top":default:{let p=a-s;return[{x:i-d/2,y:p},{x:i-d/2,y:p-c},{x:i+d/2,y:p-c},{x:i+d/2,y:p}]}}},"getSelfLoopPoints"),Xs=t((r,e,n="top",o=0,i={})=>{let f=r.x,s=r.y-o,u=i.width??0,d=i.height??0;switch(n){case"bottom":return{x:f,y:Math.max(...e.map((c)=>c.y))+d/2+4};case"right":return{x:Math.max(...e.map((c)=>c.x))+u/2+4,y:s};case"left":return{x:Math.min(...e.map((c)=>c.x))-u/2-4,y:s};case"top":default:return{x:f,y:Math.min(...e.map((c)=>c.y))-d/2-4}}},"getSelfLoopLabelPosition"),En=t((r,e=0,{mergeSelfLoops:n=!0}={})=>{let o=new Map,i=[],a=r.graph()?.rankdir;return r.edges().forEach((f)=>{let s=r.edge(f);if(n&&s.selfLoop){let u=s.selfLoop.id;if(!o.has(u))o.set(u,[]);o.get(u).push({edge:s,start:f.v,end:f.w})}else i.push({edge:s,start:f.v,end:f.w})}),o.forEach((f)=>{if(f.length!==3){f.forEach((_)=>i.push(_));return}f.sort((_,A)=>_.edge.selfLoop.order-A.edge.selfLoop.order);let[s,u,d]=f,c=s.edge.originalEdge??u.edge.originalEdge??d.edge.originalEdge??u.edge,p=r.node(c.start);if(!p){f.forEach((_)=>i.push(_));return}let h={width:u.edge.width,height:u.edge.height},b=Fs(r,p,f,c.start,a),w=Gs(p,b,e,h.width??0),y=Xs(p,w,b,e,h),g={...u.edge,...c,id:c.id,points:w,start:c.start,end:c.end,x:y.x,y:y.y,width:h.width,height:h.height,labelStyle:u.edge.labelStyle,fromCluster:s.edge.fromCluster??u.edge.fromCluster??d.edge.fromCluster,toCluster:s.edge.toCluster??u.edge.toCluster??d.edge.toCluster};delete g.selfLoop,delete g.originalEdge,i.push({edge:g,start:g.start,end:g.end})}),i},"getEdgesToRender"),xn=t(async({element:r,graph:e,diagramType:n,id:o,parentCluster:i,siteConfig:a})=>{let f=e.graph().rankdir;l.trace("Dir in recursive render - dir:",f);let{clusters:s,edgePaths:u,edgeLabels:d,nodes:c,rootGroups:p}=Bp(r,{edgePathsClass:"edgePaths"});if(!e.nodes())l.info("No nodes found for",e);else l.info("Recursive render XXX",e.nodes());if(e.edges().length>0)l.info("Recursive edges",e.edge(e.edges()[0]));let h=Bs(n);await Promise.all(e.nodes().map(async function(y){let g=e.node(y);if(i!==void 0){let _=JSON.parse(JSON.stringify(i.clusterData));if(l.trace(`Setting data for parent cluster XXX
1
+ import{t,l,m,W,xa,hh,na,Do,Ca,dl,No}from"./index-gqrt766t.js";import{Kt,Rn,mr,cn,Kr,ko,we,Dt,Sr,xo,Tr,ec,Lp,Mp,Fp,Gi,ha,Pp,ji,Ln,Hi,Ja,ba,qi,wo,Wi,Op,$p,tc,Vt,zp,Ki,Co,Vi,nc,rc,Eo,Up,ac,Gp,dd,Vr,oc,jp,Hp,qp,tr,ic,sc,Yi,Wp,lc,v,fr,Yr,Yt,Bo,Xe}from"./index-rqt8mem9.js";import{Dp,Np,ye,ol,oh,Qp,si}from"./index-fv7nybnf.js";import{Sn}from"./index-2s17netq.js";var ur={};Sn(ur,{default:()=>Z});var Nn=/\s/;function Pn(r){var e=r.length;while(e--&&Nn.test(r.charAt(e)));return e}var Jr=Pn;var kn=/^\s+/;function Tn(r){return r?r.slice(0,Jr(r)+1).replace(kn,""):r}var Zr=Tn;var $r=NaN,Cn=/^[-+]0x[0-9a-f]+$/i,An=/^0b[01]+$/i,Mn=/^0o[0-7]+$/i,jn=parseInt;function Bn(r){if(typeof r=="number")return r;if(Kr(r))return $r;if(Dt(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Dt(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=Zr(r);var n=An.test(r);return n||Mn.test(r)?jn(r.slice(2),n?2:8):Cn.test(r)?$r:+r}var Qr=Bn;var re=1/0,Dn=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function Fn(r){if(!r)return r===0?r:0;if(r=Qr(r),r===re||r===-re){var e=r<0?-1:1;return e*Dn}return r===r?r:0}var U=Fn;function Gn(r){var e=U(r),n=e%1;return e===e?n?e-n:e:0}var ee=Gn;var te=Object.create,Xn=function(){function r(){}return function(e){if(!Dt(e))return{};if(te)return te(e);r.prototype=e;var n=new r;return r.prototype=void 0,n}}(),ne=Xn;function Un(r,e){var n=-1,o=r.length;e||(e=Array(o));while(++n<o)e[n]=r[n];return e}var ar=Un;function Vn(r,e,n){if(e=="__proto__"&&ec)ec(r,e,{configurable:!0,enumerable:!0,value:n,writable:!0});else r[e]=n}var R=Vn;var Yn=Object.prototype,zn=Yn.hasOwnProperty;function Wn(r,e,n){var o=r[e];if(!(zn.call(r,e)&&ha(o,n))||n===void 0&&!(e in r))R(r,e,n)}var M=Wn;function qn(r,e,n,o){var i=!n;n||(n={});var a=-1,f=e.length;while(++a<f){var s=e[a],u=o?o(n[s],r[s],s,n,r):void 0;if(u===void 0)u=r[s];if(i)R(n,s,u);else M(n,s,u)}return n}var P=qn;function Hn(r,e,n){if(!Dt(n))return!1;var o=typeof e;if(o=="number"?Ln(n)&&Gi(e,n.length):o=="string"&&(e in n))return ha(n[e],r);return!1}var T=Hn;function Kn(r){return ji(function(e,n){var o=-1,i=n.length,a=i>1?n[i-1]:void 0,f=i>2?n[2]:void 0;if(a=r.length>3&&typeof a=="function"?(i--,a):void 0,f&&T(n[0],n[1],f))a=i<3?void 0:a,i=1;e=Object(e);while(++o<i){var s=n[o];if(s)r(e,s,o,a)}return e})}var oe=Kn;function Jn(r){var e=[];if(r!=null)for(var n in Object(r))e.push(n);return e}var ie=Jn;var Zn=Object.prototype,$n=Zn.hasOwnProperty;function Qn(r){if(!Dt(r))return ie(r);var e=Hi(r),n=[];for(var o in r)if(!(o=="constructor"&&(e||!$n.call(r,o))))n.push(o);return n}var ae=Qn;function ro(r){return Ln(r)?Op(r,!0):ae(r)}var L=ro;function eo(r){var e=r==null?0:r.length;return e?rc(r,1):[]}var S=eo;function to(r){return Lp(Pp(r,void 0,S),r+"")}var fe=to;var no=$p(Object.getPrototypeOf,Object),V=no;var oo="[object Object]",io=Function.prototype,ao=Object.prototype,se=io.toString,fo=ao.hasOwnProperty,so=se.call(Object);function uo(r){if(!cn(r)||mr(r)!=oo)return!1;var e=V(r);if(e===null)return!0;var n=fo.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&se.call(n)==so}var ue=uo;var co="\\ud800-\\udfff",po="\\u0300-\\u036f",lo="\\ufe20-\\ufe2f",mo="\\u20d0-\\u20ff",ho=po+lo+mo,go="\\ufe0e\\ufe0f",vo="\\u200d",bo=RegExp("["+vo+co+ho+go+"]");function yo(r){return bo.test(r)}var de=yo;function _o(r,e){return r&&P(e,Vt(e),r)}var ce=_o;function Oo(r,e){return r&&P(e,L(e),r)}var pe=Oo;var ge=typeof ur=="object"&&ur&&!ur.nodeType&&ur,le=ge&&typeof sr=="object"&&sr&&!sr.nodeType&&sr,Lo=le&&le.exports===ge,me=Lo?Kt.Buffer:void 0,he=me?me.allocUnsafe:void 0;function Io(r,e){if(e)return r.slice();var n=r.length,o=he?he(n):new r.constructor(n);return r.copy(o),o}var Z=Io;function So(r,e){return P(r,ac(r),e)}var ve=So;var Po=Object.getOwnPropertySymbols,To=!Po?Up:function(r){var e=[];while(r)nc(e,ac(r)),r=V(r);return e},dr=To;function Ao(r,e){return P(r,dr(r),e)}var be=Ao;function Ro(r){return Gp(r,L,dr)}var _e=Ro;var Mo=Object.prototype,jo=Mo.hasOwnProperty;function Fo(r){var e=r.length,n=new r.constructor(e);if(e&&typeof r[0]=="string"&&jo.call(r,"index"))n.index=r.index,n.input=r.input;return n}var Ee=Fo;function Go(r){var e=new r.constructor(r.byteLength);return new oc(e).set(new oc(r)),e}var Y=Go;function Xo(r,e){var n=e?Y(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.byteLength)}var xe=Xo;var Uo=/\w*$/;function Vo(r){var e=new r.constructor(r.source,Uo.exec(r));return e.lastIndex=r.lastIndex,e}var Oe=Vo;var Le=Rn?Rn.prototype:void 0,Ie=Le?Le.valueOf:void 0;function Yo(r){return Ie?Object(Ie.call(r)):{}}var Se=Yo;function zo(r,e){var n=e?Y(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.length)}var cr=zo;var Wo="[object Boolean]",qo="[object Date]",Ho="[object Map]",Ko="[object Number]",Jo="[object RegExp]",Zo="[object Set]",$o="[object String]",Qo="[object Symbol]",ri="[object ArrayBuffer]",ei="[object DataView]",ti="[object Float32Array]",ni="[object Float64Array]",oi="[object Int8Array]",ii="[object Int16Array]",ai="[object Int32Array]",fi="[object Uint8Array]",ui="[object Uint8ClampedArray]",di="[object Uint16Array]",ci="[object Uint32Array]";function pi(r,e,n){var o=r.constructor;switch(e){case ri:return Y(r);case Wo:case qo:return new o(+r);case ei:return xe(r,n);case ti:case ni:case oi:case ii:case ai:case fi:case ui:case di:case ci:return cr(r,n);case Ho:return new o;case Ko:case $o:return new o(r);case Jo:return Oe(r);case Zo:return new o;case Qo:return Se(r)}}var Ne=pi;function li(r){return typeof r.constructor=="function"&&!Hi(r)?ne(V(r)):{}}var pr=li;var mi="[object Map]";function hi(r){return cn(r)&&Vr(r)==mi}var Pe=hi;var ke=wo&&wo.isMap,gi=ke?qi(ke):Pe,Te=gi;var vi="[object Set]";function bi(r){return cn(r)&&Vr(r)==vi}var Ce=bi;var Ae=wo&&wo.isSet,yi=Ae?qi(Ae):Ce,Re=yi;var wi=1,_i=2,Ei=4,Me="[object Arguments]",xi="[object Array]",Oi="[object Boolean]",Li="[object Date]",Ii="[object Error]",je="[object Function]",Si="[object GeneratorFunction]",Ni="[object Map]",Pi="[object Number]",Be="[object Object]",ki="[object RegExp]",Ti="[object Set]",Ci="[object String]",Ai="[object Symbol]",Ri="[object WeakMap]",Mi="[object ArrayBuffer]",Bi="[object DataView]",Di="[object Float32Array]",Fi="[object Float64Array]",Xi="[object Int8Array]",Ui="[object Int16Array]",zi="[object Int32Array]",Ji="[object Uint8Array]",Zi="[object Uint8ClampedArray]",$i="[object Uint16Array]",Qi="[object Uint32Array]",x={};x[Me]=x[xi]=x[Mi]=x[Bi]=x[Oi]=x[Li]=x[Di]=x[Fi]=x[Xi]=x[Ui]=x[zi]=x[Ni]=x[Pi]=x[Be]=x[ki]=x[Ti]=x[Ci]=x[Ai]=x[Ji]=x[Zi]=x[$i]=x[Qi]=!0;x[Ii]=x[je]=x[Ri]=!1;function lr(r,e,n,o,i,a){var f,s=e&wi,u=e&_i,d=e&Ei;if(n)f=i?n(r,o,i,a):n(r);if(f!==void 0)return f;if(!Dt(r))return r;var c=we(r);if(c){if(f=Ee(r),!s)return ar(r,f)}else{var p=Vr(r),h=p==je||p==Si;if(ba(r))return Z(r,s);if(p==Be||p==Me||h&&!i){if(f=u||h?{}:pr(r),!s)return u?be(r,pe(f,r)):ve(r,ce(f,r))}else{if(!x[p])return i?r:{};f=Ne(r,p,s)}}a||(a=new Eo);var b=a.get(r);if(b)return b;if(a.set(r,f),Re(r))r.forEach(function(g){f.add(lr(g,e,n,g,r,a))});else if(Te(r))r.forEach(function(g,_){f.set(_,lr(g,e,n,_,r,a))});var w=d?u?_e:dd:u?L:Vt,y=c?void 0:w(r);return Mp(y||r,function(g,_){if(y)_=g,g=r[_];M(f,_,lr(g,e,n,_,r,a))}),f}var De=lr;var ra=1,ea=4;function ta(r){return De(r,ra|ea)}var Fe=ta;var oa=function(){return Kt.Date.now()},_r=oa;var Ge=Object.prototype,ia=Ge.hasOwnProperty,aa=ji(function(r,e){r=Object(r);var n=-1,o=e.length,i=o>2?e[2]:void 0;if(i&&T(e[0],e[1],i))o=1;while(++n<o){var a=e[n],f=L(a),s=-1,u=f.length;while(++s<u){var d=f[s],c=r[d];if(c===void 0||ha(c,Ge[d])&&!ia.call(r,d))r[d]=a[d]}}return r}),Ue=aa;function fa(r,e,n){if(n!==void 0&&!ha(r[e],n)||n===void 0&&!(e in r))R(r,e,n)}var Q=fa;function sa(r,e){if(e==="constructor"&&typeof r[e]==="function")return;if(e=="__proto__")return;return r[e]}var rr=sa;function ua(r){return P(r,L(r))}var Ve=ua;function da(r,e,n,o,i,a,f){var s=rr(r,n),u=rr(e,n),d=f.get(u);if(d){Q(r,n,d);return}var c=a?a(s,u,n+"",r,e,f):void 0,p=c===void 0;if(p){var h=we(u),b=!h&&ba(u),w=!h&&!b&&Wi(u);if(c=u,h||b||w)if(we(s))c=s;else if(Wp(s))c=ar(s);else if(b)p=!1,c=Z(u,!0);else if(w)p=!1,c=cr(u,!0);else c=[];else if(ue(u)||Ja(u)){if(c=s,Ja(s))c=Ve(s);else if(!Dt(s)||xo(s))c=pr(u)}else p=!1}if(p)f.set(u,c),i(c,u,o,a,f),f.delete(u);Q(r,n,c)}var Ye=da;function ze(r,e,n,o,i){if(r===e)return;ic(e,function(a,f){if(i||(i=new Eo),Dt(a))Ye(r,e,f,n,ze,o,i);else{var s=o?o(rr(r,f),a,f+"",r,e,i):void 0;if(s===void 0)s=a;Q(r,f,s)}},L)}var We=ze;function ca(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var G=ca;function pa(r){return function(e,n,o){var i=Object(e);if(!Ln(e)){var a=tr(n,3);e=Vt(e),n=function(s){return a(i[s],s,i)}}var f=r(e,n,o);return f>-1?i[a?e[f]:f]:void 0}}var qe=pa;var la=Math.max;function ma(r,e,n){var o=r==null?0:r.length;if(!o)return-1;var i=n==null?0:ee(n);if(i<0)i=la(o+i,0);return Fp(r,tr(e,3),i)}var He=ma;var ga=qe(He),er=ga;function va(r,e){var n=-1,o=Ln(r)?Array(r.length):[];return Yi(r,function(i,a,f){o[++n]=e(i,a,f)}),o}var hr=va;function ya(r,e){var n=we(r)?ko:hr;return n(r,tr(e,3))}var E=ya;function wa(r,e){return r==null?r:ic(r,lc(e),L)}var Ke=wa;function _a(r,e){return r&&sc(r,lc(e))}var Je=_a;function Ea(r,e){return r>e}var Ze=Ea;var Oa=Object.prototype,La=Oa.hasOwnProperty;function Ia(r,e){return r!=null&&La.call(r,e)}var $e=Ia;function Sa(r,e){return r!=null&&jp(r,e,$e)}var gr=Sa;var Na="[object String]";function Pa(r){return typeof r=="string"||!we(r)&&cn(r)&&mr(r)==Na}var Qe=Pa;function ka(r,e){return r<e}var vr=ka;function Ta(r,e){var n={};return e=tr(e,3),sc(r,function(o,i,a){R(n,i,e(o,i,a))}),n}var z=Ta;function Aa(r,e,n){var o=-1,i=r.length;while(++o<i){var a=r[o],f=e(a);if(f!=null&&(s===void 0?f===f&&!Kr(f):n(f,s)))var s=f,u=a}return u}var q=Aa;function Ra(r){return r&&r.length?q(r,Sr,Ze):void 0}var I=Ra;var Ma=oe(function(r,e,n){We(r,e,n)}),nr=Ma;function ja(r){return r&&r.length?q(r,Sr,vr):void 0}var j=ja;function Ba(r,e){return r&&r.length?q(r,tr(e,2),vr):void 0}var H=Ba;function Da(r,e,n,o){if(!Dt(r))return r;e=Ki(e,r);var i=-1,a=e.length,f=a-1,s=r;while(s!=null&&++i<a){var u=Co(e[i]),d=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return r;if(i!=f){var c=s[u];if(d=o?o(c,u,s):void 0,d===void 0)d=Dt(c)?c:Gi(e[i+1])?[]:{}}M(s,u,d),s=s[u]}return r}var rt=Da;function Fa(r,e,n){var o=-1,i=e.length,a={};while(++o<i){var f=e[o],s=Vi(r,f);if(n(s,f))rt(a,Ki(f,r),s)}return a}var et=Fa;function Ga(r,e){var n=r.length;r.sort(e);while(n--)r[n]=r[n].value;return r}var tt=Ga;function Xa(r,e){if(r!==e){var n=r!==void 0,o=r===null,i=r===r,a=Kr(r),f=e!==void 0,s=e===null,u=e===e,d=Kr(e);if(!s&&!d&&!a&&r>e||a&&f&&u&&!s&&!d||o&&f&&u||!n&&u||!i)return 1;if(!o&&!a&&!d&&r<e||d&&n&&i&&!o&&!a||s&&n&&i||!f&&i||!u)return-1}return 0}var nt=Xa;function Ua(r,e,n){var o=-1,i=r.criteria,a=e.criteria,f=i.length,s=n.length;while(++o<f){var u=nt(i[o],a[o]);if(u){if(o>=s)return u;var d=n[o];return u*(d=="desc"?-1:1)}}return r.index-e.index}var ot=Ua;function Va(r,e,n){if(e.length)e=ko(e,function(a){if(we(a))return function(f){return Vi(f,a.length===1?a[0]:a)};return a});else e=[Sr];var o=-1;e=ko(e,qi(tr));var i=hr(r,function(a,f,s){var u=ko(e,function(d){return d(a)});return{criteria:u,index:++o,value:a}});return tt(i,function(a,f){return ot(a,f,n)})}var it=Va;var Ya=qp("length"),at=Ya;var st="\\ud800-\\udfff",za="\\u0300-\\u036f",Wa="\\ufe20-\\ufe2f",qa="\\u20d0-\\u20ff",Ha=za+Wa+qa,Ka="\\ufe0e\\ufe0f",Za="["+st+"]",Er="["+Ha+"]",xr="\\ud83c[\\udffb-\\udfff]",$a="(?:"+Er+"|"+xr+")",ut="[^"+st+"]",dt="(?:\\ud83c[\\udde6-\\uddff]){2}",ct="[\\ud800-\\udbff][\\udc00-\\udfff]",Qa="\\u200d",pt=$a+"?",lt="["+Ka+"]?",rf="(?:"+Qa+"(?:"+[ut,dt,ct].join("|")+")"+lt+pt+")*",ef=lt+pt+rf,tf="(?:"+[ut+Er+"?",Er,dt,ct,Za].join("|")+")",ft=RegExp(xr+"(?="+xr+")|"+tf+ef,"g");function nf(r){var e=ft.lastIndex=0;while(ft.test(r))++e;return e}var mt=nf;function of(r){return de(r)?mt(r):at(r)}var ht=of;function af(r,e){return et(r,e,function(n,o){return Hp(r,o)})}var gt=af;var ff=fe(function(r,e){return r==null?{}:gt(r,e)}),K=ff;var{ceil:sf,max:uf}=Math;function df(r,e,n,o){var i=-1,a=uf(sf((e-r)/(n||1)),0),f=Array(a);while(a--)f[o?a:++i]=r,r+=n;return f}var vt=df;function cf(r){return function(e,n,o){if(o&&typeof o!="number"&&T(e,n,o))n=o=void 0;if(e=U(e),n===void 0)n=e,e=0;else n=U(n);return o=o===void 0?e<n?1:-1:U(o),vt(e,n,o,r)}}var bt=cf;var pf=bt(),N=pf;var lf="[object Map]",mf="[object Set]";function hf(r){if(r==null)return 0;if(Ln(r))return Qe(r)?ht(r):r.length;var e=Vr(r);if(e==lf||e==mf)return r.size;return tc(r).length}var yt=hf;var gf=ji(function(r,e){if(r==null)return[];var n=e.length;if(n>1&&T(r,e[0],e[1]))e=[];else if(n>2&&T(e[0],e[1],e[2]))e=[e[0]];return it(r,rc(e,1),[])}),C=gf;var vf=0;function bf(r){var e=++vf;return zp(r)+e}var J=bf;function yf(r,e,n){var o=-1,i=r.length,a=e.length,f={};while(++o<i){var s=o<a?e[o]:void 0;n(f,r[o],s)}return f}var wt=yf;function wf(r,e){return wt(r||[],e||[],M)}var Or=wf;class Lr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,e=r._prev;if(e!==r)return _t(e),e}enqueue(r){var e=this._sentinel;if(r._prev&&r._next)_t(r);r._next=e._next,e._next._prev=r,e._next=r,r._prev=e}toString(){var r=[],e=this._sentinel,n=e._prev;while(n!==e)r.push(JSON.stringify(n,_f)),n=n._prev;return"["+r.join(", ")+"]"}}function _t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function _f(r,e){if(r!=="_next"&&r!=="_prev")return e}var Ef=Tr(1);function Et(r,e){if(r.nodeCount()<=1)return[];var n=Of(r,e||Ef),o=xf(n.graph,n.buckets,n.zeroIdx);return S(E(o,function(i){return r.outEdges(i.v,i.w)}))}function xf(r,e,n){var o=[],i=e[e.length-1],a=e[0],f;while(r.nodeCount()){while(f=a.dequeue())Ir(r,e,n,f);while(f=i.dequeue())Ir(r,e,n,f);if(r.nodeCount()){for(var s=e.length-2;s>0;--s)if(f=e[s].dequeue(),f){o=o.concat(Ir(r,e,n,f,!0));break}}}return o}function Ir(r,e,n,o,i){var a=i?[]:void 0;return v(r.inEdges(o.v),function(f){var s=r.edge(f),u=r.node(f.v);if(i)a.push({v:f.v,w:f.w});u.out-=s,Nr(e,n,u)}),v(r.outEdges(o.v),function(f){var s=r.edge(f),u=f.w,d=r.node(u);d.in-=s,Nr(e,n,d)}),r.removeNode(o.v),a}function Of(r,e){var n=new Xe,o=0,i=0;v(r.nodes(),function(s){n.setNode(s,{v:s,in:0,out:0})}),v(r.edges(),function(s){var u=n.edge(s.v,s.w)||0,d=e(s),c=u+d;n.setEdge(s.v,s.w,c),i=Math.max(i,n.node(s.v).out+=d),o=Math.max(o,n.node(s.w).in+=d)});var a=N(i+o+3).map(function(){return new Lr}),f=o+1;return v(n.nodes(),function(s){Nr(a,f,n.node(s))}),{graph:n,buckets:a,zeroIdx:f}}function Nr(r,e,n){if(!n.out)r[0].enqueue(n);else if(!n.in)r[r.length-1].enqueue(n);else r[n.out-n.in+e].enqueue(n)}function xt(r){var e=r.graph().acyclicer==="greedy"?Et(r,n(r)):Lf(r);v(e,function(o){var i=r.edge(o);r.removeEdge(o),i.forwardName=o.name,i.reversed=!0,r.setEdge(o.w,o.v,i,J("rev"))});function n(o){return function(i){return o.edge(i).weight}}}function Lf(r){var e=[],n={},o={};function i(a){if(Object.prototype.hasOwnProperty.call(o,a))return;o[a]=!0,n[a]=!0,v(r.outEdges(a),function(f){if(Object.prototype.hasOwnProperty.call(n,f.w))e.push(f);else i(f.w)}),delete n[a]}return v(r.nodes(),i),e}function Ot(r){v(r.edges(),function(e){var n=r.edge(e);if(n.reversed){r.removeEdge(e);var o=n.forwardName;delete n.reversed,delete n.forwardName,r.setEdge(e.w,e.v,n,o)}})}function k(r,e,n,o){var i;do i=J(o);while(r.hasNode(i));return n.dummy=e,r.setNode(i,n),i}function It(r){var e=new Xe().setGraph(r.graph());return v(r.nodes(),function(n){e.setNode(n,r.node(n))}),v(r.edges(),function(n){var o=e.edge(n.v,n.w)||{weight:0,minlen:1},i=r.edge(n);e.setEdge(n.v,n.w,{weight:o.weight+i.weight,minlen:Math.max(o.minlen,i.minlen)})}),e}function br(r){var e=new Xe({multigraph:r.isMultigraph()}).setGraph(r.graph());return v(r.nodes(),function(n){if(!r.children(n).length)e.setNode(n,r.node(n))}),v(r.edges(),function(n){e.setEdge(n,r.edge(n))}),e}function Pr(r,e){var{x:n,y:o}=r,i=e.x-n,a=e.y-o,f=r.width/2,s=r.height/2;if(!i&&!a)throw Error("Not possible to find intersection inside of the rectangle");var u,d;if(Math.abs(a)*f>Math.abs(i)*s){if(a<0)s=-s;u=s*i/a,d=s}else{if(i<0)f=-f;u=f,d=f*a/i}return{x:n+u,y:o+d}}function B(r){var e=E(N(Cr(r)+1),function(){return[]});return v(r.nodes(),function(n){var o=r.node(n),i=o.rank;if(!Yt(i))e[i][o.order]=n}),e}function St(r){var e=j(E(r.nodes(),function(n){return r.node(n).rank}));v(r.nodes(),function(n){var o=r.node(n);if(gr(o,"rank"))o.rank-=e})}function Nt(r){var e=j(E(r.nodes(),function(a){return r.node(a).rank})),n=[];v(r.nodes(),function(a){var f=r.node(a).rank-e;if(!n[f])n[f]=[];n[f].push(a)});var o=0,i=r.graph().nodeRankFactor;v(n,function(a,f){if(Yt(a)&&f%i!==0)--o;else if(o)v(a,function(s){r.node(s).rank+=o})})}function kr(r,e,n,o){var i={width:0,height:0};if(arguments.length>=4)i.rank=n,i.order=o;return k(r,"border",i,e)}function Cr(r){return I(E(r.nodes(),function(e){var n=r.node(e).rank;if(!Yt(n))return n}))}function Pt(r,e){var n={lhs:[],rhs:[]};return v(r,function(o){if(e(o))n.lhs.push(o);else n.rhs.push(o)}),n}function kt(r,e){var n=_r();try{return e()}finally{console.log(r+" time: "+(_r()-n)+"ms")}}function Tt(r,e){return e()}function At(r){function e(n){var o=r.children(n),i=r.node(n);if(o.length)v(o,e);if(Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,f=i.maxRank+1;a<f;++a)Ct(r,"borderLeft","_bl",n,i,a),Ct(r,"borderRight","_br",n,i,a)}}v(r.children(),e)}function Ct(r,e,n,o,i,a){var f={width:0,height:0,rank:a,borderType:e},s=i[e][a-1],u=k(r,"border",f,n);if(i[e][a]=u,r.setParent(u,o),s)r.setEdge(s,u,{weight:1})}function Mt(r){var e=r.graph().rankdir.toLowerCase();if(e==="lr"||e==="rl")Bt(r)}function jt(r){var e=r.graph().rankdir.toLowerCase();if(e==="bt"||e==="rl")If(r);if(e==="lr"||e==="rl")Sf(r),Bt(r)}function Bt(r){v(r.nodes(),function(e){Rt(r.node(e))}),v(r.edges(),function(e){Rt(r.edge(e))})}function Rt(r){var e=r.width;r.width=r.height,r.height=e}function If(r){v(r.nodes(),function(e){Ar(r.node(e))}),v(r.edges(),function(e){var n=r.edge(e);if(v(n.points,Ar),Object.prototype.hasOwnProperty.call(n,"y"))Ar(n)})}function Ar(r){r.y=-r.y}function Sf(r){v(r.nodes(),function(e){Rr(r.node(e))}),v(r.edges(),function(e){var n=r.edge(e);if(v(n.points,Rr),Object.prototype.hasOwnProperty.call(n,"x"))Rr(n)})}function Rr(r){var e=r.x;r.x=r.y,r.y=e}function Ft(r){r.graph().dummyChains=[],v(r.edges(),function(e){Pf(r,e)})}function Pf(r,e){var n=e.v,o=r.node(n).rank,i=e.w,a=r.node(i).rank,f=e.name,s=r.edge(e),u=s.labelRank;if(a===o+1)return;r.removeEdge(e);var d=void 0,c,p;for(p=0,++o;o<a;++p,++o){if(s.points=[],d={width:0,height:0,edgeLabel:s,edgeObj:e,rank:o},c=k(r,"edge",d,"_d"),o===u)d.width=s.width,d.height=s.height,d.dummy="edge-label",d.labelpos=s.labelpos;if(r.setEdge(n,c,{weight:s.weight},f),p===0)r.graph().dummyChains.push(c);n=c}r.setEdge(n,i,{weight:s.weight},f)}function Gt(r){v(r.graph().dummyChains,function(e){var n=r.node(e),o=n.edgeLabel,i;r.setEdge(n.edgeObj,o);while(n.dummy){if(i=r.successors(e)[0],r.removeNode(e),o.points.push({x:n.x,y:n.y}),n.dummy==="edge-label")o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height;e=i,n=r.node(e)}})}function or(r){var e={};function n(o){var i=r.node(o);if(Object.prototype.hasOwnProperty.call(e,o))return i.rank;e[o]=!0;var a=j(E(r.outEdges(o),function(f){return n(f.w)-r.edge(f).minlen}));if(a===Number.POSITIVE_INFINITY||a===void 0||a===null)a=0;return i.rank=a}v(r.sources(),n)}function X(r,e){return r.node(e.w).rank-r.node(e.v).rank-r.edge(e).minlen}function yr(r){var e=new Xe({directed:!1}),n=r.nodes()[0],o=r.nodeCount();e.setNode(n,{});var i,a;while(kf(e,r)<o)i=Tf(e,r),a=e.hasNode(i.v)?X(r,i):-X(r,i),Cf(e,r,a);return e}function kf(r,e){function n(o){v(e.nodeEdges(o),function(i){var a=i.v,f=o===a?i.w:a;if(!r.hasNode(f)&&!X(e,i))r.setNode(f,{}),r.setEdge(o,f,{}),n(f)})}return v(r.nodes(),n),r.nodeCount()}function Tf(r,e){return H(e.edges(),function(n){if(r.hasNode(n.v)!==r.hasNode(n.w))return X(e,n)})}function Cf(r,e,n){v(r.nodes(),function(o){e.node(o).rank+=n})}var sh=Tr(1);var gh=Tr(1);Mr.CycleException=ir;function Mr(r){var e={},n={},o=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new ir;if(!Object.prototype.hasOwnProperty.call(e,a))n[a]=!0,e[a]=!0,v(r.predecessors(a),i),delete n[a],o.push(a)}if(v(r.sinks(),i),yt(e)!==r.nodeCount())throw new ir;return o}function ir(){}ir.prototype=Error();function wr(r,e,n){if(!we(e))e=[e];var o=(r.isDirected()?r.successors:r.neighbors).bind(r),i=[],a={};return v(e,function(f){if(!r.hasNode(f))throw Error("Graph does not have node: "+f);Ut(r,f,n==="post",a,o,i)}),i}function Ut(r,e,n,o,i,a){if(!Object.prototype.hasOwnProperty.call(o,e)){if(o[e]=!0,!n)a.push(e);if(v(i(e),function(f){Ut(r,f,n,o,i,a)}),n)a.push(e)}}function jr(r,e){return wr(r,e,"post")}function Br(r,e){return wr(r,e,"pre")}F.initLowLimValues=Fr;F.initCutValues=Dr;F.calcCutValue=Wt;F.leaveEdge=Ht;F.enterEdge=Jt;F.exchangeEdges=Zt;function F(r){r=It(r),or(r);var e=yr(r);Fr(e),Dr(e,r);var n,o;while(n=Ht(e))o=Jt(e,r,n),Zt(e,r,n,o)}function Dr(r,e){var n=jr(r,r.nodes());n=n.slice(0,n.length-1),v(n,function(o){Bf(r,e,o)})}function Bf(r,e,n){var o=r.node(n),i=o.parent;r.edge(n,i).cutvalue=Wt(r,e,n)}function Wt(r,e,n){var o=r.node(n),i=o.parent,a=!0,f=e.edge(n,i),s=0;if(!f)a=!1,f=e.edge(i,n);return s=f.weight,v(e.nodeEdges(n),function(u){var d=u.v===n,c=d?u.w:u.v;if(c!==i){var p=d===a,h=e.edge(u).weight;if(s+=p?h:-h,Ff(r,n,c)){var b=r.edge(n,c).cutvalue;s+=p?-b:b}}}),s}function Fr(r,e){if(arguments.length<2)e=r.nodes()[0];qt(r,{},1,e)}function qt(r,e,n,o,i){var a=n,f=r.node(o);if(e[o]=!0,v(r.neighbors(o),function(s){if(!Object.prototype.hasOwnProperty.call(e,s))n=qt(r,e,n,s,o)}),f.low=a,f.lim=n++,i)f.parent=i;else delete f.parent;return n}function Ht(r){return er(r.edges(),function(e){return r.edge(e).cutvalue<0})}function Jt(r,e,n){var{v:o,w:i}=n;if(!e.hasEdge(o,i))o=n.w,i=n.v;var a=r.node(o),f=r.node(i),s=a,u=!1;if(a.lim>f.lim)s=f,u=!0;var d=fr(e.edges(),function(c){return u===zt(r,r.node(c.v),s)&&u!==zt(r,r.node(c.w),s)});return H(d,function(c){return X(e,c)})}function Zt(r,e,n,o){var{v:i,w:a}=n;r.removeEdge(i,a),r.setEdge(o.v,o.w,{}),Fr(r),Dr(r,e),Df(r,e)}function Df(r,e){var n=er(r.nodes(),function(i){return!e.node(i).parent}),o=Br(r,n);o=o.slice(1),v(o,function(i){var a=r.node(i).parent,f=e.edge(i,a),s=!1;if(!f)f=e.edge(a,i),s=!0;e.node(i).rank=e.node(a).rank+(s?f.minlen:-f.minlen)})}function Ff(r,e,n){return r.hasEdge(e,n)}function zt(r,e,n){return n.low<=e.lim&&e.lim<=n.lim}function Gr(r){switch(r.graph().ranker){case"network-simplex":$t(r);break;case"tight-tree":Xf(r);break;case"longest-path":Gf(r);break;default:$t(r)}}var Gf=or;function Xf(r){or(r),yr(r)}function $t(r){F(r)}function Qt(r){var e=k(r,"root",{},"_root"),n=Uf(r),o=I(Yr(n))-1,i=2*o+1;r.graph().nestingRoot=e,v(r.edges(),function(f){r.edge(f).minlen*=i});var a=Vf(r)+1;v(r.children(),function(f){rn(r,e,i,a,o,n,f)}),r.graph().nodeRankFactor=i}function rn(r,e,n,o,i,a,f){var s=r.children(f);if(!s.length){if(f!==e)r.setEdge(e,f,{weight:0,minlen:n});return}var u=kr(r,"_bt"),d=kr(r,"_bb"),c=r.node(f);if(r.setParent(u,f),c.borderTop=u,r.setParent(d,f),c.borderBottom=d,v(s,function(p){rn(r,e,n,o,i,a,p);var h=r.node(p),b=h.borderTop?h.borderTop:p,w=h.borderBottom?h.borderBottom:p,y=h.borderTop?o:2*o,g=b!==w?1:i-a[f]+1;r.setEdge(u,b,{weight:y,minlen:g,nestingEdge:!0}),r.setEdge(w,d,{weight:y,minlen:g,nestingEdge:!0})}),!r.parent(f))r.setEdge(e,u,{weight:0,minlen:i+a[f]})}function Uf(r){var e={};function n(o,i){var a=r.children(o);if(a&&a.length)v(a,function(f){n(f,i+1)});e[o]=i}return v(r.children(),function(o){n(o,1)}),e}function Vf(r){return Bo(r.edges(),function(e,n){return e+r.edge(n).weight},0)}function en(r){var e=r.graph();r.removeNode(e.nestingRoot),delete e.nestingRoot,v(r.edges(),function(n){var o=r.edge(n);if(o.nestingEdge)r.removeEdge(n)})}function tn(r,e,n){var o={},i;v(n,function(a){var f=r.parent(a),s,u;while(f){if(s=r.parent(f),s)u=o[s],o[s]=f;else u=i,i=f;if(u&&u!==f){e.setEdge(u,f);return}f=s}})}function nn(r,e,n){var o=zf(r),i=new Xe({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(a){return r.node(a)});return v(r.nodes(),function(a){var f=r.node(a),s=r.parent(a);if(f.rank===e||f.minRank<=e&&e<=f.maxRank){if(i.setNode(a),i.setParent(a,s||o),v(r[n](a),function(u){var d=u.v===a?u.w:u.v,c=i.edge(d,a),p=!Yt(c)?c.weight:0;i.setEdge(d,a,{weight:r.edge(u).weight+p})}),Object.prototype.hasOwnProperty.call(f,"minRank"))i.setNode(a,{borderLeft:f.borderLeft[e],borderRight:f.borderRight[e]})}}),i}function zf(r){var e;while(r.hasNode(e=J("_root")));return e}function on(r,e){var n=0;for(var o=1;o<e.length;++o)n+=Wf(r,e[o-1],e[o]);return n}function Wf(r,e,n){var o=Or(n,E(n,function(d,c){return c})),i=S(E(e,function(d){return C(E(r.outEdges(d),function(c){return{pos:o[c.w],weight:r.edge(c).weight}}),"pos")})),a=1;while(a<n.length)a<<=1;var f=2*a-1;a-=1;var s=E(Array(f),function(){return 0}),u=0;return v(i.forEach(function(d){var c=d.pos+a;s[c]+=d.weight;var p=0;while(c>0){if(c%2)p+=s[c+1];c=c-1>>1,s[c]+=d.weight}u+=d.weight*p})),u}function an(r){var e={},n=fr(r.nodes(),function(s){return!r.children(s).length}),o=I(E(n,function(s){return r.node(s).rank})),i=E(N(o+1),function(){return[]});function a(s){if(gr(e,s))return;e[s]=!0;var u=r.node(s);i[u.rank].push(s),v(r.successors(s),a)}var f=C(n,function(s){return r.node(s).rank});return v(f,a),i}function fn(r,e){return E(e,function(n){var o=r.inEdges(n);if(!o.length)return{v:n};else{var i=Bo(o,function(a,f){var s=r.edge(f),u=r.node(f.v);return{sum:a.sum+s.weight*u.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:i.sum/i.weight,weight:i.weight}}})}function sn(r,e){var n={};v(r,function(i,a){var f=n[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};if(!Yt(i.barycenter))f.barycenter=i.barycenter,f.weight=i.weight}),v(e.edges(),function(i){var a=n[i.v],f=n[i.w];if(!Yt(a)&&!Yt(f))f.indegree++,a.out.push(n[i.w])});var o=fr(n,function(i){return!i.indegree});return qf(o)}function qf(r){var e=[];function n(a){return function(f){if(f.merged)return;if(Yt(f.barycenter)||Yt(a.barycenter)||f.barycenter>=a.barycenter)Hf(a,f)}}function o(a){return function(f){if(f.in.push(a),--f.indegree===0)r.push(f)}}while(r.length){var i=r.pop();e.push(i),v(i.in.reverse(),n(i)),v(i.out,o(i))}return E(fr(e,function(a){return!a.merged}),function(a){return K(a,["vs","i","barycenter","weight"])})}function Hf(r,e){var n=0,o=0;if(r.weight)n+=r.barycenter*r.weight,o+=r.weight;if(e.weight)n+=e.barycenter*e.weight,o+=e.weight;r.vs=e.vs.concat(r.vs),r.barycenter=n/o,r.weight=o,r.i=Math.min(e.i,r.i),e.merged=!0}function dn(r,e){var n=Pt(r,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),o=n.lhs,i=C(n.rhs,function(c){return-c.i}),a=[],f=0,s=0,u=0;o.sort(Kf(!!e)),u=un(a,i,u),v(o,function(c){u+=c.vs.length,a.push(c.vs),f+=c.barycenter*c.weight,s+=c.weight,u=un(a,i,u)});var d={vs:S(a)};if(s)d.barycenter=f/s,d.weight=s;return d}function un(r,e,n){var o;while(e.length&&(o=G(e)).i<=n)e.pop(),r.push(o.vs),n++;return n}function Kf(r){return function(e,n){if(e.barycenter<n.barycenter)return-1;else if(e.barycenter>n.barycenter)return 1;return!r?e.i-n.i:n.i-e.i}}function Xr(r,e,n,o){var i=r.children(e),a=r.node(e),f=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,u={};if(f)i=fr(i,function(w){return w!==f&&w!==s});var d=fn(r,i);v(d,function(w){if(r.children(w.v).length){var y=Xr(r,w.v,n,o);if(u[w.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter"))Zf(w,y)}});var c=sn(d,n);Jf(c,u);var p=dn(c,o);if(f){if(p.vs=S([f,p.vs,s]),r.predecessors(f).length){var h=r.node(r.predecessors(f)[0]),b=r.node(r.predecessors(s)[0]);if(!Object.prototype.hasOwnProperty.call(p,"barycenter"))p.barycenter=0,p.weight=0;p.barycenter=(p.barycenter*p.weight+h.order+b.order)/(p.weight+2),p.weight+=2}}return p}function Jf(r,e){v(r,function(n){n.vs=S(n.vs.map(function(o){if(e[o])return e[o].vs;return o}))})}function Zf(r,e){if(!Yt(r.barycenter))r.barycenter=(r.barycenter*r.weight+e.barycenter*e.weight)/(r.weight+e.weight),r.weight+=e.weight;else r.barycenter=e.barycenter,r.weight=e.weight}function mn(r){var e=Cr(r),n=pn(r,N(1,e+1),"inEdges"),o=pn(r,N(e-1,-1,-1),"outEdges"),i=an(r);ln(r,i);var a=Number.POSITIVE_INFINITY,f;for(var s=0,u=0;u<4;++s,++u){$f(s%2?n:o,s%4>=2),i=B(r);var d=on(r,i);if(d<a)u=0,f=Fe(i),a=d}ln(r,f)}function pn(r,e,n){return E(e,function(o){return nn(r,o,n)})}function $f(r,e){var n=new Xe;v(r,function(o){var i=o.graph().root,a=Xr(o,i,n,e);v(a.vs,function(f,s){o.node(f).order=s}),tn(o,n,a.vs)})}function ln(r,e){v(e,function(n){v(n,function(o,i){r.node(o).order=i})})}function hn(r){var e=rs(r);v(r.graph().dummyChains,function(n){var o=r.node(n),i=o.edgeObj,a=Qf(r,e,i.v,i.w),{path:f,lca:s}=a,u=0,d=f[u],c=!0;while(n!==i.w){if(o=r.node(n),c){while((d=f[u])!==s&&r.node(d).maxRank<o.rank)u++;if(d===s)c=!1}if(!c){while(u<f.length-1&&r.node(d=f[u+1]).minRank<=o.rank)u++;d=f[u]}r.setParent(n,d),n=r.successors(n)[0]}})}function Qf(r,e,n,o){var i=[],a=[],f=Math.min(e[n].low,e[o].low),s=Math.max(e[n].lim,e[o].lim),u,d;u=n;do u=r.parent(u),i.push(u);while(u&&(e[u].low>f||s>e[u].lim));d=u,u=o;while((u=r.parent(u))!==d)a.push(u);return{path:i.concat(a.reverse()),lca:d}}function rs(r){var e={},n=0;function o(i){var a=n;v(r.children(i),o),e[i]={low:a,lim:n++}}return v(r.children(),o),e}function es(r,e){var n={};function o(i,a){var f=0,s=0,u=i.length,d=G(a);return v(a,function(c,p){var h=ns(r,c),b=h?r.node(h).order:u;if(h||c===d)v(a.slice(s,p+1),function(w){v(r.predecessors(w),function(y){var g=r.node(y),_=g.order;if((_<f||b<_)&&!(g.dummy&&r.node(w).dummy))gn(n,y,w)})}),s=p+1,f=b}),a}return Bo(e,o),n}function ts(r,e){var n={};function o(a,f,s,u,d){var c;v(N(f,s),function(p){if(c=a[p],r.node(c).dummy)v(r.predecessors(c),function(h){var b=r.node(h);if(b.dummy&&(b.order<u||b.order>d))gn(n,h,c)})})}function i(a,f){var s=-1,u,d=0;return v(f,function(c,p){if(r.node(c).dummy==="border"){var h=r.predecessors(c);if(h.length)u=r.node(h[0]).order,o(f,d,p,s,u),d=p,s=u}o(f,d,f.length,u,a.length)}),f}return Bo(e,i),n}function ns(r,e){if(r.node(e).dummy)return er(r.predecessors(e),function(n){return r.node(n).dummy})}function gn(r,e,n){if(e>n){var o=e;e=n,n=o}if(!Object.prototype.hasOwnProperty.call(r,e))Object.defineProperty(r,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=r[e];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function os(r,e,n){if(e>n){var o=e;e=n,n=o}return!!r[e]&&Object.prototype.hasOwnProperty.call(r[e],n)}function is(r,e,n,o){var i={},a={},f={};return v(e,function(s){v(s,function(u,d){i[u]=u,a[u]=u,f[u]=d})}),v(e,function(s){var u=-1;v(s,function(d){var c=o(d);if(c.length){c=C(c,function(y){return f[y]});var p=(c.length-1)/2;for(var h=Math.floor(p),b=Math.ceil(p);h<=b;++h){var w=c[h];if(a[d]===d&&u<f[w]&&!os(n,d,w))a[w]=d,a[d]=i[d]=i[w],u=f[w]}}})}),{root:i,align:a}}function as(r,e,n,o,i){var a={},f=fs(r,e,n,i),s=i?"borderLeft":"borderRight";function u(p,h){var b=f.nodes(),w=b.pop(),y={};while(w){if(y[w])p(w);else y[w]=!0,b.push(w),b=b.concat(h(w));w=b.pop()}}function d(p){a[p]=f.inEdges(p).reduce(function(h,b){return Math.max(h,a[b.v]+f.edge(b))},0)}function c(p){var h=f.outEdges(p).reduce(function(w,y){return Math.min(w,a[y.w]-f.edge(y))},Number.POSITIVE_INFINITY),b=r.node(p);if(h!==Number.POSITIVE_INFINITY&&b.borderType!==s)a[p]=Math.max(a[p],h)}return u(d,f.predecessors.bind(f)),u(c,f.successors.bind(f)),v(o,function(p){a[p]=a[n[p]]}),a}function fs(r,e,n,o){var i=new Xe,a=r.graph(),f=cs(a.nodesep,a.edgesep,o);return v(e,function(s){var u;v(s,function(d){var c=n[d];if(i.setNode(c),u){var p=n[u],h=i.edge(p,c);i.setEdge(p,c,Math.max(f(r,d,u),h||0))}u=d})}),i}function ss(r,e){return H(Yr(e),function(n){var{NEGATIVE_INFINITY:o,POSITIVE_INFINITY:i}=Number;return Ke(n,function(a,f){var s=ps(r,f)/2;o=Math.max(a+s,o),i=Math.min(a-s,i)}),o-i})}function us(r,e){var n=Yr(e),o=j(n),i=I(n);v(["u","d"],function(a){v(["l","r"],function(f){var s=a+f,u=r[s],d;if(u===e)return;var c=Yr(u);if(d=f==="l"?o-j(c):i-I(c),d)r[s]=z(u,function(p){return p+d})})})}function ds(r,e){return z(r.ul,function(n,o){if(e)return r[e.toLowerCase()][o];else{var i=C(E(r,o));return(i[1]+i[2])/2}})}function vn(r){var e=B(r),n=nr(es(r,e),ts(r,e)),o={},i;v(["u","d"],function(f){i=f==="u"?e:Yr(e).reverse(),v(["l","r"],function(s){if(s==="r")i=E(i,function(p){return Yr(p).reverse()});var u=(f==="u"?r.predecessors:r.successors).bind(r),d=is(r,i,n,u),c=as(r,i,d.root,d.align,s==="r");if(s==="r")c=z(c,function(p){return-p});o[f+s]=c})});var a=ss(r,o);return us(o,a),ds(o,r.graph().align)}function cs(r,e,n){return function(o,i,a){var f=o.node(i),s=o.node(a),u=0,d;if(u+=f.width/2,Object.prototype.hasOwnProperty.call(f,"labelpos"))switch(f.labelpos.toLowerCase()){case"l":d=-f.width/2;break;case"r":d=f.width/2;break}if(d)u+=n?d:-d;if(d=0,u+=(f.dummy?e:r)/2,u+=(s.dummy?e:r)/2,u+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":d=s.width/2;break;case"r":d=-s.width/2;break}if(d)u+=n?d:-d;return d=0,u}}function ps(r,e){return r.node(e).width}function bn(r){r=br(r),ls(r),Je(vn(r),function(e,n){r.node(n).x=e})}function ls(r){var e=B(r),n=r.graph().ranksep,o=0;v(e,function(i){var a=I(E(i,function(f){return r.node(f).height}));v(i,function(f){r.node(f).y=o+a/2}),o+=a+n})}function Wr(r,e){var n=e&&e.debugTiming?kt:Tt;n("layout",()=>{var o=n(" buildLayoutGraph",()=>Os(r));n(" runLayout",()=>ms(o,n)),n(" updateInputGraph",()=>hs(r,o))})}function ms(r,e){e(" makeSpaceForEdgeLabels",()=>Ls(r)),e(" removeSelfEdges",()=>Rs(r)),e(" acyclic",()=>xt(r)),e(" nestingGraph.run",()=>Qt(r)),e(" rank",()=>Gr(br(r))),e(" injectEdgeLabelProxies",()=>Is(r)),e(" removeEmptyRanks",()=>Nt(r)),e(" nestingGraph.cleanup",()=>en(r)),e(" normalizeRanks",()=>St(r)),e(" assignRankMinMax",()=>Ss(r)),e(" removeEdgeLabelProxies",()=>Ns(r)),e(" normalize.run",()=>Ft(r)),e(" parentDummyChains",()=>hn(r)),e(" addBorderSegments",()=>At(r)),e(" order",()=>mn(r)),e(" insertSelfEdges",()=>Ms(r)),e(" adjustCoordinateSystem",()=>Mt(r)),e(" position",()=>bn(r)),e(" positionSelfEdges",()=>js(r)),e(" removeBorderNodes",()=>As(r)),e(" normalize.undo",()=>Gt(r)),e(" fixupEdgeLabelCoords",()=>Ts(r)),e(" undoCoordinateSystem",()=>jt(r)),e(" translateGraph",()=>Ps(r)),e(" assignNodeIntersects",()=>ks(r)),e(" reversePoints",()=>Cs(r)),e(" acyclic.undo",()=>Ot(r))}function hs(r,e){v(r.nodes(),function(n){var o=r.node(n),i=e.node(n);if(o){if(o.x=i.x,o.y=i.y,e.children(n).length)o.width=i.width,o.height=i.height}}),v(r.edges(),function(n){var o=r.edge(n),i=e.edge(n);if(o.points=i.points,Object.prototype.hasOwnProperty.call(i,"x"))o.x=i.x,o.y=i.y}),r.graph().width=e.graph().width,r.graph().height=e.graph().height}var gs=["nodesep","edgesep","ranksep","marginx","marginy"],vs={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},bs=["acyclicer","ranker","rankdir","align"],ys=["width","height"],ws={width:0,height:0},_s=["minlen","weight","width","height","labeloffset"],Es={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},xs=["labelpos"];function Os(r){var e=new Xe({multigraph:!0,compound:!0}),n=zr(r.graph());return e.setGraph(nr({},vs,Ur(n,gs),K(n,bs))),v(r.nodes(),function(o){var i=zr(r.node(o));e.setNode(o,Ue(Ur(i,ys),ws)),e.setParent(o,r.parent(o))}),v(r.edges(),function(o){var i=zr(r.edge(o));e.setEdge(o,nr({},Es,Ur(i,_s),K(i,xs)))}),e}function Ls(r){var e=r.graph();e.ranksep/=2,v(r.edges(),function(n){var o=r.edge(n);if(o.minlen*=2,o.labelpos.toLowerCase()!=="c")if(e.rankdir==="TB"||e.rankdir==="BT")o.width+=o.labeloffset;else o.height+=o.labeloffset})}function Is(r){v(r.edges(),function(e){var n=r.edge(e);if(n.width&&n.height){var o=r.node(e.v),i=r.node(e.w),a={rank:(i.rank-o.rank)/2+o.rank,e};k(r,"edge-proxy",a,"_ep")}})}function Ss(r){var e=0;v(r.nodes(),function(n){var o=r.node(n);if(o.borderTop)o.minRank=r.node(o.borderTop).rank,o.maxRank=r.node(o.borderBottom).rank,e=I(e,o.maxRank)}),r.graph().maxRank=e}function Ns(r){v(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="edge-proxy")r.edge(n.e).labelRank=n.rank,r.removeNode(e)})}function Ps(r){var e=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,i=0,a=r.graph(),f=a.marginx||0,s=a.marginy||0;function u(d){var{x:c,y:p,width:h,height:b}=d;e=Math.min(e,c-h/2),n=Math.max(n,c+h/2),o=Math.min(o,p-b/2),i=Math.max(i,p+b/2)}v(r.nodes(),function(d){u(r.node(d))}),v(r.edges(),function(d){var c=r.edge(d);if(Object.prototype.hasOwnProperty.call(c,"x"))u(c)}),e-=f,o-=s,v(r.nodes(),function(d){var c=r.node(d);c.x-=e,c.y-=o}),v(r.edges(),function(d){var c=r.edge(d);if(v(c.points,function(p){p.x-=e,p.y-=o}),Object.prototype.hasOwnProperty.call(c,"x"))c.x-=e;if(Object.prototype.hasOwnProperty.call(c,"y"))c.y-=o}),a.width=n-e+f,a.height=i-o+s}function ks(r){v(r.edges(),function(e){var n=r.edge(e),o=r.node(e.v),i=r.node(e.w),a,f;if(!n.points)n.points=[],a=i,f=o;else a=n.points[0],f=n.points[n.points.length-1];n.points.unshift(Pr(o,a)),n.points.push(Pr(i,f))})}function Ts(r){v(r.edges(),function(e){var n=r.edge(e);if(Object.prototype.hasOwnProperty.call(n,"x")){if(n.labelpos==="l"||n.labelpos==="r")n.width-=n.labeloffset;switch(n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}}})}function Cs(r){v(r.edges(),function(e){var n=r.edge(e);if(n.reversed)n.points.reverse()})}function As(r){v(r.nodes(),function(e){if(r.children(e).length){var n=r.node(e),o=r.node(n.borderTop),i=r.node(n.borderBottom),a=r.node(G(n.borderLeft)),f=r.node(G(n.borderRight));n.width=Math.abs(f.x-a.x),n.height=Math.abs(i.y-o.y),n.x=a.x+n.width/2,n.y=o.y+n.height/2}}),v(r.nodes(),function(e){if(r.node(e).dummy==="border")r.removeNode(e)})}function Rs(r){v(r.edges(),function(e){if(e.v===e.w){var n=r.node(e.v);if(!n.selfEdges)n.selfEdges=[];n.selfEdges.push({e,label:r.edge(e)}),r.removeEdge(e)}})}function Ms(r){var e=B(r);v(e,function(n){var o=0;v(n,function(i,a){var f=r.node(i);f.order=a+o,v(f.selfEdges,function(s){k(r,"selfedge",{width:s.label.width,height:s.label.height,rank:f.rank,order:a+ ++o,e:s.e,label:s.label},"_se")}),delete f.selfEdges})})}function js(r){v(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="selfedge"){var o=r.node(n.e.v),i=o.x+o.width/2,a=o.y,f=n.x-i,s=o.height/2;r.setEdge(n.e,n.label),r.removeNode(e),n.label.points=[{x:i+2*f/3,y:a-s},{x:i+5*f/6,y:a-s},{x:i+f,y:a},{x:i+5*f/6,y:a+s},{x:i+2*f/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Ur(r,e){return z(K(r,e),Number)}function zr(r){var e={};return v(r,function(n,o){e[o.toLowerCase()]=n}),e}var yn=t((r,e,n)=>Math.max(e,Math.min(n,r)),"clamp"),wn=t((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),Bs=t((r)=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),Ds=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Fs=t((r,e,n,o,i)=>{let a=[],f=new Set;if(n.forEach(({start:c,end:p})=>{if(c!==o)f.add(c);if(p!==o)f.add(p)}),f.forEach((c)=>{let p=r.node(c);if(typeof p?.x==="number"&&typeof p?.y==="number")a.push(p)}),a.length===0)n.forEach(({edge:c})=>{(c.points??[]).forEach((p)=>{if(typeof p?.x==="number"&&typeof p?.y==="number")a.push(p)})});if(a.length===0)return wn(i);let s=a.reduce((c,p)=>({x:c.x+p.x/a.length,y:c.y+p.y/a.length}),{x:0,y:0}),u=s.x-e.x,d=s.y-e.y;if(Math.abs(u)>Math.abs(d))return u>0?"right":"left";if(Math.abs(d)>0)return d>0?"bottom":"top";return wn(i)},"getSelfLoopSide"),Gs=t((r,e="top",n=0,o=0)=>{let i=r.x,a=r.y-n,f=r.width/2,s=r.height/2,u=Math.max(36,Math.min(100,r.width*0.8)),d=yn(Math.max(o,r.width*0.35),36,u),c=yn(Math.min(r.width,r.height)*0.45,24,48);switch(e){case"bottom":{let p=a+s;return[{x:i-d/2,y:p},{x:i-d/2,y:p+c},{x:i+d/2,y:p+c},{x:i+d/2,y:p}]}case"right":{let p=i+f;return[{x:p,y:a-d/2},{x:p+c,y:a-d/2},{x:p+c,y:a+d/2},{x:p,y:a+d/2}]}case"left":{let p=i-f;return[{x:p,y:a-d/2},{x:p-c,y:a-d/2},{x:p-c,y:a+d/2},{x:p,y:a+d/2}]}case"top":default:{let p=a-s;return[{x:i-d/2,y:p},{x:i-d/2,y:p-c},{x:i+d/2,y:p-c},{x:i+d/2,y:p}]}}},"getSelfLoopPoints"),Xs=t((r,e,n="top",o=0,i={})=>{let f=r.x,s=r.y-o,u=i.width??0,d=i.height??0;switch(n){case"bottom":return{x:f,y:Math.max(...e.map((c)=>c.y))+d/2+4};case"right":return{x:Math.max(...e.map((c)=>c.x))+u/2+4,y:s};case"left":return{x:Math.min(...e.map((c)=>c.x))-u/2-4,y:s};case"top":default:return{x:f,y:Math.min(...e.map((c)=>c.y))-d/2-4}}},"getSelfLoopLabelPosition"),En=t((r,e=0,{mergeSelfLoops:n=!0}={})=>{let o=new Map,i=[],a=r.graph()?.rankdir;return r.edges().forEach((f)=>{let s=r.edge(f);if(n&&s.selfLoop){let u=s.selfLoop.id;if(!o.has(u))o.set(u,[]);o.get(u).push({edge:s,start:f.v,end:f.w})}else i.push({edge:s,start:f.v,end:f.w})}),o.forEach((f)=>{if(f.length!==3){f.forEach((_)=>i.push(_));return}f.sort((_,A)=>_.edge.selfLoop.order-A.edge.selfLoop.order);let[s,u,d]=f,c=s.edge.originalEdge??u.edge.originalEdge??d.edge.originalEdge??u.edge,p=r.node(c.start);if(!p){f.forEach((_)=>i.push(_));return}let h={width:u.edge.width,height:u.edge.height},b=Fs(r,p,f,c.start,a),w=Gs(p,b,e,h.width??0),y=Xs(p,w,b,e,h),g={...u.edge,...c,id:c.id,points:w,start:c.start,end:c.end,x:y.x,y:y.y,width:h.width,height:h.height,labelStyle:u.edge.labelStyle,fromCluster:s.edge.fromCluster??u.edge.fromCluster??d.edge.fromCluster,toCluster:s.edge.toCluster??u.edge.toCluster??d.edge.toCluster};delete g.selfLoop,delete g.originalEdge,i.push({edge:g,start:g.start,end:g.end})}),i},"getEdgesToRender"),xn=t(async({element:r,graph:e,diagramType:n,id:o,parentCluster:i,siteConfig:a})=>{let f=e.graph().rankdir;l.trace("Dir in recursive render - dir:",f);let{clusters:s,edgePaths:u,edgeLabels:d,nodes:c,rootGroups:p}=Dp(r,{edgePathsClass:"edgePaths"});if(!e.nodes())l.info("No nodes found for",e);else l.info("Recursive render XXX",e.nodes());if(e.edges().length>0)l.info("Recursive edges",e.edge(e.edges()[0]));let h=Bs(n);await Promise.all(e.nodes().map(async function(y){let g=e.node(y);if(i!==void 0){let _=JSON.parse(JSON.stringify(i.clusterData));if(l.trace(`Setting data for parent cluster XXX
2
2
  Node.id = `,y,`
3
3
  data=`,_.height,`
4
- Parent cluster`,i.height),e.setNode(i.id,_),!e.parent(y))l.trace("Setting parent",y,i.id),e.setParent(y,i.id,_)}if(l.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),g?.clusterNode){l.info("Cluster identified XBX",y,g.width,e.node(y));let{ranksep:_,nodesep:A}=e.graph();g.graph.setGraph({...g.graph.graph(),ranksep:_+25,nodesep:A});let qr=await Ws({element:c,graph:g.graph,diagramType:n,id:o,parentCluster:e.node(y),siteConfig:a}),Hr=qr.elem;W(g,Hr),g.diff=qr.diff||0,l.info("New compound node after recursive render XAX",y,"width",g.width,"height",g.height),sh(Hr,g)}else if(e.children(y).length>0)l.trace("Cluster - the non recursive path XBX",y,g.id,g,g.width,"Graph:",e),l.trace(al(g.id,e)),ve.set(g.id,{id:al(g.id,e),node:g});else l.trace("Node - the non recursive path XAX",y,c,e.node(y),f),await Ip(c,e.node(y),{config:a,dir:f})})),await t(async()=>{let y=e.edges().map(async function(g){let _=e.edge(g.v,g.w,g.name);if(l.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(g)),l.info("Edge "+g.v+" -> "+g.w+": ",g," ",JSON.stringify(e.edge(g))),l.info("Fix",ve,"ids:",g.v,g.w,"Translating: ",ve.get(g.v),ve.get(g.w)),h&&_.selfLoop){if(_.selfLoop.order!==1)return;let A={..._.originalEdge,..._,id:_.selfLoop.id,startLabelLeft:_.originalEdge?.startLabelLeft??_.startLabelLeft,startLabelRight:_.originalEdge?.startLabelRight??_.startLabelRight,endLabelLeft:_.originalEdge?.endLabelLeft??_.endLabelLeft,endLabelRight:_.originalEdge?.endLabelRight??_.endLabelRight};await Ca(d,A),_.width=A.width,_.height=A.height,_.labelStyle=A.labelStyle;return}await Ca(d,_)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:w}=xa(a);return{elem:p,graph:e,groups:{clusters:s,edgePaths:u,edgeLabels:d,nodes:c,rootGroups:p},diagramType:n,id:o,mergeSelfLoops:h,subGraphTitleTotalMargin:w}},"measureDagreGraph"),On=t((r)=>{l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),Wr(r)},"runDagreGraphLayout"),Us=t((r,e,n)=>{let o=r.node(e);if(!o)return;let i={...o};if(o?.clusterNode)i.y=(o.y??0)+n;else if(r.children(e).length>0)i.height=(o.height??0)+n;else i.y=(o.y??0)+n/2;return i},"normalizeDagreNode"),_n=t((r,e)=>{Ds.forEach((n)=>{if(e[n]!==void 0)r[n]=e[n]})},"applyDagreNodeLayout"),Vs=t((r,e,n,o)=>({...r,start:r.start??e,end:r.end??n,points:(r.points??[]).map((i)=>({...i,y:typeof i.y==="number"?i.y+o:i.y}))}),"normalizeDagreEdge"),Ys=t((r,e)=>{let{graph:n,mergeSelfLoops:o,subGraphTitleTotalMargin:i=0}=e,a=new Map(r.nodes.map((s)=>[s.id,s]));_p(n).forEach((s)=>{let u=Us(n,s,i);if(!u)return;_n(n.node(s),u);let d=a.get(s);if(d)_n(d,u)});let f=i/2;return r.edges=En(n,f,{mergeSelfLoops:o}).map(({edge:s,start:u,end:d})=>Vs(s,u,d,f)),r},"applyDagreLayoutResult"),zs=t(async({elem:r,graph:e,groups:{clusters:n,edgePaths:o},diagramType:i,id:a,mergeSelfLoops:f,subGraphTitleTotalMargin:s})=>{let u=0;await Promise.all(_p(e).map(async function(p){let h=e.node(p);if(l.info("Position XBX => "+p+": ("+h.x,","+h.y,") width: ",h.width," height: ",h.height),h?.clusterNode)h.y+=s,l.info("A tainted cluster node XBX1",p,h.id,h.width,h.height,h.x,h.y,e.parent(p)),ve.get(h.id).node=h,na(h);else if(e.children(p).length>0){l.info("A pure cluster node XBX1",p,h.id,h.x,h.y,h.width,h.height,e.parent(p)),h.height+=s,e.node(h.parentId);let b=h?.padding/2||0,w=h?.labelBBox?.height||0,y=w-b||0;l.debug("OffsetY",y,"labelHeight",w,"halfPadding",b),await So(n,h),ve.get(h.id).node=h}else{let b=e.node(h.parentId);h.y+=s/2,l.info("A regular node XBX1 - using the padding",h.id,"parent",h.parentId,h.width,h.height,h.x,h.y,"offsetY",h.offsetY,"parent",b,b?.offsetY,h),na(h)}}));let d=s/2;return En(e,d,{mergeSelfLoops:f}).forEach(function({edge:p,start:h,end:b}){l.info("Edge "+h+" -> "+b+": "+JSON.stringify(p),p),p.points.forEach((_)=>_.y+=d);let w=e.node(h),y=e.node(b),g=To(o,p,ve,i,w,y,a);ul(p,g)}),e.nodes().forEach(function(p){let h=e.node(p);if(l.info(p,h.type,h.diff),h.isGroup)u=h.diff}),l.warn("Returning from recursive render XAX",r,u),{elem:r,diff:u}},"paintDagreLayoutCore"),Ws=t(async(r)=>{let e=await xn(r);return On(e.graph),await zs(e)},"renderDagreSubgraph"),In=t((r)=>{let e=new Je({multigraph:!0,compound:!0}).setGraph({rankdir:r.direction,nodesep:r.config?.nodeSpacing||r.nodeSpacing||r.config?.flowchart?.nodeSpacing,ranksep:r.config?.rankSpacing||r.rankSpacing||r.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return r.nodes.forEach((n)=>{if(e.setNode(n.id,{...n}),n.parentId)e.setParent(n.id,n.parentId)}),l.debug("Edges:",r.edges),r.edges.forEach((n)=>{if(n.start===n.end){let o=n.start,i=o+"---"+o+"---1",a=o+"---"+o+"---2",f=e.node(o);e.setNode(i,{domId:i,id:i,parentId:f.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(i,f.parentId),e.setNode(a,{domId:a,id:a,parentId:f.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(a,f.parentId);let s=structuredClone(n),u=structuredClone(n),d=structuredClone(n),c=structuredClone(n);if(u.originalEdge=s,u.selfLoop={id:s.id,order:0},d.originalEdge=s,d.selfLoop={id:s.id,order:1},c.originalEdge=s,c.selfLoop={id:s.id,order:2},u.label="",u.arrowTypeEnd="none",u.endLabelLeft="",u.endLabelRight="",u.startLabelLeft="",u.id=o+"-cyclic-special-1",d.startLabelRight="",d.startLabelLeft="",d.endLabelLeft="",d.endLabelRight="",d.arrowTypeStart="none",d.arrowTypeEnd="none",d.id=o+"-cyclic-special-mid",c.label="",c.startLabelRight="",c.startLabelLeft="",c.arrowTypeStart="none",f.isGroup)u.fromCluster=o,c.toCluster=o;c.id=o+"-cyclic-special-2",c.arrowTypeStart="none",e.setEdge(o,i,u,o+"-cyclic-special-0"),e.setEdge(i,a,d,o+"-cyclic-special-1"),e.setEdge(a,o,c,o+"-cyclic-special-2")}else e.setEdge(n.start,n.end,{...n},n.id)}),VA(e),{graph:e}},"prepareLayoutForDagre"),qs=t(async(r,{element:e,preparedLayout:n})=>{let o=n??In(r),i=m(),a=await xn({element:e,graph:o.graph,diagramType:r.type,id:r.diagramId,parentCluster:void 0,siteConfig:i});return o.measuredLayout=a,a},"measureDagreLayout"),Hs=t((r,e)=>{let n=e.preparedLayout?.measuredLayout;if(!n)throw Error("runDagreLayoutCore requires measureDagreLayout to run first");return On(n.graph),Ys(r,n),n},"runDagreLayoutCore"),Ks=t((r,{measure:e})=>_p(e.graph).map((n)=>e.graph.node(n)).filter(Boolean),"getDagrePaintNodes"),Js=t((r,e,{measure:n})=>r?n.graph.node(r):void 0,"getDagreEdgeNode"),Hg=oi({prepareLayout:In,measureLayout:qs,runLayoutCore:Hs,paintOptions:{clusterDb:ve,getNodes:Ks,getEdgeNode:Js,skipNode:t((r,{measure:e})=>!e.graph.hasNode(r.id),"skipNode"),isCluster:t((r,{measure:e})=>e.graph.hasNode(r.id)&&(e.graph.children(r.id)??[]).length>0,"isCluster")}});export{Ys as applyDagreLayoutResult,En as getEdgesToRender,qs as measureDagreLayout,In as prepareLayoutForDagre,Hg as render,Hs as runDagreLayoutCore};
4
+ Parent cluster`,i.height),e.setNode(i.id,_),!e.parent(y))l.trace("Setting parent",y,i.id),e.setParent(y,i.id,_)}if(l.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),g?.clusterNode){l.info("Cluster identified XBX",y,g.width,e.node(y));let{ranksep:_,nodesep:A}=e.graph();g.graph.setGraph({...g.graph.graph(),ranksep:_+25,nodesep:A});let qr=await Ws({element:c,graph:g.graph,diagramType:n,id:o,parentCluster:e.node(y),siteConfig:a}),Hr=qr.elem;W(g,Hr),g.diff=qr.diff||0,l.info("New compound node after recursive render XAX",y,"width",g.width,"height",g.height),hh(Hr,g)}else if(e.children(y).length>0)l.trace("Cluster - the non recursive path XBX",y,g.id,g,g.width,"Graph:",e),l.trace(ol(g.id,e)),ye.set(g.id,{id:ol(g.id,e),node:g});else l.trace("Node - the non recursive path XAX",y,c,e.node(y),f),await Np(c,e.node(y),{config:a,dir:f})})),await t(async()=>{let y=e.edges().map(async function(g){let _=e.edge(g.v,g.w,g.name);if(l.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(g)),l.info("Edge "+g.v+" -> "+g.w+": ",g," ",JSON.stringify(e.edge(g))),l.info("Fix",ye,"ids:",g.v,g.w,"Translating: ",ye.get(g.v),ye.get(g.w)),h&&_.selfLoop){if(_.selfLoop.order!==1)return;let A={..._.originalEdge,..._,id:_.selfLoop.id,startLabelLeft:_.originalEdge?.startLabelLeft??_.startLabelLeft,startLabelRight:_.originalEdge?.startLabelRight??_.startLabelRight,endLabelLeft:_.originalEdge?.endLabelLeft??_.endLabelLeft,endLabelRight:_.originalEdge?.endLabelRight??_.endLabelRight};await Ca(d,A),_.width=A.width,_.height=A.height,_.labelStyle=A.labelStyle;return}await Ca(d,_)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:w}=xa(a);return{elem:p,graph:e,groups:{clusters:s,edgePaths:u,edgeLabels:d,nodes:c,rootGroups:p},diagramType:n,id:o,mergeSelfLoops:h,subGraphTitleTotalMargin:w}},"measureDagreGraph"),On=t((r)=>{l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),Wr(r)},"runDagreGraphLayout"),Us=t((r,e,n)=>{let o=r.node(e);if(!o)return;let i={...o};if(o?.clusterNode)i.y=(o.y??0)+n;else if(r.children(e).length>0)i.height=(o.height??0)+n;else i.y=(o.y??0)+n/2;return i},"normalizeDagreNode"),_n=t((r,e)=>{Ds.forEach((n)=>{if(e[n]!==void 0)r[n]=e[n]})},"applyDagreNodeLayout"),Vs=t((r,e,n,o)=>({...r,start:r.start??e,end:r.end??n,points:(r.points??[]).map((i)=>({...i,y:typeof i.y==="number"?i.y+o:i.y}))}),"normalizeDagreEdge"),Ys=t((r,e)=>{let{graph:n,mergeSelfLoops:o,subGraphTitleTotalMargin:i=0}=e,a=new Map(r.nodes.map((s)=>[s.id,s]));Qp(n).forEach((s)=>{let u=Us(n,s,i);if(!u)return;_n(n.node(s),u);let d=a.get(s);if(d)_n(d,u)});let f=i/2;return r.edges=En(n,f,{mergeSelfLoops:o}).map(({edge:s,start:u,end:d})=>Vs(s,u,d,f)),r},"applyDagreLayoutResult"),zs=t(async({elem:r,graph:e,groups:{clusters:n,edgePaths:o},diagramType:i,id:a,mergeSelfLoops:f,subGraphTitleTotalMargin:s})=>{let u=0;await Promise.all(Qp(e).map(async function(p){let h=e.node(p);if(l.info("Position XBX => "+p+": ("+h.x,","+h.y,") width: ",h.width," height: ",h.height),h?.clusterNode)h.y+=s,l.info("A tainted cluster node XBX1",p,h.id,h.width,h.height,h.x,h.y,e.parent(p)),ye.get(h.id).node=h,na(h);else if(e.children(p).length>0){l.info("A pure cluster node XBX1",p,h.id,h.x,h.y,h.width,h.height,e.parent(p)),h.height+=s,e.node(h.parentId);let b=h?.padding/2||0,w=h?.labelBBox?.height||0,y=w-b||0;l.debug("OffsetY",y,"labelHeight",w,"halfPadding",b),await Do(n,h),ye.get(h.id).node=h}else{let b=e.node(h.parentId);h.y+=s/2,l.info("A regular node XBX1 - using the padding",h.id,"parent",h.parentId,h.width,h.height,h.x,h.y,"offsetY",h.offsetY,"parent",b,b?.offsetY,h),na(h)}}));let d=s/2;return En(e,d,{mergeSelfLoops:f}).forEach(function({edge:p,start:h,end:b}){l.info("Edge "+h+" -> "+b+": "+JSON.stringify(p),p),p.points.forEach((_)=>_.y+=d);let w=e.node(h),y=e.node(b),g=No(o,p,ye,i,w,y,a);dl(p,g)}),e.nodes().forEach(function(p){let h=e.node(p);if(l.info(p,h.type,h.diff),h.isGroup)u=h.diff}),l.warn("Returning from recursive render XAX",r,u),{elem:r,diff:u}},"paintDagreLayoutCore"),Ws=t(async(r)=>{let e=await xn(r);return On(e.graph),await zs(e)},"renderDagreSubgraph"),In=t((r)=>{let e=new Xe({multigraph:!0,compound:!0}).setGraph({rankdir:r.direction,nodesep:r.config?.nodeSpacing||r.nodeSpacing||r.config?.flowchart?.nodeSpacing,ranksep:r.config?.rankSpacing||r.rankSpacing||r.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return r.nodes.forEach((n)=>{if(e.setNode(n.id,{...n}),n.parentId)e.setParent(n.id,n.parentId)}),l.debug("Edges:",r.edges),r.edges.forEach((n)=>{if(n.start===n.end){let o=n.start,i=o+"---"+o+"---1",a=o+"---"+o+"---2",f=e.node(o);e.setNode(i,{domId:i,id:i,parentId:f.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(i,f.parentId),e.setNode(a,{domId:a,id:a,parentId:f.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(a,f.parentId);let s=structuredClone(n),u=structuredClone(n),d=structuredClone(n),c=structuredClone(n);if(u.originalEdge=s,u.selfLoop={id:s.id,order:0},d.originalEdge=s,d.selfLoop={id:s.id,order:1},c.originalEdge=s,c.selfLoop={id:s.id,order:2},u.label="",u.arrowTypeEnd="none",u.endLabelLeft="",u.endLabelRight="",u.startLabelLeft="",u.id=o+"-cyclic-special-1",d.startLabelRight="",d.startLabelLeft="",d.endLabelLeft="",d.endLabelRight="",d.arrowTypeStart="none",d.arrowTypeEnd="none",d.id=o+"-cyclic-special-mid",c.label="",c.startLabelRight="",c.startLabelLeft="",c.arrowTypeStart="none",f.isGroup)u.fromCluster=o,c.toCluster=o;c.id=o+"-cyclic-special-2",c.arrowTypeStart="none",e.setEdge(o,i,u,o+"-cyclic-special-0"),e.setEdge(i,a,d,o+"-cyclic-special-1"),e.setEdge(a,o,c,o+"-cyclic-special-2")}else e.setEdge(n.start,n.end,{...n},n.id)}),oh(e),{graph:e}},"prepareLayoutForDagre"),qs=t(async(r,{element:e,preparedLayout:n})=>{let o=n??In(r),i=m(),a=await xn({element:e,graph:o.graph,diagramType:r.type,id:r.diagramId,parentCluster:void 0,siteConfig:i});return o.measuredLayout=a,a},"measureDagreLayout"),Hs=t((r,e)=>{let n=e.preparedLayout?.measuredLayout;if(!n)throw Error("runDagreLayoutCore requires measureDagreLayout to run first");return On(n.graph),Ys(r,n),n},"runDagreLayoutCore"),Ks=t((r,{measure:e})=>Qp(e.graph).map((n)=>e.graph.node(n)).filter(Boolean),"getDagrePaintNodes"),Js=t((r,e,{measure:n})=>r?n.graph.node(r):void 0,"getDagreEdgeNode"),Kg=si({prepareLayout:In,measureLayout:qs,runLayoutCore:Hs,paintOptions:{clusterDb:ye,getNodes:Ks,getEdgeNode:Js,skipNode:t((r,{measure:e})=>!e.graph.hasNode(r.id),"skipNode"),isCluster:t((r,{measure:e})=>e.graph.hasNode(r.id)&&(e.graph.children(r.id)??[]).length>0,"isCluster")}});export{Ys as applyDagreLayoutResult,En as getEdgesToRender,qs as measureDagreLayout,In as prepareLayoutForDagre,Kg as render,Hs as runDagreLayoutCore};