@tobisk/codesafari 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/dist/content/frontmatter.js +9 -1
  2. package/dist/content/frontmatter.js.map +1 -1
  3. package/package.json +12 -9
  4. package/viewer-dist/assets/abnfDiagram-XWFEHMT6-C79KnTw8.js +1 -0
  5. package/viewer-dist/assets/arc-l-ZAXPJO.js +1 -0
  6. package/viewer-dist/assets/architecture-WOLXFQ4H-BgLy9Yqp.js +1 -0
  7. package/viewer-dist/assets/architectureDiagram-CSQXQB3N-TJ9cXrHq.js +36 -0
  8. package/viewer-dist/assets/blockDiagram-BEDRHYPZ-By3kvess.js +140 -0
  9. package/viewer-dist/assets/bpmnIcons-APHXDYXF-C0jbCElo.js +1 -0
  10. package/viewer-dist/assets/c4Diagram-M2UUVUY5-CEeFbn5F.js +38 -0
  11. package/viewer-dist/assets/chunk-2Q5K7J3B-DKYFIUDS.js +1 -0
  12. package/viewer-dist/assets/chunk-3BJB4PZV-D3hUDXSk.js +1 -0
  13. package/viewer-dist/assets/chunk-3GCGMST5-C9FeQipv.js +1 -0
  14. package/viewer-dist/assets/{chunk-5VM5RSS4-Zc4pbF2-.js → chunk-5VM5RSS4-CdmEoR_J.js} +2 -2
  15. package/viewer-dist/assets/chunk-7U7NFRK5-CTLlozLY.js +88 -0
  16. package/viewer-dist/assets/chunk-CNRTWJTD-Ccr1NK1L.js +1 -0
  17. package/viewer-dist/assets/chunk-D5HYT7QG-Bj30JPRv.js +1 -0
  18. package/viewer-dist/assets/chunk-EBZ3SEQC-Sk8u_9ep.js +2 -0
  19. package/viewer-dist/assets/chunk-JWPE2WC7-COMTgl4A.js +1 -0
  20. package/viewer-dist/assets/chunk-KTR4FSNJ-WfEV-uOS.js +1 -0
  21. package/viewer-dist/assets/chunk-VN5WK6U6-C6BzLJ3g.js +213 -0
  22. package/viewer-dist/assets/chunk-XXDRQBXY-B_jRWCc3.js +1 -0
  23. package/viewer-dist/assets/classDiagram-v2-IZLYA2OM-CMUybpF2.js +217 -0
  24. package/viewer-dist/assets/cose-bilkent-JH36ORCC-BPaMzy85.js +1 -0
  25. package/viewer-dist/assets/cynefin-EF2NZ3EQ-DWzUaEWi.js +1 -0
  26. package/viewer-dist/assets/cynefinDiagram-NJNITYFG-C8QaCQXp.js +62 -0
  27. package/viewer-dist/assets/cytoscape.esm-DTfjcSDB.js +321 -0
  28. package/viewer-dist/assets/dagre-KIHZ2IZ3-BOPsr9LQ.js +4 -0
  29. package/viewer-dist/assets/defaultLocale-DeDIAtVl.js +1 -0
  30. package/viewer-dist/assets/diagram-7YQZDPLS-mYVjZ8Lx.js +41 -0
  31. package/viewer-dist/assets/diagram-QBROCOUO-DvI2mJSr.js +200 -0
  32. package/viewer-dist/assets/diagram-RJJCUUZO-CUPJGu2H.js +30 -0
  33. package/viewer-dist/assets/diagram-WERXNKYE-LcjJC6e6.js +24 -0
  34. package/viewer-dist/assets/diagram-YHHI257C-CcytRL3C.js +3 -0
  35. package/viewer-dist/assets/diagram-YR4HJLHV-DSNAvpUg.js +24 -0
  36. package/viewer-dist/assets/ebnfDiagram-N527522P-DCRtXms7.js +1 -0
  37. package/viewer-dist/assets/elk-O5DQBFGD-DMI6Zpvy.js +27 -0
  38. package/viewer-dist/assets/erDiagram-GT5GOJPG-D1F-hqWB.js +99 -0
  39. package/viewer-dist/assets/eventmodeling-K75KTNOO-4qs67wAF.js +1 -0
  40. package/viewer-dist/assets/flowDiagram-JAYNFW54-7bC7dhfH.js +1 -0
  41. package/viewer-dist/assets/ganttDiagram-3PRQTZWP-c3vw-KzJ.js +292 -0
  42. package/viewer-dist/assets/gitGraph-VSP46ZUC-CFMJazMp.js +1 -0
  43. package/viewer-dist/assets/gitGraphDiagram-VXDFKS5L-CXwZYVtU.js +106 -0
  44. package/viewer-dist/assets/graphlib-7nQ5Ng6P.js +1 -0
  45. package/viewer-dist/assets/grid-E2QIVN74-ryRc6Wgk.js +1 -0
  46. package/viewer-dist/assets/index-BLTUQmtP.css +1 -0
  47. package/viewer-dist/assets/index-LgGsGSUh.js +398 -0
  48. package/viewer-dist/assets/info-OHQRW6UA-rYwbZW6Y.js +1 -0
  49. package/viewer-dist/assets/infoDiagram-ATMJ4U3S-qX5Cid2q.js +2 -0
  50. package/viewer-dist/assets/init-C-OQMol4.js +1 -0
  51. package/viewer-dist/assets/ishikawaDiagram-S3EKX5GW-CSUJfCgm.js +70 -0
  52. package/viewer-dist/assets/journeyDiagram-POQNLL5X--_T-gdww.js +139 -0
  53. package/viewer-dist/assets/kanban-definition-BH5XI6FM-BsWjihcO.js +89 -0
  54. package/viewer-dist/assets/katex-CePi8B18.js +257 -0
  55. package/viewer-dist/assets/linear-BjnGGdIE.js +1 -0
  56. package/viewer-dist/assets/mermaid-parser.core-D9IKLdIu.js +141 -0
  57. package/viewer-dist/assets/mindmap-definition-WVAN44T4-vxwY3Xnu.js +98 -0
  58. package/viewer-dist/assets/ordinal-BDEzSJ7C.js +1 -0
  59. package/viewer-dist/assets/packet-JDAUHWVQ-CEegYGRn.js +1 -0
  60. package/viewer-dist/assets/pegDiagram-D4NLKWP3-8tSu4Jqx.js +1 -0
  61. package/viewer-dist/assets/pie-XZMESJXO-exj595wL.js +1 -0
  62. package/viewer-dist/assets/pieDiagram-36ENHN4W-CNY-FqqW.js +39 -0
  63. package/viewer-dist/assets/quadrantDiagram-ZQUDMS73-CqGaRuIP.js +7 -0
  64. package/viewer-dist/assets/radar-ABXABTNO-CmxHfKAF.js +1 -0
  65. package/viewer-dist/assets/railroad-I3PHUGI6-DXY0-ZL-.js +1 -0
  66. package/viewer-dist/assets/railroad-abnf-LNEFI6M7-v-M60bY5.js +1 -0
  67. package/viewer-dist/assets/railroad-ebnf-DWYD2UWJ-C7Ubri5u.js +1 -0
  68. package/viewer-dist/assets/railroad-peg-JR7BVNR7-DpAM4Usk.js +1 -0
  69. package/viewer-dist/assets/railroadDiagram-JIZHGYPL-D6LbsW-D.js +1 -0
  70. package/viewer-dist/assets/render-VIF2ZAQL-B9RjOjNU.js +2 -0
  71. package/viewer-dist/assets/requirementDiagram-AXW2TVFA-FxNR3nZg.js +84 -0
  72. package/viewer-dist/assets/sankeyDiagram-FBCJTAIF-pSJfgdmf.js +40 -0
  73. package/viewer-dist/assets/sequenceDiagram-3LA2ROMG-R5T9FB-U.js +169 -0
  74. package/viewer-dist/assets/sizeCapture-2Q2CQKSF-BuZ6aVhF.js +1 -0
  75. package/viewer-dist/assets/stateDiagram-v2-XZFR63ZJ-y2ApNDME.js +291 -0
  76. package/viewer-dist/assets/swimlanes-YQL5WMAO-Dqbpsu6u.js +1 -0
  77. package/viewer-dist/assets/swimlanesDiagram-BA3ZWDFA-iEZapiU_.js +8 -0
  78. package/viewer-dist/assets/timeline-definition-7Z437IG3-DAxdChcP.js +120 -0
  79. package/viewer-dist/assets/treeView-D4JQ5SDB-DE5B8wLE.js +1 -0
  80. package/viewer-dist/assets/treemap-SAJKECNS-fnWCJ5Gb.js +1 -0
  81. package/viewer-dist/assets/usecaseDiagram-RDK6N6HP-bXXWy_jN.js +328 -0
  82. package/viewer-dist/assets/vennDiagram-SHRQU5PJ-CjOBjqdM.js +34 -0
  83. package/viewer-dist/assets/wardley-7MLQ67FV-COzPZ67W.js +1 -0
  84. package/viewer-dist/assets/wardleyDiagram-F3OXNVQS-BjHoJgg7.js +78 -0
  85. package/viewer-dist/assets/xychartDiagram-GDYJKCDI-CwJZcH_5.js +7 -0
  86. package/viewer-dist/index.html +2 -2
  87. package/viewer-dist/assets/abnfDiagram-VRR7QNED-CUtCPUcK.js +0 -1
  88. package/viewer-dist/assets/arc-DT1qPdzO.js +0 -1
  89. package/viewer-dist/assets/architectureDiagram-ZJ3FMSHR-Clz4_k6c.js +0 -36
  90. package/viewer-dist/assets/blockDiagram-677ZJIJ3-BprAT8ww.js +0 -132
  91. package/viewer-dist/assets/c4Diagram-LMCZKHZV-K4EFS-bi.js +0 -10
  92. package/viewer-dist/assets/channel-B6VWJVDA.js +0 -1
  93. package/viewer-dist/assets/chunk-2Q5K7J3B-wt4j9iAJ.js +0 -1
  94. package/viewer-dist/assets/chunk-32BRIVSS-DZndHhpA.js +0 -1
  95. package/viewer-dist/assets/chunk-EX3LRPZG-D150rsiB.js +0 -231
  96. package/viewer-dist/assets/chunk-JWPE2WC7-CnWGcCgD.js +0 -1
  97. package/viewer-dist/assets/chunk-MOJQB5TN-CNNkBqHI.js +0 -88
  98. package/viewer-dist/assets/chunk-RYQCIY6F-BohP8cpF.js +0 -1
  99. package/viewer-dist/assets/chunk-V7JOEXUC-O8PMb1tP.js +0 -206
  100. package/viewer-dist/assets/chunk-VR4S4FIN-AjltP-MY.js +0 -1
  101. package/viewer-dist/assets/chunk-XXDRQBXY-BOvzmjQv.js +0 -1
  102. package/viewer-dist/assets/classDiagram-OUVF2IWQ-7lFY7hbW.js +0 -1
  103. package/viewer-dist/assets/classDiagram-v2-EOCWNBFH-7lFY7hbW.js +0 -1
  104. package/viewer-dist/assets/cose-bilkent-JH36ORCC-BI5sbJIe.js +0 -1
  105. package/viewer-dist/assets/cynefin-VYW2F7L2-DsqQ6c-8.js +0 -178
  106. package/viewer-dist/assets/cynefinDiagram-TSTJHNR4-aSrdlJhs.js +0 -62
  107. package/viewer-dist/assets/cytoscape.esm-CUqq0XTU.js +0 -331
  108. package/viewer-dist/assets/dagre-VKFMJZFB-C1JJb4il.js +0 -4
  109. package/viewer-dist/assets/defaultLocale-DX6XiGOO.js +0 -1
  110. package/viewer-dist/assets/diagram-FQU43EPY-bqnjeq9L.js +0 -3
  111. package/viewer-dist/assets/diagram-G47NLZAW-CI_3tBI7.js +0 -24
  112. package/viewer-dist/assets/diagram-NH7WQ7WH--Cuuj_l0.js +0 -24
  113. package/viewer-dist/assets/diagram-OA4YK3LP-Ber9CxgW.js +0 -30
  114. package/viewer-dist/assets/diagram-WEI45ONY-DA4LRa2G.js +0 -41
  115. package/viewer-dist/assets/ebnfDiagram-CCIWWBDH-BWw30PPO.js +0 -1
  116. package/viewer-dist/assets/erDiagram-Q63AITRT-CvTYXHZZ.js +0 -85
  117. package/viewer-dist/assets/flowDiagram-23GEKE2U-Jzg6zox9.js +0 -156
  118. package/viewer-dist/assets/ganttDiagram-NO4QXBWP-DXxub_Mn.js +0 -292
  119. package/viewer-dist/assets/gitGraphDiagram-IHSO6WYX-DplAVHS7.js +0 -106
  120. package/viewer-dist/assets/graph-C2PyVmSI.js +0 -1
  121. package/viewer-dist/assets/index-DVLkX2-Z.css +0 -1
  122. package/viewer-dist/assets/index-MwqpmjOm.js +0 -430
  123. package/viewer-dist/assets/infoDiagram-FWYZ7A6U-Df_ey2Yt.js +0 -2
  124. package/viewer-dist/assets/init-Gi6I4Gst.js +0 -1
  125. package/viewer-dist/assets/ishikawaDiagram-FXEZZL3T-C68vhFVb.js +0 -70
  126. package/viewer-dist/assets/journeyDiagram-5HDEW3XC-CoDmHoV3.js +0 -139
  127. package/viewer-dist/assets/kanban-definition-HUTT4EX6-B6r0jwQw.js +0 -89
  128. package/viewer-dist/assets/katex-C5jXJg4s.js +0 -257
  129. package/viewer-dist/assets/layout-HEHzrzvT.js +0 -1
  130. package/viewer-dist/assets/linear-DIoMe8rR.js +0 -1
  131. package/viewer-dist/assets/map-BQHxRNoK.js +0 -1
  132. package/viewer-dist/assets/mindmap-definition-LN4V7U3C-Bnswylok.js +0 -96
  133. package/viewer-dist/assets/ordinal-Cboi1Yqb.js +0 -1
  134. package/viewer-dist/assets/pegDiagram-2B236MQR-DIN1FTnX.js +0 -1
  135. package/viewer-dist/assets/pieDiagram-ENE6RG2P-CprqMtkw.js +0 -39
  136. package/viewer-dist/assets/quadrantDiagram-ABIIQ3AL-BDDULhdJ.js +0 -7
  137. package/viewer-dist/assets/railroadDiagram-RFXS5EU6-DYchCzqc.js +0 -1
  138. package/viewer-dist/assets/requirementDiagram-TGXJPOKE-C5wnr9uO.js +0 -84
  139. package/viewer-dist/assets/sankeyDiagram-HTMAVEWB-DkwntNXb.js +0 -40
  140. package/viewer-dist/assets/sequenceDiagram-DBY2YBRQ-CjDmNFC_.js +0 -162
  141. package/viewer-dist/assets/sizeCapture-X5ZJPWSS-DPuxDmrs.js +0 -1
  142. package/viewer-dist/assets/stateDiagram-2N3HPSRC-BYVZZo-M.js +0 -1
  143. package/viewer-dist/assets/stateDiagram-v2-6OUMAXLB-BRXNY8_F.js +0 -1
  144. package/viewer-dist/assets/swimlanes-5IMT3BWC-GXmz8FzP.js +0 -2
  145. package/viewer-dist/assets/swimlanesDiagram-G3AALYLV-Gfb32vBV.js +0 -8
  146. package/viewer-dist/assets/timeline-definition-FHXFAJF6-CQLwZsEX.js +0 -120
  147. package/viewer-dist/assets/vennDiagram-L72KCM5P-DZt4sGqU.js +0 -34
  148. package/viewer-dist/assets/wardleyDiagram-EHGQE667-7OXN_C-l.js +0 -78
  149. package/viewer-dist/assets/xychartDiagram-FW5EYKEG-rI5CAM0A.js +0 -7
