@scalar/agent-chat 0.2.3 → 0.2.5

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 (262) hide show
  1. package/LICENSE +21 -0
  2. package/dist/App.vue.d.ts +3 -2
  3. package/dist/App.vue.d.ts.map +1 -1
  4. package/dist/App.vue.js +32 -0
  5. package/dist/App.vue2.js +4 -0
  6. package/dist/Chat.vue.d.ts.map +1 -1
  7. package/dist/Chat.vue.js +23 -0
  8. package/dist/Chat.vue2.js +4 -0
  9. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  10. package/dist/api.d.ts +50 -0
  11. package/dist/api.d.ts.map +1 -0
  12. package/dist/api.js +68 -0
  13. package/dist/components/ApprovalSection.vue.d.ts.map +1 -1
  14. package/dist/components/ApprovalSection.vue.js +7 -0
  15. package/dist/components/ApprovalSection.vue2.js +42 -0
  16. package/dist/components/AuthenticationProvided.vue.d.ts +3 -0
  17. package/dist/components/AuthenticationProvided.vue.d.ts.map +1 -0
  18. package/dist/components/AuthenticationProvided.vue.js +13 -0
  19. package/dist/components/AuthenticationRequired.vue.d.ts +3 -0
  20. package/dist/components/AuthenticationRequired.vue.d.ts.map +1 -0
  21. package/dist/components/AuthenticationRequired.vue.js +13 -0
  22. package/dist/components/AutosendPaused.vue.d.ts.map +1 -1
  23. package/dist/components/AutosendPaused.vue.js +13 -0
  24. package/dist/components/ContextItem.vue.d.ts.map +1 -1
  25. package/dist/components/ContextItem.vue.js +7 -0
  26. package/dist/components/ContextItem.vue2.js +19 -0
  27. package/dist/components/ErrorMessage.vue.d.ts +2 -1
  28. package/dist/components/ErrorMessage.vue.d.ts.map +1 -1
  29. package/dist/components/ErrorMessage.vue.js +7 -0
  30. package/dist/components/ErrorMessage.vue2.js +22 -0
  31. package/dist/components/LoadingMiniOpenAPIDoc.vue.d.ts.map +1 -1
  32. package/dist/components/LoadingMiniOpenAPIDoc.vue.js +14 -0
  33. package/dist/components/LoadingOpenAPISpecsSummary.vue.d.ts.map +1 -1
  34. package/dist/components/LoadingOpenAPISpecsSummary.vue.js +14 -0
  35. package/dist/components/Logo.vue.d.ts.map +1 -1
  36. package/dist/components/Logo.vue.js +23 -0
  37. package/dist/components/PaymentSection.vue.d.ts.map +1 -1
  38. package/dist/components/PaymentSection.vue.js +7 -0
  39. package/dist/components/PaymentSection.vue2.js +34 -0
  40. package/dist/components/RequestApproved.vue.d.ts.map +1 -1
  41. package/dist/components/RequestApproved.vue.js +13 -0
  42. package/dist/components/RequestFailed.vue.d.ts.map +1 -1
  43. package/dist/components/RequestFailed.vue.js +24 -0
  44. package/dist/components/RequestPreview.vue.d.ts +1 -1
  45. package/dist/components/RequestPreview.vue.d.ts.map +1 -1
  46. package/dist/components/RequestPreview.vue.js +7 -0
  47. package/dist/components/RequestPreview.vue2.js +123 -0
  48. package/dist/components/RequestRejected.vue.d.ts.map +1 -1
  49. package/dist/components/RequestRejected.vue.js +22 -0
  50. package/dist/components/RequestSuccess.vue.d.ts.map +1 -1
  51. package/dist/components/RequestSuccess.vue.js +13 -0
  52. package/dist/components/ResponseBody/ResponseBody.vue.d.ts +1 -1
  53. package/dist/components/ResponseBody/ResponseBody.vue.d.ts.map +1 -1
  54. package/dist/components/ResponseBody/ResponseBody.vue.js +41 -0
  55. package/dist/components/ResponseBody/ResponseBody.vue2.js +4 -0
  56. package/dist/components/ResponseBody/ResponseBodyInfo.vue.d.ts.map +1 -1
  57. package/dist/components/ResponseBody/ResponseBodyInfo.vue.js +14 -0
  58. package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts +1 -1
  59. package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts.map +1 -1
  60. package/dist/components/ResponseBody/ResponseBodyPreview.vue.js +7 -0
  61. package/dist/components/ResponseBody/ResponseBodyPreview.vue2.js +65 -0
  62. package/dist/components/ResponseBody/ResponseBodyRaw.vue.d.ts.map +1 -1
  63. package/dist/components/ResponseBody/ResponseBodyRaw.vue.js +20 -0
  64. package/dist/components/ResponseBody/ResponseBodyRaw.vue2.js +4 -0
  65. package/dist/components/ResponseBody/ResponseBodyToggle.vue.d.ts +2 -2
  66. package/dist/components/ResponseBody/ResponseBodyToggle.vue.d.ts.map +1 -1
  67. package/dist/components/ResponseBody/ResponseBodyToggle.vue.js +26 -0
  68. package/dist/components/ResponseBody/ResponseBodyToggle.vue2.js +4 -0
  69. package/dist/components/ResponseBody/helpers/media-types.js +130 -0
  70. package/dist/components/ResponseBody/helpers/process-response-body.d.ts +1 -1
  71. package/dist/components/ResponseBody/helpers/process-response-body.d.ts.map +1 -1
  72. package/dist/components/ResponseBody/helpers/process-response-body.js +33 -0
  73. package/dist/components/SearchPopover.vue.d.ts +2 -2
  74. package/dist/components/SearchPopover.vue.d.ts.map +1 -1
  75. package/dist/components/SearchPopover.vue.js +7 -0
  76. package/dist/components/SearchPopover.vue2.js +67 -0
  77. package/dist/components/SendingRequest.vue.d.ts.map +1 -1
  78. package/dist/components/SendingRequest.vue.js +24 -0
  79. package/dist/components/Suggestion.vue.d.ts.map +1 -1
  80. package/dist/components/TestRequestButton.vue.d.ts.map +1 -1
  81. package/dist/components/{Endpoint.vue.d.ts → UploadSection.vue.d.ts} +3 -5
  82. package/dist/components/UploadSection.vue.d.ts.map +1 -0
  83. package/dist/components/UploadSection.vue.js +7 -0
  84. package/dist/components/UploadSection.vue2.js +62 -0
  85. package/dist/entities/prompt/constants.d.ts +2 -0
  86. package/dist/entities/prompt/constants.d.ts.map +1 -0
  87. package/dist/entities/prompt/constants.js +4 -0
  88. package/dist/entities/registry/document.d.ts +21 -0
  89. package/dist/entities/registry/document.d.ts.map +1 -0
  90. package/dist/entities/registry/document.js +12 -0
  91. package/dist/entities/tools/ask-for-authentication.d.ts +7 -0
  92. package/dist/entities/tools/ask-for-authentication.d.ts.map +1 -0
  93. package/dist/entities/tools/ask-for-authentication.js +8 -0
  94. package/dist/entities/tools/constants.d.ts +2 -0
  95. package/dist/entities/tools/constants.d.ts.map +1 -0
  96. package/dist/entities/tools/constants.js +4 -0
  97. package/dist/entities/tools/execute-request.d.ts +42 -0
  98. package/dist/entities/tools/execute-request.d.ts.map +1 -0
  99. package/dist/entities/tools/execute-request.js +11 -0
  100. package/dist/entities/tools/get-mini-openapi-spec.d.ts +12 -0
  101. package/dist/entities/tools/get-mini-openapi-spec.d.ts.map +1 -0
  102. package/dist/entities/tools/get-mini-openapi-spec.js +8 -0
  103. package/dist/entities/tools/get-openapi-spec-summary.d.ts +10 -0
  104. package/dist/entities/tools/get-openapi-spec-summary.d.ts.map +1 -0
  105. package/dist/entities/tools/get-openapi-spec-summary.js +4 -0
  106. package/dist/helpers.d.ts +20 -12
  107. package/dist/helpers.d.ts.map +1 -1
  108. package/dist/helpers.js +115 -0
  109. package/dist/hooks/{useChatApprovals.d.ts → use-chat-approvals.d.ts} +1 -1
  110. package/dist/hooks/use-chat-approvals.d.ts.map +1 -0
  111. package/dist/hooks/use-chat-approvals.js +21 -0
  112. package/dist/hooks/use-chat-error.d.ts +14 -0
  113. package/dist/hooks/use-chat-error.d.ts.map +1 -0
  114. package/dist/hooks/use-chat-error.js +23 -0
  115. package/dist/hooks/use-chat-pending-client-tool-parts.d.ts +19 -0
  116. package/dist/hooks/use-chat-pending-client-tool-parts.d.ts.map +1 -0
  117. package/dist/hooks/use-chat-pending-client-tool-parts.js +12 -0
  118. package/dist/hooks/{useChatScroll.d.ts → use-chat-scroll.d.ts} +1 -1
  119. package/dist/hooks/use-chat-scroll.d.ts.map +1 -0
  120. package/dist/hooks/use-chat-scroll.js +16 -0
  121. package/dist/hooks/{useSearch.d.ts → use-search.d.ts} +11 -11
  122. package/dist/hooks/use-search.d.ts.map +1 -0
  123. package/dist/hooks/use-search.js +25 -0
  124. package/dist/hooks/use-term-and-conditions.d.ts +6 -0
  125. package/dist/hooks/use-term-and-conditions.d.ts.map +1 -0
  126. package/dist/hooks/use-term-and-conditions.js +16 -0
  127. package/dist/hooks/use-upload-tmp-document.d.ts +19 -0
  128. package/dist/hooks/use-upload-tmp-document.d.ts.map +1 -0
  129. package/dist/hooks/use-upload-tmp-document.js +64 -0
  130. package/dist/index.d.ts +2 -1
  131. package/dist/index.d.ts.map +1 -1
  132. package/dist/index.js +2 -1
  133. package/dist/package.json +35 -23
  134. package/dist/registry/add-documents-to-store.d.ts +6 -6
  135. package/dist/registry/add-documents-to-store.d.ts.map +1 -1
  136. package/dist/registry/add-documents-to-store.js +39 -0
  137. package/dist/registry/create-document-name.d.ts +2 -0
  138. package/dist/registry/create-document-name.d.ts.map +1 -0
  139. package/dist/registry/create-document-name.js +6 -0
  140. package/dist/state/state.d.ts +20 -8
  141. package/dist/state/state.d.ts.map +1 -1
  142. package/dist/state/state.js +110 -0
  143. package/dist/style.css +1 -1
  144. package/dist/types.d.ts +2 -0
  145. package/dist/types.d.ts.map +1 -0
  146. package/dist/views/Chat/Chat.vue.d.ts.map +1 -1
  147. package/dist/views/Chat/Chat.vue.js +7 -0
  148. package/dist/views/Chat/Chat.vue2.js +77 -0
  149. package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts +10 -0
  150. package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts.map +1 -0
  151. package/dist/views/Chat/Messages/AskForAuthentication.vue.js +7 -0
  152. package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +89 -0
  153. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts +2 -2
  154. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts.map +1 -1
  155. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +7 -0
  156. package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js +23 -0
  157. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts +2 -2
  158. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts.map +1 -1
  159. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.js +7 -0
  160. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue2.js +56 -0
  161. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts +2 -2
  162. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts.map +1 -1
  163. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js +26 -0
  164. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue2.js +4 -0
  165. package/dist/views/Chat/Messages/Text.vue.d.ts.map +1 -1
  166. package/dist/views/Chat/Messages/Text.vue.js +16 -0
  167. package/dist/views/Chat/Messages/Text.vue2.js +4 -0
  168. package/dist/views/Layout.vue.d.ts.map +1 -1
  169. package/dist/views/Layout.vue.js +7 -0
  170. package/dist/views/Layout.vue2.js +23 -0
  171. package/dist/views/PromptForm.vue.d.ts.map +1 -1
  172. package/dist/views/PromptForm.vue.js +7 -0
  173. package/dist/views/PromptForm.vue2.js +212 -0
  174. package/dist/views/Settings/Auth.vue.d.ts.map +1 -1
  175. package/dist/views/Settings/Auth.vue.js +67 -0
  176. package/dist/views/Settings/Auth.vue2.js +4 -0
  177. package/dist/views/Settings/DocSettings.vue.d.ts.map +1 -1
  178. package/dist/views/Settings/DocSettings.vue.js +7 -0
  179. package/dist/views/Settings/DocSettings.vue2.js +43 -0
  180. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  181. package/dist/views/Settings/Settings.vue.js +8 -0
  182. package/dist/views/Settings/Settings.vue2.js +67 -0
  183. package/dist/views/Start.vue.d.ts.map +1 -1
  184. package/dist/views/Start.vue.js +7 -0
  185. package/dist/views/Start.vue2.js +41 -0
  186. package/package.json +53 -7
  187. package/dist/Tooltip-Cm82QgNj.js +0 -575
  188. package/dist/__vite-optional-peer-dep_stream-markdown_markstream-vue_false-sdjmOmXd.js +0 -5
  189. package/dist/__vite-optional-peer-dep_stream-monaco_markstream-vue_false-HdL4xm5U.js +0 -5
  190. package/dist/__vite-optional-peer-dep_vue-i18n_markstream-vue_false-B9Pwe5kz.js +0 -5
  191. package/dist/_basePickBy-hHD8tMGb.js +0 -151
  192. package/dist/_baseUniq-DTF1wuF6.js +0 -614
  193. package/dist/arc-Dw2RQerU.js +0 -83
  194. package/dist/architecture-U656AL7Q-B00Z9eXr.js +0 -36
  195. package/dist/architectureDiagram-VXUJARFQ-BtOffFaM.js +0 -4662
  196. package/dist/blockDiagram-VD42YOAC-BUqFMMQe.js +0 -2261
  197. package/dist/c4Diagram-YG6GDRKO-NrM1YcpG.js +0 -1579
  198. package/dist/channel-105myCGU.js +0 -5
  199. package/dist/chunk-4BX2VUAB-TAxJli7C.js +0 -8
  200. package/dist/chunk-55IACEB6-VXFJ4bz5.js +0 -8
  201. package/dist/chunk-B4BG7PRW-CZDQpfj5.js +0 -1375
  202. package/dist/chunk-DI55MBZ5-D3l7TA-E.js +0 -1370
  203. package/dist/chunk-FMBD7UC4-BMXFm8I3.js +0 -19
  204. package/dist/chunk-QN33PNHL-BOUpbpWp.js +0 -19
  205. package/dist/chunk-QZHKN3VN-C-TEEx05.js +0 -15
  206. package/dist/chunk-TZMSLE5B-BUiROKNR.js +0 -64
  207. package/dist/classDiagram-2ON5EDUG-HQET4ybK.js +0 -16
  208. package/dist/classDiagram-v2-WZHVMYZB-HQET4ybK.js +0 -16
  209. package/dist/clone-CIIO71O9.js +0 -8
  210. package/dist/components/Endpoint.vue.d.ts.map +0 -1
  211. package/dist/cose-bilkent-S5V4N54A-CMsF4n-5.js +0 -2609
  212. package/dist/cytoscape.esm-DfdJODL8.js +0 -18735
  213. package/dist/dagre-6UL2VRFP-DqzdQ6Qg.js +0 -444
  214. package/dist/defaultLocale-BEa-49Qz.js +0 -171
  215. package/dist/diagram-PSM6KHXK-1xyGntw2.js +0 -531
  216. package/dist/diagram-QEK2KX5R-DdZdlAm1.js +0 -217
  217. package/dist/diagram-S2PKOQOG-C80Eo2jp.js +0 -142
  218. package/dist/erDiagram-Q2GNP2WA-DFVRrMXT.js +0 -841
  219. package/dist/flowDiagram-NV44I4VS-D9QK_qqB.js +0 -1620
  220. package/dist/ganttDiagram-LVOFAZNH-Bo1NTkeQ.js +0 -2506
  221. package/dist/gitGraph-F6HP7TQM-C5hdgcgO.js +0 -27
  222. package/dist/gitGraphDiagram-NY62KEGX-BZqnqZh6.js +0 -699
  223. package/dist/graph-Dth4IhEK.js +0 -247
  224. package/dist/hooks/useChatApprovals.d.ts.map +0 -1
  225. package/dist/hooks/useChatOperationBlocks.d.ts +0 -3
  226. package/dist/hooks/useChatOperationBlocks.d.ts.map +0 -1
  227. package/dist/hooks/useChatScroll.d.ts.map +0 -1
  228. package/dist/hooks/useSearch.d.ts.map +0 -1
  229. package/dist/index-BOvT43H8.js +0 -111780
  230. package/dist/index2-B36B-gt0.js +0 -69
  231. package/dist/index3-CtIyYUnG.js +0 -70
  232. package/dist/index4-Dzz91Ao2.js +0 -537
  233. package/dist/index5-Bmz0gMSP.js +0 -590
  234. package/dist/index6-DMB3qTSV.js +0 -196
  235. package/dist/info-NVLQJR56-azt5obk5.js +0 -27
  236. package/dist/infoDiagram-ER5ION4S-DD4Jtctm.js +0 -24
  237. package/dist/infographic_markstream-vue_false-BfsmcXxk.js +0 -5
  238. package/dist/init-DjUOC4st.js +0 -16
  239. package/dist/journeyDiagram-XKPGCS4Q-CXL6UO0r.js +0 -834
  240. package/dist/kanban-definition-3W4ZIXB7-B57do5Wg.js +0 -719
  241. package/dist/katex-SsTUIUTC.js +0 -11688
  242. package/dist/layout-7TCY8eA2.js +0 -1332
  243. package/dist/linear-DSm5i91N.js +0 -625
  244. package/dist/mermaid-parser.core-CUQWpAMM.js +0 -12746
  245. package/dist/mermaid.core-QjuzH7xx.js +0 -14164
  246. package/dist/mhchem-XHl7cef5.js +0 -2306
  247. package/dist/mindmap-definition-VGOIOE7T-DAQyGNAM.js +0 -784
  248. package/dist/ordinal-DfAQgscy.js +0 -61
  249. package/dist/packet-BFZMPI3H-CixuxAEA.js +0 -27
  250. package/dist/pie-7BOR55EZ-D3cgnzR1.js +0 -32
  251. package/dist/pieDiagram-ADFJNKIX-BqxgYwrL.js +0 -161
  252. package/dist/quadrantDiagram-AYHSOK5B-CQ4v-9Hh.js +0 -1022
  253. package/dist/radar-NHE76QYJ-DhV0Od_M.js +0 -27
  254. package/dist/requirementDiagram-UZGBJVZJ-ncWNAgFi.js +0 -850
  255. package/dist/safeRaf-I3a3-dyJ.js +0 -10
  256. package/dist/sankeyDiagram-TZEHDZUN-yCR2_cH5.js +0 -810
  257. package/dist/sequenceDiagram-WL72ISMW-DZ7wqFyd.js +0 -2511
  258. package/dist/stateDiagram-FKZM4ZOC-Dra68Tzi.js +0 -263
  259. package/dist/stateDiagram-v2-4FDKWEC3-CARbPECD.js +0 -16
  260. package/dist/timeline-definition-IT6M3QCI-DEbG9QIM.js +0 -795
  261. package/dist/treemap-KMMF4GRG-CQbPsyWe.js +0 -81
  262. package/dist/xychartDiagram-PRI3JC2R-C94Pu8hL.js +0 -1340
