@staticbolt/docs 0.0.1-beta.3 → 0.0.1-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +16 -19
  2. package/lib/index.d.mts +62 -35
  3. package/lib/mermaid/abnfDiagram-PAR5IXJI-Ibbj5eGO.js +1 -0
  4. package/lib/mermaid/architecture-7GRP2DOG-M7G3SWCO-BJAoKIRD.js +1 -0
  5. package/lib/mermaid/architectureDiagram-2PNWDENW-CI3fLWIN.js +36 -0
  6. package/lib/mermaid/blockDiagram-PUWGUBOA-DAfWpjz7.js +129 -0
  7. package/lib/mermaid/c4Diagram-3NLNHZP5-at-f4FDi.js +38 -0
  8. package/lib/mermaid/chunk-2NMSUPJH-DuxvnX1p.js +1 -0
  9. package/lib/mermaid/chunk-32MCUW2P-D8U-Oy6M.js +206 -0
  10. package/lib/mermaid/chunk-3NPNU5GP-8WYybYAh.js +1 -0
  11. package/lib/mermaid/chunk-3SMGFRGC-C0WC5bhP.js +1 -0
  12. package/lib/mermaid/chunk-4CAJECRU-C_QnaDal.js +15 -0
  13. package/lib/mermaid/chunk-4OADUZ5Q-DHE3k_pb.js +10 -0
  14. package/lib/mermaid/chunk-5IMINLNL-Cl3N81sR.js +1 -0
  15. package/lib/mermaid/chunk-5IQCK5RY-Df5Ppxew.js +3 -0
  16. package/lib/mermaid/chunk-5MVFYWFU-DgXg5u6h.js +1 -0
  17. package/lib/mermaid/chunk-AQ6EADP3-CZhslHi-.js +1 -0
  18. package/lib/mermaid/chunk-AZZRMDJM-y-xJBuMz.js +15 -0
  19. package/lib/mermaid/chunk-CLS4B6BI-BRLlisnG.js +168 -0
  20. package/lib/mermaid/chunk-DZP67EKU-9RpG5Rdc.js +70 -0
  21. package/lib/mermaid/chunk-EICP7K5X-8YS1Gtlr.js +1 -0
  22. package/lib/mermaid/chunk-GDY2UAB4-QtXfmDIW.js +1 -0
  23. package/lib/mermaid/chunk-H7VHZCWX-CwFRFlEn.js +1 -0
  24. package/lib/mermaid/chunk-IJBDOHL6-CgcssvZb.js +1 -0
  25. package/lib/mermaid/chunk-JFFVMJIA-Cx1_ZSMR.js +1 -0
  26. package/lib/mermaid/chunk-JQRUD6KW-Dbva2Z17.js +1 -0
  27. package/lib/mermaid/chunk-JZGDI5JK-BspJQ1vQ.js +1 -0
  28. package/lib/mermaid/chunk-KD6SPIPN-4bKl37hM.js +2 -0
  29. package/lib/mermaid/chunk-NF366YI6-D1lnbapv.js +231 -0
  30. package/lib/mermaid/chunk-NUDPKBEF-CL0e9XiQ.js +34 -0
  31. package/lib/mermaid/chunk-OJINMHTS-rKnCIFV0.js +1 -0
  32. package/lib/mermaid/chunk-Q6NGPIAH-CM9NYxWM.js +2 -0
  33. package/lib/mermaid/chunk-QJSWEUOL-kvKBktmc.js +133 -0
  34. package/lib/mermaid/chunk-R7JDMUKV-CSyCOfYj.js +1 -0
  35. package/lib/mermaid/chunk-RCXAM2GK-BeKcutEV.js +1 -0
  36. package/lib/mermaid/chunk-RT4MAWR3-Cv_8LyN5.js +1 -0
  37. package/lib/mermaid/chunk-SFMINX4W-BW2NSwFJ.js +1 -0
  38. package/lib/mermaid/chunk-SLDQ463B-D15xTdNW.js +88 -0
  39. package/lib/mermaid/chunk-STOV2HOB-GnExfzIX.js +1 -0
  40. package/lib/mermaid/chunk-T5OCTHI4-DdZvN-9i.js +1 -0
  41. package/lib/mermaid/chunk-TCEHX7R3-BXjgPiQF.js +1 -0
  42. package/lib/mermaid/chunk-VQC2EELJ-sGo2yn97.js +1 -0
  43. package/lib/mermaid/chunk-VRZKL3EH-BzaZ6KlD.js +1 -0
  44. package/lib/mermaid/chunk-VTHDQ7BV-BqUEu5Ml.js +1 -0
  45. package/lib/mermaid/chunk-VY2OSTJR-BYk2nUI_.js +2 -0
  46. package/lib/mermaid/chunk-WUBWJARI-Z8MI6quX.js +1 -0
  47. package/lib/mermaid/chunk-YBMQ5JGJ-DlZ1nCKo.js +2 -0
  48. package/lib/mermaid/chunk-YDMLL4PJ-BHgx6nXf.js +1 -0
  49. package/lib/mermaid/chunk-Z6V44ARX-CWGOZvke.js +62 -0
  50. package/lib/mermaid/chunk-ZJJ7VQJP-CZ7qJzqZ.js +340 -0
  51. package/lib/mermaid/chunk-ZNLK7HRR-B-wIfXTw.js +1 -0
  52. package/lib/mermaid/chunk-ZQN7UHIL-CNp35E78.js +1 -0
  53. package/lib/mermaid/chunk-ZS6VBONO-D-IFTJgn.js +175 -0
  54. package/lib/mermaid/chunk-ZUNWM646-DRKPDcQl.js +1 -0
  55. package/lib/mermaid/classDiagram-FGAMPOII-D1sf64vv.js +1 -0
  56. package/lib/mermaid/classDiagram-v2-AI5RJEK4-D1sf64vv.js +1 -0
  57. package/lib/mermaid/cose-bilkent-Q72C2OJ3-iX90typn.js +1 -0
  58. package/lib/mermaid/cynefin-OW5HDTMX-6OCTWOGG-6jDAiaRu.js +1 -0
  59. package/lib/mermaid/cynefinDiagram-2OOWUY4M-5ACKe62t.js +62 -0
  60. package/lib/mermaid/dagre-MPVFI544-BUrJjGwd.js +4 -0
  61. package/lib/mermaid/diagram-AE4NWXFW-B3Lkw8MS.js +24 -0
  62. package/lib/mermaid/diagram-BUJID5UG-p2ajLLgr.js +41 -0
  63. package/lib/mermaid/diagram-C44CZ5NI-CO0U1GX-.js +24 -0
  64. package/lib/mermaid/diagram-EYOLEXXS-DDoUndBV.js +30 -0
  65. package/lib/mermaid/diagram-P7B6PWOJ-C_dSNQyG.js +3 -0
  66. package/lib/mermaid/ebnfDiagram-FTPZ3PV6-DIwB5te0.js +1 -0
  67. package/lib/mermaid/erDiagram-H3ERR26V-CN4pCzIq.js +99 -0
  68. package/lib/mermaid/eventmodeling-NTZA5JFV-WKSWQHFS-Ruta89_N.js +1 -0
  69. package/lib/mermaid/flowDiagram-YHGXBVSY-CrSHzFwR.js +1 -0
  70. package/lib/mermaid/ganttDiagram-RWFTB7ED-C-rfEOn5.js +292 -0
  71. package/lib/mermaid/gitGraph-4MIJSDKK-JH2HKYUO-B76vihW5.js +1 -0
  72. package/lib/mermaid/gitGraphDiagram-MAR6GKOP-peAd7EYO.js +106 -0
  73. package/lib/mermaid/index.js +15 -0
  74. package/lib/mermaid/info-A6RAGUB7-3TX3OFWW-DykwOJ0Z.js +1 -0
  75. package/lib/mermaid/infoDiagram-LV547AFH-C46dOKDG.js +2 -0
  76. package/lib/mermaid/ishikawaDiagram-PUJQGNDS-DUmHXvO9.js +70 -0
  77. package/lib/mermaid/journeyDiagram-EW5QJT4W-CNAhUHsQ.js +139 -0
  78. package/lib/mermaid/kanban-definition-JSQERAZB-uOEoksHt.js +89 -0
  79. package/lib/mermaid/katex-CZ4GXH2S-CaEE-8Xf.js +257 -0
  80. package/lib/mermaid/mindmap-definition-VBJCLQLM-DZceCWFq.js +96 -0
  81. package/lib/mermaid/packet-AYTQ26CC-MKII6P3Y-XqJQX7OO.js +1 -0
  82. package/lib/mermaid/pegDiagram-7WILOQTJ-DMKA8PUf.js +1 -0
  83. package/lib/mermaid/pie-WAS4IAKB-6B4OPMJ5-DpoRuAye.js +1 -0
  84. package/lib/mermaid/pieDiagram-EFA7CBSB-BzO4xw8C.js +39 -0
  85. package/lib/mermaid/quadrantDiagram-WARVYA7P-DMQd2xKZ.js +7 -0
  86. package/lib/mermaid/radar-RG4KPBEZ-UPTR3XUL-BcwE6tO1.js +1 -0
  87. package/lib/mermaid/railroad-74A4TZTK-MEFUPFMS-B2Kwx3Uk.js +1 -0
  88. package/lib/mermaid/railroad-abnf-HS5TGJTU-R5YG2S5D-uBY3fYzG.js +1 -0
  89. package/lib/mermaid/railroad-ebnf-LZEXJU2U-G5QEX2L6-AhpzdU_3.js +1 -0
  90. package/lib/mermaid/railroad-peg-WCYAUIDC-H5I2ZRY2-CrsmP7-8.js +1 -0
  91. package/lib/mermaid/railroadDiagram-5NIQVNLQ-BGyZ628g.js +1 -0
  92. package/lib/mermaid/requirementDiagram-SXREGOKZ-CtCO7u9U.js +84 -0
  93. package/lib/mermaid/sankeyDiagram-VV74M2VP-CPXqmSKK.js +40 -0
  94. package/lib/mermaid/sequenceDiagram-52ZFIFDL-B1rSqWZp.js +162 -0
  95. package/lib/mermaid/sizeCapture-FGA5AGYP-BEqQzsxs.js +1 -0
  96. package/lib/mermaid/stateDiagram-3QAKPIVI-3KzWPUq3.js +1 -0
  97. package/lib/mermaid/stateDiagram-v2-HN2P4RDZ-dXASbYMy.js +1 -0
  98. package/lib/mermaid/swimlanes-QLVP42QD-CLpR90IY.js +1 -0
  99. package/lib/mermaid/swimlanesDiagram-JKPDBFCN-C2sgVGQE.js +8 -0
  100. package/lib/mermaid/timeline-definition-GS45XAXW-DLn0_RV5.js +120 -0
  101. package/lib/mermaid/treeView-Q6P3EWNA-ZRJGANNQ-u1bD1sZ1.js +1 -0
  102. package/lib/mermaid/treemap-WGGIJYW6-K64VN5AS-DrIaTBlj.js +1 -0
  103. package/lib/mermaid/vennDiagram-QIQU2ZRJ-FxbUp7-Z.js +34 -0
  104. package/lib/mermaid/wardley-WFR3VGLG-D67OWCCH-Br9hyuFK.js +1 -0
  105. package/lib/mermaid/wardleyDiagram-U6YNM66N-l-Kvr0Az.js +78 -0
  106. package/lib/mermaid/xychartDiagram-XJAZEDNM-O9bztWNh.js +7 -0
  107. package/lib/plugins.mjs +213 -162
  108. package/package.json +3 -10
  109. package/sources/parts/document/document.part.html +7 -7
  110. package/sources/parts/header/header.part.html +2 -2
  111. package/sources/parts/header/header.style.css +4 -2
  112. package/sources/parts/mermaid/mermaid.part.html +1 -1
  113. package/sources/parts/pagefind/pagefind.part.html +5 -3
  114. package/sources/parts/sidebar/sidebar.part.html +1 -1
  115. package/sources/parts/sidebar/sidebar.style.css +10 -0
  116. package/sources/parts/table-of-content/table-of-content-desktop.part.html +2 -2
  117. package/sources/scripts/mermaid.ts +3 -1
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{C as t,D as n,E as r,O as i,S as a,T as o,_ as s,a as c,b as l,c as u,d,f,g as p,h as m,i as h,k as g,l as ee,m as te,n as _,o as v,p as y,r as ne,s as re,t as b,u as x,v as S,w as ie,x as C,y as w}from"./chunk-4CAJECRU-C_QnaDal.js";function T(e,t,n,r){var a;do a=i(r);while(e.hasNode(a));return n.dummy=t,e.setNode(a,n),a}e(T,`addDummyNode`);function ae(e){var t=new v().setGraph(e.graph());return b(e.nodes(),function(n){t.setNode(n,e.node(n))}),b(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}e(ae,`simplify`);function E(e){var t=new v({multigraph:e.isMultigraph()}).setGraph(e.graph());return b(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),b(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}e(E,`asNonCompoundGraph`);function D(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}}e(D,`intersectRect`);function O(e){var t=f(C(k(e)+1),function(){return[]});return b(e.nodes(),function(r){var i=e.node(r),a=i.rank;n(a)||(t[a][i.order]=r)}),t}e(O,`buildLayerMatrix`);function oe(e){var t=_(f(e.nodes(),function(t){return e.node(t).rank}));b(e.nodes(),function(n){var i=e.node(n);r(i,`rank`)&&(i.rank-=t)})}e(oe,`normalizeRanks`);function se(e){var t=_(f(e.nodes(),function(t){return e.node(t).rank})),r=[];b(e.nodes(),function(n){var i=e.node(n).rank-t;r[i]||(r[i]=[]),r[i].push(n)});var i=0,a=e.graph().nodeRankFactor;b(r,function(t,r){n(t)&&r%a!==0?--i:i&&b(t,function(t){e.node(t).rank+=i})})}e(se,`removeEmptyRanks`);function ce(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),T(e,`border`,i,t)}e(ce,`addBorderNode`);function k(e){return m(f(e.nodes(),function(t){var r=e.node(t).rank;if(!n(r))return r}))}e(k,`maxRank`);function le(e,t){var n={lhs:[],rhs:[]};return b(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}e(le,`partition`);function ue(e,t){var n=re();try{return t()}finally{console.log(e+` time: `+(re()-n)+`ms`)}}e(ue,`time`);function de(e,t){return t()}e(de,`notime`);function fe(t){function n(e){var r=t.children(e),i=t.node(e);if(r.length&&b(r,n),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)A(t,`borderLeft`,`_bl`,e,i,a),A(t,`borderRight`,`_br`,e,i,a)}}e(n,`dfs`),b(t.children(),n)}e(fe,`addBorderSegments`);function A(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=T(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}e(A,`addBorderNode`);function pe(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&j(e)}e(pe,`adjust`);function me(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&he(e),(t===`lr`||t===`rl`)&&(ge(e),j(e))}e(me,`undo`);function j(e){b(e.nodes(),function(t){M(e.node(t))}),b(e.edges(),function(t){M(e.edge(t))})}e(j,`swapWidthHeight`);function M(e){var t=e.width;e.width=e.height,e.height=t}e(M,`swapWidthHeightOne`);function he(e){b(e.nodes(),function(t){N(e.node(t))}),b(e.edges(),function(t){var n=e.edge(t);b(n.points,N),Object.prototype.hasOwnProperty.call(n,`y`)&&N(n)})}e(he,`reverseY`);function N(e){e.y=-e.y}e(N,`reverseYOne`);function ge(e){b(e.nodes(),function(t){P(e.node(t))}),b(e.edges(),function(t){var n=e.edge(t);b(n.points,P),Object.prototype.hasOwnProperty.call(n,`x`)&&P(n)})}e(ge,`swapXY`);function P(e){var t=e.x;e.x=e.y,e.y=t}e(P,`swapXYOne`);var _e=class{static{e(this,`List`)}constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return F(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&F(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,ve)),n=n._prev;return`[`+e.join(`, `)+`]`}};function F(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}e(F,`unlink`);function ve(e,t){if(e!==`_next`&&e!==`_prev`)return t}e(ve,`filterOutLinks`);var ye=s(1);function be(e,t){if(e.nodeCount()<=1)return[];var n=Se(e,t||ye),r=xe(n.graph,n.buckets,n.zeroIdx);return x(f(r,function(t){return e.outEdges(t.v,t.w)}))}e(be,`greedyFAS`);function xe(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)I(e,t,n,o);for(;o=i.dequeue();)I(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(I(e,t,n,o,!0));break}}}return r}e(xe,`doGreedyFAS`);function I(e,t,n,r,i){var a=i?[]:void 0;return b(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,L(t,n,s)}),b(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,L(t,n,o)}),e.removeNode(r.v),a}e(I,`removeNode`);function Se(e,t){var n=new v,r=0,i=0;b(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),b(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=C(i+r+3).map(function(){return new _e}),o=r+1;return b(n.nodes(),function(e){L(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}e(Se,`buildState`);function L(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)}e(L,`assignBucket`);function Ce(t){var n=t.graph().acyclicer===`greedy`?be(t,r(t)):we(t);b(n,function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,i(`rev`))});function r(e){return function(t){return e.edge(t).weight}}e(r,`weightFn`)}e(Ce,`run`);function we(t){var n=[],r={},i={};function a(e){Object.prototype.hasOwnProperty.call(i,e)||(i[e]=!0,r[e]=!0,b(t.outEdges(e),function(e){Object.prototype.hasOwnProperty.call(r,e.w)?n.push(e):a(e.w)}),delete r[e])}return e(a,`dfs`),b(t.nodes(),a),n}e(we,`dfsFAS`);function Te(e){b(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)}})}e(Te,`undo`);function Ee(e){e.graph().dummyChains=[],b(e.edges(),function(t){De(e,t)})}e(Ee,`run`);function De(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;for(d=0,++r;r<a;++d,++r)s.points=[],l={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},u=T(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)}}e(De,`normalizeEdge`);function Oe(e){b(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)})}e(Oe,`undo`);function R(t){var n={};function r(e){var i=t.node(e);if(Object.prototype.hasOwnProperty.call(n,e))return i.rank;n[e]=!0;var a=_(f(t.outEdges(e),function(e){return r(e.w)-t.edge(e).minlen}));return(a===1/0||a==null)&&(a=0),i.rank=a}e(r,`dfs`),b(t.sources(),r)}e(R,`longestPath`);function z(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}e(z,`slack`);function B(e){var t=new v({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;ke(t,e)<r;)i=Ae(t,e),a=t.hasNode(i.v)?z(e,i):-z(e,i),je(t,e,a);return t}e(B,`feasibleTree`);function ke(t,n){function r(e){b(n.nodeEdges(e),function(i){var a=i.v,o=e===a?i.w:a;!t.hasNode(o)&&!z(n,i)&&(t.setNode(o,{}),t.setEdge(e,o,{}),r(o))})}return e(r,`dfs`),b(t.nodes(),r),t.nodeCount()}e(ke,`tightTree`);function Ae(e,t){return h(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return z(t,n)})}e(Ae,`findMinSlackEdge`);function je(e,t,n){b(e.nodes(),function(e){t.node(e).rank+=n})}e(je,`shiftRanks`),s(1),s(1),Me.CycleException=V;function Me(t){var n={},r={},i=[];function a(e){if(Object.prototype.hasOwnProperty.call(r,e))throw new V;Object.prototype.hasOwnProperty.call(n,e)||(r[e]=!0,n[e]=!0,b(t.predecessors(e),a),delete r[e],i.push(e))}if(e(a,`visit`),b(t.sinks(),a),ie(n)!==t.nodeCount())throw new V;return i}e(Me,`topsort`);function V(){}e(V,`CycleException`),V.prototype=Error();function H(e,n,r){t(n)||(n=[n]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],o={};return b(n,function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);U(e,t,r===`post`,o,i,a)}),a}e(H,`dfs`);function U(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),b(i(t),function(t){U(e,t,n,r,i,a)}),n&&a.push(t))}e(U,`doDfs`);function Ne(e,t){return H(e,t,`post`)}e(Ne,`postorder`);function Pe(e,t){return H(e,t,`pre`)}e(Pe,`preorder`),W.initLowLimValues=q,W.initCutValues=G,W.calcCutValue=K,W.leaveEdge=Y,W.enterEdge=X,W.exchangeEdges=Ie;function W(e){e=ae(e),R(e);var t=B(e);q(t),G(t,e);for(var n,r;n=Y(t);)r=X(t,e,n),Ie(t,e,n,r)}e(W,`networkSimplex`);function G(e,t){var n=Ne(e,e.nodes());n=n.slice(0,n.length-1),b(n,function(n){Fe(e,t,n)})}e(G,`initCutValues`);function Fe(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=K(e,t,n)}e(Fe,`assignCutValue`);function K(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,b(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,Re(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}e(K,`calcCutValue`);function q(e,t){arguments.length<2&&(t=e.nodes()[0]),J(e,{},1,t)}e(q,`initLowLimValues`);function J(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,b(e.neighbors(r),function(i){Object.prototype.hasOwnProperty.call(t,i)||(n=J(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}e(J,`dfsAssignLowLim`);function Y(e){return S(e.edges(),function(t){return e.edge(t).cutvalue<0})}e(Y,`leaveEdge`);function X(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,l=!1;a.lim>o.lim&&(s=o,l=!0);var u=c(t.edges(),function(t){return l===ze(e,e.node(t.v),s)&&l!==ze(e,e.node(t.w),s)});return h(u,function(e){return z(t,e)})}e(X,`enterEdge`);function Ie(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),q(e),G(e,t),Le(e,t)}e(Ie,`exchangeEdges`);function Le(e,t){var n=Pe(e,S(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),b(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)})}e(Le,`updateRanks`);function Re(e,t,n){return e.hasEdge(t,n)}e(Re,`isTreeEdge`);function ze(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e(ze,`isDescendant`);function Be(e){switch(e.graph().ranker){case`network-simplex`:Z(e);break;case`tight-tree`:He(e);break;case`longest-path`:Ve(e);break;default:Z(e)}}e(Be,`rank`);var Ve=R;function He(e){R(e),B(e)}e(He,`tightTreeRanker`);function Z(e){W(e)}e(Z,`networkSimplexRanker`);function Ue(e){var t=T(e,`root`,{},`_root`),n=Ge(e),r=m(u(n))-1,i=2*r+1;e.graph().nestingRoot=t,b(e.edges(),function(t){e.edge(t).minlen*=i});var a=Ke(e)+1;b(e.children(),function(o){We(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}e(Ue,`run`);function We(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});return}var c=ce(e,`_bt`),l=ce(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,b(s,function(s){We(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]})}e(We,`dfs`);function Ge(t){var n={};function r(e,i){var a=t.children(e);a&&a.length&&b(a,function(e){r(e,i+1)}),n[e]=i}return e(r,`dfs`),b(t.children(),function(e){r(e,1)}),n}e(Ge,`treeDepths`);function Ke(e){return d(e.edges(),function(t,n){return t+e.edge(n).weight},0)}e(Ke,`sumWeights`);function qe(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,b(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}e(qe,`cleanup`);function Je(e,t,n){var r={},i;b(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}})}e(Je,`addSubgraphConstraints`);function Ye(e,t,r){var i=Xe(e),a=new v({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(function(t){return e.node(t)});return b(e.nodes(),function(o){var s=e.node(o),c=e.parent(o);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(o),a.setParent(o,c||i),b(e[r](o),function(t){var r=t.v===o?t.w:t.v,i=a.edge(r,o),s=n(i)?0:i.weight;a.setEdge(r,o,{weight:e.edge(t).weight+s})}),Object.prototype.hasOwnProperty.call(s,`minRank`)&&a.setNode(o,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))}),a}e(Ye,`buildLayerGraph`);function Xe(e){for(var t;e.hasNode(t=i(`_root`)););return t}e(Xe,`createRootNode`);function Ze(e,t){for(var n=0,r=1;r<t.length;++r)n+=Qe(e,t[r-1],t[r]);return n}e(Ze,`crossCount`);function Qe(e,t,n){for(var r=te(n,f(n,function(e,t){return t})),i=x(f(t,function(t){return w(f(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=f(Array(o),function(){return 0}),c=0;return b(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}e(Qe,`twoLayerCrossCount`);function $e(t){var n={},i=c(t.nodes(),function(e){return!t.children(e).length}),a=m(f(i,function(e){return t.node(e).rank})),o=f(C(a+1),function(){return[]});function s(e){r(n,e)||(n[e]=!0,o[t.node(e).rank].push(e),b(t.successors(e),s))}e(s,`dfs`);var l=w(i,function(e){return t.node(e).rank});return b(l,s),o}e($e,`initOrder`);function et(e,t){return f(t,function(t){var n=e.inEdges(t);if(n.length){var r=d(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}})}e(et,`barycenter`);function tt(e,t){var r={};return b(e,function(e,t){var i=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};n(e.barycenter)||(i.barycenter=e.barycenter,i.weight=e.weight)}),b(t.edges(),function(e){var t=r[e.v],i=r[e.w];!n(t)&&!n(i)&&(i.indegree++,t.out.push(r[e.w]))}),nt(c(r,function(e){return!e.indegree}))}e(tt,`resolveConflicts`);function nt(t){var r=[];function i(e){return function(t){t.merged||(n(t.barycenter)||n(e.barycenter)||t.barycenter>=e.barycenter)&&rt(e,t)}}e(i,`handleIn`);function o(e){return function(n){n.in.push(e),--n.indegree===0&&t.push(n)}}for(e(o,`handleOut`);t.length;){var s=t.pop();r.push(s),b(s.in.reverse(),i(s)),b(s.out,o(s))}return f(c(r,function(e){return!e.merged}),function(e){return a(e,[`vs`,`i`,`barycenter`,`weight`])})}e(nt,`doResolveConflicts`);function rt(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}e(rt,`mergeEntries`);function it(e,t){var n=le(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=w(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(ot(!!t)),c=at(a,i,c),b(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=at(a,i,c)});var l={vs:x(a)};return s&&(l.barycenter=o/s,l.weight=s),l}e(it,`sort`);function at(e,t,n){for(var r;t.length&&(r=p(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}e(at,`consumeUnsortable`);function ot(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}}e(ot,`compareWithBias`);function st(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,l={};o&&(i=c(i,function(e){return e!==o&&e!==s}));var u=et(e,i);b(u,function(t){if(e.children(t.v).length){var i=st(e,t.v,n,r);l[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&lt(t,i)}});var d=tt(u,n);ct(d,l);var f=it(d,r);if(o&&(f.vs=x([o,f.vs,s]),e.predecessors(o).length)){var p=e.node(e.predecessors(o)[0]),m=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(f,`barycenter`)||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+m.order)/(f.weight+2),f.weight+=2}return f}e(st,`sortSubgraph`);function ct(e,t){b(e,function(e){e.vs=x(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}e(ct,`expandSubgraphs`);function lt(e,t){n(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)}e(lt,`mergeBarycenters`);function ut(e){var t=k(e),n=dt(e,C(1,t+1),`inEdges`),r=dt(e,C(t-1,-1,-1),`outEdges`),i=$e(e);pt(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){ft(s%2?n:r,s%4>=2),i=O(e);var l=Ze(e,i);l<a&&(c=0,o=ne(i),a=l)}pt(e,o)}e(ut,`order`);function dt(e,t,n){return f(t,function(t){return Ye(e,t,n)})}e(dt,`buildLayerGraphs`);function ft(e,t){var n=new v;b(e,function(e){var r=e.graph().root,i=st(e,r,n,t);b(i.vs,function(t,n){e.node(t).order=n}),Je(e,n,i.vs)})}e(ft,`sweepLayerGraphs`);function pt(e,t){b(t,function(t){b(t,function(t,n){e.node(t).order=n})})}e(pt,`assignOrder`);function mt(e){var t=gt(e);b(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=ht(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]}})}e(mt,`parentDummyChains`);function ht(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}}e(ht,`findPath`);function gt(t){var n={},r=0;function i(e){var a=r;b(t.children(e),i),n[e]={low:a,lim:r++}}return e(i,`dfs`),b(t.children(),i),n}e(gt,`postorder`);function _t(t,n){var r={};function i(e,n){var i=0,a=0,o=e.length,s=p(n);return b(n,function(e,c){var l=yt(t,e),u=l?t.node(l).order:o;(l||e===s)&&(b(n.slice(a,c+1),function(e){b(t.predecessors(e),function(n){var a=t.node(n),o=a.order;(o<i||u<o)&&!(a.dummy&&t.node(e).dummy)&&bt(r,n,e)})}),a=c+1,i=u)}),n}return e(i,`visitLayer`),d(n,i),r}e(_t,`findType1Conflicts`);function vt(t,n){var r={};function i(e,n,i,a,o){var s;b(C(n,i),function(n){s=e[n],t.node(s).dummy&&b(t.predecessors(s),function(e){var n=t.node(e);n.dummy&&(n.order<a||n.order>o)&&bt(r,e,s)})})}e(i,`scan`);function a(e,n){var r=-1,a,o=0;return b(n,function(s,c){if(t.node(s).dummy===`border`){var l=t.predecessors(s);l.length&&(a=t.node(l[0]).order,i(n,o,c,r,a),o=c,r=a)}i(n,o,n.length,a,e.length)}),n}return e(a,`visitLayer`),d(n,a),r}e(vt,`findType2Conflicts`);function yt(e,t){if(e.node(t).dummy)return S(e.predecessors(t),function(t){return e.node(t).dummy})}e(yt,`findOtherInnerSegmentNode`);function bt(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})}e(bt,`addConflict`);function xt(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}e(xt,`hasConflict`);function St(e,t,n,r){var i={},a={},o={};return b(t,function(e){b(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),b(t,function(e){var t=-1;b(e,function(e){var s=r(e);if(s.length){s=w(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]&&!xt(n,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=o[d])}}})}),{root:i,align:a}}e(St,`verticalAlignment`);function Ct(t,n,r,i,a){var o={},s=wt(t,n,r,a),c=a?`borderLeft`:`borderRight`;function l(e,t){for(var n=s.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}e(l,`iterate`);function u(e){o[e]=s.inEdges(e).reduce(function(e,t){return Math.max(e,o[t.v]+s.edge(t))},0)}e(u,`pass1`);function d(e){var n=s.outEdges(e).reduce(function(e,t){return Math.min(e,o[t.w]-s.edge(t))},1/0),r=t.node(e);n!==1/0&&r.borderType!==c&&(o[e]=Math.max(o[e],n))}return e(d,`pass2`),l(u,s.predecessors.bind(s)),l(d,s.successors.bind(s)),b(i,function(e){o[e]=o[r[e]]}),o}e(Ct,`horizontalCompaction`);function wt(e,t,n,r){var i=new v,a=e.graph(),o=kt(a.nodesep,a.edgesep,r);return b(t,function(t){var r;b(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}e(wt,`buildBlockGraph`);function Tt(e,t){return h(u(t),function(t){var n=-1/0,r=1/0;return o(t,function(t,i){var a=At(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}e(Tt,`findSmallestWidthAlignment`);function Et(e,t){var n=u(t),r=_(n),i=m(n);b([`u`,`d`],function(n){b([`l`,`r`],function(a){var o=n+a,s=e[o],c;if(s!==t){var l=u(s);c=a===`l`?r-_(l):i-m(l),c&&(e[o]=g(s,function(e){return e+c}))}})})}e(Et,`alignCoordinates`);function Dt(e,t){return g(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=w(f(e,r));return(i[1]+i[2])/2})}e(Dt,`balance`);function Ot(e){var t=O(e),n=y(_t(e,t),vt(e,t)),r={},i;return b([`u`,`d`],function(a){i=a===`u`?t:u(t).reverse(),b([`l`,`r`],function(t){t===`r`&&(i=f(i,function(e){return u(e).reverse()}));var o=(a===`u`?e.predecessors:e.successors).bind(e),s=St(e,i,n,o),c=Ct(e,i,s.root,s.align,t===`r`);t===`r`&&(c=g(c,function(e){return-e})),r[a+t]=c})}),Et(r,Tt(e,r)),Dt(r,e.graph().align)}e(Ot,`positionX`);function kt(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}}e(kt,`sep`);function At(e,t){return e.node(t).width}e(At,`width`);function jt(e){e=E(e),Mt(e),l(Ot(e),function(t,n){e.node(n).x=t})}e(jt,`position`);function Mt(e){var t=O(e),n=e.graph().ranksep,r=0;b(t,function(t){var i=m(f(t,function(t){return e.node(t).height}));b(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}e(Mt,`positionY`);function Nt(e,t){var n=t&&t.debugTiming?ue:de;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>Wt(e));n(` runLayout`,()=>Pt(t,n)),n(` updateInputGraph`,()=>Ft(e,t))})}e(Nt,`layout`);function Pt(e,t){t(` makeSpaceForEdgeLabels`,()=>Gt(e)),t(` removeSelfEdges`,()=>en(e)),t(` acyclic`,()=>Ce(e)),t(` nestingGraph.run`,()=>Ue(e)),t(` rank`,()=>Be(E(e))),t(` injectEdgeLabelProxies`,()=>Kt(e)),t(` removeEmptyRanks`,()=>se(e)),t(` nestingGraph.cleanup`,()=>qe(e)),t(` normalizeRanks`,()=>oe(e)),t(` assignRankMinMax`,()=>qt(e)),t(` removeEdgeLabelProxies`,()=>Jt(e)),t(` normalize.run`,()=>Ee(e)),t(` parentDummyChains`,()=>mt(e)),t(` addBorderSegments`,()=>fe(e)),t(` order`,()=>ut(e)),t(` insertSelfEdges`,()=>tn(e)),t(` adjustCoordinateSystem`,()=>pe(e)),t(` position`,()=>jt(e)),t(` positionSelfEdges`,()=>nn(e)),t(` removeBorderNodes`,()=>$t(e)),t(` normalize.undo`,()=>Oe(e)),t(` fixupEdgeLabelCoords`,()=>Zt(e)),t(` undoCoordinateSystem`,()=>me(e)),t(` translateGraph`,()=>Yt(e)),t(` assignNodeIntersects`,()=>Xt(e)),t(` reversePoints`,()=>Qt(e)),t(` acyclic.undo`,()=>Te(e))}e(Pt,`runLayout`);function Ft(e,t){b(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))}),b(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}e(Ft,`updateInputGraph`);var It=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],Lt={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},Rt=[`acyclicer`,`ranker`,`rankdir`,`align`],zt=[`width`,`height`],Bt={width:0,height:0},Vt=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Ht={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Ut=[`labelpos`];function Wt(e){var t=new v({multigraph:!0,compound:!0}),n=$(e.graph());return t.setGraph(y({},Lt,Q(n,It),a(n,Rt))),b(e.nodes(),function(n){var r=$(e.node(n));t.setNode(n,ee(Q(r,zt),Bt)),t.setParent(n,e.parent(n))}),b(e.edges(),function(n){var r=$(e.edge(n));t.setEdge(n,y({},Ht,Q(r,Vt),a(r,Ut)))}),t}e(Wt,`buildLayoutGraph`);function Gt(e){var t=e.graph();t.ranksep/=2,b(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)})}e(Gt,`makeSpaceForEdgeLabels`);function Kt(e){b(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);T(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}e(Kt,`injectEdgeLabelProxies`);function qt(e){var t=0;b(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=m(t,r.maxRank))}),e.graph().maxRank=t}e(qt,`assignRankMinMax`);function Jt(e){b(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}e(Jt,`removeEdgeLabelProxies`);function Yt(t){var n=1/0,r=0,i=1/0,a=0,o=t.graph(),s=o.marginx||0,c=o.marginy||0;function l(e){var t=e.x,o=e.y,s=e.width,c=e.height;n=Math.min(n,t-s/2),r=Math.max(r,t+s/2),i=Math.min(i,o-c/2),a=Math.max(a,o+c/2)}e(l,`getExtremes`),b(t.nodes(),function(e){l(t.node(e))}),b(t.edges(),function(e){var n=t.edge(e);Object.prototype.hasOwnProperty.call(n,`x`)&&l(n)}),n-=s,i-=c,b(t.nodes(),function(e){var r=t.node(e);r.x-=n,r.y-=i}),b(t.edges(),function(e){var r=t.edge(e);b(r.points,function(e){e.x-=n,e.y-=i}),Object.prototype.hasOwnProperty.call(r,`x`)&&(r.x-=n),Object.prototype.hasOwnProperty.call(r,`y`)&&(r.y-=i)}),o.width=r-n+s,o.height=a-i+c}e(Yt,`translateGraph`);function Xt(e){b(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(D(r,a)),n.points.push(D(i,o))})}e(Xt,`assignNodeIntersects`);function Zt(e){b(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}})}e(Zt,`fixupEdgeLabelCoords`);function Qt(e){b(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}e(Qt,`reversePointsForReversedEdges`);function $t(e){b(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(p(n.borderLeft)),o=e.node(p(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}}),b(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}e($t,`removeBorderNodes`);function en(e){b(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)}})}e(en,`removeSelfEdges`);function tn(e){var t=O(e);b(t,function(t){var n=0;b(t,function(t,r){var i=e.node(t);i.order=r+n,b(i.selfEdges,function(t){T(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})})}e(tn,`insertSelfEdges`);function nn(e){b(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}})}e(nn,`positionSelfEdges`);function Q(e,t){return g(a(e,t),Number)}e(Q,`selectNumberAttrs`);function $(e){var t={};return b(e,function(e,n){t[n.toLowerCase()]=e}),t}e($,`canonicalize`);export{Nt as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{V as t}from"./chunk-H7VHZCWX-CwFRFlEn.js";var n=e((e,n)=>{let r;return n===`sandbox`&&(r=t(`#i`+e)),t(n===`sandbox`?r.nodes()[0].contentDocument.body:`body`).select(`[id="${e}"]`)},`getDiagramElement`);export{n as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{a as t,c as n,g as r,i,n as a,o,r as s,t as c,y as l}from"./chunk-ZS6VBONO-D-IFTJgn.js";var u=class extends i{static{e(this,`RailroadAbnfTokenBuilder`)}static{l(this,`RailroadAbnfTokenBuilder`)}constructor(){super([`railroad-abnf-beta`])}},d=class extends t{static{e(this,`RailroadAbnfValueConverter`)}static{l(this,`RailroadAbnfValueConverter`)}runConverter(e,t,n){let r=super.runConverter(e,t,n);if(e.name===`TITLE`&&typeof r==`string`){let e=r.trim();if(e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`))return e.slice(1,-1)}return r}runCustomConverter(e,t,n){if(e.name===`ABNF_STRING`)return t.slice(1,-1)}},f={parser:{TokenBuilder:l(()=>new u,`TokenBuilder`),ValueConverter:l(()=>new d,`ValueConverter`)}};function p(e=n){let t=s(o(e),a),i=s(c({shared:t}),r,f);return t.ServiceRegistry.register(i),{shared:t,RailroadAbnf:i}}e(p,`createRailroadAbnfServices`),l(p,`createRailroadAbnfServices`);export{p as n,f as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{a as t,c as n,i as r,n as i,o as a,r as o,t as s,u as c,y as l}from"./chunk-ZS6VBONO-D-IFTJgn.js";var u=class extends t{static{e(this,`TreeViewValueConverter`)}static{l(this,`TreeViewValueConverter`)}runCustomConverter(e,t,n){if(e.name===`INDENTATION`)return t?.length||0;if(e.name===`QUOTED_NAME`)return t.substring(1,t.length-1);if(e.name===`BARE_NAME`)return t.replace(/[\t ]+$/,``);if(e.name===`CLASS_ANNOTATION`)return t.trim().substring(3).trim();if(e.name===`ICON_ANNOTATION`){let e=t.trim();return e.substring(5,e.length-1)}if(e.name===`DESC_ANNOTATION`)return t.trim().substring(2).trim()}},d=class extends r{static{e(this,`TreeViewTokenBuilder`)}static{l(this,`TreeViewTokenBuilder`)}constructor(){super([`treeView-beta`])}},f={parser:{TokenBuilder:l(()=>new d,`TokenBuilder`),ValueConverter:l(()=>new u,`ValueConverter`)}};function p(e=n){let t=o(a(e),i),r=o(s({shared:t}),c,f);return t.ServiceRegistry.register(r),{shared:t,TreeView:r}}e(p,`createTreeViewServices`),l(p,`createTreeViewServices`);export{f as n,p as t};
@@ -0,0 +1,88 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{q as t}from"./chunk-H7VHZCWX-CwFRFlEn.js";import{B as n,M as r,O as i,h as a,l as o,y as s}from"./chunk-QJSWEUOL-kvKBktmc.js";import{t as c}from"./chunk-IJBDOHL6-CgcssvZb.js";var l=``,u=``,d=``,f=[],p=new Map,m=e(e=>s(e,n()),`sanitizeText`),h=e(e=>{switch(e.type){case`terminal`:return{...e,value:m(e.value)};case`nonterminal`:return{...e,name:m(e.name)};case`sequence`:return{...e,elements:e.elements.map(h)};case`choice`:return{...e,alternatives:e.alternatives.map(h)};case`optional`:return{...e,element:h(e.element)};case`repetition`:return{...e,element:h(e.element),separator:e.separator?h(e.separator):void 0};case`special`:return{...e,text:m(e.text)}}},`sanitizeAstNode`),g=e(()=>{l=``,u=``,d=``,f.length=0,p.clear(),a(),t.debug(`[Railroad] Database cleared`)},`clear`),_=e(e=>{l=m(e),t.debug(`[Railroad] Title set:`,e)},`setTitle`),v=e(()=>l,`getTitle`),y={clear:g,setTitle:_,getTitle:v,addRule:e(e=>{let n={...e,name:m(e.name),definition:h(e.definition),comment:e.comment?m(e.comment):void 0};t.debug(`[Railroad] Adding rule:`,n.name),p.has(n.name)&&t.warn(`[Railroad] Rule '${n.name}' is already defined. Overwriting.`),f.push(n),p.set(n.name,n)},`addRule`),getRules:e(()=>f,`getRules`),getRule:e(e=>p.get(e),`getRule`),setAccTitle:e(e=>{u=m(e).replace(/^\s+/g,``),t.debug(`[Railroad] Accessibility title set:`,e)},`setAccTitle`),getAccTitle:e(()=>u,`getAccTitle`),setAccDescription:e(e=>{d=m(e).replace(/\n\s+/g,`
2
+ `),t.debug(`[Railroad] Accessibility description set:`,e)},`setAccDescription`),getAccDescription:e(()=>d,`getAccDescription`),setDiagramTitle:_,getDiagramTitle:v},b={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:`monospace`,terminalFill:`#FFFFC0`,terminalStroke:`#000000`,terminalTextColor:`#000000`,nonTerminalFill:`#FFFFFF`,nonTerminalStroke:`#000000`,nonTerminalTextColor:`#000000`,lineColor:`#000000`,strokeWidth:2,markerFill:`#000000`,commentFill:`#E8E8E8`,commentStroke:`#888888`,commentTextColor:`#666666`,specialFill:`#F0E0FF`,specialStroke:`#8800CC`,ruleNameColor:`#000066`,showMarkers:!0,markerRadius:5},x=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,S=/^[\w "',.-]+$/,C=new Set([`compactMode`,`padding`,`verticalSeparation`,`horizontalSeparation`,`arcRadius`,`fontSize`,`fontFamily`,`terminalFill`,`terminalStroke`,`terminalTextColor`,`nonTerminalFill`,`nonTerminalStroke`,`nonTerminalTextColor`,`lineColor`,`strokeWidth`,`markerFill`,`commentFill`,`commentStroke`,`commentTextColor`,`specialFill`,`specialStroke`,`ruleNameColor`,`showMarkers`,`markerRadius`]),w=e(e=>e?Object.keys(e).every(e=>e===`railroad`||C.has(e)):!1,`isRailroadStyleOptions`),T=e(e=>e?`railroad`in e&&e.railroad?e.railroad:w(e)?e:{}:{},`extractRailroadOverrides`),E=e(e=>{if(!e||w(e))return{};let{railroad:t,svgId:n,theme:r,look:i,...a}=e;return a},`extractThemeOverrides`),D=e((e,t)=>{if(typeof e!=`string`)return t;let n=e.trim();return x.test(n)?n:t},`sanitizeColorValue`),O=e((e,t)=>{if(typeof e!=`string`)return t;let n=e.trim();return S.test(n)?n:t},`sanitizeFontFamilyValue`),k=e((e,t)=>{let n=typeof e==`number`?e:typeof e==`string`?Number.parseFloat(e):NaN;return Number.isFinite(n)&&n>=0?n:t},`sanitizeNumberValue`),A=e(e=>{let t=typeof e==`number`?e:typeof e==`string`?Number.parseFloat(e):NaN;return Number.isFinite(t)&&t>0?t:void 0},`parseThemeFontSize`),j=e(e=>{let t=O(e.fontFamily,b.fontFamily),n=A(e.fontSize)??b.fontSize;return{...b,fontFamily:t,fontSize:n,terminalFill:D(e.secondBkg??e.secondaryColor,b.terminalFill),terminalStroke:D(e.secondaryBorderColor??e.lineColor,b.terminalStroke),terminalTextColor:D(e.secondaryTextColor??e.textColor,b.terminalTextColor),nonTerminalFill:D(e.mainBkg??e.background,b.nonTerminalFill),nonTerminalStroke:D(e.primaryBorderColor??e.lineColor,b.nonTerminalStroke),nonTerminalTextColor:D(e.primaryTextColor??e.textColor,b.nonTerminalTextColor),lineColor:D(e.lineColor,b.lineColor),markerFill:D(e.lineColor,b.markerFill),commentFill:D(e.labelBackground??e.tertiaryColor,b.commentFill),commentStroke:D(e.tertiaryBorderColor??e.lineColor,b.commentStroke),commentTextColor:D(e.tertiaryTextColor??e.textColor,b.commentTextColor),specialFill:D(e.tertiaryColor??e.secondaryColor,b.specialFill),specialStroke:D(e.tertiaryBorderColor??e.secondaryBorderColor,b.specialStroke),ruleNameColor:D(e.titleColor??e.textColor,b.ruleNameColor)}},`buildThemeDefaults`),M=e(e=>{let t=o(),n=j({...r(),...t.themeVariables??{},...E(e)}),i={...t.railroad??{},...T(e)};return{compactMode:i.compactMode??n.compactMode,padding:k(i.padding,n.padding),verticalSeparation:k(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:k(i.horizontalSeparation,n.horizontalSeparation),arcRadius:k(i.arcRadius,n.arcRadius),fontSize:k(i.fontSize,n.fontSize),fontFamily:O(i.fontFamily,n.fontFamily),terminalFill:D(i.terminalFill,n.terminalFill),terminalStroke:D(i.terminalStroke,n.terminalStroke),terminalTextColor:D(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:D(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:D(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:D(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:D(i.lineColor,n.lineColor),strokeWidth:k(i.strokeWidth,n.strokeWidth),markerFill:D(i.markerFill,n.markerFill),commentFill:D(i.commentFill,n.commentFill),commentStroke:D(i.commentStroke,n.commentStroke),commentTextColor:D(i.commentTextColor,n.commentTextColor),specialFill:D(i.specialFill,n.specialFill),specialStroke:D(i.specialStroke,n.specialStroke),ruleNameColor:D(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:k(i.markerRadius,n.markerRadius)}},`buildRailroadStyleOptions`),N=e(e=>{let{fontFamily:t,fontSize:n,terminalFill:r,terminalStroke:i,terminalTextColor:a,nonTerminalFill:o,nonTerminalStroke:s,nonTerminalTextColor:c,lineColor:l,strokeWidth:u,markerFill:d,commentFill:f,commentStroke:p,commentTextColor:m,specialFill:h,specialStroke:g,ruleNameColor:_}=M(e);return`
3
+ .railroad-diagram {
4
+ font-family: ${t};
5
+ font-size: ${n}px;
6
+ }
7
+
8
+ .railroad-terminal rect {
9
+ fill: ${r};
10
+ stroke: ${i};
11
+ stroke-width: ${u}px;
12
+ }
13
+
14
+ .railroad-terminal text {
15
+ fill: ${a};
16
+ font-family: ${t};
17
+ font-size: ${n}px;
18
+ text-anchor: middle;
19
+ dominant-baseline: middle;
20
+ }
21
+
22
+ .railroad-nonterminal rect {
23
+ fill: ${o};
24
+ stroke: ${s};
25
+ stroke-width: ${u}px;
26
+ }
27
+
28
+ .railroad-nonterminal text {
29
+ fill: ${c};
30
+ font-family: ${t};
31
+ font-size: ${n}px;
32
+ text-anchor: middle;
33
+ dominant-baseline: middle;
34
+ }
35
+
36
+ .railroad-line {
37
+ stroke: ${l};
38
+ stroke-width: ${u}px;
39
+ fill: none;
40
+ }
41
+
42
+ .railroad-start circle,
43
+ .railroad-end circle {
44
+ fill: ${d};
45
+ }
46
+
47
+ .railroad-comment ellipse {
48
+ fill: ${f};
49
+ stroke: ${p};
50
+ stroke-width: ${u}px;
51
+ }
52
+
53
+ .railroad-comment text {
54
+ fill: ${m};
55
+ font-style: italic;
56
+ font-family: ${t};
57
+ font-size: ${n}px;
58
+ text-anchor: middle;
59
+ dominant-baseline: middle;
60
+ }
61
+
62
+ .railroad-special rect {
63
+ fill: ${h};
64
+ stroke: ${g};
65
+ stroke-width: ${u}px;
66
+ stroke-dasharray: 5,3;
67
+ }
68
+
69
+ .railroad-special text {
70
+ fill: ${c};
71
+ font-family: ${t};
72
+ font-size: ${n}px;
73
+ text-anchor: middle;
74
+ dominant-baseline: middle;
75
+ }
76
+
77
+ .railroad-rule-name {
78
+ font-weight: bold;
79
+ fill: ${_};
80
+ font-family: ${t};
81
+ font-size: ${n}px;
82
+ }
83
+
84
+ .railroad-group {
85
+ /* Grouping container, no specific styles */
86
+ }
87
+ `},`getStyles`),P=class{constructor(){this.d=``}static{e(this,`PathBuilder`)}moveTo(e,t){return this.d+=`M ${e} ${t} `,this}lineTo(e,t){return this.d+=`L ${e} ${t} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,t,n,r,i,a,o){return this.d+=`A ${e} ${t} ${n} ${+!!r} ${+!!i} ${a} ${o} `,this}build(){return this.d.trim()}},F=class{constructor(e,t=M()){this.textCache=new Map,this.svg=e,this.config=t}static{e(this,`RailroadRenderer`)}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);let t=this.svg.append(`text`).attr(`font-family`,this.config.fontFamily).attr(`font-size`,this.config.fontSize).text(e),n=t.node().getBBox(),r={width:n.width,height:n.height};return t.remove(),this.textCache.set(e,r),r}renderTerminal(e,t){let n=this.measureText(t),r=n.width+this.config.padding*2,i=n.height+this.config.padding*2,a=e.append(`g`).attr(`class`,`railroad-terminal`);return a.append(`rect`).attr(`x`,0).attr(`y`,0).attr(`width`,r).attr(`height`,i).attr(`rx`,10).attr(`ry`,10),a.append(`text`).attr(`x`,r/2).attr(`y`,i/2).text(t),{element:a.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderNonTerminal(e,t){let n=this.measureText(t),r=n.width+this.config.padding*2,i=n.height+this.config.padding*2,a=e.append(`g`).attr(`class`,`railroad-nonterminal`);return a.append(`rect`).attr(`x`,0).attr(`y`,0).attr(`width`,r).attr(`height`,i),a.append(`text`).attr(`x`,r/2).attr(`y`,i/2).text(t),{element:a.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderSequence(e,t){let n=t.map(t=>this.renderExpression(e,t)),r=0,i=0,a=0;for(let e of n)r+=e.dimensions.width,i=Math.max(i,e.dimensions.up),a=Math.max(a,e.dimensions.down);r+=(n.length-1)*this.config.horizontalSeparation;let o=e.append(`g`).attr(`class`,`railroad-sequence`),s=0;for(let e=0;e<n.length;e++){let t=n[e],r=i-t.dimensions.up;if(o.node().appendChild(t.element).setAttribute(`transform`,`translate(${s}, ${r})`),e<n.length-1){let e=s+t.dimensions.width,n=e+this.config.horizontalSeparation,r=i;o.append(`path`).attr(`class`,`railroad-line`).attr(`d`,new P().moveTo(e,r).lineTo(n,r).build())}s+=t.dimensions.width+this.config.horizontalSeparation}return{element:o.node(),dimensions:{width:r,height:i+a,up:i,down:a}}}renderChoice(e,t){let n=t.map(t=>this.renderExpression(e,t)),r=0,i=0;for(let e of n)r=Math.max(r,e.dimensions.width),i+=e.dimensions.height;i+=(n.length-1)*this.config.verticalSeparation;let a=this.config.arcRadius,o=a*4,s=r+o,c=e.append(`g`).attr(`class`,`railroad-choice`),l=0,u=i/2;for(let e of n){let t=l,n=t+e.dimensions.up,i=a*2+(r-e.dimensions.width)/2;c.node().appendChild(e.element).setAttribute(`transform`,`translate(${i}, ${t})`);let o=new P,d=n>u;n===u?o.moveTo(0,u).lineTo(i,n):o.moveTo(0,u).arcTo(a,a,0,!1,d,a,u+(d?a:-a)).lineTo(a,n-(d?a:-a)).arcTo(a,a,0,!1,!d,a*2,n).lineTo(i,n),c.append(`path`).attr(`class`,`railroad-line`).attr(`d`,o.build());let f=new P,p=i+e.dimensions.width,m=s-a*2;n===u?f.moveTo(p,n).lineTo(s,u):f.moveTo(p,n).lineTo(m,n).arcTo(a,a,0,!1,!d,s-a,n+(d?-a:a)).lineTo(s-a,u+(d?a:-a)).arcTo(a,a,0,!1,d,s,u),c.append(`path`).attr(`class`,`railroad-line`).attr(`d`,f.build()),l+=e.dimensions.height+this.config.verticalSeparation}return{element:c.node(),dimensions:{width:s,height:i,up:u,down:i-u}}}renderOptional(e,t){let n=this.renderExpression(e,t),r=this.config.arcRadius,i=r*2,a=n.dimensions.width+r*4,o=n.dimensions.height+i,s=e.append(`g`).attr(`class`,`railroad-optional`),c=r*2,l=i;s.node().appendChild(n.element).setAttribute(`transform`,`translate(${c}, ${l})`);let u=l+n.dimensions.up,d=new P().moveTo(0,u).lineTo(r*2,u);s.append(`path`).attr(`class`,`railroad-line`).attr(`d`,d.build());let f=new P().moveTo(c+n.dimensions.width,u).lineTo(a,u);s.append(`path`).attr(`class`,`railroad-line`).attr(`d`,f.build());let p=new P().moveTo(0,u).arcTo(r,r,0,!1,!1,r,u-r).lineTo(r,r).arcTo(r,r,0,!1,!0,r*2,0).lineTo(a-r*2,0).arcTo(r,r,0,!1,!0,a-r,r).lineTo(a-r,u-r).arcTo(r,r,0,!1,!1,a,u);return s.append(`path`).attr(`class`,`railroad-line`).attr(`d`,p.build()),{element:s.node(),dimensions:{width:a,height:o,up:u,down:o-u}}}renderRepetition(e,t,n){let r=this.renderExpression(e,t),i=this.config.arcRadius,a=i*2,o=r.dimensions.width+i*4,s=n===0,c=r.dimensions.height+a+(s?a:0),l=e.append(`g`).attr(`class`,`railroad-repetition`),u=i*2,d=s?a:0;l.node().appendChild(r.element).setAttribute(`transform`,`translate(${u}, ${d})`);let f=d+r.dimensions.up;l.append(`path`).attr(`class`,`railroad-line`).attr(`d`,new P().moveTo(0,f).lineTo(i*2,f).build()),l.append(`path`).attr(`class`,`railroad-line`).attr(`d`,new P().moveTo(u+r.dimensions.width,f).lineTo(o,f).build());let p=d+r.dimensions.height+i,m=new P().moveTo(u+r.dimensions.width,f).arcTo(i,i,0,!1,!0,u+r.dimensions.width+i,f+i).lineTo(u+r.dimensions.width+i,p).arcTo(i,i,0,!1,!0,u+r.dimensions.width,p+i).lineTo(i*2,p+i).arcTo(i,i,0,!1,!0,i,p).lineTo(i,f+i).arcTo(i,i,0,!1,!0,i*2,f);if(l.append(`path`).attr(`class`,`railroad-line`).attr(`d`,m.build()),s){let e=new P().moveTo(0,f).arcTo(i,i,0,!1,!1,i,f-i).lineTo(i,i).arcTo(i,i,0,!1,!0,i*2,0).lineTo(o-i*2,0).arcTo(i,i,0,!1,!0,o-i,i).lineTo(o-i,f-i).arcTo(i,i,0,!1,!1,o,f);l.append(`path`).attr(`class`,`railroad-line`).attr(`d`,e.build())}return{element:l.node(),dimensions:{width:o,height:c,up:f,down:c-f}}}renderSpecial(e,t){let n=this.measureText(`? `+t+` ?`),r=n.width+this.config.padding*2,i=n.height+this.config.padding*2,a=e.append(`g`).attr(`class`,`railroad-special`);return a.append(`rect`).attr(`x`,0).attr(`y`,0).attr(`width`,r).attr(`height`,i),a.append(`text`).attr(`x`,r/2).attr(`y`,i/2).text(`? `+t+` ?`),{element:a.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderExpression(e,t){switch(t.type){case`terminal`:return this.renderTerminal(e,t.value);case`nonterminal`:return this.renderNonTerminal(e,t.name);case`sequence`:return this.renderSequence(e,t.elements);case`choice`:return this.renderChoice(e,t.alternatives);case`optional`:return this.renderOptional(e,t.element);case`repetition`:return this.renderRepetition(e,t.element,t.min);case`special`:return this.renderSpecial(e,t.text);default:throw Error(`Unknown node type: ${t.type}`)}}renderRule(e,t){let n=this.svg.append(`g`).attr(`class`,`railroad-rule`).attr(`transform`,`translate(0, ${t})`),r=e.name+` =`,i=this.measureText(r).width+20,a=i+20,o=n.append(`g`),s=this.renderExpression(o,e.definition),c=Math.max(20,s.dimensions.up),l=c-s.dimensions.up;return o.attr(`transform`,`translate(${a}, ${l})`),n.append(`g`).attr(`class`,`railroad-rule-name-group`).append(`text`).attr(`class`,`railroad-rule-name`).attr(`x`,0).attr(`y`,c).text(r),n.append(`g`).attr(`class`,`railroad-start`).append(`circle`).attr(`cx`,i).attr(`cy`,c).attr(`r`,this.config.markerRadius),n.append(`g`).attr(`class`,`railroad-end`).append(`circle`).attr(`cx`,a+s.dimensions.width+10).attr(`cy`,c).attr(`r`,this.config.markerRadius),n.append(`path`).attr(`class`,`railroad-line`).attr(`d`,new P().moveTo(i+this.config.markerRadius,c).lineTo(a,c).build()),n.append(`path`).attr(`class`,`railroad-line`).attr(`d`,new P().moveTo(a+s.dimensions.width,c).lineTo(a+s.dimensions.width+10-this.config.markerRadius,c).build()),{height:Math.max(40,l+s.dimensions.height+this.config.padding*2),width:a+s.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let t=this.config.padding,n=0;for(let r of e){let e=this.renderRule(r,t);t+=e.height+this.config.verticalSeparation,n=Math.max(n,e.width)}return{width:n+this.config.padding*2,height:t+this.config.padding}}},I=e((e,t,n)=>{i(e,t.height,t.width,n),e.attr(`viewBox`,`0 0 ${t.width} ${t.height}`)},`configureRailroadSvgSize`),L={draw:e((e,n,r)=>{t.debug(`[Railroad] Rendering diagram
88
+ `+e);try{let e=c(n);e.attr(`class`,`railroad-diagram`);let r=o().railroad?.useMaxWidth??!0,i=y.getRules();if(t.debug(`[Railroad] Rendering ${i.length} rules`),i.length===0){t.warn(`[Railroad] No rules to render`),I(e,{height:100,width:200},r);return}I(e,new F(e,M()).renderDiagram(i),r),t.debug(`[Railroad] Render complete`)}catch(e){throw t.error(`[Railroad] Render error:`,e),e}},`draw`)};export{L as n,y as r,N as t};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./chunk-AQ6EADP3-CZhslHi-.js";var n=e(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BLANK_URL=e.relativeFirstCharacters=e.whitespaceEscapeCharsRegex=e.urlSchemeRegex=e.ctrlCharactersRegex=e.htmlCtrlEntityRegex=e.htmlEntitiesRegex=e.invalidProtocolRegex=void 0,e.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,e.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,e.htmlCtrlEntityRegex=/&(newline|tab);/gi,e.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,e.urlSchemeRegex=/^.+(:|&colon;)/gim,e.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,e.relativeFirstCharacters=[`.`,`/`],e.BLANK_URL=`about:blank`}),r=e(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.sanitizeUrl=c;var r=n();function i(e){return r.relativeFirstCharacters.indexOf(e[0])>-1}t(i,`isRelativeUrlWithoutProtocol`);function a(e){return e.replace(r.ctrlCharactersRegex,``).replace(r.htmlEntitiesRegex,function(e,t){return String.fromCharCode(t)})}t(a,`decodeHtmlCharacters`);function o(e){return URL.canParse(e)}t(o,`isValidUrl`);function s(e){try{return decodeURIComponent(e)}catch{return e}}t(s,`decodeURI`);function c(e){if(!e)return r.BLANK_URL;var t,n=s(e.trim());do n=a(n).replace(r.htmlCtrlEntityRegex,``).replace(r.ctrlCharactersRegex,``).replace(r.whitespaceEscapeCharsRegex,``).trim(),n=s(n),t=n.match(r.ctrlCharactersRegex)||n.match(r.htmlEntitiesRegex)||n.match(r.htmlCtrlEntityRegex)||n.match(r.whitespaceEscapeCharsRegex);while(t&&t.length>0);var c=n;if(!c)return r.BLANK_URL;if(i(c))return c;var l=c.trimStart(),u=l.match(r.urlSchemeRegex);if(!u)return c;var d=u[0].toLowerCase().trim();if(r.invalidProtocolRegex.test(d))return r.BLANK_URL;var f=l.replace(/\\/g,`/`);if(d===`mailto:`||d.includes(`://`))return f;if(d===`http:`||d===`https:`){if(!o(f))return r.BLANK_URL;var p=new URL(f);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return f}t(c,`sanitizeUrl`)});export{r as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";var t=class{constructor(e){this.init=e,this.records=this.init()}static{e(this,`ImperativeState`)}reset(){this.records=this.init()}};export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{c as t,h as n,i as r,m as i,n as a,o,r as s,t as c,y as l}from"./chunk-ZS6VBONO-D-IFTJgn.js";var u=class extends r{static{e(this,`PacketTokenBuilder`)}static{l(this,`PacketTokenBuilder`)}constructor(){super([`packet`])}},d={parser:{TokenBuilder:l(()=>new u,`TokenBuilder`),ValueConverter:l(()=>new i,`ValueConverter`)}};function f(e=t){let r=s(o(e),a),i=s(c({shared:r}),n,d);return r.ServiceRegistry.register(i),{shared:r,Packet:i}}e(f,`createPacketServices`),l(f,`createPacketServices`);export{d as n,f as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{b as t,c as n,i as r,m as i,n as a,o,r as s,t as c,y as l}from"./chunk-ZS6VBONO-D-IFTJgn.js";var u=class extends r{static{e(this,`RadarTokenBuilder`)}static{l(this,`RadarTokenBuilder`)}constructor(){super([`radar-beta`])}},d={parser:{TokenBuilder:l(()=>new u,`TokenBuilder`),ValueConverter:l(()=>new i,`ValueConverter`)}};function f(e=n){let r=s(o(e),a),i=s(c({shared:r}),t,d);return r.ServiceRegistry.register(i),{shared:r,Radar:i}}e(f,`createRadarServices`),l(f,`createRadarServices`);export{d as n,f as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{q as t}from"./chunk-H7VHZCWX-CwFRFlEn.js";import{i as n}from"./chunk-VY2OSTJR-BYk2nUI_.js";import{s as r}from"./chunk-Z6V44ARX-CWGOZvke.js";var i=e(({flowchart:e})=>{let t=e?.subGraphTitleMargin?.top??0,n=e?.subGraphTitleMargin?.bottom??0;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:n,subGraphTitleTotalMargin:t+n}},`getSubGraphTitleMargins`),a=new Map;async function o(e,t,i){let o,s;t.shape===`rect`&&(t.shape=t.rx&&t.ry?`roundedRect`:`squareRect`);let c=t.shape?r[t.shape]:void 0;if(!c)throw Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let n;i.config.securityLevel===`sandbox`?n=`_top`:t.linkTarget&&(n=t.linkTarget||`_blank`),o=e.insert(`svg:a`).attr(`xlink:href`,t.link).attr(`target`,n??null),s=await c(o,t,i)}else s=await c(e,t,i),o=s;return o.attr(`data-look`,n(t.look)),t.tooltip&&s.attr(`title`,t.tooltip),a.set(t.id,o),t.haveCallback&&o.attr(`class`,o.attr(`class`)+` clickable`),o}e(o,`insertNode`);var s=e((e,t)=>{a.set(t.id,e)},`setNodeElem`),c=e(()=>{a.clear()},`clear`),l=e(e=>{let n=a.get(e.id);t.trace(`Transforming node`,e.diff,e,`translate(`+(e.x-e.width/2-5)+`, `+e.width/2+`)`);let r=e.diff||0;return e.clusterNode?n.attr(`transform`,`translate(`+(e.x+r-e.width/2)+`, `+(e.y-e.height/2-8)+`)`):n.attr(`transform`,`translate(`+e.x+`, `+e.y+`)`),r},`positionNode`);export{l as a,i,c as n,o as r,s as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{q as t}from"./chunk-H7VHZCWX-CwFRFlEn.js";import{O as n}from"./chunk-QJSWEUOL-kvKBktmc.js";var r=e((e,r,o,s)=>{e.attr(`class`,o);let{width:c,height:l,x:u,y:d}=i(e,r);n(e,l,c,s);let f=a(u,d,c,l,r);e.attr(`viewBox`,f),t.debug(`viewBox configured: ${f} with padding: ${r}`)},`setupViewPortForSVG`),i=e((e,t)=>{let n=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:n.width+t*2,height:n.height+t*2,x:n.x,y:n.y}},`calculateDimensionsWithPadding`),a=e((e,t,n,r,i)=>`${e-i} ${t-i} ${n} ${r}`,`createViewBox`);export{r as t};
@@ -0,0 +1,2 @@
1
+ import{i as e,t}from"./chunk-AQ6EADP3-CZhslHi-.js";import{$ as n,D as r,F as i,L as a,O as o,Q as s,S as c,V as l,Y as u,_ as d,b as ee,d as te,f as ne,g as re,h as ie,j as ae,o as oe,q as f,r as se,u as ce,x as le,z as ue}from"./chunk-H7VHZCWX-CwFRFlEn.js";import{D as de,G as fe,H as pe,R as p,n as m}from"./chunk-QJSWEUOL-kvKBktmc.js";import{t as me}from"./chunk-STOV2HOB-GnExfzIX.js";var he=e(me(),1);function ge(e){return Number.isSafeInteger(e)&&e>=0}t(ge,`isLength`);function h(e){return e!=null&&typeof e!=`function`&&ge(e.length)}t(h,`isArrayLike`);function _e(e){return e===`__proto__`}t(_e,`isUnsafeProperty`);function g(e){return e==null||typeof e!=`object`&&typeof e!=`function`}t(g,`isPrimitive`);function _(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}t(_,`getSymbols`);function v(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}t(v,`getTag`);var y=`[object RegExp]`,b=`[object String]`,x=`[object Number]`,S=`[object Boolean]`,C=`[object Arguments]`,w=`[object Symbol]`,T=`[object Date]`,E=`[object Map]`,D=`[object Set]`,ve=`[object Array]`,O=`[object ArrayBuffer]`,k=`[object Object]`,A=`[object DataView]`,ye=`[object Uint8Array]`,be=`[object Uint8ClampedArray]`,xe=`[object Uint16Array]`,Se=`[object Uint32Array]`,j=`[object Int8Array]`,Ce=`[object Int16Array]`,we=`[object Int32Array]`,Te=`[object Float32Array]`,Ee=`[object Float64Array]`;function M(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}t(M,`isTypedArray`);function De(e,t){return N(e,void 0,e,new Map,t)}t(De,`cloneDeepWith`);function N(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(g(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=N(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,N(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(N(a,void 0,n,r,i));return t}if(typeof Buffer<`u`&&Buffer.isBuffer(e))return e.subarray();if(M(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=N(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),P(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),P(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),P(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,P(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),P(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),P(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),P(t,e,n,r,i),t}if(typeof e==`object`&&Oe(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),P(t,e,n,r,i),t}return e}t(N,`cloneDeepWithImpl`);function P(e,t,n=e,r,i){let a=[...Object.keys(t),..._(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=N(t[s],s,n,r,i))}}t(P,`copyProperties`);function Oe(e){switch(v(e)){case C:case ve:case O:case A:case S:case T:case Te:case Ee:case j:case Ce:case we:case E:case x:case k:case y:case D:case b:case w:case ye:case be:case xe:case Se:return!0;default:return!1}}t(Oe,`isCloneableObject`);function ke(e,t){return De(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(v(e)===k&&typeof e.constructor!=`function`){let t={};return a.set(e,t),P(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case x:case b:case S:{let t=new e.constructor(e?.valueOf());return P(t,e),t}case C:{let t={};return P(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}t(ke,`cloneDeepWith`);function F(e){return ke(e)}t(F,`cloneDeep`);function I(e){return typeof e==`object`&&!!e&&v(e)===`[object Arguments]`}t(I,`isArguments`);function L(e){return typeof e==`object`&&!!e}t(L,`isObjectLike`);function Ae(e){return L(e)&&h(e)}t(Ae,`isArrayLikeObject`);function je(e){return Array.isArray(e)}t(je,`isArray`);function R(e,n){if(typeof e!=`function`||n!=null&&typeof n!=`function`)throw TypeError(`Expected a function`);let r=t(function(...t){let i=n?n.apply(this,t):t[0],a=r.cache;if(a.has(i))return a.get(i);let o=e.apply(this,t);return r.cache=a.set(i,o)||a,o},`memoized`);return r.cache=new(R.Cache||Map),r}t(R,`memoize`),R.Cache=Map;function Me(){}t(Me,`noop`);function Ne(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}t(Ne,`isPrototype`);function z(e){return M(e)}t(z,`isTypedArray`);function Pe(e){if(g(e))return e;let t=v(e);if(!Fe(e))return{};if(je(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&Object.hasOwn(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(z(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===O)return new ArrayBuffer(e.byteLength);if(t===A){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===S||t===x||t===b){let n=e.constructor,r=new n(e.valueOf());return t===b?Le(r,e):B(r,e),r}if(t===T)return new Date(Number(e));if(t===y){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===w)return Object(Symbol.prototype.valueOf.call(e));if(t===E){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===D){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===C){let t=e,n={};return B(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return Re(n,e),B(n,e),Ie(n,e),n}t(Pe,`clone`);function Fe(e){switch(v(e)){case C:case ve:case O:case A:case S:case T:case Te:case Ee:case j:case Ce:case we:case E:case x:case k:case y:case D:case b:case w:case ye:case be:case xe:case Se:return!0;default:return!1}}t(Fe,`isCloneableObject`);function B(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}t(B,`copyOwnProperties`);function Ie(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r<n.length;r++){let i=n[r];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}t(Ie,`copySymbolProperties`);function Le(e,t){let n=t.valueOf().length;for(let r in t)Object.hasOwn(t,r)&&(Number.isNaN(Number(r))||Number(r)>=n)&&(e[r]=t[r])}t(Le,`cloneStringObjectProperties`);function Re(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}t(Re,`copyPrototype`);function V(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}t(V,`isPlainObject`);function ze(e){if(g(e))return e;if(Array.isArray(e)||M(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){let t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new n(e.errors,e.message,{cause:e.cause}):new n(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}if(typeof File<`u`&&e instanceof File)return new n([e],e.name,{type:e.type,lastModified:e.lastModified});if(typeof e==`object`){let n=Object.create(t);return Object.assign(n,e)}return e}t(ze,`clone`);function Be(e,...t){let n=t.slice(0,-1),r=t[t.length-1],i=e;for(let e=0;e<n.length;e++){let t=n[e];i=H(i,t,r,new Map)}return i}t(Be,`mergeWith`);function H(e,t,n,r){if(g(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return ze(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}let i=[...Object.keys(t),..._(t)];for(let a=0;a<i.length;a++){let o=i[a];if(_e(o))continue;let s=t[o],c=e[o];if(I(s)&&(s={...s}),I(c)&&(c={...c}),typeof Buffer<`u`&&Buffer.isBuffer(s)&&(s=F(s)),Array.isArray(s)){if(Array.isArray(c)){let e=[],t=Reflect.ownKeys(c);for(let n=0;n<t.length;n++){let r=t[n];e[r]=c[r]}c=e}else if(Ae(c)){let e=[];for(let t=0;t<c.length;t++)e[t]=c[t];c=e}else c=[]}let l=n(c,s,o,e,t,r);l===void 0?Array.isArray(s)||L(c)&&L(s)&&(V(c)||V(s)||z(c)||z(s))?e[o]=H(c,s,n,r):c==null&&V(s)?e[o]=H({},s,n,r):c==null&&z(s)?e[o]=F(s):(c===void 0||s!==void 0)&&(e[o]=s):e[o]=l}return e}t(H,`mergeWithDeep`);function Ve(e,...t){return Be(e,...t,Me)}t(Ve,`merge`);function He(e){if(e==null)return!0;if(h(e))return typeof e.splice!=`function`&&typeof e!=`string`&&(typeof Buffer>`u`||!Buffer.isBuffer(e))&&!z(e)&&!I(e)?!1:e.length===0;if(typeof e==`object`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return Ne(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}t(He,`isEmpty`);var Ue={curveBasis:se,curveBasisClosed:ce,curveBasisOpen:c,curveBumpX:d,curveBumpY:s,curveBundle:ne,curveCardinalClosed:u,curveCardinalOpen:ae,curveCardinal:oe,curveCatmullRomClosed:i,curveCatmullRomOpen:te,curveCatmullRom:r,curveLinear:o,curveLinearClosed:n,curveMonotoneX:a,curveMonotoneY:ee,curveNatural:ue,curveStep:le,curveStepAfter:ie,curveStepBefore:re},We=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Ge=t(function(e,t){let n=Ke(e,/(?:init\b)|(?:initialize\b)/),r={};if(Array.isArray(n)){let e=n.map(e=>e.args);fe(e),r=pe(r,[...e])}else r=n.args;if(!r)return;let i=de(e,t),a=`config`;return r[a]!==void 0&&(i===`flowchart-v2`&&(i=`flowchart`),r[i]=r[a],delete r[a]),r},`detectInit`),Ke=t(function(e,t=null){try{let n=RegExp(`[%]{2}(?![{]${We.source})(?=[}][%]{2}).*
2
+ `,`ig`);e=e.trim().replace(n,``).replace(/'/gm,`"`),f.debug(`Detecting diagram directive${t===null?``:` type:`+t} based on the text:${e}`);let r,i=[];for(;(r=m.exec(e))!==null;)if(r.index===m.lastIndex&&m.lastIndex++,r&&!t||t&&r[1]?.match(t)||t&&r[2]?.match(t)){let e=r[1]?r[1]:r[2],t=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;i.push({type:e,args:t})}return i.length===0?{type:e,args:null}:i.length===1?i[0]:i}catch(n){return f.error(`ERROR: ${n.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},`detectDirective`),qe=t(function(e){return e.replace(m,``)},`removeDirectives`),Je=t(function(e,t){for(let[n,r]of t.entries())if(r.match(e))return n;return-1},`isSubstringInArray`);function U(e,t){return e?Ue[`curve${e.charAt(0).toUpperCase()+e.slice(1)}`]??t:t}t(U,`interpolateToCurve`);function Ye(e,t){let n=e.trim();if(n)return t.securityLevel===`loose`?n:(0,he.sanitizeUrl)(n)}t(Ye,`formatUrl`);var Xe=t((e,...t)=>{let n=e.split(`.`),r=n.length-1,i=n[r],a=window;for(let t=0;t<r;t++)if(a=a[n[t]],!a){f.error(`Function name: ${e} not found in window`);return}a[i](...t)},`runFunc`);function W(e,t){return!e||!t?0:Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}t(W,`distance`);function Ze(e){let t,n=0;return e.forEach(e=>{n+=W(e,t),t=e}),G(e,n/2)}t(Ze,`traverseEdge`);function Qe(e){return e.length===1?e[0]:Ze(e)}t(Qe,`calcLabelPosition`);var $e=t((e,t=2)=>{let n=10**t;return Math.round(e*n)/n},`roundNumber`),G=t((e,t)=>{let n,r=t;for(let t of e){if(n){let e=W(t,n);if(e===0)return n;if(e<r)r-=e;else{let i=r/e;if(i<=0)return n;if(i>=1)return{x:t.x,y:t.y};if(i>0&&i<1)return{x:$e((1-i)*n.x+i*t.x,5),y:$e((1-i)*n.y+i*t.y,5)}}}n=t}throw Error(`Could not find a suitable point for the given distance`)},`calculatePoint`),et=t((e,t,n)=>{f.info(`our points ${JSON.stringify(t)}`),t[0]!==n&&(t=t.reverse());let r=G(t,25),i=e?10:5,a=Math.atan2(t[0].y-r.y,t[0].x-r.x),o={x:0,y:0};return o.x=Math.sin(a)*i+(t[0].x+r.x)/2,o.y=-Math.cos(a)*i+(t[0].y+r.y)/2,o},`calcCardinalityPosition`);function tt(e,t,n){let r=structuredClone(n);f.info(`our points`,r),t!==`start_left`&&t!==`start_right`&&r.reverse();let i=G(r,25+e),a=10+e*.5,o=Math.atan2(r[0].y-i.y,r[0].x-i.x),s={x:0,y:0};return t===`start_left`?(s.x=Math.sin(o+Math.PI)*a+(r[0].x+i.x)/2,s.y=-Math.cos(o+Math.PI)*a+(r[0].y+i.y)/2):t===`end_right`?(s.x=Math.sin(o-Math.PI)*a+(r[0].x+i.x)/2-5,s.y=-Math.cos(o-Math.PI)*a+(r[0].y+i.y)/2-5):t===`end_left`?(s.x=Math.sin(o)*a+(r[0].x+i.x)/2-5,s.y=-Math.cos(o)*a+(r[0].y+i.y)/2-5):(s.x=Math.sin(o)*a+(r[0].x+i.x)/2,s.y=-Math.cos(o)*a+(r[0].y+i.y)/2),s}t(tt,`calcTerminalLabelPosition`);function K(e){let t=``,n=``;for(let r of e)r!==void 0&&(r.startsWith(`color:`)||r.startsWith(`text-align:`)?n=n+r+`;`:t=t+r+`;`);return{style:t,labelStyle:n}}t(K,`getStylesFromArray`);var nt=0,rt=t(()=>(nt++,`id-`+Math.random().toString(36).substr(2,12)+`-`+nt),`generateId`);function it(e){let t=``;for(let n=0;n<e;n++)t+=`0123456789abcdef`.charAt(Math.floor(Math.random()*16));return t}t(it,`makeRandomHex`);var at=t(e=>it(e.length),`random`),ot=t(function(){return{x:0,y:0,fill:void 0,anchor:`start`,style:`#666`,width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:``}},`getTextObj`),st=t(function(e,t){let n=t.text.replace(p.lineBreakRegex,` `),[,r]=Q(t.fontSize),i=e.append(`text`);i.attr(`x`,t.x),i.attr(`y`,t.y),i.style(`text-anchor`,t.anchor),i.style(`font-family`,t.fontFamily),i.style(`font-size`,r),i.style(`font-weight`,t.fontWeight),i.attr(`fill`,t.fill),t.class!==void 0&&i.attr(`class`,t.class);let a=i.append(`tspan`);return a.attr(`x`,t.x+t.textMargin*2),a.attr(`fill`,t.fill),a.text(n),i},`drawSimpleText`),q=R((e,t,n)=>{if(!e||(n=Object.assign({fontSize:12,fontWeight:400,fontFamily:`Arial`,joinWith:`<br/>`},n),p.lineBreakRegex.test(e)))return e;let r=e.split(` `).filter(Boolean),i=[],a=``;return r.forEach((e,o)=>{let s=Y(`${e} `,n),c=Y(a,n);if(s>t){let{hyphenatedStrings:r,remainingWord:o}=ct(e,t,`-`,n);i.push(a,...r),a=o}else c+s>=t?(i.push(a),a=e):a=[a,e].filter(Boolean).join(` `);o+1===r.length&&i.push(a)}),i.filter(e=>e!==``).join(n.joinWith)},(e,t,n)=>`${e}${t}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`),ct=R((e,t,n=`-`,r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:`Arial`,margin:0},r);let i=[...e],a=[],o=``;return i.forEach((e,s)=>{let c=`${o}${e}`;if(Y(c,r)>=t){let e=s+1,t=i.length===e,r=`${c}${n}`;a.push(t?c:r),o=``}else o=c}),{hyphenatedStrings:a,remainingWord:o}},(e,t,n=`-`,r)=>`${e}${t}${n}${r.fontSize}${r.fontWeight}${r.fontFamily}`);function J(e,t){return X(e,t).height}t(J,`calculateTextHeight`);function Y(e,t){return X(e,t).width}t(Y,`calculateTextWidth`);var X=R((e,t)=>{let{fontSize:n=12,fontFamily:r=`Arial`,fontWeight:i=400}=t;if(!e)return{width:0,height:0};let[,a]=Q(n),o=[`sans-serif`,r],s=e.split(p.lineBreakRegex),c=[],u=l(`body`);if(!u.remove)return{width:0,height:0,lineHeight:0};let d=u.append(`svg`);for(let e of o){let t=0,n={width:0,height:0,lineHeight:0};for(let r of s){let o=ot();o.text=r||`​`;let s=st(d,o).style(`font-size`,a).style(`font-weight`,i).style(`font-family`,e),c=(s._groups||s)[0][0].getBBox();if(c.width===0&&c.height===0)throw Error(`svg element not in render tree`);n.width=Math.round(Math.max(n.width,c.width)),t=Math.round(c.height),n.height+=t,n.lineHeight=Math.round(Math.max(n.lineHeight,t))}c.push(n)}return d.remove(),c[isNaN(c[1].height)||isNaN(c[1].width)||isNaN(c[1].lineHeight)||c[0].height>c[1].height&&c[0].width>c[1].width&&c[0].lineHeight>c[1].lineHeight?0:1]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),lt=class{constructor(e=!1,t){this.count=0,this.count=t?t.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{t(this,`InitIDGenerator`)}},Z,ut=t(function(e){return Z||=document.createElement(`div`),e=escape(e).replace(/%26/g,`&`).replace(/%23/g,`#`).replace(/%3B/g,`;`),Z.innerHTML=e,unescape(Z.textContent)},`entityDecode`);function dt(e){return`str`in e}t(dt,`isDetailedError`);var ft=t((e,t,n,r)=>{if(!r)return;let i=e.node()?.getBBox();i&&e.append(`text`).text(r).attr(`text-anchor`,`middle`).attr(`x`,i.x+i.width/2).attr(`y`,-n).attr(`class`,t)},`insertTitle`),Q=t(e=>{if(typeof e==`number`)return[e,e+`px`];let t=parseInt(e??``,10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+`px`]:[t,e]},`parseFontSize`);function $(e,t){return Ve({},e,t)}t($,`cleanAndMerge`);var pt={assignWithDepth:pe,wrapLabel:q,calculateTextHeight:J,calculateTextWidth:Y,calculateTextDimensions:X,cleanAndMerge:$,detectInit:Ge,detectDirective:Ke,isSubstringInArray:Je,interpolateToCurve:U,calcLabelPosition:Qe,calcCardinalityPosition:et,calcTerminalLabelPosition:tt,formatUrl:Ye,getStylesFromArray:K,generateId:rt,random:at,runFunc:Xe,entityDecode:ut,insertTitle:ft,isLabelCoordinateInPath:vt,parseFontSize:Q,InitIDGenerator:lt},mt=t(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/#\w+;/g,function(e){let t=e.substring(1,e.length-1);return/^\+?\d+$/.test(t)?`fl°°`+t+`¶ß`:`fl°`+t+`¶ß`}),t},`encodeEntities`),ht=t(function(e){return e.replace(/fl°°/g,`&#`).replace(/fl°/g,`&`).replace(/¶ß/g,`;`)},`decodeEntities`),gt=t((e,t,{counter:n=0,prefix:r,suffix:i},a)=>a||`${r?`${r}_`:``}${e}_${t}_${n}${i?`_${i}`:``}`,`getEdgeId`);function _t(e){return e??null}t(_t,`handleUndefinedAttr`);function vt(e,t){let n=Math.round(e.x),r=Math.round(e.y),i=t.replace(/(\d+\.\d+)/g,e=>Math.round(parseFloat(e)).toString());return i.includes(n.toString())||i.includes(r.toString())}t(vt,`isLabelCoordinateInPath`);export{Pe as _,$ as a,dt as c,J as d,K as f,X as g,He as h,_t as i,q as l,Y as m,gt as n,pt as o,Q as p,ht as r,at as s,qe as t,mt as u,U as v,rt as y};
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{q as t}from"./chunk-H7VHZCWX-CwFRFlEn.js";import{B as n,l as r}from"./chunk-QJSWEUOL-kvKBktmc.js";import{o as i}from"./chunk-4CAJECRU-C_QnaDal.js";import{o as a}from"./chunk-VY2OSTJR-BYk2nUI_.js";import{t as o}from"./chunk-Z6V44ARX-CWGOZvke.js";import{a as s,i as c,n as l,r as u}from"./chunk-VRZKL3EH-BzaZ6KlD.js";import{n as d,t as f}from"./chunk-ZQN7UHIL-CNp35E78.js";import{a as p,i as m,n as h,o as g,r as _,s as v,t as y}from"./chunk-4OADUZ5Q-DHE3k_pb.js";function b(e,{edgePathsClass:t=`edges edgePaths`}={}){let n=e.insert(`g`).attr(`class`,`root`);return{clusters:n.insert(`g`).attr(`class`,`clusters`),edgePaths:n.insert(`g`).attr(`class`,t),edgeLabels:n.insert(`g`).attr(`class`,`edgeLabels`),nodes:n.insert(`g`).attr(`class`,`nodes`),rootGroups:n}}e(b,`createLayoutElementGroups`);async function x(e,t){if(t.label){let{shapeSvg:n,bbox:r}=await o(e,t);t.labelBBox={width:r.width,height:r.height},n.remove()}else t.labelBBox={width:0,height:0}}e(x,`measureGroupLabel`);async function S(e,t,n){let r=await u(e,t,n),i=r.node()?.getBBox()??{width:0,height:0};return t.width=i.width,t.height=i.height,r}e(S,`insertMeasuredNode`);async function C(e,t){let r=new i({multigraph:!0,compound:!0}),a=[...t.edges],o=n(),s=b(e),{edgeLabels:c,nodes:l}=s,u=new Map,d=e.node()!=null;await Promise.all(t.nodes.map(async e=>{if(e.isGroup)d&&await x(l,e),r.setNode(e.id,{...e});else{if(d){let t=await S(l,e,{config:o,dir:e.dir});u.set(e.id,t)}r.setNode(e.id,{...e})}}));for(let e of a)d&&y(e)&&await _(c,e),r.setEdge(e.start,e.end,{...e},e.id),t.edges.some(t=>t.id===e.id)||t.edges.push(e);if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:n}=await import(`./sizeCapture-FGA5AGYP-BEqQzsxs.js`);n(e,t)}return{graph:r,groups:s,nodeElements:u}}e(C,`createGraphWithElements`);var w=new Map,T=new Map,E=new Map,D=e(()=>{T.clear(),E.clear(),w.clear()},`clear`),O=e((e,n)=>{let r=T.get(n)||[];return t.trace(`In isDescendant`,n,` `,e,` = `,r.includes(e)),r.includes(e)},`isDescendant`),k=e((e,n)=>{let r=T.get(n)||[];return t.info(`Descendants of `,n,` is `,r),t.info(`Edge is `,e),e.v===n||e.w===n?!1:r?r.includes(e.v)||O(e.v,n)||O(e.w,n)||r.includes(e.w):(t.debug(`Tilt, `,n,`,not in descendants`),!1)},`edgeInCluster`),A=e((e,n,r,i)=>{t.debug(`Copying children of `,e,`root`,i,`data`,n.node(e),i);let a=n.children(e)||[];e!==i&&a.push(e),t.debug(`Copying (nodes) clusterId`,e,`nodes`,a),a.forEach(a=>{if(n.children(a).length>0)A(a,n,r,i);else{let o=n.node(a);t.info(`cp `,a,` to `,i,` with parent `,e),r.setNode(a,o),i!==n.parent(a)&&(t.debug(`Setting parent`,a,n.parent(a)),r.setParent(a,n.parent(a))),e!==i&&a!==e?(t.debug(`Setting parent`,a,e),r.setParent(a,e)):(t.info(`In copy `,e,`root`,i,`data`,n.node(e),i),t.debug(`Not Setting parent for node=`,a,`cluster!==rootId`,e!==i,`node!==clusterId`,a!==e));let s=n.edges(a);t.debug(`Copying Edges`,s),s.forEach(a=>{t.info(`Edge`,a);let o=n.edge(a.v,a.w,a.name);t.info(`Edge data`,o,i);try{k(a,i)?(t.info(`Copying as `,a.v,a.w,o,a.name),r.setEdge(a.v,a.w,o,a.name),t.info(`newGraph edges `,r.edges(),r.edge(r.edges()[0]))):t.info(`Skipping copy of edge `,a.v,`-->`,a.w,` rootId: `,i,` clusterId:`,e)}catch(e){t.error(e)}})}t.debug(`Removing node`,a),n.removeNode(a)})},`copy`),j=e((e,t)=>{let n=t.children(e),r=[...n];for(let i of n)E.set(i,e),r=[...r,...j(i,t)];return r},`extractDescendants`),M=e((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},`findCommonEdges`),N=e((e,n,r)=>{let i=n.children(e);if(t.trace(`Searching children of id `,e,i),i.length<1)return e;let a;for(let e of i){let t=N(e,n,r),i=M(n,r,t);if(t){if(i.length>0)a=t;else return t}}return a},`findNonClusterChild`),P=e(e=>!w.has(e)||!w.get(e).externalConnections?e:w.has(e)?w.get(e).id:e,`getAnchorId`),F=e((e,n)=>{if(!e||n>10){t.debug(`Opting out, no graph `);return}t.debug(`Opting in, graph `),e.nodes().forEach(function(n){e.children(n).length>0&&(t.debug(`Cluster identified`,n,` Replacement id in edges: `,N(n,e,n)),T.set(n,j(n,e)),w.set(n,{id:N(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){let r=e.children(n),i=e.edges();r.length>0?(t.debug(`Cluster identified`,n,T),i.forEach(e=>{O(e.v,n)^O(e.w,n)&&(t.debug(`Edge: `,e,` leaves cluster `,n),t.debug(`Descendants of XXX `,n,`: `,T.get(n)),w.get(n).externalConnections=!0)})):t.debug(`Not a cluster `,n,T)});for(let t of w.keys()){let n=w.get(t).id,r=e.parent(n);r!==t&&w.has(r)&&!w.get(r).externalConnections&&(w.get(t).id=r);let i=e.edges().some(e=>e.v===t);if(n&&w.get(t)?.externalConnections&&i&&z(e,n,t)){let r=B(e,t,e.parent(n));r&&(w.get(t).id=r)}}e.edges().forEach(function(n){let r=e.edge(n);t.debug(`Edge `+n.v+` -> `+n.w+`: `+JSON.stringify(n)),t.debug(`Edge `+n.v+` -> `+n.w+`: `+JSON.stringify(e.edge(n)));let i=n.v,a=n.w;if(t.debug(`Fix XXX`,w,`ids:`,n.v,n.w,`Translating: `,w.get(n.v),` --- `,w.get(n.w)),w.get(n.v)||w.get(n.w)){if(t.debug(`Fixing and trying - removing XXX`,n.v,n.w,n.name),i=P(n.v),a=P(n.w),e.removeEdge(n.v,n.w,n.name),i!==n.v){let t=e.parent(i);w.get(t).externalConnections=!0,r.fromCluster=n.v}if(a!==n.w){let t=e.parent(a);w.get(t).externalConnections=!0,r.toCluster=n.w}t.debug(`Fix Replacing with XXX`,i,a,n.name),e.setEdge(i,a,r,n.name)}}),I(e,0),t.trace(w)},`adjustClustersAndEdges`),I=e((e,n)=>{if(n>10){t.error(`Bailing out`);return}let r=e.nodes(),a=!1;for(let t of r){let n=e.children(t);a||=n.length>0}if(!a){t.debug(`Done, no node has children`,e.nodes());return}t.debug(`Nodes = `,r,n);for(let a of r)if(t.debug(`Extracting node`,a,w,w.has(a)&&!w.get(a).externalConnections,!e.parent(a),e.node(a),e.children(`D`),` Depth `,n),!w.has(a))t.debug(`Not a cluster`,a,n);else if(!w.get(a).externalConnections&&e.children(a)&&e.children(a).length>0){t.debug(`Cluster without external connections, without a parent and with children`,a,n);let r=e.graph().rankdir===`TB`?`LR`:`TB`;w.get(a)?.clusterData?.dir&&(r=w.get(a).clusterData.dir,t.debug(`Fixing dir`,w.get(a).clusterData.dir,r));let o=new i({multigraph:!0,compound:!0}).setGraph({rankdir:r,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});A(a,e,o,a),e.setNode(a,{clusterNode:!0,id:a,clusterData:w.get(a).clusterData,label:w.get(a).label,graph:o})}else t.debug(`Cluster ** `,a,` **not meeting the criteria !externalConnections:`,!w.get(a).externalConnections,` no parent: `,!e.parent(a),` children `,e.children(a)&&e.children(a).length>0,e.children(`D`),n),t.debug(w);r=e.nodes(),t.debug(`New list of nodes`,r);for(let i of r){let r=e.node(i);t.debug(` Now next level`,i,r),r?.clusterNode&&I(r.graph,n+1)}},`extractor`),L=e((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=L(e,e.children(t));n=[...n,...r]}),n},`sorter`),R=e(e=>L(e,e.children()),`sortNodesByHierarchy`),z=e((e,t,n)=>{let r=e.parent(t);for(;r&&r!==n;){let t=w.get(r);if(t&&!t.externalConnections)return!0;r=e.parent(r)}return!1},`isNodeInExtractableCluster`),B=e((e,t,n)=>{let r=e.children(t)??[];for(let i of r){if(i===n||O(i,n))continue;let r=N(i,e,t);if(r&&!z(e,r,t))return r}return null},`findSafeAnchorNode`);function V({prepareLayout:t,measureLayout:n,runLayoutCore:r,paintLayout:i,afterPaint:a,paintOptions:o}){let s=n??U;return e(async function(e,n,c,l){let u=n.select(`g`);(c?.insertMarkers??p)(u,e.markers,e.type,e.diagramId),H();let d={element:u,helpers:c,options:l};d.preparedLayout=await t?.(e,d);let f=await s(e,d),m=await r(e,d),h={...d,measure:f};i?await i(e,h,m):await W(e,h,o),await a?.(e,h,m)},`render`)}e(V,`createCommonLayoutRenderer`);function H(){l(),h(),f(),D()}e(H,`clearLayoutRenderState`);async function U(e,{element:t}){return await C(t,e)}e(U,`defaultMeasureLayout`);async function W(e,t,n={}){let{measure:r}=t,{groups:i}=r;for(let r of n.getNodes?.(e,t)??e.nodes)n.skipNode?.(r,t)||await G(i,r,t,n);let a=q(e.nodes);for(let r of e.edges)J(r,n)||await Y(i,r,a,e,n,t)}e(W,`paintLayoutData`);async function G(e,t,n,r){t.clusterNode?s(t):K(t,n,r)?await d(e.clusters,t):s(t)}e(G,`paintLayoutNode`);function K(e,t,n){return e.isGroup===!0&&(n.isCluster?.(e,t)??!0)}e(K,`shouldPaintAsCluster`);function q(e){let t=new Map;for(let n of e)n?.id&&t.set(n.id,n);return t}e(q,`buildNodeLookup`);function J(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}e(J,`shouldSkipPaintEdge`);async function Y(e,t,n,r,i,a){let o=v(e.edgePaths,{...t},i.clusterDb??new Map,r.type,X(t.start,t,n,a,i),X(t.end,t,n,a,i),r.diagramId,Z(t,i));y(t)&&(m.has(t.id)||await _(e.edgeLabels,t),Q(t,o))}e(Y,`paintLayoutEdge`);function X(e,t,n,r,i){return i.getEdgeNode?.(e,t,r)??(e?n.get(e)??{}:{})}e(X,`getRenderedNode`);function Z(e,t){return typeof t.skipIntersect==`function`?t.skipIntersect(e):t.skipIntersect??!1}e(Z,`shouldSkipIntersect`);function Q(e,n){let i=n?.updatedPath??n?.originalPath,o=r(),{subGraphTitleTotalMargin:s}=c({flowchart:o.flowchart??{}});if(e.label){let r=m.get(e.id),o=e.x,c=e.y;if(i){let r=a.calcLabelPosition(i);t.debug(`Moving label `+e.label+` from (`,o,`,`,c,`) to (`,r.x,`,`,r.y,`) abc88`),n?.updatedPath&&(o=r.x,c=r.y)}r.attr(`transform`,`translate(${o}, ${c+s/2})`)}if(e?.startLabelLeft){let t=g.get(e.id).startLeft,n=e?.x,r=e?.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_left`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.startLabelRight){let t=g.get(e.id).startRight,n=e.x,r=e.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_right`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.endLabelLeft){let t=g.get(e.id).endLeft,n=e.x,r=e.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_left`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.endLabelRight){let t=g.get(e.id).endRight,n=e.x,r=e.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_right`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}}e(Q,`positionRenderedEdgeLabel`);export{S as a,b as i,R as n,w as o,N as r,F as s,V as t};
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{a as t,c as n,i as r,n as i,o as a,p as o,r as s,t as c,y as l}from"./chunk-ZS6VBONO-D-IFTJgn.js";var u=class extends r{static{e(this,`RailroadPegTokenBuilder`)}static{l(this,`RailroadPegTokenBuilder`)}constructor(){super([`railroad-peg-beta`])}},d=l(e=>{let t=e.slice(1,-1),n=``;for(let e=0;e<t.length;e++){let r=t[e];if(r===`\\`&&e+1<t.length){e++;let r=t[e];switch(r){case`n`:n+=`
2
+ `;break;case`r`:n+=`\r`;break;case`t`:n+=` `;break;default:n+=r}continue}n+=r}return n},`decodeEscapedString`),f=class extends t{static{e(this,`RailroadPegValueConverter`)}static{l(this,`RailroadPegValueConverter`)}runConverter(e,t,n){let r=super.runConverter(e,t,n);if(e.name===`TITLE`&&typeof r==`string`){let e=r.trim();if(e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`))return d(e)}return r}runCustomConverter(e,t,n){if(e.name===`PEG_STRING`)return d(t)}},p={parser:{TokenBuilder:l(()=>new u,`TokenBuilder`),ValueConverter:l(()=>new f,`ValueConverter`)}};function m(e=n){let t=s(a(e),i),r=s(c({shared:t}),o,p);return t.ServiceRegistry.register(r),{shared:t,RailroadPeg:r}}e(m,`createRailroadPegServices`),l(m,`createRailroadPegServices`);export{p as n,m as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{q as t}from"./chunk-H7VHZCWX-CwFRFlEn.js";import{R as n,l as r}from"./chunk-QJSWEUOL-kvKBktmc.js";import{v as i}from"./chunk-VY2OSTJR-BYk2nUI_.js";import{t as a}from"./chunk-Z6V44ARX-CWGOZvke.js";import{r as o}from"./chunk-VRZKL3EH-BzaZ6KlD.js";import{n as s}from"./chunk-ZQN7UHIL-CNp35E78.js";import{a as c,c as l,r as u,s as d}from"./chunk-4OADUZ5Q-DHE3k_pb.js";var f={common:n,getConfig:r,insertCluster:s,insertEdge:d,insertEdgeLabel:u,insertMarkers:c,insertNode:o,interpolateToCurve:i,labelHelper:a,log:t,positionEdgeLabel:l},p={},m=e(e=>{for(let t of e)p[t.name]=t},`registerLayoutLoaders`);e(()=>{m([{name:`dagre`,loader:e(async()=>await import(`./dagre-MPVFI544-BUrJjGwd.js`),`loader`)},{name:`swimlane`,loader:e(async()=>await import(`./swimlanes-QLVP42QD-CLpR90IY.js`),`loader`)},{name:`cose-bilkent`,loader:e(async()=>await import(`./cose-bilkent-Q72C2OJ3-iX90typn.js`),`loader`)}])},`registerDefaultLayoutLoaders`)();var h=e(async(e,t)=>{if(!(e.layoutAlgorithm in p))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let n=t.domId||t.id;t.domId=`${e.diagramId}-${n}`}let n=p[e.layoutAlgorithm],r=await n.loader(),{theme:i,themeVariables:a}=e.config,{useGradient:o,gradientStart:s,gradientStop:c}=a,l=t.attr(`id`);if(t.append(`defs`).append(`filter`).attr(`id`,`${l}-drop-shadow`).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),t.append(`defs`).append(`filter`).attr(`id`,`${l}-drop-shadow-small`).attr(`height`,`150%`).attr(`width`,`150%`).append(`feDropShadow`).attr(`dx`,`2`).attr(`dy`,`2`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),o){let e=t.append(`linearGradient`).attr(`id`,t.attr(`id`)+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);e.append(`svg:stop`).attr(`offset`,`0%`).attr(`stop-color`,s).attr(`stop-opacity`,1),e.append(`svg:stop`).attr(`offset`,`100%`).attr(`stop-color`,c).attr(`stop-opacity`,1)}return r.render(e,t,f,{algorithm:n.algorithm})},`render`),g=e((e=``,{fallback:n=`dagre`}={})=>{if(e in p)return e;if(n in p)return t.warn(`Layout algorithm ${e} is not registered. Using ${n} as fallback.`),n;throw Error(`Both layout algorithms ${e} and ${n} are not registered.`)},`getRegisteredLayoutAlgorithm`);export{g as n,h as r,m as t};