@@ -0,0 +1,4 @@
1
+ import{a as e,c as t,i as n,l as r,r as i,s as a,t as o}from"./chunk-EBZ3SEQC-Sk8u_9ep.js";import{D as s,E as c,M as l,Qn as u,S as d,Tn as f,g as p,l as m,tr as h,u as g,w as ee}from"./index-LgGsGSUh.js";import{$ as _,A as v,B as y,C as b,D as x,E as te,F as ne,G as re,H as S,I as ie,J as ae,K as oe,L as se,M as ce,N as le,O as ue,P as C,Q as w,R as de,S as fe,T as pe,U as me,V as he,W as ge,X as _e,Y as ve,Z as T,_ as ye,a as E,b as be,c as xe,d as Se,et as Ce,f as D,g as we,h as Te,i as O,it as Ee,j as De,k as Oe,l as ke,m as Ae,n as k,nt as je,o as A,p as Me,q as Ne,r as j,rt as Pe,s as Fe,t as M,tt as N,u as Ie,v as Le,w as Re,x as ze,y as Be,z as P}from"./graphlib-7nQ5Ng6P.js";var Ve=/\s/;function He(e){for(var t=e.length;t--&&Ve.test(e.charAt(t)););return t}var Ue=/^\s+/;function We(e){return e&&e.slice(0,He(e)+1).replace(Ue,``)}var Ge=NaN,Ke=/^[-+]0x[0-9a-f]+$/i,qe=/^0b[01]+$/i,Je=/^0o[0-7]+$/i,Ye=parseInt;function Xe(e){if(typeof e==`number`)return e;if(Ce(e))return Ge;if(T(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=T(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=We(e);var n=qe.test(e);return n||Je.test(e)?Ye(e.slice(2),n?2:8):Ke.test(e)?Ge:+e}var Ze=1/0,Qe=17976931348623157e292;function F(e){return e?(e=Xe(e),e===Ze||e===-Ze?(e<0?-1:1)*Qe:e===e?e:0):e===0?e:0}function $e(e){var t=F(e),n=t%1;return t===t?n?t-n:t:0}var et=Object.create,tt=function(){function e(){}return function(t){if(!T(t))return{};if(et)return et(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function nt(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}function I(e,t,n){t==`__proto__`&&Ne?Ne(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var rt=Object.prototype.hasOwnProperty;function L(e,t,n){var r=e[t];(!(rt.call(e,t)&&S(r,n))||n===void 0&&!(t in e))&&I(e,t,n)}function R(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?I(n,s,c):L(n,s,c)}return n}function z(e,t,n){if(!T(n))return!1;var r=typeof t;return(r==`number`?P(n)&&me(t,n.length):r==`string`&&t in n)?S(n[t],e):!1}function it(e){return y(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&z(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}function at(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var ot=Object.prototype.hasOwnProperty;function st(e){if(!T(e))return at(e);var t=de(e),n=[];for(var r in e)(r!=`constructor`||!t&&ot.call(e,r))&&n.push(r);return n}function B(e){return P(e)?ce(e,!0):st(e)}function V(e){return e!=null&&e.length?b(e,1):[]}function ct(e){return oe(he(e,void 0,V),e+``)}var lt=De(Object.getPrototypeOf,Object),ut=`[object Object]`,dt=Function.prototype,ft=Object.prototype,pt=dt.toString,mt=ft.hasOwnProperty,ht=pt.call(Object);function gt(e){if(!N(e)||je(e)!=ut)return!1;var t=lt(e);if(t===null)return!0;var n=mt.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&pt.call(n)==ht}var _t=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function vt(e){return _t.test(e)}function yt(e,t){return e&&R(t,Oe(t),e)}function bt(e,t){return e&&R(t,B(t),e)}var xt=typeof exports==`object`&&exports&&!exports.nodeType&&exports,St=xt&&typeof module==`object`&&module&&!module.nodeType&&module,Ct=St&&St.exports===xt?Ee.Buffer:void 0,wt=Ct?Ct.allocUnsafe:void 0;function Tt(e,t){if(t)return e.slice();var n=e.length,r=wt?wt(n):new e.constructor(n);return e.copy(r),r}function Et(e,t){return R(e,be(e),t)}var Dt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Re(t,be(e)),e=lt(e);return t}:ze;function Ot(e,t){return R(e,Dt(e),t)}function kt(e){return Be(e,B,Dt)}var At=Object.prototype.hasOwnProperty;function jt(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&At.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function Mt(e){var t=new e.constructor(e.byteLength);return new we(t).set(new we(e)),t}function Nt(e,t){var n=t?Mt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Pt=/\w*$/;function Ft(e){var t=new e.constructor(e.source,Pt.exec(e));return t.lastIndex=e.lastIndex,t}var It=Pe?Pe.prototype:void 0,Lt=It?It.valueOf:void 0;function Rt(e){return Lt?Object(Lt.call(e)):{}}function zt(e,t){var n=t?Mt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Bt=`[object Boolean]`,Vt=`[object Date]`,Ht=`[object Map]`,Ut=`[object Number]`,Wt=`[object RegExp]`,Gt=`[object Set]`,Kt=`[object String]`,qt=`[object Symbol]`,Jt=`[object ArrayBuffer]`,Yt=`[object DataView]`,Xt=`[object Float32Array]`,Zt=`[object Float64Array]`,Qt=`[object Int8Array]`,$t=`[object Int16Array]`,en=`[object Int32Array]`,tn=`[object Uint8Array]`,nn=`[object Uint8ClampedArray]`,rn=`[object Uint16Array]`,an=`[object Uint32Array]`;function on(e,t,n){var r=e.constructor;switch(t){case Jt:return Mt(e);case Bt:case Vt:return new r(+e);case Yt:return Nt(e,n);case Xt:case Zt:case Qt:case $t:case en:case tn:case nn:case rn:case an:return zt(e,n);case Ht:return new r;case Ut:case Kt:return new r(e);case Wt:return Ft(e);case Gt:return new r;case qt:return Rt(e)}}function sn(e){return typeof e.constructor==`function`&&!de(e)?tt(lt(e)):{}}var cn=`[object Map]`;function ln(e){return N(e)&&ye(e)==cn}var un=C&&C.isMap,dn=un?ne(un):ln,fn=`[object Set]`;function pn(e){return N(e)&&ye(e)==fn}var mn=C&&C.isSet,hn=mn?ne(mn):pn,gn=1,_n=2,vn=4,yn=`[object Arguments]`,bn=`[object Array]`,xn=`[object Boolean]`,Sn=`[object Date]`,Cn=`[object Error]`,wn=`[object Function]`,Tn=`[object GeneratorFunction]`,En=`[object Map]`,Dn=`[object Number]`,On=`[object Object]`,kn=`[object RegExp]`,An=`[object Set]`,jn=`[object String]`,Mn=`[object Symbol]`,Nn=`[object WeakMap]`,Pn=`[object ArrayBuffer]`,Fn=`[object DataView]`,In=`[object Float32Array]`,Ln=`[object Float64Array]`,Rn=`[object Int8Array]`,zn=`[object Int16Array]`,Bn=`[object Int32Array]`,Vn=`[object Uint8Array]`,Hn=`[object Uint8ClampedArray]`,Un=`[object Uint16Array]`,Wn=`[object Uint32Array]`,H={};H[yn]=H[bn]=H[Pn]=H[Fn]=H[xn]=H[Sn]=H[In]=H[Ln]=H[Rn]=H[zn]=H[Bn]=H[En]=H[Dn]=H[On]=H[kn]=H[An]=H[jn]=H[Mn]=H[Vn]=H[Hn]=H[Un]=H[Wn]=!0,H[Cn]=H[wn]=H[Nn]=!1;function U(e,t,n,r,i,a){var o,s=t&gn,c=t&_n,l=t&vn;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!T(e))return e;var u=w(e);if(u){if(o=jt(e),!s)return nt(e,o)}else{var d=ye(e),f=d==wn||d==Tn;if(ie(e))return Tt(e,s);if(d==On||d==yn||f&&!i){if(o=c||f?{}:sn(e),!s)return c?Ot(e,bt(o,e)):Et(e,yt(o,e))}else{if(!H[d])return i?e:{};o=on(e,d,s)}}a||=new fe;var p=a.get(e);if(p)return p;a.set(e,o),hn(e)?e.forEach(function(r){o.add(U(r,t,n,r,e,a))}):dn(e)&&e.forEach(function(r,i){o.set(i,U(r,t,n,i,e,a))});var m=u?void 0:(l?c?kt:Le:c?B:Oe)(e);return re(m||e,function(r,i){m&&(i=r,r=e[i]),L(o,i,U(r,t,n,i,e,a))}),o}var Gn=1,Kn=4;function qn(e){return U(e,Gn|Kn)}var Jn=function(){return Ee.Date.now()},Yn=Object.prototype,Xn=Yn.hasOwnProperty,Zn=y(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&z(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],o=B(a),s=-1,c=o.length;++s<c;){var l=o[s],u=e[l];(u===void 0||S(u,Yn[l])&&!Xn.call(e,l))&&(e[l]=a[l])}return e});function Qn(e,t,n){(n!==void 0&&!S(e[t],n)||n===void 0&&!(t in e))&&I(e,t,n)}function $n(e,t){if((t!==`constructor`||typeof e[t]!=`function`)&&t!=`__proto__`)return e[t]}function er(e){return R(e,B(e))}function tr(e,t,n,r,i,a,o){var s=$n(e,n),c=$n(t,n),l=o.get(c);if(l)Qn(e,n,l);else{var u=a?a(s,c,n+``,e,t,o):void 0,d=u===void 0;if(d){var f=w(c),p=!f&&ie(c),m=!f&&!p&&le(c);u=c,f||p||m?w(s)?u=s:xe(s)?u=nt(s):p?(d=!1,u=Tt(c,!0)):m?(d=!1,u=zt(c,!0)):u=[]:gt(c)||se(c)?(u=s,se(s)?u=er(s):(!T(s)||ve(s))&&(u=sn(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),Qn(e,n,u)}}function nr(e,t,n,r,i){e!==t&&Se(t,function(a,o){if(i||=new fe,T(a))tr(e,t,o,n,nr,r,i);else{var s=r?r($n(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),Qn(e,o,s)}},B)}function W(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function rr(e){return function(t,n,r){var i=Object(t);if(!P(t)){var a=D(n,3);t=Oe(t),n=function(e){return a(i[e],e,i)}}var o=e(t,n,r);return o>-1?i[a?t[o]:o]:void 0}}var ir=Math.max;function ar(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:$e(n);return i<0&&(i=ir(r+i,0)),ge(e,D(t,3),i)}var or=rr(ar);function sr(e,t){var n=-1,r=P(e)?Array(e.length):[];return ke(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function G(e,t){return(w(e)?_:sr)(e,D(t,3))}function cr(e,t){return e==null?e:Se(e,Fe(t),B)}function lr(e,t){return e&&Ie(e,Fe(t))}function ur(e,t){return e>t}var dr=Object.prototype.hasOwnProperty;function fr(e,t){return e!=null&&dr.call(e,t)}function pr(e,t){return e!=null&&Te(e,t,fr)}var mr=`[object String]`;function hr(e){return typeof e==`string`||!w(e)&&N(e)&&je(e)==mr}function gr(e,t){return e<t}function K(e,t){var n={};return t=D(t,3),Ie(e,function(e,r,i){I(n,r,t(e,r,i))}),n}function _r(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(s===void 0?o===o&&!Ce(o):n(o,s)))var s=o,c=a}return c}function q(e){return e&&e.length?_r(e,_e,ur):void 0}var vr=it(function(e,t,n){nr(e,t,n)});function J(e){return e&&e.length?_r(e,_e,gr):void 0}function yr(e,t){return e&&e.length?_r(e,D(t,2),gr):void 0}function br(e,t,n,r){if(!T(e))return e;t=x(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=te(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var u=s[c];l=r?r(u,c,s):void 0,l===void 0&&(l=T(u)?u:me(t[i+1])?[]:{})}L(s,c,l),s=s[c]}return e}function xr(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=pe(e,o);n(s,o)&&br(a,x(o,e),s)}return a}function Sr(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Cr(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=Ce(e),o=t!==void 0,s=t===null,c=t===t,l=Ce(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}function wr(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=Cr(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Tr(e,t,n){t=t.length?_(t,function(e){return w(e)?function(t){return pe(t,e.length===1?e[0]:e)}:e}):[_e];var r=-1;return t=_(t,ne(D)),Sr(sr(e,function(e,n,i){return{criteria:_(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return wr(e,t,n)})}var Er=Me(`length`),Dr=`\\ud800-\\udfff`,Or=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,kr=`\\ufe0e\\ufe0f`,Ar=`[`+Dr+`]`,jr=`[`+Or+`]`,Mr=`\\ud83c[\\udffb-\\udfff]`,Nr=`(?:`+jr+`|`+Mr+`)`,Pr=`[^`+Dr+`]`,Fr=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Ir=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Lr=`\\u200d`,Rr=Nr+`?`,zr=`[`+kr+`]?`,Br=`(?:`+Lr+`(?:`+[Pr,Fr,Ir].join(`|`)+`)`+zr+Rr+`)*`,Vr=zr+Rr+Br,Hr=`(?:`+[Pr+jr+`?`,jr,Fr,Ir,Ar].join(`|`)+`)`,Ur=RegExp(Mr+`(?=`+Mr+`)|`+Hr+Vr,`g`);function Wr(e){for(var t=Ur.lastIndex=0;Ur.test(e);)++t;return t}function Gr(e){return vt(e)?Wr(e):Er(e)}function Kr(e,t){return xr(e,t,function(t,n){return Ae(e,n)})}var qr=ct(function(e,t){return e==null?{}:Kr(e,t)}),Jr=Math.ceil,Yr=Math.max;function Xr(e,t,n,r){for(var i=-1,a=Yr(Jr((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function Zr(e){return function(t,n,r){return r&&typeof r!=`number`&&z(t,n,r)&&(n=r=void 0),t=F(t),n===void 0?(n=t,t=0):n=F(n),r=r===void 0?t<n?1:-1:F(r),Xr(t,n,r,e)}}var Y=Zr(),Qr=`[object Map]`,$r=`[object Set]`;function ei(e){if(e==null)return 0;if(P(e))return hr(e)?Gr(e):e.length;var t=ye(e);return t==Qr||t==$r?e.size:v(e).length}var X=y(function(e,t){if(e==null)return[];var n=t.length;return n>1&&z(e,t[0],t[1])?t=[]:n>2&&z(t[0],t[1],t[2])&&(t=[t[0]]),Tr(e,b(t,1),[])}),ti=0;function ni(e){var t=++ti;return ue(e)+t}function ri(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r<i;){var s=r<a?t[r]:void 0;n(o,e[r],s)}return o}function ii(e,t){return ri(e||[],t||[],L)}var ai=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return oi(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&oi(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,si)),n=n._prev;return`[`+e.join(`, `)+`]`}};function oi(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function si(e,t){if(e!==`_next`&&e!==`_prev`)return t}var ci=ae(1);function li(e,t){if(e.nodeCount()<=1)return[];var n=fi(e,t||ci);return V(G(ui(n.graph,n.buckets,n.zeroIdx),function(t){return e.outEdges(t.v,t.w)}))}function ui(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)di(e,t,n,o);for(;o=i.dequeue();)di(e,t,n,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){r=r.concat(di(e,t,n,o,!0));break}}}return r}function di(e,t,n,r,i){var a=i?[]:void 0;return A(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,pi(t,n,s)}),A(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,pi(t,n,o)}),e.removeNode(r.v),a}function fi(e,t){var n=new M,r=0,i=0;A(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),A(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=Y(i+r+3).map(function(){return new ai}),o=r+1;return A(n.nodes(),function(e){pi(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function pi(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function mi(e){var t=e.graph().acyclicer===`greedy`?li(e,n(e)):hi(e);A(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,ni(`rev`))});function n(e){return function(t){return e.edge(t).weight}}}function hi(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,A(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return A(e.nodes(),i),t}function gi(e){A(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Z(e,t,n,r){var i;do i=ni(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function _i(e){var t=new M().setGraph(e.graph());return A(e.nodes(),function(n){t.setNode(n,e.node(n))}),A(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function vi(e){var t=new M({multigraph:e.isMultigraph()}).setGraph(e.graph());return A(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),A(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function yi(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function bi(e){var t=G(Y(wi(e)+1),function(){return[]});return A(e.nodes(),function(n){var r=e.node(n),i=r.rank;j(i)||(t[i][r.order]=n)}),t}function xi(e){var t=J(G(e.nodes(),function(t){return e.node(t).rank}));A(e.nodes(),function(n){var r=e.node(n);pr(r,`rank`)&&(r.rank-=t)})}function Si(e){var t=J(G(e.nodes(),function(t){return e.node(t).rank})),n=[];A(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;A(n,function(t,n){j(t)&&n%i!==0?--r:r&&A(t,function(t){e.node(t).rank+=r})})}function Ci(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Z(e,`border`,i,t)}function wi(e){return q(G(e.nodes(),function(t){var n=e.node(t).rank;if(!j(n))return n}))}function Ti(e,t){var n={lhs:[],rhs:[]};return A(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Ei(e,t){var n=Jn();try{return t()}finally{console.log(e+` time: `+(Jn()-n)+`ms`)}}function Di(e,t){return t()}function Oi(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&A(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)ki(e,`borderLeft`,`_bl`,n,i,a),ki(e,`borderRight`,`_br`,n,i,a)}}A(e.children(),t)}function ki(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=Z(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Ai(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&Mi(e)}function ji(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&Pi(e),(t===`lr`||t===`rl`)&&(Ii(e),Mi(e))}function Mi(e){A(e.nodes(),function(t){Ni(e.node(t))}),A(e.edges(),function(t){Ni(e.edge(t))})}function Ni(e){var t=e.width;e.width=e.height,e.height=t}function Pi(e){A(e.nodes(),function(t){Fi(e.node(t))}),A(e.edges(),function(t){var n=e.edge(t);A(n.points,Fi),Object.prototype.hasOwnProperty.call(n,`y`)&&Fi(n)})}function Fi(e){e.y=-e.y}function Ii(e){A(e.nodes(),function(t){Li(e.node(t))}),A(e.edges(),function(t){var n=e.edge(t);A(n.points,Li),Object.prototype.hasOwnProperty.call(n,`x`)&&Li(n)})}function Li(e){var t=e.x;e.x=e.y,e.y=t}function Ri(e){e.graph().dummyChains=[],A(e.edges(),function(t){zi(e,t)})}function zi(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a!==r+1){e.removeEdge(t);var l=void 0,u,d=0;for(++r;r<a;++d,++r)s.points=[],l={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},u=Z(e,`edge`,l,`_d`),r===c&&(l.width=s.width,l.height=s.height,l.dummy=`edge-label`,l.labelpos=s.labelpos),e.setEdge(n,u,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,i,{weight:s.weight},o)}}function Bi(e){A(e.graph().dummyChains,function(t){var n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function Vi(e){var t={};function n(r){var i=e.node(r);if(Object.prototype.hasOwnProperty.call(t,r))return i.rank;t[r]=!0;var a=J(G(e.outEdges(r),function(t){return n(t.w)-e.edge(t).minlen}));return(a===1/0||a==null)&&(a=0),i.rank=a}A(e.sources(),n)}function Q(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function Hi(e){var t=new M({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;Ui(t,e)<r;)i=Wi(t,e),a=t.hasNode(i.v)?Q(e,i):-Q(e,i),Gi(t,e,a);return t}function Ui(e,t){function n(r){A(t.nodeEdges(r),function(i){var a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!Q(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return A(e.nodes(),n),e.nodeCount()}function Wi(e,t){return yr(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return Q(t,n)})}function Gi(e,t,n){A(e.nodes(),function(e){t.node(e).rank+=n})}ae(1),ae(1),Ki.CycleException=qi;function Ki(e){var t={},n={},r=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new qi;Object.prototype.hasOwnProperty.call(t,a)||(n[a]=!0,t[a]=!0,A(e.predecessors(a),i),delete n[a],r.push(a))}if(A(e.sinks(),i),ei(t)!==e.nodeCount())throw new qi;return r}function qi(){}qi.prototype=Error();function Ji(e,t,n){w(t)||(t=[t]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return A(t,function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);Yi(e,t,n===`post`,a,r,i)}),i}function Yi(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),A(i(t),function(t){Yi(e,t,n,r,i,a)}),n&&a.push(t))}function Xi(e,t){return Ji(e,t,`post`)}function Zi(e,t){return Ji(e,t,`pre`)}$.initLowLimValues=ta,$.initCutValues=Qi,$.calcCutValue=ea,$.leaveEdge=ra,$.enterEdge=ia,$.exchangeEdges=aa;function $(e){e=_i(e),Vi(e);var t=Hi(e);ta(t),Qi(t,e);for(var n,r;n=ra(t);)r=ia(t,e,n),aa(t,e,n,r)}function Qi(e,t){var n=Xi(e,e.nodes());n=n.slice(0,n.length-1),A(n,function(n){$i(e,t,n)})}function $i(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=ea(e,t,n)}function ea(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,A(t.nodeEdges(n),function(a){var s=a.v===n,c=s?a.w:a.v;if(c!==r){var l=s===i,u=t.edge(a).weight;if(o+=l?u:-u,sa(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function ta(e,t){arguments.length<2&&(t=e.nodes()[0]),na(e,{},1,t)}function na(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,A(e.neighbors(r),function(i){Object.prototype.hasOwnProperty.call(t,i)||(n=na(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function ra(e){return or(e.edges(),function(t){return e.edge(t).cutvalue<0})}function ia(e,t,n){var r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);var a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),yr(E(t.edges(),function(t){return c===ca(e,e.node(t.v),s)&&c!==ca(e,e.node(t.w),s)}),function(e){return Q(t,e)})}function aa(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),ta(e),Qi(e,t),oa(e,t)}function oa(e,t){var n=Zi(e,or(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),A(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function sa(e,t,n){return e.hasEdge(t,n)}function ca(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function la(e){switch(e.graph().ranker){case`network-simplex`:fa(e);break;case`tight-tree`:da(e);break;case`longest-path`:ua(e);break;default:fa(e)}}var ua=Vi;function da(e){Vi(e),Hi(e)}function fa(e){$(e)}function pa(e){var t=Z(e,`root`,{},`_root`),n=ha(e),r=q(O(n))-1,i=2*r+1;e.graph().nestingRoot=t,A(e.edges(),function(t){e.edge(t).minlen*=i});var a=ga(e)+1;A(e.children(),function(o){ma(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function ma(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length)o!==t&&e.setEdge(t,o,{weight:0,minlen:n});else{var c=Ci(e,`_bt`),l=Ci(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,A(s,function(s){ma(e,t,n,r,i,a,s);var u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}}function ha(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&A(a,function(e){n(e,i+1)}),t[r]=i}return A(e.children(),function(e){n(e,1)}),t}function ga(e){return k(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function _a(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,A(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function va(e,t,n){var r={},i;A(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function ya(e,t,n){var r=ba(e),i=new M({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return A(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),A(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=j(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function ba(e){for(var t;e.hasNode(t=ni(`_root`)););return t}function xa(e,t){for(var n=0,r=1;r<t.length;++r)n+=Sa(e,t[r-1],t[r]);return n}function Sa(e,t,n){for(var r=ii(n,G(n,function(e,t){return t})),i=V(G(t,function(t){return X(G(e.outEdges(t),function(t){return{pos:r[t.w],weight:e.edge(t).weight}}),`pos`)})),a=1;a<n.length;)a<<=1;var o=2*a-1;--a;var s=G(Array(o),function(){return 0}),c=0;return A(i.forEach(function(e){var t=e.pos+a;s[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function Ca(e){var t={},n=E(e.nodes(),function(t){return!e.children(t).length}),r=G(Y(q(G(n,function(t){return e.node(t).rank}))+1),function(){return[]});function i(n){pr(t,n)||(t[n]=!0,r[e.node(n).rank].push(n),A(e.successors(n),i))}var a=X(n,function(t){return e.node(t).rank});return A(a,i),r}function wa(e,t){return G(t,function(t){var n=e.inEdges(t);if(n.length){var r=k(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})}function Ta(e,t){var n={};return A(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};j(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),A(t.edges(),function(e){var t=n[e.v],r=n[e.w];!j(t)&&!j(r)&&(r.indegree++,t.out.push(n[e.w]))}),Ea(E(n,function(e){return!e.indegree}))}function Ea(e){var t=[];function n(e){return function(t){t.merged||(j(t.barycenter)||j(e.barycenter)||t.barycenter>=e.barycenter)&&Da(e,t)}}function r(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),A(i.in.reverse(),n(i)),A(i.out,r(i))}return G(E(t,function(e){return!e.merged}),function(e){return qr(e,[`vs`,`i`,`barycenter`,`weight`])})}function Da(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Oa(e,t){var n=Ti(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=X(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(Aa(!!t)),c=ka(a,i,c),A(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=ka(a,i,c)});var l={vs:V(a)};return s&&(l.barycenter=o/s,l.weight=s),l}function ka(e,t,n){for(var r;t.length&&(r=W(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Aa(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}function ja(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=E(i,function(e){return e!==o&&e!==s}));var l=wa(e,i);A(l,function(t){if(e.children(t.v).length){var i=ja(e,t.v,n,r);c[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&Na(t,i)}});var u=Ta(l,n);Ma(u,c);var d=Oa(u,r);if(o&&(d.vs=V([o,d.vs,s]),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function Ma(e,t){A(e,function(e){e.vs=V(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function Na(e,t){j(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Pa(e){var t=wi(e),n=Fa(e,Y(1,t+1),`inEdges`),r=Fa(e,Y(t-1,-1,-1),`outEdges`),i=Ca(e);La(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){Ia(s%2?n:r,s%4>=2),i=bi(e);var l=xa(e,i);l<a&&(c=0,o=qn(i),a=l)}La(e,o)}function Fa(e,t,n){return G(t,function(t){return ya(e,t,n)})}function Ia(e,t){var n=new M;A(e,function(e){var r=ja(e,e.graph().root,n,t);A(r.vs,function(t,n){e.node(t).order=n}),va(e,n,r.vs)})}function La(e,t){A(t,function(t){A(t,function(t,n){e.node(t).order=n})})}function Ra(e){var t=Ba(e);A(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=za(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(n,l),n=e.successors(n)[0]}})}function za(e,t,n,r){var i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c=n,l;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Ba(e){var t={},n=0;function r(i){var a=n;A(e.children(i),r),t[i]={low:a,lim:n++}}return A(e.children(),r),t}function Va(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=W(r);return A(r,function(t,c){var l=Ua(e,t),u=l?e.node(l).order:o;(l||t===s)&&(A(r.slice(a,c+1),function(t){A(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&Wa(n,r,t)})}),a=c+1,i=u)}),r}return k(t,r),n}function Ha(e,t){var n={};function r(t,r,i,a,o){var s;A(Y(r,i),function(r){s=t[r],e.node(s).dummy&&A(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Wa(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return A(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return k(t,i),n}function Ua(e,t){if(e.node(t).dummy)return or(e.predecessors(t),function(t){return e.node(t).dummy})}function Wa(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ga(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Ka(e,t,n,r){var i={},a={},o={};return A(t,function(e){A(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),A(t,function(e){var t=-1;A(e,function(e){var s=r(e);if(s.length){s=X(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t<o[d]&&!Ga(n,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=o[d])}}})}),{root:i,align:a}}function qa(e,t,n,r,i){var a={},o=Ja(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}function l(e){a[e]=o.inEdges(e).reduce(function(e,t){return Math.max(e,a[t.v]+o.edge(t))},0)}function u(t){var n=o.outEdges(t).reduce(function(e,t){return Math.min(e,a[t.w]-o.edge(t))},1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),A(r,function(e){a[e]=a[n[e]]}),a}function Ja(e,t,n,r){var i=new M,a=e.graph(),o=$a(a.nodesep,a.edgesep,r);return A(t,function(t){var r;A(t,function(t){var a=n[t];if(i.setNode(a),r){var s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function Ya(e,t){return yr(O(t),function(t){var n=-1/0,r=1/0;return cr(t,function(t,i){var a=eo(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function Xa(e,t){var n=O(t),r=J(n),i=q(n);A([`u`,`d`],function(n){A([`l`,`r`],function(a){var o=n+a,s=e[o],c;if(s!==t){var l=O(s);c=a===`l`?r-J(l):i-q(l),c&&(e[o]=K(s,function(e){return e+c}))}})})}function Za(e,t){return K(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=X(G(e,r));return(i[1]+i[2])/2})}function Qa(e){var t=bi(e),n=vr(Va(e,t),Ha(e,t)),r={},i;return A([`u`,`d`],function(a){i=a===`u`?t:O(t).reverse(),A([`l`,`r`],function(t){t===`r`&&(i=G(i,function(e){return O(e).reverse()}));var o=(a===`u`?e.predecessors:e.successors).bind(e),s=Ka(e,i,n,o),c=qa(e,i,s.root,s.align,t===`r`);t===`r`&&(c=K(c,function(e){return-e})),r[a+t]=c})}),Xa(r,Ya(e,r)),Za(r,e.graph().align)}function $a(e,t,n){return function(r,i,a){var o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.prototype.hasOwnProperty.call(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.prototype.hasOwnProperty.call(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),l=0,c}}function eo(e,t){return e.node(t).width}function to(e){e=vi(e),no(e),lr(Qa(e),function(t,n){e.node(n).x=t})}function no(e){var t=bi(e),n=e.graph().ranksep,r=0;A(t,function(t){var i=q(G(t,function(t){return e.node(t).height}));A(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}function ro(e,t){var n=t&&t.debugTiming?Ei:Di;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>ho(e));n(` runLayout`,()=>io(t,n)),n(` updateInputGraph`,()=>ao(e,t))})}function io(e,t){t(` makeSpaceForEdgeLabels`,()=>go(e)),t(` removeSelfEdges`,()=>To(e)),t(` acyclic`,()=>mi(e)),t(` nestingGraph.run`,()=>pa(e)),t(` rank`,()=>la(vi(e))),t(` injectEdgeLabelProxies`,()=>_o(e)),t(` removeEmptyRanks`,()=>Si(e)),t(` nestingGraph.cleanup`,()=>_a(e)),t(` normalizeRanks`,()=>xi(e)),t(` assignRankMinMax`,()=>vo(e)),t(` removeEdgeLabelProxies`,()=>yo(e)),t(` normalize.run`,()=>Ri(e)),t(` parentDummyChains`,()=>Ra(e)),t(` addBorderSegments`,()=>Oi(e)),t(` order`,()=>Pa(e)),t(` insertSelfEdges`,()=>Eo(e)),t(` adjustCoordinateSystem`,()=>Ai(e)),t(` position`,()=>to(e)),t(` positionSelfEdges`,()=>Do(e)),t(` removeBorderNodes`,()=>wo(e)),t(` normalize.undo`,()=>Bi(e)),t(` fixupEdgeLabelCoords`,()=>So(e)),t(` undoCoordinateSystem`,()=>ji(e)),t(` translateGraph`,()=>bo(e)),t(` assignNodeIntersects`,()=>xo(e)),t(` reversePoints`,()=>Co(e)),t(` acyclic.undo`,()=>gi(e))}function ao(e,t){A(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),A(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var oo=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],so={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},co=[`acyclicer`,`ranker`,`rankdir`,`align`],lo=[`width`,`height`],uo={width:0,height:0},fo=[`minlen`,`weight`,`width`,`height`,`labeloffset`],po={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},mo=[`labelpos`];function ho(e){var t=new M({multigraph:!0,compound:!0}),n=ko(e.graph());return t.setGraph(vr({},so,Oo(n,oo),qr(n,co))),A(e.nodes(),function(n){var r=ko(e.node(n));t.setNode(n,Zn(Oo(r,lo),uo)),t.setParent(n,e.parent(n))}),A(e.edges(),function(n){var r=ko(e.edge(n));t.setEdge(n,vr({},po,Oo(r,fo),qr(r,mo)))}),t}function go(e){var t=e.graph();t.ranksep/=2,A(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function _o(e){A(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);Z(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function vo(e){var t=0;A(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=q(t,r.maxRank))}),e.graph().maxRank=t}function yo(e){A(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function bo(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}A(e.nodes(),function(t){c(e.node(t))}),A(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,A(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),A(e.edges(),function(n){var i=e.edge(n);A(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function xo(e){A(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(yi(r,a)),n.points.push(yi(i,o))})}function So(e){A(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function Co(e){A(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function wo(e){A(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(W(n.borderLeft)),o=e.node(W(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),A(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function To(e){A(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Eo(e){var t=bi(e);A(t,function(t){var n=0;A(t,function(t,r){var i=e.node(t);i.order=r+n,A(i.selfEdges,function(t){Z(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Do(e){A(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Oo(e,t){return K(qr(e,t),Number)}function ko(e){var t={};return A(e,function(e,n){t[n.toLowerCase()]=e}),t}var Ao=h((e,t,n)=>Math.max(t,Math.min(n,e)),`clamp`),jo=h((e=`TB`)=>{switch(e){case`BT`:return`bottom`;case`LR`:return`right`;case`RL`:return`left`;default:return`top`}},`getDefaultSelfLoopSide`),Mo=h(e=>e===`flowchart`||e===`flowchart-v2`||e===`stateDiagram`||e===`er`||e===`classDiagram`,`shouldMergeSelfLoopSegments`),No=[`x`,`y`,`width`,`height`,`labelBBox`,`intersect`,`calcIntersect`,`diff`,`clusterNode`],Po=h((e,t,n,r,i)=>{let a=[],o=new Set;if(n.forEach(({start:e,end:t})=>{e!==r&&o.add(e),t!==r&&o.add(t)}),o.forEach(t=>{let n=e.node(t);typeof n?.x==`number`&&typeof n?.y==`number`&&a.push(n)}),a.length===0&&n.forEach(({edge:e})=>{(e.points??[]).forEach(e=>{typeof e?.x==`number`&&typeof e?.y==`number`&&a.push(e)})}),a.length===0)return jo(i);let s=a.reduce((e,t)=>({x:e.x+t.x/a.length,y:e.y+t.y/a.length}),{x:0,y:0}),c=s.x-t.x,l=s.y-t.y;return Math.abs(c)>Math.abs(l)?c>0?`right`:`left`:Math.abs(l)>0?l>0?`bottom`:`top`:jo(i)},`getSelfLoopSide`),Fo=h((e,t=`top`,n=0,r=0)=>{let i=e.x,a=e.y-n,o=e.width/2,s=e.height/2,c=Math.max(36,Math.min(100,e.width*.8)),l=Ao(Math.max(r,e.width*.35),36,c),u=Ao(Math.min(e.width,e.height)*.45,24,48);switch(t){case`bottom`:{let e=a+s;return[{x:i-l/2,y:e},{x:i-l/2,y:e+u},{x:i+l/2,y:e+u},{x:i+l/2,y:e}]}case`right`:{let e=i+o;return[{x:e,y:a-l/2},{x:e+u,y:a-l/2},{x:e+u,y:a+l/2},{x:e,y:a+l/2}]}case`left`:{let e=i-o;return[{x:e,y:a-l/2},{x:e-u,y:a-l/2},{x:e-u,y:a+l/2},{x:e,y:a+l/2}]}default:{let e=a-s;return[{x:i-l/2,y:e},{x:i-l/2,y:e-u},{x:i+l/2,y:e-u},{x:i+l/2,y:e}]}}},`getSelfLoopPoints`),Io=h((e,t,n=`top`,r=0,i={})=>{let a=e.x,o=e.y-r,s=i.width??0,c=i.height??0;switch(n){case`bottom`:return{x:a,y:Math.max(...t.map(e=>e.y))+c/2+4};case`right`:return{x:Math.max(...t.map(e=>e.x))+s/2+4,y:o};case`left`:return{x:Math.min(...t.map(e=>e.x))-s/2-4,y:o};default:return{x:a,y:Math.min(...t.map(e=>e.y))-c/2-4}}},`getSelfLoopLabelPosition`),Lo=h((e,t=0,{mergeSelfLoops:n=!0}={})=>{let r=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(t=>{let a=e.edge(t);if(n&&a.selfLoop){let e=a.selfLoop.id;r.has(e)||r.set(e,[]),r.get(e).push({edge:a,start:t.v,end:t.w})}else i.push({edge:a,start:t.v,end:t.w})}),r.forEach(n=>{if(n.length!==3){n.forEach(e=>i.push(e));return}n.sort((e,t)=>e.edge.selfLoop.order-t.edge.selfLoop.order);let[r,o,s]=n,c=r.edge.originalEdge??o.edge.originalEdge??s.edge.originalEdge??o.edge,l=e.node(c.start);if(!l){n.forEach(e=>i.push(e));return}let u={width:o.edge.width,height:o.edge.height},d=Po(e,l,n,c.start,a),f=Fo(l,d,t,u.width??0),p=Io(l,f,d,t,u),m={...o.edge,...c,id:c.id,points:f,start:c.start,end:c.end,x:p.x,y:p.y,width:u.width,height:u.height,labelStyle:o.edge.labelStyle,fromCluster:r.edge.fromCluster??o.edge.fromCluster??s.edge.fromCluster,toCluster:r.edge.toCluster??o.edge.toCluster??s.edge.toCluster};delete m.selfLoop,delete m.originalEdge,i.push({edge:m,start:m.start,end:m.end})}),i},`getEdgesToRender`),Ro=h(async({element:n,graph:r,diagramType:o,id:c,parentCluster:d,siteConfig:f})=>{let p=r.graph().rankdir;u.trace(`Dir in recursive render - dir:`,p);let{clusters:m,edgePaths:_,edgeLabels:v,nodes:y,rootGroups:b}=e(n,{edgePathsClass:`edgePaths`});r.nodes()?u.info(`Recursive render XXX`,r.nodes()):u.info(`No nodes found for`,r),r.edges().length>0&&u.info(`Recursive edges`,r.edge(r.edges()[0]));let x=Mo(o);await Promise.all(r.nodes().map(async function(e){let n=r.node(e);if(d!==void 0){let t=JSON.parse(JSON.stringify(d.clusterData));u.trace(`Setting data for parent cluster XXX
2
+ Node.id = `,e,`
3
+ data=`,t.height,`
4
+ Parent cluster`,d.height),r.setNode(d.id,t),r.parent(e)||(u.trace(`Setting parent`,e,d.id),r.setParent(e,d.id,t))}if(u.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(r.node(e))),n?.clusterNode){u.info(`Cluster identified XBX`,e,n.width,r.node(e));let{ranksep:t,nodesep:i}=r.graph();n.graph.setGraph({...n.graph.graph(),ranksep:t+25,nodesep:i});let a=await Go({element:y,graph:n.graph,diagramType:o,id:c,parentCluster:r.node(e),siteConfig:f}),d=a.elem;l(n,d),n.diff=a.diff||0,u.info(`New compound node after recursive render XAX`,e,`width`,n.width,`height`,n.height),s(d,n)}else r.children(e).length>0?(u.trace(`Cluster - the non recursive path XBX`,e,n.id,n,n.width,`Graph:`,r),u.trace(a(n.id,r)),i.set(n.id,{id:a(n.id,r),node:n})):(u.trace(`Node - the non recursive path XAX`,e,y,r.node(e),p),await t(y,r.node(e),{config:f,dir:p}))})),await h(async()=>{let e=r.edges().map(async function(e){let t=r.edge(e.v,e.w,e.name);if(u.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),u.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(r.edge(e))),u.info(`Fix`,i,`ids:`,e.v,e.w,`Translating: `,i.get(e.v),i.get(e.w)),x&&t.selfLoop){if(t.selfLoop.order!==1)return;let e={...t.originalEdge,...t,id:t.selfLoop.id,startLabelLeft:t.originalEdge?.startLabelLeft??t.startLabelLeft,startLabelRight:t.originalEdge?.startLabelRight??t.startLabelRight,endLabelLeft:t.originalEdge?.endLabelLeft??t.endLabelLeft,endLabelRight:t.originalEdge?.endLabelRight??t.endLabelRight};await g(v,e),t.width=e.width,t.height=e.height,t.labelStyle=e.labelStyle}else await g(v,t)});await Promise.all(e)},`processEdges`)();let{subGraphTitleTotalMargin:te}=ee(f);return{elem:b,graph:r,groups:{clusters:m,edgePaths:_,edgeLabels:v,nodes:y,rootGroups:b},diagramType:o,id:c,mergeSelfLoops:x,subGraphTitleTotalMargin:te}},`measureDagreGraph`),zo=h(e=>{u.info(`############################################# XXX`),u.info(`### Layout ### XXX`),u.info(`############################################# XXX`),ro(e)},`runDagreGraphLayout`),Bo=h((e,t,n)=>{let r=e.node(t);if(!r)return;let i={...r};return r?.clusterNode?i.y=(r.y??0)+n:e.children(t).length>0?i.height=(r.height??0)+n:i.y=(r.y??0)+n/2,i},`normalizeDagreNode`),Vo=h((e,t)=>{No.forEach(n=>{t[n]!==void 0&&(e[n]=t[n])})},`applyDagreNodeLayout`),Ho=h((e,t,n,r)=>({...e,start:e.start??t,end:e.end??n,points:(e.points??[]).map(e=>({...e,y:typeof e.y==`number`?e.y+r:e.y}))}),`normalizeDagreEdge`),Uo=h((e,t)=>{let{graph:n,mergeSelfLoops:i,subGraphTitleTotalMargin:a=0}=t,o=new Map(e.nodes.map(e=>[e.id,e]));r(n).forEach(e=>{let t=Bo(n,e,a);if(!t)return;Vo(n.node(e),t);let r=o.get(e);r&&Vo(r,t)});let s=a/2;return e.edges=Lo(n,s,{mergeSelfLoops:i}).map(({edge:e,start:t,end:n})=>Ho(e,t,n,s)),e},`applyDagreLayoutResult`),Wo=h(async({elem:e,graph:t,groups:{clusters:n,edgePaths:a},diagramType:o,id:s,mergeSelfLoops:l,subGraphTitleTotalMargin:f})=>{let h=0;await Promise.all(r(t).map(async function(e){let r=t.node(e);if(u.info(`Position XBX => `+e+`: (`+r.x,`,`+r.y,`) width: `,r.width,` height: `,r.height),r?.clusterNode)r.y+=f,u.info(`A tainted cluster node XBX1`,e,r.id,r.width,r.height,r.x,r.y,t.parent(e)),i.get(r.id).node=r,c(r);else if(t.children(e).length>0){u.info(`A pure cluster node XBX1`,e,r.id,r.x,r.y,r.width,r.height,t.parent(e)),r.height+=f,t.node(r.parentId);let a=r?.padding/2||0,o=r?.labelBBox?.height||0,s=o-a||0;u.debug(`OffsetY`,s,`labelHeight`,o,`halfPadding`,a),await d(n,r),i.get(r.id).node=r}else{let e=t.node(r.parentId);r.y+=f/2,u.info(`A regular node XBX1 - using the padding`,r.id,`parent`,r.parentId,r.width,r.height,r.x,r.y,`offsetY`,r.offsetY,`parent`,e,e?.offsetY,r),c(r)}}));let g=f/2;return Lo(t,g,{mergeSelfLoops:l}).forEach(function({edge:e,start:n,end:r}){u.info(`Edge `+n+` -> `+r+`: `+JSON.stringify(e),e),e.points.forEach(e=>e.y+=g);let c=t.node(n),l=t.node(r),d=m(a,e,i,o,c,l,s);p(e,d)}),t.nodes().forEach(function(e){let n=t.node(e);u.info(e,n.type,n.diff),n.isGroup&&(h=n.diff)}),u.warn(`Returning from recursive render XAX`,e,h),{elem:e,diff:h}},`paintDagreLayoutCore`),Go=h(async e=>{let t=await Ro(e);return zo(t.graph),await Wo(t)},`renderDagreSubgraph`),Ko=h(e=>{let t=new M({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(e=>{t.setNode(e.id,{...e}),e.parentId&&t.setParent(e.id,e.parentId)}),u.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let n=e.start,r=n+`---`+n+`---1`,i=n+`---`+n+`---2`,a=t.node(n);t.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),t.setParent(r,a.parentId),t.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),t.setParent(i,a.parentId);let o=structuredClone(e),s=structuredClone(e),c=structuredClone(e),l=structuredClone(e);s.originalEdge=o,s.selfLoop={id:o.id,order:0},c.originalEdge=o,c.selfLoop={id:o.id,order:1},l.originalEdge=o,l.selfLoop={id:o.id,order:2},s.label=``,s.arrowTypeEnd=`none`,s.endLabelLeft=``,s.endLabelRight=``,s.startLabelLeft=``,s.id=n+`-cyclic-special-1`,c.startLabelRight=``,c.startLabelLeft=``,c.endLabelLeft=``,c.endLabelRight=``,c.arrowTypeStart=`none`,c.arrowTypeEnd=`none`,c.id=n+`-cyclic-special-mid`,l.label=``,l.startLabelRight=``,l.startLabelLeft=``,l.arrowTypeStart=`none`,a.isGroup&&(s.fromCluster=n,l.toCluster=n),l.id=n+`-cyclic-special-2`,l.arrowTypeStart=`none`,t.setEdge(n,r,s,n+`-cyclic-special-0`),t.setEdge(r,i,c,n+`-cyclic-special-1`),t.setEdge(i,n,l,n+`-cyclic-special-2`)}else t.setEdge(e.start,e.end,{...e},e.id)}),o(t),{graph:t}},`prepareLayoutForDagre`),qo=h(async(e,{element:t,preparedLayout:n})=>{let r=n??Ko(e),i=f(),a=await Ro({element:t,graph:r.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:i});return r.measuredLayout=a,a},`measureDagreLayout`),Jo=h((e,t)=>{let n=t.preparedLayout?.measuredLayout;if(!n)throw Error(`runDagreLayoutCore requires measureDagreLayout to run first`);return zo(n.graph),Uo(e,n),n},`runDagreLayoutCore`),Yo=n({prepareLayout:Ko,measureLayout:qo,runLayoutCore:Jo,paintOptions:{clusterDb:i,getNodes:h((e,{measure:t})=>r(t.graph).map(e=>t.graph.node(e)).filter(Boolean),`getDagrePaintNodes`),getEdgeNode:h((e,t,{measure:n})=>e?n.graph.node(e):void 0,`getDagreEdgeNode`),skipNode:h((e,{measure:t})=>!t.graph.hasNode(e.id),`skipNode`),isCluster:h((e,{measure:t})=>t.graph.hasNode(e.id)&&(t.graph.children(e.id)??[]).length>0,`isCluster`)}});export{Uo as applyDagreLayoutResult,Lo as getEdgesToRender,qo as measureDagreLayout,Ko as prepareLayoutForDagre,Yo as render,Jo as runDagreLayoutCore,Mo as shouldMergeSelfLoopSegments};
@@ -0,0 +1 @@
1
+ function e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function t(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function n(e){return e=t(Math.abs(e)),e?e[1]:NaN}function r(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function i(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(e){if(!(t=a.exec(e)))throw Error(`invalid format: `+e);var t;return new s({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}o.prototype=s.prototype;function s(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function c(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var l;function u(e,n){var r=t(e,n);if(!r)return l=void 0,e.toPrecision(n);var i=r[0],a=r[1],o=a-(l=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,s=i.length;return o===s?i:o>s?i+Array(o-s+1).join(`0`):o>0?i.slice(0,o)+`.`+i.slice(o):`0.`+Array(1-o).join(`0`)+t(e,Math.max(0,n+o-1))[0]}function d(e,n){var r=t(e,n);if(!r)return e+``;var i=r[0],a=r[1];return a<0?`0.`+Array(-a).join(`0`)+i:i.length>a+1?i.slice(0,a+1)+`.`+i.slice(a+1):i+Array(a-i.length+2).join(`0`)}var f={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:e,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>d(e*100,t),r:d,s:u,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function p(e){return e}var m=Array.prototype.map,h=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function g(e){var t=e.grouping===void 0||e.thousands===void 0?p:r(m.call(e.grouping,Number),e.thousands+``),a=e.currency===void 0?``:e.currency[0]+``,s=e.currency===void 0?``:e.currency[1]+``,u=e.decimal===void 0?`.`:e.decimal+``,d=e.numerals===void 0?p:i(m.call(e.numerals,String)),g=e.percent===void 0?`%`:e.percent+``,_=e.minus===void 0?`−`:e.minus+``,v=e.nan===void 0?`NaN`:e.nan+``;function y(e,n){e=o(e);var r=e.fill,i=e.align,p=e.sign,m=e.symbol,y=e.zero,b=e.width,x=e.comma,S=e.precision,C=e.trim,w=e.type;w===`n`?(x=!0,w=`g`):f[w]||(S===void 0&&(S=12),C=!0,w=`g`),(y||r===`0`&&i===`=`)&&(y=!0,r=`0`,i=`=`);var T=(n&&n.prefix!==void 0?n.prefix:``)+(m===`$`?a:m===`#`&&/[boxX]/.test(w)?`0`+w.toLowerCase():``),E=(m===`$`?s:/[%p]/.test(w)?g:``)+(n&&n.suffix!==void 0?n.suffix:``),D=f[w],O=/[defgprs%]/.test(w);S=S===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function k(e){var n=T,a=E,o,s,f;if(w===`c`)a=D(e)+a,e=``;else{e=+e;var m=e<0||1/e<0;if(e=isNaN(e)?v:D(Math.abs(e),S),C&&(e=c(e)),m&&+e==0&&p!==`+`&&(m=!1),n=(m?p===`(`?p:_:p===`-`||p===`(`?``:p)+n,a=(w===`s`&&!isNaN(e)&&l!==void 0?h[8+l/3]:``)+a+(m&&p===`(`?`)`:``),O){for(o=-1,s=e.length;++o<s;)if(f=e.charCodeAt(o),48>f||f>57){a=(f===46?u+e.slice(o+1):e.slice(o))+a,e=e.slice(0,o);break}}}x&&!y&&(e=t(e,1/0));var g=n.length+e.length+a.length,k=g<b?Array(b-g+1).join(r):``;switch(x&&y&&(e=t(k+e,k.length?b-a.length:1/0),k=``),i){case`<`:e=n+e+a+k;break;case`=`:e=n+k+e+a;break;case`^`:e=k.slice(0,g=k.length>>1)+n+e+a+k.slice(g);break;default:e=k+n+e+a}return d(e)}return k.toString=function(){return e+``},k}function b(e,t){var r=Math.max(-8,Math.min(8,Math.floor(n(t)/3)))*3,i=10**-r,a=y((e=o(e),e.type=`f`,e),{suffix:h[8+r/3]});return function(e){return a(i*e)}}return{format:y,formatPrefix:b}}var _,v,y;b({thousands:`,`,grouping:[3],currency:[`$`,``]});function b(e){return _=g(e),v=_.format,y=_.formatPrefix,_}export{n as i,y as n,o as r,v as t};
@@ -0,0 +1,41 @@
1
+ import{t as e}from"./chunk-JWPE2WC7-COMTgl4A.js";import{Bn as t,Cn as n,Dn as r,En as i,It as a,Ln as o,Qn as s,Rn as c,Sn as l,V as u,gn as d,tr as f,wn as p,xn as m,yn as h}from"./index-LgGsGSUh.js";import{n as g}from"./mermaid-parser.core-D9IKLdIu.js";var _={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`},v=32,y={axes:[],curves:[],options:_},b=structuredClone(y),x=m.radar,S=f(()=>u({...x,...p().radar}),`getConfig`),C=f(()=>b.axes,`getAxes`),w=f(()=>b.curves,`getCurves`),T=f(()=>b.options,`getOptions`),E=f(e=>{b.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},`setAxes`),D=f(e=>{b.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:O(e.entries)}))},`setCurves`),O=f(e=>{if(e[0].axis==null)return e.map(e=>e.value);let t=C();if(t.length===0)throw Error(`Axes must be populated before curves for reference entries`);return t.map(t=>{let n=e.find(e=>e.axis?.$refText===t.name);if(n===void 0)throw Error(`Missing entry for axis `+t.label);return n.value})},`computeCurveEntries`),k={getAxes:C,getCurves:w,getOptions:T,setAxes:E,setCurves:D,setOptions:f(e=>{let t=e.reduce((e,t)=>(e[t.name]=t,e),{});b.options={showLegend:t.showLegend?.value??_.showLegend,ticks:t.ticks?.value??_.ticks,max:t.max?.value??_.max,min:t.min?.value??_.min,graticule:t.graticule?.value??_.graticule},b.options.ticks>v&&(s.warn(`Radar diagram ticks (${b.options.ticks}) exceeds maximum allowed (${v}). Using ${v} instead.`),b.options.ticks=v)},`setOptions`),getConfig:S,clear:f(()=>{d(),b=structuredClone(y)},`clear`),setAccTitle:c,getAccTitle:n,setDiagramTitle:t,getDiagramTitle:i,getAccDescription:l,setAccDescription:o},A=f(t=>{e(t,k);let{axes:n,curves:r,options:i}=t;k.setAxes(n),k.setCurves(r),k.setOptions(i)},`populate`),j={parse:f(async e=>{let t=await g(`radar`,e);s.debug(t),A(t)},`parse`)},M=f((e,t,n,r)=>{let i=r.db,o=i.getAxes(),s=i.getCurves(),c=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),d=N(a(t),l),f=c.max??Math.max(...s.map(e=>Math.max(...e.entries))),p=c.min,m=Math.min(l.width,l.height)/2;P(d,o,m,c.ticks,c.graticule),F(d,o,m,l),I(d,o,s,p,f,c.graticule,l),z(d,s,c.showLegend,l),d.append(`text`).attr(`class`,`radarTitle`).text(u).attr(`x`,0).attr(`y`,-l.height/2-l.marginTop)},`draw`),N=f((e,t)=>{let n=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return h(e,r,n,t.useMaxWidth??!0),e.attr(`viewBox`,`0 0 ${n} ${r}`).attr(`overflow`,`visible`),e.append(`g`).attr(`transform`,`translate(${i.x}, ${i.y})`)},`drawFrame`),P=f((e,t,n,r,i)=>{if(i===`circle`)for(let t=0;t<r;t++){let i=n*(t+1)/r;e.append(`circle`).attr(`r`,i).attr(`class`,`radarGraticule`)}else if(i===`polygon`){let i=t.length;for(let a=0;a<r;a++){let o=n*(a+1)/r,s=t.map((e,t)=>{let n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(` `);e.append(`polygon`).attr(`points`,s).attr(`class`,`radarGraticule`)}}},`drawGraticule`),F=f((e,t,n,r)=>{let i=t.length;for(let a=0;a<i;a++){let o=t[a].label,s=2*a*Math.PI/i-Math.PI/2,c=Math.cos(s),l=Math.sin(s);e.append(`line`).attr(`x1`,0).attr(`y1`,0).attr(`x2`,n*r.axisScaleFactor*c).attr(`y2`,n*r.axisScaleFactor*l).attr(`class`,`radarAxisLine`);let u=c>.01?`start`:c<-.01?`end`:`middle`,d=l>.01?`hanging`:l<-.01?`auto`:`central`;e.append(`text`).text(o).attr(`x`,n*r.axisLabelFactor*c+4*c).attr(`y`,n*r.axisLabelFactor*l+4*l).attr(`text-anchor`,u).attr(`dominant-baseline`,d).attr(`class`,`radarAxisLabel`)}},`drawAxes`);function I(e,t,n,r,i,a,o){let s=t.length,c=Math.min(o.width,o.height)/2;n.forEach((t,n)=>{if(t.entries.length!==s)return;let l=t.entries.map((e,t)=>{let n=2*Math.PI*t/s-Math.PI/2,a=L(e,r,i,c);return{x:a*Math.cos(n),y:a*Math.sin(n)}});a===`circle`?e.append(`path`).attr(`d`,R(l,o.curveTension)).attr(`class`,`radarCurve-${n}`):a===`polygon`&&e.append(`polygon`).attr(`points`,l.map(e=>`${e.x},${e.y}`).join(` `)).attr(`class`,`radarCurve-${n}`)})}f(I,`drawCurves`);function L(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}f(L,`relativeRadius`);function R(e,t){let n=e.length,r=`M${e[0].x},${e[0].y}`;for(let i=0;i<n;i++){let a=e[(i-1+n)%n],o=e[i],s=e[(i+1)%n],c=e[(i+2)%n],l={x:o.x+(s.x-a.x)*t,y:o.y+(s.y-a.y)*t},u={x:s.x-(c.x-o.x)*t,y:s.y-(c.y-o.y)*t};r+=` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`}return`${r} Z`}f(R,`closedRoundCurve`);function z(e,t,n,r){if(!n)return;let i=(r.width/2+r.marginRight)*3/4,a=-(r.height/2+r.marginTop)*3/4;t.forEach((t,n)=>{let r=e.append(`g`).attr(`transform`,`translate(${i}, ${a+n*20})`);r.append(`rect`).attr(`width`,12).attr(`height`,12).attr(`class`,`radarLegendBox-${n}`),r.append(`text`).attr(`x`,16).attr(`y`,0).attr(`class`,`radarLegendText`).text(t.label)})}f(z,`drawLegend`);var B={draw:M},V=f((e,t)=>{let n=``;for(let r=0;r<e.THEME_COLOR_LIMIT;r++){let i=e[`cScale${r}`];n+=`
2
+ .radarCurve-${r} {
3
+ color: ${i};
4
+ fill: ${i};
5
+ fill-opacity: ${t.curveOpacity};
6
+ stroke: ${i};
7
+ stroke-width: ${t.curveStrokeWidth};
8
+ }
9
+ .radarLegendBox-${r} {
10
+ fill: ${i};
11
+ fill-opacity: ${t.curveOpacity};
12
+ stroke: ${i};
13
+ }
14
+ `}return n},`genIndexStyles`),H=f(e=>{let t=r(),n=p(),i=u(t,n.themeVariables);return{themeVariables:i,radarOptions:u(i.radar,e)}},`buildRadarStyleOptions`),U={parser:j,db:k,renderer:B,styles:f(({radar:e}={})=>{let{themeVariables:t,radarOptions:n}=H(e);return`
15
+ .radarTitle {
16
+ font-size: ${t.fontSize};
17
+ color: ${t.titleColor};
18
+ dominant-baseline: hanging;
19
+ text-anchor: middle;
20
+ }
21
+ .radarAxisLine {
22
+ stroke: ${n.axisColor};
23
+ stroke-width: ${n.axisStrokeWidth};
24
+ }
25
+ .radarAxisLabel {
26
+ font-size: ${n.axisLabelFontSize}px;
27
+ color: ${n.axisColor};
28
+ }
29
+ .radarGraticule {
30
+ fill: ${n.graticuleColor};
31
+ fill-opacity: ${n.graticuleOpacity};
32
+ stroke: ${n.graticuleColor};
33
+ stroke-width: ${n.graticuleStrokeWidth};
34
+ }
35
+ .radarLegendText {
36
+ text-anchor: start;
37
+ font-size: ${n.legendFontSize}px;
38
+ dominant-baseline: hanging;
39
+ }
40
+ ${V(t,n)}
41
+ `},`styles`)};export{U as diagram};
@@ -0,0 +1,200 @@
1
+ import{t as e}from"./chunk-KTR4FSNJ-WfEV-uOS.js";import{t}from"./chunk-5VM5RSS4-CdmEoR_J.js";import{t as n}from"./chunk-XXDRQBXY-B_jRWCc3.js";import{t as r}from"./chunk-CNRTWJTD-Ccr1NK1L.js";import{Bn as i,Cn as a,Dt as o,En as s,Et as c,Ft as l,Ln as u,Pt as d,Qn as f,Rn as p,Sn as m,Tn as h,Tt as g,U as _,Wn as v,Xn as y,Zn as b,bn as x,gn as S,k as C,kt as w,n as T,nr as E,pn as D,q as O,t as k,tr as A,vn as j,zn as M}from"./index-LgGsGSUh.js";import{t as N}from"./chunk-D5HYT7QG-Bj30JPRv.js";var P={SHAPE_UNSUPPORTED:`SHAPE_UNSUPPORTED`,SHAPE_REMOVED:`SHAPE_REMOVED`,EDGE_OPERATOR_UNSUPPORTED:`EDGE_OPERATOR_UNSUPPORTED`,REFERENCE_EDGE_LABEL_REJECTED:`REFERENCE_EDGE_LABEL_REJECTED`,CONNECTOR_REF_UNRESOLVED:`CONNECTOR_REF_UNRESOLVED`,CONNECTOR_REF_NOT_A_CONNECTOR:`CONNECTOR_REF_NOT_A_CONNECTOR`,METADATA_KEY_MISAPPLIED:`METADATA_KEY_MISAPPLIED`,DUPLICATE_ID_NODE:`DUPLICATE_ID_NODE`,RESERVED_SYNTHETIC_ID:`RESERVED_SYNTHETIC_ID`,CONTAINMENT_VIOLATION:`CONTAINMENT_VIOLATION`,EDGE_SEMANTIC_CONTRADICTION:`EDGE_SEMANTIC_CONTRADICTION`,FLOW_NO_INPUT:`FLOW_NO_INPUT`},ee=new Set([P.SHAPE_UNSUPPORTED,P.SHAPE_REMOVED,P.CONTAINMENT_VIOLATION]);new Set(Object.values(P).filter(e=>!ee.has(e)));var te=new Map([[`task`,`roundedRect`],[`tool`,`subroutine`],[`input`,`lean-right`],[`lean_right`,`lean-right`],[`decision`,`diamond`],[`refdoc`,`lin-doc`],[`action`,`hexagon`],[`round`,`rect`]]),ne=new Set(`doc.stadium.terminal.circle.trapezoid.inv_trapezoid.inv-trapezoid.doublecircle.double-circle.typeDeclaration.procs.lean_left.lean-left.in-out.cylinder.ellipse.odd.tag-rect.tagged-rectangle.delay.half-rounded-rectangle.lin-rect.lined-rectangle.win-pane.window-pane.curv-trap.curved-trapezoid`.split(`.`)),re=new Set([`roundedRect`,`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`lean-right`,`diamond`,`lin-doc`,`lined-document`,`hexagon`,`hex`,`connector`,`collapsedGroup`]),F=`roundedRect`;function I(e){return e&&(te.get(e)??e)}A(I,`resolveShapeAlias`);function L(e,t){for(let n of e)if(!n.isGroup){if(n.shape&&n.shape!==`squareRect`&&n.shape!==`rect`||(n.shape=F),ne.has(n.shape)){let e=`shape "${n.shape}" was removed in v0.8.1, using "${F}"`;t?.emitError?t.emitError(`SHAPE_REMOVED`,e,{nodeId:n.id}):f.warn(`agentflow: ${e}`),n.shape=F}else if(!re.has(n.shape)){let e=`shape "${n.shape}" is not supported, using "${F}"`;t?.emitWarning?t.emitWarning(`SHAPE_UNSUPPORTED`,e,{nodeId:n.id}):f.warn(`agentflow: ${e}`),n.shape=F}}}A(L,`normaliseNodeShapes`);var R=new Map([[`tool`,0],[`task`,1],[`decision`,2],[`input`,3],[`refdoc`,4],[`connector`,5],[`action`,6]]),z=R.size,B=A(e=>`af-kind-${e}`,`kindClass`),V=[...R.keys()],ie=A(e=>Math.max(1,e-z),`containerSlotCount`),ae=A((e,t)=>{let n=z+e%ie(t);return t>0?n%t:n},`containerSlot`);function oe(e,t,n){let r=h().themeVariables?.borderColorArray,i=Array.isArray(r)?r.length:0,a=n.size;for(let r of e??[]){if(r.isGroup||r.shape===`collapsedGroup`){r.colorIndex=ae(n.get(String(r.id))??a++,i);continue}let e=t(String(r.id));e&&R.has(e)&&(r.cssClasses=`${r.cssClasses??``} ${B(e)}`.replace(/\s+/g,` `).trim())}}A(oe,`assignColorSlots`);var se=`agentflow-`,ce=new Set([`shape`,`view`,`icon`,`img`,`form`,`pos`,`w`,`h`,`class`,`style`,`labelType`]),le=new Set([`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`tool`]),ue={flow:`flowGroup`};function de(e){let t=!1,n=!1,r=0,i,a=[];for(let o of e.split(`
2
+ `)){if(i!==void 0){let e=o.length-o.trimStart().length;if(o.trim()===``||e>i){a.push(o);continue}i=void 0}let e=-1;for(let i=0;i<o.length;i++){let a=o[i];if(n)a===`\\`?i++:a===`"`&&(n=!1);else if(t)a===`'`&&(t=!1);else if(a===`"`)n=!0;else if(a===`'`)t=!0;else if(a===`#`&&(i===0||o[i-1]===` `||o[i-1]===` `)){e=i;break}else a===`[`||a===`{`?r++:(a===`]`||a===`}`)&&(r=Math.max(0,r-1))}if(t||n||r>0){a.push(o);continue}let s=e>=0?o.slice(0,e):o,c=e>=0?o.slice(e):``;/:\s*[>|][\d+-]*\s*$/.test(s)?(i=o.length-o.trimStart().length,a.push(o)):a.push(s.replace(/,([\t ]*)$/,`$1`)+c)}return a.join(`
3
+ `)}A(de,`stripLineTrailingCommas`);var fe=class{constructor(){this.vertexCounter=0,this.config=h(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId=``,this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=p,this.setAccDescription=u,this.setDiagramTitle=i,this.getAccTitle=a,this.getAccDescription=m,this.getDiagramTitle=s,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen(`gen-2`)}static{A(this,`AgentFlowDB`)}sanitizeText(e){return j.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(t,n,r,i,a,o,s={},c,u){if(!t||t.trim().length===0)return;let f;if(c!==void 0){let t;t=c.includes(`
4
+ `)?c+`
5
+ `:`{
6
+ `+c+`
7
+ }`;try{f=l(t,{schema:d})??{}}catch(e){let t=c.includes(`
8
+ `)?de(c):c;if(t!==c)try{f=l(t+`
9
+ `,{schema:d})??{}}catch{this.rethrowMetadataYamlError(e,c,u)}else this.rethrowMetadataYamlError(e,c,u)}f=e(f)}let p;if(f&&typeof f.shape==`string`){let e=f;p=e.shape;let t=I(p);t&&t!==p&&(e.shape=t)}let m=this.subGraphLookup.get(t);if(m&&f){m.metadata={...m.metadata,...f};return}let g=this.connectors.get(t);if(g&&f){g.metadata={...g.metadata,...f};return}if(t===`connectors`)return;let _=this.edges.find(e=>e.id===t);if(_){let e=f;e?.animate!==void 0&&(_.animate=e.animate),e?.animation!==void 0&&(_.animation=e.animation),e?.curve!==void 0&&(_.interpolate=e.curve),f&&(_.metadata={..._.metadata,...f});return}let v,y=this.vertices.get(t);if(y===void 0&&(y={id:t,labelType:`text`,domId:se+t+`-`+this.vertexCounter,styles:[],classes:[]},this.vertices.set(t,y)),this.vertexCounter++,n===void 0?y.text===void 0&&(y.text=t):(this.config=h(),v=this.sanitizeText(n.text.trim()),y.labelType=n.type,v.startsWith(`"`)&&v.endsWith(`"`)&&(v=v.substring(1,v.length-1)),y.text=v),r!==void 0&&(y.type=r),i?.forEach(e=>{y.styles.push(e)}),a?.forEach(e=>{y.classes.push(e)}),o!==void 0&&(y.dir=o),y.props===void 0?y.props=s:s!==void 0&&Object.assign(y.props,s),f){if(y.metadata={...y.metadata,...f},f.shape){let e=p??f.shape;if(typeof e!=`string`)throw this.positionedShapeError(`No such shape: ${JSON.stringify(e)}.`,u);if(e!==e.toLowerCase()||e.includes(`_`))throw this.positionedShapeError(`No such shape: ${e}. Shape names should be lowercase.`,u);if(!C(f.shape))throw this.positionedShapeError(`No such shape: ${f.shape}.`,u);y.type=f?.shape}f?.label&&(y.text=this.sanitizeText(f.label),y.labelType=this.sanitizeNodeLabelType(f?.labelType))}}positionedShapeError(e,t){let n=Error(e);if(!t)return n;let r=t.first_line+this.frontmatterLineOffset;return Object.assign(n,{hash:{text:``,token:null,line:r-1,loc:{first_line:r,last_line:t.last_line+this.frontmatterLineOffset,first_column:t.first_column,last_column:t.last_column},expected:[]}}),n}rethrowMetadataYamlError(e,t,n){let r=e;if(!r||r.name!==`YAMLException`||!r.mark||!n)throw e;let i;try{let e=!t.includes(`
10
+ `),a=e?`{
11
+ `+t+`
12
+ }`:t+`
13
+ `,o=n.first_line+this.frontmatterLineOffset,s=n.first_column+2,c=A((t,n)=>e?{line:o,column:s+(t===1?n:0)}:{line:o+t,column:t===0?s+n:n},`toSource`),l=c(r.mark.line,r.mark.column),u=r.reason??(r.message??``).split(`
14
+ `)[0].replace(/\s*\(\d+:\d+\)\s*$/,``),d=a.split(`
15
+ `),f=[];if(e)f.push(1);else for(let e=r.mark.line-1;e<=r.mark.line+1;e++)e<0||e>=d.length||(e!==d.length-1||d[e]!==``||e===r.mark.line)&&f.push(e);let p=Math.max(...f.map(e=>String(c(e,0).line).length)),m=[];for(let e of f){let t=c(e,0).line,n=` ${String(t).padStart(p)} | `;m.push(n+d[e].replace(/\t/g,`→`)),e===r.mark.line&&m.push(`-`.repeat(n.length+r.mark.column)+`^`)}i={message:`${u} (${l.line}:${l.column+1})
16
+
17
+ ${m.join(`
18
+ `)}`,markLine:l.line-1,markColumn:l.column,hash:{text:``,token:null,line:l.line-1,loc:{first_line:l.line,last_line:l.line,first_column:l.column,last_column:l.column+1},expected:[]}}}catch{}throw i&&(r.message=i.message,r.mark.line=i.markLine,r.mark.column=i.markColumn,r.hash=i.hash),r}addSingleLink(e,t,n,r){let i={start:e,end:t,type:void 0,text:``,labelType:`text`,classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};f.info(`abc78 Got edge...`,i);let a=n.text;if(a!==void 0&&(i.text=this.sanitizeText(a.text.trim()),i.text.startsWith(`"`)&&i.text.endsWith(`"`)&&(i.text=i.text.substring(1,i.text.length-1)),i.labelType=this.sanitizeNodeLabelType(a.type)),n!==void 0&&(i.type=n.type,i.stroke=n.stroke,i.length=n.length>10?10:n.length,n.edgeSemantic&&(i.edgeSemantic=n.edgeSemantic)),r&&!this.edges.some(e=>e.id===r))i.id=r,i.isUserDefinedId=!0;else{let e=this.edges.filter(e=>e.start===i.start&&e.end===i.end);i.id=e.length===0?_(i.start,i.end,{counter:0,prefix:`L`}):_(i.start,i.end,{counter:e.length+1,prefix:`L`})}if(this.edges.length<(this.config.maxEdges??500))f.info(`Pushing edge...`),this.edges.push(i);else throw Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
19
+
20
+ Initialize mermaid with maxEdges set to a higher number to allow more edges.
21
+ You cannot set this config via configuration inside the diagram as it is a secure config.
22
+ You have to call mermaid.initialize.`)}isLinkData(e){return typeof e==`object`&&!!e&&`id`in e&&typeof e.id==`string`}addLink(e,t,n){let r=this.isLinkData(n)?n.id.replace(`@`,``):void 0;f.info(`addLink`,e,t,r);for(let i of e)for(let a of t){let o=i===e[e.length-1],s=a===t[0];o&&s?this.addSingleLink(i,a,n,r):this.addSingleLink(i,a,n,void 0)}}updateLinkInterpolate(e,t){e.forEach(e=>{if(e==="default")this.edges.defaultInterpolate=t;else{if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[e].interpolate=t}})}updateLink(e,t){e.forEach(e=>{if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);e==="default"?this.edges.defaultStyle=t:(this.edges[e].style=t,(this.edges[e]?.style?.length??0)>0&&!this.edges[e]?.style?.some(e=>e?.startsWith(`fill`))&&this.edges[e]?.style?.push(`fill:none`))})}addClass(e,t){let n=t.join().replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);e.split(`,`).forEach(e=>{let t=this.classes.get(e);t===void 0&&(t={id:e,styles:[],textStyles:[]},this.classes.set(e,t)),n?.forEach(e=>{if(/color/.exec(e)){let n=e.replace(`fill`,`bgFill`);t.textStyles.push(n)}t.styles.push(e)})})}setDirection(e){this.direction=e.trim(),/.*</.exec(this.direction)&&(this.direction=`RL`),/.*\^/.exec(this.direction)&&(this.direction=`BT`),/.*>/.exec(this.direction)&&(this.direction=`LR`),/.*v/.exec(this.direction)&&(this.direction=`TB`),this.direction===`TD`&&(this.direction=`TB`)}setClass(e,t){for(let n of e.split(`,`)){let e=this.vertices.get(n);e&&e.classes.push(t);let r=this.edges.find(e=>e.id===n);r&&r.classes.push(t);let i=this.subGraphLookup.get(n);i&&i.classes.push(t)}}setTooltip(e,t){if(t!==void 0){t=this.sanitizeText(t);for(let n of e.split(`,`))this.tooltips.set(this.version===`gen-1`?this.lookUpDomId(n):n,t)}}setClickFun(e,t,n){if(h().securityLevel!==`loose`||t===void 0)return;let r=[];if(typeof n==`string`){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e<r.length;e++){let t=r[e].trim();t.startsWith(`"`)&&t.endsWith(`"`)&&(t=t.substr(1,t.length-2)),r[e]=t}}r.length===0&&r.push(e);let i=this.vertices.get(e);i&&(i.haveCallback=!0,this.funs.push(()=>{let n=this.lookUpDomId(e),i=document.querySelector(`[id="${n}"]`);i!==null&&i.addEventListener(`click`,()=>{O.runFunc(t,...r)},!1)}))}setLink(e,t,n){e.split(`,`).forEach(e=>{let r=this.vertices.get(e);r!==void 0&&(r.link=O.formatUrl(t,this.config),r.linkTarget=n)}),this.setClass(e,`clickable`)}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,t,n){e.split(`,`).forEach(e=>{this.setClickFun(e,t,n)}),this.setClass(e,`clickable`)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(e){return le.has(e.type)}getTools(){let e=[];for(let t of this.vertices.values())this.isToolDefinition(t)&&e.push(t);return e}getClasses(){return this.classes}setupToolTips(e){let t=N();D(e).select(`svg`).selectAll(`g.node`).on(`mouseover`,e=>{let n=D(e.currentTarget),r=n.attr(`title`);if(r===null)return;let i=e.currentTarget?.getBoundingClientRect();t.transition().duration(200).style(`opacity`,`.9`),t.text(n.attr(`title`)).style(`left`,window.scrollX+i.left+(i.right-i.left)/2+`px`).style(`top`,window.scrollY+i.bottom+`px`),t.html(E.sanitize(r)),n.classed(`hover`,!0)}).on(`mouseout`,e=>{t.transition().duration(500).style(`opacity`,0),D(e.currentTarget).classed(`hover`,!1)})}clear(e=`gen-2`){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=h(),this.diagramId=``,this.vertexCounter=0,this.direction=void 0,this.secCount=-1,this.posCrossRef=[],this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,S()}setGen(e){this.version=e||`gen-2`}defaultStyle(){return`fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;`}addSubGraph(e,t,n,r){let i=e?.text?.trim(),a=n?.text;e===n&&n?.text&&/\s/.exec(n.text)&&(i=void 0);let o=A(e=>{let t={boolean:{},number:{},string:{}},n=[],r;return{nodeList:e.filter(function(e){let i=typeof e;return e.stmt&&e.stmt===`dir`?(r=e.value,!1):e.trim()===``?!1:i in t?t[i].hasOwnProperty(e)?!1:t[i][e]=!0:!n.includes(e)&&n.push(e)}),dir:r}},`uniq`)(t.flat()),s=o.nodeList,c=o.dir,l=h().flowchart??{};if(c??=l.inheritDir?this.getDirection()??h().direction??void 0:void 0,this.version===`gen-1`)for(let e=0;e<s.length;e++)s[e]=this.lookUpDomId(s[e]);i??=`subGraph`+this.subCount,a||=``,a=this.sanitizeText(a),this.subCount+=1;let u={id:i,nodes:s.filter(e=>e!==i&&!this.globalNodes.has(e)),title:a.trim(),classes:[],dir:c,labelType:this.sanitizeNodeLabelType(n?.type),type:r??`flow`};f.info(`Adding`,u.id,u.nodes,u.dir),u.nodes=this.makeUniq(u,this.subGraphs).nodes;let d=this.getPosForId(i);if(d!==-1){let e=this.subGraphs[d];for(let t of u.nodes)e.nodes.includes(t)||e.nodes.push(t);u.title&&(e.title=u.title),u.dir&&(e.dir=u.dir),u.type&&(e.type=u.type),this.subGraphLookup.set(i,e)}else this.subGraphs.push(u),this.subGraphLookup.set(i,u);return i}addGlobal(e){for(let t of e.flat()){if(typeof t!=`string`)continue;let e=t.trim();e!==``&&this.globalNodes.add(e)}for(let e of this.subGraphs)e.nodes=e.nodes.filter(e=>!this.globalNodes.has(e))}getPosForId(e){for(let[t,n]of this.subGraphs.entries())if(n.id===e)return t;return-1}indexNodes2(e,t){let n=this.subGraphs[t].nodes;if(this.secCount+=1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=t,this.subGraphs[t].id===e)return{result:!0,count:0};let r=0,i=1;for(;r<n.length;){let t=this.getPosForId(n[r]);if(t>=0){let n=this.indexNodes2(e,t);if(n.result)return{result:!0,count:i+n.count};i+=n.count}r+=1}return{result:!1,count:i}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2(`none`,this.subGraphs.length-1)}addConnector(e,t){let n=e?.text?.trim();if(!n)return``;let r=t?.text?.trim()??``,i=r.length>0?this.sanitizeText(r):n,a=this.connectors.get(n);return a?r.length>0&&(a.text=i):(a={id:n,labelType:`text`,domId:se+n+`-`+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:i},this.connectors.set(n,a),this.vertices.set(n,a),this.vertexCounter++),n}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}computeEdgeSemantic(e,t){if(e===`arrow_point`&&t===`normal`)return`sequence`;if(e===`arrow_cross`&&t===`normal`)return`failure`;if(e===`arrow_open`&&t===`dotted`)return`reference`}destructStartLink(e){let t=e.trim(),n=`normal`;return t.includes(`.`)&&(n=`dotted`),{type:`arrow_open`,stroke:n}}countChar(e,t){let n=t.length,r=0;for(let i=0;i<n;++i)t[i]===e&&++r;return r}destructEndLink(e){let t=e.trim(),n=t.slice(0,-1),r=`arrow_open`;switch(t.slice(-1)){case`x`:r=`arrow_cross`;break;case`>`:r=`arrow_point`;break;case`-`:case`.`:r=`arrow_open`,n=t}let i=`normal`,a=n.length-1,o=this.countChar(`.`,n);return o>0&&(i=`dotted`,a=o),{type:r,stroke:i,length:a}}destructLink(e,t){let n=this.destructEndLink(e),r;return t?(r=this.destructStartLink(t),r.stroke===n.stroke?(r.type=n.type,r.length=n.length,{...r,edgeSemantic:this.computeEdgeSemantic(r.type,r.stroke)}):{type:`INVALID`,stroke:`INVALID`}):{...n,edgeSemantic:this.computeEdgeSemantic(n.type,n.stroke)}}exists(e,t){for(let n of e)if(n.nodes.includes(t))return!0;return!1}makeUniq(e,t){let n=[];return e.nodes.forEach((r,i)=>{this.exists(t,r)||n.push(e.nodes[i])}),{nodes:n}}getTypeFromVertex(e){let t=typeof e.type==`string`?I(e.type):e.type;switch(t){case`square`:case void 0:return`squareRect`;case`round`:return`roundedRect`;case`ellipse`:return`ellipse`;default:return t}}findNode(e,t){return e.find(e=>e.id===t)}destructEdgeType(e){let t=`none`,n=`arrow_point`;switch(e){case`arrow_point`:case`arrow_circle`:case`arrow_cross`:case`arrow_hierarchy`:n=e;break;case`double_arrow_point`:case`double_arrow_circle`:case`double_arrow_cross`:t=e.replace(`double_`,``),n=t}return{arrowTypeStart:t,arrowTypeEnd:n}}addNodeFromVertex(e,t,n,r,i,a){let o=n.get(e.id),s=r.get(e.id)??!1,c=this.findNode(t,e.id);if(c)c.cssStyles=e.styles,c.cssCompiledStyles=this.getCompiledStyles(e.classes),c.cssClasses=e.classes.join(` `);else{let n={id:e.id,label:e.text,labelType:e.labelType,labelStyle:``,parentId:o,padding:i.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles([`default`,`node`,...e.classes]),cssClasses:`default `+e.classes.join(` `),dir:e.dir,domId:e.domId,look:a,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),metadata:e.metadata};s?t.push({...n,isGroup:!0,shape:`rect`}):t.push({...n,isGroup:!1,shape:this.getTypeFromVertex(e),wrappingWidth:i.agentflow?.wrappingWidth,minWidth:i.agentflow?.minNodeWidth})}}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}runPostParseValidators(){this.postParseValidationRun||=!0}getData(){this.runPostParseValidators();let e=h(),t=[],n=[],r=this.getSubGraphs(),i=new Map,a=new Map,o=new Set,s=new Map,c=A((e,t,n=new Set)=>{if(n.has(e))return;n.add(e);let r=this.subGraphLookup.get(e);if(r)for(let e of r.nodes)e===t||n.has(e)||(o.add(e),s.set(e,t),c(e,t,n))},`collectDescendants`);for(let e of r)e.metadata?.view===`collapsed`&&!o.has(e.id)&&c(e.id,e.id);let l=A((e,t)=>{let n=new Set,r=t;for(;r!==void 0&&!n.has(r);){if(r===e)return!0;n.add(r),r=i.get(r)}return!1},`wouldCloseContainmentCycle`);for(let e=r.length-1;e>=0;e--){let t=r[e];if(!o.has(t.id)){t.nodes.length>0&&a.set(t.id,!0);for(let e of t.nodes)l(e,t.id)?this.emitWarning(P.CONTAINMENT_VIOLATION,`Container "${t.id}" cannot contain "${e}" because "${e}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:e}):i.set(e,t.id)}}for(let n=r.length-1;n>=0;n--){let a=r[n];if(!o.has(a.id)){if(a.metadata?.view===`collapsed`){let n={...a.metadata,containerType:a.type};t.push({id:a.id,label:a.title,labelStyle:``,labelType:a.labelType,parentId:i.get(a.id),padding:8,cssCompiledStyles:this.getCompiledStyles(a.classes),cssClasses:a.classes.join(` `),shape:`collapsedGroup`,dir:a.dir,isGroup:!1,look:e.look,metadata:n})}else t.push({id:a.id,label:a.title,labelStyle:``,labelType:a.labelType,parentId:i.get(a.id),padding:8,cssCompiledStyles:this.getCompiledStyles(a.classes),cssClasses:a.classes.join(` `),shape:ue[a.type??`flow`],dir:a.dir,isGroup:!0,look:e.look,metadata:a.metadata})}}this.getVertices().forEach(n=>{o.has(n.id)||this.addNodeFromVertex(n,t,i,a,e,e.look||`classic`)});let u=this.getEdges();u.forEach((t,r)=>{let i=s.get(t.start)??t.start,a=s.get(t.end)??t.end;if(i===a&&t.start!==t.end)return;let{arrowTypeStart:o,arrowTypeEnd:c}=this.destructEdgeType(t.type),l=[...u.defaultStyle??[]];t.style&&l.push(...t.style);let d={id:_(i,a,{counter:r,prefix:`L`},t.id),isUserDefinedId:t.isUserDefinedId,start:i,end:a,type:t.type??`normal`,label:t.text,labelType:t.labelType,labelpos:`c`,thickness:t.stroke,minlen:t.length,classes:t?.stroke===`invisible`?``:`edge-thickness-normal edge-pattern-solid flowchart-link`,arrowTypeStart:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:o,arrowTypeEnd:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:c,arrowheadStyle:`fill: #333`,cssCompiledStyles:this.getCompiledStyles(t.classes),labelStyle:l,style:l,pattern:t.stroke,look:e.look,animate:t.animate,animation:t.animation,curve:t.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve,metadata:t.metadata};n.push(d)}),L(t,this);let d=new Map,f=new Map;for(let e of r){let t=i.get(e.id);t!==void 0&&f.set(t,[...f.get(t)??[],e.id])}let p=0,m=A(e=>{if(!d.has(e)){d.set(e,p++);for(let t of f.get(e)??[])m(t)}},`walkContainers`);for(let e of r)i.get(e.id)===void 0&&m(e.id);let g=new Set(this.getConnectors().map(e=>e.id));return oe(t,e=>{if(g.has(e))return`connector`;let t=this.vertices.get(e);return t?this.deriveVertexKind(t,I(t.type)):void 0},d),{nodes:t,edges:n,other:{},config:e,connectors:this.getConnectors()}}validate(){h().layout===`grid`&&v(void 0,[...this.vertices.values(),...this.subGraphs])}defaultConfig(){return x.flowchart}deriveVertexKind(e,t){return this.isToolDefinition(e)?`tool`:t===`hexagon`||t===`hex`?`action`:t===`lean-right`||t===`lean_right`?`input`:t===`lin-doc`||t===`lined-document`?`refdoc`:t===`diamond`?`decision`:`task`}getSemanticModel(){this.runPostParseValidators();let e=new Set(this.subGraphs.map(e=>e.id)),t=[],n=[];for(let[r,i]of this.vertices){if(e.has(r))continue;if(i.isConnector){let e={id:r};if(i.text!==void 0&&i.text!==r&&(e.title=i.text),i.metadata&&Object.keys(i.metadata).length>0){let t={};for(let[e,n]of Object.entries(i.metadata))ce.has(e)||(t[e]=n);Object.keys(t).length>0&&(e.metadata=t)}n.push(e);continue}let a={id:r};i.text!==void 0&&(a.label=i.text);let o=typeof i.type==`string`?I(i.type):i.type;if(o!==void 0&&(a.shape=o),a.vertexKind=this.deriveVertexKind(i,o),i.metadata&&Object.keys(i.metadata).length>0){let e={};for(let[t,n]of Object.entries(i.metadata))ce.has(t)||(e[t]=n);Object.keys(e).length>0&&(a.metadata=e)}t.push(a)}let r={vertices:t,edges:this.edges.map(e=>{let t={start:e.start,end:e.end};return e.id!==void 0&&(t.id=e.id),typeof e.text==`string`&&e.text.length>0&&(t.label=e.text),e.type!==void 0&&(t.type=e.type),e.stroke!==void 0&&(t.stroke=e.stroke),e.edgeSemantic!==void 0&&(t.edgeSemantic=e.edgeSemantic),e.length!==void 0&&(t.length=e.length),e.metadata&&Object.keys(e.metadata).length>0&&(t.metadata={...e.metadata}),t}),subGraphs:this.subGraphs.map(e=>{let t={id:e.id,nodes:[...e.nodes]};if(e.type!==void 0&&(t.type=e.type),e.title!==void 0&&(t.title=e.title),e.dir!==void 0&&(t.direction=e.dir),e.metadata&&Object.keys(e.metadata).length>0){let n={};for(let[t,r]of Object.entries(e.metadata))ce.has(t)||(n[t]=r);Object.keys(n).length>0&&(t.metadata=n)}return t}),connectors:n,diagnostics:this.diagnostics};return this.direction!==void 0&&(r.direction=this.direction),r}setFrontmatterLineOffset(e){this.frontmatterLineOffset=e??0}toElementPosition(e){let t=e?.first_line??0,n=e?.first_column??0,r=e?.last_line??t,i=e?.last_column??n,[a,o]=e?.range??[0,0];return{startLine:t+this.frontmatterLineOffset,startColumn:n,endLine:r+this.frontmatterLineOffset,endColumn:i,startIndex:a,endIndex:o}}pushMapping(e,t,n){if(!e)return;let r={id:e,type:t,position:this.toElementPosition(n)};return this.elementMappings.push(r),r}addVertexMapping(e,t,n,r){let i=this.pushMapping(e,`vertex`,r);i&&n==null&&this.bareVertexMappings.add(i)}extendVertexMapping(e,t){if(!e||!t)return;let n=this.toElementPosition(t);for(let t=this.elementMappings.length-1;t>=0;t--){let r=this.elementMappings[t];if(r.type===`vertex`&&r.id===e){this.bareVertexMappings.has(r)&&(r.type=`attachment`,this.bareVertexMappings.delete(r)),(n.endLine>r.position.endLine||n.endLine===r.position.endLine&&n.endColumn>r.position.endColumn)&&(r.position.endLine=n.endLine,r.position.endColumn=n.endColumn,r.position.endIndex=n.endIndex);return}}this.pushMapping(e,`attachment`,t)}addEdgeMapping(e,t,n,r){let i=Array.isArray(t)?t.map(e=>typeof e==`string`?e:e?.id??``).filter(Boolean):[],a=i.length>0?i.join(`>`):`edge`;this.pushMapping(a,`edge`,r)}addSubgraphMapping(e,t,n,r){let i=(typeof e==`string`?e:e?.text)??``,a=this.toElementPosition(n),o=r?this.toElementPosition(r):a;i&&this.elementMappings.push({id:i,type:`subgraph`,position:{startLine:a.startLine,startColumn:a.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:a.startIndex,endIndex:o.endIndex}})}addConnectorMapping(e,t,n,r){let i=e?.text?.trim()??``;if(!i)return;let a=this.toElementPosition(n),o=r?this.toElementPosition(r):a;this.elementMappings.push({id:i,type:`connector`,position:{startLine:a.startLine,startColumn:a.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:a.startIndex,endIndex:o.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(e){return this.elementMappings.find(t=>t.id===e)}getElementsOnLine(e){return this.elementMappings.filter(t=>e>=t.position.startLine&&e<=t.position.endLine)}getElementAtPosition(e,t){let n=this.elementMappings.filter(n=>{let{startLine:r,startColumn:i,endLine:a,endColumn:o}=n.position;return!(e<r||e>a||e===r&&t<i||e===a&&t>o)});if(n.length===0)return;let r=A(({position:e})=>[e.endLine-e.startLine,e.endColumn-e.startColumn],`span`);return n.reduce((e,t)=>{let[n,i]=r(e),[a,o]=r(t);return a===n?o<i?t:e:a<n?t:e})}getMappingStats(){let e=0,t=0,n=0,r=0,i=0;for(let a of this.elementMappings)a.type===`vertex`?e++:a.type===`edge`?t++:a.type===`subgraph`?n++:a.type===`connector`?r++:a.type===`attachment`&&i++;return{vertices:e,edges:t,subgraphs:n,connectors:r,attachments:i,totalElements:this.elementMappings.length}}emitDiagnostic(e,t,n,r){let i=r?.nodeId??r?.edgeId,a=i?this.getElementById(i):void 0,o={id:e,severity:t,message:n,...r?.nodeId?{nodeId:r.nodeId}:{},...r?.edgeId&&!r?.nodeId?{edgeId:r.edgeId}:{},...a?{position:a.position}:{}};if(this.diagnostics.some(e=>e.id===o.id&&e.severity===o.severity&&e.message===o.message&&e.nodeId===o.nodeId&&e.edgeId===o.edgeId))return;this.diagnostics.push(o);let s=`agentflow[${e}]: ${n}`;t===`error`?f.error(s):f.warn(s)}emitWarning(e,t,n){this.emitDiagnostic(e,`warning`,t,n)}emitError(e,t,n){this.emitDiagnostic(e,`error`,t,n)}getDiagnostics(){return[...this.diagnostics]}},pe={getClasses:A(function(e,t){return t.db.getClasses()},`getClasses`),draw:A(async function(e,t,i,a){f.debug(`Drawing agentflow diagram`,t);let{securityLevel:o,agentflow:s,layout:c}=h();a.db.setDiagramId(t),f.debug(`Before getData: `);let l=a.db.getData();f.debug(`Data: `,l);let u=n(t,o),d=a.db.getDirection();l.type=a.type,l.layoutAlgorithm=k(c),l.layoutAlgorithm===`dagre`&&c===`elk`&&f.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),l.direction=d,l.nodeSpacing=s?.nodeSpacing||50,l.rankSpacing=s?.rankSpacing||50,l.markers=[`point`,`circle`,`cross`,`hierarchy`],l.diagramId=t,f.debug(`REF1:`,l),await T(l,u);let p=s?.diagramPadding??8;O.insertTitle(u,`agentflowTitleText`,s?.titleTopMargin??0,a.db.getDiagramTitle()),r(u,p,`agentflow`,s?.useMaxWidth??!0)},`draw`)},me=(function(){var e=A(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,5],n=[1,4],r=[1,3],i=[1,6],a=[1,8,9,10,11,12,28,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],o=[2,2],s=[1,15],c=[1,16],l=[1,17],u=[1,18],d=[1,19],f=[1,26],p=[1,27],m=[1,28],h=[1,30],g=[1,31],_=[1,32],v=[1,55],y=[1,54],b=[1,34],x=[1,35],S=[1,36],C=[1,37],w=[1,38],T=[1,50],E=[1,52],D=[1,48],O=[1,53],k=[1,49],j=[1,56],M=[1,51],N=[1,57],P=[1,58],ee=[1,39],te=[1,40],ne=[1,41],re=[1,42],F=[1,43],I=[1,64],L=[1,8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],R=[1,70],z=[1,68],B=[1,67],V=[1,69],ie=[8,9,10,12,78,80,81],ae=[1,88],oe=[1,101],se=[1,106],ce=[1,105],le=[1,102],ue=[1,98],de=[1,104],fe=[1,100],pe=[1,107],me=[1,103],he=[1,108],ge=[1,99],_e=[8,9,10,11,12,43,78,80,81],H=[8,9,10,11,12,43,49,78,80,81],U=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],ve=[8,9,10,12,47,63,78,80,81,92,105,108,109,112,114,117,118,119],ye=[47,63,92,105,108,109,112,114,117,118,119],be=[1,131],xe=[1,132],Se=[1,134],Ce=[1,133],we=[47,63,65,77,92,105,108,109,112,114,117,118,119],Te=[1,143],Ee=[1,157],De=[1,158],Oe=[1,159],ke=[1,162],Ae=[1,161],je=[1,160],Me=[1,145],Ne=[1,147],Pe=[1,151],Fe=[1,139],Ie=[1,140],Le=[1,152],Re=[1,153],ze=[1,154],Be=[1,155],Ve=[1,156],He=[1,163],Ue=[1,164],We=[1,141],Ge=[1,142],Ke=[1,149],qe=[1,144],Je=[1,148],Ye=[1,146],Xe=[8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],Ze=[1,168],Qe=[1,170],W=[8,9,10,12],G=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],K=[1,190],q=[1,186],J=[1,187],Y=[1,191],X=[1,188],Z=[1,189],$e=[80,119,122],Q=[8,9,10,11,12,13,15,28,30,33,35,36,43,47,63,78,87,88,89,90,91,92,93,108,112,114,117,118,119],et=[11,109],tt=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],nt=[1,269],rt=[1,267],it=[1,271],at=[1,265],ot=[1,266],st=[1,268],ct=[1,270],lt=[1,272],ut=[1,292],dt=[8,9,10,12,109],$=[8,9,10,11,12,63,87,108,109,112,113,114,115],ft={trace:A(function(){},`trace`),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,COMMENT:8,SEMI:9,NEWLINE:10,SPACE:11,EOF:12,GRAPH:13,NODIR:14,DIR:15,FirstStmtSeparator:16,ending:17,endToken:18,spaceList:19,spaceListNewline:20,vertexStatement:21,separator:22,styleStatement:23,linkStyleStatement:24,classDefStatement:25,classStatement:26,clickStatement:27,flow:28,textNoTags:29,SQS:30,text:31,SQE:32,end:33,shapeData:34,global:35,connector:36,direction:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,SHAPE_DATA:43,link:44,node:45,styledVertex:46,AMP:47,vertex:48,STYLE_SEPARATOR:49,idString:50,DOUBLECIRCLESTART:51,DOUBLECIRCLEEND:52,PS:53,PE:54,"(-":55,"-)":56,STADIUMSTART:57,STADIUMEND:58,SUBROUTINESTART:59,SUBROUTINEEND:60,VERTEX_WITH_PROPS_START:61,"NODE_STRING[field]":62,COLON:63,"NODE_STRING[value]":64,PIPE:65,CYLINDERSTART:66,CYLINDEREND:67,DIAMOND_START:68,DIAMOND_STOP:69,TAGEND:70,TRAPSTART:71,TRAPEND:72,INVTRAPSTART:73,INVTRAPEND:74,linkStatement:75,arrowText:76,TESTSTR:77,START_LINK:78,edgeText:79,LINK:80,LINK_ID:81,edgeTextToken:82,STR:83,MD_STR:84,textToken:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTagsToken:94,stylesOpt:95,"idString[vertex]":96,"idString[class]":97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,"STR[link]":102,"STR[tooltip]":103,alphaNum:104,DEFAULT:105,numList:106,INTERPOLATE:107,NUM:108,COMMA:109,style:110,styleComponent:111,NODE_STRING:112,UNIT:113,BRKT:114,PCT:115,idStringToken:116,MINUS:117,MULT:118,UNICODE_TEXT:119,TEXT:120,TAGSTART:121,EDGE_TEXT:122,alphaNumToken:123,direction_tb:124,direction_bt:125,direction_rl:126,direction_lr:127,direction_td:128,$accept:0,$end:1},terminals_:{2:`error`,8:`COMMENT`,9:`SEMI`,10:`NEWLINE`,11:`SPACE`,12:`EOF`,13:`GRAPH`,14:`NODIR`,15:`DIR`,28:`flow`,30:`SQS`,32:`SQE`,33:`end`,35:`global`,36:`connector`,38:`acc_title`,39:`acc_title_value`,40:`acc_descr`,41:`acc_descr_value`,42:`acc_descr_multiline_value`,43:`SHAPE_DATA`,47:`AMP`,49:`STYLE_SEPARATOR`,51:`DOUBLECIRCLESTART`,52:`DOUBLECIRCLEEND`,53:`PS`,54:`PE`,55:`(-`,56:`-)`,57:`STADIUMSTART`,58:`STADIUMEND`,59:`SUBROUTINESTART`,60:`SUBROUTINEEND`,61:`VERTEX_WITH_PROPS_START`,62:`NODE_STRING[field]`,63:`COLON`,64:`NODE_STRING[value]`,65:`PIPE`,66:`CYLINDERSTART`,67:`CYLINDEREND`,68:`DIAMOND_START`,69:`DIAMOND_STOP`,70:`TAGEND`,71:`TRAPSTART`,72:`TRAPEND`,73:`INVTRAPSTART`,74:`INVTRAPEND`,77:`TESTSTR`,78:`START_LINK`,80:`LINK`,81:`LINK_ID`,83:`STR`,84:`MD_STR`,87:`STYLE`,88:`LINKSTYLE`,89:`CLASSDEF`,90:`CLASS`,91:`CLICK`,92:`DOWN`,93:`UP`,96:`idString[vertex]`,97:`idString[class]`,98:`CALLBACKNAME`,99:`CALLBACKARGS`,100:`HREF`,101:`LINK_TARGET`,102:`STR[link]`,103:`STR[tooltip]`,105:`DEFAULT`,107:`INTERPOLATE`,108:`NUM`,109:`COMMA`,112:`NODE_STRING`,113:`UNIT`,114:`BRKT`,115:`PCT`,117:`MINUS`,118:`MULT`,119:`UNICODE_TEXT`,120:`TEXT`,121:`TAGSTART`,122:`EDGE_TEXT`,124:`direction_tb`,125:`direction_bt`,126:`direction_rl`,127:`direction_lr`,128:`direction_td`},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,2],[4,3],[17,2],[17,1],[18,1],[18,1],[18,1],[16,1],[16,1],[16,2],[16,1],[20,2],[20,2],[20,2],[20,1],[20,1],[20,1],[19,2],[19,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,10],[7,6],[7,7],[7,4],[7,4],[7,7],[7,8],[7,4],[7,5],[7,1],[7,2],[7,2],[7,1],[22,1],[22,1],[22,1],[22,1],[34,2],[34,1],[21,4],[21,3],[21,4],[21,2],[21,2],[21,1],[45,1],[45,6],[45,5],[46,1],[46,3],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,8],[48,4],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,4],[48,4],[48,1],[44,2],[44,3],[44,3],[44,1],[44,3],[44,4],[79,1],[79,2],[79,1],[79,1],[75,1],[75,2],[76,3],[31,1],[31,2],[31,1],[31,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[29,1],[29,2],[29,1],[29,1],[25,5],[26,5],[27,2],[27,4],[27,3],[27,5],[27,3],[27,5],[27,5],[27,7],[27,2],[27,4],[27,2],[27,4],[27,4],[27,6],[23,5],[24,5],[24,5],[24,9],[24,9],[24,7],[24,7],[106,1],[106,3],[95,1],[95,3],[110,1],[110,2],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[85,1],[85,1],[85,1],[85,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[82,1],[82,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[50,1],[50,2],[104,1],[104,2],[37,1],[37,1],[37,1],[37,1],[37,1]],performAction:A(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:(!Array.isArray(a[s])||a[s].length>0)&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 198:this.$=a[s];break;case 5:case 33:case 34:case 35:case 36:case 37:this.$=[];break;case 13:r.setDirection(`TB`),this.$=`TB`;break;case 14:r.setDirection(a[s-1]),this.$=a[s-1];break;case 32:this.$=a[s-1].nodes;break;case 38:this.$=r.addSubGraph(a[s-6],a[s-1],a[s-4],`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-6],a[s-4],o[s-8],o[s]);break;case 39:this.$=r.addSubGraph(a[s-7],a[s-1],a[s-5],`flow`),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-3],o[s-3]),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-7],a[s-5],o[s-9],o[s]);break;case 40:this.$=r.addSubGraph(a[s-3],a[s-1],{text:``,type:`text`},`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-3],{text:``,type:`text`},o[s-5],o[s]);break;case 41:this.$=r.addSubGraph(a[s-4],a[s-1],{text:``,type:`text`},`flow`),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-3],o[s-3]),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-4],{text:``,type:`text`},o[s-6],o[s]);break;case 42:this.$=r.addSubGraph(void 0,a[s-1],void 0,`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(void 0,void 0,o[s-3],o[s]);break;case 43:r.addGlobal(a[s-1]),this.$=[];break;case 44:this.$=r.addConnector(a[s-4],a[s-2]),r.addConnectorMapping&&r.addConnectorMapping(a[s-4],a[s-2],o[s-6],o[s]);break;case 45:this.$=r.addConnector(a[s-5],a[s-3]),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-1],o[s-1]),r.addConnectorMapping&&r.addConnectorMapping(a[s-5],a[s-3],o[s-7],o[s]);break;case 46:this.$=r.addConnector(a[s-1],{text:``,type:`text`}),r.addConnectorMapping&&r.addConnectorMapping(a[s-1],{text:``,type:`text`},o[s-3],o[s]);break;case 47:this.$=r.addConnector(a[s-2],{text:``,type:`text`}),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-1],o[s-1]),r.addConnectorMapping&&r.addConnectorMapping(a[s-2],{text:``,type:`text`},o[s-4],o[s]);break;case 49:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 50:case 51:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 56:this.$=a[s-1]+a[s];break;case 57:this.$=a[s];break;case 58:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s],o[s]),r.extendVertexMapping&&r.extendVertexMapping(a[s-1][a[s-1].length-1],o[s]),r.addLink(a[s-3].stmt,a[s-1],a[s-2]),r.addEdgeMapping&&r.addEdgeMapping(a[s-3].stmt,a[s-1],a[s-2],this._$),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 59:r.addLink(a[s-2].stmt,a[s],a[s-1]),r.addEdgeMapping&&r.addEdgeMapping(a[s-2].stmt,a[s],a[s-1],this._$),this.$={stmt:a[s],nodes:a[s].concat(a[s-2].nodes)};break;case 60:r.addLink(a[s-3].stmt,a[s-1],a[s-2]),r.addEdgeMapping&&r.addEdgeMapping(a[s-3].stmt,a[s-1],a[s-2],this._$),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 61:this.$={stmt:a[s-1],nodes:a[s-1]};break;case 62:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s],o[s]),r.extendVertexMapping&&r.extendVertexMapping(a[s-1][a[s-1].length-1],o[s]),this.$={stmt:a[s-1],nodes:a[s-1],shapeData:a[s]};break;case 63:this.$={stmt:a[s],nodes:a[s]};break;case 64:this.$=[a[s]];break;case 65:r.addVertex(a[s-5][a[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s-4],o[s-4]),r.extendVertexMapping&&r.extendVertexMapping(a[s-5][a[s-5].length-1],o[s-4]),this.$=a[s-5].concat(a[s]);break;case 66:this.$=a[s-4].concat(a[s]);break;case 67:this.$=a[s];break;case 68:this.$=a[s-2],r.setClass(a[s-2],a[s]);break;case 69:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`square`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`square`,this._$);break;case 70:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`doublecircle`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`doublecircle`,this._$);break;case 71:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`circle`),r.addVertexMapping&&r.addVertexMapping(a[s-5],a[s-2],`circle`,this._$);break;case 72:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`ellipse`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`ellipse`,this._$);break;case 73:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`stadium`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`stadium`,this._$);break;case 74:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`subroutine`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`subroutine`,this._$);break;case 75:this.$=a[s-7],r.addVertex(a[s-7],a[s-1],`rect`,void 0,void 0,void 0,Object.fromEntries([[a[s-5],a[s-3]]])),r.addVertexMapping&&r.addVertexMapping(a[s-7],a[s-1],`rect`,this._$);break;case 76:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`cylinder`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`cylinder`,this._$);break;case 77:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`round`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`round`,this._$);break;case 78:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`diamond`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`diamond`,this._$);break;case 79:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`hexagon`),r.addVertexMapping&&r.addVertexMapping(a[s-5],a[s-2],`hexagon`,this._$);break;case 80:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`odd`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`odd`,this._$);break;case 81:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`trapezoid`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`trapezoid`,this._$);break;case 82:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`inv_trapezoid`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`inv_trapezoid`,this._$);break;case 83:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_right`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`lean_right`,this._$);break;case 84:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_left`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`lean_left`,this._$);break;case 85:this.$=a[s],r.addVertex(a[s]),r.addVertexMapping&&r.addVertexMapping(a[s],void 0,void 0,this._$);break;case 86:a[s-1].text=a[s],this.$=a[s-1];break;case 87:case 88:a[s-2].text=a[s-1],this.$=a[s-2];break;case 89:this.$=a[s];break;case 90:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,text:a[s-1]};break;case 91:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,text:a[s-1],id:a[s-3]};break;case 92:this.$={text:a[s],type:`text`};break;case 93:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 94:this.$={text:a[s],type:`string`};break;case 95:this.$={text:a[s],type:`markdown`};break;case 96:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic};break;case 97:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,id:a[s-1]};break;case 98:this.$=a[s-1];break;case 99:this.$={text:a[s],type:`text`};break;case 100:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 101:this.$={text:a[s],type:`string`};break;case 102:case 119:this.$={text:a[s],type:`markdown`};break;case 116:this.$={text:a[s],type:`text`};break;case 117:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 118:this.$={text:a[s],type:`text`};break;case 120:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 121:this.$=a[s-4],r.setClass(a[s-2],a[s]);break;case 122:case 130:this.$=a[s-1],r.setClickEvent(a[s-1],a[s]);break;case 123:case 131:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 124:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 125:this.$=a[s-4],r.setClickEvent(a[s-4],a[s-3],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 126:this.$=a[s-2],r.setLink(a[s-2],a[s]);break;case 127:this.$=a[s-4],r.setLink(a[s-4],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 128:this.$=a[s-4],r.setLink(a[s-4],a[s-2],a[s]);break;case 129:this.$=a[s-6],r.setLink(a[s-6],a[s-4],a[s]),r.setTooltip(a[s-6],a[s-2]);break;case 132:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 133:this.$=a[s-3],r.setLink(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 134:this.$=a[s-3],r.setLink(a[s-3],a[s-2],a[s]);break;case 135:this.$=a[s-5],r.setLink(a[s-5],a[s-4],a[s]),r.setTooltip(a[s-5],a[s-2]);break;case 136:this.$=a[s-4],r.addVertex(a[s-2],void 0,void 0,a[s]);break;case 137:this.$=a[s-4],r.updateLink([a[s-2]],a[s]);break;case 138:this.$=a[s-4],r.updateLink(a[s-2],a[s]);break;case 139:this.$=a[s-8],r.updateLinkInterpolate([a[s-6]],a[s-2]),r.updateLink([a[s-6]],a[s]);break;case 140:this.$=a[s-8],r.updateLinkInterpolate(a[s-6],a[s-2]),r.updateLink(a[s-6],a[s]);break;case 141:this.$=a[s-6],r.updateLinkInterpolate([a[s-4]],a[s]);break;case 142:this.$=a[s-6],r.updateLinkInterpolate(a[s-4],a[s]);break;case 143:case 145:this.$=[a[s]];break;case 144:case 146:a[s-2].push(a[s]),this.$=a[s-2];break;case 148:this.$=a[s-1]+a[s];break;case 196:this.$=a[s];break;case 197:case 199:this.$=a[s-1]+``+a[s];break;case 200:this.$={stmt:`dir`,value:`TB`};break;case 201:this.$={stmt:`dir`,value:`BT`};break;case 202:this.$={stmt:`dir`,value:`RL`};break;case 203:this.$={stmt:`dir`,value:`LR`};break;case 204:this.$={stmt:`dir`,value:`TD`}}},`anonymous`),table:[{3:1,4:2,8:t,10:n,11:r,13:i},{1:[3]},e(a,o,{5:7}),{4:8,8:t,10:n,11:r,13:i},{4:9,8:t,10:n,11:r,13:i},{4:10,8:t,10:n,11:r,13:i},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:s,9:c,10:l,11:u,12:d,21:20,23:21,24:22,25:23,26:24,27:25,28:f,35:p,36:m,37:29,38:h,40:g,42:_,45:33,46:44,47:v,48:45,50:46,63:y,87:b,88:x,89:S,90:C,91:w,92:T,105:E,108:D,109:O,112:k,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:ne,127:re,128:F},e(a,[2,10]),e(a,[2,11]),e(a,[2,12]),e(a,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:I,16:59,19:62},e(L,[2,3]),e(L,[2,4]),e(L,[2,5]),e(L,[2,6]),e(L,[2,7]),e(L,[2,8]),e(L,[2,9]),{8:R,9:z,10:B,12:V,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:R,9:z,10:B,12:V,22:75},{8:R,9:z,10:B,12:V,22:76},{8:R,9:z,10:B,12:V,22:77},{8:R,9:z,10:B,12:V,22:78},{8:R,9:z,10:B,12:V,22:79},{8:R,9:z,10:B,11:[1,80],12:V,22:81},{8:R,9:z,10:B,12:V,22:82},{11:[1,83]},e(L,[2,48]),{39:[1,84]},{41:[1,85]},e(L,[2,51]),e(ie,[2,63],{19:86,34:87,11:I,43:ae}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:oe,47:se,63:ce,83:[1,96],92:le,98:[1,93],100:[1,94],104:95,108:ue,109:de,112:fe,114:pe,117:me,118:he,119:ge,123:97},e(L,[2,200]),e(L,[2,201]),e(L,[2,202]),e(L,[2,203]),e(L,[2,204]),e(_e,[2,64]),e(_e,[2,67],{49:[1,109]}),e(H,[2,85],{116:122,30:[1,110],47:v,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:y,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:T,105:E,108:D,109:O,112:k,114:j,117:M,118:N,119:P}),e(U,[2,196]),e(U,[2,157]),e(U,[2,158]),e(U,[2,159]),e(U,[2,160]),e(U,[2,161]),e(U,[2,162]),e(U,[2,163]),e(U,[2,164]),e(U,[2,165]),e(U,[2,166]),e(U,[2,167]),e(a,[2,14]),e(a,[2,20]),e(a,[2,21]),{10:[1,123]},e(a,[2,23]),e(ve,[2,31],{19:124,11:I}),e(L,[2,32]),{45:125,46:44,47:v,48:45,50:46,63:y,92:T,105:E,108:D,109:O,112:k,114:j,116:47,117:M,118:N,119:P},e(L,[2,52]),e(L,[2,53]),e(L,[2,54]),e(L,[2,55]),e(ye,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:be,84:xe,119:Se,122:Ce},{78:[1,135],80:[1,136]},e(we,[2,96]),e(L,[2,33]),e(L,[2,34]),e(L,[2,35]),e(L,[2,36]),e(L,[2,37]),{11:Te,13:Ee,15:De,28:Oe,29:137,33:ke,35:Ae,36:je,47:Me,63:Ne,78:Pe,83:Fe,84:Ie,86:150,87:Le,88:Re,89:ze,90:Be,91:Ve,92:He,93:Ue,94:138,108:We,112:Ge,114:Ke,117:qe,118:Je,119:Ye},e(Xe,o,{5:165}),e(Xe,o,{5:166}),{11:Te,13:Ee,15:De,28:Oe,29:167,33:ke,35:Ae,36:je,47:Me,63:Ne,78:Pe,83:Fe,84:Ie,86:150,87:Le,88:Re,89:ze,90:Be,91:Ve,92:He,93:Ue,94:138,108:We,112:Ge,114:Ke,117:qe,118:Je,119:Ye},e(L,[2,49]),e(L,[2,50]),e(ie,[2,61],{47:Ze}),e(ie,[2,62],{19:169,11:I,43:Qe}),e(_e,[2,57]),{47:v,50:171,63:y,92:T,105:E,108:D,109:O,112:k,114:j,116:47,117:M,118:N,119:P},{105:[1,172],106:173,108:[1,174]},{47:v,50:175,63:y,92:T,105:E,108:D,109:O,112:k,114:j,116:47,117:M,118:N,119:P},{47:v,50:176,63:y,92:T,105:E,108:D,109:O,112:k,114:j,116:47,117:M,118:N,119:P},e(W,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},e(W,[2,130],{123:181,11:[1,180],15:oe,47:se,63:ce,92:le,108:ue,109:de,112:fe,114:pe,117:me,118:he,119:ge}),e(W,[2,132],{11:[1,182]}),e(G,[2,198]),e(G,[2,185]),e(G,[2,186]),e(G,[2,187]),e(G,[2,188]),e(G,[2,189]),e(G,[2,190]),e(G,[2,191]),e(G,[2,192]),e(G,[2,193]),e(G,[2,194]),e(G,[2,195]),{47:v,50:183,63:y,92:T,105:E,108:D,109:O,112:k,114:j,116:47,117:M,118:N,119:P},{31:184,70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},{31:192,70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},{31:194,53:[1,193],70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},{31:195,70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},{31:196,70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},{31:197,70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},{112:[1,198]},{31:199,70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},{31:200,68:[1,201],70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},{31:202,70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},{31:203,70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},{31:204,70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},e(U,[2,197]),e(a,[2,22]),e(ve,[2,30]),e(ie,[2,59],{34:205,19:206,11:I,43:ae}),e(ye,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},{80:[1,210],82:211,119:Se,122:Ce},e($e,[2,92]),e($e,[2,94]),e($e,[2,95]),e($e,[2,183]),e($e,[2,184]),{79:212,82:130,83:be,84:xe,119:Se,122:Ce},e(we,[2,97]),{8:R,9:z,10:B,11:Te,12:V,13:Ee,15:De,22:214,28:Oe,30:[1,213],33:ke,34:215,35:Ae,36:je,43:ae,47:Me,63:Ne,78:Pe,86:150,87:Le,88:Re,89:ze,90:Be,91:Ve,92:He,93:Ue,94:216,108:We,112:Ge,114:Ke,117:qe,118:Je,119:Ye},e(Q,[2,116]),e(Q,[2,118]),e(Q,[2,119]),e(Q,[2,172]),e(Q,[2,173]),e(Q,[2,174]),e(Q,[2,175]),e(Q,[2,176]),e(Q,[2,177]),e(Q,[2,178]),e(Q,[2,179]),e(Q,[2,180]),e(Q,[2,181]),e(Q,[2,182]),e(Q,[2,103]),e(Q,[2,104]),e(Q,[2,105]),e(Q,[2,106]),e(Q,[2,107]),e(Q,[2,108]),e(Q,[2,109]),e(Q,[2,110]),e(Q,[2,111]),e(Q,[2,112]),e(Q,[2,113]),e(Q,[2,114]),e(Q,[2,115]),{6:13,7:14,8:s,9:c,10:l,11:u,12:d,21:20,23:21,24:22,25:23,26:24,27:25,28:f,33:[1,217],35:p,36:m,37:29,38:h,40:g,42:_,45:33,46:44,47:v,48:45,50:46,63:y,87:b,88:x,89:S,90:C,91:w,92:T,105:E,108:D,109:O,112:k,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:ne,127:re,128:F},{6:13,7:14,8:s,9:c,10:l,11:u,12:d,21:20,23:21,24:22,25:23,26:24,27:25,28:f,33:[1,218],35:p,36:m,37:29,38:h,40:g,42:_,45:33,46:44,47:v,48:45,50:46,63:y,87:b,88:x,89:S,90:C,91:w,92:T,105:E,108:D,109:O,112:k,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:ne,127:re,128:F},{8:R,9:z,10:B,11:Te,12:V,13:Ee,15:De,22:220,28:Oe,30:[1,219],33:ke,34:221,35:Ae,36:je,43:ae,47:Me,63:Ne,78:Pe,86:150,87:Le,88:Re,89:ze,90:Be,91:Ve,92:He,93:Ue,94:216,108:We,112:Ge,114:Ke,117:qe,118:Je,119:Ye},{11:I,19:222},{47:[1,223]},e(_e,[2,56]),{11:[1,224],47:v,63:y,92:T,105:E,108:D,109:O,112:k,114:j,116:122,117:M,118:N,119:P},{11:[1,225]},{11:[1,226],109:[1,227]},e(et,[2,143]),{11:[1,228],47:v,63:y,92:T,105:E,108:D,109:O,112:k,114:j,116:122,117:M,118:N,119:P},{11:[1,229],47:v,63:y,92:T,105:E,108:D,109:O,112:k,114:j,116:122,117:M,118:N,119:P},{83:[1,230]},e(W,[2,124],{11:[1,231]}),e(W,[2,126],{11:[1,232]}),{83:[1,233]},e(G,[2,199]),{83:[1,234],101:[1,235]},e(_e,[2,68],{116:122,47:v,63:y,92:T,105:E,108:D,109:O,112:k,114:j,117:M,118:N,119:P}),{32:[1,236],70:K,85:237,119:Y,120:X,121:Z},e(tt,[2,99]),e(tt,[2,101]),e(tt,[2,102]),e(tt,[2,168]),e(tt,[2,169]),e(tt,[2,170]),e(tt,[2,171]),{52:[1,238],70:K,85:237,119:Y,120:X,121:Z},{31:239,70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},{54:[1,240],70:K,85:237,119:Y,120:X,121:Z},{56:[1,241],70:K,85:237,119:Y,120:X,121:Z},{58:[1,242],70:K,85:237,119:Y,120:X,121:Z},{60:[1,243],70:K,85:237,119:Y,120:X,121:Z},{63:[1,244]},{67:[1,245],70:K,85:237,119:Y,120:X,121:Z},{69:[1,246],70:K,85:237,119:Y,120:X,121:Z},{31:247,70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},{32:[1,248],70:K,85:237,119:Y,120:X,121:Z},{70:K,72:[1,249],74:[1,250],85:237,119:Y,120:X,121:Z},{70:K,72:[1,252],74:[1,251],85:237,119:Y,120:X,121:Z},e(ie,[2,58],{19:169,11:I,43:Qe}),e(ie,[2,60],{47:Ze}),e(ye,[2,88]),e(ye,[2,87]),{65:[1,253],70:K,85:237,119:Y,120:X,121:Z},e(ye,[2,90]),e($e,[2,93]),{80:[1,254],82:211,119:Se,122:Ce},{31:255,70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},e(Xe,o,{5:256}),{8:R,9:z,10:B,12:V,22:257,43:Qe},e(Q,[2,117]),e(L,[2,42]),e(L,[2,43]),{31:258,70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},e(L,[2,46]),{8:R,9:z,10:B,12:V,22:259,43:Qe},{46:260,47:v,48:45,50:46,63:y,92:T,105:E,108:D,109:O,112:k,114:j,116:47,117:M,118:N,119:P},{11:I,19:261},{11:nt,63:rt,87:it,95:262,108:at,110:263,111:264,112:ot,113:st,114:ct,115:lt},{11:nt,63:rt,87:it,95:273,107:[1,274],108:at,110:263,111:264,112:ot,113:st,114:ct,115:lt},{11:nt,63:rt,87:it,95:275,107:[1,276],108:at,110:263,111:264,112:ot,113:st,114:ct,115:lt},{108:[1,277]},{11:nt,63:rt,87:it,95:278,108:at,110:263,111:264,112:ot,113:st,114:ct,115:lt},{47:v,50:279,63:y,92:T,105:E,108:D,109:O,112:k,114:j,116:47,117:M,118:N,119:P},e(W,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},e(W,[2,131]),e(W,[2,133],{11:[1,283]}),e(W,[2,134]),e(H,[2,69]),e(tt,[2,100]),e(H,[2,70]),{54:[1,284],70:K,85:237,119:Y,120:X,121:Z},e(H,[2,77]),e(H,[2,72]),e(H,[2,73]),e(H,[2,74]),{112:[1,285]},e(H,[2,76]),e(H,[2,78]),{69:[1,286],70:K,85:237,119:Y,120:X,121:Z},e(H,[2,80]),e(H,[2,81]),e(H,[2,83]),e(H,[2,82]),e(H,[2,84]),e([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),e(ye,[2,91]),{32:[1,287],70:K,85:237,119:Y,120:X,121:Z},{6:13,7:14,8:s,9:c,10:l,11:u,12:d,21:20,23:21,24:22,25:23,26:24,27:25,28:f,33:[1,288],35:p,36:m,37:29,38:h,40:g,42:_,45:33,46:44,47:v,48:45,50:46,63:y,87:b,88:x,89:S,90:C,91:w,92:T,105:E,108:D,109:O,112:k,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:ne,127:re,128:F},e(Xe,o,{5:289}),{32:[1,290],70:K,85:237,119:Y,120:X,121:Z},e(L,[2,47]),e(_e,[2,66]),{46:291,47:v,48:45,50:46,63:y,92:T,105:E,108:D,109:O,112:k,114:j,116:47,117:M,118:N,119:P},e(W,[2,136],{109:ut}),e(dt,[2,145],{111:293,11:nt,63:rt,87:it,108:at,112:ot,113:st,114:ct,115:lt}),e($,[2,147]),e($,[2,149]),e($,[2,150]),e($,[2,151]),e($,[2,152]),e($,[2,153]),e($,[2,154]),e($,[2,155]),e($,[2,156]),e(W,[2,137],{109:ut}),{11:[1,294]},e(W,[2,138],{109:ut}),{11:[1,295]},e(et,[2,144]),e(W,[2,120],{109:ut}),e(W,[2,121],{116:122,47:v,63:y,92:T,105:E,108:D,109:O,112:k,114:j,117:M,118:N,119:P}),e(W,[2,125]),e(W,[2,127],{11:[1,296]}),e(W,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:R,9:z,10:B,12:V,22:301,34:302,43:ae},e(L,[2,40]),{6:13,7:14,8:s,9:c,10:l,11:u,12:d,21:20,23:21,24:22,25:23,26:24,27:25,28:f,33:[1,303],35:p,36:m,37:29,38:h,40:g,42:_,45:33,46:44,47:v,48:45,50:46,63:y,87:b,88:x,89:S,90:C,91:w,92:T,105:E,108:D,109:O,112:k,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:ne,127:re,128:F},{8:R,9:z,10:B,12:V,22:304,34:305,43:ae},e(_e,[2,65]),{11:nt,63:rt,87:it,108:at,110:306,111:264,112:ot,113:st,114:ct,115:lt},e($,[2,148]),{15:oe,47:se,63:ce,92:le,104:307,108:ue,109:de,112:fe,114:pe,117:me,118:he,119:ge,123:97},{15:oe,47:se,63:ce,92:le,104:308,108:ue,109:de,112:fe,114:pe,117:me,118:he,119:ge,123:97},{101:[1,309]},e(W,[2,135]),e(H,[2,71]),{31:310,70:K,83:q,84:J,85:185,119:Y,120:X,121:Z},e(H,[2,79]),e(Xe,o,{5:311}),{8:R,9:z,10:B,12:V,22:312,43:Qe},e(L,[2,41]),e(L,[2,44]),{8:R,9:z,10:B,12:V,22:313,43:Qe},e(dt,[2,146],{111:293,11:nt,63:rt,87:it,108:at,112:ot,113:st,114:ct,115:lt}),e(W,[2,141],{123:181,11:[1,314],15:oe,47:se,63:ce,92:le,108:ue,109:de,112:fe,114:pe,117:me,118:he,119:ge}),e(W,[2,142],{123:181,11:[1,315],15:oe,47:se,63:ce,92:le,108:ue,109:de,112:fe,114:pe,117:me,118:he,119:ge}),e(W,[2,129]),{32:[1,316],70:K,85:237,119:Y,120:X,121:Z},{6:13,7:14,8:s,9:c,10:l,11:u,12:d,21:20,23:21,24:22,25:23,26:24,27:25,28:f,33:[1,317],35:p,36:m,37:29,38:h,40:g,42:_,45:33,46:44,47:v,48:45,50:46,63:y,87:b,88:x,89:S,90:C,91:w,92:T,105:E,108:D,109:O,112:k,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:ne,127:re,128:F},e(Xe,o,{5:318}),e(L,[2,45]),{11:nt,63:rt,87:it,95:319,108:at,110:263,111:264,112:ot,113:st,114:ct,115:lt},{11:nt,63:rt,87:it,95:320,108:at,110:263,111:264,112:ot,113:st,114:ct,115:lt},e(H,[2,75]),e(L,[2,38]),{6:13,7:14,8:s,9:c,10:l,11:u,12:d,21:20,23:21,24:22,25:23,26:24,27:25,28:f,33:[1,321],35:p,36:m,37:29,38:h,40:g,42:_,45:33,46:44,47:v,48:45,50:46,63:y,87:b,88:x,89:S,90:C,91:w,92:T,105:E,108:D,109:O,112:k,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:ne,127:re,128:F},e(W,[2,139],{109:ut}),e(W,[2,140],{109:ut}),e(L,[2,39])],defaultActions:{},parseError:A(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:A(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,c=0,l=0,u=0,d=2,f=1,p=a.slice.call(arguments,1),m=Object.create(this.lexer),h={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(h.yy[g]=this.yy[g]);m.setInput(e,h.yy),h.yy.lexer=m,h.yy.parser=this,m.yylloc===void 0&&(m.yylloc={});var _=m.yylloc;a.push(_);var v=m.options&&m.options.ranges;this.parseError=typeof h.yy.parseError==`function`?h.yy.parseError:Object.getPrototypeOf(this).parseError;function y(e){n.length-=2*e,i.length-=e,a.length-=e}A(y,`popStack`);function b(){var e=r.pop()||m.lex()||f;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}A(b,`lex`);for(var x,S,C,w,T,E={},D,O,k,j;;){if(C=n[n.length-1],this.defaultActions[C]?w=this.defaultActions[C]:(x??=b(),w=o[C]&&o[C][x]),w===void 0||!w.length||!w[0]){var M=``;for(D in j=[],o[C])this.terminals_[D]&&D>d&&j.push(`'`+this.terminals_[D]+`'`);M=m.showPosition?`Parse error on line `+(c+1)+`:
23
+ `+m.showPosition()+`
24
+ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[x]||x)+`'`:`Parse error on line `+(c+1)+`: Unexpected `+(x==f?`end of input`:`'`+(this.terminals_[x]||x)+`'`),this.parseError(M,{text:m.match,token:this.terminals_[x]||x,line:m.yylineno,loc:_,expected:j})}if(w[0]instanceof Array&&w.length>1)throw Error(`Parse Error: multiple actions possible at state: `+C+`, token: `+x);switch(w[0]){case 1:n.push(x),i.push(m.yytext),a.push(m.yylloc),n.push(w[1]),x=null,S?(x=S,S=null):(l=m.yyleng,s=m.yytext,c=m.yylineno,_=m.yylloc,u>0&&u--);break;case 2:if(O=this.productions_[w[1]][1],E.$=i[i.length-O],E._$={first_line:a[a.length-(O||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(O||1)].first_column,last_column:a[a.length-1].last_column},v&&(E._$.range=[a[a.length-(O||1)].range[0],a[a.length-1].range[1]]),T=this.performAction.apply(E,[s,l,c,h.yy,w[1],i,a].concat(p)),T!==void 0)return T;O&&(n=n.slice(0,-1*O*2),i=i.slice(0,-1*O),a=a.slice(0,-1*O)),n.push(this.productions_[w[1]][0]),i.push(E.$),a.push(E._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},`parse`)};ft.lexer=(function(){return{EOF:1,parseError:A(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:A(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:A(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:A(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:A(function(){return this._more=!0,this},`more`),reject:A(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
25
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:A(function(e){this.unput(this.match.slice(e))},`less`),pastInput:A(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:A(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:A(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
26
+ `+t+`^`},`showPosition`),test_match:A(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:A(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
27
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:A(function(){return this.next()||this.lex()},`lex`),begin:A(function(e){this.conditionStack.push(e)},`begin`),popState:A(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:A(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:A(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:A(function(e){this.begin(e)},`pushState`),stateStackSize:A(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:A(function(e,t,n,r){switch(n){case 0:return this.begin(`acc_title`),38;case 1:return this.popState(),`acc_title_value`;case 2:return this.begin(`acc_descr`),40;case 3:return this.popState(),`acc_descr_value`;case 4:this.begin(`acc_descr_multiline`);break;case 5:this.popState();break;case 6:return`acc_descr_multiline_value`;case 7:return this.pushState(`shapeData`),t.yytext=``,43;case 8:return this.pushState(`shapeDataStr`),43;case 9:return this.popState(),43;case 10:return t.yytext=t.yytext.replace(/\n\s*/g,`<br/>`),43;case 11:return 43;case 12:this.popState();break;case 13:this.begin(`callbackname`);break;case 14:this.popState();break;case 15:this.popState(),this.begin(`callbackargs`);break;case 16:return 98;case 17:this.popState();break;case 18:return 99;case 19:return`MD_STR`;case 20:this.popState();break;case 21:this.begin(`md_string`);break;case 22:return`STR`;case 23:this.popState();break;case 24:this.pushState(`string`);break;case 25:return 87;case 26:return 105;case 27:return 88;case 28:return 107;case 29:return 89;case 30:return 90;case 31:return 100;case 32:this.begin(`click`);break;case 33:this.popState();break;case 34:return 91;case 35:return e.lex.firstGraph()&&this.begin(`dir`),13;case 36:return e.lex.firstGraph()?(this.begin(`dir`),13):112;case 37:return 28;case 38:return 36;case 39:return 35;case 40:return 33;case 41:case 42:case 43:case 44:return 101;case 45:return this.popState(),14;case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:return this.popState(),15;case 56:return 124;case 57:return 125;case 58:return 126;case 59:return 127;case 60:return 128;case 61:return 81;case 62:return 108;case 63:return 114;case 64:return 49;case 65:return 63;case 66:return 47;case 67:return 9;case 68:return 109;case 69:return 118;case 70:return this.popState(),80;case 71:return this.pushState(`edgeText`),78;case 72:return 122;case 73:return 80;case 74:break;case 75:return this.popState(),56;case 76:return`TEXT`;case 77:return this.pushState(`ellipseText`),55;case 78:return this.popState(),58;case 79:return this.pushState(`text`),57;case 80:return this.popState(),60;case 81:return this.pushState(`text`),59;case 82:return 61;case 83:return this.pushState(`text`),70;case 84:return this.popState(),67;case 85:return this.pushState(`text`),66;case 86:return this.popState(),52;case 87:return this.pushState(`text`),51;case 88:break;case 89:return this.popState(),72;case 90:return this.popState(),74;case 91:return 120;case 92:return this.pushState(`trapText`),71;case 93:return this.pushState(`trapText`),73;case 94:return 121;case 95:return 70;case 96:return 93;case 97:return`SEP`;case 98:return 92;case 99:return 118;case 100:return 114;case 101:return 47;case 102:return 8;case 103:return 112;case 104:return 117;case 105:return 119;case 106:return this.popState(),65;case 107:return this.pushState(`text`),65;case 108:return this.popState(),54;case 109:return this.pushState(`text`),53;case 110:return this.popState(),32;case 111:return this.pushState(`text`),30;case 112:return this.popState(),69;case 113:return this.pushState(`text`),68;case 114:break;case 115:return`TEXT`;case 116:return`QUOTE`;case 117:return 10;case 118:return 11;case 119:return 12}},`anonymous`),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:agentflow-beta\b)/,/^(?:agentflow(?=[\s;]|$))/,/^(?:flow\b)/,/^(?:connector\b)/,/^(?:global\b[ \t]*)/,/^(?:end\b[ \t]*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*--+[x>]\s*)/,/^(?:\s*--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*-\.+-\s*)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|(?:[^\\\[\]\(\)\{\}\/%]+|(?!))+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:[ \t]*%%(?!\{)[^\n]*)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:(?:[^\[\]\(\)\{\}\|\"%]+|(?!))+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},shapeData:{rules:[8,11,12,21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},callbackargs:{rules:[17,18,21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},callbackname:{rules:[14,15,16,21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},href:{rules:[21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},click:{rules:[21,24,33,34,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},edgeText:{rules:[21,24,70,72,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},trapText:{rules:[21,24,77,79,81,85,87,88,89,90,91,92,93,107,109,111,113],inclusive:!1},ellipseText:{rules:[21,24,74,75,76,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},text:{rules:[21,24,77,78,79,80,81,84,85,86,87,92,93,106,107,108,109,110,111,112,113,114,115],inclusive:!1},vertex:{rules:[21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},acc_descr:{rules:[3,21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},acc_title:{rules:[1,21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},md_string:{rules:[19,20,21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},string:{rules:[21,22,23,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,77,79,81,82,83,85,87,92,93,94,95,96,97,98,99,100,101,102,103,104,105,107,109,111,113,116,117,118,119],inclusive:!0}}}})();function pt(){this.yy={}}return A(pt,`Parser`),pt.prototype=ft,ft.Parser=pt,new pt})();me.parser=me;var he=me,ge=Object.assign({},he);ge.parse=e=>{let t=e.replace(/}[^\S\n]*\n/g,`}
28
+ `);return he.parse(t)};var _e=ge,H=A(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!o(t,r))return``;let i=w(e.look),a=c(n),s=g(e.THEME_COLOR_LIMIT,r),l=A(e=>r[e%r.length],`border`),u=A(e=>a?`fill: ${n[e%n.length]};`:``,`fill`),d=``;for(let e of V){let t=R.get(e),n=`[data-look="${i}"].node.${B(e)}`;d+=`
29
+
30
+ ${n} rect,
31
+ ${n} path,
32
+ ${n} polygon {
33
+ stroke: ${l(t)};
34
+ ${u(t)}
35
+ }
36
+ `}for(let e=0;e<ie(s);e++){let t=ae(e,s),n=`[data-look="${i}"][data-color-id="color-${t}"].cluster`,r=`[data-look="${i}"][data-color-id="color-${t}"].node`,a=A(e=>`${n} ${e}, ${r} ${e}`,`rule`);d+=`
37
+
38
+ ${a(`rect`)},
39
+ ${a(`path`)} {
40
+ stroke: ${l(t)};
41
+ ${u(t)}
42
+ }
43
+ `}return d},`genColor`),U=A((e,t)=>{let n=y,r=n(e,`r`),i=n(e,`g`),a=n(e,`b`);return b(r,i,a,t)},`fade`),ve={parser:_e,get db(){return new fe},renderer:pe,styles:A(e=>`${H(e)}
44
+ .label {
45
+ font-family: ${e.fontFamily};
46
+ color: ${e.nodeTextColor||e.textColor};
47
+ }
48
+ .cluster-label text {
49
+ fill: ${e.titleColor};
50
+ }
51
+ .cluster-label span {
52
+ color: ${e.titleColor};
53
+ }
54
+ .cluster-label span p {
55
+ background-color: transparent;
56
+ }
57
+
58
+ .label text,span {
59
+ fill: ${e.nodeTextColor||e.textColor};
60
+ color: ${e.nodeTextColor||e.textColor};
61
+ }
62
+
63
+ .node rect,
64
+ .node circle,
65
+ .node ellipse,
66
+ .node polygon,
67
+ .node path {
68
+ fill: ${e.mainBkg};
69
+ stroke: ${e.nodeBorder};
70
+ stroke-width: ${e.strokeWidth??1}px;
71
+ }
72
+ .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {
73
+ text-anchor: middle;
74
+ }
75
+ .node .katex path {
76
+ fill: ${e.nodeTextColor||e.textColor};
77
+ stroke: ${e.nodeTextColor||e.textColor};
78
+ stroke-width: 1px;
79
+ }
80
+
81
+ .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {
82
+ text-align: center;
83
+ }
84
+ .node.clickable {
85
+ cursor: pointer;
86
+ }
87
+
88
+
89
+ .root .anchor path {
90
+ fill: ${e.lineColor} !important;
91
+ stroke-width: 0;
92
+ stroke: ${e.lineColor};
93
+ }
94
+
95
+ .arrowheadPath {
96
+ fill: ${e.arrowheadColor};
97
+ }
98
+
99
+ .edgePaths .path {
100
+ stroke: ${e.lineColor};
101
+ stroke-width: ${e.strokeWidth??2}px;
102
+ }
103
+
104
+ .flowchart-link {
105
+ stroke: ${e.lineColor};
106
+ fill: none;
107
+ }
108
+
109
+ .edgeLabel {
110
+ background-color: ${e.edgeLabelBackground};
111
+ p {
112
+ background-color: ${e.edgeLabelBackground};
113
+ }
114
+ rect {
115
+ opacity: 0.5;
116
+ background-color: ${e.edgeLabelBackground};
117
+ fill: ${e.edgeLabelBackground};
118
+ }
119
+ text-align: center;
120
+ }
121
+
122
+ /* For html labels only */
123
+ .labelBkg {
124
+ background-color: ${U(e.edgeLabelBackground,.5)};
125
+ }
126
+
127
+ .cluster rect {
128
+ fill: ${e.clusterBkg};
129
+ stroke: ${e.clusterBorder};
130
+ stroke-width: 1px;
131
+ }
132
+
133
+ .flow-cluster rect {
134
+ fill: none;
135
+ stroke: ${e.clusterBorder};
136
+ stroke-width: 0.75px;
137
+ }
138
+
139
+ .node .collapsed-indicator {
140
+ fill: ${e.nodeBorder};
141
+ stroke: none;
142
+ stroke-width: 0;
143
+ opacity: 0.5;
144
+ }
145
+
146
+ .node .collapsed-separator {
147
+ stroke-width: 0.75px;
148
+ }
149
+
150
+ .cluster text {
151
+ fill: ${e.titleColor};
152
+ }
153
+
154
+ .cluster span {
155
+ color: ${e.titleColor};
156
+ }
157
+ /* .cluster div {
158
+ color: ${e.titleColor};
159
+ } */
160
+
161
+ div.mermaidTooltip {
162
+ position: absolute;
163
+ text-align: center;
164
+ max-width: 200px;
165
+ padding: 2px;
166
+ font-family: ${e.fontFamily};
167
+ font-size: 12px;
168
+ background: ${e.tertiaryColor};
169
+ border: 1px solid ${e.border2};
170
+ border-radius: 2px;
171
+ pointer-events: none;
172
+ z-index: 100;
173
+ }
174
+
175
+ .agentflowTitleText {
176
+ text-anchor: middle;
177
+ font-size: 18px;
178
+ fill: ${e.textColor};
179
+ }
180
+
181
+ rect.text {
182
+ fill: none;
183
+ stroke-width: 0;
184
+ }
185
+
186
+ .icon-shape, .image-shape {
187
+ background-color: ${e.edgeLabelBackground};
188
+ p {
189
+ background-color: ${e.edgeLabelBackground};
190
+ padding: 2px;
191
+ }
192
+ .label rect {
193
+ opacity: 0.5;
194
+ background-color: ${e.edgeLabelBackground};
195
+ fill: ${e.edgeLabelBackground};
196
+ }
197
+ text-align: center;
198
+ }
199
+ ${t()}
200
+ `,`getStyles`),init:A(e=>{e.agentflow??={},e.layout&&M({layout:e.layout}),e.flowchart??={},e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,M({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}})},`init`)};export{ve as diagram};
@@ -0,0 +1,30 @@
1
+ import{t as e}from"./chunk-JWPE2WC7-COMTgl4A.js";import{t}from"./chunk-2Q5K7J3B-DKYFIUDS.js";import{Bn as n,Cn as r,En as i,In as a,It as o,Ln as s,Qn as c,Rn as l,Sn as u,St as d,V as f,gn as p,tr as m,wn as h,xn as g,xt as _,yn as v}from"./index-LgGsGSUh.js";import{n as y}from"./mermaid-parser.core-D9IKLdIu.js";var b=/[─━│┃└┗├┣]/,x=/[└┗├┣]/,S=/[─━]/,C=/^[\s│┃]+$/,w=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,T=/^\s*%%/,E=` `;function D(e){return e.some(e=>b.test(e))}m(D,`isBoxDrawingFormat`);function O(e){for(let t of e){let e=x.exec(t);if(e?.index&&e.index>0)return e.index}return 4}m(O,`inferSegmentWidth`);function k(e,t){return e.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let r=parseInt(n,10),i=t.get(r);return i?`line ${i}`:e})}m(k,`remapErrorLines`);function A(e){let t=e.split(`
2
+ `),n=new Map,r=-1;for(let[e,n]of t.entries())if(n.trim()===`treeView-beta`){r=e;break}if(r===-1)return{text:e,lineMap:n};let i=[];for(let e=r+1;e<t.length;e++){let n=t[e];n.trim()===``||T.test(n)||w.test(n)||C.test(n)||i.push(n.replace(/\t/g,` `))}if(!D(i))return{text:e,lineMap:n};let a=O(i),o=[],s=0;for(let e=0;e<=r;e++)o.push(t[e]),s++,n.set(s,e+1);for(let e=r+1;e<t.length;e++){let r=t[e],i=r.trim(),c=e+1;if(i===``||T.test(r)||w.test(r)){o.push(r),s++,n.set(s,c);continue}if(C.test(r))continue;let l=r.replace(/\t/g,` `),u=x.exec(l);if(u?.index!==void 0){let e=u.index,t=Math.round(e/a)+1,r=e+1;for(;r<l.length&&S.test(l[r]);)r++;for(;r<l.length&&l[r]===` `;)r++;let i=l.slice(r).trimEnd();if(!i)throw Error(`Line ${c}: Empty node \u2014 expected a filename or directory name after the box-drawing prefix`);let d=E.repeat(t);o.push(d+i),s++,n.set(s,c)}else if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;else if(b.test(l))o.push(r),s++,n.set(s,c);else if(/^\s+/.test(l))throw Error(`Line ${c}: Unexpected indentation without box-drawing characters. In box-drawing format, use \u251C\u2500\u2500 or \u2514\u2500\u2500 prefixes for indented nodes.`);else o.push(r),s++,n.set(s,c)}return{text:o.join(`
3
+ `),lineMap:n}}m(A,`preprocessBoxDrawing`);var j=new t(()=>({cnt:1,stack:[{id:0,level:-1,name:`/`,nodeType:`directory`,children:[]}]})),M=m(()=>{j.reset(),p()},`clear`),N=m(()=>j.records.stack[0],`getRoot`),P=m(()=>j.records.cnt,`getCount`),F=g.treeView,I={clear:M,addNode:m((e,t,n,r,i,a)=>{for(;e<=j.records.stack[j.records.stack.length-1].level;)j.records.stack.pop();let o={id:j.records.cnt++,level:e,name:t,nodeType:n,icon:i,cssClass:r,description:a,children:[]};j.records.stack[j.records.stack.length-1].children.push(o),j.records.stack.push(o)},`addNode`),getRoot:N,getCount:P,getConfig:m(()=>f(F,h().treeView),`getConfig`),getAccTitle:r,getAccDescription:u,getDiagramTitle:i,setAccDescription:s,setAccTitle:l,setDiagramTitle:n},L=m(t=>{e(t,I);for(let e of t.nodes){let t=typeof e.indent==`number`?e.indent:0,n=e.name,r=n.endsWith(`/`);r&&(n=n.slice(0,-1));let i=r?`directory`:`file`,o=e.classAnnotation||void 0,s=e.iconAnnotation,c=s===void 0?void 0:s||`none`,l=e.descAnnotation||void 0,u=l?a(l,h()):void 0;I.addNode(t,n,i,o,c,u)}},`populate`),R={parse:m(async e=>{let{text:t,lineMap:n}=A(e);try{let e=await y(`treeView`,t);c.debug(e),L(e)}catch(e){throw n.size>0&&e instanceof Error&&(e.message=k(e.message,n)),e}},`parse`)},z={prefix:`mermaid-treeview`,height:24,width:24,icons:{folder:{body:`<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>`},file:{body:`<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>`}}};function B(e,t){let n=t?.filenameIcons?.[e];if(n)return n;let r=e.lastIndexOf(`.`);if(r>0){let n=e.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[n]??i?.[n.slice(1)]}}m(B,`detectIcon`);function V(e,t){return e.includes(`:`)?e:e in z.icons||!t?`${z.prefix}:${e}`:`${t}:${e}`}m(V,`qualifyIcon`);function H(e,t){if(e.icon!==`none`){if(e.icon)return V(e.icon,t.defaultIconPack);if(t.showIcons){if(e.nodeType===`file`){let n=B(e.name,t);if(n===`none`)return;if(n)return V(n,t.defaultIconPack)}return`${z.prefix}:${e.nodeType===`directory`?`folder`:`file`}`}}}m(H,`getNodeIcon`),d([{name:z.prefix,icons:z}]);var U=14,W=4,G=16,K=m(async(e,t)=>{let n=[],r=m(e=>{let i=H(e,t);i&&n.push({icon:i,node:e}),e.children.forEach(r)},`collect`);r(e);let i=await Promise.all(n.map(async({icon:e,node:t})=>({id:t.id,svg:await _(e,{height:U,width:U})})));return new Map(i.map(({id:e,svg:t})=>[e,t]))},`resolveNodeIcons`),q=m((e,t,n,r,i,a)=>{let o=r.append(`g`),s=`treeView-node-label`;n.nodeType===`directory`&&(s+=` treeView-node-dir`),n.cssClass&&(s+=` ${n.cssClass}`);let c=U+W,l=H(n,i),u=l!==void 0;l&&o.append(`g`).attr(`class`,`treeView-node-icon`).attr(`transform`,`translate(${e+i.paddingX}, ${t+i.paddingY})`).html(a.get(n.id)??``);let d=o.append(`text`).text(n.name).attr(`dominant-baseline`,`middle`).attr(`class`,s),{height:f,width:p}=d.node().getBBox(),m=f+i.paddingY*2,h=e+i.paddingX+(u?c:0);d.attr(`x`,h),d.attr(`y`,t+m/2);let g=h+p;return n.BBox={x:e,y:t,width:p+i.paddingX*2+(u?c:0),height:m},n.cssClass?.split(/\s+/).includes(`highlight`)&&o.insert(`rect`,`:first-child`).attr(`x`,e).attr(`y`,t+1).attr(`width`,0).attr(`height`,m-2).attr(`rx`,3).attr(`class`,`treeView-highlight-bg`),{node:n,nodeGroup:o,labelRightEdge:g,centerY:t+m/2}},`positionLabel`),J=m((e,t,n,r,i,a)=>e.append(`line`).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i).attr(`stroke-width`,a).attr(`class`,`treeView-node-line`),`positionLine`),Y=m((e,t,n,r)=>{let i=0,a=0,o=[],s=m((e,t,n,s)=>{let c=s*(n.rowIndent+n.paddingX),l=q(c,i,t,e,n,r);o.push(l);let{height:u,width:d}=t.BBox;J(e,c-n.rowIndent,i+u/2,c,i+u/2,n.lineThickness),a=Math.max(a,c+d),i+=u},`drawNode`),c=m((t,r=0)=>{s(e,t,n,r),t.children.forEach(e=>{c(e,r+1)});let{x:i,y:a,height:o}=t.BBox;if(t.children.length){let{y:r,height:s}=t.children[t.children.length-1].BBox;J(e,i+n.paddingX,a+o,i+n.paddingX,r+s/2+n.lineThickness/2,n.lineThickness)}},`processNode`);c(t);let l=o.filter(e=>e.node.description);if(l.length>0){let e=Math.max(...o.map(e=>e.labelRightEdge))+G;for(let t of l){let r=t.nodeGroup.append(`text`).text(t.node.description).attr(`dominant-baseline`,`middle`).attr(`class`,`treeView-node-description`).attr(`x`,e).attr(`y`,t.centerY).node().getBBox();a=Math.max(a,e+r.width+n.paddingX)}}for(let e of o)if(e.node.cssClass?.split(/\s+/).includes(`highlight`)){let t=e.nodeGroup.select(`.treeView-highlight-bg`);if(!t.empty()){let n=a-e.node.BBox.x+8;t.attr(`width`,n),a=Math.max(a,e.node.BBox.x+n+2)}}return{totalHeight:i,totalWidth:a}},`drawTree`),X={draw:m(async(e,t,n,r)=>{c.debug(`Rendering treeView diagram
4
+ `+e);let i=r.db,a=i.getRoot(),s=i.getConfig(),l=o(t),u=l.append(`g`);u.attr(`class`,`tree-view`);let{totalHeight:d,totalWidth:f}=Y(u,a,s,await K(a,s));l.attr(`viewBox`,`-${s.lineThickness/2} 0 ${f} ${d}`),v(l,d,f,s.useMaxWidth)},`draw`)},Z={labelFontSize:`16px`,labelColor:`black`,lineColor:`black`,iconColor:`#546e7a`,descriptionColor:`#6a9955`,highlightBg:`rgba(255, 193, 7, 0.15)`,highlightStroke:`#ffc107`},Q={db:I,renderer:X,parser:R,styles:m(({treeView:e})=>{let{labelFontSize:t,labelColor:n,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:o,highlightStroke:s}=f(Z,e);return`
5
+ .treeView-node-label {
6
+ font-size: ${t};
7
+ fill: ${n};
8
+ white-space: pre;
9
+ }
10
+ .treeView-node-dir {
11
+ font-weight: bold;
12
+ }
13
+ .treeView-node-line {
14
+ stroke: ${r};
15
+ }
16
+ .treeView-node-icon {
17
+ color: ${i};
18
+ }
19
+ .treeView-node-description {
20
+ font-size: ${t};
21
+ fill: ${a};
22
+ font-style: italic;
23
+ white-space: pre;
24
+ }
25
+ .treeView-highlight-bg {
26
+ fill: ${o};
27
+ stroke: ${s};
28
+ stroke-width: 1;
29
+ }
30
+ `},`styles`)};export{Q as diagram};