@@ -1,1332 +0,0 @@
1
- import { G as g } from "./graph-Dth4IhEK.js";
2
- import { b as Te, p as ce, q as le, g as X, e as ee, l as F, o as Me, s as Ie, c as Se, u as je, d as f, i as m, f as C, v as x, r as I } from "./_baseUniq-DTF1wuF6.js";
3
- import { f as O, b as he, a as Fe, c as Ve, d as Ae, t as V, m as w, e as P, h as ve, g as z, l as T, i as Be } from "./_basePickBy-hHD8tMGb.js";
4
- import { aX as Ge, aY as Ye, aZ as De, aN as $e, a_ as qe, aR as pe, aQ as we, a$ as We, aM as $, ar as Xe, aT as ze, at as Ue, b0 as q } from "./mermaid.core-QjuzH7xx.js";
5
- function He(e) {
6
- return Ge(Ye(e, void 0, O), e + "");
7
- }
8
- var Ze = 1, Je = 4;
9
- function Qe(e) {
10
- return Te(e, Ze | Je);
11
- }
12
- function Ke(e, n) {
13
- return e == null ? e : De(e, ce(n), $e);
14
- }
15
- function en(e, n) {
16
- return e && le(e, ce(n));
17
- }
18
- function nn(e, n) {
19
- return e > n;
20
- }
21
- function S(e, n) {
22
- var r = {};
23
- return n = X(n), le(e, function(t, a, i) {
24
- qe(r, a, n(t, a, i));
25
- }), r;
26
- }
27
- function y(e) {
28
- return e && e.length ? he(e, pe, nn) : void 0;
29
- }
30
- function U(e, n) {
31
- return e && e.length ? he(e, X(n), Fe) : void 0;
32
- }
33
- function rn(e, n) {
34
- var r = e.length;
35
- for (e.sort(n); r--; )
36
- e[r] = e[r].value;
37
- return e;
38
- }
39
- function tn(e, n) {
40
- if (e !== n) {
41
- var r = e !== void 0, t = e === null, a = e === e, i = ee(e), o = n !== void 0, u = n === null, d = n === n, s = ee(n);
42
- if (!u && !s && !i && e > n || i && o && d && !u && !s || t && o && d || !r && d || !a)
43
- return 1;
44
- if (!t && !i && !s && e < n || s && r && a && !t && !i || u && r && a || !o && a || !d)
45
- return -1;
46
- }
47
- return 0;
48
- }
49
- function an(e, n, r) {
50
- for (var t = -1, a = e.criteria, i = n.criteria, o = a.length, u = r.length; ++t < o; ) {
51
- var d = tn(a[t], i[t]);
52
- if (d) {
53
- if (t >= u)
54
- return d;
55
- var s = r[t];
56
- return d * (s == "desc" ? -1 : 1);
57
- }
58
- }
59
- return e.index - n.index;
60
- }
61
- function on(e, n, r) {
62
- n.length ? n = F(n, function(i) {
63
- return we(i) ? function(o) {
64
- return Me(o, i.length === 1 ? i[0] : i);
65
- } : i;
66
- }) : n = [pe];
67
- var t = -1;
68
- n = F(n, We(X));
69
- var a = Ve(e, function(i, o, u) {
70
- var d = F(n, function(s) {
71
- return s(i);
72
- });
73
- return { criteria: d, index: ++t, value: i };
74
- });
75
- return rn(a, function(i, o) {
76
- return an(i, o, r);
77
- });
78
- }
79
- function un(e, n) {
80
- return Ae(e, n, function(r, t) {
81
- return Ie(e, t);
82
- });
83
- }
84
- var M = He(function(e, n) {
85
- return e == null ? {} : un(e, n);
86
- }), dn = Math.ceil, sn = Math.max;
87
- function fn(e, n, r, t) {
88
- for (var a = -1, i = sn(dn((n - e) / (r || 1)), 0), o = Array(i); i--; )
89
- o[++a] = e, e += r;
90
- return o;
91
- }
92
- function cn(e) {
93
- return function(n, r, t) {
94
- return t && typeof t != "number" && $(n, r, t) && (r = t = void 0), n = V(n), r === void 0 ? (r = n, n = 0) : r = V(r), t = t === void 0 ? n < r ? 1 : -1 : V(t), fn(n, r, t);
95
- };
96
- }
97
- var E = cn(), R = Xe(function(e, n) {
98
- if (e == null)
99
- return [];
100
- var r = n.length;
101
- return r > 1 && $(e, n[0], n[1]) ? n = [] : r > 2 && $(n[0], n[1], n[2]) && (n = [n[0]]), on(e, Se(n), []);
102
- }), ln = 0;
103
- function H(e) {
104
- var n = ++ln;
105
- return je(e) + n;
106
- }
107
- function hn(e, n, r) {
108
- for (var t = -1, a = e.length, i = n.length, o = {}; ++t < a; ) {
109
- var u = t < i ? n[t] : void 0;
110
- r(o, e[t], u);
111
- }
112
- return o;
113
- }
114
- function vn(e, n) {
115
- return hn(e || [], n || [], ze);
116
- }
117
- class pn {
118
- constructor() {
119
- var n = {};
120
- n._next = n._prev = n, this._sentinel = n;
121
- }
122
- dequeue() {
123
- var n = this._sentinel, r = n._prev;
124
- if (r !== n)
125
- return ne(r), r;
126
- }
127
- enqueue(n) {
128
- var r = this._sentinel;
129
- n._prev && n._next && ne(n), n._next = r._next, r._next._prev = n, r._next = n, n._prev = r;
130
- }
131
- toString() {
132
- for (var n = [], r = this._sentinel, t = r._prev; t !== r; )
133
- n.push(JSON.stringify(t, wn)), t = t._prev;
134
- return "[" + n.join(", ") + "]";
135
- }
136
- }
137
- function ne(e) {
138
- e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
139
- }
140
- function wn(e, n) {
141
- if (e !== "_next" && e !== "_prev")
142
- return n;
143
- }
144
- var bn = Ue(1);
145
- function mn(e, n) {
146
- if (e.nodeCount() <= 1)
147
- return [];
148
- var r = yn(e, n || bn), t = gn(r.graph, r.buckets, r.zeroIdx);
149
- return O(
150
- w(t, function(a) {
151
- return e.outEdges(a.v, a.w);
152
- })
153
- );
154
- }
155
- function gn(e, n, r) {
156
- for (var t = [], a = n[n.length - 1], i = n[0], o; e.nodeCount(); ) {
157
- for (; o = i.dequeue(); )
158
- A(e, n, r, o);
159
- for (; o = a.dequeue(); )
160
- A(e, n, r, o);
161
- if (e.nodeCount()) {
162
- for (var u = n.length - 2; u > 0; --u)
163
- if (o = n[u].dequeue(), o) {
164
- t = t.concat(A(e, n, r, o, !0));
165
- break;
166
- }
167
- }
168
- }
169
- return t;
170
- }
171
- function A(e, n, r, t, a) {
172
- var i = a ? [] : void 0;
173
- return f(e.inEdges(t.v), function(o) {
174
- var u = e.edge(o), d = e.node(o.v);
175
- a && i.push({ v: o.v, w: o.w }), d.out -= u, W(n, r, d);
176
- }), f(e.outEdges(t.v), function(o) {
177
- var u = e.edge(o), d = o.w, s = e.node(d);
178
- s.in -= u, W(n, r, s);
179
- }), e.removeNode(t.v), i;
180
- }
181
- function yn(e, n) {
182
- var r = new g(), t = 0, a = 0;
183
- f(e.nodes(), function(u) {
184
- r.setNode(u, { v: u, in: 0, out: 0 });
185
- }), f(e.edges(), function(u) {
186
- var d = r.edge(u.v, u.w) || 0, s = n(u), c = d + s;
187
- r.setEdge(u.v, u.w, c), a = Math.max(a, r.node(u.v).out += s), t = Math.max(t, r.node(u.w).in += s);
188
- });
189
- var i = E(a + t + 3).map(function() {
190
- return new pn();
191
- }), o = t + 1;
192
- return f(r.nodes(), function(u) {
193
- W(i, o, r.node(u));
194
- }), { graph: r, buckets: i, zeroIdx: o };
195
- }
196
- function W(e, n, r) {
197
- r.out ? r.in ? e[r.out - r.in + n].enqueue(r) : e[e.length - 1].enqueue(r) : e[0].enqueue(r);
198
- }
199
- function kn(e) {
200
- var n = e.graph().acyclicer === "greedy" ? mn(e, r(e)) : xn(e);
201
- f(n, function(t) {
202
- var a = e.edge(t);
203
- e.removeEdge(t), a.forwardName = t.name, a.reversed = !0, e.setEdge(t.w, t.v, a, H("rev"));
204
- });
205
- function r(t) {
206
- return function(a) {
207
- return t.edge(a).weight;
208
- };
209
- }
210
- }
211
- function xn(e) {
212
- var n = [], r = {}, t = {};
213
- function a(i) {
214
- Object.prototype.hasOwnProperty.call(t, i) || (t[i] = !0, r[i] = !0, f(e.outEdges(i), function(o) {
215
- Object.prototype.hasOwnProperty.call(r, o.w) ? n.push(o) : a(o.w);
216
- }), delete r[i]);
217
- }
218
- return f(e.nodes(), a), n;
219
- }
220
- function En(e) {
221
- f(e.edges(), function(n) {
222
- var r = e.edge(n);
223
- if (r.reversed) {
224
- e.removeEdge(n);
225
- var t = r.forwardName;
226
- delete r.reversed, delete r.forwardName, e.setEdge(n.w, n.v, r, t);
227
- }
228
- });
229
- }
230
- function L(e, n, r, t) {
231
- var a;
232
- do
233
- a = H(t);
234
- while (e.hasNode(a));
235
- return r.dummy = n, e.setNode(a, r), a;
236
- }
237
- function On(e) {
238
- var n = new g().setGraph(e.graph());
239
- return f(e.nodes(), function(r) {
240
- n.setNode(r, e.node(r));
241
- }), f(e.edges(), function(r) {
242
- var t = n.edge(r.v, r.w) || { weight: 0, minlen: 1 }, a = e.edge(r);
243
- n.setEdge(r.v, r.w, {
244
- weight: t.weight + a.weight,
245
- minlen: Math.max(t.minlen, a.minlen)
246
- });
247
- }), n;
248
- }
249
- function be(e) {
250
- var n = new g({ multigraph: e.isMultigraph() }).setGraph(e.graph());
251
- return f(e.nodes(), function(r) {
252
- e.children(r).length || n.setNode(r, e.node(r));
253
- }), f(e.edges(), function(r) {
254
- n.setEdge(r, e.edge(r));
255
- }), n;
256
- }
257
- function re(e, n) {
258
- var r = e.x, t = e.y, a = n.x - r, i = n.y - t, o = e.width / 2, u = e.height / 2;
259
- if (!a && !i)
260
- throw new Error("Not possible to find intersection inside of the rectangle");
261
- var d, s;
262
- return Math.abs(i) * o > Math.abs(a) * u ? (i < 0 && (u = -u), d = u * a / i, s = u) : (a < 0 && (o = -o), d = o, s = o * i / a), { x: r + d, y: t + s };
263
- }
264
- function j(e) {
265
- var n = w(E(me(e) + 1), function() {
266
- return [];
267
- });
268
- return f(e.nodes(), function(r) {
269
- var t = e.node(r), a = t.rank;
270
- m(a) || (n[a][t.order] = r);
271
- }), n;
272
- }
273
- function Ln(e) {
274
- var n = P(
275
- w(e.nodes(), function(r) {
276
- return e.node(r).rank;
277
- })
278
- );
279
- f(e.nodes(), function(r) {
280
- var t = e.node(r);
281
- ve(t, "rank") && (t.rank -= n);
282
- });
283
- }
284
- function Nn(e) {
285
- var n = P(
286
- w(e.nodes(), function(i) {
287
- return e.node(i).rank;
288
- })
289
- ), r = [];
290
- f(e.nodes(), function(i) {
291
- var o = e.node(i).rank - n;
292
- r[o] || (r[o] = []), r[o].push(i);
293
- });
294
- var t = 0, a = e.graph().nodeRankFactor;
295
- f(r, function(i, o) {
296
- m(i) && o % a !== 0 ? --t : t && f(i, function(u) {
297
- e.node(u).rank += t;
298
- });
299
- });
300
- }
301
- function te(e, n, r, t) {
302
- var a = {
303
- width: 0,
304
- height: 0
305
- };
306
- return arguments.length >= 4 && (a.rank = r, a.order = t), L(e, "border", a, n);
307
- }
308
- function me(e) {
309
- return y(
310
- w(e.nodes(), function(n) {
311
- var r = e.node(n).rank;
312
- if (!m(r))
313
- return r;
314
- })
315
- );
316
- }
317
- function Pn(e, n) {
318
- var r = { lhs: [], rhs: [] };
319
- return f(e, function(t) {
320
- n(t) ? r.lhs.push(t) : r.rhs.push(t);
321
- }), r;
322
- }
323
- function _n(e, n) {
324
- return n();
325
- }
326
- function Cn(e) {
327
- function n(r) {
328
- var t = e.children(r), a = e.node(r);
329
- if (t.length && f(t, n), Object.prototype.hasOwnProperty.call(a, "minRank")) {
330
- a.borderLeft = [], a.borderRight = [];
331
- for (var i = a.minRank, o = a.maxRank + 1; i < o; ++i)
332
- ae(e, "borderLeft", "_bl", r, a, i), ae(e, "borderRight", "_br", r, a, i);
333
- }
334
- }
335
- f(e.children(), n);
336
- }
337
- function ae(e, n, r, t, a, i) {
338
- var o = { width: 0, height: 0, rank: i, borderType: n }, u = a[n][i - 1], d = L(e, "border", o, r);
339
- a[n][i] = d, e.setParent(d, t), u && e.setEdge(u, d, { weight: 1 });
340
- }
341
- function Rn(e) {
342
- var n = e.graph().rankdir.toLowerCase();
343
- (n === "lr" || n === "rl") && ge(e);
344
- }
345
- function Tn(e) {
346
- var n = e.graph().rankdir.toLowerCase();
347
- (n === "bt" || n === "rl") && Mn(e), (n === "lr" || n === "rl") && (In(e), ge(e));
348
- }
349
- function ge(e) {
350
- f(e.nodes(), function(n) {
351
- ie(e.node(n));
352
- }), f(e.edges(), function(n) {
353
- ie(e.edge(n));
354
- });
355
- }
356
- function ie(e) {
357
- var n = e.width;
358
- e.width = e.height, e.height = n;
359
- }
360
- function Mn(e) {
361
- f(e.nodes(), function(n) {
362
- B(e.node(n));
363
- }), f(e.edges(), function(n) {
364
- var r = e.edge(n);
365
- f(r.points, B), Object.prototype.hasOwnProperty.call(r, "y") && B(r);
366
- });
367
- }
368
- function B(e) {
369
- e.y = -e.y;
370
- }
371
- function In(e) {
372
- f(e.nodes(), function(n) {
373
- G(e.node(n));
374
- }), f(e.edges(), function(n) {
375
- var r = e.edge(n);
376
- f(r.points, G), Object.prototype.hasOwnProperty.call(r, "x") && G(r);
377
- });
378
- }
379
- function G(e) {
380
- var n = e.x;
381
- e.x = e.y, e.y = n;
382
- }
383
- function Sn(e) {
384
- e.graph().dummyChains = [], f(e.edges(), function(n) {
385
- jn(e, n);
386
- });
387
- }
388
- function jn(e, n) {
389
- var r = n.v, t = e.node(r).rank, a = n.w, i = e.node(a).rank, o = n.name, u = e.edge(n), d = u.labelRank;
390
- if (i !== t + 1) {
391
- e.removeEdge(n);
392
- var s = void 0, c, l;
393
- for (l = 0, ++t; t < i; ++l, ++t)
394
- u.points = [], s = {
395
- width: 0,
396
- height: 0,
397
- edgeLabel: u,
398
- edgeObj: n,
399
- rank: t
400
- }, c = L(e, "edge", s, "_d"), t === d && (s.width = u.width, s.height = u.height, s.dummy = "edge-label", s.labelpos = u.labelpos), e.setEdge(r, c, { weight: u.weight }, o), l === 0 && e.graph().dummyChains.push(c), r = c;
401
- e.setEdge(r, a, { weight: u.weight }, o);
402
- }
403
- }
404
- function Fn(e) {
405
- f(e.graph().dummyChains, function(n) {
406
- var r = e.node(n), t = r.edgeLabel, a;
407
- for (e.setEdge(r.edgeObj, t); r.dummy; )
408
- a = e.successors(n)[0], e.removeNode(n), t.points.push({ x: r.x, y: r.y }), r.dummy === "edge-label" && (t.x = r.x, t.y = r.y, t.width = r.width, t.height = r.height), n = a, r = e.node(n);
409
- });
410
- }
411
- function Z(e) {
412
- var n = {};
413
- function r(t) {
414
- var a = e.node(t);
415
- if (Object.prototype.hasOwnProperty.call(n, t))
416
- return a.rank;
417
- n[t] = !0;
418
- var i = P(
419
- w(e.outEdges(t), function(o) {
420
- return r(o.w) - e.edge(o).minlen;
421
- })
422
- );
423
- return (i === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3
424
- i === void 0 || // return value of _.map([]) for Lodash 4
425
- i === null) && (i = 0), a.rank = i;
426
- }
427
- f(e.sources(), r);
428
- }
429
- function _(e, n) {
430
- return e.node(n.w).rank - e.node(n.v).rank - e.edge(n).minlen;
431
- }
432
- function ye(e) {
433
- var n = new g({ directed: !1 }), r = e.nodes()[0], t = e.nodeCount();
434
- n.setNode(r, {});
435
- for (var a, i; Vn(n, e) < t; )
436
- a = An(n, e), i = n.hasNode(a.v) ? _(e, a) : -_(e, a), Bn(n, e, i);
437
- return n;
438
- }
439
- function Vn(e, n) {
440
- function r(t) {
441
- f(n.nodeEdges(t), function(a) {
442
- var i = a.v, o = t === i ? a.w : i;
443
- !e.hasNode(o) && !_(n, a) && (e.setNode(o, {}), e.setEdge(t, o, {}), r(o));
444
- });
445
- }
446
- return f(e.nodes(), r), e.nodeCount();
447
- }
448
- function An(e, n) {
449
- return U(n.edges(), function(r) {
450
- if (e.hasNode(r.v) !== e.hasNode(r.w))
451
- return _(n, r);
452
- });
453
- }
454
- function Bn(e, n, r) {
455
- f(e.nodes(), function(t) {
456
- n.node(t).rank += r;
457
- });
458
- }
459
- function ke(e, n, r) {
460
- we(n) || (n = [n]);
461
- var t = (e.isDirected() ? e.successors : e.neighbors).bind(e), a = [], i = {};
462
- return f(n, function(o) {
463
- if (!e.hasNode(o))
464
- throw new Error("Graph does not have node: " + o);
465
- xe(e, o, r === "post", i, t, a);
466
- }), a;
467
- }
468
- function xe(e, n, r, t, a, i) {
469
- Object.prototype.hasOwnProperty.call(t, n) || (t[n] = !0, r || i.push(n), f(a(n), function(o) {
470
- xe(e, o, r, t, a, i);
471
- }), r && i.push(n));
472
- }
473
- function Gn(e, n) {
474
- return ke(e, n, "post");
475
- }
476
- function Yn(e, n) {
477
- return ke(e, n, "pre");
478
- }
479
- k.initLowLimValues = Q;
480
- k.initCutValues = J;
481
- k.calcCutValue = Ee;
482
- k.leaveEdge = Le;
483
- k.enterEdge = Ne;
484
- k.exchangeEdges = Pe;
485
- function k(e) {
486
- e = On(e), Z(e);
487
- var n = ye(e);
488
- Q(n), J(n, e);
489
- for (var r, t; r = Le(n); )
490
- t = Ne(n, e, r), Pe(n, e, r, t);
491
- }
492
- function J(e, n) {
493
- var r = Gn(e, e.nodes());
494
- r = r.slice(0, r.length - 1), f(r, function(t) {
495
- Dn(e, n, t);
496
- });
497
- }
498
- function Dn(e, n, r) {
499
- var t = e.node(r), a = t.parent;
500
- e.edge(r, a).cutvalue = Ee(e, n, r);
501
- }
502
- function Ee(e, n, r) {
503
- var t = e.node(r), a = t.parent, i = !0, o = n.edge(r, a), u = 0;
504
- return o || (i = !1, o = n.edge(a, r)), u = o.weight, f(n.nodeEdges(r), function(d) {
505
- var s = d.v === r, c = s ? d.w : d.v;
506
- if (c !== a) {
507
- var l = s === i, h = n.edge(d).weight;
508
- if (u += l ? h : -h, qn(e, r, c)) {
509
- var v = e.edge(r, c).cutvalue;
510
- u += l ? -v : v;
511
- }
512
- }
513
- }), u;
514
- }
515
- function Q(e, n) {
516
- arguments.length < 2 && (n = e.nodes()[0]), Oe(e, {}, 1, n);
517
- }
518
- function Oe(e, n, r, t, a) {
519
- var i = r, o = e.node(t);
520
- return n[t] = !0, f(e.neighbors(t), function(u) {
521
- Object.prototype.hasOwnProperty.call(n, u) || (r = Oe(e, n, r, u, t));
522
- }), o.low = i, o.lim = r++, a ? o.parent = a : delete o.parent, r;
523
- }
524
- function Le(e) {
525
- return z(e.edges(), function(n) {
526
- return e.edge(n).cutvalue < 0;
527
- });
528
- }
529
- function Ne(e, n, r) {
530
- var t = r.v, a = r.w;
531
- n.hasEdge(t, a) || (t = r.w, a = r.v);
532
- var i = e.node(t), o = e.node(a), u = i, d = !1;
533
- i.lim > o.lim && (u = o, d = !0);
534
- var s = C(n.edges(), function(c) {
535
- return d === oe(e, e.node(c.v), u) && d !== oe(e, e.node(c.w), u);
536
- });
537
- return U(s, function(c) {
538
- return _(n, c);
539
- });
540
- }
541
- function Pe(e, n, r, t) {
542
- var a = r.v, i = r.w;
543
- e.removeEdge(a, i), e.setEdge(t.v, t.w, {}), Q(e), J(e, n), $n(e, n);
544
- }
545
- function $n(e, n) {
546
- var r = z(e.nodes(), function(a) {
547
- return !n.node(a).parent;
548
- }), t = Yn(e, r);
549
- t = t.slice(1), f(t, function(a) {
550
- var i = e.node(a).parent, o = n.edge(a, i), u = !1;
551
- o || (o = n.edge(i, a), u = !0), n.node(a).rank = n.node(i).rank + (u ? o.minlen : -o.minlen);
552
- });
553
- }
554
- function qn(e, n, r) {
555
- return e.hasEdge(n, r);
556
- }
557
- function oe(e, n, r) {
558
- return r.low <= n.lim && n.lim <= r.lim;
559
- }
560
- function Wn(e) {
561
- switch (e.graph().ranker) {
562
- case "network-simplex":
563
- ue(e);
564
- break;
565
- case "tight-tree":
566
- zn(e);
567
- break;
568
- case "longest-path":
569
- Xn(e);
570
- break;
571
- default:
572
- ue(e);
573
- }
574
- }
575
- var Xn = Z;
576
- function zn(e) {
577
- Z(e), ye(e);
578
- }
579
- function ue(e) {
580
- k(e);
581
- }
582
- function Un(e) {
583
- var n = L(e, "root", {}, "_root"), r = Hn(e), t = y(x(r)) - 1, a = 2 * t + 1;
584
- e.graph().nestingRoot = n, f(e.edges(), function(o) {
585
- e.edge(o).minlen *= a;
586
- });
587
- var i = Zn(e) + 1;
588
- f(e.children(), function(o) {
589
- _e(e, n, a, i, t, r, o);
590
- }), e.graph().nodeRankFactor = a;
591
- }
592
- function _e(e, n, r, t, a, i, o) {
593
- var u = e.children(o);
594
- if (!u.length) {
595
- o !== n && e.setEdge(n, o, { weight: 0, minlen: r });
596
- return;
597
- }
598
- var d = te(e, "_bt"), s = te(e, "_bb"), c = e.node(o);
599
- e.setParent(d, o), c.borderTop = d, e.setParent(s, o), c.borderBottom = s, f(u, function(l) {
600
- _e(e, n, r, t, a, i, l);
601
- var h = e.node(l), v = h.borderTop ? h.borderTop : l, p = h.borderBottom ? h.borderBottom : l, b = h.borderTop ? t : 2 * t, N = v !== p ? 1 : a - i[o] + 1;
602
- e.setEdge(d, v, {
603
- weight: b,
604
- minlen: N,
605
- nestingEdge: !0
606
- }), e.setEdge(p, s, {
607
- weight: b,
608
- minlen: N,
609
- nestingEdge: !0
610
- });
611
- }), e.parent(o) || e.setEdge(n, d, { weight: 0, minlen: a + i[o] });
612
- }
613
- function Hn(e) {
614
- var n = {};
615
- function r(t, a) {
616
- var i = e.children(t);
617
- i && i.length && f(i, function(o) {
618
- r(o, a + 1);
619
- }), n[t] = a;
620
- }
621
- return f(e.children(), function(t) {
622
- r(t, 1);
623
- }), n;
624
- }
625
- function Zn(e) {
626
- return I(
627
- e.edges(),
628
- function(n, r) {
629
- return n + e.edge(r).weight;
630
- },
631
- 0
632
- );
633
- }
634
- function Jn(e) {
635
- var n = e.graph();
636
- e.removeNode(n.nestingRoot), delete n.nestingRoot, f(e.edges(), function(r) {
637
- var t = e.edge(r);
638
- t.nestingEdge && e.removeEdge(r);
639
- });
640
- }
641
- function Qn(e, n, r) {
642
- var t = {}, a;
643
- f(r, function(i) {
644
- for (var o = e.parent(i), u, d; o; ) {
645
- if (u = e.parent(o), u ? (d = t[u], t[u] = o) : (d = a, a = o), d && d !== o) {
646
- n.setEdge(d, o);
647
- return;
648
- }
649
- o = u;
650
- }
651
- });
652
- }
653
- function Kn(e, n, r) {
654
- var t = er(e), a = new g({ compound: !0 }).setGraph({ root: t }).setDefaultNodeLabel(function(i) {
655
- return e.node(i);
656
- });
657
- return f(e.nodes(), function(i) {
658
- var o = e.node(i), u = e.parent(i);
659
- (o.rank === n || o.minRank <= n && n <= o.maxRank) && (a.setNode(i), a.setParent(i, u || t), f(e[r](i), function(d) {
660
- var s = d.v === i ? d.w : d.v, c = a.edge(s, i), l = m(c) ? 0 : c.weight;
661
- a.setEdge(s, i, { weight: e.edge(d).weight + l });
662
- }), Object.prototype.hasOwnProperty.call(o, "minRank") && a.setNode(i, {
663
- borderLeft: o.borderLeft[n],
664
- borderRight: o.borderRight[n]
665
- }));
666
- }), a;
667
- }
668
- function er(e) {
669
- for (var n; e.hasNode(n = H("_root")); ) ;
670
- return n;
671
- }
672
- function nr(e, n) {
673
- for (var r = 0, t = 1; t < n.length; ++t)
674
- r += rr(e, n[t - 1], n[t]);
675
- return r;
676
- }
677
- function rr(e, n, r) {
678
- for (var t = vn(
679
- r,
680
- w(r, function(s, c) {
681
- return c;
682
- })
683
- ), a = O(
684
- w(n, function(s) {
685
- return R(
686
- w(e.outEdges(s), function(c) {
687
- return { pos: t[c.w], weight: e.edge(c).weight };
688
- }),
689
- "pos"
690
- );
691
- })
692
- ), i = 1; i < r.length; ) i <<= 1;
693
- var o = 2 * i - 1;
694
- i -= 1;
695
- var u = w(new Array(o), function() {
696
- return 0;
697
- }), d = 0;
698
- return f(
699
- // @ts-expect-error
700
- a.forEach(function(s) {
701
- var c = s.pos + i;
702
- u[c] += s.weight;
703
- for (var l = 0; c > 0; )
704
- c % 2 && (l += u[c + 1]), c = c - 1 >> 1, u[c] += s.weight;
705
- d += s.weight * l;
706
- })
707
- ), d;
708
- }
709
- function tr(e) {
710
- var n = {}, r = C(e.nodes(), function(u) {
711
- return !e.children(u).length;
712
- }), t = y(
713
- w(r, function(u) {
714
- return e.node(u).rank;
715
- })
716
- ), a = w(E(t + 1), function() {
717
- return [];
718
- });
719
- function i(u) {
720
- if (!ve(n, u)) {
721
- n[u] = !0;
722
- var d = e.node(u);
723
- a[d.rank].push(u), f(e.successors(u), i);
724
- }
725
- }
726
- var o = R(r, function(u) {
727
- return e.node(u).rank;
728
- });
729
- return f(o, i), a;
730
- }
731
- function ar(e, n) {
732
- return w(n, function(r) {
733
- var t = e.inEdges(r);
734
- if (t.length) {
735
- var a = I(
736
- t,
737
- function(i, o) {
738
- var u = e.edge(o), d = e.node(o.v);
739
- return {
740
- sum: i.sum + u.weight * d.order,
741
- weight: i.weight + u.weight
742
- };
743
- },
744
- { sum: 0, weight: 0 }
745
- );
746
- return {
747
- v: r,
748
- barycenter: a.sum / a.weight,
749
- weight: a.weight
750
- };
751
- } else
752
- return { v: r };
753
- });
754
- }
755
- function ir(e, n) {
756
- var r = {};
757
- f(e, function(a, i) {
758
- var o = r[a.v] = {
759
- indegree: 0,
760
- in: [],
761
- out: [],
762
- vs: [a.v],
763
- i
764
- };
765
- m(a.barycenter) || (o.barycenter = a.barycenter, o.weight = a.weight);
766
- }), f(n.edges(), function(a) {
767
- var i = r[a.v], o = r[a.w];
768
- !m(i) && !m(o) && (o.indegree++, i.out.push(r[a.w]));
769
- });
770
- var t = C(r, function(a) {
771
- return !a.indegree;
772
- });
773
- return or(t);
774
- }
775
- function or(e) {
776
- var n = [];
777
- function r(i) {
778
- return function(o) {
779
- o.merged || (m(o.barycenter) || m(i.barycenter) || o.barycenter >= i.barycenter) && ur(i, o);
780
- };
781
- }
782
- function t(i) {
783
- return function(o) {
784
- o.in.push(i), --o.indegree === 0 && e.push(o);
785
- };
786
- }
787
- for (; e.length; ) {
788
- var a = e.pop();
789
- n.push(a), f(a.in.reverse(), r(a)), f(a.out, t(a));
790
- }
791
- return w(
792
- C(n, function(i) {
793
- return !i.merged;
794
- }),
795
- function(i) {
796
- return M(i, ["vs", "i", "barycenter", "weight"]);
797
- }
798
- );
799
- }
800
- function ur(e, n) {
801
- var r = 0, t = 0;
802
- e.weight && (r += e.barycenter * e.weight, t += e.weight), n.weight && (r += n.barycenter * n.weight, t += n.weight), e.vs = n.vs.concat(e.vs), e.barycenter = r / t, e.weight = t, e.i = Math.min(n.i, e.i), n.merged = !0;
803
- }
804
- function dr(e, n) {
805
- var r = Pn(e, function(c) {
806
- return Object.prototype.hasOwnProperty.call(c, "barycenter");
807
- }), t = r.lhs, a = R(r.rhs, function(c) {
808
- return -c.i;
809
- }), i = [], o = 0, u = 0, d = 0;
810
- t.sort(sr(!!n)), d = de(i, a, d), f(t, function(c) {
811
- d += c.vs.length, i.push(c.vs), o += c.barycenter * c.weight, u += c.weight, d = de(i, a, d);
812
- });
813
- var s = { vs: O(i) };
814
- return u && (s.barycenter = o / u, s.weight = u), s;
815
- }
816
- function de(e, n, r) {
817
- for (var t; n.length && (t = T(n)).i <= r; )
818
- n.pop(), e.push(t.vs), r++;
819
- return r;
820
- }
821
- function sr(e) {
822
- return function(n, r) {
823
- return n.barycenter < r.barycenter ? -1 : n.barycenter > r.barycenter ? 1 : e ? r.i - n.i : n.i - r.i;
824
- };
825
- }
826
- function Ce(e, n, r, t) {
827
- var a = e.children(n), i = e.node(n), o = i ? i.borderLeft : void 0, u = i ? i.borderRight : void 0, d = {};
828
- o && (a = C(a, function(p) {
829
- return p !== o && p !== u;
830
- }));
831
- var s = ar(e, a);
832
- f(s, function(p) {
833
- if (e.children(p.v).length) {
834
- var b = Ce(e, p.v, r, t);
835
- d[p.v] = b, Object.prototype.hasOwnProperty.call(b, "barycenter") && cr(p, b);
836
- }
837
- });
838
- var c = ir(s, r);
839
- fr(c, d);
840
- var l = dr(c, t);
841
- if (o && (l.vs = O([o, l.vs, u]), e.predecessors(o).length)) {
842
- var h = e.node(e.predecessors(o)[0]), v = e.node(e.predecessors(u)[0]);
843
- Object.prototype.hasOwnProperty.call(l, "barycenter") || (l.barycenter = 0, l.weight = 0), l.barycenter = (l.barycenter * l.weight + h.order + v.order) / (l.weight + 2), l.weight += 2;
844
- }
845
- return l;
846
- }
847
- function fr(e, n) {
848
- f(e, function(r) {
849
- r.vs = O(
850
- r.vs.map(function(t) {
851
- return n[t] ? n[t].vs : t;
852
- })
853
- );
854
- });
855
- }
856
- function cr(e, n) {
857
- m(e.barycenter) ? (e.barycenter = n.barycenter, e.weight = n.weight) : (e.barycenter = (e.barycenter * e.weight + n.barycenter * n.weight) / (e.weight + n.weight), e.weight += n.weight);
858
- }
859
- function lr(e) {
860
- var n = me(e), r = se(e, E(1, n + 1), "inEdges"), t = se(e, E(n - 1, -1, -1), "outEdges"), a = tr(e);
861
- fe(e, a);
862
- for (var i = Number.POSITIVE_INFINITY, o, u = 0, d = 0; d < 4; ++u, ++d) {
863
- hr(u % 2 ? r : t, u % 4 >= 2), a = j(e);
864
- var s = nr(e, a);
865
- s < i && (d = 0, o = Qe(a), i = s);
866
- }
867
- fe(e, o);
868
- }
869
- function se(e, n, r) {
870
- return w(n, function(t) {
871
- return Kn(e, t, r);
872
- });
873
- }
874
- function hr(e, n) {
875
- var r = new g();
876
- f(e, function(t) {
877
- var a = t.graph().root, i = Ce(t, a, r, n);
878
- f(i.vs, function(o, u) {
879
- t.node(o).order = u;
880
- }), Qn(t, r, i.vs);
881
- });
882
- }
883
- function fe(e, n) {
884
- f(n, function(r) {
885
- f(r, function(t, a) {
886
- e.node(t).order = a;
887
- });
888
- });
889
- }
890
- function vr(e) {
891
- var n = wr(e);
892
- f(e.graph().dummyChains, function(r) {
893
- for (var t = e.node(r), a = t.edgeObj, i = pr(e, n, a.v, a.w), o = i.path, u = i.lca, d = 0, s = o[d], c = !0; r !== a.w; ) {
894
- if (t = e.node(r), c) {
895
- for (; (s = o[d]) !== u && e.node(s).maxRank < t.rank; )
896
- d++;
897
- s === u && (c = !1);
898
- }
899
- if (!c) {
900
- for (; d < o.length - 1 && e.node(s = o[d + 1]).minRank <= t.rank; )
901
- d++;
902
- s = o[d];
903
- }
904
- e.setParent(r, s), r = e.successors(r)[0];
905
- }
906
- });
907
- }
908
- function pr(e, n, r, t) {
909
- var a = [], i = [], o = Math.min(n[r].low, n[t].low), u = Math.max(n[r].lim, n[t].lim), d, s;
910
- d = r;
911
- do
912
- d = e.parent(d), a.push(d);
913
- while (d && (n[d].low > o || u > n[d].lim));
914
- for (s = d, d = t; (d = e.parent(d)) !== s; )
915
- i.push(d);
916
- return { path: a.concat(i.reverse()), lca: s };
917
- }
918
- function wr(e) {
919
- var n = {}, r = 0;
920
- function t(a) {
921
- var i = r;
922
- f(e.children(a), t), n[a] = { low: i, lim: r++ };
923
- }
924
- return f(e.children(), t), n;
925
- }
926
- function br(e, n) {
927
- var r = {};
928
- function t(a, i) {
929
- var o = 0, u = 0, d = a.length, s = T(i);
930
- return f(i, function(c, l) {
931
- var h = gr(e, c), v = h ? e.node(h).order : d;
932
- (h || c === s) && (f(i.slice(u, l + 1), function(p) {
933
- f(e.predecessors(p), function(b) {
934
- var N = e.node(b), K = N.order;
935
- (K < o || v < K) && !(N.dummy && e.node(p).dummy) && Re(r, b, p);
936
- });
937
- }), u = l + 1, o = v);
938
- }), i;
939
- }
940
- return I(n, t), r;
941
- }
942
- function mr(e, n) {
943
- var r = {};
944
- function t(i, o, u, d, s) {
945
- var c;
946
- f(E(o, u), function(l) {
947
- c = i[l], e.node(c).dummy && f(e.predecessors(c), function(h) {
948
- var v = e.node(h);
949
- v.dummy && (v.order < d || v.order > s) && Re(r, h, c);
950
- });
951
- });
952
- }
953
- function a(i, o) {
954
- var u = -1, d, s = 0;
955
- return f(o, function(c, l) {
956
- if (e.node(c).dummy === "border") {
957
- var h = e.predecessors(c);
958
- h.length && (d = e.node(h[0]).order, t(o, s, l, u, d), s = l, u = d);
959
- }
960
- t(o, s, o.length, d, i.length);
961
- }), o;
962
- }
963
- return I(n, a), r;
964
- }
965
- function gr(e, n) {
966
- if (e.node(n).dummy)
967
- return z(e.predecessors(n), function(r) {
968
- return e.node(r).dummy;
969
- });
970
- }
971
- function Re(e, n, r) {
972
- if (n > r) {
973
- var t = n;
974
- n = r, r = t;
975
- }
976
- Object.prototype.hasOwnProperty.call(e, n) || Object.defineProperty(e, n, {
977
- enumerable: !0,
978
- configurable: !0,
979
- value: {},
980
- writable: !0
981
- });
982
- var a = e[n];
983
- Object.defineProperty(a, r, {
984
- enumerable: !0,
985
- configurable: !0,
986
- value: !0,
987
- writable: !0
988
- });
989
- }
990
- function yr(e, n, r) {
991
- if (n > r) {
992
- var t = n;
993
- n = r, r = t;
994
- }
995
- return !!e[n] && Object.prototype.hasOwnProperty.call(e[n], r);
996
- }
997
- function kr(e, n, r, t) {
998
- var a = {}, i = {}, o = {};
999
- return f(n, function(u) {
1000
- f(u, function(d, s) {
1001
- a[d] = d, i[d] = d, o[d] = s;
1002
- });
1003
- }), f(n, function(u) {
1004
- var d = -1;
1005
- f(u, function(s) {
1006
- var c = t(s);
1007
- if (c.length) {
1008
- c = R(c, function(b) {
1009
- return o[b];
1010
- });
1011
- for (var l = (c.length - 1) / 2, h = Math.floor(l), v = Math.ceil(l); h <= v; ++h) {
1012
- var p = c[h];
1013
- i[s] === s && d < o[p] && !yr(r, s, p) && (i[p] = s, i[s] = a[s] = a[p], d = o[p]);
1014
- }
1015
- }
1016
- });
1017
- }), { root: a, align: i };
1018
- }
1019
- function xr(e, n, r, t, a) {
1020
- var i = {}, o = Er(e, n, r, a), u = a ? "borderLeft" : "borderRight";
1021
- function d(l, h) {
1022
- for (var v = o.nodes(), p = v.pop(), b = {}; p; )
1023
- b[p] ? l(p) : (b[p] = !0, v.push(p), v = v.concat(h(p))), p = v.pop();
1024
- }
1025
- function s(l) {
1026
- i[l] = o.inEdges(l).reduce(function(h, v) {
1027
- return Math.max(h, i[v.v] + o.edge(v));
1028
- }, 0);
1029
- }
1030
- function c(l) {
1031
- var h = o.outEdges(l).reduce(function(p, b) {
1032
- return Math.min(p, i[b.w] - o.edge(b));
1033
- }, Number.POSITIVE_INFINITY), v = e.node(l);
1034
- h !== Number.POSITIVE_INFINITY && v.borderType !== u && (i[l] = Math.max(i[l], h));
1035
- }
1036
- return d(s, o.predecessors.bind(o)), d(c, o.successors.bind(o)), f(t, function(l) {
1037
- i[l] = i[r[l]];
1038
- }), i;
1039
- }
1040
- function Er(e, n, r, t) {
1041
- var a = new g(), i = e.graph(), o = _r(i.nodesep, i.edgesep, t);
1042
- return f(n, function(u) {
1043
- var d;
1044
- f(u, function(s) {
1045
- var c = r[s];
1046
- if (a.setNode(c), d) {
1047
- var l = r[d], h = a.edge(l, c);
1048
- a.setEdge(l, c, Math.max(o(e, s, d), h || 0));
1049
- }
1050
- d = s;
1051
- });
1052
- }), a;
1053
- }
1054
- function Or(e, n) {
1055
- return U(x(n), function(r) {
1056
- var t = Number.NEGATIVE_INFINITY, a = Number.POSITIVE_INFINITY;
1057
- return Ke(r, function(i, o) {
1058
- var u = Cr(e, o) / 2;
1059
- t = Math.max(i + u, t), a = Math.min(i - u, a);
1060
- }), t - a;
1061
- });
1062
- }
1063
- function Lr(e, n) {
1064
- var r = x(n), t = P(r), a = y(r);
1065
- f(["u", "d"], function(i) {
1066
- f(["l", "r"], function(o) {
1067
- var u = i + o, d = e[u], s;
1068
- if (d !== n) {
1069
- var c = x(d);
1070
- s = o === "l" ? t - P(c) : a - y(c), s && (e[u] = S(d, function(l) {
1071
- return l + s;
1072
- }));
1073
- }
1074
- });
1075
- });
1076
- }
1077
- function Nr(e, n) {
1078
- return S(e.ul, function(r, t) {
1079
- if (n)
1080
- return e[n.toLowerCase()][t];
1081
- var a = R(w(e, t));
1082
- return (a[1] + a[2]) / 2;
1083
- });
1084
- }
1085
- function Pr(e) {
1086
- var n = j(e), r = q(br(e, n), mr(e, n)), t = {}, a;
1087
- f(["u", "d"], function(o) {
1088
- a = o === "u" ? n : x(n).reverse(), f(["l", "r"], function(u) {
1089
- u === "r" && (a = w(a, function(l) {
1090
- return x(l).reverse();
1091
- }));
1092
- var d = (o === "u" ? e.predecessors : e.successors).bind(e), s = kr(e, a, r, d), c = xr(e, a, s.root, s.align, u === "r");
1093
- u === "r" && (c = S(c, function(l) {
1094
- return -l;
1095
- })), t[o + u] = c;
1096
- });
1097
- });
1098
- var i = Or(e, t);
1099
- return Lr(t, i), Nr(t, e.graph().align);
1100
- }
1101
- function _r(e, n, r) {
1102
- return function(t, a, i) {
1103
- var o = t.node(a), u = t.node(i), d = 0, s;
1104
- if (d += o.width / 2, Object.prototype.hasOwnProperty.call(o, "labelpos"))
1105
- switch (o.labelpos.toLowerCase()) {
1106
- case "l":
1107
- s = -o.width / 2;
1108
- break;
1109
- case "r":
1110
- s = o.width / 2;
1111
- break;
1112
- }
1113
- if (s && (d += r ? s : -s), s = 0, d += (o.dummy ? n : e) / 2, d += (u.dummy ? n : e) / 2, d += u.width / 2, Object.prototype.hasOwnProperty.call(u, "labelpos"))
1114
- switch (u.labelpos.toLowerCase()) {
1115
- case "l":
1116
- s = u.width / 2;
1117
- break;
1118
- case "r":
1119
- s = -u.width / 2;
1120
- break;
1121
- }
1122
- return s && (d += r ? s : -s), s = 0, d;
1123
- };
1124
- }
1125
- function Cr(e, n) {
1126
- return e.node(n).width;
1127
- }
1128
- function Rr(e) {
1129
- e = be(e), Tr(e), en(Pr(e), function(n, r) {
1130
- e.node(r).x = n;
1131
- });
1132
- }
1133
- function Tr(e) {
1134
- var n = j(e), r = e.graph().ranksep, t = 0;
1135
- f(n, function(a) {
1136
- var i = y(
1137
- w(a, function(o) {
1138
- return e.node(o).height;
1139
- })
1140
- );
1141
- f(a, function(o) {
1142
- e.node(o).y = t + i / 2;
1143
- }), t += i + r;
1144
- });
1145
- }
1146
- function it(e, n) {
1147
- var r = _n;
1148
- r("layout", () => {
1149
- var t = r(" buildLayoutGraph", () => Dr(e));
1150
- r(" runLayout", () => Mr(t, r)), r(" updateInputGraph", () => Ir(e, t));
1151
- });
1152
- }
1153
- function Mr(e, n) {
1154
- n(" makeSpaceForEdgeLabels", () => $r(e)), n(" removeSelfEdges", () => Qr(e)), n(" acyclic", () => kn(e)), n(" nestingGraph.run", () => Un(e)), n(" rank", () => Wn(be(e))), n(" injectEdgeLabelProxies", () => qr(e)), n(" removeEmptyRanks", () => Nn(e)), n(" nestingGraph.cleanup", () => Jn(e)), n(" normalizeRanks", () => Ln(e)), n(" assignRankMinMax", () => Wr(e)), n(" removeEdgeLabelProxies", () => Xr(e)), n(" normalize.run", () => Sn(e)), n(" parentDummyChains", () => vr(e)), n(" addBorderSegments", () => Cn(e)), n(" order", () => lr(e)), n(" insertSelfEdges", () => Kr(e)), n(" adjustCoordinateSystem", () => Rn(e)), n(" position", () => Rr(e)), n(" positionSelfEdges", () => et(e)), n(" removeBorderNodes", () => Jr(e)), n(" normalize.undo", () => Fn(e)), n(" fixupEdgeLabelCoords", () => Hr(e)), n(" undoCoordinateSystem", () => Tn(e)), n(" translateGraph", () => zr(e)), n(" assignNodeIntersects", () => Ur(e)), n(" reversePoints", () => Zr(e)), n(" acyclic.undo", () => En(e));
1155
- }
1156
- function Ir(e, n) {
1157
- f(e.nodes(), function(r) {
1158
- var t = e.node(r), a = n.node(r);
1159
- t && (t.x = a.x, t.y = a.y, n.children(r).length && (t.width = a.width, t.height = a.height));
1160
- }), f(e.edges(), function(r) {
1161
- var t = e.edge(r), a = n.edge(r);
1162
- t.points = a.points, Object.prototype.hasOwnProperty.call(a, "x") && (t.x = a.x, t.y = a.y);
1163
- }), e.graph().width = n.graph().width, e.graph().height = n.graph().height;
1164
- }
1165
- var Sr = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], jr = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, Fr = ["acyclicer", "ranker", "rankdir", "align"], Vr = ["width", "height"], Ar = { width: 0, height: 0 }, Br = ["minlen", "weight", "width", "height", "labeloffset"], Gr = {
1166
- minlen: 1,
1167
- weight: 1,
1168
- width: 0,
1169
- height: 0,
1170
- labeloffset: 10,
1171
- labelpos: "r"
1172
- }, Yr = ["labelpos"];
1173
- function Dr(e) {
1174
- var n = new g({ multigraph: !0, compound: !0 }), r = D(e.graph());
1175
- return n.setGraph(
1176
- q({}, jr, Y(r, Sr), M(r, Fr))
1177
- ), f(e.nodes(), function(t) {
1178
- var a = D(e.node(t));
1179
- n.setNode(t, Be(Y(a, Vr), Ar)), n.setParent(t, e.parent(t));
1180
- }), f(e.edges(), function(t) {
1181
- var a = D(e.edge(t));
1182
- n.setEdge(
1183
- t,
1184
- q({}, Gr, Y(a, Br), M(a, Yr))
1185
- );
1186
- }), n;
1187
- }
1188
- function $r(e) {
1189
- var n = e.graph();
1190
- n.ranksep /= 2, f(e.edges(), function(r) {
1191
- var t = e.edge(r);
1192
- t.minlen *= 2, t.labelpos.toLowerCase() !== "c" && (n.rankdir === "TB" || n.rankdir === "BT" ? t.width += t.labeloffset : t.height += t.labeloffset);
1193
- });
1194
- }
1195
- function qr(e) {
1196
- f(e.edges(), function(n) {
1197
- var r = e.edge(n);
1198
- if (r.width && r.height) {
1199
- var t = e.node(n.v), a = e.node(n.w), i = { rank: (a.rank - t.rank) / 2 + t.rank, e: n };
1200
- L(e, "edge-proxy", i, "_ep");
1201
- }
1202
- });
1203
- }
1204
- function Wr(e) {
1205
- var n = 0;
1206
- f(e.nodes(), function(r) {
1207
- var t = e.node(r);
1208
- t.borderTop && (t.minRank = e.node(t.borderTop).rank, t.maxRank = e.node(t.borderBottom).rank, n = y(n, t.maxRank));
1209
- }), e.graph().maxRank = n;
1210
- }
1211
- function Xr(e) {
1212
- f(e.nodes(), function(n) {
1213
- var r = e.node(n);
1214
- r.dummy === "edge-proxy" && (e.edge(r.e).labelRank = r.rank, e.removeNode(n));
1215
- });
1216
- }
1217
- function zr(e) {
1218
- var n = Number.POSITIVE_INFINITY, r = 0, t = Number.POSITIVE_INFINITY, a = 0, i = e.graph(), o = i.marginx || 0, u = i.marginy || 0;
1219
- function d(s) {
1220
- var c = s.x, l = s.y, h = s.width, v = s.height;
1221
- n = Math.min(n, c - h / 2), r = Math.max(r, c + h / 2), t = Math.min(t, l - v / 2), a = Math.max(a, l + v / 2);
1222
- }
1223
- f(e.nodes(), function(s) {
1224
- d(e.node(s));
1225
- }), f(e.edges(), function(s) {
1226
- var c = e.edge(s);
1227
- Object.prototype.hasOwnProperty.call(c, "x") && d(c);
1228
- }), n -= o, t -= u, f(e.nodes(), function(s) {
1229
- var c = e.node(s);
1230
- c.x -= n, c.y -= t;
1231
- }), f(e.edges(), function(s) {
1232
- var c = e.edge(s);
1233
- f(c.points, function(l) {
1234
- l.x -= n, l.y -= t;
1235
- }), Object.prototype.hasOwnProperty.call(c, "x") && (c.x -= n), Object.prototype.hasOwnProperty.call(c, "y") && (c.y -= t);
1236
- }), i.width = r - n + o, i.height = a - t + u;
1237
- }
1238
- function Ur(e) {
1239
- f(e.edges(), function(n) {
1240
- var r = e.edge(n), t = e.node(n.v), a = e.node(n.w), i, o;
1241
- r.points ? (i = r.points[0], o = r.points[r.points.length - 1]) : (r.points = [], i = a, o = t), r.points.unshift(re(t, i)), r.points.push(re(a, o));
1242
- });
1243
- }
1244
- function Hr(e) {
1245
- f(e.edges(), function(n) {
1246
- var r = e.edge(n);
1247
- if (Object.prototype.hasOwnProperty.call(r, "x"))
1248
- switch ((r.labelpos === "l" || r.labelpos === "r") && (r.width -= r.labeloffset), r.labelpos) {
1249
- case "l":
1250
- r.x -= r.width / 2 + r.labeloffset;
1251
- break;
1252
- case "r":
1253
- r.x += r.width / 2 + r.labeloffset;
1254
- break;
1255
- }
1256
- });
1257
- }
1258
- function Zr(e) {
1259
- f(e.edges(), function(n) {
1260
- var r = e.edge(n);
1261
- r.reversed && r.points.reverse();
1262
- });
1263
- }
1264
- function Jr(e) {
1265
- f(e.nodes(), function(n) {
1266
- if (e.children(n).length) {
1267
- var r = e.node(n), t = e.node(r.borderTop), a = e.node(r.borderBottom), i = e.node(T(r.borderLeft)), o = e.node(T(r.borderRight));
1268
- r.width = Math.abs(o.x - i.x), r.height = Math.abs(a.y - t.y), r.x = i.x + r.width / 2, r.y = t.y + r.height / 2;
1269
- }
1270
- }), f(e.nodes(), function(n) {
1271
- e.node(n).dummy === "border" && e.removeNode(n);
1272
- });
1273
- }
1274
- function Qr(e) {
1275
- f(e.edges(), function(n) {
1276
- if (n.v === n.w) {
1277
- var r = e.node(n.v);
1278
- r.selfEdges || (r.selfEdges = []), r.selfEdges.push({ e: n, label: e.edge(n) }), e.removeEdge(n);
1279
- }
1280
- });
1281
- }
1282
- function Kr(e) {
1283
- var n = j(e);
1284
- f(n, function(r) {
1285
- var t = 0;
1286
- f(r, function(a, i) {
1287
- var o = e.node(a);
1288
- o.order = i + t, f(o.selfEdges, function(u) {
1289
- L(
1290
- e,
1291
- "selfedge",
1292
- {
1293
- width: u.label.width,
1294
- height: u.label.height,
1295
- rank: o.rank,
1296
- order: i + ++t,
1297
- e: u.e,
1298
- label: u.label
1299
- },
1300
- "_se"
1301
- );
1302
- }), delete o.selfEdges;
1303
- });
1304
- });
1305
- }
1306
- function et(e) {
1307
- f(e.nodes(), function(n) {
1308
- var r = e.node(n);
1309
- if (r.dummy === "selfedge") {
1310
- var t = e.node(r.e.v), a = t.x + t.width / 2, i = t.y, o = r.x - a, u = t.height / 2;
1311
- e.setEdge(r.e, r.label), e.removeNode(n), r.label.points = [
1312
- { x: a + 2 * o / 3, y: i - u },
1313
- { x: a + 5 * o / 6, y: i - u },
1314
- { x: a + o, y: i },
1315
- { x: a + 5 * o / 6, y: i + u },
1316
- { x: a + 2 * o / 3, y: i + u }
1317
- ], r.label.x = r.x, r.label.y = r.y;
1318
- }
1319
- });
1320
- }
1321
- function Y(e, n) {
1322
- return S(M(e, n), Number);
1323
- }
1324
- function D(e) {
1325
- var n = {};
1326
- return f(e, function(r, t) {
1327
- n[t.toLowerCase()] = r;
1328
- }), n;
1329
- }
1330
- export {
1331
- it as l
1332
- };