filecat 7.7.1 → 7.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/build/dist/1045.0e4bdc838c37771a7f50.js +1 -0
  2. package/build/dist/1075.493acb74297c1e753de2.js +1 -0
  3. package/build/dist/1128.b80776fbdbdda36034c3.js +1 -0
  4. package/build/dist/1388.1dcf844b452e3aae3dc0.js +1 -0
  5. package/build/dist/1671.fb137d27b5763953487e.js +1 -0
  6. package/build/dist/{6887.93191dae462af3692775.js → 1738.b8ab2bd79df131e60051.js} +1 -1
  7. package/build/dist/1802.e43e833638f6ba8e22d7.js +1 -0
  8. package/build/dist/1964.bd3d684b50aa5191b413.js +1 -0
  9. package/build/dist/200.bb7f6ce5543bd7ff6d97.js +1 -0
  10. package/build/dist/2105.e4ba1c1d506b3fe14e8e.js +1 -0
  11. package/build/dist/2122.bc10dcdbbfc38e0ef883.js +1 -0
  12. package/build/dist/{3457.18b45379d8bcf7f5f3b5.js → 2180.df641ebaead77c4ada71.js} +1 -1
  13. package/build/dist/2300.9e1baa1c0368abe53d96.js +2 -0
  14. package/build/dist/2479.15722ac55b05c521f4f7.js +1 -0
  15. package/build/dist/2572.8fdddfebb4da2f29dbd8.js +1 -0
  16. package/build/dist/259.81bb9e049e5ef587a96f.js +1 -0
  17. package/build/dist/2674.0c822a9c458f923a4eff.js +1 -0
  18. package/build/dist/{1001.44a1a25c7d6d3f294bf3.js → 2822.9417e764a14f8f5f57dc.js} +1 -1
  19. package/build/dist/2994.c492be0d907fa468a9be.js +1 -0
  20. package/build/dist/{3140.b078ec311f99170b7f4c.js → 3140.794a212da633caf38b3a.js} +2 -2
  21. package/build/dist/3230.7798ab546facfa058b34.js +1 -0
  22. package/build/dist/3233.fb6bffd5e097e4ac9423.js +1 -0
  23. package/build/dist/3283.9386fc7f67aef46604fb.js +1 -0
  24. package/build/dist/3299.d01f5a742d80f4e6e25b.js +1 -0
  25. package/build/dist/3300.b8a3bc571293a6280ed8.js +1 -0
  26. package/build/dist/{3402.d412940350051a52d7ac.js → 3402.b6dc28d2f9bace7cde85.js} +1 -1
  27. package/build/dist/3509.cbcb309fbf49db53229f.js +1 -0
  28. package/build/dist/{3727.b8d9cbae9de47bf8d49b.js → 3510.b975b8bfdee5e8518215.js} +1 -1
  29. package/build/dist/{587.c75ed69a8373139346f9.js → 3566.ba323afadcf41fad2fa7.js} +1 -1
  30. package/build/dist/3608.aff9429024b740ac5cd0.js +1 -0
  31. package/build/dist/3990.5e16453f57b90b01d539.js +1 -0
  32. package/build/dist/4004.de90f1192487a24a0a9a.js +1 -0
  33. package/build/dist/4061.c0eb5824eeb6a59fa827.js +1 -0
  34. package/build/dist/4220.b65b40382726a69ba0bc.js +1 -0
  35. package/build/dist/{3883.70d42c3a335d6833f07e.js → 4376.b022a792fb34fbe50398.js} +1 -1
  36. package/build/dist/4437.4d5a0965043471411a00.js +1 -0
  37. package/build/dist/4469.536491f90535e831ce3e.js +1 -0
  38. package/build/dist/453.8877eb10f13258c290bc.js +1 -0
  39. package/build/dist/4560.8ef2e4b60cc86d019dd6.js +1 -0
  40. package/build/dist/4735.838cd0f656bbf7d99ff6.js +1 -0
  41. package/build/dist/4772.9b95c402a4def0f576e3.js +1 -0
  42. package/build/dist/4985.44cb7d829ca477e368b8.js +1 -0
  43. package/build/dist/5516.645e4a900df9bdc1806c.js +1 -0
  44. package/build/dist/5526.6b4867751becda056ed8.js +1 -0
  45. package/build/dist/5614.fb6bffd5e097e4ac9423.js +1 -0
  46. package/build/dist/5617.8efc3b1d218f80df9b39.js +1 -0
  47. package/build/dist/5744.e9f1efb88a617b05b709.js +1 -0
  48. package/build/dist/583.cef46d6b21c6fa6454cf.js +1 -0
  49. package/build/dist/6089.6d5d19a327284ff3b11c.js +1 -0
  50. package/build/dist/6164.7dae9989dd129479f952.js +1 -0
  51. package/build/dist/6284.10deb80685728f50aa45.js +1 -0
  52. package/build/dist/629.b75b024aacc43e0d69cf.js +1 -0
  53. package/build/dist/6344.291e5dadc74e62739774.js +1 -0
  54. package/build/dist/6492.3ee4060598de873d8e8f.js +1 -0
  55. package/build/dist/6571.b381c44055704e3ba649.js +1 -0
  56. package/build/dist/6731.6763296ce5ae210bc0fe.js +1 -0
  57. package/build/dist/6759.f88b50c41207cb8345d1.js +1 -0
  58. package/build/dist/{4951.88718d978aea2dd40006.js → 6789.34921a30c8a81f0a6407.js} +1 -1
  59. package/build/dist/6800.ee99fd0a88b6acbaaf2c.js +1 -0
  60. package/build/dist/6803.fe4297b1e51c3bfc7f50.js +1 -0
  61. package/build/dist/{313.d51fc773856f078487ad.js → 6806.9ebf089eba60f3b8e946.js} +1 -1
  62. package/build/dist/7038.4e4fc8e405c56d3080e2.js +1 -0
  63. package/build/dist/7310.bf944d03f24fcf109680.js +1 -0
  64. package/build/dist/{359.1b95bd6368196ccaa731.js → 7430.25bf8437ad8f7c1fd36f.js} +1 -1
  65. package/build/dist/7483.5e26ada69b33418c31a8.js +1 -0
  66. package/build/dist/{4087.4796ff56340985c35542.js → 7486.fe0b5f867c08b40a3360.js} +1 -1
  67. package/build/dist/7567.09e1b34ad9bd3e463eb4.js +1 -0
  68. package/build/dist/7834.7a593dcb80ca09f58586.js +1 -0
  69. package/build/dist/784.48a3b71205680f427109.js +1 -0
  70. package/build/dist/7943.54c702542d55f576a576.js +1 -0
  71. package/build/dist/7954.6ce241a8ed27cb26efc6.js +1 -0
  72. package/build/dist/8079.f6f2be43e5d933ae1f6f.js +1 -0
  73. package/build/dist/8677.860320b7f36947e57d11.js +1 -0
  74. package/build/dist/8727.3628c746061aed7a4077.js +1 -0
  75. package/build/dist/9299.ed4de6cd4f4bfa0a966a.js +1 -0
  76. package/build/dist/9324.ef229da9b943484298ba.js +1 -0
  77. package/build/dist/9364.d2570d78afc50fe1b23e.js +1 -0
  78. package/build/dist/9463.2629a7daf4c2865b9b96.js +1 -0
  79. package/build/dist/index.html +1 -1
  80. package/build/dist/main.98bb29605335d9b2219f.js +2 -0
  81. package/build/main.js +1 -1
  82. package/build/threads.work.filecat.js +1 -1
  83. package/package.json +4 -5
  84. package/shell/config/webpack.web.config.js +2 -2
  85. package/build/dist/1075.3ef2e1902e9f7e9e37b1.js +0 -1
  86. package/build/dist/1312.199a506fb836a2412255.js +0 -1
  87. package/build/dist/136.e3bb3c50051edb17454d.js +0 -1
  88. package/build/dist/1478.c58a43bb24820a13eaed.js +0 -1
  89. package/build/dist/1491.901cce0168c42ad319fa.js +0 -1
  90. package/build/dist/1566.4f405afd26063b55129c.js +0 -1
  91. package/build/dist/161.98f6c2a50bf3824a6efb.js +0 -1
  92. package/build/dist/1654.a21a099e2749ef167ea9.js +0 -1
  93. package/build/dist/1875.46dd3a6cc071d45a32f1.js +0 -1
  94. package/build/dist/1883.14c90bbe93fe206906f0.js +0 -1
  95. package/build/dist/1924.c7bd2a2aa0e9bc78c9ba.js +0 -1
  96. package/build/dist/2000.f55ddba9e6313243f028.js +0 -1
  97. package/build/dist/2101.d4efa6a2c1e9169d9225.js +0 -1
  98. package/build/dist/2180.60fe32ab12c2fa1570a4.js +0 -1
  99. package/build/dist/2191.4c4f2fd5127168a81877.js +0 -1
  100. package/build/dist/2213.ceffb8fd7be66b35d079.js +0 -1
  101. package/build/dist/2463.6e530d1e9b5c58dba166.js +0 -1
  102. package/build/dist/2623.8b1e5e391dd4e05fc119.js +0 -1
  103. package/build/dist/2674.3713c09449bdd57b1066.js +0 -1
  104. package/build/dist/2894.8395ec5e280cc6b6c4dc.js +0 -1
  105. package/build/dist/3042.f490cfa4208208262398.js +0 -1
  106. package/build/dist/3096.d0b2c77a23418c545c01.js +0 -1
  107. package/build/dist/311.da79ace98b69a635c41c.js +0 -1
  108. package/build/dist/3166.088cf4a0356c3a6e30a0.js +0 -1
  109. package/build/dist/3233.80bcbba8a50c0f85ceee.js +0 -1
  110. package/build/dist/3357.4f1bf81ecc3c11a3f813.js +0 -1
  111. package/build/dist/3475.d10d21b637761d7d886d.js +0 -1
  112. package/build/dist/3708.04401b24d95214d641e5.js +0 -1
  113. package/build/dist/3752.01fc1f14b29f340e41fd.js +0 -1
  114. package/build/dist/3871.7a387a9dc21883d08423.js +0 -1
  115. package/build/dist/3994.19fb81947d65fc81b0a2.js +0 -1
  116. package/build/dist/4012.b516fdc981e55be2ebb2.js +0 -1
  117. package/build/dist/4122.9ea6b5dd8dc9d2265825.js +0 -1
  118. package/build/dist/4141.06960673a6a484e7b88d.js +0 -1
  119. package/build/dist/4190.ff72264b4f07f6542d33.js +0 -1
  120. package/build/dist/4239.1b49d7c26192fb637d57.js +0 -1
  121. package/build/dist/4288.8dc8f5d962720e084952.js +0 -1
  122. package/build/dist/434.04cdc2a05316f92d1d38.js +0 -1
  123. package/build/dist/4376.f3c60897f70dd4e33d2f.js +0 -1
  124. package/build/dist/4472.38816dfb835d527175d6.js +0 -1
  125. package/build/dist/4473.b42b37616f13be64199b.js +0 -1
  126. package/build/dist/449.3fd75e05da22fe1c5ecc.js +0 -1
  127. package/build/dist/452.4974390f4f4d991216e5.js +0 -1
  128. package/build/dist/4547.36b5848220c04c47bc80.js +0 -1
  129. package/build/dist/4605.ef0f4204b3bf3a18efa6.js +0 -1
  130. package/build/dist/4804.fbd0ffcf57d9dffc15b7.js +0 -1
  131. package/build/dist/482.0c7512372a1fbf61d704.js +0 -1
  132. package/build/dist/4963.22d7db9b376a42d3f00b.js +0 -1
  133. package/build/dist/5097.a0de16bf7b90a8b1157d.js +0 -1
  134. package/build/dist/5123.d9ed79af478b5cc4f1b2.js +0 -1
  135. package/build/dist/5332.8b6e85d8764e907a01d5.js +0 -1
  136. package/build/dist/536.660d866952b46ba53180.js +0 -1
  137. package/build/dist/548.d3d912d0c0c7e835e1dc.js +0 -1
  138. package/build/dist/5516.cc92dfbf06ddcd133dbc.js +0 -1
  139. package/build/dist/5590.585778da623ec71f7722.js +0 -1
  140. package/build/dist/5614.80bcbba8a50c0f85ceee.js +0 -1
  141. package/build/dist/5616.14df0fe505c4dadf4042.js +0 -1
  142. package/build/dist/5695.95dc69f3b02812eb9e93.js +0 -1
  143. package/build/dist/5697.6ac62f99ca19a979f1eb.js +0 -1
  144. package/build/dist/5741.237d817efc942de875e5.js +0 -1
  145. package/build/dist/5849.d26365d4b19533db6fd6.js +0 -1
  146. package/build/dist/5902.3969a79465383ff4bbb4.js +0 -1
  147. package/build/dist/5937.c3f14ccc441bfd06e13d.js +0 -1
  148. package/build/dist/5942.981e03467a3b2c653ab8.js +0 -1
  149. package/build/dist/6029.63e4beb66df7afc65a90.js +0 -1
  150. package/build/dist/6054.f91307b52046172fc5f8.js +0 -1
  151. package/build/dist/6089.0863a6a09be2b97e84e1.js +0 -1
  152. package/build/dist/6095.d845e356a4db8a241cdb.js +0 -1
  153. package/build/dist/6114.ca67e88c701691b3bb1e.js +0 -1
  154. package/build/dist/612.74d77e32957a5c6eb197.js +0 -1
  155. package/build/dist/625.d9e531476b3306e0b837.js +0 -1
  156. package/build/dist/6318.66541f9cef18d14ea3ea.js +0 -1
  157. package/build/dist/6455.5c950f6eb61015409eb6.js +0 -1
  158. package/build/dist/6527.436d2d5d81376e6a54ae.js +0 -1
  159. package/build/dist/6530.2f1b283a902603262048.js +0 -1
  160. package/build/dist/6610.b92f337fcc1b347350fb.js +0 -1
  161. package/build/dist/6926.2786af754adcdabfbede.js +0 -1
  162. package/build/dist/697.62f8b1ec6d2cd40ed316.js +0 -1
  163. package/build/dist/70.be2f9130c93c4175d12f.js +0 -1
  164. package/build/dist/7081.9e1e196fecfcccb4bfb9.js +0 -1
  165. package/build/dist/7128.3573ab2a5f28b79ba89e.js +0 -1
  166. package/build/dist/7163.ad09accaa87e565b8dc0.js +0 -1
  167. package/build/dist/72.a1d87dabb7f0615b3a21.js +0 -1
  168. package/build/dist/7229.50a1700104d1e4732735.js +0 -1
  169. package/build/dist/7332.d024ae75a3da2f7674a1.js +0 -1
  170. package/build/dist/7509.370c49d7ff43e289190c.js +0 -1
  171. package/build/dist/7514.dbf525bade6ffbd70af6.js +0 -2
  172. package/build/dist/7557.7d62939c56391a647067.js +0 -1
  173. package/build/dist/7588.2d840229f62de92b22e5.js +0 -1
  174. package/build/dist/7632.5660653552f755580adc.js +0 -1
  175. package/build/dist/7639.b3c6382de2fde652a40b.js +0 -1
  176. package/build/dist/779.91614fabf5c9eb3aafa0.js +0 -1
  177. package/build/dist/7810.979796e8a3aad6d4d72f.js +0 -1
  178. package/build/dist/7897.8b8070d6abe5c2327168.js +0 -1
  179. package/build/dist/7941.dbef0b0f412899800b13.js +0 -1
  180. package/build/dist/7953.5cd280effe2e967ea490.js +0 -1
  181. package/build/dist/7954.efecc100b407af204add.js +0 -1
  182. package/build/dist/7959.e31a21f28ff463d9d5e9.js +0 -1
  183. package/build/dist/8034.301f1099c4a7ce6c2829.js +0 -1
  184. package/build/dist/8080.e1c9af30bdd818b08c6e.js +0 -1
  185. package/build/dist/8087.6452b67614a0855535a4.js +0 -1
  186. package/build/dist/8140.bbccc589b007f9d410d1.js +0 -1
  187. package/build/dist/8162.e47cccbe327b26a2ea6f.js +0 -1
  188. package/build/dist/8177.d669c6337f8814781f49.js +0 -1
  189. package/build/dist/8322.56c8f4b4ad93b1a866c8.js +0 -1
  190. package/build/dist/8376.01a9f23ba06a78922364.js +0 -1
  191. package/build/dist/8433.e54d57e2cc9408e5e411.js +0 -1
  192. package/build/dist/8460.25f0859cb2266f764113.js +0 -1
  193. package/build/dist/8524.7945bff0063dc5c5903d.js +0 -1
  194. package/build/dist/8782.a5498372f1eb6bab41b7.js +0 -1
  195. package/build/dist/8953.23fe6fe13b28168428d3.js +0 -1
  196. package/build/dist/8964.bdf168262ab40956654a.js +0 -1
  197. package/build/dist/9003.69a0d15e722e1ed455b0.js +0 -1
  198. package/build/dist/9299.c2699815e5339e4045f8.js +0 -1
  199. package/build/dist/9385.2b1afe7b55d4c16f97ad.js +0 -1
  200. package/build/dist/9428.3176bab8f5780f060d51.js +0 -1
  201. package/build/dist/9456.506d55e351dec4f45566.js +0 -1
  202. package/build/dist/9465.8ff5871fb708cf7c1021.js +0 -1
  203. package/build/dist/9500.95d19d78b580734ec35e.js +0 -1
  204. package/build/dist/9512.03215278f26dc63c056d.js +0 -1
  205. package/build/dist/9614.cfdbe03d8e2960b0a53a.js +0 -1
  206. package/build/dist/9651.6bf3e34362f10c1aa35d.js +0 -1
  207. package/build/dist/9788.4a1c2f3626e532d3b44c.js +0 -1
  208. package/build/dist/9943.b62436bd9d0730c715a9.js +0 -1
  209. package/build/dist/9967.216bc8d26440bcbaf785.js +0 -1
  210. package/build/dist/9970.aa60aa700a790ba226f0.js +0 -1
  211. package/build/dist/main.401995af1fd441fa9164.js +0 -2
  212. /package/build/dist/{7514.dbf525bade6ffbd70af6.js.LICENSE.txt → 2300.9e1baa1c0368abe53d96.js.LICENSE.txt} +0 -0
  213. /package/build/dist/{3140.b078ec311f99170b7f4c.js.LICENSE.txt → 3140.794a212da633caf38b3a.js.LICENSE.txt} +0 -0
  214. /package/build/dist/{main.401995af1fd441fa9164.js.LICENSE.txt → main.98bb29605335d9b2219f.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6344],{26527(t,e,i){var n;n=function(t){return(()=>{"use strict";var e={658:t=>{t.exports=null!=Object.assign?Object.assign.bind(Object):function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return i.forEach(function(e){Object.keys(e).forEach(function(i){return t[i]=e[i]})}),t}},548:(t,e,i)=>{var n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var i=[],n=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){r=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(r)throw o}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=i(140).layoutBase.LinkedList,o={getTopMostNodes:function(t){for(var e={},i=0;i<t.length;i++)e[t[i].id()]=!0;var n=t.filter(function(t,i){"number"==typeof t&&(t=i);for(var n=t.parent()[0];null!=n;){if(e[n.id()])return!1;n=n.parent()[0]}return!0});return n},connectComponents:function(t,e,i,n){var o=new r,s=new Set,a=[],h=void 0,l=void 0,d=void 0,c=!1,g=1,u=[],f=[],p=function(){var n=t.collection();f.push(n);var r=i[0],p=t.collection();p.merge(r).merge(r.descendants().intersection(e)),a.push(r),p.forEach(function(t){o.push(t),s.add(t),n.merge(t)});for(var m=function(){r=o.shift();var l=t.collection();r.neighborhood().nodes().forEach(function(t){e.intersection(r.edgesWith(t)).length>0&&l.merge(t)});for(var d=0;d<l.length;d++){var c=l[d];null==(h=i.intersection(c.union(c.ancestors())))||s.has(h[0])||h.union(h.descendants()).forEach(function(t){o.push(t),s.add(t),n.merge(t),i.has(t)&&a.push(t)})}};0!=o.length;)m();if(n.forEach(function(t){e.intersection(t.connectedEdges()).forEach(function(t){n.has(t.source())&&n.has(t.target())&&n.merge(t)})}),a.length==i.length&&(c=!0),!c||c&&g>1){l=a[0],d=l.connectedEdges().length,a.forEach(function(t){t.connectedEdges().length<d&&(d=t.connectedEdges().length,l=t)}),u.push(l.id());var y=t.collection();y.merge(a[0]),a.forEach(function(t){y.merge(t)}),a=[],i=i.difference(y),g++}};do{p()}while(!c);return n&&u.length>0&&n.set("dummy"+(n.size+1),u),f},relocateComponent:function(t,e,i){if(!i.fixedNodeConstraint){var r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;if("draft"==i.quality){var h=!0,l=!1,d=void 0;try{for(var c,g=e.nodeIndexes[Symbol.iterator]();!(h=(c=g.next()).done);h=!0){var u=c.value,f=n(u,2),p=f[0],m=f[1],y=i.cy.getElementById(p);if(y){var v=y.boundingBox(),E=e.xCoords[m]-v.w/2,N=e.xCoords[m]+v.w/2,T=e.yCoords[m]-v.h/2,A=e.yCoords[m]+v.h/2;E<r&&(r=E),N>o&&(o=N),T<s&&(s=T),A>a&&(a=A)}}}catch(t){l=!0,d=t}finally{try{!h&&g.return&&g.return()}finally{if(l)throw d}}var w=t.x-(o+r)/2,I=t.y-(a+s)/2;e.xCoords=e.xCoords.map(function(t){return t+w}),e.yCoords=e.yCoords.map(function(t){return t+I})}else{Object.keys(e).forEach(function(t){var i=e[t],n=i.getRect().x,h=i.getRect().x+i.getRect().width,l=i.getRect().y,d=i.getRect().y+i.getRect().height;n<r&&(r=n),h>o&&(o=h),l<s&&(s=l),d>a&&(a=d)});var C=t.x-(o+r)/2,L=t.y-(a+s)/2;Object.keys(e).forEach(function(t){var i=e[t];i.setCenter(i.getCenterX()+C,i.getCenterY()+L)})}}},calcBoundingBox:function(t,e,i,n){for(var r=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,h=void 0,l=void 0,d=void 0,c=void 0,g=t.descendants().not(":parent"),u=g.length,f=0;f<u;f++){var p=g[f];r>(h=e[n.get(p.id())]-p.width()/2)&&(r=h),o<(l=e[n.get(p.id())]+p.width()/2)&&(o=l),s>(d=i[n.get(p.id())]-p.height()/2)&&(s=d),a<(c=i[n.get(p.id())]+p.height()/2)&&(a=c)}var m={};return m.topLeftX=r,m.topLeftY=s,m.width=o-r,m.height=a-s,m},calcParentsWithoutChildren:function(t,e){var i=t.collection();return e.nodes(":parent").forEach(function(t){var e=!1;t.children().forEach(function(t){"none"!=t.css("display")&&(e=!0)}),e||i.merge(t)}),i}};t.exports=o},816:(t,e,i)=>{var n=i(548),r=i(140).CoSELayout,o=i(140).CoSENode,s=i(140).layoutBase.PointD,a=i(140).layoutBase.DimensionD,h=i(140).layoutBase.LayoutConstants,l=i(140).layoutBase.FDLayoutConstants,d=i(140).CoSEConstants;t.exports={coseLayout:function(t,e){var i=t.cy,c=t.eles,g=c.nodes(),u=c.edges(),f=void 0,p=void 0,m=void 0,y={};t.randomize&&(f=e.nodeIndexes,p=e.xCoords,m=e.yCoords);var v=function(t){return"function"==typeof t},E=function(t,e){return v(t)?t(e):t},N=n.calcParentsWithoutChildren(i,c);null!=t.nestingFactor&&(d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.nestingFactor),null!=t.gravity&&(d.DEFAULT_GRAVITY_STRENGTH=l.DEFAULT_GRAVITY_STRENGTH=t.gravity),null!=t.numIter&&(d.MAX_ITERATIONS=l.MAX_ITERATIONS=t.numIter),null!=t.gravityRange&&(d.DEFAULT_GRAVITY_RANGE_FACTOR=l.DEFAULT_GRAVITY_RANGE_FACTOR=t.gravityRange),null!=t.gravityCompound&&(d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.gravityCompound),null!=t.gravityRangeCompound&&(d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.gravityRangeCompound),null!=t.initialEnergyOnIncremental&&(d.DEFAULT_COOLING_FACTOR_INCREMENTAL=l.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.initialEnergyOnIncremental),null!=t.tilingCompareBy&&(d.TILING_COMPARE_BY=t.tilingCompareBy),"proof"==t.quality?h.QUALITY=2:h.QUALITY=0,d.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=t.nodeDimensionsIncludeLabels,d.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!t.randomize,d.ANIMATE=l.ANIMATE=h.ANIMATE=t.animate,d.TILE=t.tile,d.TILING_PADDING_VERTICAL="function"==typeof t.tilingPaddingVertical?t.tilingPaddingVertical.call():t.tilingPaddingVertical,d.TILING_PADDING_HORIZONTAL="function"==typeof t.tilingPaddingHorizontal?t.tilingPaddingHorizontal.call():t.tilingPaddingHorizontal,d.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!0,d.PURE_INCREMENTAL=!t.randomize,h.DEFAULT_UNIFORM_LEAF_NODE_SIZES=t.uniformNodeDimensions,"transformed"==t.step&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!1),"enforced"==t.step&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!1),"cose"==t.step&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!0),"all"==t.step&&(t.randomize?d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0),t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint?d.TREE_REDUCTION_ON_INCREMENTAL=!1:d.TREE_REDUCTION_ON_INCREMENTAL=!0;var T=new r,A=T.newGraphManager();return function t(e,i,r,h){for(var l=i.length,d=0;d<l;d++){var c=i[d],g=null;0==c.intersection(N).length&&(g=c.children());var u=void 0,v=c.layoutDimensions({nodeDimensionsIncludeLabels:h.nodeDimensionsIncludeLabels});if(null!=c.outerWidth()&&null!=c.outerHeight())if(h.randomize)if(c.isParent()){var T=n.calcBoundingBox(c,p,m,f);u=0==c.intersection(N).length?e.add(new o(r.graphManager,new s(T.topLeftX,T.topLeftY),new a(T.width,T.height))):e.add(new o(r.graphManager,new s(T.topLeftX,T.topLeftY),new a(parseFloat(v.w),parseFloat(v.h))))}else u=e.add(new o(r.graphManager,new s(p[f.get(c.id())]-v.w/2,m[f.get(c.id())]-v.h/2),new a(parseFloat(v.w),parseFloat(v.h))));else u=e.add(new o(r.graphManager,new s(c.position("x")-v.w/2,c.position("y")-v.h/2),new a(parseFloat(v.w),parseFloat(v.h))));else u=e.add(new o(this.graphManager));u.id=c.data("id"),u.nodeRepulsion=E(h.nodeRepulsion,c),u.paddingLeft=parseInt(c.css("padding")),u.paddingTop=parseInt(c.css("padding")),u.paddingRight=parseInt(c.css("padding")),u.paddingBottom=parseInt(c.css("padding")),h.nodeDimensionsIncludeLabels&&(u.labelWidth=c.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,u.labelHeight=c.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,u.labelPosVertical=c.css("text-valign"),u.labelPosHorizontal=c.css("text-halign")),y[c.data("id")]=u,isNaN(u.rect.x)&&(u.rect.x=0),isNaN(u.rect.y)&&(u.rect.y=0),null!=g&&g.length>0&&t(r.getGraphManager().add(r.newGraph(),u),g,r,h)}}(A.addRoot(),n.getTopMostNodes(g),T,t),function(e,i,n){for(var r=0,o=0,s=0;s<n.length;s++){var a=n[s],h=y[a.data("source")],c=y[a.data("target")];if(h&&c&&h!==c&&0==h.getEdgesBetween(c).length){var g=i.add(e.newEdge(),h,c);g.id=a.id(),g.idealLength=E(t.idealEdgeLength,a),g.edgeElasticity=E(t.edgeElasticity,a),r+=g.idealLength,o++}}null!=t.idealEdgeLength&&(o>0?d.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=r/o:v(t.idealEdgeLength)?d.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=50:d.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=t.idealEdgeLength,d.MIN_REPULSION_DIST=l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,d.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH)}(T,A,u),function(t,e){e.fixedNodeConstraint&&(t.constraints.fixedNodeConstraint=e.fixedNodeConstraint),e.alignmentConstraint&&(t.constraints.alignmentConstraint=e.alignmentConstraint),e.relativePlacementConstraint&&(t.constraints.relativePlacementConstraint=e.relativePlacementConstraint)}(T,t),T.runLayout(),y}}},212:(t,e,i)=>{var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(658),o=i(548),s=i(657).spectralLayout,a=i(816).coseLayout,h=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(t){return 4500},idealEdgeLength:function(t){return 50},edgeElasticity:function(t){return.45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),l=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=r({},h,e)}return n(t,[{key:"run",value:function(){var t=this.options,e=t.cy,i=t.eles,n=[],r=[],h=void 0,l=[];!t.fixedNodeConstraint||Array.isArray(t.fixedNodeConstraint)&&0!=t.fixedNodeConstraint.length||(t.fixedNodeConstraint=void 0),t.alignmentConstraint&&(!t.alignmentConstraint.vertical||Array.isArray(t.alignmentConstraint.vertical)&&0!=t.alignmentConstraint.vertical.length||(t.alignmentConstraint.vertical=void 0),!t.alignmentConstraint.horizontal||Array.isArray(t.alignmentConstraint.horizontal)&&0!=t.alignmentConstraint.horizontal.length||(t.alignmentConstraint.horizontal=void 0)),!t.relativePlacementConstraint||Array.isArray(t.relativePlacementConstraint)&&0!=t.relativePlacementConstraint.length||(t.relativePlacementConstraint=void 0),(t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint)&&(t.tile=!1,t.packComponents=!1);var d=void 0,c=!1;if(e.layoutUtilities&&t.packComponents&&((d=e.layoutUtilities("get"))||(d=e.layoutUtilities()),c=!0),i.nodes().length>0)if(c){var g=o.getTopMostNodes(t.eles.nodes());if((h=o.connectComponents(e,t.eles,g)).forEach(function(t){var e=t.boundingBox();l.push({x:e.x1+e.w/2,y:e.y1+e.h/2})}),t.randomize&&h.forEach(function(e){t.eles=e,n.push(s(t))}),"default"==t.quality||"proof"==t.quality){var u=e.collection();if(t.tile){var f=new Map,p=0,m={nodeIndexes:f,xCoords:[],yCoords:[]},y=[];if(h.forEach(function(t,e){0==t.edges().length&&(t.nodes().forEach(function(e,i){u.merge(t.nodes()[i]),e.isParent()||(m.nodeIndexes.set(t.nodes()[i].id(),p++),m.xCoords.push(t.nodes()[0].position().x),m.yCoords.push(t.nodes()[0].position().y))}),y.push(e))}),u.length>1){var v=u.boundingBox();l.push({x:v.x1+v.w/2,y:v.y1+v.h/2}),h.push(u),n.push(m);for(var E=y.length-1;E>=0;E--)h.splice(y[E],1),n.splice(y[E],1),l.splice(y[E],1)}}h.forEach(function(e,i){t.eles=e,r.push(a(t,n[i])),o.relocateComponent(l[i],r[i],t)})}else h.forEach(function(e,i){o.relocateComponent(l[i],n[i],t)});var N=new Set;if(h.length>1){var T=[],A=i.filter(function(t){return"none"==t.css("display")});h.forEach(function(e,i){var s=void 0;if("draft"==t.quality&&(s=n[i].nodeIndexes),e.nodes().not(A).length>0){var a={edges:[],nodes:[]},h=void 0;e.nodes().not(A).forEach(function(e){if("draft"==t.quality)if(e.isParent()){var l=o.calcBoundingBox(e,n[i].xCoords,n[i].yCoords,s);a.nodes.push({x:l.topLeftX,y:l.topLeftY,width:l.width,height:l.height})}else h=s.get(e.id()),a.nodes.push({x:n[i].xCoords[h]-e.boundingbox().w/2,y:n[i].yCoords[h]-e.boundingbox().h/2,width:e.boundingbox().w,height:e.boundingbox().h});else r[i][e.id()]&&a.nodes.push({x:r[i][e.id()].getLeft(),y:r[i][e.id()].getTop(),width:r[i][e.id()].getWidth(),height:r[i][e.id()].getHeight()})}),e.edges().forEach(function(e){var h=e.source(),l=e.target();if("none"!=h.css("display")&&"none"!=l.css("display"))if("draft"==t.quality){var d=s.get(h.id()),c=s.get(l.id()),g=[],u=[];if(h.isParent()){var f=o.calcBoundingBox(h,n[i].xCoords,n[i].yCoords,s);g.push(f.topLeftX+f.width/2),g.push(f.topLeftY+f.height/2)}else g.push(n[i].xCoords[d]),g.push(n[i].yCoords[d]);if(l.isParent()){var p=o.calcBoundingBox(l,n[i].xCoords,n[i].yCoords,s);u.push(p.topLeftX+p.width/2),u.push(p.topLeftY+p.height/2)}else u.push(n[i].xCoords[c]),u.push(n[i].yCoords[c]);a.edges.push({startX:g[0],startY:g[1],endX:u[0],endY:u[1]})}else r[i][h.id()]&&r[i][l.id()]&&a.edges.push({startX:r[i][h.id()].getCenterX(),startY:r[i][h.id()].getCenterY(),endX:r[i][l.id()].getCenterX(),endY:r[i][l.id()].getCenterY()})}),a.nodes.length>0&&(T.push(a),N.add(i))}});var w=d.packComponents(T,t.randomize).shifts;if("draft"==t.quality)n.forEach(function(t,e){var i=t.xCoords.map(function(t){return t+w[e].dx}),n=t.yCoords.map(function(t){return t+w[e].dy});t.xCoords=i,t.yCoords=n});else{var I=0;N.forEach(function(t){Object.keys(r[t]).forEach(function(e){var i=r[t][e];i.setCenter(i.getCenterX()+w[I].dx,i.getCenterY()+w[I].dy)}),I++})}}}else{var C=t.eles.boundingBox();if(l.push({x:C.x1+C.w/2,y:C.y1+C.h/2}),t.randomize){var L=s(t);n.push(L)}"default"==t.quality||"proof"==t.quality?(r.push(a(t,n[0])),o.relocateComponent(l[0],r[0],t)):o.relocateComponent(l[0],n[0],t)}var M=function(e,i){if("default"==t.quality||"proof"==t.quality){"number"==typeof e&&(e=i);var o=void 0,s=void 0,a=e.data("id");return r.forEach(function(t){a in t&&(o={x:t[a].getRect().getCenterX(),y:t[a].getRect().getCenterY()},s=t[a])}),t.nodeDimensionsIncludeLabels&&(s.labelWidth&&("left"==s.labelPosHorizontal?o.x+=s.labelWidth/2:"right"==s.labelPosHorizontal&&(o.x-=s.labelWidth/2)),s.labelHeight&&("top"==s.labelPosVertical?o.y+=s.labelHeight/2:"bottom"==s.labelPosVertical&&(o.y-=s.labelHeight/2))),null==o&&(o={x:e.position("x"),y:e.position("y")}),{x:o.x,y:o.y}}var h=void 0;return n.forEach(function(t){var i=t.nodeIndexes.get(e.id());null!=i&&(h={x:t.xCoords[i],y:t.yCoords[i]})}),null==h&&(h={x:e.position("x"),y:e.position("y")}),{x:h.x,y:h.y}};if("default"==t.quality||"proof"==t.quality||t.randomize){var _=o.calcParentsWithoutChildren(e,i),x=i.filter(function(t){return"none"==t.css("display")});t.eles=i.not(x),i.nodes().not(":parent").not(x).layoutPositions(this,t,M),_.length>0&&_.forEach(function(t){t.position(M(t))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),t}();t.exports=l},657:(t,e,i)=>{var n=i(548),r=i(140).layoutBase.Matrix,o=i(140).layoutBase.SVD;t.exports={spectralLayout:function(t){var e=t.cy,i=t.eles,s=i.nodes(),a=i.nodes(":parent"),h=new Map,l=new Map,d=new Map,c=[],g=[],u=[],f=[],p=[],m=[],y=[],v=[],E=void 0,N=1e8,T=1e-9,A=t.piTol,w=t.samplingType,I=t.nodeSeparation,C=void 0,L=function(t,e,i){for(var n=[],r=0,o=0,s=0,a=void 0,h=[],d=0,g=1,u=0;u<E;u++)h[u]=N;for(n[o]=t,h[t]=0;o>=r;){s=n[r++];for(var f=c[s],y=0;y<f.length;y++)h[a=l.get(f[y])]==N&&(h[a]=h[s]+1,n[++o]=a);m[s][e]=h[s]*I}if(i){for(var v=0;v<E;v++)m[v][e]<p[v]&&(p[v]=m[v][e]);for(var T=0;T<E;T++)p[T]>d&&(d=p[T],g=T)}return g};n.connectComponents(e,i,n.getTopMostNodes(s),h),a.forEach(function(t){n.connectComponents(e,i,n.getTopMostNodes(t.descendants().intersection(i)),h)});for(var M=0,_=0;_<s.length;_++)s[_].isParent()||l.set(s[_].id(),M++);var x=!0,O=!1,D=void 0;try{for(var R,b=h.keys()[Symbol.iterator]();!(x=(R=b.next()).done);x=!0){var F=R.value;l.set(F,M++)}}catch(t){O=!0,D=t}finally{try{!x&&b.return&&b.return()}finally{if(O)throw D}}for(var G=0;G<l.size;G++)c[G]=[];a.forEach(function(t){for(var e=t.children().intersection(i);0==e.nodes(":childless").length;)e=e.nodes()[0].children().intersection(i);var n=0,r=e.nodes(":childless")[0].connectedEdges().length;e.nodes(":childless").forEach(function(t,e){t.connectedEdges().length<r&&(r=t.connectedEdges().length,n=e)}),d.set(t.id(),e.nodes(":childless")[n].id())}),s.forEach(function(t){var e=void 0;e=t.isParent()?l.get(d.get(t.id())):l.get(t.id()),t.neighborhood().nodes().forEach(function(n){i.intersection(t.edgesWith(n)).length>0&&(n.isParent()?c[e].push(d.get(n.id())):c[e].push(n.id()))})});var S=function(t){var i=l.get(t),n=void 0;h.get(t).forEach(function(r){n=e.getElementById(r).isParent()?d.get(r):r,c[i].push(n),c[l.get(n)].push(t)})},P=!0,U=!1,Y=void 0;try{for(var k,H=h.keys()[Symbol.iterator]();!(P=(k=H.next()).done);P=!0)S(k.value)}catch(t){U=!0,Y=t}finally{try{!P&&H.return&&H.return()}finally{if(U)throw Y}}var X=void 0;if((E=l.size)>2){C=E<t.sampleSize?E:t.sampleSize;for(var z=0;z<E;z++)m[z]=[];for(var B=0;B<C;B++)v[B]=[];return"draft"==t.quality||"all"==t.step?(function(t){var e=void 0;if(t){e=Math.floor(Math.random()*E);for(var i=0;i<E;i++)p[i]=N;for(var n=0;n<C;n++)f[n]=e,e=L(e,n,t)}else{!function(){for(var t=0,e=0,i=!1;e<C;){t=Math.floor(Math.random()*E),i=!1;for(var n=0;n<e;n++)if(f[n]==t){i=!0;break}i||(f[e]=t,e++)}}();for(var r=0;r<C;r++)L(f[r],r,t)}for(var o=0;o<E;o++)for(var s=0;s<C;s++)m[o][s]*=m[o][s];for(var a=0;a<C;a++)y[a]=[];for(var h=0;h<C;h++)for(var l=0;l<C;l++)y[h][l]=m[f[l]][h]}(w),function(){for(var t=o.svd(y),e=t.S,i=t.U,n=t.V,s=e[0]*e[0]*e[0],a=[],h=0;h<C;h++){a[h]=[];for(var l=0;l<C;l++)a[h][l]=0,h==l&&(a[h][l]=e[h]/(e[h]*e[h]+s/(e[h]*e[h])))}v=r.multMat(r.multMat(n,a),r.transpose(i))}(),function(){for(var t=void 0,e=void 0,i=[],n=[],o=[],s=[],a=0;a<E;a++)i[a]=Math.random(),n[a]=Math.random();i=r.normalize(i),n=r.normalize(n);for(var h=T,l=T,d=void 0;;){for(var c=0;c<E;c++)o[c]=i[c];if(i=r.multGamma(r.multL(r.multGamma(o),m,v)),t=r.dotProduct(o,i),i=r.normalize(i),h=r.dotProduct(o,i),(d=Math.abs(h/l))<=1+A&&d>=1)break;l=h}for(var f=0;f<E;f++)o[f]=i[f];for(l=T;;){for(var p=0;p<E;p++)s[p]=n[p];if(s=r.minusOp(s,r.multCons(o,r.dotProduct(o,s))),n=r.multGamma(r.multL(r.multGamma(s),m,v)),e=r.dotProduct(s,n),n=r.normalize(n),h=r.dotProduct(s,n),(d=Math.abs(h/l))<=1+A&&d>=1)break;l=h}for(var y=0;y<E;y++)s[y]=n[y];g=r.multCons(o,Math.sqrt(Math.abs(t))),u=r.multCons(s,Math.sqrt(Math.abs(e)))}(),X={nodeIndexes:l,xCoords:g,yCoords:u}):(l.forEach(function(t,i){g.push(e.getElementById(i).position("x")),u.push(e.getElementById(i).position("y"))}),X={nodeIndexes:l,xCoords:g,yCoords:u}),X}var V=l.keys(),W=e.getElementById(V.next().value),$=W.position(),j=W.outerWidth();if(g.push($.x),u.push($.y),2==E){var q=e.getElementById(V.next().value).outerWidth();g.push($.x+j/2+q/2+t.idealEdgeLength),u.push($.y)}return X={nodeIndexes:l,xCoords:g,yCoords:u}}}},579:(t,e,i)=>{var n=i(212),r=function(t){t&&t("layout","fcose",n)};"undefined"!=typeof cytoscape&&r(cytoscape),t.exports=r},140:e=>{e.exports=t}},i={},n=function t(n){var r=i[n];if(void 0!==r)return r.exports;var o=i[n]={exports:{}};return e[n](o,o.exports,t),o.exports}(579);return n})()},t.exports=n(i(41709))},41709(t,e,i){var n;n=function(t){return(()=>{"use strict";var e={45:(t,e,i)=>{var n={};n.layoutBase=i(551),n.CoSEConstants=i(806),n.CoSEEdge=i(767),n.CoSEGraph=i(880),n.CoSEGraphManager=i(578),n.CoSELayout=i(765),n.CoSENode=i(991),n.ConstraintHandler=i(902),t.exports=n},806:(t,e,i)=>{var n=i(551).FDLayoutConstants;function r(){}for(var o in n)r[o]=n[o];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=n.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,t.exports=r},767:(t,e,i)=>{var n=i(551).FDLayoutEdge;function r(t,e,i){n.call(this,t,e,i)}for(var o in r.prototype=Object.create(n.prototype),n)r[o]=n[o];t.exports=r},880:(t,e,i)=>{var n=i(551).LGraph;function r(t,e,i){n.call(this,t,e,i)}for(var o in r.prototype=Object.create(n.prototype),n)r[o]=n[o];t.exports=r},578:(t,e,i)=>{var n=i(551).LGraphManager;function r(t){n.call(this,t)}for(var o in r.prototype=Object.create(n.prototype),n)r[o]=n[o];t.exports=r},765:(t,e,i)=>{var n=i(551).FDLayout,r=i(578),o=i(880),s=i(991),a=i(767),h=i(806),l=i(902),d=i(551).FDLayoutConstants,c=i(551).LayoutConstants,g=i(551).Point,u=i(551).PointD,f=i(551).DimensionD,p=i(551).Layout,m=i(551).Integer,y=i(551).IGeometry,v=i(551).LGraph,E=i(551).Transform,N=i(551).LinkedList;function T(){n.call(this),this.toBeTiled={},this.constraints={}}for(var A in T.prototype=Object.create(n.prototype),n)T[A]=n[A];T.prototype.newGraphManager=function(){var t=new r(this);return this.graphManager=t,t},T.prototype.newGraph=function(t){return new o(null,this.graphManager,t)},T.prototype.newNode=function(t){return new s(this.graphManager,t)},T.prototype.newEdge=function(t){return new a(null,null,t)},T.prototype.initParameters=function(){n.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},T.prototype.initSpringEmbedder=function(){n.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},T.prototype.layout=function(){return c.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},T.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)h.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),e=new Set(this.getAllNodes()),i=this.nodesWithGravity.filter(function(t){return e.has(t)}),this.graphManager.setAllNodesToApplyGravitation(i));else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),i=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(i),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(l.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),h.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},T.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),h.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),h.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var i=!this.isTreeGrowing&&!this.isGrowthFinished,n=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(i,n),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},T.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},i=0;i<t.length;i++){var n=t[i].rect,r=t[i].id;e[r]={id:r,x:n.getCenterX(),y:n.getCenterY(),w:n.width,h:n.height}}return e},T.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===d.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},T.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].calculateDisplacement();for(Object.keys(this.constraints).length>0&&this.updateDisplacements(),e=0;e<t.length;e++)t[e].move()},T.prototype.initConstraintVariables=function(){var t=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var e=this.graphManager.getAllNodes(),i=0;i<e.length;i++){var n=e[i];this.idToNodeMap.set(n.id,n)}var r=function e(i){for(var n,r=i.getChild().getNodes(),o=0,s=0;s<r.length;s++)null==(n=r[s]).getChild()?t.fixedNodeSet.has(n.id)&&(o+=100):o+=e(n);return o};if(this.constraints.fixedNodeConstraint)for(this.constraints.fixedNodeConstraint.forEach(function(e){t.fixedNodeSet.add(e.nodeId)}),e=this.graphManager.getAllNodes(),i=0;i<e.length;i++)if(null!=(n=e[i]).getChild()){var o=r(n);o>0&&(n.fixedNodeWeight=o)}if(this.constraints.relativePlacementConstraint){var s=new Map,a=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(e){t.fixedNodesOnHorizontal.add(e),t.fixedNodesOnVertical.add(e)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var l=this.constraints.alignmentConstraint.vertical;for(i=0;i<l.length;i++)this.dummyToNodeForVerticalAlignment.set("dummy"+i,[]),l[i].forEach(function(e){s.set(e,"dummy"+i),t.dummyToNodeForVerticalAlignment.get("dummy"+i).push(e),t.fixedNodeSet.has(e)&&t.fixedNodesOnHorizontal.add("dummy"+i)})}if(this.constraints.alignmentConstraint.horizontal){var d=this.constraints.alignmentConstraint.horizontal;for(i=0;i<d.length;i++)this.dummyToNodeForHorizontalAlignment.set("dummy"+i,[]),d[i].forEach(function(e){a.set(e,"dummy"+i),t.dummyToNodeForHorizontalAlignment.get("dummy"+i).push(e),t.fixedNodeSet.has(e)&&t.fixedNodesOnVertical.add("dummy"+i)})}}if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(t){var e,i,n;for(n=t.length-1;n>=2*t.length/3;n--)e=Math.floor(Math.random()*(n+1)),i=t[n],t[n]=t[e],t[e]=i;return t},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(e){if(e.left){var i=s.has(e.left)?s.get(e.left):e.left,n=s.has(e.right)?s.get(e.right):e.right;t.nodesInRelativeHorizontal.includes(i)||(t.nodesInRelativeHorizontal.push(i),t.nodeToRelativeConstraintMapHorizontal.set(i,[]),t.dummyToNodeForVerticalAlignment.has(i)?t.nodeToTempPositionMapHorizontal.set(i,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(i)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(i,t.idToNodeMap.get(i).getCenterX())),t.nodesInRelativeHorizontal.includes(n)||(t.nodesInRelativeHorizontal.push(n),t.nodeToRelativeConstraintMapHorizontal.set(n,[]),t.dummyToNodeForVerticalAlignment.has(n)?t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(n).getCenterX())),t.nodeToRelativeConstraintMapHorizontal.get(i).push({right:n,gap:e.gap}),t.nodeToRelativeConstraintMapHorizontal.get(n).push({left:i,gap:e.gap})}else{var r=a.has(e.top)?a.get(e.top):e.top,o=a.has(e.bottom)?a.get(e.bottom):e.bottom;t.nodesInRelativeVertical.includes(r)||(t.nodesInRelativeVertical.push(r),t.nodeToRelativeConstraintMapVertical.set(r,[]),t.dummyToNodeForHorizontalAlignment.has(r)?t.nodeToTempPositionMapVertical.set(r,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(r)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(r,t.idToNodeMap.get(r).getCenterY())),t.nodesInRelativeVertical.includes(o)||(t.nodesInRelativeVertical.push(o),t.nodeToRelativeConstraintMapVertical.set(o,[]),t.dummyToNodeForHorizontalAlignment.has(o)?t.nodeToTempPositionMapVertical.set(o,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(o)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(o,t.idToNodeMap.get(o).getCenterY())),t.nodeToRelativeConstraintMapVertical.get(r).push({bottom:o,gap:e.gap}),t.nodeToRelativeConstraintMapVertical.get(o).push({top:r,gap:e.gap})}});else{var c=new Map,g=new Map;this.constraints.relativePlacementConstraint.forEach(function(t){if(t.left){var e=s.has(t.left)?s.get(t.left):t.left,i=s.has(t.right)?s.get(t.right):t.right;c.has(e)?c.get(e).push(i):c.set(e,[i]),c.has(i)?c.get(i).push(e):c.set(i,[e])}else{var n=a.has(t.top)?a.get(t.top):t.top,r=a.has(t.bottom)?a.get(t.bottom):t.bottom;g.has(n)?g.get(n).push(r):g.set(n,[r]),g.has(r)?g.get(r).push(n):g.set(r,[n])}});var u=function(t,e){var i=[],n=[],r=new N,o=new Set,s=0;return t.forEach(function(a,h){if(!o.has(h)){i[s]=[],n[s]=!1;var l=h;for(r.push(l),o.add(l),i[s].push(l);0!=r.length;)l=r.shift(),e.has(l)&&(n[s]=!0),t.get(l).forEach(function(t){o.has(t)||(r.push(t),o.add(t),i[s].push(t))});s++}}),{components:i,isFixed:n}},f=u(c,t.fixedNodesOnHorizontal);this.componentsOnHorizontal=f.components,this.fixedComponentsOnHorizontal=f.isFixed;var p=u(g,t.fixedNodesOnVertical);this.componentsOnVertical=p.components,this.fixedComponentsOnVertical=p.isFixed}}},T.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(e){var i=t.idToNodeMap.get(e.nodeId);i.displacementX=0,i.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var e=this.constraints.alignmentConstraint.vertical,i=0;i<e.length;i++){for(var n=0,r=0;r<e[i].length;r++){if(this.fixedNodeSet.has(e[i][r])){n=0;break}n+=this.idToNodeMap.get(e[i][r]).displacementX}var o=n/e[i].length;for(r=0;r<e[i].length;r++)this.idToNodeMap.get(e[i][r]).displacementX=o}if(this.constraints.alignmentConstraint.horizontal){var s=this.constraints.alignmentConstraint.horizontal;for(i=0;i<s.length;i++){var a=0;for(r=0;r<s[i].length;r++){if(this.fixedNodeSet.has(s[i][r])){a=0;break}a+=this.idToNodeMap.get(s[i][r]).displacementY}var l=a/s[i].length;for(r=0;r<s[i].length;r++)this.idToNodeMap.get(s[i][r]).displacementY=l}}}if(this.constraints.relativePlacementConstraint)if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(e){if(!t.fixedNodesOnHorizontal.has(e)){var i=0;i=t.dummyToNodeForVerticalAlignment.has(e)?t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(e)[0]).displacementX:t.idToNodeMap.get(e).displacementX,t.nodeToRelativeConstraintMapHorizontal.get(e).forEach(function(n){var r;n.right?(r=t.nodeToTempPositionMapHorizontal.get(n.right)-t.nodeToTempPositionMapHorizontal.get(e)-i)<n.gap&&(i-=n.gap-r):(r=t.nodeToTempPositionMapHorizontal.get(e)-t.nodeToTempPositionMapHorizontal.get(n.left)+i)<n.gap&&(i+=n.gap-r)}),t.nodeToTempPositionMapHorizontal.set(e,t.nodeToTempPositionMapHorizontal.get(e)+i),t.dummyToNodeForVerticalAlignment.has(e)?t.dummyToNodeForVerticalAlignment.get(e).forEach(function(e){t.idToNodeMap.get(e).displacementX=i}):t.idToNodeMap.get(e).displacementX=i}}),this.nodesInRelativeVertical.forEach(function(e){if(!t.fixedNodesOnHorizontal.has(e)){var i=0;i=t.dummyToNodeForHorizontalAlignment.has(e)?t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(e)[0]).displacementY:t.idToNodeMap.get(e).displacementY,t.nodeToRelativeConstraintMapVertical.get(e).forEach(function(n){var r;n.bottom?(r=t.nodeToTempPositionMapVertical.get(n.bottom)-t.nodeToTempPositionMapVertical.get(e)-i)<n.gap&&(i-=n.gap-r):(r=t.nodeToTempPositionMapVertical.get(e)-t.nodeToTempPositionMapVertical.get(n.top)+i)<n.gap&&(i+=n.gap-r)}),t.nodeToTempPositionMapVertical.set(e,t.nodeToTempPositionMapVertical.get(e)+i),t.dummyToNodeForHorizontalAlignment.has(e)?t.dummyToNodeForHorizontalAlignment.get(e).forEach(function(e){t.idToNodeMap.get(e).displacementY=i}):t.idToNodeMap.get(e).displacementY=i}});else{for(i=0;i<this.componentsOnHorizontal.length;i++){var d=this.componentsOnHorizontal[i];if(this.fixedComponentsOnHorizontal[i])for(r=0;r<d.length;r++)this.dummyToNodeForVerticalAlignment.has(d[r])?this.dummyToNodeForVerticalAlignment.get(d[r]).forEach(function(e){t.idToNodeMap.get(e).displacementX=0}):this.idToNodeMap.get(d[r]).displacementX=0;else{var c=0,g=0;for(r=0;r<d.length;r++)this.dummyToNodeForVerticalAlignment.has(d[r])?(c+=(f=this.dummyToNodeForVerticalAlignment.get(d[r])).length*this.idToNodeMap.get(f[0]).displacementX,g+=f.length):(c+=this.idToNodeMap.get(d[r]).displacementX,g++);var u=c/g;for(r=0;r<d.length;r++)this.dummyToNodeForVerticalAlignment.has(d[r])?this.dummyToNodeForVerticalAlignment.get(d[r]).forEach(function(e){t.idToNodeMap.get(e).displacementX=u}):this.idToNodeMap.get(d[r]).displacementX=u}}for(i=0;i<this.componentsOnVertical.length;i++)if(d=this.componentsOnVertical[i],this.fixedComponentsOnVertical[i])for(r=0;r<d.length;r++)this.dummyToNodeForHorizontalAlignment.has(d[r])?this.dummyToNodeForHorizontalAlignment.get(d[r]).forEach(function(e){t.idToNodeMap.get(e).displacementY=0}):this.idToNodeMap.get(d[r]).displacementY=0;else{for(c=0,g=0,r=0;r<d.length;r++){var f;this.dummyToNodeForHorizontalAlignment.has(d[r])?(c+=(f=this.dummyToNodeForHorizontalAlignment.get(d[r])).length*this.idToNodeMap.get(f[0]).displacementY,g+=f.length):(c+=this.idToNodeMap.get(d[r]).displacementY,g++)}for(u=c/g,r=0;r<d.length;r++)this.dummyToNodeForHorizontalAlignment.has(d[r])?this.dummyToNodeForHorizontalAlignment.get(d[r]).forEach(function(e){t.idToNodeMap.get(e).displacementY=u}):this.idToNodeMap.get(d[r]).displacementY=u}}},T.prototype.calculateNodesToApplyGravitationTo=function(){var t,e,i=[],n=this.graphManager.getGraphs(),r=n.length;for(e=0;e<r;e++)(t=n[e]).updateConnected(),t.isConnected||(i=i.concat(t.getNodes()));return i},T.prototype.createBendpoints=function(){var t=[];t=t.concat(this.graphManager.getAllEdges());var e,i=new Set;for(e=0;e<t.length;e++){var n=t[e];if(!i.has(n)){var r=n.getSource(),o=n.getTarget();if(r==o)n.getBendpoints().push(new u),n.getBendpoints().push(new u),this.createDummyNodesForBendpoints(n),i.add(n);else{var s=[];if(s=(s=s.concat(r.getEdgeListToNode(o))).concat(o.getEdgeListToNode(r)),!i.has(s[0])){var a;if(s.length>1)for(a=0;a<s.length;a++){var h=s[a];h.getBendpoints().push(new u),this.createDummyNodesForBendpoints(h)}s.forEach(function(t){i.add(t)})}}}if(i.size==t.length)break}},T.prototype.positionNodesRadially=function(t){for(var e=new g(0,0),i=Math.ceil(Math.sqrt(t.length)),n=0,r=0,o=0,s=new u(0,0),a=0;a<t.length;a++){a%i==0&&(o=0,r=n,0!=a&&(r+=h.DEFAULT_COMPONENT_SEPERATION),n=0);var l=t[a],d=p.findCenterOfTree(l);e.x=o,e.y=r,(s=T.radialLayout(l,d,e)).y>n&&(n=Math.floor(s.y)),o=Math.floor(s.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new u(c.WORLD_CENTER_X-s.x/2,c.WORLD_CENTER_Y-s.y/2))},T.radialLayout=function(t,e,i){var n=Math.max(this.maxDiagonalInTree(t),h.DEFAULT_RADIAL_SEPARATION);T.branchRadialLayout(e,null,0,359,0,n);var r=v.calculateBounds(t),o=new E;o.setDeviceOrgX(r.getMinX()),o.setDeviceOrgY(r.getMinY()),o.setWorldOrgX(i.x),o.setWorldOrgY(i.y);for(var s=0;s<t.length;s++)t[s].transform(o);var a=new u(r.getMaxX(),r.getMaxY());return o.inverseTransformPoint(a)},T.branchRadialLayout=function(t,e,i,n,r,o){var s=(n-i+1)/2;s<0&&(s+=180);var a=(s+i)%360*y.TWO_PI/360,h=(Math.cos(a),r*Math.cos(a)),l=r*Math.sin(a);t.setCenter(h,l);var d=[],c=(d=d.concat(t.getEdges())).length;null!=e&&c--;for(var g,u=0,f=d.length,p=t.getEdgesBetween(e);p.length>1;){var m=p[0];p.splice(0,1);var v=d.indexOf(m);v>=0&&d.splice(v,1),f--,c--}g=null!=e?(d.indexOf(p[0])+1)%f:0;for(var E=Math.abs(n-i)/c,N=g;u!=c;N=++N%f){var A=d[N].getOtherEnd(t);if(A!=e){var w=(i+u*E)%360,I=(w+E)%360;T.branchRadialLayout(A,t,w,I,r+o,o),u++}}},T.maxDiagonalInTree=function(t){for(var e=m.MIN_VALUE,i=0;i<t.length;i++){var n=t[i].getDiagonal();n>e&&(e=n)}return e},T.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},T.prototype.groupZeroDegreeMembers=function(){var t=this,e={};this.memberGroups={},this.idToDummyNode={};for(var i=[],n=this.graphManager.getAllNodes(),r=0;r<n.length;r++){var o=(a=n[r]).getParent();0!==this.getNodeDegreeWithChildren(a)||null!=o.id&&this.getToBeTiled(o)||i.push(a)}for(r=0;r<i.length;r++){var a,h=(a=i[r]).getParent().id;void 0===e[h]&&(e[h]=[]),e[h]=e[h].concat(a)}Object.keys(e).forEach(function(i){if(e[i].length>1){var n="DummyCompound_"+i;t.memberGroups[n]=e[i];var r=e[i][0].getParent(),o=new s(t.graphManager);o.id=n,o.paddingLeft=r.paddingLeft||0,o.paddingRight=r.paddingRight||0,o.paddingBottom=r.paddingBottom||0,o.paddingTop=r.paddingTop||0,t.idToDummyNode[n]=o;var a=t.getGraphManager().add(t.newGraph(),o),h=r.getChild();h.add(o);for(var l=0;l<e[i].length;l++){var d=e[i][l];h.remove(d),a.add(d)}}})},T.prototype.clearCompounds=function(){var t={},e={};this.performDFSOnCompounds();for(var i=0;i<this.compoundOrder.length;i++)e[this.compoundOrder[i].id]=this.compoundOrder[i],t[this.compoundOrder[i].id]=[].concat(this.compoundOrder[i].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[i].getChild()),this.compoundOrder[i].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,e)},T.prototype.clearZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(i){var n=t.idToDummyNode[i];if(e[i]=t.tileNodes(t.memberGroups[i],n.paddingLeft+n.paddingRight),n.rect.width=e[i].width,n.rect.height=e[i].height,n.setCenter(e[i].centerX,e[i].centerY),n.labelMarginLeft=0,n.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var r=n.rect.width,o=n.rect.height;n.labelWidth&&("left"==n.labelPosHorizontal?(n.rect.x-=n.labelWidth,n.setWidth(r+n.labelWidth),n.labelMarginLeft=n.labelWidth):"center"==n.labelPosHorizontal&&n.labelWidth>r?(n.rect.x-=(n.labelWidth-r)/2,n.setWidth(n.labelWidth),n.labelMarginLeft=(n.labelWidth-r)/2):"right"==n.labelPosHorizontal&&n.setWidth(r+n.labelWidth)),n.labelHeight&&("top"==n.labelPosVertical?(n.rect.y-=n.labelHeight,n.setHeight(o+n.labelHeight),n.labelMarginTop=n.labelHeight):"center"==n.labelPosVertical&&n.labelHeight>o?(n.rect.y-=(n.labelHeight-o)/2,n.setHeight(n.labelHeight),n.labelMarginTop=(n.labelHeight-o)/2):"bottom"==n.labelPosVertical&&n.setHeight(o+n.labelHeight))}})},T.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t],i=e.id,n=e.paddingLeft,r=e.paddingTop,o=e.labelMarginLeft,s=e.labelMarginTop;this.adjustLocations(this.tiledMemberPack[i],e.rect.x,e.rect.y,n,r,o,s)}},T.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach(function(i){var n=t.idToDummyNode[i],r=n.paddingLeft,o=n.paddingTop,s=n.labelMarginLeft,a=n.labelMarginTop;t.adjustLocations(e[i],n.rect.x,n.rect.y,r,o,s,a)})},T.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var i=t.getChild();if(null==i)return this.toBeTiled[e]=!1,!1;for(var n=i.getNodes(),r=0;r<n.length;r++){var o=n[r];if(this.getNodeDegree(o)>0)return this.toBeTiled[e]=!1,!1;if(null!=o.getChild()){if(!this.getToBeTiled(o))return this.toBeTiled[e]=!1,!1}else this.toBeTiled[o.id]=!1}return this.toBeTiled[e]=!0,!0},T.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),i=0,n=0;n<e.length;n++){var r=e[n];r.getSource().id!==r.getTarget().id&&(i+=1)}return i},T.prototype.getNodeDegreeWithChildren=function(t){var e=this.getNodeDegree(t);if(null==t.getChild())return e;for(var i=t.getChild().getNodes(),n=0;n<i.length;n++){var r=i[n];e+=this.getNodeDegreeWithChildren(r)}return e},T.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},T.prototype.fillCompexOrderByDFS=function(t){for(var e=0;e<t.length;e++){var i=t[e];null!=i.getChild()&&this.fillCompexOrderByDFS(i.getChild().getNodes()),this.getToBeTiled(i)&&this.compoundOrder.push(i)}},T.prototype.adjustLocations=function(t,e,i,n,r,o,s){i+=r+s;for(var a=e+=n+o,h=0;h<t.rows.length;h++){var l=t.rows[h];e=a;for(var d=0,c=0;c<l.length;c++){var g=l[c];g.rect.x=e,g.rect.y=i,e+=g.rect.width+t.horizontalPadding,g.rect.height>d&&(d=g.rect.height)}i+=d+t.verticalPadding}},T.prototype.tileCompoundMembers=function(t,e){var i=this;this.tiledMemberPack=[],Object.keys(t).forEach(function(n){var r=e[n];if(i.tiledMemberPack[n]=i.tileNodes(t[n],r.paddingLeft+r.paddingRight),r.rect.width=i.tiledMemberPack[n].width,r.rect.height=i.tiledMemberPack[n].height,r.setCenter(i.tiledMemberPack[n].centerX,i.tiledMemberPack[n].centerY),r.labelMarginLeft=0,r.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var o=r.rect.width,s=r.rect.height;r.labelWidth&&("left"==r.labelPosHorizontal?(r.rect.x-=r.labelWidth,r.setWidth(o+r.labelWidth),r.labelMarginLeft=r.labelWidth):"center"==r.labelPosHorizontal&&r.labelWidth>o?(r.rect.x-=(r.labelWidth-o)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-o)/2):"right"==r.labelPosHorizontal&&r.setWidth(o+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(s+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>s?(r.rect.y-=(r.labelHeight-s)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-s)/2):"bottom"==r.labelPosVertical&&r.setHeight(s+r.labelHeight))}})},T.prototype.tileNodes=function(t,e){var i=this.tileNodesByFavoringDim(t,e,!0),n=this.tileNodesByFavoringDim(t,e,!1),r=this.getOrgRatio(i);return this.getOrgRatio(n)<r?n:i},T.prototype.getOrgRatio=function(t){var e=t.width/t.height;return e<1&&(e=1/e),e},T.prototype.calcIdealRowWidth=function(t,e){var i=h.TILING_PADDING_VERTICAL,n=h.TILING_PADDING_HORIZONTAL,r=t.length,o=0,s=0,a=0;t.forEach(function(t){o+=t.getWidth(),s+=t.getHeight(),t.getWidth()>a&&(a=t.getWidth())});var l,d=o/r,c=s/r,g=Math.pow(i-n,2)+4*(d+n)*(c+i)*r,u=(n-i+Math.sqrt(g))/(2*(d+n));e?(l=Math.ceil(u))==u&&l++:l=Math.floor(u);var f=l*(d+n)-n;return a>f&&(f=a),f+=2*n},T.prototype.tileNodesByFavoringDim=function(t,e,i){var n=h.TILING_PADDING_VERTICAL,r=h.TILING_PADDING_HORIZONTAL,o=h.TILING_COMPARE_BY,s={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:n,horizontalPadding:r,centerX:0,centerY:0};o&&(s.idealRowWidth=this.calcIdealRowWidth(t,i));var a=function(t){return t.rect.width*t.rect.height},l=function(t,e){return a(e)-a(t)};t.sort(function(t,e){var i=l;return s.idealRowWidth?(i=o)(t.id,e.id):i(t,e)});for(var d=0,c=0,g=0;g<t.length;g++)d+=(u=t[g]).getCenterX(),c+=u.getCenterY();for(s.centerX=d/t.length,s.centerY=c/t.length,g=0;g<t.length;g++){var u=t[g];if(0==s.rows.length)this.insertNodeToRow(s,u,0,e);else if(this.canAddHorizontal(s,u.rect.width,u.rect.height)){var f=s.rows.length-1;s.idealRowWidth||(f=this.getShortestRowIndex(s)),this.insertNodeToRow(s,u,f,e)}else this.insertNodeToRow(s,u,s.rows.length,e);this.shiftToLastRow(s)}return s},T.prototype.insertNodeToRow=function(t,e,i,n){var r=n;i==t.rows.length&&(t.rows.push([]),t.rowWidth.push(r),t.rowHeight.push(0));var o=t.rowWidth[i]+e.rect.width;t.rows[i].length>0&&(o+=t.horizontalPadding),t.rowWidth[i]=o,t.width<o&&(t.width=o);var s=e.rect.height;i>0&&(s+=t.verticalPadding);var a=0;s>t.rowHeight[i]&&(a=t.rowHeight[i],t.rowHeight[i]=s,a=t.rowHeight[i]-a),t.height+=a,t.rows[i].push(e)},T.prototype.getShortestRowIndex=function(t){for(var e=-1,i=Number.MAX_VALUE,n=0;n<t.rows.length;n++)t.rowWidth[n]<i&&(e=n,i=t.rowWidth[n]);return e},T.prototype.getLongestRowIndex=function(t){for(var e=-1,i=Number.MIN_VALUE,n=0;n<t.rows.length;n++)t.rowWidth[n]>i&&(e=n,i=t.rowWidth[n]);return e},T.prototype.canAddHorizontal=function(t,e,i){if(t.idealRowWidth){var n=t.rows.length-1;return t.rowWidth[n]+e+t.horizontalPadding<=t.idealRowWidth}var r=this.getShortestRowIndex(t);if(r<0)return!0;var o=t.rowWidth[r];if(o+t.horizontalPadding+e<=t.width)return!0;var s,a,h=0;return t.rowHeight[r]<i&&r>0&&(h=i+t.verticalPadding-t.rowHeight[r]),s=t.width-o>=e+t.horizontalPadding?(t.height+h)/(o+e+t.horizontalPadding):(t.height+h)/t.width,h=i+t.verticalPadding,(a=t.width<e?(t.height+h)/e:(t.height+h)/t.width)<1&&(a=1/a),s<1&&(s=1/s),s<a},T.prototype.shiftToLastRow=function(t){var e=this.getLongestRowIndex(t),i=t.rowWidth.length-1,n=t.rows[e],r=n[n.length-1],o=r.width+t.horizontalPadding;if(t.width-t.rowWidth[i]>o&&e!=i){n.splice(-1,1),t.rows[i].push(r),t.rowWidth[e]=t.rowWidth[e]-o,t.rowWidth[i]=t.rowWidth[i]+o,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var s=Number.MIN_VALUE,a=0;a<n.length;a++)n[a].height>s&&(s=n[a].height);e>0&&(s+=t.verticalPadding);var h=t.rowHeight[e]+t.rowHeight[i];t.rowHeight[e]=s,t.rowHeight[i]<r.height+t.verticalPadding&&(t.rowHeight[i]=r.height+t.verticalPadding);var l=t.rowHeight[e]+t.rowHeight[i];t.height+=l-h,this.shiftToLastRow(t)}},T.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},T.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},T.prototype.reduceTrees=function(){for(var t,e=[],i=!0;i;){var n=this.graphManager.getAllNodes(),r=[];i=!1;for(var o=0;o<n.length;o++)if(1==(t=n[o]).getEdges().length&&!t.getEdges()[0].isInterGraph&&null==t.getChild()){if(h.PURE_INCREMENTAL){var s=t.getEdges()[0].getOtherEnd(t),a=new f(t.getCenterX()-s.getCenterX(),t.getCenterY()-s.getCenterY());r.push([t,t.getEdges()[0],t.getOwner(),a])}else r.push([t,t.getEdges()[0],t.getOwner()]);i=!0}if(1==i){for(var l=[],d=0;d<r.length;d++)1==r[d][0].getEdges().length&&(l.push(r[d]),r[d][0].getOwner().remove(r[d][0]));e.push(l),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},T.prototype.growTree=function(t){for(var e,i=t[t.length-1],n=0;n<i.length;n++)e=i[n],this.findPlaceforPrunedNode(e),e[2].add(e[0]),e[2].add(e[1],e[1].source,e[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},T.prototype.findPlaceforPrunedNode=function(t){var e,i,n=t[0];if(i=n==t[1].source?t[1].target:t[1].source,h.PURE_INCREMENTAL)n.setCenter(i.getCenterX()+t[3].getWidth(),i.getCenterY()+t[3].getHeight());else{var r=i.startX,o=i.finishX,s=i.startY,a=i.finishY,l=[0,0,0,0];if(s>0)for(var c=r;c<=o;c++)l[0]+=this.grid[c][s-1].length+this.grid[c][s].length-1;if(o<this.grid.length-1)for(c=s;c<=a;c++)l[1]+=this.grid[o+1][c].length+this.grid[o][c].length-1;if(a<this.grid[0].length-1)for(c=r;c<=o;c++)l[2]+=this.grid[c][a+1].length+this.grid[c][a].length-1;if(r>0)for(c=s;c<=a;c++)l[3]+=this.grid[r-1][c].length+this.grid[r][c].length-1;for(var g,u,f=m.MAX_VALUE,p=0;p<l.length;p++)l[p]<f?(f=l[p],g=1,u=p):l[p]==f&&g++;if(3==g&&0==f)0==l[0]&&0==l[1]&&0==l[2]?e=1:0==l[0]&&0==l[1]&&0==l[3]?e=0:0==l[0]&&0==l[2]&&0==l[3]?e=3:0==l[1]&&0==l[2]&&0==l[3]&&(e=2);else if(2==g&&0==f){var y=Math.floor(2*Math.random());e=0==l[0]&&0==l[1]?0==y?0:1:0==l[0]&&0==l[2]?0==y?0:2:0==l[0]&&0==l[3]?0==y?0:3:0==l[1]&&0==l[2]?0==y?1:2:0==l[1]&&0==l[3]?0==y?1:3:0==y?2:3}else e=4==g&&0==f?y=Math.floor(4*Math.random()):u;0==e?n.setCenter(i.getCenterX(),i.getCenterY()-i.getHeight()/2-d.DEFAULT_EDGE_LENGTH-n.getHeight()/2):1==e?n.setCenter(i.getCenterX()+i.getWidth()/2+d.DEFAULT_EDGE_LENGTH+n.getWidth()/2,i.getCenterY()):2==e?n.setCenter(i.getCenterX(),i.getCenterY()+i.getHeight()/2+d.DEFAULT_EDGE_LENGTH+n.getHeight()/2):n.setCenter(i.getCenterX()-i.getWidth()/2-d.DEFAULT_EDGE_LENGTH-n.getWidth()/2,i.getCenterY())}},t.exports=T},991:(t,e,i)=>{var n=i(551).FDLayoutNode,r=i(551).IMath;function o(t,e,i,r){n.call(this,t,e,i,r)}for(var s in o.prototype=Object.create(n.prototype),n)o[s]=n[s];o.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*r.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*r.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},o.prototype.propogateDisplacementToChildren=function(t,e){for(var i,n=this.getChild().getNodes(),r=0;r<n.length;r++)null==(i=n[r]).getChild()?(i.displacementX+=t,i.displacementY+=e):i.propogateDisplacementToChildren(t,e)},o.prototype.move=function(){var t=this.graphManager.getLayout();null!=this.child&&0!=this.child.getNodes().length||(this.moveBy(this.displacementX,this.displacementY),t.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},o.prototype.setPred1=function(t){this.pred1=t},o.prototype.getPred1=function(){return pred1},o.prototype.getPred2=function(){return pred2},o.prototype.setNext=function(t){this.next=t},o.prototype.getNext=function(){return next},o.prototype.setProcessed=function(t){this.processed=t},o.prototype.isProcessed=function(){return processed},t.exports=o},902:(t,e,i)=>{function n(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}var r=i(806),o=i(551).LinkedList,s=i(551).Matrix,a=i(551).SVD;function h(){}h.handleConstraints=function(t){var e={};e.fixedNodeConstraint=t.constraints.fixedNodeConstraint,e.alignmentConstraint=t.constraints.alignmentConstraint,e.relativePlacementConstraint=t.constraints.relativePlacementConstraint;for(var i=new Map,h=new Map,l=[],d=[],c=t.getAllNodes(),g=0,u=0;u<c.length;u++){var f=c[u];null==f.getChild()&&(h.set(f.id,g++),l.push(f.getCenterX()),d.push(f.getCenterY()),i.set(f.id,f))}e.relativePlacementConstraint&&e.relativePlacementConstraint.forEach(function(t){t.gap||0==t.gap||(t.left?t.gap=r.DEFAULT_EDGE_LENGTH+i.get(t.left).getWidth()/2+i.get(t.right).getWidth()/2:t.gap=r.DEFAULT_EDGE_LENGTH+i.get(t.top).getHeight()/2+i.get(t.bottom).getHeight()/2)});var p=function(t){var e=0,i=0;return t.forEach(function(t){e+=l[h.get(t)],i+=d[h.get(t)]}),{x:e/t.size,y:i/t.size}},m=function(t,e,i,r,s){var a=new Map;t.forEach(function(t,e){a.set(e,0)}),t.forEach(function(t,e){t.forEach(function(t){a.set(t.id,a.get(t.id)+1)})});var c=new Map,g=new Map,u=new o;a.forEach(function(t,n){0==t?(u.push(n),i||("horizontal"==e?c.set(n,h.has(n)?l[h.get(n)]:r.get(n)):c.set(n,h.has(n)?d[h.get(n)]:r.get(n)))):c.set(n,Number.NEGATIVE_INFINITY),i&&g.set(n,new Set([n]))}),i&&s.forEach(function(t){var n=[];if(t.forEach(function(t){i.has(t)&&n.push(t)}),n.length>0){var o=0;n.forEach(function(t){"horizontal"==e?(c.set(t,h.has(t)?l[h.get(t)]:r.get(t)),o+=c.get(t)):(c.set(t,h.has(t)?d[h.get(t)]:r.get(t)),o+=c.get(t))}),o/=n.length,t.forEach(function(t){i.has(t)||c.set(t,o)})}else{var s=0;t.forEach(function(t){s+="horizontal"==e?h.has(t)?l[h.get(t)]:r.get(t):h.has(t)?d[h.get(t)]:r.get(t)}),s/=t.length,t.forEach(function(t){c.set(t,s)})}});for(var f=function(){var n=u.shift();t.get(n).forEach(function(t){if(c.get(t.id)<c.get(n)+t.gap)if(i&&i.has(t.id)){var o=void 0;if(o="horizontal"==e?h.has(t.id)?l[h.get(t.id)]:r.get(t.id):h.has(t.id)?d[h.get(t.id)]:r.get(t.id),c.set(t.id,o),o<c.get(n)+t.gap){var s=c.get(n)+t.gap-o;g.get(n).forEach(function(t){c.set(t,c.get(t)-s)})}}else c.set(t.id,c.get(n)+t.gap);a.set(t.id,a.get(t.id)-1),0==a.get(t.id)&&u.push(t.id),i&&g.set(t.id,function(t,e){var i=new Set(t),n=!0,r=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var h=s.value;i.add(h)}}catch(t){r=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(r)throw o}}return i}(g.get(n),g.get(t.id)))})};0!=u.length;)f();if(i){var p=new Set;t.forEach(function(t,e){0==t.length&&p.add(e)});var m=[];g.forEach(function(t,e){if(p.has(e)){var r=!1,o=!0,s=!1,a=void 0;try{for(var h,l=t[Symbol.iterator]();!(o=(h=l.next()).done);o=!0){var d=h.value;i.has(d)&&(r=!0)}}catch(t){s=!0,a=t}finally{try{!o&&l.return&&l.return()}finally{if(s)throw a}}if(!r){var c=!1,g=void 0;m.forEach(function(e,i){e.has([].concat(n(t))[0])&&(c=!0,g=i)}),c?t.forEach(function(t){m[g].add(t)}):m.push(new Set(t))}}}),m.forEach(function(t,i){var n=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY,g=!0,u=!1,f=void 0;try{for(var p,m=t[Symbol.iterator]();!(g=(p=m.next()).done);g=!0){var y=p.value,v=void 0;v="horizontal"==e?h.has(y)?l[h.get(y)]:r.get(y):h.has(y)?d[h.get(y)]:r.get(y);var E=c.get(y);v<n&&(n=v),v>s&&(s=v),E<o&&(o=E),E>a&&(a=E)}}catch(t){u=!0,f=t}finally{try{!g&&m.return&&m.return()}finally{if(u)throw f}}var N=(n+s)/2-(o+a)/2,T=!0,A=!1,w=void 0;try{for(var I,C=t[Symbol.iterator]();!(T=(I=C.next()).done);T=!0){var L=I.value;c.set(L,c.get(L)+N)}}catch(t){A=!0,w=t}finally{try{!T&&C.return&&C.return()}finally{if(A)throw w}}})}return c},y=function(t){var e=0,i=0,n=0,r=0;if(t.forEach(function(t){t.left?l[h.get(t.left)]-l[h.get(t.right)]>=0?e++:i++:d[h.get(t.top)]-d[h.get(t.bottom)]>=0?n++:r++}),e>i&&n>r)for(var o=0;o<h.size;o++)l[o]=-1*l[o],d[o]=-1*d[o];else if(e>i)for(var s=0;s<h.size;s++)l[s]=-1*l[s];else if(n>r)for(var a=0;a<h.size;a++)d[a]=-1*d[a]},v=function(t){var e=[],i=new o,n=new Set,r=0;return t.forEach(function(o,s){if(!n.has(s)){e[r]=[];var a=s;for(i.push(a),n.add(a),e[r].push(a);0!=i.length;)a=i.shift(),t.get(a).forEach(function(t){n.has(t.id)||(i.push(t.id),n.add(t.id),e[r].push(t.id))});r++}}),e},E=function(t){var e=new Map;return t.forEach(function(t,i){e.set(i,[])}),t.forEach(function(t,i){t.forEach(function(t){e.get(i).push(t),e.get(t.id).push({id:i,gap:t.gap,direction:t.direction})})}),e},N=function(t){var e=new Map;return t.forEach(function(t,i){e.set(i,[])}),t.forEach(function(t,i){t.forEach(function(t){e.get(t.id).push({id:i,gap:t.gap,direction:t.direction})})}),e},T=[],A=[],w=!1,I=!1,C=new Set,L=new Map,M=new Map,_=[];if(e.fixedNodeConstraint&&e.fixedNodeConstraint.forEach(function(t){C.add(t.nodeId)}),e.relativePlacementConstraint&&(e.relativePlacementConstraint.forEach(function(t){t.left?(L.has(t.left)?L.get(t.left).push({id:t.right,gap:t.gap,direction:"horizontal"}):L.set(t.left,[{id:t.right,gap:t.gap,direction:"horizontal"}]),L.has(t.right)||L.set(t.right,[])):(L.has(t.top)?L.get(t.top).push({id:t.bottom,gap:t.gap,direction:"vertical"}):L.set(t.top,[{id:t.bottom,gap:t.gap,direction:"vertical"}]),L.has(t.bottom)||L.set(t.bottom,[]))}),M=E(L),_=v(M)),r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(e.fixedNodeConstraint&&e.fixedNodeConstraint.length>1)e.fixedNodeConstraint.forEach(function(t,e){T[e]=[t.position.x,t.position.y],A[e]=[l[h.get(t.nodeId)],d[h.get(t.nodeId)]]}),w=!0;else if(e.alignmentConstraint)!function(){var t=0;if(e.alignmentConstraint.vertical){for(var i=e.alignmentConstraint.vertical,r=function(e){var r=new Set;i[e].forEach(function(t){r.add(t)});var o=new Set([].concat(n(r)).filter(function(t){return C.has(t)})),s=void 0;s=o.size>0?l[h.get(o.values().next().value)]:p(r).x,i[e].forEach(function(e){T[t]=[s,d[h.get(e)]],A[t]=[l[h.get(e)],d[h.get(e)]],t++})},o=0;o<i.length;o++)r(o);w=!0}if(e.alignmentConstraint.horizontal){for(var s=e.alignmentConstraint.horizontal,a=function(e){var i=new Set;s[e].forEach(function(t){i.add(t)});var r=new Set([].concat(n(i)).filter(function(t){return C.has(t)})),o=void 0;o=r.size>0?l[h.get(r.values().next().value)]:p(i).y,s[e].forEach(function(e){T[t]=[l[h.get(e)],o],A[t]=[l[h.get(e)],d[h.get(e)]],t++})},c=0;c<s.length;c++)a(c);w=!0}e.relativePlacementConstraint&&(I=!0)}();else if(e.relativePlacementConstraint){for(var x=0,O=0,D=0;D<_.length;D++)_[D].length>x&&(x=_[D].length,O=D);if(x<M.size/2)y(e.relativePlacementConstraint),w=!1,I=!1;else{var R=new Map,b=new Map,F=[];_[O].forEach(function(t){L.get(t).forEach(function(e){"horizontal"==e.direction?(R.has(t)?R.get(t).push(e):R.set(t,[e]),R.has(e.id)||R.set(e.id,[]),F.push({left:t,right:e.id})):(b.has(t)?b.get(t).push(e):b.set(t,[e]),b.has(e.id)||b.set(e.id,[]),F.push({top:t,bottom:e.id}))})}),y(F),I=!1;var G=m(R,"horizontal"),S=m(b,"vertical");_[O].forEach(function(t,e){A[e]=[l[h.get(t)],d[h.get(t)]],T[e]=[],G.has(t)?T[e][0]=G.get(t):T[e][0]=l[h.get(t)],S.has(t)?T[e][1]=S.get(t):T[e][1]=d[h.get(t)]}),w=!0}}if(w){for(var P,U=s.transpose(T),Y=s.transpose(A),k=0;k<U.length;k++)U[k]=s.multGamma(U[k]),Y[k]=s.multGamma(Y[k]);var H=s.multMat(U,s.transpose(Y)),X=a.svd(H);P=s.multMat(X.V,s.transpose(X.U));for(var z=0;z<h.size;z++){var B=[l[z],d[z]],V=[P[0][0],P[1][0]],W=[P[0][1],P[1][1]];l[z]=s.dotProduct(B,V),d[z]=s.dotProduct(B,W)}I&&y(e.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(e.fixedNodeConstraint&&e.fixedNodeConstraint.length>0){var $={x:0,y:0};e.fixedNodeConstraint.forEach(function(t,e){var i,n,r={x:l[h.get(t.nodeId)],y:d[h.get(t.nodeId)]},o=t.position,s=(n=r,{x:(i=o).x-n.x,y:i.y-n.y});$.x+=s.x,$.y+=s.y}),$.x/=e.fixedNodeConstraint.length,$.y/=e.fixedNodeConstraint.length,l.forEach(function(t,e){l[e]+=$.x}),d.forEach(function(t,e){d[e]+=$.y}),e.fixedNodeConstraint.forEach(function(t){l[h.get(t.nodeId)]=t.position.x,d[h.get(t.nodeId)]=t.position.y})}if(e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var j=e.alignmentConstraint.vertical,q=function(t){var e=new Set;j[t].forEach(function(t){e.add(t)});var i=new Set([].concat(n(e)).filter(function(t){return C.has(t)})),r=void 0;r=i.size>0?l[h.get(i.values().next().value)]:p(e).x,e.forEach(function(t){C.has(t)||(l[h.get(t)]=r)})},K=0;K<j.length;K++)q(K);if(e.alignmentConstraint.horizontal)for(var Z=e.alignmentConstraint.horizontal,Q=function(t){var e=new Set;Z[t].forEach(function(t){e.add(t)});var i=new Set([].concat(n(e)).filter(function(t){return C.has(t)})),r=void 0;r=i.size>0?d[h.get(i.values().next().value)]:p(e).y,e.forEach(function(t){C.has(t)||(d[h.get(t)]=r)})},J=0;J<Z.length;J++)Q(J)}e.relativePlacementConstraint&&function(){var t=new Map,i=new Map,n=new Map,r=new Map,o=new Map,s=new Map,a=new Set,c=new Set;if(C.forEach(function(t){a.add(t),c.add(t)}),e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var g=e.alignmentConstraint.vertical,u=function(e){n.set("dummy"+e,[]),g[e].forEach(function(i){t.set(i,"dummy"+e),n.get("dummy"+e).push(i),C.has(i)&&a.add("dummy"+e)}),o.set("dummy"+e,l[h.get(g[e][0])])},f=0;f<g.length;f++)u(f);if(e.alignmentConstraint.horizontal)for(var p=e.alignmentConstraint.horizontal,y=function(t){r.set("dummy"+t,[]),p[t].forEach(function(e){i.set(e,"dummy"+t),r.get("dummy"+t).push(e),C.has(e)&&c.add("dummy"+t)}),s.set("dummy"+t,d[h.get(p[t][0])])},T=0;T<p.length;T++)y(T)}var A=new Map,w=new Map,I=function(e){L.get(e).forEach(function(n){var r=void 0,o=void 0;"horizontal"==n.direction?(r=t.get(e)?t.get(e):e,o=t.get(n.id)?{id:t.get(n.id),gap:n.gap,direction:n.direction}:n,A.has(r)?A.get(r).push(o):A.set(r,[o]),A.has(o.id)||A.set(o.id,[])):(r=i.get(e)?i.get(e):e,o=i.get(n.id)?{id:i.get(n.id),gap:n.gap,direction:n.direction}:n,w.has(r)?w.get(r).push(o):w.set(r,[o]),w.has(o.id)||w.set(o.id,[]))})},M=!0,_=!1,x=void 0;try{for(var O,D=L.keys()[Symbol.iterator]();!(M=(O=D.next()).done);M=!0)I(O.value)}catch(t){_=!0,x=t}finally{try{!M&&D.return&&D.return()}finally{if(_)throw x}}var R=E(A),b=E(w),F=v(R),G=v(b),S=N(A),P=N(w),U=[],Y=[];F.forEach(function(t,e){U[e]=[],t.forEach(function(t){0==S.get(t).length&&U[e].push(t)})}),G.forEach(function(t,e){Y[e]=[],t.forEach(function(t){0==P.get(t).length&&Y[e].push(t)})});var k=m(A,"horizontal",a,o,U),H=m(w,"vertical",c,s,Y),X=function(t){n.get(t)?n.get(t).forEach(function(e){l[h.get(e)]=k.get(t)}):l[h.get(t)]=k.get(t)},z=!0,B=!1,V=void 0;try{for(var W,$=k.keys()[Symbol.iterator]();!(z=(W=$.next()).done);z=!0)X(W.value)}catch(t){B=!0,V=t}finally{try{!z&&$.return&&$.return()}finally{if(B)throw V}}var j=function(t){r.get(t)?r.get(t).forEach(function(e){d[h.get(e)]=H.get(t)}):d[h.get(t)]=H.get(t)},q=!0,K=!1,Z=void 0;try{for(var Q,J=H.keys()[Symbol.iterator]();!(q=(Q=J.next()).done);q=!0)j(Q.value)}catch(t){K=!0,Z=t}finally{try{!q&&J.return&&J.return()}finally{if(K)throw Z}}}()}for(var tt=0;tt<c.length;tt++){var et=c[tt];null==et.getChild()&&et.setCenter(l[h.get(et.id)],d[h.get(et.id)])}},t.exports=h},551:e=>{e.exports=t}},i={},n=function t(n){var r=i[n];if(void 0!==r)return r.exports;var o=i[n]={exports:{}};return e[n](o,o.exports,t),o.exports}(45);return n})()},t.exports=n(i(1917))},1917(t){var e;e=function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=28)}([function(t,e,i){"use strict";function n(){}n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,t.exports=n},function(t,e,i){"use strict";var n=i(2),r=i(8),o=i(9);function s(t,e,i){n.call(this,i),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=i,this.bendpoints=[],this.source=t,this.target=e}for(var a in s.prototype=Object.create(n.prototype),n)s[a]=n[a];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(t){if(this.source===t)return this.target;if(this.target===t)return this.source;throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(t,e){for(var i=this.getOtherEnd(t),n=e.getGraphManager().getRoot();;){if(i.getOwner()==e)return i;if(i.getOwner()==n)break;i=i.getOwner().getParent()}return null},s.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=r.getIntersection(this.target.getRect(),this.source.getRect(),t),this.isOverlapingSourceAndTarget||(this.lengthX=t[0]-t[2],this.lengthY=t[1]-t[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},s.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=s},function(t,e,i){"use strict";t.exports=function(t){this.vGraphObject=t}},function(t,e,i){"use strict";var n=i(2),r=i(10),o=i(13),s=i(0),a=i(16),h=i(5);function l(t,e,i,s){null==i&&null==s&&(s=e),n.call(this,s),null!=t.graphManager&&(t=t.graphManager),this.estimatedSize=r.MIN_VALUE,this.inclusionTreeDepth=r.MAX_VALUE,this.vGraphObject=s,this.edges=[],this.graphManager=t,this.rect=null!=i&&null!=e?new o(e.x,e.y,i.width,i.height):new o}for(var d in l.prototype=Object.create(n.prototype),n)l[d]=n[d];l.prototype.getEdges=function(){return this.edges},l.prototype.getChild=function(){return this.child},l.prototype.getOwner=function(){return this.owner},l.prototype.getWidth=function(){return this.rect.width},l.prototype.setWidth=function(t){this.rect.width=t},l.prototype.getHeight=function(){return this.rect.height},l.prototype.setHeight=function(t){this.rect.height=t},l.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},l.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},l.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},l.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},l.prototype.getRect=function(){return this.rect},l.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},l.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},l.prototype.setRect=function(t,e){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=e.width,this.rect.height=e.height},l.prototype.setCenter=function(t,e){this.rect.x=t-this.rect.width/2,this.rect.y=e-this.rect.height/2},l.prototype.setLocation=function(t,e){this.rect.x=t,this.rect.y=e},l.prototype.moveBy=function(t,e){this.rect.x+=t,this.rect.y+=e},l.prototype.getEdgeListToNode=function(t){var e=[],i=this;return i.edges.forEach(function(n){if(n.target==t){if(n.source!=i)throw"Incorrect edge source!";e.push(n)}}),e},l.prototype.getEdgesBetween=function(t){var e=[],i=this;return i.edges.forEach(function(n){if(n.source!=i&&n.target!=i)throw"Incorrect edge source and/or target";n.target!=t&&n.source!=t||e.push(n)}),e},l.prototype.getNeighborsList=function(){var t=new Set,e=this;return e.edges.forEach(function(i){if(i.source==e)t.add(i.target);else{if(i.target!=e)throw"Incorrect incidency!";t.add(i.source)}}),t},l.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var e=this.child.getNodes(),i=0;i<e.length;i++)e[i].withChildren().forEach(function(e){t.add(e)});return t},l.prototype.getNoOfChildren=function(){var t=0;if(null==this.child)t=1;else for(var e=this.child.getNodes(),i=0;i<e.length;i++)t+=e[i].getNoOfChildren();return 0==t&&(t=1),t},l.prototype.getEstimatedSize=function(){if(this.estimatedSize==r.MIN_VALUE)throw"assert failed";return this.estimatedSize},l.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},l.prototype.scatter=function(){var t,e,i=-s.INITIAL_WORLD_BOUNDARY,n=s.INITIAL_WORLD_BOUNDARY;t=s.WORLD_CENTER_X+a.nextDouble()*(n-i)+i;var r=-s.INITIAL_WORLD_BOUNDARY,o=s.INITIAL_WORLD_BOUNDARY;e=s.WORLD_CENTER_Y+a.nextDouble()*(o-r)+r,this.rect.x=t,this.rect.y=e},l.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var e=t.getRight()-t.getLeft(),i=t.getBottom()-t.getTop();this.labelWidth&&("left"==this.labelPosHorizontal?(this.rect.x-=this.labelWidth,this.setWidth(e+this.labelWidth)):"center"==this.labelPosHorizontal&&this.labelWidth>e?(this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(e+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(i+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>i?(this.rect.y-=(this.labelHeight-i)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(i+this.labelHeight))}}},l.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==r.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},l.prototype.transform=function(t){var e=this.rect.x;e>s.WORLD_BOUNDARY?e=s.WORLD_BOUNDARY:e<-s.WORLD_BOUNDARY&&(e=-s.WORLD_BOUNDARY);var i=this.rect.y;i>s.WORLD_BOUNDARY?i=s.WORLD_BOUNDARY:i<-s.WORLD_BOUNDARY&&(i=-s.WORLD_BOUNDARY);var n=new h(e,i),r=t.inverseTransformPoint(n);this.setLocation(r.x,r.y)},l.prototype.getLeft=function(){return this.rect.x},l.prototype.getRight=function(){return this.rect.x+this.rect.width},l.prototype.getTop=function(){return this.rect.y},l.prototype.getBottom=function(){return this.rect.y+this.rect.height},l.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=l},function(t,e,i){"use strict";var n=i(0);function r(){}for(var o in n)r[o]=n[o];r.MAX_ITERATIONS=2500,r.DEFAULT_EDGE_LENGTH=50,r.DEFAULT_SPRING_STRENGTH=.45,r.DEFAULT_REPULSION_STRENGTH=4500,r.DEFAULT_GRAVITY_STRENGTH=.4,r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,r.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,r.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,r.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,r.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,r.COOLING_ADAPTATION_FACTOR=.33,r.ADAPTATION_LOWER_NODE_LIMIT=1e3,r.ADAPTATION_UPPER_NODE_LIMIT=5e3,r.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,r.MAX_NODE_DISPLACEMENT=3*r.MAX_NODE_DISPLACEMENT_INCREMENTAL,r.MIN_REPULSION_DIST=r.DEFAULT_EDGE_LENGTH/10,r.CONVERGENCE_CHECK_PERIOD=100,r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,r.MIN_EDGE_LENGTH=1,r.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=r},function(t,e,i){"use strict";function n(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(t){this.x=t},n.prototype.setY=function(t){this.y=t},n.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=n},function(t,e,i){"use strict";var n=i(2),r=i(10),o=i(0),s=i(7),a=i(3),h=i(1),l=i(13),d=i(12),c=i(11);function g(t,e,i){n.call(this,i),this.estimatedSize=r.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof s?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(var u in g.prototype=Object.create(n.prototype),n)g[u]=n[u];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(t,e,i){if(null==e&&null==i){var n=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(n)>-1)throw"Node already in graph!";return n.owner=this,this.getNodes().push(n),n}var r=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(i)>-1))throw"Source or target not in graph!";if(e.owner!=i.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=i.owner?null:(r.source=e,r.target=i,r.isInterGraph=!1,this.getEdges().push(r),e.edges.push(r),i!=e&&i.edges.push(r),r)},g.prototype.remove=function(t){var e=t;if(t instanceof a){if(null==e)throw"Node is null!";if(null==e.owner||e.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var i=e.edges.slice(),n=i.length,r=0;r<n;r++)(o=i[r]).isInterGraph?this.graphManager.remove(o):o.source.owner.remove(o);if(-1==(s=this.nodes.indexOf(e)))throw"Node not in owner node list!";this.nodes.splice(s,1)}else if(t instanceof h){var o;if(null==(o=t))throw"Edge is null!";if(null==o.source||null==o.target)throw"Source and/or target is null!";if(null==o.source.owner||null==o.target.owner||o.source.owner!=this||o.target.owner!=this)throw"Source and/or target owner is invalid!";var s,l=o.source.edges.indexOf(o),d=o.target.edges.indexOf(o);if(!(l>-1&&d>-1))throw"Source and/or target doesn't know this edge!";if(o.source.edges.splice(l,1),o.target!=o.source&&o.target.edges.splice(d,1),-1==(s=o.source.owner.getEdges().indexOf(o)))throw"Not in owner's edge list!";o.source.owner.getEdges().splice(s,1)}},g.prototype.updateLeftTop=function(){for(var t,e,i,n=r.MAX_VALUE,o=r.MAX_VALUE,s=this.getNodes(),a=s.length,h=0;h<a;h++){var l=s[h];n>(t=l.getTop())&&(n=t),o>(e=l.getLeft())&&(o=e)}return n==r.MAX_VALUE?null:(i=null!=s[0].getParent().paddingLeft?s[0].getParent().paddingLeft:this.margin,this.left=o-i,this.top=n-i,new d(this.left,this.top))},g.prototype.updateBounds=function(t){for(var e,i,n,o,s,a=r.MAX_VALUE,h=-r.MAX_VALUE,d=r.MAX_VALUE,c=-r.MAX_VALUE,g=this.nodes,u=g.length,f=0;f<u;f++){var p=g[f];t&&null!=p.child&&p.updateBounds(),a>(e=p.getLeft())&&(a=e),h<(i=p.getRight())&&(h=i),d>(n=p.getTop())&&(d=n),c<(o=p.getBottom())&&(c=o)}var m=new l(a,d,h-a,c-d);a==r.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),s=null!=g[0].getParent().paddingLeft?g[0].getParent().paddingLeft:this.margin,this.left=m.x-s,this.right=m.x+m.width+s,this.top=m.y-s,this.bottom=m.y+m.height+s},g.calculateBounds=function(t){for(var e,i,n,o,s=r.MAX_VALUE,a=-r.MAX_VALUE,h=r.MAX_VALUE,d=-r.MAX_VALUE,c=t.length,g=0;g<c;g++){var u=t[g];s>(e=u.getLeft())&&(s=e),a<(i=u.getRight())&&(a=i),h>(n=u.getTop())&&(h=n),d<(o=u.getBottom())&&(d=o)}return new l(s,h,a-s,d-h)},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==r.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var t=0,e=this.nodes,i=e.length,n=0;n<i;n++)t+=e[n].calcEstimatedSize();return this.estimatedSize=0==t?o.EMPTY_COMPOUND_NODE_SIZE:t/Math.sqrt(this.nodes.length),this.estimatedSize},g.prototype.updateConnected=function(){var t=this;if(0!=this.nodes.length){var e,i,n=new c,r=new Set,o=this.nodes[0];for(o.withChildren().forEach(function(t){n.push(t),r.add(t)});0!==n.length;)for(var s=(e=(o=n.shift()).getEdges()).length,a=0;a<s;a++)null==(i=e[a].getOtherEndInGraph(o,this))||r.has(i)||i.withChildren().forEach(function(t){n.push(t),r.add(t)});if(this.isConnected=!1,r.size>=this.nodes.length){var h=0;r.forEach(function(e){e.owner==t&&h++}),h==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=g},function(t,e,i){"use strict";var n,r=i(1);function o(t){n=i(6),this.layout=t,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null),i=this.add(t,e);return this.setRootGraph(i),this.rootGraph},o.prototype.add=function(t,e,i,n,r){if(null==i&&null==n&&null==r){if(null==t)throw"Graph is null!";if(null==e)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=e.child)throw"Already has a child!";return t.parent=e,e.child=t,t}r=i,i=t;var o=(n=e).getOwner(),s=r.getOwner();if(null==o||o.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==s||s.getGraphManager()!=this)throw"Target not in this graph mgr!";if(o==s)return i.isInterGraph=!1,o.add(i,n,r);if(i.isInterGraph=!0,i.source=n,i.target=r,this.edges.indexOf(i)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(i),null==i.source||null==i.target)throw"Edge source and/or target is null!";if(-1!=i.source.edges.indexOf(i)||-1!=i.target.edges.indexOf(i))throw"Edge already in source and/or target incidency list!";return i.source.edges.push(i),i.target.edges.push(i),i},o.prototype.remove=function(t){if(t instanceof n){var e=t;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(e!=this.rootGraph&&(null==e.parent||e.parent.graphManager!=this))throw"Invalid parent node!";for(var i,o=[],s=(o=o.concat(e.getEdges())).length,a=0;a<s;a++)i=o[a],e.remove(i);var h,l=[];for(s=(l=l.concat(e.getNodes())).length,a=0;a<s;a++)h=l[a],e.remove(h);e==this.rootGraph&&this.setRootGraph(null);var d=this.graphs.indexOf(e);this.graphs.splice(d,1),e.parent=null}else if(t instanceof r){if(null==(i=t))throw"Edge is null!";if(!i.isInterGraph)throw"Not an inter-graph edge!";if(null==i.source||null==i.target)throw"Source and/or target is null!";if(-1==i.source.edges.indexOf(i)||-1==i.target.edges.indexOf(i))throw"Source and/or target doesn't know this edge!";if(d=i.source.edges.indexOf(i),i.source.edges.splice(d,1),d=i.target.edges.indexOf(i),i.target.edges.splice(d,1),null==i.source.owner||null==i.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==i.source.owner.getGraphManager().edges.indexOf(i))throw"Not in owner graph manager's edge list!";d=i.source.owner.getGraphManager().edges.indexOf(i),i.source.owner.getGraphManager().edges.splice(d,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(null==this.allNodes){for(var t=[],e=this.getGraphs(),i=e.length,n=0;n<i;n++)t=t.concat(e[n].getNodes());this.allNodes=t}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(null==this.allEdges){for(var t=[],e=this.getGraphs(),i=(e.length,0);i<e.length;i++)t=t.concat(e[i].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(t){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=t},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(t){if(t.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=t,null==t.parent&&(t.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(t,e){if(null==t||null==e)throw"assert failed";if(t==e)return!0;for(var i,n=t.getOwner();null!=(i=n.getParent());){if(i==e)return!0;if(null==(n=i.getOwner()))break}for(n=e.getOwner();null!=(i=n.getParent());){if(i==t)return!0;if(null==(n=i.getOwner()))break}return!1},o.prototype.calcLowestCommonAncestors=function(){for(var t,e,i,n,r,o=this.getAllEdges(),s=o.length,a=0;a<s;a++)if(e=(t=o[a]).source,i=t.target,t.lca=null,t.sourceInLca=e,t.targetInLca=i,e!=i){for(n=e.getOwner();null==t.lca;){for(t.targetInLca=i,r=i.getOwner();null==t.lca;){if(r==n){t.lca=r;break}if(r==this.rootGraph)break;if(null!=t.lca)throw"assert failed";t.targetInLca=r.getParent(),r=t.targetInLca.getOwner()}if(n==this.rootGraph)break;null==t.lca&&(t.sourceInLca=n.getParent(),n=t.sourceInLca.getOwner())}if(null==t.lca)throw"assert failed"}else t.lca=e.getOwner()},o.prototype.calcLowestCommonAncestor=function(t,e){if(t==e)return t.getOwner();for(var i=t.getOwner();null!=i;){for(var n=e.getOwner();null!=n;){if(n==i)return n;n=n.getParent().getOwner()}i=i.getParent().getOwner()}return i},o.prototype.calcInclusionTreeDepths=function(t,e){var i;null==t&&null==e&&(t=this.rootGraph,e=1);for(var n=t.getNodes(),r=n.length,o=0;o<r;o++)(i=n[o]).inclusionTreeDepth=e,null!=i.child&&this.calcInclusionTreeDepths(i.child,e+1)},o.prototype.includesInvalidEdge=function(){for(var t,e=[],i=this.edges.length,n=0;n<i;n++)t=this.edges[n],this.isOneAncestorOfOther(t.source,t.target)&&e.push(t);for(n=0;n<e.length;n++)this.remove(e[n]);return!1},t.exports=o},function(t,e,i){"use strict";var n=i(12);function r(){}r.calcSeparationAmount=function(t,e,i,n){if(!t.intersects(e))throw"assert failed";var r=new Array(2);this.decideDirectionsForOverlappingNodes(t,e,r),i[0]=Math.min(t.getRight(),e.getRight())-Math.max(t.x,e.x),i[1]=Math.min(t.getBottom(),e.getBottom())-Math.max(t.y,e.y),t.getX()<=e.getX()&&t.getRight()>=e.getRight()?i[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(i[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?i[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(i[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()));var o=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()&&(o=1);var s=o*i[0],a=i[1]/o;i[0]<a?a=i[0]:s=i[1],i[0]=-1*r[0]*(a/2+n),i[1]=-1*r[1]*(s/2+n)},r.decideDirectionsForOverlappingNodes=function(t,e,i){t.getCenterX()<e.getCenterX()?i[0]=-1:i[0]=1,t.getCenterY()<e.getCenterY()?i[1]=-1:i[1]=1},r.getIntersection2=function(t,e,i){var n=t.getCenterX(),r=t.getCenterY(),o=e.getCenterX(),s=e.getCenterY();if(t.intersects(e))return i[0]=n,i[1]=r,i[2]=o,i[3]=s,!0;var a=t.getX(),h=t.getY(),l=t.getRight(),d=t.getX(),c=t.getBottom(),g=t.getRight(),u=t.getWidthHalf(),f=t.getHeightHalf(),p=e.getX(),m=e.getY(),y=e.getRight(),v=e.getX(),E=e.getBottom(),N=e.getRight(),T=e.getWidthHalf(),A=e.getHeightHalf(),w=!1,I=!1;if(n===o){if(r>s)return i[0]=n,i[1]=h,i[2]=o,i[3]=E,!1;if(r<s)return i[0]=n,i[1]=c,i[2]=o,i[3]=m,!1}else if(r===s){if(n>o)return i[0]=a,i[1]=r,i[2]=y,i[3]=s,!1;if(n<o)return i[0]=l,i[1]=r,i[2]=p,i[3]=s,!1}else{var C=t.height/t.width,L=e.height/e.width,M=(s-r)/(o-n),_=void 0,x=void 0,O=void 0,D=void 0,R=void 0,b=void 0;if(-C===M?n>o?(i[0]=d,i[1]=c,w=!0):(i[0]=l,i[1]=h,w=!0):C===M&&(n>o?(i[0]=a,i[1]=h,w=!0):(i[0]=g,i[1]=c,w=!0)),-L===M?o>n?(i[2]=v,i[3]=E,I=!0):(i[2]=y,i[3]=m,I=!0):L===M&&(o>n?(i[2]=p,i[3]=m,I=!0):(i[2]=N,i[3]=E,I=!0)),w&&I)return!1;if(n>o?r>s?(_=this.getCardinalDirection(C,M,4),x=this.getCardinalDirection(L,M,2)):(_=this.getCardinalDirection(-C,M,3),x=this.getCardinalDirection(-L,M,1)):r>s?(_=this.getCardinalDirection(-C,M,1),x=this.getCardinalDirection(-L,M,3)):(_=this.getCardinalDirection(C,M,2),x=this.getCardinalDirection(L,M,4)),!w)switch(_){case 1:D=h,O=n+-f/M,i[0]=O,i[1]=D;break;case 2:O=g,D=r+u*M,i[0]=O,i[1]=D;break;case 3:D=c,O=n+f/M,i[0]=O,i[1]=D;break;case 4:O=d,D=r+-u*M,i[0]=O,i[1]=D}if(!I)switch(x){case 1:b=m,R=o+-A/M,i[2]=R,i[3]=b;break;case 2:R=N,b=s+T*M,i[2]=R,i[3]=b;break;case 3:b=E,R=o+A/M,i[2]=R,i[3]=b;break;case 4:R=v,b=s+-T*M,i[2]=R,i[3]=b}}return!1},r.getCardinalDirection=function(t,e,i){return t>e?i:1+i%4},r.getIntersection=function(t,e,i,r){if(null==r)return this.getIntersection2(t,e,i);var o,s,a,h,l,d,c,g=t.x,u=t.y,f=e.x,p=e.y,m=i.x,y=i.y,v=r.x,E=r.y;return 0===(c=(o=p-u)*(h=m-v)-(s=E-y)*(a=g-f))?null:new n((a*(d=v*y-m*E)-h*(l=f*u-g*p))/c,(s*l-o*d)/c)},r.angleOfVector=function(t,e,i,n){var r=void 0;return t!==i?(r=Math.atan((n-e)/(i-t)),i<t?r+=Math.PI:n<e&&(r+=this.TWO_PI)):r=n<e?this.ONE_AND_HALF_PI:this.HALF_PI,r},r.doIntersect=function(t,e,i,n){var r=t.x,o=t.y,s=e.x,a=e.y,h=i.x,l=i.y,d=n.x,c=n.y,g=(s-r)*(c-l)-(d-h)*(a-o);if(0===g)return!1;var u=((c-l)*(d-r)+(h-d)*(c-o))/g,f=((o-a)*(d-r)+(s-r)*(c-o))/g;return 0<u&&u<1&&0<f&&f<1},r.findCircleLineIntersections=function(t,e,i,n,r,o,s){var a=(i-t)*(i-t)+(n-e)*(n-e),h=2*((t-r)*(i-t)+(e-o)*(n-e)),l=(t-r)*(t-r)+(e-o)*(e-o)-s*s;if(h*h-4*a*l>=0){var d=(-h+Math.sqrt(h*h-4*a*l))/(2*a),c=(-h-Math.sqrt(h*h-4*a*l))/(2*a);return d>=0&&d<=1?[d]:c>=0&&c<=1?[c]:null}return null},r.HALF_PI=.5*Math.PI,r.ONE_AND_HALF_PI=1.5*Math.PI,r.TWO_PI=2*Math.PI,r.THREE_PI=3*Math.PI,t.exports=r},function(t,e,i){"use strict";function n(){}n.sign=function(t){return t>0?1:t<0?-1:0},n.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},n.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=n},function(t,e,i){"use strict";function n(){}n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,t.exports=n},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=function(t){return{value:t,next:null,prev:null}},o=function(t,e,i,n){return null!==t?t.next=e:n.head=e,null!==i?i.prev=e:n.tail=e,e.prev=t,e.next=i,n.length++,e},s=function(t,e){var i=t.prev,n=t.next;return null!==i?i.next=n:e.head=n,null!==n?n.prev=i:e.tail=i,t.prev=t.next=null,e.length--,t},a=function(){function t(e){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.length=0,this.head=null,this.tail=null,null!=e&&e.forEach(function(t){return i.push(t)})}return n(t,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,e){return o(e.prev,r(t),e,this)}},{key:"insertAfter",value:function(t,e){return o(e,r(t),e.next,this)}},{key:"insertNodeBefore",value:function(t,e){return o(e.prev,t,e,this)}},{key:"insertNodeAfter",value:function(t,e){return o(e,t,e.next,this)}},{key:"push",value:function(t){return o(this.tail,r(t),null,this)}},{key:"unshift",value:function(t){return o(null,r(t),this.head,this)}},{key:"remove",value:function(t){return s(t,this)}},{key:"pop",value:function(){return s(this.tail,this).value}},{key:"popNode",value:function(){return s(this.tail,this)}},{key:"shift",value:function(){return s(this.head,this).value}},{key:"shiftNode",value:function(){return s(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var e=1,i=this.head;e<t;)i=i.next,e++;return i.value}}},{key:"set_object_at",value:function(t,e){if(t<=this.length()){for(var i=1,n=this.head;i<t;)n=n.next,i++;n.value=e}}}]),t}();t.exports=a},function(t,e,i){"use strict";function n(t,e,i){this.x=null,this.y=null,null==t&&null==e&&null==i?(this.x=0,this.y=0):"number"==typeof t&&"number"==typeof e&&null==i?(this.x=t,this.y=e):"Point"==t.constructor.name&&null==e&&null==i&&(i=t,this.x=i.x,this.y=i.y)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.getLocation=function(){return new n(this.x,this.y)},n.prototype.setLocation=function(t,e,i){"Point"==t.constructor.name&&null==e&&null==i?(i=t,this.setLocation(i.x,i.y)):"number"==typeof t&&"number"==typeof e&&null==i&&(parseInt(t)==t&&parseInt(e)==e?this.move(t,e):(this.x=Math.floor(t+.5),this.y=Math.floor(e+.5)))},n.prototype.move=function(t,e){this.x=t,this.y=e},n.prototype.translate=function(t,e){this.x+=t,this.y+=e},n.prototype.equals=function(t){if("Point"==t.constructor.name){var e=t;return this.x==e.x&&this.y==e.y}return this==t},n.prototype.toString=function(){return(new n).constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=n},function(t,e,i){"use strict";function n(t,e,i,n){this.x=0,this.y=0,this.width=0,this.height=0,null!=t&&null!=e&&null!=i&&null!=n&&(this.x=t,this.y=e,this.width=i,this.height=n)}n.prototype.getX=function(){return this.x},n.prototype.setX=function(t){this.x=t},n.prototype.getY=function(){return this.y},n.prototype.setY=function(t){this.y=t},n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(t){this.width=t},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(t){this.height=t},n.prototype.getRight=function(){return this.x+this.width},n.prototype.getBottom=function(){return this.y+this.height},n.prototype.intersects=function(t){return!(this.getRight()<t.x||this.getBottom()<t.y||t.getRight()<this.x||t.getBottom()<this.y)},n.prototype.getCenterX=function(){return this.x+this.width/2},n.prototype.getMinX=function(){return this.getX()},n.prototype.getMaxX=function(){return this.getX()+this.width},n.prototype.getCenterY=function(){return this.y+this.height/2},n.prototype.getMinY=function(){return this.getY()},n.prototype.getMaxY=function(){return this.getY()+this.height},n.prototype.getWidthHalf=function(){return this.width/2},n.prototype.getHeightHalf=function(){return this.height/2},t.exports=n},function(t,e,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function r(){}r.lastID=0,r.createID=function(t){return r.isPrimitive(t)?t:(null!=t.uniqueID||(t.uniqueID=r.getString(),r.lastID++),t.uniqueID)},r.getString=function(t){return null==t&&(t=r.lastID),"Object#"+t},r.isPrimitive=function(t){var e=void 0===t?"undefined":n(t);return null==t||"object"!=e&&"function"!=e},t.exports=r},function(t,e,i){"use strict";function n(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}var r=i(0),o=i(7),s=i(3),a=i(1),h=i(6),l=i(5),d=i(17),c=i(29);function g(t){c.call(this),this.layoutQuality=r.QUALITY,this.createBendsAsNeeded=r.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=r.DEFAULT_INCREMENTAL,this.animationOnLayout=r.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=r.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=r.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=r.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=t&&(this.isRemoteUse=t)}g.RANDOM_SEED=1,g.prototype=Object.create(c.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var t=new o(this);return this.graphManager=t,t},g.prototype.newGraph=function(t){return new h(null,this.graphManager,t)},g.prototype.newNode=function(t){return new s(this.graphManager,t)},g.prototype.newEdge=function(t){return new a(null,null,t)},g.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){var t;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),t=!this.checkLayoutSuccess()&&this.layout(),"during"!==r.ANIMATE&&(t&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,t)},g.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var t=this.graphManager.getAllEdges(),e=0;e<t.length;e++)t[e];var i=this.graphManager.getRoot().getNodes();for(e=0;e<i.length;e++)i[e];this.update(this.graphManager.getRoot())}},g.prototype.update=function(t){if(null==t)this.update2();else if(t instanceof s){var e=t;if(null!=e.getChild())for(var i=e.getChild().getNodes(),n=0;n<i.length;n++)update(i[n]);null!=e.vGraphObject&&e.vGraphObject.update(e)}else if(t instanceof a){var r=t;null!=r.vGraphObject&&r.vGraphObject.update(r)}else if(t instanceof h){var o=t;null!=o.vGraphObject&&o.vGraphObject.update(o)}},g.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=r.QUALITY,this.animationDuringLayout=r.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=r.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=r.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=r.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=r.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=r.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},g.prototype.transform=function(t){if(null==t)this.transform(new l(0,0));else{var e=new d,i=this.graphManager.getRoot().updateLeftTop();if(null!=i){e.setWorldOrgX(t.x),e.setWorldOrgY(t.y),e.setDeviceOrgX(i.x),e.setDeviceOrgY(i.y);for(var n=this.getAllNodes(),r=0;r<n.length;r++)n[r].transform(e)}}},g.prototype.positionNodesRandomly=function(t){if(null==t)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var e,i,n=t.getNodes(),r=0;r<n.length;r++)null==(i=(e=n[r]).getChild())||0==i.getNodes().length?e.scatter():(this.positionNodesRandomly(i),e.updateBounds())},g.prototype.getFlatForest=function(){for(var t=[],e=!0,i=this.graphManager.getRoot().getNodes(),r=!0,o=0;o<i.length;o++)null!=i[o].getChild()&&(r=!1);if(!r)return t;var s=new Set,a=[],h=new Map,l=[];for(l=l.concat(i);l.length>0&&e;){for(a.push(l[0]);a.length>0&&e;){var d=a[0];a.splice(0,1),s.add(d);var c=d.getEdges();for(o=0;o<c.length;o++){var g=c[o].getOtherEnd(d);if(h.get(d)!=g){if(s.has(g)){e=!1;break}a.push(g),h.set(g,d)}}}if(e){var u=[].concat(n(s));for(t.push(u),o=0;o<u.length;o++){var f=u[o],p=l.indexOf(f);p>-1&&l.splice(p,1)}s=new Set,h=new Map}else t=[]}return t},g.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],i=t.source,n=this.graphManager.calcLowestCommonAncestor(t.source,t.target),r=0;r<t.bendpoints.length;r++){var o=this.newNode(null);o.setRect(new Point(0,0),new Dimension(1,1)),n.add(o);var s=this.newEdge(null);this.graphManager.add(s,i,o),e.add(o),i=o}return s=this.newEdge(null),this.graphManager.add(s,i,t.target),this.edgeToDummyNodes.set(t,e),t.isInterGraph()?this.graphManager.remove(t):n.remove(t),e},g.prototype.createBendpointsFromDummyNodes=function(){var t=[];t=t.concat(this.graphManager.getAllEdges()),t=[].concat(n(this.edgeToDummyNodes.keys())).concat(t);for(var e=0;e<t.length;e++){var i=t[e];if(i.bendpoints.length>0){for(var r=this.edgeToDummyNodes.get(i),o=0;o<r.length;o++){var s=r[o],a=new l(s.getCenterX(),s.getCenterY()),h=i.bendpoints.get(o);h.x=a.x,h.y=a.y,s.getOwner().remove(s)}this.graphManager.add(i,i.source,i.target)}}},g.transform=function(t,e,i,n){if(null!=i&&null!=n){var r=e;return t<=50?r-=(e-e/i)/50*(50-t):r+=(e*n-e)/50*(t-50),r}var o,s;return t<=50?(o=9*e/500,s=e/10):(o=9*e/50,s=-8*e),o*t+s},g.findCenterOfTree=function(t){var e=[];e=e.concat(t);var i=[],n=new Map,r=!1,o=null;1!=e.length&&2!=e.length||(r=!0,o=e[0]);for(var s=0;s<e.length;s++){var a=(d=e[s]).getNeighborsList().size;n.set(d,d.getNeighborsList().size),1==a&&i.push(d)}var h=[];for(h=h.concat(i);!r;){var l=[];for(l=l.concat(h),h=[],s=0;s<e.length;s++){var d=e[s],c=e.indexOf(d);c>=0&&e.splice(c,1),d.getNeighborsList().forEach(function(t){if(i.indexOf(t)<0){var e=n.get(t)-1;1==e&&h.push(t),n.set(t,e)}})}i=i.concat(h),1!=e.length&&2!=e.length||(r=!0,o=e[0])}return o},g.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=g},function(t,e,i){"use strict";function n(){}n.seed=1,n.x=0,n.nextDouble=function(){return n.x=1e4*Math.sin(n.seed++),n.x-Math.floor(n.x)},t.exports=n},function(t,e,i){"use strict";var n=i(5);function r(t,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}r.prototype.getWorldOrgX=function(){return this.lworldOrgX},r.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},r.prototype.getWorldOrgY=function(){return this.lworldOrgY},r.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},r.prototype.getWorldExtX=function(){return this.lworldExtX},r.prototype.setWorldExtX=function(t){this.lworldExtX=t},r.prototype.getWorldExtY=function(){return this.lworldExtY},r.prototype.setWorldExtY=function(t){this.lworldExtY=t},r.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},r.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},r.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},r.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},r.prototype.getDeviceExtX=function(){return this.ldeviceExtX},r.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},r.prototype.getDeviceExtY=function(){return this.ldeviceExtY},r.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},r.prototype.transformX=function(t){var e=0,i=this.lworldExtX;return 0!=i&&(e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/i),e},r.prototype.transformY=function(t){var e=0,i=this.lworldExtY;return 0!=i&&(e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/i),e},r.prototype.inverseTransformX=function(t){var e=0,i=this.ldeviceExtX;return 0!=i&&(e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/i),e},r.prototype.inverseTransformY=function(t){var e=0,i=this.ldeviceExtY;return 0!=i&&(e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/i),e},r.prototype.inverseTransformPoint=function(t){return new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=r},function(t,e,i){"use strict";var n=i(15),r=i(4),o=i(0),s=i(8),a=i(9);function h(){n.call(this),this.useSmartIdealEdgeLengthCalculation=r.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=r.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=r.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=r.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*r.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=r.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=r.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=r.MAX_ITERATIONS}for(var l in h.prototype=Object.create(n.prototype),n)h[l]=n[l];h.prototype.initParameters=function(){n.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=r.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){for(var t,e,i,n,s,a,h,l=this.getGraphManager().getAllEdges(),d=0;d<l.length;d++)e=(t=l[d]).idealLength,t.isInterGraph&&(n=t.getSource(),s=t.getTarget(),a=t.getSourceInLca().getEstimatedSize(),h=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=a+h-2*o.SIMPLE_NODE_SIZE),i=t.getLca().getInclusionTreeDepth(),t.idealLength+=e*r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(n.getInclusionTreeDepth()+s.getInclusionTreeDepth()-2*i))},h.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>r.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*r.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-r.ADAPTATION_LOWER_NODE_LIMIT)/(r.ADAPTATION_UPPER_NODE_LIMIT-r.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-r.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=r.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>r.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(r.COOLING_ADAPTATION_FACTOR,1-(t-r.ADAPTATION_LOWER_NODE_LIMIT)/(r.ADAPTATION_UPPER_NODE_LIMIT-r.ADAPTATION_LOWER_NODE_LIMIT)*(1-r.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=r.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*r.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var t,e=this.getAllEdges(),i=0;i<e.length;i++)t=e[i],this.calcSpringForce(t,t.idealLength)},h.prototype.calcRepulsionForces=function(){var t,e,i,n,o,s=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],h=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%r.GRID_CALCULATION_CHECK_PERIOD==1&&s&&this.updateGrid(),o=new Set,t=0;t<h.length;t++)i=h[t],this.calculateRepulsionForceOfANode(i,o,s,a),o.add(i);else for(t=0;t<h.length;t++)for(i=h[t],e=t+1;e<h.length;e++)n=h[e],i.getOwner()==n.getOwner()&&this.calcRepulsionForce(i,n)},h.prototype.calcGravitationalForces=function(){for(var t,e=this.getAllNodesToApplyGravitation(),i=0;i<e.length;i++)t=e[i],this.calcGravitationalForce(t)},h.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].move()},h.prototype.calcSpringForce=function(t,e){var i,n,r,o,s=t.getSource(),a=t.getTarget();if(this.uniformLeafNodeSizes&&null==s.getChild()&&null==a.getChild())t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;0!=(i=t.getLength())&&(r=(n=t.edgeElasticity*(i-e))*(t.lengthX/i),o=n*(t.lengthY/i),s.springForceX+=r,s.springForceY+=o,a.springForceX-=r,a.springForceY-=o)},h.prototype.calcRepulsionForce=function(t,e){var i,n,o,h,l,d,c,g=t.getRect(),u=e.getRect(),f=new Array(2),p=new Array(4);if(g.intersects(u)){s.calcSeparationAmount(g,u,f,r.DEFAULT_EDGE_LENGTH/2),d=2*f[0],c=2*f[1];var m=t.noOfChildren*e.noOfChildren/(t.noOfChildren+e.noOfChildren);t.repulsionForceX-=m*d,t.repulsionForceY-=m*c,e.repulsionForceX+=m*d,e.repulsionForceY+=m*c}else this.uniformLeafNodeSizes&&null==t.getChild()&&null==e.getChild()?(i=u.getCenterX()-g.getCenterX(),n=u.getCenterY()-g.getCenterY()):(s.getIntersection(g,u,p),i=p[2]-p[0],n=p[3]-p[1]),Math.abs(i)<r.MIN_REPULSION_DIST&&(i=a.sign(i)*r.MIN_REPULSION_DIST),Math.abs(n)<r.MIN_REPULSION_DIST&&(n=a.sign(n)*r.MIN_REPULSION_DIST),o=i*i+n*n,h=Math.sqrt(o),d=(l=(t.nodeRepulsion/2+e.nodeRepulsion/2)*t.noOfChildren*e.noOfChildren/o)*i/h,c=l*n/h,t.repulsionForceX-=d,t.repulsionForceY-=c,e.repulsionForceX+=d,e.repulsionForceY+=c},h.prototype.calcGravitationalForce=function(t){var e,i,n,r,o,s,a,h;i=((e=t.getOwner()).getRight()+e.getLeft())/2,n=(e.getTop()+e.getBottom())/2,r=t.getCenterX()-i,o=t.getCenterY()-n,s=Math.abs(r)+t.getWidth()/2,a=Math.abs(o)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(s>(h=e.getEstimatedSize()*this.gravityRangeFactor)||a>h)&&(t.gravitationForceX=-this.gravityConstant*r,t.gravitationForceY=-this.gravityConstant*o):(s>(h=e.getEstimatedSize()*this.compoundGravityRangeFactor)||a>h)&&(t.gravitationForceX=-this.gravityConstant*r*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant)},h.prototype.isConverged=function(){var t,e=!1;return this.totalIterations>this.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||e},h.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},h.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,e=this.graphManager.getAllNodes(),i=0;i<e.length;i++)(t=e[i]).noOfChildren=t.getNoOfChildren()},h.prototype.calcGrid=function(t){var e,i;e=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),i=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var n=new Array(e),r=0;r<e;r++)n[r]=new Array(i);for(r=0;r<e;r++)for(var o=0;o<i;o++)n[r][o]=new Array;return n},h.prototype.addNodeToGrid=function(t,e,i){var n,r,o,s;n=parseInt(Math.floor((t.getRect().x-e)/this.repulsionRange)),r=parseInt(Math.floor((t.getRect().width+t.getRect().x-e)/this.repulsionRange)),o=parseInt(Math.floor((t.getRect().y-i)/this.repulsionRange)),s=parseInt(Math.floor((t.getRect().height+t.getRect().y-i)/this.repulsionRange));for(var a=n;a<=r;a++)for(var h=o;h<=s;h++)this.grid[a][h].push(t),t.setGridCoordinates(n,r,o,s)},h.prototype.updateGrid=function(){var t,e,i=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<i.length;t++)e=i[t],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(t,e,i,n){if(this.totalIterations%r.GRID_CALCULATION_CHECK_PERIOD==1&&i||n){var o,s=new Set;t.surrounding=new Array;for(var a=this.grid,h=t.startX-1;h<t.finishX+2;h++)for(var l=t.startY-1;l<t.finishY+2;l++)if(!(h<0||l<0||h>=a.length||l>=a[0].length))for(var d=0;d<a[h][l].length;d++)if(o=a[h][l][d],t.getOwner()==o.getOwner()&&t!=o&&!e.has(o)&&!s.has(o)){var c=Math.abs(t.getCenterX()-o.getCenterX())-(t.getWidth()/2+o.getWidth()/2),g=Math.abs(t.getCenterY()-o.getCenterY())-(t.getHeight()/2+o.getHeight()/2);c<=this.repulsionRange&&g<=this.repulsionRange&&s.add(o)}t.surrounding=[].concat(function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}(s))}for(h=0;h<t.surrounding.length;h++)this.calcRepulsionForce(t,t.surrounding[h])},h.prototype.calcRepulsionRange=function(){return 0},t.exports=h},function(t,e,i){"use strict";var n=i(1),r=i(4);function o(t,e,i){n.call(this,t,e,i),this.idealLength=r.DEFAULT_EDGE_LENGTH,this.edgeElasticity=r.DEFAULT_SPRING_STRENGTH}for(var s in o.prototype=Object.create(n.prototype),n)o[s]=n[s];t.exports=o},function(t,e,i){"use strict";var n=i(3),r=i(4);function o(t,e,i,o){n.call(this,t,e,i,o),this.nodeRepulsion=r.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var s in o.prototype=Object.create(n.prototype),n)o[s]=n[s];o.prototype.setGridCoordinates=function(t,e,i,n){this.startX=t,this.finishX=e,this.startY=i,this.finishY=n},t.exports=o},function(t,e,i){"use strict";function n(t,e){this.width=0,this.height=0,null!==t&&null!==e&&(this.height=e,this.width=t)}n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(t){this.width=t},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(t){this.height=t},t.exports=n},function(t,e,i){"use strict";var n=i(14);function r(){this.map={},this.keys=[]}r.prototype.put=function(t,e){var i=n.createID(t);this.contains(i)||(this.map[i]=e,this.keys.push(t))},r.prototype.contains=function(t){return n.createID(t),null!=this.map[t]},r.prototype.get=function(t){var e=n.createID(t);return this.map[e]},r.prototype.keySet=function(){return this.keys},t.exports=r},function(t,e,i){"use strict";var n=i(14);function r(){this.set={}}r.prototype.add=function(t){var e=n.createID(t);this.contains(e)||(this.set[e]=t)},r.prototype.remove=function(t){delete this.set[n.createID(t)]},r.prototype.clear=function(){this.set={}},r.prototype.contains=function(t){return this.set[n.createID(t)]==t},r.prototype.isEmpty=function(){return 0===this.size()},r.prototype.size=function(){return Object.keys(this.set).length},r.prototype.addAllTo=function(t){for(var e=Object.keys(this.set),i=e.length,n=0;n<i;n++)t.push(this.set[e[n]])},r.prototype.size=function(){return Object.keys(this.set).length},r.prototype.addAll=function(t){for(var e=t.length,i=0;i<e;i++){var n=t[i];this.add(n)}},t.exports=r},function(t,e,i){"use strict";function n(){}n.multMat=function(t,e){for(var i=[],n=0;n<t.length;n++){i[n]=[];for(var r=0;r<e[0].length;r++){i[n][r]=0;for(var o=0;o<t[0].length;o++)i[n][r]+=t[n][o]*e[o][r]}}return i},n.transpose=function(t){for(var e=[],i=0;i<t[0].length;i++){e[i]=[];for(var n=0;n<t.length;n++)e[i][n]=t[n][i]}return e},n.multCons=function(t,e){for(var i=[],n=0;n<t.length;n++)i[n]=t[n]*e;return i},n.minusOp=function(t,e){for(var i=[],n=0;n<t.length;n++)i[n]=t[n]-e[n];return i},n.dotProduct=function(t,e){for(var i=0,n=0;n<t.length;n++)i+=t[n]*e[n];return i},n.mag=function(t){return Math.sqrt(this.dotProduct(t,t))},n.normalize=function(t){for(var e=[],i=this.mag(t),n=0;n<t.length;n++)e[n]=t[n]/i;return e},n.multGamma=function(t){for(var e=[],i=0,n=0;n<t.length;n++)i+=t[n];i*=-1/t.length;for(var r=0;r<t.length;r++)e[r]=i+t[r];return e},n.multL=function(t,e,i){for(var n=[],r=[],o=[],s=0;s<e[0].length;s++){for(var a=0,h=0;h<e.length;h++)a+=-.5*e[h][s]*t[h];r[s]=a}for(var l=0;l<i.length;l++){for(var d=0,c=0;c<i.length;c++)d+=i[l][c]*r[c];o[l]=d}for(var g=0;g<e.length;g++){for(var u=0,f=0;f<e[0].length;f++)u+=e[g][f]*o[f];n[g]=u}return n},t.exports=n},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(11),o=function(){function t(e,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),null===i&&void 0===i||(this.compareFunction=this._defaultCompareFunction);var n=void 0;n=e instanceof r?e.size():e.length,this._quicksort(e,0,n-1)}return n(t,[{key:"_quicksort",value:function(t,e,i){if(e<i){var n=this._partition(t,e,i);this._quicksort(t,e,n),this._quicksort(t,n+1,i)}}},{key:"_partition",value:function(t,e,i){for(var n=this._get(t,e),r=e,o=i;;){for(;this.compareFunction(n,this._get(t,o));)o--;for(;this.compareFunction(this._get(t,r),n);)r++;if(!(r<o))return o;this._swap(t,r,o),r++,o--}}},{key:"_get",value:function(t,e){return t instanceof r?t.get_object_at(e):t[e]}},{key:"_set",value:function(t,e,i){t instanceof r?t.set_object_at(e,i):t[e]=i}},{key:"_swap",value:function(t,e,i){var n=this._get(t,e);this._set(t,e,this._get(t,i)),this._set(t,i,n)}},{key:"_defaultCompareFunction",value:function(t,e){return e>t}}]),t}();t.exports=o},function(t,e,i){"use strict";function n(){}n.svd=function(t){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=t.length,this.n=t[0].length;var e=Math.min(this.m,this.n);this.s=function(t){for(var e=[];t-- >0;)e.push(0);return e}(Math.min(this.m+1,this.n)),this.U=function t(e){if(0==e.length)return 0;for(var i=[],n=0;n<e[0];n++)i.push(t(e.slice(1)));return i}([this.m,e]),this.V=function(t){return function t(e){if(0==e.length)return 0;for(var i=[],n=0;n<e[0];n++)i.push(t(e.slice(1)));return i}(t)}([this.n,this.n]);for(var i=function(t){for(var e=[];t-- >0;)e.push(0);return e}(this.n),r=function(t){for(var e=[];t-- >0;)e.push(0);return e}(this.m),o=Math.min(this.m-1,this.n),s=Math.max(0,Math.min(this.n-2,this.m)),a=0;a<Math.max(o,s);a++){if(a<o){this.s[a]=0;for(var h=a;h<this.m;h++)this.s[a]=n.hypot(this.s[a],t[h][a]);if(0!==this.s[a]){t[a][a]<0&&(this.s[a]=-this.s[a]);for(var l=a;l<this.m;l++)t[l][a]/=this.s[a];t[a][a]+=1}this.s[a]=-this.s[a]}for(var d=a+1;d<this.n;d++){if(function(t,e){return t&&e}(a<o,0!==this.s[a])){for(var c=0,g=a;g<this.m;g++)c+=t[g][a]*t[g][d];c=-c/t[a][a];for(var u=a;u<this.m;u++)t[u][d]+=c*t[u][a]}i[d]=t[a][d]}if(function(t,e){return e}(0,a<o))for(var f=a;f<this.m;f++)this.U[f][a]=t[f][a];if(a<s){i[a]=0;for(var p=a+1;p<this.n;p++)i[a]=n.hypot(i[a],i[p]);if(0!==i[a]){i[a+1]<0&&(i[a]=-i[a]);for(var m=a+1;m<this.n;m++)i[m]/=i[a];i[a+1]+=1}if(i[a]=-i[a],function(t,e){return t&&e}(a+1<this.m,0!==i[a])){for(var y=a+1;y<this.m;y++)r[y]=0;for(var v=a+1;v<this.n;v++)for(var E=a+1;E<this.m;E++)r[E]+=i[v]*t[E][v];for(var N=a+1;N<this.n;N++)for(var T=-i[N]/i[a+1],A=a+1;A<this.m;A++)t[A][N]+=T*r[A]}for(var w=a+1;w<this.n;w++)this.V[w][a]=i[w]}}var I=Math.min(this.n,this.m+1);o<this.n&&(this.s[o]=t[o][o]),this.m<I&&(this.s[I-1]=0),s+1<I&&(i[s]=t[s][I-1]),i[I-1]=0;for(var C=o;C<e;C++){for(var L=0;L<this.m;L++)this.U[L][C]=0;this.U[C][C]=1}for(var M=o-1;M>=0;M--)if(0!==this.s[M]){for(var _=M+1;_<e;_++){for(var x=0,O=M;O<this.m;O++)x+=this.U[O][M]*this.U[O][_];x=-x/this.U[M][M];for(var D=M;D<this.m;D++)this.U[D][_]+=x*this.U[D][M]}for(var R=M;R<this.m;R++)this.U[R][M]=-this.U[R][M];this.U[M][M]=1+this.U[M][M];for(var b=0;b<M-1;b++)this.U[b][M]=0}else{for(var F=0;F<this.m;F++)this.U[F][M]=0;this.U[M][M]=1}for(var G=this.n-1;G>=0;G--){if(function(t,e){return t&&e}(G<s,0!==i[G]))for(var S=G+1;S<e;S++){for(var P=0,U=G+1;U<this.n;U++)P+=this.V[U][G]*this.V[U][S];P=-P/this.V[G+1][G];for(var Y=G+1;Y<this.n;Y++)this.V[Y][S]+=P*this.V[Y][G]}for(var k=0;k<this.n;k++)this.V[k][G]=0;this.V[G][G]=1}for(var H=I-1,X=Math.pow(2,-52),z=Math.pow(2,-966);I>0;){var B=void 0,V=void 0;for(B=I-2;B>=-1&&-1!==B;B--)if(Math.abs(i[B])<=z+X*(Math.abs(this.s[B])+Math.abs(this.s[B+1]))){i[B]=0;break}if(B===I-2)V=4;else{var W=void 0;for(W=I-1;W>=B&&W!==B;W--){var $=(W!==I?Math.abs(i[W]):0)+(W!==B+1?Math.abs(i[W-1]):0);if(Math.abs(this.s[W])<=z+X*$){this.s[W]=0;break}}W===B?V=3:W===I-1?V=1:(V=2,B=W)}switch(B++,V){case 1:var j=i[I-2];i[I-2]=0;for(var q=I-2;q>=B;q--){var K=n.hypot(this.s[q],j),Z=this.s[q]/K,Q=j/K;this.s[q]=K,q!==B&&(j=-Q*i[q-1],i[q-1]=Z*i[q-1]);for(var J=0;J<this.n;J++)K=Z*this.V[J][q]+Q*this.V[J][I-1],this.V[J][I-1]=-Q*this.V[J][q]+Z*this.V[J][I-1],this.V[J][q]=K}break;case 2:var tt=i[B-1];i[B-1]=0;for(var et=B;et<I;et++){var it=n.hypot(this.s[et],tt),nt=this.s[et]/it,rt=tt/it;this.s[et]=it,tt=-rt*i[et],i[et]=nt*i[et];for(var ot=0;ot<this.m;ot++)it=nt*this.U[ot][et]+rt*this.U[ot][B-1],this.U[ot][B-1]=-rt*this.U[ot][et]+nt*this.U[ot][B-1],this.U[ot][et]=it}break;case 3:var st=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[I-1]),Math.abs(this.s[I-2])),Math.abs(i[I-2])),Math.abs(this.s[B])),Math.abs(i[B])),at=this.s[I-1]/st,ht=this.s[I-2]/st,lt=i[I-2]/st,dt=this.s[B]/st,ct=i[B]/st,gt=((ht+at)*(ht-at)+lt*lt)/2,ut=at*lt*(at*lt),ft=0;(function(t,e){return t||e})(0!==gt,0!==ut)&&(ft=Math.sqrt(gt*gt+ut),gt<0&&(ft=-ft),ft=ut/(gt+ft));for(var pt=(dt+at)*(dt-at)+ft,mt=dt*ct,yt=B;yt<I-1;yt++){var vt=n.hypot(pt,mt),Et=pt/vt,Nt=mt/vt;yt!==B&&(i[yt-1]=vt),pt=Et*this.s[yt]+Nt*i[yt],i[yt]=Et*i[yt]-Nt*this.s[yt],mt=Nt*this.s[yt+1],this.s[yt+1]=Et*this.s[yt+1];for(var Tt=0;Tt<this.n;Tt++)vt=Et*this.V[Tt][yt]+Nt*this.V[Tt][yt+1],this.V[Tt][yt+1]=-Nt*this.V[Tt][yt]+Et*this.V[Tt][yt+1],this.V[Tt][yt]=vt;if(Et=pt/(vt=n.hypot(pt,mt)),Nt=mt/vt,this.s[yt]=vt,pt=Et*i[yt]+Nt*this.s[yt+1],this.s[yt+1]=-Nt*i[yt]+Et*this.s[yt+1],mt=Nt*i[yt+1],i[yt+1]=Et*i[yt+1],yt<this.m-1)for(var At=0;At<this.m;At++)vt=Et*this.U[At][yt]+Nt*this.U[At][yt+1],this.U[At][yt+1]=-Nt*this.U[At][yt]+Et*this.U[At][yt+1],this.U[At][yt]=vt}i[I-2]=pt;break;case 4:if(this.s[B]<=0){this.s[B]=this.s[B]<0?-this.s[B]:0;for(var wt=0;wt<=H;wt++)this.V[wt][B]=-this.V[wt][B]}for(;B<H&&!(this.s[B]>=this.s[B+1]);){var It=this.s[B];if(this.s[B]=this.s[B+1],this.s[B+1]=It,B<this.n-1)for(var Ct=0;Ct<this.n;Ct++)It=this.V[Ct][B+1],this.V[Ct][B+1]=this.V[Ct][B],this.V[Ct][B]=It;if(B<this.m-1)for(var Lt=0;Lt<this.m;Lt++)It=this.U[Lt][B+1],this.U[Lt][B+1]=this.U[Lt][B],this.U[Lt][B]=It;B++}I--}}return{U:this.U,V:this.V,S:this.s}},n.hypot=function(t,e){var i=void 0;return Math.abs(t)>Math.abs(e)?(i=e/t,i=Math.abs(t)*Math.sqrt(1+i*i)):0!=e?(i=t/e,i=Math.abs(e)*Math.sqrt(1+i*i)):i=0,i},t.exports=n},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=function(){function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.sequence1=e,this.sequence2=i,this.match_score=n,this.mismatch_penalty=r,this.gap_penalty=o,this.iMax=e.length+1,this.jMax=i.length+1,this.grid=new Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=new Array(this.jMax);for(var a=0;a<this.jMax;a++)this.grid[s][a]=0}this.tracebackGrid=new Array(this.iMax);for(var h=0;h<this.iMax;h++){this.tracebackGrid[h]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.tracebackGrid[h][l]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return n(t,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var t=1;t<this.jMax;t++)this.grid[0][t]=this.grid[0][t-1]+this.gap_penalty,this.tracebackGrid[0][t]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var i=1;i<this.iMax;i++)for(var n=1;n<this.jMax;n++){var r=[this.sequence1[i-1]===this.sequence2[n-1]?this.grid[i-1][n-1]+this.match_score:this.grid[i-1][n-1]+this.mismatch_penalty,this.grid[i-1][n]+this.gap_penalty,this.grid[i][n-1]+this.gap_penalty],o=this.arrayAllMaxIndexes(r);this.grid[i][n]=r[o[0]],this.tracebackGrid[i][n]=[o.includes(0),o.includes(1),o.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var e=t[0],i=this.tracebackGrid[e.pos[0]][e.pos[1]];i[0]&&t.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),i[1]&&t.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),i[2]&&t.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),0===e.pos[0]&&0===e.pos[1]&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),t.shift()}return this.alignments}},{key:"getAllIndexes",value:function(t,e){for(var i=[],n=-1;-1!==(n=t.indexOf(e,n+1));)i.push(n);return i}},{key:"arrayAllMaxIndexes",value:function(t){return this.getAllIndexes(t,Math.max.apply(null,t))}}]),t}();t.exports=r},function(t,e,i){"use strict";var n=function(){};n.FDLayout=i(18),n.FDLayoutConstants=i(4),n.FDLayoutEdge=i(19),n.FDLayoutNode=i(20),n.DimensionD=i(21),n.HashMap=i(22),n.HashSet=i(23),n.IGeometry=i(8),n.IMath=i(9),n.Integer=i(10),n.Point=i(12),n.PointD=i(5),n.RandomSeed=i(16),n.RectangleD=i(13),n.Transform=i(17),n.UniqueIDGeneretor=i(14),n.Quicksort=i(25),n.LinkedList=i(11),n.LGraphObject=i(2),n.LGraph=i(6),n.LEdge=i(1),n.LGraphManager=i(7),n.LNode=i(3),n.Layout=i(15),n.LayoutConstants=i(0),n.NeedlemanWunsch=i(27),n.Matrix=i(24),n.SVD=i(26),t.exports=n},function(t,e,i){"use strict";function n(){this.listeners=[]}var r=n.prototype;r.addListener=function(t,e){this.listeners.push({event:t,callback:e})},r.removeListener=function(t,e){for(var i=this.listeners.length;i>=0;i--){var n=this.listeners[i];n.event===t&&n.callback===e&&this.listeners.splice(i,1)}},r.emit=function(t,e){for(var i=0;i<this.listeners.length;i++){var n=this.listeners[i];t===n.event&&n.callback(e)}},t.exports=n}])},t.exports=e()},6344(t,e,i){"use strict";i.d(e,{diagram:()=>et});var n=i(77454),r=i(5637),o=i(69793),s=i(43287),a=i(12505),h=i(86535),l=i(31293),d=i(86827),c=i(34376),g=i(90165),u=i(26527),f=i(51444),p={L:"left",R:"right",T:"top",B:"bottom"},m={L:(0,d.K)(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:(0,d.K)(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:(0,d.K)(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:(0,d.K)(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},y={L:(0,d.K)((t,e)=>t-e+2,"L"),R:(0,d.K)((t,e)=>t-2,"R"),T:(0,d.K)((t,e)=>t-e+2,"T"),B:(0,d.K)((t,e)=>t-2,"B")},v=(0,d.K)(function(t){return N(t)?"L"===t?"R":"L":"T"===t?"B":"T"},"getOppositeArchitectureDirection"),E=(0,d.K)(function(t){return"L"===t||"R"===t||"T"===t||"B"===t},"isArchitectureDirection"),N=(0,d.K)(function(t){return"L"===t||"R"===t},"isArchitectureDirectionX"),T=(0,d.K)(function(t){return"T"===t||"B"===t},"isArchitectureDirectionY"),A=(0,d.K)(function(t,e){const i=N(t)&&T(e),n=T(t)&&N(e);return i||n},"isArchitectureDirectionXY"),w=(0,d.K)(function(t){const e=t[0],i=t[1],n=N(e)&&T(i),r=T(e)&&N(i);return n||r},"isArchitecturePairXY"),I=(0,d.K)(function(t){return"LL"!==t&&"RR"!==t&&"TT"!==t&&"BB"!==t},"isValidArchitectureDirectionPair"),C=(0,d.K)(function(t,e){const i=`${t}${e}`;return I(i)?i:void 0},"getArchitectureDirectionPair"),L=(0,d.K)(function([t,e],i){const n=i[0],r=i[1];return N(n)?T(r)?[t+("L"===n?-1:1),e+("T"===r?1:-1)]:[t+("L"===n?-1:1),e]:N(r)?[t+("L"===r?1:-1),e+("T"===n?1:-1)]:[t,e+("T"===n?1:-1)]},"shiftPositionByArchitectureDirectionPair"),M=(0,d.K)(function(t){return"LT"===t||"TL"===t?[1,1]:"BL"===t||"LB"===t?[1,-1]:"BR"===t||"RB"===t?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),_=(0,d.K)(function(t,e){return A(t,e)?"bend":N(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),x=(0,d.K)(function(t){return"service"===t.type},"isArchitectureService"),O=(0,d.K)(function(t){return"junction"===t.type},"isArchitectureJunction"),D=(0,d.K)((t,e)=>{const[i,n]=[t,e].sort();return`${JSON.stringify(i)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),R=(0,d.K)(t=>t.data(),"edgeData"),b=(0,d.K)(t=>t.data(),"nodeData"),F=h.UI.architecture,G=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=h.SV,this.getAccTitle=h.iN,this.setDiagramTitle=h.ke,this.getDiagramTitle=h.ab,this.getAccDescription=h.m7,this.setAccDescription=h.EI,this.clear()}static{(0,d.K)(this,"ArchitectureDB")}setDiagramId(t){this.diagramId=t}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",(0,h.IU)()}addService({id:t,icon:e,in:i,title:n,iconText:r}){if(this.registeredIds.has(t))throw new Error(`The service id [${t}] is already in use by another ${this.registeredIds.get(t)}`);if(void 0!==i){if(t===i)throw new Error(`The service [${t}] cannot be placed within itself`);if(!this.registeredIds.has(i))throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===this.registeredIds.get(i))throw new Error(`The service [${t}]'s parent is not a group`)}this.registeredIds.set(t,"node"),this.nodes.set(t,{id:t,type:"service",icon:e,iconText:r,title:n,edges:[],in:i})}getServices(){return[...this.nodes.values()].filter(x)}addJunction({id:t,in:e}){if(this.registeredIds.has(t))throw new Error(`The junction id [${t}] is already in use by another ${this.registeredIds.get(t)}`);if(void 0!==e){if(t===e)throw new Error(`The junction [${t}] cannot be placed within itself`);if(!this.registeredIds.has(e))throw new Error(`The junction [${t}]'s parent does not exist. Please make sure the parent is created before this junction`);if("node"===this.registeredIds.get(e))throw new Error(`The junction [${t}]'s parent is not a group`)}this.registeredIds.set(t,"node"),this.nodes.set(t,{id:t,type:"junction",edges:[],in:e})}getJunctions(){return[...this.nodes.values()].filter(O)}getNodes(){return[...this.nodes.values()]}getNode(t){return this.nodes.get(t)??null}addGroup({id:t,icon:e,in:i,title:n}){if(this.registeredIds.has(t))throw new Error(`The group id [${t}] is already in use by another ${this.registeredIds.get(t)}`);if(void 0!==i){if(t===i)throw new Error(`The group [${t}] cannot be placed within itself`);if(!this.registeredIds.has(i))throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===this.registeredIds.get(i))throw new Error(`The group [${t}]'s parent is not a group`)}this.registeredIds.set(t,"group"),this.groups.set(t,{id:t,icon:e,title:n,in:i})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:t,rhsId:e,lhsDir:i,rhsDir:n,lhsInto:r,rhsInto:o,lhsGroup:s,rhsGroup:a,title:h}){if(!E(i))throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${String(i)}`);if(!E(n))throw new Error(`Invalid direction given for right hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${String(n)}`);if(!this.nodes.has(t)&&!this.groups.has(t))throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(e)&&!this.groups.has(e))throw new Error(`The right-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);const l=this.nodes.get(t).in,d=this.nodes.get(e).in;if(s&&l&&d&&l==d)throw new Error(`The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&l&&d&&l==d)throw new Error(`The right-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const c={lhsId:t,lhsDir:i,lhsInto:r,lhsGroup:s,rhsId:e,rhsDir:n,rhsInto:o,rhsGroup:a,title:h};this.edges.push(c);const g=this.nodes.get(t),u=this.nodes.get(e);g&&u&&(g.edges.push(this.edges[this.edges.length-1]),u.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(t){if(t.members.length<2)throw new Error(`An align directive requires at least two members; got ${t.members.length}`);const e=new Set;t.members.forEach(i=>{if("node"!==this.registeredIds.get(i))throw new Error(`align ${t.direction} references [${i}], which is not a service or junction`);if(e.has(i))throw new Error(`align ${t.direction} lists [${i}] more than once`);e.add(i)}),this.layoutHints.push(t)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(void 0===this.dataStructures){const t=new Map,e=new Map;for(const[i,n]of this.nodes.entries()){const r=new Map;for(const e of n.edges){const n=this.getNode(e.lhsId)?.in,o=this.getNode(e.rhsId)?.in;if(n&&o&&n!==o){const i=_(e.lhsDir,e.rhsDir);"bend"!==i&&t.set(D(n,o),i)}if(e.lhsId===i){const t=C(e.lhsDir,e.rhsDir);t&&r.set(t,e.rhsId)}else{const t=C(e.rhsDir,e.lhsDir);t&&r.set(t,e.lhsId)}}e.set(i,r)}const i=new Set,n=new Set(e.keys()),r=(0,d.K)(t=>{const r=new Map([[t,[0,0]]]),o=[t];for(;o.length>0;){const t=o.shift();if(t){i.add(t),n.delete(t);const s=e.get(t);if(!s)throw new Error(`BFS error: adjacency list for id ${t} not found. Please report this as a bug.`);const a=r.get(t);if(!a)throw new Error(`BFS error: position for id ${t} not found in spatial map. Please report this as a bug.`);const[h,l]=a;s.forEach((t,e)=>{i.has(t)||(r.set(t,L([h,l],e)),o.push(t))})}}return r},"BFS"),o=[];for(;n.size>0;){const t=n.values().next().value;o.push(r(t))}this.dataStructures={adjList:e,spatialMaps:o,groupAlignments:t}}return this.dataStructures}setElementForId(t,e){this.elements.set(t,e)}getElementById(t){return this.elements.get(t)}getConfig(){return(0,a.$t)({...F,...(0,h.zj)().architecture})}getConfigField(t){return this.getConfig()[t]}},S=(0,d.K)((t,e)=>{(0,n.S)(t,e),t.groups.map(t=>e.addGroup(t)),t.services.map(t=>e.addService({...t,type:"service"})),t.junctions.map(t=>e.addJunction({...t,type:"junction"})),t.edges.map(t=>e.addEdge(t)),t.alignments?.map(t=>e.addLayoutHint({direction:t.direction,members:[...t.members]}))},"populateDb"),P={parser:{yy:void 0},parse:(0,d.K)(async t=>{const e=await(0,c.qg)("architecture",t);l.R.debug(e);const i=P.parser?.yy;if(!(i instanceof G))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");S(e,i)},"parse")},U=(0,d.K)(t=>`\n .edge {\n stroke-width: ${t.archEdgeWidth};\n stroke: ${t.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${t.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${t.archGroupBorderColor};\n stroke-width: ${t.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`,"getStyles");function Y(t,e){if(0===t)return e();const i=Math.random;let n=t>>>0;Math.random=function(){n=n+1831565813>>>0;let t=n;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296};try{return e()}finally{Math.random=i}}(0,d.K)(Y,"withSeededRandom");var k=(0,d.K)(t=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${t}</g>`,"wrapIcon"),H={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:k('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:k('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:k('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:k('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:k('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:s.Gc,blank:{body:k("")}}},X=(0,d.K)(async function(t,e,i,n){const r=i.getConfigField("padding"),s=i.getConfigField("iconSize"),l=s/2,d=s/6,c=d/2;await Promise.all(e.edges().map(async e=>{const{source:s,sourceDir:g,sourceArrow:u,sourceGroup:f,target:p,targetDir:v,targetArrow:E,targetGroup:I,label:L}=R(e);let{x:_,y:x}=e[0].sourceEndpoint();const{x:O,y:D}=e[0].midpoint();let{x:b,y:F}=e[0].targetEndpoint();const G=r+4;if(f&&(N(g)?_+="L"===g?-G:G:x+="T"===g?-G:G+18),I&&(N(v)?b+="L"===v?-G:G:F+="T"===v?-G:G+18),f||"junction"!==i.getNode(s)?.type||(N(g)?_+="L"===g?l:-l:x+="T"===g?l:-l),I||"junction"!==i.getNode(p)?.type||(N(v)?b+="L"===v?l:-l:F+="T"===v?l:-l),e[0]._private.rscratch){const e=t.insert("g");if(e.insert("path").attr("d",`M ${_},${x} L ${O},${D} L${b},${F} `).attr("class","edge").attr("id",`${n}-${(0,a.rY)(s,p,{prefix:"L"})}`),u){const t=N(g)?y[g](_,d):_-c,i=T(g)?y[g](x,d):x-c;e.insert("polygon").attr("points",m[g](d)).attr("transform",`translate(${t},${i})`).attr("class","arrow")}if(E){const t=N(v)?y[v](b,d):b-c,i=T(v)?y[v](F,d):F-c;e.insert("polygon").attr("points",m[v](d)).attr("transform",`translate(${t},${i})`).attr("class","arrow")}if(L){const t=A(g,v)?"XY":N(g)?"X":"Y";let i=0;i="X"===t?Math.abs(_-b):"Y"===t?Math.abs(x-F)/1.5:Math.abs(_-b)/2;const n=e.append("g");if(await(0,o.GZ)(n,L,{useHtmlLabels:!1,width:i,classes:"architecture-service-label"},(0,h.D7)()),n.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===t)n.attr("transform","translate("+O+", "+D+")");else if("Y"===t)n.attr("transform","translate("+O+", "+D+") rotate(-90)");else if("XY"===t){const t=C(g,v);if(t&&w(t)){const e=n.node().getBoundingClientRect(),[i,r]=M(t);n.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*i*r*45})`);const o=n.node().getBoundingClientRect();n.attr("transform",`\n translate(${O}, ${D-e.height/2})\n translate(${i*o.width/2}, ${r*o.height/2})\n rotate(${-1*i*r*45}, 0, ${e.height/2})\n `)}}}}}))},"drawEdges"),z=(0,d.K)(async function(t,e,i,n){const r=.75*i.getConfigField("padding"),a=i.getConfigField("fontSize"),l=i.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async e=>{const d=b(e);if("group"===d.type){const{h:c,w:g,x1:u,y1:f}=e.boundingBox(),p=t.append("rect");p.attr("id",`${n}-group-${d.id}`).attr("x",u+l).attr("y",f+l).attr("width",g).attr("height",c).attr("class","node-bkg");const m=t.append("g");let y=u,v=f;if(d.icon){const t=m.append("g");t.html(`<g>${await(0,s.WY)(d.icon,{height:r,width:r,fallbackPrefix:H.prefix})}</g>`),t.attr("transform","translate("+(y+l+1)+", "+(v+l+1)+")"),y+=r,v+=a/2-1-2}if(d.label){const t=m.append("g");await(0,o.GZ)(t,d.label,{useHtmlLabels:!1,width:g,classes:"architecture-service-label"},(0,h.D7)()),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),t.attr("transform","translate("+(y+l+4)+", "+(v+l+2)+")")}i.setElementForId(d.id,p)}}))},"drawGroups"),B=(0,d.K)(async function(t,e,i,n){const r=(0,h.D7)();for(const a of i){const i=e.append("g"),l=t.getConfigField("iconSize");if(a.title){const t=i.append("g");await(0,o.GZ)(t,a.title,{useHtmlLabels:!1,width:1.5*l,classes:"architecture-service-label"},r),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),t.attr("transform","translate("+l/2+", "+l+")")}const d=i.append("g");if(a.icon)d.html(`<g>${await(0,s.WY)(a.icon,{height:l,width:l,fallbackPrefix:H.prefix})}</g>`);else if(a.iconText){d.html(`<g>${await(0,s.WY)("blank",{height:l,width:l,fallbackPrefix:H.prefix})}</g>`);const t=d.append("g").append("foreignObject").attr("width",l).attr("height",l).append("div").attr("class","node-icon-text").attr("style",`height: ${l}px;`).append("div").html((0,h.jZ)(a.iconText,r)),e=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((l-2)/e)};`)}else d.append("path").attr("class","node-bkg").attr("id",`${n}-node-${a.id}`).attr("d",`M0,${l} V5 Q0,0 5,0 H${l-5} Q${l},0 ${l},5 V${l} Z`);i.attr("id",`${n}-service-${a.id}`).attr("class","architecture-service");const{width:c,height:g}=i.node().getBBox();a.width=c,a.height=g,t.setElementForId(a.id,i)}return 0},"drawServices"),V=(0,d.K)(function(t,e,i,n){i.forEach(i=>{const r=e.append("g"),o=t.getConfigField("iconSize");r.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",o).attr("height",o),r.attr("class","architecture-junction");const{width:s,height:a}=r._groups[0][0].getBBox();r.width=s,r.height=a,t.setElementForId(i.id,r)})},"drawJunctions");function W(t,e,i){t.forEach(t=>{e.add({group:"nodes",data:{type:"service",id:t.id,icon:t.icon,label:t.title,parent:t.in,width:i.getConfigField("iconSize"),height:i.getConfigField("iconSize")},classes:"node-service"})})}function $(t,e,i){t.forEach(t=>{e.add({group:"nodes",data:{type:"junction",id:t.id,parent:t.in,width:i.getConfigField("iconSize"),height:i.getConfigField("iconSize")},classes:"node-junction"})})}function j(t,e){e.nodes().map(e=>{const i=b(e);if("group"===i.type)return;i.x=e.position().x,i.y=e.position().y;t.getElementById(i.id).attr("transform","translate("+(i.x||0)+","+(i.y||0)+")")})}function q(t,e){t.forEach(t=>{e.add({group:"nodes",data:{type:"group",id:t.id,icon:t.icon,label:t.title,parent:t.in},classes:"node-group"})})}function K(t,e){t.forEach(t=>{const{lhsId:i,rhsId:n,lhsInto:r,lhsGroup:o,rhsInto:s,lhsDir:a,rhsDir:h,rhsGroup:l,title:d}=t,c=A(t.lhsDir,t.rhsDir)?"segments":"straight",g={id:`${i}-${n}`,label:d,source:i,sourceDir:a,sourceArrow:r,sourceGroup:o,sourceEndpoint:"L"===a?"0 50%":"R"===a?"100% 50%":"T"===a?"50% 0":"50% 100%",target:n,targetDir:h,targetArrow:s,targetGroup:l,targetEndpoint:"L"===h?"0 50%":"R"===h?"100% 50%":"T"===h?"50% 0":"50% 100%"};e.add({group:"edges",data:g,classes:c})})}function Z(t,e,i,n=[]){const r=(0,d.K)((t,e)=>{const n=new Map;for(const[r,o]of t.entries()){const t=`${r}`;let s=0;const a=[...o.entries()];if(1!==a.length)for(let r=0;r<a.length-1;r++)for(let o=r+1;o<a.length;o++){const[h,l]=a[r],[d,c]=a[o];if(i.get(D(h,d))===e)n.set(t,[...n.get(t)??[],...l,...c]);else if("default"===h||"default"===d)n.set(t,[...n.get(t)??[],...l,...c]);else{const e=`${t}-${s++}`;n.set(e,l);const i=`${t}-${s++}`;n.set(i,c)}}else n.set(t,a[0][1])}return n},"flattenAlignments"),o=e.map(e=>{const i=new Map,n=new Map;return e.forEach(([e,r],o)=>{const s=t.getNode(o)?.in??"default",a=i.get(r)??new Map;i.has(r)||i.set(r,a);const h=n.get(e)??new Map;n.has(e)||n.set(e,h);for(const t of[a,h]){const e=t.get(s)??[];t.has(s)||t.set(s,e),e.push(o)}}),{horiz:[...r(i,"horizontal").values()].filter(t=>t.length>1),vert:[...r(n,"vertical").values()].filter(t=>t.length>1)}}),[s,a]=o.reduce(([t,e],{horiz:i,vert:n})=>[[...t,...i],[...e,...n]],[[],[]]),h=new Set;n.forEach(t=>t.members.forEach(t=>h.add(t)));const l=(0,d.K)(t=>t.filter(t=>!t.some(t=>h.has(t))),"dropOverlapping"),c=l(s),g=l(a);return n.forEach(t=>{t.members.length<2||("row"===t.direction?c.push([...t.members]):g.push([...t.members]))}),{horizontal:c,vertical:g}}function Q(t,e,i=[]){const n=[],r=e.getConfigField("iconSize"),o=e.getConfigField("idealEdgeLengthMultiplier"),s=o*r,a=new Set;i.forEach(t=>{for(let e=0;e<t.members.length-1;e++){const i=t.members[e],r=t.members[e+1];a.add(`${i}|${r}`),a.add(`${r}|${i}`),"row"===t.direction?n.push({left:i,right:r,gap:s}):n.push({top:i,bottom:r,gap:s})}});const h=(0,d.K)(t=>`${t[0]},${t[1]}`,"posToStr"),l=(0,d.K)(t=>t.split(",").map(t=>parseInt(t)),"strToPos");return t.forEach(t=>{const e=new Map([...t.entries()].map(([t,e])=>[h(e),t])),i=[h([0,0])],s={},d={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;i.length>0;){const t=i.shift();if(t){s[t]=1;const c=e.get(t);if(c){const g=l(t);Object.entries(d).forEach(([t,l])=>{const d=h([g[0]+l[0],g[1]+l[1]]),u=e.get(d);if(u&&!s[d]){if(i.push(d),a.has(`${c}|${u}`))return;n.push({[p[t]]:u,[p[v(t)]]:c,gap:o*r})}})}}}}),n}function J(t,e,i,n,r,{spatialMaps:o,groupAlignments:s}){return new Promise(a=>{const h=(0,f.Ltv)("body").append("div").attr("id","cy").attr("style","display:none"),c=(0,g.A)({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${r.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${r.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});h.remove(),q(i,c),W(t,c,r),$(e,c,r),K(n,c);const u=r.getLayoutHints(),p=Z(r,o,s,u),m=Q(o,r,u),y=r.getConfigField("iconSize"),v=r.getConfigField("idealEdgeLengthMultiplier")*y,E=.5*y,N=r.getConfigField("edgeElasticity"),A=r.getConfigField("seed"),w=c.layout({name:"fcose",quality:"proof",randomize:r.getConfigField("randomize"),nodeSeparation:r.getConfigField("nodeSeparation"),numIter:r.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[e,i]=t.connectedNodes(),{parent:n}=b(e),{parent:r}=b(i);return n===r?v:E},edgeElasticity(t){const[e,i]=t.connectedNodes(),{parent:n}=b(e),{parent:r}=b(i);return n===r?N:.001},alignmentConstraint:p,relativePlacementConstraint:m});w.one("layoutstop",()=>{function t(t,e,i,n){let r,o;const{x:s,y:a}=t,{x:h,y:l}=e;o=(n-a+(s-i)*(a-l)/(s-h))/Math.sqrt(1+Math.pow((a-l)/(s-h),2)),r=Math.sqrt(Math.pow(n-a,2)+Math.pow(i-s,2)-Math.pow(o,2));r/=Math.sqrt(Math.pow(h-s,2)+Math.pow(l-a,2));let d=(h-s)*(n-a)-(l-a)*(i-s);switch(!0){case d>=0:d=1;break;case d<0:d=-1}let c=(h-s)*(i-s)+(l-a)*(n-a);switch(!0){case c>=0:c=1;break;case c<0:c=-1}return o=Math.abs(o)*d,r*=c,{distances:o,weights:r}}(0,d.K)(t,"getSegmentWeights"),c.startBatch();for(const e of Object.values(c.edges()))if(e.data?.()){const{x:i,y:n}=e.source().position(),{x:r,y:o}=e.target().position();if(i!==r&&n!==o){const i=e.sourceEndpoint(),n=e.targetEndpoint(),{sourceDir:r}=R(e),[o,s]=T(r)?[i.x,n.y]:[n.x,i.y],{weights:a,distances:h}=t(i,n,o,s);e.style("segment-distances",h),e.style("segment-weights",a)}}c.endBatch(),Y(A,()=>w.run())});try{Y(A,()=>w.run())}catch(t){if(t instanceof RangeError&&t.message.includes("Invalid array length"))throw new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.");throw t}c.ready(t=>{l.R.info("Ready",t),a(c)})})}(0,s.pC)([{name:H.prefix,icons:H}]),g.A.use(u),(0,d.K)(W,"addServices"),(0,d.K)($,"addJunctions"),(0,d.K)(j,"positionNodes"),(0,d.K)(q,"addGroups"),(0,d.K)(K,"addEdges"),(0,d.K)(Z,"getAlignments"),(0,d.K)(Q,"getRelativeConstraints"),(0,d.K)(J,"layoutArchitecture");var tt={draw:(0,d.K)(async(t,e,i,n)=>{const o=n.db;o.setDiagramId(e);const s=o.getServices(),a=o.getJunctions(),l=o.getGroups(),d=o.getEdges(),c=o.getDataStructures(),g=(0,r.D)(e),u=g.append("g");u.attr("class","architecture-edges");const f=g.append("g");f.attr("class","architecture-services");const p=g.append("g");p.attr("class","architecture-groups"),await B(o,f,s,e),V(o,f,a,e);const m=await J(s,a,l,d,o,c);await X(u,m,o,e),await z(p,m,o,e),j(o,m),(0,h.ot)(void 0,g,o.getConfigField("padding"),o.getConfigField("useMaxWidth"))},"draw")},et={parser:P,get db(){return new G},renderer:tt,styles:U}},77454(t,e,i){"use strict";function n(t,e){t.accDescr&&e.setAccDescription?.(t.accDescr),t.accTitle&&e.setAccTitle?.(t.accTitle),t.title&&e.setDiagramTitle?.(t.title)}i.d(e,{S:()=>n}),(0,i(86827).K)(n,"populateCommonDb")}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6492],{11356(t,e){e.k=void 0;e.k=function(t,e){void 0===e&&(e={listUnicodeChar:""}),(e=e||{}).listUnicodeChar=!!e.hasOwnProperty("listUnicodeChar")&&e.listUnicodeChar,e.stripListLeaders=!e.hasOwnProperty("stripListLeaders")||e.stripListLeaders,e.gfm=!e.hasOwnProperty("gfm")||e.gfm,e.useImgAltText=!e.hasOwnProperty("useImgAltText")||e.useImgAltText,e.preserveLinks=!!e.hasOwnProperty("preserveLinks")&&e.preserveLinks;var r=t||"";r=r.replace(/^(-\s*?|\*\s*?|_\s*?){3,}\s*$/gm,"");try{e.stripListLeaders&&(r=e.listUnicodeChar?r.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,e.listUnicodeChar+" $1"):r.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,"$1")),e.gfm&&(r=r.replace(/\n={2,}/g,"\n").replace(/~{3}.*\n/g,"").replace(/~~/g,"").replace(/`{3}.*\n/g,"")),e.preserveLinks&&(r=r.replace(/\[(.*?)\][\[\(](.*?)[\]\)]/g,"$1 ($2)")),r=r.replace(/<[^>]*>/g,"").replace(/^[=\-]{2,}\s*$/g,"").replace(/\[\^.+?\](\: .*?$)?/g,"").replace(/\s{0,2}\[.*?\]: .*?$/g,"").replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g,e.useImgAltText?"$1":"").replace(/\[(.*?)\][\[\(].*?[\]\)]/g,"$1").replace(/^\s{0,3}>\s?/g,"").replace(/(^|\n)\s{0,3}>\s?/g,"\n\n").replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g,"").replace(/^(\n)?\s{0,}#{1,6}\s+| {0,}(\n)?\s{0,}#{0,} {0,}(\n)?\s{0,}$/gm,"$1$2$3").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/(`{3,})(.*?)\1/gm,"$2").replace(/`(.+?)`/g,"$1").replace(/\n{2,}/g,"\n\n")}catch(e){return console.error(e),t}return r}},6492(t,e,r){r.r(e),r.d(e,{parseMermaidToExcalidraw:()=>Ie});const o={rect:"rectangle",circle:"ellipse"},n={startOnLoad:!1,flowchart:{curve:"linear"},themeVariables:{fontSize:"20px"},maxEdges:500,maxTextSize:5e4};class s{constructor({converter:t}){this.convert=(t,e)=>this.converter(t,{...e,fontSize:e.fontSize||20}),this.converter=t}}var i,a,l;!function(t){t.ROUND="round",t.STADIUM="stadium",t.DOUBLECIRCLE="doublecircle",t.CIRCLE="circle",t.DIAMOND="diamond",t.CYLINDER="cylinder"}(i||(i={})),function(t){t.COLOR="color"}(a||(a={})),function(t){t.FILL="fill",t.STROKE="stroke",t.STROKE_WIDTH="stroke-width",t.STROKE_DASHARRAY="stroke-dasharray"}(l||(l={}));var c=r(11356);const d={arrow_circle:{endArrowhead:"circle"},arrow_cross:{endArrowhead:"bar"},arrow_open:{endArrowhead:null,startArrowhead:null},double_arrow_circle:{endArrowhead:"circle",startArrowhead:"circle"},double_arrow_cross:{endArrowhead:"bar",startArrowhead:"bar"},double_arrow_point:{endArrowhead:"arrow",startArrowhead:"arrow"}},u=t=>{let e=t.text;return"markdown"===t.labelType&&(e=(0,c.k)(t.text)),h(e)},h=t=>t.replace(/\s?(fa|fab):[a-zA-Z0-9-]+/g,""),p=t=>{const e={};return Object.keys(t).forEach(r=>{switch(r){case l.FILL:e.backgroundColor=t[r],e.fillStyle="solid";break;case l.STROKE:e.strokeColor=t[r];break;case l.STROKE_WIDTH:e.strokeWidth=Number(t[r]?.split("px")[0]);break;case l.STROKE_DASHARRAY:e.strokeStyle="dashed"}}),e},g=t=>{const e={};return Object.keys(t).forEach(r=>{if(r===a.COLOR)e.strokeColor=t[r]}),e},y=(t,e)=>Math.max(20,Math.ceil(t.length*e*.62)),f=new s({converter:(t,e)=>{const r=[],o=e.fontSize,{getGroupIds:n,getParentId:s}=(t=>{const e={};t.subGraphs.map(r=>{r.nodeIds.forEach(o=>{e[r.id]={id:r.id,parent:null,isLeaf:!1},e[o]={id:o,parent:r.id,isLeaf:void 0!==t.vertices[o]}})});const r={};return[...Object.keys(t.vertices),...t.subGraphs.map(t=>t.id)].forEach(t=>{if(!e[t])return;let o=e[t];const n=[];for(o.isLeaf||n.push(`subgraph_group_${o.id}`);o.parent;)n.push(`subgraph_group_${o.parent}`),o=e[o.parent];r[t]=n}),{getGroupIds:t=>r[t]||[],getParentId:t=>e[t]?e[t].parent:null}})(t);return t.subGraphs.reverse().forEach(t=>{const e=n(t.id),s=u(t),i=y(s,o||16)+64,a=Math.max(t.width,i),l=t.x-(a-t.width)/2,c=p(t.containerStyle),d=g(t.labelStyle),h={id:t.id,type:"rectangle",groupIds:e,x:l,y:t.y,width:a,height:t.height,label:{groupIds:e,text:s,fontSize:o,verticalAlign:"top",...d},...c};r.push(h)}),Object.values(t.vertices).forEach(t=>{if(!t)return;const e=n(t.id),s=u(t),a=((t,e,r,o)=>{const n=o||20;if(t!==i.CYLINDER||!e||e.includes("\n"))return n;const s=Math.max(20,r-12);return y(e,n)<=s?n:Math.max(12,Math.floor(s/(.62*e.length)))})(t.type,s,t.width,o),l=p(t.containerStyle),c=g(t.labelStyle);let d={id:t.id,type:"rectangle",groupIds:e,x:t.x,y:t.y,width:t.width,height:t.height,strokeWidth:2,label:{groupIds:e,text:s,fontSize:a,...c},link:t.link||null,...l};switch(t.type){case i.STADIUM:case i.ROUND:d={...d,roundness:{type:3}};break;case i.DOUBLECIRCLE:{const o=5;e.push(`doublecircle_${t.id}}`);const n={type:"ellipse",groupIds:e,x:t.x+o,y:t.y+o,width:t.width-2*o,height:t.height-2*o,strokeWidth:2,roundness:{type:3},label:{groupIds:e,text:s,fontSize:a,...c}};d={...d,groupIds:e,type:"ellipse"},r.push(n);break}case i.CIRCLE:d.type="ellipse";break;case i.DIAMOND:d.type="diamond"}r.push(d)}),t.edges.forEach(t=>{let e=[];const i=s(t.start),a=s(t.end);i&&i===a&&(e=n(i));const{startX:l,startY:c,reflectionPoints:h}=t,p=h.map(t=>{return e=t.x-h[0].x,r=t.y-h[0].y,[e,r];var e,r}),g=(y=t.type||"arrow_point",d[y]);var y;const f=r.find(e=>e.id===t.start),b=r.find(e=>e.id===t.end);if(!f||!b)return;const m={id:`${t.start}_${t.end}`,type:"arrow",groupIds:e,x:l,y:c,strokeWidth:"thick"===t.stroke?4:2,strokeStyle:"dotted"===t.stroke?"dashed":void 0,points:p,...t.text?{label:{text:u(t),fontSize:o,groupIds:e}}:{},roundness:{type:2},...g,start:{id:f.id||""},end:{id:b.id||""}};r.push(m)}),{elements:r}}});let b=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e>62?"-":"_","");const m=new s({converter:t=>{const e=b(),{width:r,height:o}=t,n={type:"image",x:0,y:0,width:r,height:o,status:"saved",fileId:e};return{files:{[e]:{id:e,mimeType:t.mimeType,dataURL:t.dataURL}},elements:[n]}}}),x=(t,e)=>[t,e],w=t=>t.replace(/\\n/g,"\n"),S=t=>{const e={type:"line",x:t.startX,y:t.startY,points:[x(0,0),x(t.endX-t.startX,t.endY-t.startY)],width:t.endX-t.startX,height:t.endY-t.startY,strokeStyle:t.strokeStyle||"solid",strokeColor:t.strokeColor||"#000",strokeWidth:t.strokeWidth||1};return t.groupId&&Object.assign(e,{groupIds:[t.groupId]}),t.id&&Object.assign(e,{id:t.id}),e},A=t=>{const e={type:"text",x:t.x,y:t.y,width:t.width,height:t.height,text:w(t.text)||"",fontSize:t.fontSize,verticalAlign:"top",strokeColor:t.color};return t.groupId&&Object.assign(e,{groupIds:[t.groupId]}),t.id&&Object.assign(e,{id:t.id}),e},k=t=>{const e={text:w(t?.label?.text||""),fontSize:t?.label?.fontSize,textAlign:t.label?.textAlign,verticalAlign:t.label?.verticalAlign||"middle",strokeColor:t.label?.color||"#000",...t.groupId?{groupIds:[t.groupId]}:{}};let r={};"rectangle"===t.type&&"activation"===t.subtype&&(r={backgroundColor:"#e9ecef",fillStyle:"solid"});const o={id:t.id,type:t.type,x:t.x,y:t.y,width:t.width,height:t.height,label:e,strokeStyle:t?.strokeStyle,strokeWidth:t?.strokeWidth,strokeColor:t?.strokeColor,backgroundColor:t?.bgColor,fillStyle:"solid",...r};return t.groupId&&Object.assign(o,{groupIds:[t.groupId]}),o},E=t=>{const e={type:"arrow",x:t.startX,y:t.startY,points:t.points?.map(([t,e])=>x(t,e))||[x(0,0),x(t.endX-t.startX,t.endY-t.startY)],width:t.endX-t.startX,height:t.endY-t.startY,strokeStyle:t?.strokeStyle||"solid",endArrowhead:t?.endArrowhead||null,startArrowhead:t?.startArrowhead||null,label:{text:w(t?.label?.text||""),fontSize:16,textAlign:t?.label?.textAlign,verticalAlign:t?.label?.verticalAlign},roundness:{type:2},start:t.start,end:t.end};return t.groupId&&Object.assign(e,{groupIds:[t.groupId]}),e},v=t=>{if(!t)return!0;const e=t.trim().toLowerCase();return"transparent"===e||"none"===e||"rgba(0,0,0,0)"===e||"rgba(0, 0, 0, 0)"===e},C=(t,e,r=!0)=>{const o=t,n=o.groupIds??[];if(n.includes(e)||(o.groupIds=[...n,e]),!r||!o.label)return;const s=o.label.groupIds??[];s.includes(e)||(o.label.groupIds=[...s,e])},I=new s({converter:t=>{const e=[],r=[];if(Object.values(t.nodes).forEach(t=>{t&&t.length&&t.forEach(t=>{let o;switch(t.type){case"line":o=S(t);break;case"rectangle":case"ellipse":o=k(t);break;case"text":o=A(t);break;default:throw`unknown type ${t.type}`}"rectangle"===t.type&&"activation"===t?.subtype?r.push(o):e.push(o)})}),Object.values(t.lines).forEach(t=>{t&&e.push(S(t))}),Object.values(t.arrows).forEach(t=>{t&&(e.push(E(t)),t.sequenceNumber&&e.push(k(t.sequenceNumber)))}),e.push(...r),t.loops){const{lines:r,texts:o,nodes:n}=t.loops;r.forEach(t=>{e.push(S(t))}),o.forEach(t=>{e.push(A(t))}),n.forEach(t=>{e.push(k(t))})}return t.groups&&t.groups.forEach(t=>{const{actorKeys:r,name:o}=t;let n=1/0,s=1/0,i=0,a=0;if(!r.length)return;const l=e.filter(t=>{if(t.id){const e=t.id.indexOf("-"),o=t.id.substring(0,e);return r.includes(o)}return!1});if(!l.length)return;if(l.forEach(t=>{void 0!==t.x&&void 0!==t.y&&void 0!==t.width&&void 0!==t.height&&(n=Math.min(n,t.x),s=Math.min(s,t.y),i=Math.max(i,t.x+t.width),a=Math.max(a,t.y+t.height))}),!(Number.isFinite(n)&&Number.isFinite(s)&&Number.isFinite(i)&&Number.isFinite(a)))return;const c=n-10,d=s-10,u=i-n+20,h=a-s+20,p=b(),g=b(),y=k({type:"rectangle",x:c,y:d,width:u,height:h,bgColor:v(t.fill)?void 0:t.fill,strokeColor:"#1f1f1f",strokeWidth:1,id:p,groupId:g});if(e.unshift(y),e.forEach(t=>{t.id!==p&&void 0!==t.x&&void 0!==t.y&&void 0!==t.width&&void 0!==t.height&&t.x>=n&&t.x+t.width<=i&&t.y>=s&&t.y+t.height<=a&&C(t,g)}),o){const t=A({type:"text",id:b(),text:o,x:c+4,y:d-24,width:(f=o,m=16,Math.max(20,Math.round(f.length*m*.6))),height:24,fontSize:16,color:"#1f1f1f",groupId:g});C(t,g,!1),e.push(t)}var f,m}),{elements:e}}}),O=new s({converter:t=>{const e=[];return t.nodes.forEach(t=>{t&&t.length&&t.forEach(t=>{let r;switch(t.type){case"line":r=S(t);break;case"rectangle":case"ellipse":r=k(t);break;case"text":r=A(t);break;default:throw`unknown type ${t.type}`}e.push(r)})}),Object.values(t.lines).forEach(t=>{t&&e.push(S(t))}),Object.values(t.arrows).forEach(t=>{if(!t)return;const r=E(t);e.push(r)}),Object.values(t.text).forEach(t=>{const r=A(t);e.push(r)}),Object.values(t.namespaces).forEach(r=>{const o=Object.keys(r.classes),n=[...o],s=[...t.lines,...t.arrows,...t.text];o.forEach(t=>{const e=s.filter(e=>e.metadata&&e.metadata.classId===t).map(t=>t.id);e.length&&n.push(...e)});const i={type:"frame",id:b(),name:r.id,children:n};e.push(i)}),{elements:e}}}),L=new s({converter:t=>{const e=[];return t.nodes.forEach(t=>{t&&t.length&&t.forEach(t=>{let r;switch(t.type){case"line":r=S(t);break;case"rectangle":case"ellipse":r=k(t);break;case"text":r=A(t);break;default:throw`unknown type ${t.type}`}e.push(r)})}),t.lines.forEach(t=>{e.push(S(t))}),t.arrows.forEach(t=>{e.push(E(t))}),t.text.forEach(t=>{e.push(A(t))}),{elements:e}}}),N=(t,e)=>[t,e],$="#000000",T=new Set(["choice","fork","join","stateStart","stateEnd","divider"]),Y=t=>"stateEnd"===t.shape?[`state_end_group_${t.id}`]:void 0,R=t=>"rectWithTitle"===t.shape&&t.description.length?[t.text,...t.description].join("\n"):t.text;let X;const _=(t,e)=>{const r=(()=>{if(void 0!==X)return X;if("undefined"==typeof document)return X=null,X;try{X=document.createElement("canvas").getContext("2d")}catch{X=null}return X})();return r?(r.font=`${e}px Excalifont, sans-serif`,r.measureText(t).width):t.length*e*.6},q=(t,e,r)=>{if(_(t,e)<=r)return[t];const o=[];let n="";for(const s of t){const t=`${n}${s}`;n&&_(t,e)>r?(o.push(n),n=s):n=t}return n&&o.push(n),o},M=(t,e,r)=>{const o=t.map(t=>((t,e,r)=>{if(!t.trim())return t;if(_(t,e)<=r)return t;const o=t.split(/\s+/).filter(Boolean),n=[];let s="";for(const t of o){const o=q(t,e,r);for(const[t,i]of o.entries()){const o=s?`${s}${s&&0===t?" ":""}${i}`:i;_(o,e)<=r?s=o:(s&&n.push(s),s=i)}o.length}return n.push(s),n.join("\n")})(t,e,r)).join("\n"),n=o.split("\n");return{width:Math.max(...n.map(t=>_(t,e))),height:n.length*e*1.25}},z=t=>{const e=R(t);if(!e||T.has(t.shape))return 16;const r=Math.max(1,t.width-10),o=Math.max(1,t.height-10),n=e.split("\n");if(n.length>1){if(Math.max(...n.map(t=>_(t,16)))<=r)return 16}return((t,e,r,o)=>{const n=t.split("\n");for(let t=16;t>=14;t-=1){const{height:o}=M(n,t,e);if(o<=r)return t}return o})(e,r,o,1===n.length?16:14)},D=t=>{const e=p(t.containerStyle),r=(t=>{if(T.has(t.shape))return;const e=R(t);return e?{text:e,fontSize:z(t),verticalAlign:"rectWithTitle"===t.shape||"roundedWithTitle"===t.shape?"top":"middle",...g(t.labelStyle)}:void 0})(t),o="choice"===t.shape?"diamond":"stateStart"===t.shape||"stateEnd"===t.shape?"ellipse":"rectangle",n="rect"===t.shape||"rectWithTitle"===t.shape||"roundedWithTitle"===t.shape,s="stateStart"===t.shape||"fork"===t.shape||"join"===t.shape,i=e.backgroundColor||e.strokeColor||$,a=e.strokeColor||e.backgroundColor||$;return{id:t.id,type:o,...Y(t)?{groupIds:Y(t)}:{},x:t.x,y:t.y,width:t.width,height:t.height,...r?{label:r}:{},...e,...n?{roundness:{type:3}}:{},...s?{backgroundColor:i,strokeColor:a,fillStyle:"solid"}:{}}},W=new s({converter:t=>{const e=[];return t.nodes.forEach(t=>{if(!t.isRenderable)return;const r=D(t);e.push(r);const o=(t=>{if(!t.dividerLine)return null;const e=p(t.containerStyle);return{id:`${t.id}__divider`,type:"line",x:t.dividerLine.startX,y:t.dividerLine.startY,width:t.dividerLine.endX-t.dividerLine.startX,height:t.dividerLine.endY-t.dividerLine.startY,points:[N(0,0),N(t.dividerLine.endX-t.dividerLine.startX,t.dividerLine.endY-t.dividerLine.startY)],strokeColor:e.strokeColor||"#000",strokeWidth:e.strokeWidth||1}})(t);o&&e.push(o),"stateEnd"===t.shape&&e.push((t=>{const e=p(t.containerStyle),r=Math.max(2,.32*Math.min(t.width,t.height)),o=t.endInnerColor||e.strokeColor||e.backgroundColor||$;return{id:`${t.id}__inner`,type:"ellipse",groupIds:Y(t),x:t.x+r,y:t.y+r,width:Math.max(1,t.width-2*r),height:Math.max(1,t.height-2*r),backgroundColor:o,strokeColor:o,fillStyle:"solid",strokeWidth:1}})(t))}),t.edges.forEach(t=>{e.push((t=>{const e=t.reflectionPoints.map((t,e,r)=>{const o=r[0];return 0===e?N(0,0):N(t.x-o.x,t.y-o.y)});return{id:t.id,type:"arrow",x:t.startX,y:t.startY,width:t.endX-t.startX,height:t.endY-t.startY,points:e,strokeColor:t.strokeColor||"#000",strokeWidth:t.strokeWidth||2,strokeStyle:t.strokeStyle||"solid",endArrowhead:t.isNoteEdge?null:"triangle",roundness:{type:2},start:{id:t.start},end:{id:t.end},...t.text?{label:{text:t.text,fontSize:16}}:{}}})(t))}),{elements:e}}}),F=t=>{const e=(t=j(t)).replace(/#(\d+);/g,"&#$1;").replace(/#([a-z]+);/g,"&$1;"),r=document.createElement("textarea");return r.innerHTML=e,r.value},B=t=>{const e=t.getAttribute("transform"),r=e?.match(/translate\(([ \d.-]+),\s*([\d.-]+)\)/);let o=0,n=0;return r&&(o=Number(r[1]),n=Number(r[2])),{transformX:o,transformY:n}},j=function(t){return t.replace(/fl°°/g,"#").replace(/fl°/g,"&").replace(/¶ß/g,";")},K=(t,e=.5)=>{const r=[];return t.forEach(t=>{const o=r[r.length-1];if(!o)return void r.push(t);Math.hypot(t[0]-o[0],t[1]-o[1])<=e||r.push(t)}),r},P=t=>{const e=t.getAttribute("d");if(!e)return null;const r=Array.from(e.matchAll(/-?\d*\.?\d+(?:e[-+]?\d+)?/gi),t=>Number(t[0]));return r.length<4?null:{startX:r[0],startY:r[1],endX:r[r.length-2],endY:r[r.length-1]}},U=t=>{const e=t.getAttribute("data-points");if(!e){const e=P(t);return e?[{x:e.startX,y:e.startY},{x:e.endX,y:e.endY}]:[]}try{const t=atob(e),r=JSON.parse(t);return Array.isArray(r)?r.filter(t=>t&&"number"==typeof t.x&&"number"==typeof t.y&&Number.isFinite(t.x)&&Number.isFinite(t.y)):[]}catch{return[]}},H=(t,e={x:0,y:0},r="LM")=>{if("path"!==t.tagName.toLowerCase())throw new Error(`Invalid input: Expected an HTMLElement of tag "path", got ${t.tagName}`);const o=t.getAttribute("d");if(!o)throw new Error('Path element does not contain a "d" attribute');const n=o.split(new RegExp(`(?=[${r}])`)),s=n[0].substring(1).split(",").map(t=>parseFloat(t)),i=n[n.length-1].substring(1).split(",").map(t=>parseFloat(t)),a=n.map(t=>{const e=t[0],r=t.substring(1).split(",").map(t=>parseFloat(t));return"C"===e?{x:r[4],y:r[5],command:e}:{x:r[0],y:r[1],command:e}}).filter((t,e,r)=>{if(0===e||e===r.length-1)return!0;if(t.x===r[e-1].x&&t.y===r[e-1].y)return!1;if(e===r.length-2&&"C"===t.command)return!1;if(e===r.length-2&&(r[e-1].x===t.x||r[e-1].y===t.y)){const e=r[r.length-1];return Math.hypot(e.x-t.x,e.y-t.y)>20}return t.x!==r[e-1].x||t.y!==r[e-1].y}).map(t=>({x:t.x+e.x,y:t.y+e.y}));return{startX:s[0]+e.x,startY:s[1]+e.y,endX:i[0]+e.x,endY:i[1]+e.y,reflectionPoints:a}},V=(t,e={})=>(t=>({...t,elements:t.elements.map(t=>{if(!("points"in t)||!Array.isArray(t.points))return t;const e=t.points;if(e.length<2)return t;const r=K(e);return r.length===e.length?t:{...t,points:r}})}))((()=>{switch(t.type){case"graphImage":return m.convert(t,e);case"flowchart":return f.convert(t,e);case"sequence":return I.convert(t,e);case"class":return O.convert(t,e);case"erd":return L.convert(t,e);case"state":return W.convert(t,e);default:throw new Error(`graphToExcalidraw: unknown graph type "${t.type}, only flowcharts are supported!"`)}})());var G=r(62300);const J=t=>t.replace(/\s*!important\s*$/i,"").trim(),Z=(t,e)=>{let r=e;for(;r<t.length&&/\s/.test(t[r]);)r+=1;const o=r;for(;r<t.length&&/[a-z-]/i.test(t[r]);)r+=1;if(r===o)return!1;for(;r<t.length&&/\s/.test(t[r]);)r+=1;return":"===t[r]},Q=t=>{const e=[];let r=0;for(;r<t.length;){for(;r<t.length&&/[\s;,]/.test(t[r]);)r+=1;if(r>=t.length)break;const o=r;for(;r<t.length&&":"!==t[r]&&";"!==t[r]&&","!==t[r];)r+=1;if(r>=t.length||":"!==t[r])break;const n=t.substring(o,r).trim().toLowerCase();r+=1;const s=r;let i=0,a=null;for(;r<t.length;){const e=t[r];if(a)e===a&&"\\"!==t[r-1]&&(a=null),r+=1;else if('"'!==e&&"'"!==e)if("("!==e)if(")"!==e){if(0===i){if(";"===e||","===e)break;if(/\s/.test(e)&&Z(t,r))break}r+=1}else i=Math.max(0,i-1),r+=1;else i+=1,r+=1;else a=e,r+=1}const l=J(t.substring(s,r));n&&l&&e.push({property:n,value:l}),r<t.length&&(";"===t[r]||","===t[r])&&(r+=1)}return e},tt=t=>{const e=J(t);if(!e)return!1;if("undefined"!=typeof CSS&&"function"==typeof CSS.supports)return CSS.supports("color",e);if("undefined"!=typeof document){const t=document.createElement("div");return t.style.color="",t.style.color=e,""!==t.style.color}return!1},et=(t,e)=>{const r=t.getAttribute("style");return r&&Q(r).find(t=>t.property===e)?.value||""},rt=(...t)=>{for(const e of t){const t=J(e||"");if(tt(t))return t}},ot=(t,e)=>{const r=t.querySelector("text, foreignObject, div, span, p")||t,o=rt(r.getAttribute?.("fill"),et(r,"fill"),r.style?.fill);if(o)return o;const n=rt(r.getAttribute?.("color"),et(r,"color"),r.style?.color);if(n)return n;const s=rt(e);return s||void 0},nt=(t,e,r)=>{switch(e){case l.FILL:case l.STROKE:tt(r)&&(t[e]=r);break;case l.STROKE_WIDTH:case l.STROKE_DASHARRAY:t[e]=r}},st=(t,e,r)=>{e===a.COLOR&&tt(r)&&(t[a.COLOR]=r)},it=(t,e,r)=>{t&&Q(t).forEach(({property:t,value:o})=>{nt(e,t,o),st(r,t,o)})},at=(t,e)=>{t&&Q(t).forEach(({property:t,value:r})=>{"fill"===t&&tt(r)?e[a.COLOR]=r:st(e,t,r)})},lt=(t,e)=>{if(!t)return;[[l.FILL,t.getAttribute("fill")],[l.STROKE,t.getAttribute("stroke")],[l.STROKE_WIDTH,t.getAttribute("stroke-width")],[l.STROKE_DASHARRAY,t.getAttribute("stroke-dasharray")]].forEach(([t,r])=>{const o=J(r||"");o&&nt(e,t,o)})},ct=(t,e)=>{if(!t)return;const r=t.getAttribute("fill")||t.getAttribute("color"),o=J(r||"");tt(o)&&(e[a.COLOR]=o)},dt=(t,e,r,o)=>{if(!(e instanceof Map))return;const n=e.get(t);n&&(n.styles?.forEach(t=>{Q(t).forEach(({property:t,value:e})=>{nt(r,t,e),st(o,t,e)})}),n.textStyles?.forEach(t=>{Q(t).forEach(({property:t,value:e})=>{st(o,t,e)})}))},ut=(t,e,r)=>{const o=e.querySelector(`[id*="${t.domId}"]`);if(!o)return;let n;"a"===o.parentElement?.tagName.toLowerCase()&&(n=o.parentElement.getAttribute("xlink:href"));const s=ht(n?o.parentElement:o,e),i=o.getBBox(),a={width:i.width,height:i.height},l={},c={};t.classes&&r instanceof Map&&(Array.isArray(t.classes)?t.classes:[t.classes]).forEach(t=>{dt(t,r,l,c)}),t.styles?.forEach(t=>{it(t,l,c)});const d=o.querySelector(".label-container");it(d?.getAttribute("style"),l,c),lt(d,l);return Array.from(o.querySelectorAll(".label, .nodeLabel, .label text, .label tspan, .label span, .label div")).forEach(t=>{at(t.getAttribute("style"),c),ct(t,c)}),{id:t.id,labelType:t.labelType,text:F(t.text||""),type:t.type,link:n||void 0,...s,...a,containerStyle:l,labelStyle:c}},ht=(t,e)=>{if(!t)throw new Error("Element not found");let r=t.parentElement?.parentElement;const o=t.childNodes[0];let n={x:0,y:0};if(o){const{transformX:t,transformY:e}=B(o),r=o.getBBox();n={x:Number(o.getAttribute("x"))||t+r.x||0,y:Number(o.getAttribute("y"))||e+r.y||0}}const{transformX:s,transformY:i}=B(t),a={x:s+n.x,y:i+n.y};for(;r&&r.id!==e.id;){if("root"===r.classList.value&&r.hasAttribute("transform")){const{transformX:t,transformY:e}=B(r);a.x+=t,a.y+=e}r=r.parentElement}return a},pt=(t,e)=>{const r=t.getVertices(),o=t.getEdges(),n=t.getSubGraphs(),s=t.getClasses(),i={},a=s instanceof Map?s:{};r instanceof Map?r.forEach((t,r)=>{i[r]=ut(t,e,a)}):"object"==typeof r&&null!==r&&Object.entries(r).forEach(([t,r])=>{i[t]=ut(r,e,a)});const l=new Map,c=(Array.isArray(o)?o:[]).map(t=>{if(!e.querySelector(`[id*="${t.id}"]`))return null;const r=`${t.start}-${t.end}`,o=l.get(r)||0;return l.set(r,o+1),((t,e,r)=>{const o=r.querySelector(`[id*="${t.id}"]`);if(!o)throw new Error("Edge element not found");const n=ht(o,r),s=H(o,n);return t.length=void 0,{...t,...s,text:F(t.text)}})(t,0,e)}).filter(t=>null!==t&&t.reflectionPoints.length>1),d=(Array.isArray(n)?n:[]).map(t=>((t,e,r)=>{const o=t.nodes.map(t=>t.startsWith("flowchart-")?t.split("-")[1]:t),n=e.querySelector(`[id='${t.id}']`);if(!n)throw new Error("SubGraph element not found");const s=ht(n,e),i=n.getBBox(),a={width:i.width,height:i.height},l={},c={},d=n.querySelector(":scope > rect, :scope > path, :scope > polygon, :scope > ellipse")||n.querySelector(".cluster > rect, .cluster > path, .cluster > polygon, .cluster > ellipse")||n.querySelector("rect, path, polygon, ellipse");it(n.getAttribute("style"),l,c),it(d?.getAttribute("style"),l,c),lt(d,l);const u=n.querySelector(".cluster-label text, .cluster-label tspan")||n.querySelector("text");return at(u?.getAttribute("style"),c),ct(u,c),dt(t.id,r,l,c),t.classes?.forEach(t=>{dt(t,r,l,c)}),{id:t.id,nodeIds:o,text:F(t.title),labelType:"text",...s,...a,containerStyle:l,labelStyle:c}})(t,e,a));return{type:"flowchart",subGraphs:d,vertices:i,edges:c}},gt=(t,e,r,o,n)=>{const s={type:"arrow"};return s.startX=t,s.startY=e,s.endX=r,s.endY=o,Object.assign(s,{...n}),s},yt=(t,e,r,o)=>({type:"text",x:t,y:e,text:r,width:o?.width||20,height:o?.height||20,fontSize:o?.fontSize||20,id:o?.id,color:o?.color,groupId:o?.groupId,metadata:o?.metadata}),ft=(t,e,r)=>{const o={},n=Number(t.getAttribute("x")),s=Number(t.getAttribute("y"));o.type="text",o.text=F(e),r?.id&&(o.id=r.id),r?.groupId&&(o.groupId=r.groupId);const i=t.getBBox();o.width=i.width,o.height=i.height,o.x=n-i.width/2,o.y=s;const a=parseInt(getComputedStyle(t).fontSize);return o.fontSize=a,o.color=ot(t),o},bt=(t,e,r={})=>{const o={};o.type=e;const{label:n,subtype:s,id:i,groupId:a}=r;o.id=i,a&&(o.groupId=a),n&&(o.label={text:F(n.text),fontSize:16,textAlign:n?.textAlign,verticalAlign:n?.verticalAlign});const l=t.getBBox();switch(o.x=l.x,o.y=l.y,o.width=l.width,o.height=l.height,o.subtype=s,s){case"highlight":const e=t.getAttribute("fill");e&&(o.bgColor=J(e));break;case"note":o.strokeStyle="dashed"}return o},mt=(t,e,r,o,n,s)=>{const i={};i.startX=e,i.startY=r,i.endX=o,s?.groupId&&(i.groupId=s.groupId),s?.id&&(i.id=s.id),i.endY=n;const a=t.getAttribute("stroke");return i.strokeColor=a?J(a):null,i.strokeWidth=Number(t.getAttribute("stroke-width")),i.type="line",i},xt={0:"SOLID",1:"DOTTED",3:"SOLID_CROSS",4:"DOTTED_CROSS",5:"SOLID_OPEN",6:"DOTTED_OPEN",24:"SOLID_POINT",25:"DOTTED_POINT"},wt=0,St=1,At=2,kt=3,Et=4,vt=5,Ct=6,It=24,Ot=25,Lt=27,Nt=t=>{let e;switch(t){case wt:case kt:case vt:case It:e="solid";break;case St:case Et:case Ct:case Ot:e="dotted";break;default:e="solid"}return e},$t=(t,e,r)=>{if(!t)throw"root node not found";const n=b(),s=Array.from(t.children),i=[];return s.forEach((t,s)=>{const a=`${r?.id}-${s}`;let l;switch(t.tagName){case"line":const r=Number(t.getAttribute("x1")),s=Number(t.getAttribute("y1")),i=Number(t.getAttribute("x2")),c=Number(t.getAttribute("y2"));l=mt(t,r,s,i,c,{groupId:n,id:a});break;case"text":l=ft(t,e,{groupId:n,id:a});break;case"circle":l=bt(t,"ellipse",{label:t.textContent?{text:t.textContent}:void 0,groupId:n,id:a});default:l=bt(t,o[t.tagName],{label:t.textContent?{text:t.textContent}:void 0,groupId:n,id:a})}i.push(l)}),i},Tt=(t,e)=>{const r=e.getAttribute("fill"),o=e.getAttribute("stroke"),n=e.getAttribute("stroke-width"),s=e.getAttribute("stroke-dasharray");r&&"none"!==r&&(t.bgColor=J(r)),o&&"none"!==o&&(t.strokeColor=J(o)),n&&(t.strokeWidth=Number(n)),s&&s.trim()&&(t.strokeStyle="dashed")},Yt=(t,e,r)=>{const o=[],n=Array.from(e.querySelectorAll('[class*="messageLine"]')),s=Object.keys(xt),i=t.filter(t=>s.includes(t.type.toString()));return n.forEach((t,e)=>{const n=i[e],s=xt[n.type],a=((t,e)=>{const r={};e?.label&&(r.label={text:F(e.label),fontSize:16});const o=t.tagName;if("line"===o)r.startX=Number(t.getAttribute("x1")),r.startY=Number(t.getAttribute("y1")),r.endX=Number(t.getAttribute("x2")),r.endY=Number(t.getAttribute("y2"));else if("path"===o){const e=t.getAttribute("d");if(!e)throw new Error('Path element does not contain a "d" attribute');const o=e.split(/(?=[LC])/),n=o[0].substring(1).split(",").map(t=>parseFloat(t)),s=[];o.forEach(t=>{const e=t.substring(1).trim().split(" ").map(t=>{const[e,r]=t.split(",");return[parseFloat(e)-n[0],parseFloat(r)-n[1]]});s.push(...e)});const i=s[s.length-1];r.startX=n[0],r.startY=n[1],r.endX=i[0],r.endY=i[1],r.points=s}if(e?.label){const t=10;r.startY=r.startY-t,r.endY=r.endY-t}const n=t.getAttribute("stroke"),s=(n&&"none"!==n?n:"")||getComputedStyle(t).stroke||"";return r.strokeColor=s?J(s):null,r.strokeWidth=Number(t.getAttribute("stroke-width")),r.type="arrow",r.strokeStyle=e?.strokeStyle||"solid",r.startArrowhead=e?.startArrowhead||null,r.endArrowhead=e?.endArrowhead||null,r})(t,{label:n?.message,strokeStyle:Nt(n.type),endArrowhead:"SOLID_OPEN"===s||"DOTTED_OPEN"===s?null:"arrow"}),l=r[n.from],c=r[n.to];l?.topId&&c?.topId&&(a.start={type:l.bindType||"rectangle",id:l.topId},a.end={type:c.bindType||"rectangle",id:c.topId}),((t,e)=>{if(t.nextElementSibling?.classList.contains("sequenceNumber")){const r=t.nextElementSibling?.textContent;if(!r)throw new Error("sequence number not present");const o=30,n=o/2,s=10,i={type:"rectangle",x:e.startX-s,y:e.startY-n,label:{text:r,fontSize:14},bgColor:"#e9ecef",height:o,subtype:"sequence"};Object.assign(e,{sequenceNumber:i})}})(t,a),o.push(a)}),o},Rt=(t,e)=>{const r=t.db,o=[],n=r.getBoxes().map(t=>({...t,fill:J(t.fill||"")})),s=(t=>{const e=Array.from(t.querySelectorAll(".rect")).filter(t=>"g"!==t.parentElement?.tagName),r=[];return e.forEach(t=>{const e=bt(t,"rectangle",{label:{text:""},subtype:"highlight"});r.push(e)}),r})(e),i=r.getActors(),{nodes:a,lines:l,actorMap:c}=((t,e)=>{const r=Array.from(e.querySelectorAll(".actor-top")),o=Array.from(e.querySelectorAll(".actor-bottom")),n=[],s=[],i={},a=t instanceof Map?Array.from(t.values()):Object.values(t),l=Array.from(e.querySelectorAll(".actor-line")),c=(t,e)=>{const r=t.name,o=l.find(t=>t.getAttribute("name")===r);if(o)return o;const n="participant"===t.type?e.parentElement?.previousElementSibling:e.previousElementSibling;return n?"line"===n.tagName?n:n.querySelector("line"):null};return a.forEach(t=>{const e=r.find(e=>e.getAttribute("name")===t.name),a=o.find(e=>e.getAttribute("name")===t.name);if(!e||!a)throw"root not found";const l=t.description;if("participant"===t.type){const r=bt(e,"rectangle",{id:`${t.name}-top`,label:{text:l},subtype:"actor"});if(Tt(r,e),!r)throw"Top Node element not found!";n.push([r]);const o=bt(a,"rectangle",{id:`${t.name}-bottom`,label:{text:l},subtype:"actor"});i[t.name]={topId:`${t.name}-top`,bottomId:`${t.name}-bottom`,bindType:"rectangle"},Tt(o,a),n.push([o]);const d=c(t,e);if("line"!==d?.tagName)throw"Line not found";const u=Number(d.getAttribute("x1"));if(!r.height)throw"Top node element height is null";const h=r.y+r.height,p=o.y,g=Number(d.getAttribute("x2")),y=mt(d,u,h,g,p);s.push(y)}else if("actor"===t.type){const r=$t(e,l,{id:`${t.name}-top`});n.push(r);const o=$t(a,l,{id:`${t.name}-bottom`});n.push(o);const d=c(t,e);if("line"!==d?.tagName)throw"Line not found";const u=Number(d.getAttribute("x1")),h=Number(d.getAttribute("y1")),p=Number(d.getAttribute("x2")),g=o.find(t=>"ellipse"===t.type);if(g){const t=g.y,e=mt(d,u,h,p,t);s.push(e)}const y=r.find(t=>"ellipse"===t.type),f=o.find(t=>"ellipse"===t.type);y?.id&&f?.id&&(i[t.name]={topId:y.id,bottomId:f.id,bindType:"ellipse"})}}),{nodes:n,lines:s,actorMap:i}})(i,e),d=r.getMessages(),u=Yt(d,e,c),h=((t,e)=>{const r=Array.from(e.querySelectorAll(".note")).map(t=>t.parentElement),o=t.filter(t=>t.type===At),n=[];return r.forEach((t,e)=>{if(!t)return;const r=t.firstChild,s=o[e].message,i=bt(r,"rectangle",{label:{text:s},subtype:"note"}),a=r.getAttribute("fill"),l=r.getAttribute("stroke"),c=r.getAttribute("stroke-width"),d=r.getAttribute("stroke-dasharray");a&&"none"!==a&&(i.bgColor=J(a)),l&&"none"!==l&&(i.strokeColor=J(l)),c&&(i.strokeWidth=Number(c)),d&&d.trim()&&(i.strokeStyle="dashed"),n.push(i)}),n})(d,e),p=(t=>{const e=Array.from(t.querySelectorAll("[class*=activation]")),r=[];return e.forEach(t=>{const e=bt(t,"rectangle",{label:{text:""},subtype:"activation"});(()=>{const r=t.getAttribute("fill"),o=t.getAttribute("stroke"),n=t.getAttribute("stroke-width"),s=t.getAttribute("stroke-dasharray");r&&"none"!==r&&(e.bgColor=J(r)),o&&"none"!==o&&(e.strokeColor=J(o)),n&&(e.strokeWidth=Number(n)),s&&s.trim()&&(e.strokeStyle="dashed")})(),r.push(e)}),r})(e),g=((t,e)=>{const r=Array.from(e.querySelectorAll(".loopLine")),o=[],n=[],s=[];r.forEach(t=>{const e=Number(t.getAttribute("x1")),r=Number(t.getAttribute("y1")),n=Number(t.getAttribute("x2")),s=Number(t.getAttribute("y2")),i=mt(t,e,r,n,s);i.strokeStyle="dotted",i.strokeColor="#adb5bd",i.strokeWidth=2,o.push(i)});const i=Array.from(e.querySelectorAll(".loopText")),a=t.filter(t=>t.type===Lt).map(t=>t.message);i.forEach(t=>{const e=t.textContent||"",r=ft(t,e),o=e.match(/\[(.*?)\]/)?.[1]||"";a.includes(o)&&(r.x+=16),n.push(r)});const l=Array.from(e?.querySelectorAll(".labelBox")),c=Array.from(e?.querySelectorAll(".labelText"));return l.forEach((t,e)=>{const r=c[e]?.textContent||"",o=bt(t,"rectangle",{label:{text:r}});o.strokeColor="#adb5bd",o.bgColor="#e9ecef",o.width=void 0,s.push(o)}),{lines:o,texts:n,nodes:s}})(d,e);return o.push(s),o.push(...a),o.push(h),o.push(p),{type:"sequence",lines:l,arrows:u,nodes:o,loops:g,groups:n}},Xt=0,_t=1,qt=2,Mt=0,zt=1,Dt=t=>{let e;switch(t){case Xt:e="diamond_outline";break;case qt:e="diamond";break;case _t:e="triangle_outline";break;case"none":e=null;break;default:e="arrow"}return e},Wt=(t,e)=>{let r=0,o=0,n=t;for(;n&&n!==e;){const{transformX:t,transformY:e}=B(n);r+=t,o+=e,n=n.parentElement}return{tx:r,ty:o}},Ft=new Set(["triangle_outline","diamond","diamond_outline"]),Bt=(t,e=.5)=>{if(t.length<=2)return[...t];const r=[t[0]];for(let o=1;o<t.length-1;o++){const n=r[r.length-1],s=t[o],i=t[o+1],a=i.x-n.x,l=i.y-n.y,c=Math.hypot(a,l);if(!c)continue;const d=Math.abs(a*(s.y-n.y)-l*(s.x-n.x))/c,u=((s.x-n.x)*a+(s.y-n.y)*l)/(c*c);d<=e&&u>=-e&&u<=1+e||r.push(s)}return r.push(t[t.length-1]),r},jt=t=>{const e=K(U(t).map(t=>[t.x,t.y])).map(([t,e])=>({x:t,y:e})),r=P(t);return r&&e.length>=2&&(e[0]={x:r.startX,y:r.startY},e[e.length-1]={x:r.endX,y:r.endY}),Bt(e)},Kt=(t,e,r)=>{const o=t.x-e.x,n=t.y-e.y,s=Math.hypot(o,n);return s?{x:t.x+o/s*r,y:t.y+n/s*r}:t},Pt=t=>{const e=t.points?.map(([e,r])=>({x:t.startX+e,y:t.startY+r})).filter(t=>Number.isFinite(t.x)&&Number.isFinite(t.y));if(!e||e.length<2)return t;const r=[...e],o=!!t.startArrowhead&&Ft.has(t.startArrowhead),n=!!t.endArrowhead&&Ft.has(t.endArrowhead);if(!o&&!n)return t;if(o&&(r[0]=Kt(r[0],r[1],16)),n){const t=r.length-1;r[t]=Kt(r[t],r[t-1],16)}return((t,e)=>{const r=K(e.map(t=>[t.x,t.y])).map(([t,e])=>({x:t,y:e}));if(r.length<2)throw new Error("Arrow route must contain at least two points");const o=r[0],n=r[r.length-1];t.startX=o.x,t.startY=o.y,t.endX=n.x,t.endY=n.y,t.points=r.map(t=>[t.x-o.x,t.y-o.y])})(t,r),t},Ut=(t,e,r)=>{if(t.length<2)throw new Error(`Class diagram edge ${e?.id||"<unknown>"} is missing usable path points`);const o=t[0],n=t[t.length-1],s=gt(o.x,o.y,n.x,n.y,{id:e?.getAttribute("data-id")||e?.id||void 0,...r,points:t.map(t=>[t.x-o.x,t.y-o.y])});return e&&((t,e)=>{const r=J(t.getAttribute("stroke")||getComputedStyle(t).stroke||""),o=parseFloat(t.getAttribute("stroke-width")||getComputedStyle(t).strokeWidth||"1");tt(r)&&"none"!==r&&(e.strokeColor=r),Number.isFinite(o)&&o>0&&(e.strokeWidth=o)})(e,s),Pt(s)},Ht=(t,e)=>Ut((t=>{const e=[];return t.forEach(t=>{jt(t).forEach(t=>{const r=e[e.length-1];r&&r.x===t.x&&r.y===t.y||e.push(t)})}),Bt(e)})(t),t[0],e),Vt=(t,e)=>{const r=(t=>t.points?.map(([e,r])=>({x:t.startX+e,y:t.startY+r})).filter(t=>Number.isFinite(t.x)&&Number.isFinite(t.y))||[])(t);if(r.length<2)return null;const o="start"===e,n=o?r[0]:r[r.length-1],s=o?r[1]:r[r.length-2],i=s.x===n.x?o?-1:1:Math.sign(s.x-n.x),a=s.y===n.y?1:Math.sign(s.y-n.y);return{x:n.x+20*i,y:n.y+(a>=0?12:-28)}},Gt=(t,e)=>{let r=t;for(;r&&r!==e;){if(r.classList.contains("annotation-group"))return"header";if(r.classList.contains("label-group"))return"header";if(r.classList.contains("members-group"))return"members";if(r.classList.contains("methods-group"))return"methods";r=r.parentElement}return"other"},Jt=(t,e,r)=>{const o=[],n=[],s=[];return Object.values(t).forEach(t=>{const{domId:i,id:a}=t,l=b(),c=(t=>{const e={};return t?(t.forEach(t=>{Q(t).forEach(({property:t,value:r})=>{t&&r&&(e[t]=J(r))})}),e):e})(t.styles||t.cssStyles);let d;try{d=r?r(a):void 0}catch{d=void 0}const u=d&&e.querySelector(`#${d}`)||e.querySelector(`#${i}`)||e.querySelector(`[data-id='${a}']`)||(t=>{const r=new RegExp(`^classId-${t}(?:-|$)`);return Array.from(e.querySelectorAll("[id]")).filter(t=>r.test(t.id))[0]})(a);if(!u)throw Error(`DOM Node with id ${i} not found`);const h=u.querySelector("rect")||u,p=h.getBBox(),{tx:g,ty:y}=Wt(h,e),f={type:"rectangle",id:a,groupId:l,x:p.x+g,y:p.y+y,width:p.width,height:p.height,metadata:{classId:a}},m=h.getAttribute("fill"),x=h.getAttribute("stroke"),w=h.getAttribute("stroke-width"),S=h.getAttribute("stroke-dasharray"),A=getComputedStyle(h),k=J(m||c.fill||(m?A.fill:"")),E=J(x||c.stroke||(x?A.stroke:"")),v=w||c["stroke-width"]||(w?A.strokeWidth:""),C=S||c["stroke-dasharray"]||(S?"none"===A.strokeDasharray?"":A.strokeDasharray:""),I=t=>{if(!t)return!1;if(!tt(t))return!1;const e=t.toLowerCase();return!("none"===e||"transparent"===e||"rgba(0, 0, 0, 0)"===e||"black"===e||"#000"===e||"#000000"===e||"rgb(0, 0, 0)"===e||"rgba(0, 0, 0, 1)"===e)};I(k)?f.bgColor=k:f.bgColor=void 0,I(E)?f.strokeColor=E:f.strokeColor=void 0,f.strokeWidth=v?Number(v):void 0,C&&C.trim().length>0?f.strokeStyle="dashed":f.strokeStyle=void 0,o.push(f);[...Array.from(u.querySelectorAll("line")),...Array.from(u.querySelectorAll("g.divider path"))].forEach(t=>{const{tx:r,ty:o}=Wt(t,e);let s,i,c,d;if("line"===t.tagName.toLowerCase())s=Number(t.getAttribute("x1"))+r,i=Number(t.getAttribute("y1"))+o,c=Number(t.getAttribute("x2"))+r,d=Number(t.getAttribute("y2"))+o;else{const e=t.getBBox();s=e.x+r,c=e.x+e.width+r;const n=e.y+e.height/2+o;i=n,d=n}if(s===c&&i===d)return;const u=mt(t,s,i,c,d,{groupId:l,id:b()});f.strokeColor?u.strokeColor=f.strokeColor:u.strokeColor=void 0,void 0!==f.strokeWidth?u.strokeWidth=f.strokeWidth:u.strokeWidth=void 0,f.strokeStyle?u.strokeStyle=f.strokeStyle:u.strokeStyle=void 0,u.metadata={classId:a},n.push(u)});const O=Array.from(u.querySelectorAll("text, foreignObject")),L=[];O.forEach(t=>{const r="foreignobject"===t.tagName.toLowerCase(),o=r?[]:Array.from(t.querySelectorAll("tspan")),n=o.length?o.map(t=>t.textContent?.trim()).filter(Boolean).join("\n"):t.textContent?.trim()||"";if(!n)return;const s=t.getBBox(),{ty:i}=Wt(t,e);let a=parseFloat(getComputedStyle(t).fontSize||"");if(r&&(!Number.isFinite(a)||!a)){const e=t.querySelector("div, span, p");e&&(a=parseFloat(getComputedStyle(e).fontSize||""))}(!Number.isFinite(a)||a<=0)&&(a=Math.max(12,.6*s.height)),a*=.9;const l=ot(t,c.color);L.push({section:Gt(t,u),text:F(n),x:s.x,y:s.y+i,width:f&&f.width?Math.max(f.width-8,s.width):s.width,height:s.height,fontSize:a,color:l})});const N=L.filter(t=>"header"===t.section).sort((t,e)=>t.y-e.y||t.x-e.x);if(!f.label){const t=0===N.length&&1===L.length?L:N;t.length>0&&(f.label={text:t.map(t=>t.text).join("\n"),fontSize:Math.max(...t.map(t=>t.fontSize)),color:t.find(t=>t.color)?.color,verticalAlign:"top"})}L.filter(t=>N.length>0?"header"!==t.section:!(f.label&&1===L.length)).forEach(t=>{const e=yt((f?.x||0)+4,t.y,t.text,{width:t.width,height:t.height,fontSize:t.fontSize,color:t.color,id:b(),groupId:l,metadata:{classId:a}});s.push(e)})}),{nodes:o,lines:n,text:s}},Zt=(t,e,r,o)=>{const n=Array.from(r.querySelectorAll('.edgePaths path[data-edge="true"]:not([id^="edgeNote"]):not([id*="-cyclic-special-"])'));if(0===t.length)return{arrows:[],text:[]};const s=[],i=[];let a=0;return t.forEach(t=>{const{id1:l,id2:c,relation:d}=t,u=e.find(t=>t.id===l),h=e.find(t=>t.id===c);if(!u)throw new Error(`parseRelations: Cannot find node with id ${l}`);if(!h)throw new Error(`parseRelations: Cannot find node with id ${c}`);const p=(t=>{let e;switch(t){case Mt:e="solid";break;case zt:e="dotted";break;default:e="solid"}return e})(d.lineType),g=Dt(d.type1),y=Dt(d.type2);let f;if(l===c){const e=((t,e)=>[`${t}-cyclic-special-1`,`${t}-cyclic-special-mid`,`${t}-cyclic-special-2`].map(t=>e.querySelector(`path[id="${t}"][data-edge="true"]`)).filter(t=>null!==t))(l,r);if(!e.length)throw new Error(`parseRelations: Cannot find rendered SVG edge for relation ${l} -> ${c}`);f=Ht(e,{strokeStyle:p,startArrowhead:g,endArrowhead:y,label:t.title?{text:t.title}:void 0,start:{type:"rectangle",id:u.id},end:{type:"rectangle",id:h.id}})}else{const e=n[a];if(!e)throw new Error(`parseRelations: Cannot find rendered SVG edge for relation ${l} -> ${c}`);a+=1,f=((t,e)=>{const r=jt(t);return Ut([r[0],r[r.length-1]],t,e)})(e,{strokeStyle:p,startArrowhead:g,endArrowhead:y,label:t.title?{text:t.title}:void 0,start:{type:"rectangle",id:u.id},end:{type:"rectangle",id:h.id}})}s.push(f);const{relationTitle1:b,relationTitle2:m}=t,x=l===c,w=20,S=15,A=15;let k,E;if(b&&"none"!==b){if(x){const t=Vt(f,"start");t&&(k=t.x,E=t.y)}else switch(o){case"TB":k=f.startX-w,f.endX<f.startX&&(k-=A),E=f.startY+S;break;case"BT":k=f.startX+w,f.endX>f.startX&&(k+=A),E=f.startY-S;break;case"LR":k=f.startX+w,E=f.startY+S,f.endY>f.startY&&(E+=A);break;case"RL":k=f.startX-w,E=f.startY-S,f.startY>f.endY&&(E-=A);break;default:k=f.startX-w,E=f.startY+S}k??=f.startX-w,E??=f.startY+S;const t=yt(k,E,b,{fontSize:16});i.push(t)}if(m&&"none"!==m){if(x){const t=Vt(f,"end");t&&(k=t.x,E=t.y)}else switch(o){case"TB":k=f.endX+w,f.endX<f.startX&&(k+=A),E=f.endY-S;break;case"BT":k=f.endX-w,f.endX>f.startX&&(k-=A),E=f.endY+S;break;case"LR":k=f.endX-w,E=f.endY-S,f.endY>f.startY&&(E-=A);break;case"RL":k=f.endX+w,E=f.endY+S,f.startY>f.endY&&(E+=A);break;default:k=f.endX+w,E=f.endY-S}k??=f.endX+w,E??=f.endY+S;const t=yt(k,E,m,{fontSize:16});i.push(t)}}),{arrows:s,text:i}},Qt=(t,e,r)=>{const o=[],n=[];return t.forEach((t,s)=>{const{id:i,text:a,class:l}=t,c=e.querySelector(`#${i}`);if(!c)throw new Error(`Node with id ${i} not found!`);const{transformX:d,transformY:u}=B(c),h=c.firstChild,p=bt(h,"rectangle",{id:i,subtype:"note",label:{text:a}});if(Object.assign(p,{x:p.x+d,y:p.y+u}),o.push(p),l){const t=r.find(t=>t.id===l);if(!t)throw new Error(`class node with id ${l} not found!`);const o=e.querySelector(`path[id="edgeNote${s+1}"][data-edge="true"]`);if(o)return void n.push(((t,e)=>Ht([t],e))(o,{strokeStyle:"dotted",startArrowhead:null,endArrowhead:null,start:{id:p.id,type:"rectangle"},end:{id:t.id,type:"rectangle"}}));const i=p.x+(p.width||0)/2,a=p.y+(p.height||0),c=i,d=t.y,u=gt(i,a,c,d,{strokeStyle:"dotted",startArrowhead:null,endArrowhead:null,start:{id:p.id,type:"rectangle"},end:{id:t.id,type:"rectangle"}});n.push(u)}}),{notes:o,connectors:n}},te=(t,e)=>{let r=0,o=0,n=t;for(;n&&n!==e;){const{transformX:t,transformY:e}=B(n);r+=t,o+=e,n=n.parentElement}return{tx:r,ty:o}},ee=t=>{const e=t.querySelector("text, foreignObject, div, span, p")||t;let r=parseFloat(getComputedStyle(e).fontSize||"");return(!Number.isFinite(r)||r<=0)&&(r=Math.max(12,.75*t.getBBox().height)),r},re=(t,e,r)=>{const o=(t=>{const e=Array.from(t.querySelectorAll("tspan")),r=e.length?e.map(t=>t.textContent?.trim()).filter(Boolean).join("\n"):t.textContent?.trim()||"";return F(r)})(t);if(!o)return null;const n=t.getBBox(),{tx:s,ty:i}=te(t,e);return{className:t.getAttribute("class")||"",text:o,x:n.x+s,y:n.y+i,width:n.width,height:n.height,fontSize:ee(t),color:ot(t,r)}},oe=t=>{switch(t?.toLowerCase()){case"one":return"cardinality_one";case"many":return"cardinality_many";case"only_one":return"cardinality_exactly_one";case"one_or_more":return"cardinality_one_or_many";case"zero_or_one":return"cardinality_zero_or_one";case"zero_or_more":return"cardinality_zero_or_many";default:return null}},ne=t=>{switch(t){case"dotted":return"dotted";case"dashed":return"dashed";default:return"solid"}},se=(t,e)=>{const r=e.querySelector(`[id="${t.id}"]`);if(!r)throw new Error(`ER entity ${t.id} not found in rendered SVG`);const o=t.attributes.length?b():void 0,n=r.getBBox(),{tx:s,ty:i}=te(r,e),a=(t=>{const e={};return t?(t.forEach(t=>{Q(t).forEach(({property:t,value:r})=>{t&&r&&(e[t]=J(r))})}),e):e})([...t.cssStyles||[],...t.cssCompiledStyles||[]]),l=J(a.fill||""),c=J(a.stroke||""),d=(t=>{if(null==t||""===t)return;const e="number"==typeof t?t:parseFloat(J(t));return!Number.isFinite(e)||e<=0?void 0:e})(a["stroke-width"]),u=J(a["stroke-dasharray"]||""),h=Array.from(r.querySelectorAll("g.label")).map(t=>re(t,e,a.color)).filter(t=>null!==t),p=h.find(t=>t.className.includes("name"))||h[0],g=h.filter(t=>t!==p),y=p?.text||F(t.alias||t.label||""),f={type:"rectangle",id:t.id,groupId:o,x:n.x+s,y:n.y+i,width:n.width,height:n.height,label:{text:y,fontSize:t.attributes.length?18:p?.fontSize||16,color:p?.color,textAlign:"center",verticalAlign:t.attributes.length?"top":"middle"},metadata:{entityId:t.id,entityLabel:t.label,entityAlias:t.alias}};tt(l)&&"none"!==l&&(f.bgColor=l),tt(c)&&"none"!==c&&(f.strokeColor=c),d&&Number.isFinite(d)&&d>0&&(f.strokeWidth=d),u&&"none"!==u&&(f.strokeStyle="dashed");const m=Array.from(r.querySelectorAll(".divider path, path.divider, line.divider")).map(r=>((t,e,r,o,n,s,i)=>{const{tx:a,ty:l}=te(t,e);let c=0,d=0,u=0,h=0;if("line"===t.tagName.toLowerCase())c=Number(t.getAttribute("x1"))+a,d=Number(t.getAttribute("y1"))+l,u=Number(t.getAttribute("x2"))+a,h=Number(t.getAttribute("y2"))+l;else{const e=P(t);if(!e)return null;c=e.startX+a,d=e.startY+l,u=e.endX+a,h=e.endY+l}const p={type:"line",id:b(),groupId:r,startX:c,startY:d,endX:u,endY:h,metadata:{entityId:o}};return n&&tt(n)&&"none"!==n&&(p.strokeColor=n),void 0!==s&&(p.strokeWidth=s),i&&(p.strokeStyle=i),p})(r,e,o,t.id,f.strokeColor,f.strokeWidth,f.strokeStyle)).filter(t=>null!==t),x=g.map(e=>yt(e.x,e.y,e.text,{id:b(),groupId:o,width:e.width,height:e.height,fontSize:18,color:e.color,metadata:{entityId:t.id}}));return{container:f,lines:m,text:x}},ie=(t,e)=>{const r=((t,e)=>{const r=e.querySelector(`path[id="${t.id}"][data-edge="true"]`);return r?[r]:t.start!==t.end?[]:[`${t.start}-cyclic-special-1`,`${t.start}-cyclic-special-mid`,`${t.start}-cyclic-special-2`].map(t=>e.querySelector(`path[id="${t}"][data-edge="true"]`)).filter(t=>null!==t)})(t,e);if(!r.length)throw new Error(`ER relationship ${t.id} not found in rendered SVG`);const o=(t=>{const e=[];return t.forEach(t=>{U(t).forEach(t=>{const r=e[e.length-1];r&&r.x===t.x&&r.y===t.y||e.push(t)})}),e})(r);if(o.length<2)throw new Error(`ER relationship ${t.id} is missing usable path points`);const n=o[0],s=o[o.length-1],i=r[0],a=J(i.getAttribute("stroke")||getComputedStyle(i).stroke||""),l=Number(i.getAttribute("stroke-width")||getComputedStyle(i).strokeWidth||1),c=gt(n.x,n.y,s.x,s.y,{id:t.id,label:t.label?{text:F(t.label),fontSize:16,textAlign:"center"}:void 0,strokeStyle:ne(t.pattern),startArrowhead:oe(t.arrowTypeStart),endArrowhead:oe(t.arrowTypeEnd),start:{type:"rectangle",id:t.start},end:{type:"rectangle",id:t.end},points:o.map(t=>[t.x-n.x,t.y-n.y])});return tt(a)&&"none"!==a&&(c.strokeColor=a),Number.isFinite(l)&&l>0&&(c.strokeWidth=l),c},ae=t=>{const e=J(t||"");return!!e&&("none"!==e&&"transparent"!==e&&"rgba(0, 0, 0, 0)"!==e&&"rgba(0,0,0,0)"!==e&&tt(e))},le=(t,e,r)=>{switch(e){case l.FILL:case l.STROKE:ae(r)&&(t[e]=J(r));break;case l.STROKE_WIDTH:case l.STROKE_DASHARRAY:J(r)&&(t[e]=J(r))}},ce=(t,e,r)=>{e===a.COLOR&&ae(r)&&(t[a.COLOR]=J(r))},de=(t,e)=>{t&&Q(t).forEach(({property:t,value:r})=>{t===l.FILL&&ae(r)?e[a.COLOR]=J(r):ce(e,t,r)})},ue=(t,e)=>{let r=0,o=0,n=t;for(;n&&n!==e;){const{transformX:t,transformY:e}=B(n);r+=t,o+=e,n=n.parentElement}return{tx:r,ty:o}},he=(t,e)=>{const r=t.querySelector("line.divider");if(!r)return;const{tx:o,ty:n}=ue(r,e);return{startX:Number(r.getAttribute("x1"))+o,startY:Number(r.getAttribute("y1"))+n,endX:Number(r.getAttribute("x2"))+o,endY:Number(r.getAttribute("y2"))+n}},pe=t=>{const e=t.getBBox();return Math.abs(e.width*e.height)},ge=(t,e)=>{const r=t.getAttribute("style");if(!r)return;const o=Q(r).find(t=>t.property===e);return o?J(o.value):void 0},ye=(t,e)=>{const r=t.map(t=>({element:t,area:pe(t)})).filter(({area:t})=>Number.isFinite(t)&&t>0);if(0===r.length)return null;return r.sort((t,r)=>"largest"===e?r.area-t.area:t.area-r.area)[0].element},fe=(t,e)=>{const r=Array.from(t.querySelectorAll("circle, ellipse, path"));return((t,e)=>{if(!t)return;if(!e.has(l.FILL)&&!e.has(l.STROKE))return;const r=J(t.getAttribute("fill")||ge(t,l.FILL)||""),o=J(t.getAttribute("stroke")||ge(t,l.STROKE)||"");return ae(r)?r:ae(o)?o:void 0})(ye(r,"smallest"),e)},be=t=>(t=>{if(t.length<2)return t;const e=t.slice(1),r=e.filter(t=>t.trim().length>0).reduce((t,e)=>{const r=e.match(/^\s*/)?.[0].length??0;return Math.min(t,r)},Number.POSITIVE_INFINITY);return!Number.isFinite(r)||r<=0?t.map(t=>t.trimEnd()):[t[0].trimEnd(),...e.map(t=>t.replace(new RegExp(`^\\s{0,${r}}`),"").trimEnd())]})(Array.isArray(t.label)?t.label.map(t=>F(t)):F(t.label||"").split("\n")).join("\n"),me=t=>{if(!t.description)return[];return(Array.isArray(t.description)?t.description:[t.description]).map(t=>F(t)).filter(t=>t.length>0)},xe=(t,e,r)=>{const o=r(t);if(!o)throw new Error(`State node element not found for "${t.id}"`);const n=((t,e)=>{switch(e){case"roundedWithTitle":case"rectWithTitle":return t.querySelector("rect.outer")||t.querySelector("rect")||t;case"divider":return t.querySelector("rect.divider")||t.querySelector("rect")||t;case"stateStart":case"stateEnd":return ye(Array.from(t.querySelectorAll("circle, ellipse, path")),"largest")||t;default:return t.querySelector("rect, path, circle, ellipse, polygon")||t}})(o,t.shape),s={},i={},c=[t.labelStyle,...t.cssCompiledStyles||[],...t.cssStyles||[]],d=(t=>{const e=new Set;return t.filter(Boolean).forEach(t=>{Q(t||"").forEach(({property:t})=>{e.add(t)})}),e})(c);c.filter(Boolean).forEach(t=>{((t,e,r)=>{t&&Q(t).forEach(({property:t,value:o})=>{le(e,t,o),ce(r,t,o)})})(t,s,i)}),((t,e,r)=>{if(!t)return;[[l.FILL,t.getAttribute("fill")],[l.STROKE,t.getAttribute("stroke")],[l.STROKE_WIDTH,t.getAttribute("stroke-width")],[l.STROKE_DASHARRAY,t.getAttribute("stroke-dasharray")]].forEach(([t,o])=>{if(!r.has(t))return;if(e[t])return;const n=J(o||"");n&&le(e,t,n)})})(n,s,d),((t,e,r)=>{if(!t)return;const o=[t,...Array.from(t.querySelectorAll("text, foreignObject, div, span, p"))];for(const t of o){if(e[a.COLOR])break;if((r.has(a.COLOR)||r.has(l.FILL))&&(de(t.getAttribute("style"),e),e[a.COLOR]))break;const o=J(t.getAttribute("fill")||t.getAttribute("color")||"");(r.has(a.COLOR)||r.has(l.FILL))&&ae(o)&&(e[a.COLOR]=o)}})(o,i,d);const u=((t,e)=>{const r=t.getBBox(),{tx:o,ty:n}=ue(t,e);return{x:r.x+o,y:r.y+n,width:r.width,height:r.height}})(n,e);return{id:t.id,shape:t.shape,text:be(t),description:me(t),x:u.x,y:u.y,width:u.width,height:u.height,parentId:t.parentId,position:t.position,containerStyle:s,labelStyle:i,dividerLine:"rectWithTitle"===t.shape?he(o,e):void 0,endInnerColor:"stateEnd"===t.shape?fe(o,d):void 0,isRenderable:"noteGroup"!==t.shape}},we=(t,e)=>{const r=e.querySelector(`[id='${t.id}']`);if(!r)return null;const{tx:o,ty:n}=ue(r,e),s=H(r,{x:o,y:n},"MCL");if(s.reflectionPoints.length<2)return null;const i={};[t.style].filter(Boolean).forEach(t=>{Q(t||"").forEach(({property:t,value:e})=>{((t,e)=>{switch(t){case l.STROKE:ae(e)&&(i.strokeColor=J(e));break;case l.STROKE_WIDTH:{const t=parseFloat(J(e));Number.isFinite(t)&&t>0&&(i.strokeWidth=t);break}case l.STROKE_DASHARRAY:J(e)&&(i.strokeStyle="dashed")}})(t,e)})});const a="none"===t.arrowhead||t.classes?.includes("note-edge");return{id:t.id,start:t.start,end:t.end,text:F(t.label||""),...s,strokeColor:i.strokeColor,strokeWidth:i.strokeWidth,strokeStyle:a?"dashed":i.strokeStyle,isNoteEdge:a}},Se=(t,e)=>{const{nodes:r,edges:o}=t.getData(),n=(t=>{const e=new Set,r=t=>(t&&e.add(t),t),o=t=>{const o=t.find(t=>!e.has(t));return r(o||null)};return e=>{const n=[`[id='${e.domId}']`,`[id='${e.id}']`,`[data-id='${e.id}']`];for(const e of n){const o=t.querySelector(e);if(o)return r(o)}switch(e.shape){case"divider":return o(Array.from(t.querySelectorAll("g.statediagram-cluster-alt")));case"stateStart":return o(Array.from(t.querySelectorAll("g.node.default")).filter(t=>t.querySelector("circle.state-start")));case"stateEnd":return o(Array.from(t.querySelectorAll("g.node.default")).filter(t=>!t.querySelector("circle.state-start")));default:return null}}})(e);return{type:"state",nodes:r.map(t=>xe(t,e,n)),edges:o.map(t=>we(t,e)).filter(t=>null!==t)}};let Ae=Promise.resolve();let ke=null,Ee=0;const ve=t=>{const e=t.querySelector("svg");if(!e)throw new Error("SVG element not found");const r=e.getBoundingClientRect(),o=r.width,n=r.height;e.setAttribute("width",`${o}`),e.setAttribute("height",`${n}`);const s=unescape(encodeURIComponent(e.outerHTML));return{type:"graphImage",mimeType:"image/svg+xml",dataURL:`data:image/svg+xml;base64,${btoa(s)}`,width:o,height:n}},Ce=async(t,e=n)=>(t=>{const e=Ae.then(t,t);return Ae=e.then(()=>{},()=>{}),e})(async()=>{const r=e.themeVariables?.fontSize??n.themeVariables.fontSize,o={...n,...e,fontSize:r,themeVariables:{...n.themeVariables,...e.themeVariables,fontSize:r}},s=(t=>JSON.stringify(t))(o);s!==ke&&(G.default.initialize(o),ke=s);const i=await G.default.mermaidAPI.getDiagramFromText((t=>{let e=t;return e=e.replace(/style.*:\S*#.*;/g,t=>t.substring(0,t.length-1)),e=e.replace(/classDef.*:\S*#.*;/g,t=>t.substring(0,t.length-1)),e=e.replace(/#\w+;/g,t=>{const e=t.substring(1,t.length-1);return/^\+?\d+$/.test(e)?`fl°°${e}¶ß`:`fl°${e}¶ß`}),e})(t)),a="mermaid-to-excalidraw-"+Ee++,l=document.createElement("div");l.setAttribute("style","opacity: 0; position: fixed; z-index: -1; left: -99999px; top: -99999px;");const c=`${a}-container`;l.id=c,document.getElementById(c)?.remove(),document.body.appendChild(l);try{const{svg:e}=await G.default.render(a,t,l);let r;l.innerHTML=e;try{switch(i.type){case"flowchart-v2":case"graph":r=pt(i.db,l);break;case"sequence":r=Rt(i,l);break;case"class":case"classDiagram":r=((t,e)=>{const r=t.db,o=r.getDirection?.()||"TB",n=[],s=[],i=[],a=[],l=r.getNamespaces?.()||[],c=r.getClasses?.()||{},d=c instanceof Map?Object.fromEntries(c):c;if(d&&Object.keys(d).length){const t="function"==typeof r.lookUpDomId?r.lookUpDomId.bind(r):void 0,o=Jt(d,e,t);n.push(o.nodes),s.push(...o.lines),i.push(...o.text),a.push(...o.nodes)}const u=r.getRelations?.()||[],{arrows:h,text:p}=Zt(u,a,e,o),g=r.getNotes?.()||[],{notes:y,connectors:f}=Qt(g,e,a);return n.push(y),h.push(...f),i.push(...p),{type:"class",nodes:n,lines:s,arrows:h,text:i,namespaces:l}})(i,l);break;case"er":r=((t,e)=>{const r=t.getData(),o=r.nodes,n=r.edges,s=[],i=[],a=[];o.forEach(t=>{const r=se(t,e);s.push(r.container),i.push(...r.lines),a.push(...r.text)});const l=n.map(t=>ie(t,e));return{type:"erd",nodes:[s],lines:i,arrows:l,text:a}})(i.db,l);break;case"state":case"stateDiagram":r=Se(i.db,l);break;default:r=ve(l)}}catch(t){console.error("Error processing Mermaid diagram:",t),r=ve(l)}return r}finally{l.remove()}}),Ie=async(t,e)=>{const r=e||{},o=parseInt(r.themeVariables?.fontSize??"")||20,n=await Ce(t,{...r,themeVariables:{...r.themeVariables}});return V(n,{fontSize:o})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6571],{77454(t,e,a){function r(t,e){t.accDescr&&e.setAccDescription?.(t.accDescr),t.accTitle&&e.setAccTitle?.(t.accTitle),t.title&&e.setDiagramTitle?.(t.title)}a.d(e,{S:()=>r}),(0,a(86827).K)(r,"populateCommonDb")},76571(t,e,a){a.d(e,{diagram:()=>z});var r=a(77454),n=a(5637),i=a(12505),s=a(86535),o=a(31293),l=a(86827),c=a(34376),d={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},g={axes:[],curves:[],options:d},u=structuredClone(g),p=s.UI.radar,h=(0,l.K)(()=>(0,i.$t)({...p,...(0,s.zj)().radar}),"getConfig"),x=(0,l.K)(()=>u.axes,"getAxes"),m=(0,l.K)(()=>u.curves,"getCurves"),$=(0,l.K)(()=>u.options,"getOptions"),f=(0,l.K)(t=>{u.axes=t.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),v=(0,l.K)(t=>{u.curves=t.map(t=>({name:t.name,label:t.label??t.name,entries:y(t.entries)}))},"setCurves"),y=(0,l.K)(t=>{if(null==t[0].axis)return t.map(t=>t.value);const e=x();if(0===e.length)throw new Error("Axes must be populated before curves for reference entries");return e.map(e=>{const a=t.find(t=>t.axis?.$refText===e.name);if(void 0===a)throw new Error("Missing entry for axis "+e.label);return a.value})},"computeCurveEntries"),w={getAxes:x,getCurves:m,getOptions:$,setAxes:f,setCurves:v,setOptions:(0,l.K)(t=>{const e=t.reduce((t,e)=>(t[e.name]=e,t),{});u.options={showLegend:e.showLegend?.value??d.showLegend,ticks:e.ticks?.value??d.ticks,max:e.max?.value??d.max,min:e.min?.value??d.min,graticule:e.graticule?.value??d.graticule},u.options.ticks>32&&(o.R.warn(`Radar diagram ticks (${u.options.ticks}) exceeds maximum allowed (32). Using 32 instead.`),u.options.ticks=32)},"setOptions"),getConfig:h,clear:(0,l.K)(()=>{(0,s.IU)(),u=structuredClone(g)},"clear"),setAccTitle:s.SV,getAccTitle:s.iN,setDiagramTitle:s.ke,getDiagramTitle:s.ab,getAccDescription:s.m7,setAccDescription:s.EI},b=(0,l.K)(t=>{(0,r.S)(t,w);const{axes:e,curves:a,options:n}=t;w.setAxes(e),w.setCurves(a),w.setOptions(n)},"populate"),C={parse:(0,l.K)(async t=>{const e=await(0,c.qg)("radar",t);o.R.debug(e),b(e)},"parse")},k=(0,l.K)((t,e,a,r)=>{const i=r.db,s=i.getAxes(),o=i.getCurves(),l=i.getOptions(),c=i.getConfig(),d=i.getDiagramTitle(),g=(0,n.D)(e),u=K(g,c),p=l.max??Math.max(...o.map(t=>Math.max(...t.entries))),h=l.min,x=Math.min(c.width,c.height)/2;M(u,s,x,l.ticks,l.graticule),L(u,s,x,c),T(u,s,o,h,p,l.graticule,c),S(u,o,l.showLegend,c),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),K=(0,l.K)((t,e)=>{const a=e.width+e.marginLeft+e.marginRight,r=e.height+e.marginTop+e.marginBottom,n=e.marginLeft+e.width/2,i=e.marginTop+e.height/2;return(0,s.a$)(t,r,a,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${a} ${r}`).attr("overflow","visible"),t.append("g").attr("transform",`translate(${n}, ${i})`)},"drawFrame"),M=(0,l.K)((t,e,a,r,n)=>{if("circle"===n)for(let e=0;e<r;e++){const n=a*(e+1)/r;t.append("circle").attr("r",n).attr("class","radarGraticule")}else if("polygon"===n){const n=e.length;for(let i=0;i<r;i++){const s=a*(i+1)/r,o=e.map((t,e)=>{const a=2*e*Math.PI/n-Math.PI/2;return`${s*Math.cos(a)},${s*Math.sin(a)}`}).join(" ");t.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),L=(0,l.K)((t,e,a,r)=>{const n=e.length;for(let i=0;i<n;i++){const s=e[i].label,o=2*i*Math.PI/n-Math.PI/2,l=Math.cos(o),c=Math.sin(o);t.append("line").attr("x1",0).attr("y1",0).attr("x2",a*r.axisScaleFactor*l).attr("y2",a*r.axisScaleFactor*c).attr("class","radarAxisLine");const d=l>.01?"start":l<-.01?"end":"middle",g=c>.01?"hanging":c<-.01?"auto":"central",u=4;t.append("text").text(s).attr("x",a*r.axisLabelFactor*l+u*l).attr("y",a*r.axisLabelFactor*c+u*c).attr("text-anchor",d).attr("dominant-baseline",g).attr("class","radarAxisLabel")}},"drawAxes");function T(t,e,a,r,n,i,s){const o=e.length,l=Math.min(s.width,s.height)/2;a.forEach((e,a)=>{if(e.entries.length!==o)return;const c=e.entries.map((t,e)=>{const a=2*Math.PI*e/o-Math.PI/2,i=A(t,r,n,l);return{x:i*Math.cos(a),y:i*Math.sin(a)}});"circle"===i?t.append("path").attr("d",O(c,s.curveTension)).attr("class",`radarCurve-${a}`):"polygon"===i&&t.append("polygon").attr("points",c.map(t=>`${t.x},${t.y}`).join(" ")).attr("class",`radarCurve-${a}`)})}function A(t,e,a,r){return r*(Math.min(Math.max(t,e),a)-e)/(a-e)}function O(t,e){const a=t.length;let r=`M${t[0].x},${t[0].y}`;for(let n=0;n<a;n++){const i=t[(n-1+a)%a],s=t[n],o=t[(n+1)%a],l=t[(n+2)%a],c={x:s.x+(o.x-i.x)*e,y:s.y+(o.y-i.y)*e},d={x:o.x-(l.x-s.x)*e,y:o.y-(l.y-s.y)*e};r+=` C${c.x},${c.y} ${d.x},${d.y} ${o.x},${o.y}`}return`${r} Z`}function S(t,e,a,r){if(!a)return;const n=3*(r.width/2+r.marginRight)/4,i=3*-(r.height/2+r.marginTop)/4;e.forEach((e,a)=>{const r=t.append("g").attr("transform",`translate(${n}, ${i+20*a})`);r.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${a}`),r.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(e.label)})}(0,l.K)(T,"drawCurves"),(0,l.K)(A,"relativeRadius"),(0,l.K)(O,"closedRoundCurve"),(0,l.K)(S,"drawLegend");var I={draw:k},D=(0,l.K)((t,e)=>{let a="";for(let r=0;r<t.THEME_COLOR_LIMIT;r++){const n=t[`cScale${r}`];a+=`\n\t\t.radarCurve-${r} {\n\t\t\tcolor: ${n};\n\t\t\tfill: ${n};\n\t\t\tfill-opacity: ${e.curveOpacity};\n\t\t\tstroke: ${n};\n\t\t\tstroke-width: ${e.curveStrokeWidth};\n\t\t}\n\t\t.radarLegendBox-${r} {\n\t\t\tfill: ${n};\n\t\t\tfill-opacity: ${e.curveOpacity};\n\t\t\tstroke: ${n};\n\t\t}\n\t\t`}return a},"genIndexStyles"),R=(0,l.K)(t=>{const e=(0,s.P$)(),a=(0,s.zj)(),r=(0,i.$t)(e,a.themeVariables);return{themeVariables:r,radarOptions:(0,i.$t)(r.radar,t)}},"buildRadarStyleOptions"),z={parser:C,db:w,renderer:I,styles:(0,l.K)(({radar:t}={})=>{const{themeVariables:e,radarOptions:a}=R(t);return`\n\t.radarTitle {\n\t\tfont-size: ${e.fontSize};\n\t\tcolor: ${e.titleColor};\n\t\tdominant-baseline: hanging;\n\t\ttext-anchor: middle;\n\t}\n\t.radarAxisLine {\n\t\tstroke: ${a.axisColor};\n\t\tstroke-width: ${a.axisStrokeWidth};\n\t}\n\t.radarAxisLabel {\n\t\tfont-size: ${a.axisLabelFontSize}px;\n\t\tcolor: ${a.axisColor};\n\t}\n\t.radarGraticule {\n\t\tfill: ${a.graticuleColor};\n\t\tfill-opacity: ${a.graticuleOpacity};\n\t\tstroke: ${a.graticuleColor};\n\t\tstroke-width: ${a.graticuleStrokeWidth};\n\t}\n\t.radarLegendText {\n\t\ttext-anchor: start;\n\t\tfont-size: ${a.legendFontSize}px;\n\t\tdominant-baseline: hanging;\n\t}\n\t${D(e,a)}\n\t`},"styles")}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6731],{96731(e,c,a){a.d(c,{createCynefinServices:()=>s.t});var s=a(41700);a(80369)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6759],{46759(e,a,c){c.d(a,{createWardleyServices:()=>s.J});var s=c(70656);c(80369)}}]);