@marimo-team/frontend 0.10.15-dev6 → 0.10.15-dev8
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.
- package/dist/assets/{ConnectedDataExplorerComponent-BsAo0-TZ.js → ConnectedDataExplorerComponent-C3lNuddP.js} +1 -1
- package/dist/assets/{VegaLite-Cbzyxk3b.js → VegaLite-By4TLBrh.js} +1 -1
- package/dist/assets/{_baseEach-BSQ4SVv_.js → _baseEach-CJ925SFO.js} +1 -1
- package/dist/assets/_baseMap-Bqw8dLV_.js +1 -0
- package/dist/assets/{_baseUniq-BRVQVHd9.js → _baseUniq-BhoJhkdJ.js} +1 -1
- package/dist/assets/{any-language-editor-Bmab2tvk.js → any-language-editor-jEqPXzsM.js} +1 -1
- package/dist/assets/{architectureDiagram-IFBEXTG3-DqL9-7YS.js → architectureDiagram-IFBEXTG3-BUFD8Kyf.js} +1 -1
- package/dist/assets/{blockDiagram-TCMKQVZ6-BL91G_q9.js → blockDiagram-TCMKQVZ6-CLipZYp9.js} +1 -1
- package/dist/assets/{c4Diagram-ZCSEYPFN-CdR5qUeZ.js → c4Diagram-ZCSEYPFN-BO4B8t8a.js} +1 -1
- package/dist/assets/channel-CI4Pe5bF.js +1 -0
- package/dist/assets/{chunk-4LC2V6XN-DVwdU5cE.js → chunk-4LC2V6XN-BmtN6LLP.js} +1 -1
- package/dist/assets/{chunk-5RIWM3LS-DrCuURXF.js → chunk-5RIWM3LS-D9C25ZyL.js} +1 -1
- package/dist/assets/{chunk-6JKP7OK7-BO0X8FD4.js → chunk-6JKP7OK7-BVykGpXc.js} +1 -1
- package/dist/assets/{chunk-NGC4727B-C9HentDi.js → chunk-NGC4727B-BUFnpi_i.js} +1 -1
- package/dist/assets/{chunk-REEJFE46-L4qE4XvS.js → chunk-REEJFE46-BbwADUIP.js} +1 -1
- package/dist/assets/{chunk-RYO7GUH3-Bvn-G3GO.js → chunk-RYO7GUH3-CK1LTJON.js} +1 -1
- package/dist/assets/{chunk-V35ELUW5-DVMXhSfZ.js → chunk-V35ELUW5-CHMhRPXj.js} +1 -1
- package/dist/assets/{classDiagram-Q73GJZWF-BlrWTxLg.js → classDiagram-Q73GJZWF-Cgdr-U_V.js} +1 -1
- package/dist/assets/{classDiagram-v2-C6QPLPW4-DaTUsa7r.js → classDiagram-v2-C6QPLPW4-BphGQHfg.js} +1 -1
- package/dist/assets/clone-D35vxmrt.js +1 -0
- package/dist/assets/{compile-CBuFhssM.js → compile-qyhZrL9D.js} +1 -1
- package/dist/assets/{createWsUrl-BBkfPDEr.js → createWsUrl-BWHeTVrM.js} +1 -1
- package/dist/assets/{dagre-7KT5K2WU-CrpJyJza.js → dagre-7KT5K2WU-DaXAME84.js} +1 -1
- package/dist/assets/{data-editor-BYyj0d-K.js → data-editor-m7inM-h6.js} +1 -1
- package/dist/assets/{diagram-AVGMFHF7-DHIYGumX.js → diagram-AVGMFHF7-C_HNvEoZ.js} +1 -1
- package/dist/assets/{edit-page-crbLCICq.js → edit-page-2ZTEnhi0.js} +3 -3
- package/dist/assets/{erDiagram-DKC2X5TE-CNIVhE5g.js → erDiagram-DKC2X5TE-WmXEoHXa.js} +1 -1
- package/dist/assets/{flowDiagram-NWEUNK3L-BZ4gF99E.js → flowDiagram-NWEUNK3L-B7vJ_dz1.js} +1 -1
- package/dist/assets/{ganttDiagram-HLVPPPRE-DrOY6sfK.js → ganttDiagram-HLVPPPRE-B5ZwRGoK.js} +1 -1
- package/dist/assets/{gitGraph-YCYPL57B-CGup_tZ1.js → gitGraph-YCYPL57B-CJ6kV-7K.js} +1 -1
- package/dist/assets/{gitGraphDiagram-JPZ3KUXI-JzOXWn5_.js → gitGraphDiagram-JPZ3KUXI-BvzYpxkS.js} +1 -1
- package/dist/assets/{graph-BMenLjsK.js → graph-Ce9EVb2r.js} +1 -1
- package/dist/assets/{home-page-DL-7wX9r.js → home-page-z1oNeogK.js} +1 -1
- package/dist/assets/{index-Dq_wCYK6.js → index-9JqQoHFG.js} +1 -1
- package/dist/assets/{index-C4RktzAO.js → index-B-qB4lJo.js} +1 -1
- package/dist/assets/{index-onFz0Hzk.js → index-B6e5wAWy.js} +1 -1
- package/dist/assets/{index-VjHugB9l.js → index-BAjvA-aj.js} +1 -1
- package/dist/assets/index-BRpzR354.js +79 -0
- package/dist/assets/{index-CkYrCMmy.js → index-BT9lTFOE.js} +1 -1
- package/dist/assets/{index-7lZAxQEl.js → index-Bf3tH7xO.js} +1 -1
- package/dist/assets/{index-BBgpPwkg.js → index-BhTkkDct.js} +1 -1
- package/dist/assets/{index-Dsnc3iDz.js → index-C6jI4B6S.js} +1 -1
- package/dist/assets/{index-BmoO0ICT.js → index-CSNxuaTK.js} +1 -1
- package/dist/assets/{index-Dsw82KoD.js → index-CcIfyaON.js} +1 -1
- package/dist/assets/{index-C7T2WbaZ.js → index-D3X0Yleq.js} +1 -1
- package/dist/assets/{index-DebFD1P9.js → index-D6mQ7F3I.js} +1 -1
- package/dist/assets/{index-DOscTpCC.js → index-DpIo0Qyd.js} +1 -1
- package/dist/assets/{index-BBmDbzar.js → index-DpNwpjhA.js} +1 -1
- package/dist/assets/{index-Jdn_xFy4.js → index-G-V5O1vF.js} +1 -1
- package/dist/assets/{index-CbrsO-BL.js → index-Wf-W9PRh.js} +1 -1
- package/dist/assets/{infoDiagram-RZZSJVI2-E03OsOh5.js → infoDiagram-RZZSJVI2-DO2Lzb6u.js} +1 -1
- package/dist/assets/{journeyDiagram-BLD6N6MZ-BtyuL1yZ.js → journeyDiagram-BLD6N6MZ-BOXTl1vf.js} +1 -1
- package/dist/assets/{json-B8MCFVhe.js → json-BDUrgv7K.js} +1 -1
- package/dist/assets/katex-DEYOxkAH.js +1 -0
- package/dist/assets/{layout-BnpzrhGZ.js → layout-C5Umk-zv.js} +1 -1
- package/dist/assets/{linear-De0S1ro-.js → linear-CjEpTNaB.js} +1 -1
- package/dist/assets/{mermaid-M1H1kDcl.js → mermaid-DXc09vQX.js} +3 -3
- package/dist/assets/{mhchem-B1ca-zvM.js → mhchem-mael6lYf.js} +1 -1
- package/dist/assets/{min-C5A3NmZ1.js → min-DLUXj_qx.js} +1 -1
- package/dist/assets/{mindmap-definition-OEB2RXX2-Dr_wtXBE.js → mindmap-definition-OEB2RXX2-9bZc4pGq.js} +1 -1
- package/dist/assets/{pieDiagram-X7YZ5ZEZ-DG-ISu2I.js → pieDiagram-X7YZ5ZEZ-DMaGERXu.js} +1 -1
- package/dist/assets/{quadrantDiagram-F36EZAVT-BcPY1EHH.js → quadrantDiagram-F36EZAVT-DURgVbNv.js} +1 -1
- package/dist/assets/{react-plotly-CccfCShi.js → react-plotly-DhvAinRs.js} +1 -1
- package/dist/assets/{requirementDiagram-JG2LMPGF-Baa5Kjsc.js → requirementDiagram-JG2LMPGF-CGxw-ouG.js} +1 -1
- package/dist/assets/{run-page-CuCD7tWT.js → run-page-BVxP3Bxf.js} +1 -1
- package/dist/assets/{sankeyDiagram-ATFNWWW6-DD1AdWcm.js → sankeyDiagram-ATFNWWW6-BTD6_PBw.js} +1 -1
- package/dist/assets/{sequenceDiagram-WK7YDQ3N-DIYgCA-2.js → sequenceDiagram-WK7YDQ3N-s_RVixka.js} +1 -1
- package/dist/assets/{slides-component-4DgyrNmq.js → slides-component-Bpf1AVII.js} +1 -1
- package/dist/assets/{sortBy-Bki__Qw6.js → sortBy-CIRmqD_x.js} +1 -1
- package/dist/assets/{stateDiagram-4JV6CC6H-CzSyb5SP.js → stateDiagram-4JV6CC6H-D_JymQ35.js} +1 -1
- package/dist/assets/stateDiagram-v2-7KT6RKTD-C5UL-tIs.js +1 -0
- package/dist/assets/{terminal-Bz-YUgad.js → terminal-Cnqis0xe.js} +1 -1
- package/dist/assets/{time-ClrMLZRx.js → time-Cuj2u9q4.js} +1 -1
- package/dist/assets/{timeline-definition-3ZMEY6HS-mlLHcZY9.js → timeline-definition-3ZMEY6HS-DmOl3mbW.js} +1 -1
- package/dist/assets/tree-B6umugFb.js +14 -0
- package/dist/assets/{useMarimoWebSocket-D7Ed6Dez.js → useMarimoWebSocket-BxbaQGEr.js} +4 -4
- package/dist/assets/{vega-component-wtweVtHD.js → vega-component-B5iOebMJ.js} +1 -1
- package/dist/assets/{xychartDiagram-KECQ2H5Q-DTg5x0LQ.js → xychartDiagram-KECQ2H5Q-BVegjYqR.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/_baseMap-B87hcp6h.js +0 -1
- package/dist/assets/channel-Cgwe3aYo.js +0 -1
- package/dist/assets/clone-B_Mv0xNl.js +0 -1
- package/dist/assets/index-Tczrz6gD.js +0 -79
- package/dist/assets/katex-D1MatCUS.js +0 -1
- package/dist/assets/stateDiagram-v2-7KT6RKTD-Be1SCL9O.js +0 -1
- package/dist/assets/tree-Bz-GMq3G.js +0 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as n}from"./graph-BMenLjsK.js";import{cc as e,bG as r,cT as t,aj as o,cU as i,cL as u,cV as a,cW as d,B as c,ah as f,cX as s,cY as g}from"./index-Tczrz6gD.js";import{b as h,e as v,c as l,h as p,i as m,f as w,v as b,r as y}from"./_baseUniq-BRVQVHd9.js";import{b as x,a as k,m as E,c as N,f as _,l as I,d as R}from"./min-C5A3NmZ1.js";import{c as T,a as L}from"./_baseEach-BSQ4SVv_.js";import{s as M}from"./sortBy-Bki__Qw6.js";function C(n,e){return n>e}function P(n,e){var r={};return e=L(e),T(n,(function(n,o,i){t(r,o,e(n,o,i))})),r}function S(n){return n&&n.length?x(n,o,C):void 0}function j(n,e){return n&&n.length?x(n,L(e),k):void 0}var G=0;function V(n){var e=++G;return i(n)+e}class B{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,e=n._prev;if(e!==n)return F(e),e}enqueue(n){var e=this._sentinel;n._prev&&n._next&&F(n),n._next=e._next,e._next._prev=n,e._next=n,n._prev=e}toString(){for(var n=[],e=this._sentinel,r=e._prev;r!==e;)n.push(JSON.stringify(r,O)),r=r._prev;return"["+n.join(", ")+"]"}}function F(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function O(n,e){if("_next"!==n&&"_prev"!==n)return e}var q=c(1);function Y(e,r){if(e.nodeCount()<=1)return[];var t=function(e,r){var t=new n,o=0,i=0;l(e.nodes(),(function(n){t.setNode(n,{v:n,in:0,out:0})})),l(e.edges(),(function(n){var e=t.edge(n.v,n.w)||0,u=r(n),a=e+u;t.setEdge(n.v,n.w,a),i=Math.max(i,t.node(n.v).out+=u),o=Math.max(o,t.node(n.w).in+=u)}));var u=d(i+o+3).map((function(){return new B})),a=o+1;return l(t.nodes(),(function(n){D(u,a,t.node(n))})),{graph:t,buckets:u,zeroIdx:a}}(e,r||q),o=function(n,e,r){var t,o=[],i=e[e.length-1],u=e[0];for(;n.nodeCount();){for(;t=u.dequeue();)z(n,e,r,t);for(;t=i.dequeue();)z(n,e,r,t);if(n.nodeCount())for(var a=e.length-2;a>0;--a)if(t=e[a].dequeue()){o=o.concat(z(n,e,r,t,!0));break}}return o}(t.graph,t.buckets,t.zeroIdx);return a(E(o,(function(n){return e.outEdges(n.v,n.w)})))}function z(n,e,r,t,o){var i=o?[]:void 0;return l(n.inEdges(t.v),(function(t){var u=n.edge(t),a=n.node(t.v);o&&i.push({v:t.v,w:t.w}),a.out-=u,D(e,r,a)})),l(n.outEdges(t.v),(function(t){var o=n.edge(t),i=t.w,u=n.node(i);u.in-=o,D(e,r,u)})),n.removeNode(t.v),i}function D(n,e,r){r.out?r.in?n[r.out-r.in+e].enqueue(r):n[n.length-1].enqueue(r):n[0].enqueue(r)}function A(n){var e,r="greedy"===n.graph().acyclicer?Y(n,(e=n,function(n){return e.edge(n).weight})):function(n){var e=[],r={},t={};function o(i){p(t,i)||(t[i]=!0,r[i]=!0,l(n.outEdges(i),(function(n){p(r,n.w)?e.push(n):o(n.w)})),delete r[i])}return l(n.nodes(),o),e}(n);l(r,(function(e){var r=n.edge(e);n.removeEdge(e),r.forwardName=e.name,r.reversed=!0,n.setEdge(e.w,e.v,r,V("rev"))}))}function U(n,e,r,t){var o;do{o=V(t)}while(n.hasNode(o));return r.dummy=e,n.setNode(o,r),o}function J(e){var r=new n({multigraph:e.isMultigraph()}).setGraph(e.graph());return l(e.nodes(),(function(n){e.children(n).length||r.setNode(n,e.node(n))})),l(e.edges(),(function(n){r.setEdge(n,e.edge(n))})),r}function W(n,e){var r,t,o=n.x,i=n.y,u=e.x-o,a=e.y-i,d=n.width/2,c=n.height/2;if(!u&&!a)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*d>Math.abs(u)*c?(a<0&&(c=-c),r=c*u/a,t=c):(u<0&&(d=-d),r=d,t=d*a/u),{x:o+r,y:i+t}}function X(n){var e=E(d(K(n)+1),(function(){return[]}));return l(n.nodes(),(function(r){var t=n.node(r),o=t.rank;m(o)||(e[o][t.order]=r)})),e}function H(n,e,r,t){var o={width:0,height:0};return arguments.length>=4&&(o.rank=r,o.order=t),U(n,"border",o,e)}function K(n){return S(E(n.nodes(),(function(e){var r=n.node(e).rank;if(!m(r))return r})))}function Q(n,e){return e()}function Z(n,e,r,t,o,i){var u={width:0,height:0,rank:i,borderType:e},a=o[e][i-1],d=U(n,"border",u,r);o[e][i]=d,n.setParent(d,t),a&&n.setEdge(a,d,{weight:1})}function $(n){var e=n.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(n){l(n.nodes(),(function(e){rn(n.node(e))})),l(n.edges(),(function(e){var r=n.edge(e);l(r.points,rn),p(r,"y")&&rn(r)}))}(n),"lr"!==e&&"rl"!==e||(!function(n){l(n.nodes(),(function(e){tn(n.node(e))})),l(n.edges(),(function(e){var r=n.edge(e);l(r.points,tn),p(r,"x")&&tn(r)}))}(n),nn(n))}function nn(n){l(n.nodes(),(function(e){en(n.node(e))})),l(n.edges(),(function(e){en(n.edge(e))}))}function en(n){var e=n.width;n.width=n.height,n.height=e}function rn(n){n.y=-n.y}function tn(n){var e=n.x;n.x=n.y,n.y=e}function on(n){n.graph().dummyChains=[],l(n.edges(),(function(e){!function(n,e){var r,t,o,i=e.v,u=n.node(i).rank,a=e.w,d=n.node(a).rank,c=e.name,f=n.edge(e),s=f.labelRank;if(d===u+1)return;for(n.removeEdge(e),o=0,++u;u<d;++o,++u)f.points=[],r=U(n,"edge",t={width:0,height:0,edgeLabel:f,edgeObj:e,rank:u},"_d"),u===s&&(t.width=f.width,t.height=f.height,t.dummy="edge-label",t.labelpos=f.labelpos),n.setEdge(i,r,{weight:f.weight},c),0===o&&n.graph().dummyChains.push(r),i=r;n.setEdge(i,a,{weight:f.weight},c)}(n,e)}))}function un(n){var e={};l(n.sources(),(function r(t){var o=n.node(t);if(p(e,t))return o.rank;e[t]=!0;var i=N(E(n.outEdges(t),(function(e){return r(e.w)-n.edge(e).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))}function an(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen}function dn(e){var r,t,o=new n({directed:!1}),i=e.nodes()[0],u=e.nodeCount();for(o.setNode(i,{});cn(o,e)<u;)r=fn(o,e),t=o.hasNode(r.v)?an(e,r):-an(e,r),sn(o,e,t);return o}function cn(n,e){return l(n.nodes(),(function r(t){l(e.nodeEdges(t),(function(o){var i=o.v,u=t===i?o.w:i;n.hasNode(u)||an(e,o)||(n.setNode(u,{}),n.setEdge(t,u,{}),r(u))}))})),n.nodeCount()}function fn(n,e){return j(e.edges(),(function(r){if(n.hasNode(r.v)!==n.hasNode(r.w))return an(e,r)}))}function sn(n,e,r){l(n.nodes(),(function(n){e.node(n).rank+=r}))}function gn(n,e,r){f(e)||(e=[e]);var t=(n.isDirected()?n.successors:n.neighbors).bind(n),o=[],i={};return l(e,(function(e){if(!n.hasNode(e))throw new Error("Graph does not have node: "+e);hn(n,e,"post"===r,i,t,o)})),o}function hn(n,e,r,t,o,i){p(t,e)||(t[e]=!0,r||i.push(e),l(o(e),(function(e){hn(n,e,r,t,o,i)})),r&&i.push(e))}function vn(e){e=function(e){var r=(new n).setGraph(e.graph());return l(e.nodes(),(function(n){r.setNode(n,e.node(n))})),l(e.edges(),(function(n){var t=r.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);r.setEdge(n.v,n.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})})),r}(e),un(e);var r,t=dn(e);for(mn(t),ln(t,e);r=bn(t);)xn(t,e,r,yn(t,e,r))}function ln(n,e){var r=function(n,e){return gn(n,e,"post")}(n,n.nodes());r=r.slice(0,r.length-1),l(r,(function(r){!function(n,e,r){var t=n.node(r),o=t.parent;n.edge(r,o).cutvalue=pn(n,e,r)}(n,e,r)}))}function pn(n,e,r){var t=n.node(r).parent,o=!0,i=e.edge(r,t),u=0;return i||(o=!1,i=e.edge(t,r)),u=i.weight,l(e.nodeEdges(r),(function(i){var a,d,c=i.v===r,f=c?i.w:i.v;if(f!==t){var s=c===o,g=e.edge(i).weight;if(u+=s?g:-g,a=r,d=f,n.hasEdge(a,d)){var h=n.edge(r,f).cutvalue;u+=s?-h:h}}})),u}function mn(n,e){arguments.length<2&&(e=n.nodes()[0]),wn(n,{},1,e)}function wn(n,e,r,t,o){var i=r,u=n.node(t);return e[t]=!0,l(n.neighbors(t),(function(o){p(e,o)||(r=wn(n,e,r,o,t))})),u.low=i,u.lim=r++,o?u.parent=o:delete u.parent,r}function bn(n){return _(n.edges(),(function(e){return n.edge(e).cutvalue<0}))}function yn(n,e,r){var t=r.v,o=r.w;e.hasEdge(t,o)||(t=r.w,o=r.v);var i=n.node(t),u=n.node(o),a=i,d=!1;return i.lim>u.lim&&(a=u,d=!0),j(w(e.edges(),(function(e){return d===kn(n,n.node(e.v),a)&&d!==kn(n,n.node(e.w),a)})),(function(n){return an(e,n)}))}function xn(n,e,r,t){var o=r.v,i=r.w;n.removeEdge(o,i),n.setEdge(t.v,t.w,{}),mn(n),ln(n,e),function(n,e){var r=_(n.nodes(),(function(n){return!e.node(n).parent})),t=function(n,e){return gn(n,e,"pre")}(n,r);t=t.slice(1),l(t,(function(r){var t=n.node(r).parent,o=e.edge(r,t),i=!1;o||(o=e.edge(t,r),i=!0),e.node(r).rank=e.node(t).rank+(i?o.minlen:-o.minlen)}))}(n,e)}function kn(n,e,r){return r.low<=e.lim&&e.lim<=r.lim}function En(n){switch(n.graph().ranker){case"network-simplex":default:_n(n);break;case"tight-tree":!function(n){un(n),dn(n)}(n);break;case"longest-path":Nn(n)}}new Error,vn.initLowLimValues=mn,vn.initCutValues=ln,vn.calcCutValue=pn,vn.leaveEdge=bn,vn.enterEdge=yn,vn.exchangeEdges=xn;var Nn=un;function _n(n){vn(n)}function In(n){var e=U(n,"root",{},"_root"),r=function(n){var e={};function r(t,o){var i=n.children(t);i&&i.length&&l(i,(function(n){r(n,o+1)})),e[t]=o}return l(n.children(),(function(n){r(n,1)})),e}(n),t=S(b(r))-1,o=2*t+1;n.graph().nestingRoot=e,l(n.edges(),(function(e){n.edge(e).minlen*=o}));var i=function(n){return y(n.edges(),(function(e,r){return e+n.edge(r).weight}),0)}(n)+1;l(n.children(),(function(u){Rn(n,e,o,i,t,r,u)})),n.graph().nodeRankFactor=o}function Rn(n,e,r,t,o,i,u){var a=n.children(u);if(a.length){var d=H(n,"_bt"),c=H(n,"_bb"),f=n.node(u);n.setParent(d,u),f.borderTop=d,n.setParent(c,u),f.borderBottom=c,l(a,(function(a){Rn(n,e,r,t,o,i,a);var f=n.node(a),s=f.borderTop?f.borderTop:a,g=f.borderBottom?f.borderBottom:a,h=f.borderTop?t:2*t,v=s!==g?1:o-i[u]+1;n.setEdge(d,s,{weight:h,minlen:v,nestingEdge:!0}),n.setEdge(g,c,{weight:h,minlen:v,nestingEdge:!0})})),n.parent(u)||n.setEdge(e,d,{weight:0,minlen:o+i[u]})}else u!==e&&n.setEdge(e,u,{weight:0,minlen:r})}function Tn(e,r,t){var o=function(n){var e;for(;n.hasNode(e=V("_root")););return e}(e),i=new n({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(n){return e.node(n)}));return l(e.nodes(),(function(n){var u=e.node(n),a=e.parent(n);(u.rank===r||u.minRank<=r&&r<=u.maxRank)&&(i.setNode(n),i.setParent(n,a||o),l(e[t](n),(function(r){var t=r.v===n?r.w:r.v,o=i.edge(t,n),u=m(o)?0:o.weight;i.setEdge(t,n,{weight:e.edge(r).weight+u})})),p(u,"minRank")&&i.setNode(n,{borderLeft:u.borderLeft[r],borderRight:u.borderRight[r]}))})),i}function Ln(n,e){for(var r=0,t=1;t<e.length;++t)r+=Mn(n,e[t-1],e[t]);return r}function Mn(n,e,r){for(var t,o,i=(t=r,o=E(r,(function(n,e){return e})),function(n,e,r){for(var t=-1,o=n.length,i=e.length,u={};++t<o;){var a=t<i?e[t]:void 0;r(u,n[t],a)}return u}(t||[],o||[],u)),d=a(E(e,(function(e){return M(E(n.outEdges(e),(function(e){return{pos:i[e.w],weight:n.edge(e).weight}})),"pos")}))),c=1;c<r.length;)c<<=1;var f=2*c-1;c-=1;var s=E(new Array(f),(function(){return 0})),g=0;return l(d.forEach((function(n){var e=n.pos+c;s[e]+=n.weight;for(var r=0;e>0;)e%2&&(r+=s[e+1]),s[e=e-1>>1]+=n.weight;g+=n.weight*r}))),g}function Cn(n,e){var r={};return l(n,(function(n,e){var t=r[n.v]={indegree:0,in:[],out:[],vs:[n.v],i:e};m(n.barycenter)||(t.barycenter=n.barycenter,t.weight=n.weight)})),l(e.edges(),(function(n){var e=r[n.v],t=r[n.w];m(e)||m(t)||(t.indegree++,e.out.push(r[n.w]))})),function(n){var e=[];function r(n){return function(e){e.merged||(m(e.barycenter)||m(n.barycenter)||e.barycenter>=n.barycenter)&&function(n,e){var r=0,t=0;n.weight&&(r+=n.barycenter*n.weight,t+=n.weight);e.weight&&(r+=e.barycenter*e.weight,t+=e.weight);n.vs=e.vs.concat(n.vs),n.barycenter=r/t,n.weight=t,n.i=Math.min(e.i,n.i),e.merged=!0}(n,e)}}function t(e){return function(r){r.in.push(e),0==--r.indegree&&n.push(r)}}for(;n.length;){var o=n.pop();e.push(o),l(o.in.reverse(),r(o)),l(o.out,t(o))}return E(w(e,(function(n){return!n.merged})),(function(n){return s(n,["vs","i","barycenter","weight"])}))}(w(r,(function(n){return!n.indegree})))}function Pn(n,e){var r,t=function(n,e){var r={lhs:[],rhs:[]};return l(n,(function(n){e(n)?r.lhs.push(n):r.rhs.push(n)})),r}(n,(function(n){return p(n,"barycenter")})),o=t.lhs,i=M(t.rhs,(function(n){return-n.i})),u=[],d=0,c=0,f=0;o.sort((r=!!e,function(n,e){return n.barycenter<e.barycenter?-1:n.barycenter>e.barycenter?1:r?e.i-n.i:n.i-e.i})),f=Sn(u,i,f),l(o,(function(n){f+=n.vs.length,u.push(n.vs),d+=n.barycenter*n.weight,c+=n.weight,f=Sn(u,i,f)}));var s={vs:a(u)};return c&&(s.barycenter=d/c,s.weight=c),s}function Sn(n,e,r){for(var t;e.length&&(t=I(e)).i<=r;)e.pop(),n.push(t.vs),r++;return r}function jn(n,e,r,t){var o=n.children(e),i=n.node(e),u=i?i.borderLeft:void 0,d=i?i.borderRight:void 0,c={};u&&(o=w(o,(function(n){return n!==u&&n!==d})));var f=function(n,e){return E(e,(function(e){var r=n.inEdges(e);if(r.length){var t=y(r,(function(e,r){var t=n.edge(r),o=n.node(r.v);return{sum:e.sum+t.weight*o.order,weight:e.weight+t.weight}}),{sum:0,weight:0});return{v:e,barycenter:t.sum/t.weight,weight:t.weight}}return{v:e}}))}(n,o);l(f,(function(e){if(n.children(e.v).length){var o=jn(n,e.v,r,t);c[e.v]=o,p(o,"barycenter")&&(u=o,m((i=e).barycenter)?(i.barycenter=u.barycenter,i.weight=u.weight):(i.barycenter=(i.barycenter*i.weight+u.barycenter*u.weight)/(i.weight+u.weight),i.weight+=u.weight))}var i,u}));var s=Cn(f,r);!function(n,e){l(n,(function(n){n.vs=a(n.vs.map((function(n){return e[n]?e[n].vs:n})))}))}(s,c);var g=Pn(s,t);if(u&&(g.vs=a([u,g.vs,d]),n.predecessors(u).length)){var h=n.node(n.predecessors(u)[0]),v=n.node(n.predecessors(d)[0]);p(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+h.order+v.order)/(g.weight+2),g.weight+=2}return g}function Gn(n){var e=K(n),r=Vn(n,d(1,e+1),"inEdges"),t=Vn(n,d(e-1,-1,-1),"outEdges"),o=function(n){var e={},r=w(n.nodes(),(function(e){return!n.children(e).length})),t=S(E(r,(function(e){return n.node(e).rank}))),o=E(d(t+1),(function(){return[]})),i=M(r,(function(e){return n.node(e).rank}));return l(i,(function r(t){if(!p(e,t)){e[t]=!0;var i=n.node(t);o[i.rank].push(t),l(n.successors(t),r)}})),o}(n);Fn(n,o);for(var i,u=Number.POSITIVE_INFINITY,a=0,c=0;c<4;++a,++c){Bn(a%2?r:t,a%4>=2);var f=Ln(n,o=X(n));f<u&&(c=0,i=h(o,5),u=f)}Fn(n,i)}function Vn(n,e,r){return E(e,(function(e){return Tn(n,e,r)}))}function Bn(e,r){var t=new n;l(e,(function(n){var e=n.graph().root,o=jn(n,e,t,r);l(o.vs,(function(e,r){n.node(e).order=r})),function(n,e,r){var t,o={};l(r,(function(r){for(var i,u,a=n.parent(r);a;){if((i=n.parent(a))?(u=o[i],o[i]=a):(u=t,t=a),u&&u!==a)return void e.setEdge(u,a);a=i}}))}(n,t,o.vs)}))}function Fn(n,e){l(e,(function(e){l(e,(function(e,r){n.node(e).order=r}))}))}function On(n){var e=function(n){var e={},r=0;function t(o){var i=r;l(n.children(o),t),e[o]={low:i,lim:r++}}return l(n.children(),t),e}(n);l(n.graph().dummyChains,(function(r){for(var t=n.node(r),o=t.edgeObj,i=function(n,e,r,t){var o,i,u=[],a=[],d=Math.min(e[r].low,e[t].low),c=Math.max(e[r].lim,e[t].lim);o=r;do{o=n.parent(o),u.push(o)}while(o&&(e[o].low>d||c>e[o].lim));i=o,o=t;for(;(o=n.parent(o))!==i;)a.push(o);return{path:u.concat(a.reverse()),lca:i}}(n,e,o.v,o.w),u=i.path,a=i.lca,d=0,c=u[d],f=!0;r!==o.w;){if(t=n.node(r),f){for(;(c=u[d])!==a&&n.node(c).maxRank<t.rank;)d++;c===a&&(f=!1)}if(!f){for(;d<u.length-1&&n.node(c=u[d+1]).minRank<=t.rank;)d++;c=u[d]}n.setParent(r,c),r=n.successors(r)[0]}}))}function qn(n,e){var r={};return y(e,(function(e,t){var o=0,i=0,u=e.length,a=I(t);return l(t,(function(e,d){var c=function(n,e){if(n.node(e).dummy)return _(n.predecessors(e),(function(e){return n.node(e).dummy}))}(n,e),f=c?n.node(c).order:u;(c||e===a)&&(l(t.slice(i,d+1),(function(e){l(n.predecessors(e),(function(t){var i=n.node(t),u=i.order;!(u<o||f<u)||i.dummy&&n.node(e).dummy||Yn(r,t,e)}))})),i=d+1,o=f)})),t})),r}function Yn(n,e,r){if(e>r){var t=e;e=r,r=t}var o=n[e];o||(n[e]=o={}),o[r]=!0}function zn(n,e,r){if(e>r){var t=e;e=r,r=t}return p(n[e],r)}function Dn(e,r,t,o,i){var u={},a=function(e,r,t,o){var i=new n,u=e.graph(),a=function(n,e,r){return function(t,o,i){var u,a=t.node(o),d=t.node(i),c=0;if(c+=a.width/2,p(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2}if(u&&(c+=r?u:-u),u=0,c+=(a.dummy?e:n)/2,c+=(d.dummy?e:n)/2,c+=d.width/2,p(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":u=d.width/2;break;case"r":u=-d.width/2}return u&&(c+=r?u:-u),u=0,c}}(u.nodesep,u.edgesep,o);return l(r,(function(n){var r;l(n,(function(n){var o=t[n];if(i.setNode(o),r){var u=t[r],d=i.edge(u,o);i.setEdge(u,o,Math.max(a(e,n,r),d||0))}r=n}))})),i}(e,r,t,i),d=i?"borderLeft":"borderRight";function c(n,e){for(var r=a.nodes(),t=r.pop(),o={};t;)o[t]?n(t):(o[t]=!0,r.push(t),r=r.concat(e(t))),t=r.pop()}return c((function(n){u[n]=a.inEdges(n).reduce((function(n,e){return Math.max(n,u[e.v]+a.edge(e))}),0)}),a.predecessors.bind(a)),c((function(n){var r=a.outEdges(n).reduce((function(n,e){return Math.min(n,u[e.w]-a.edge(e))}),Number.POSITIVE_INFINITY),t=e.node(n);r!==Number.POSITIVE_INFINITY&&t.borderType!==d&&(u[n]=Math.max(u[n],r))}),a.successors.bind(a)),l(o,(function(n){u[n]=u[t[n]]})),u}function An(n,t){return j(b(t),(function(t){var o,i,u=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return i=function(e,r){var t=function(n,e){return n.node(e).width}(n,r)/2;u=Math.max(e+t,u),a=Math.min(e-t,a)},null==(o=t)||e(o,v(i),r),u-a}))}function Un(n){var e,r=X(n),t=g(qn(n,r),function(n,e){var r={};function t(e,t,o,i,u){var a;l(d(t,o),(function(t){a=e[t],n.node(a).dummy&&l(n.predecessors(a),(function(e){var t=n.node(e);t.dummy&&(t.order<i||t.order>u)&&Yn(r,e,a)}))}))}return y(e,(function(e,r){var o,i=-1,u=0;return l(r,(function(a,d){if("border"===n.node(a).dummy){var c=n.predecessors(a);c.length&&(o=n.node(c[0]).order,t(r,u,d,i,o),u=d,i=o)}t(r,u,r.length,o,e.length)})),r})),r}(n,r)),o={};l(["u","d"],(function(i){e="u"===i?r:b(r).reverse(),l(["l","r"],(function(r){"r"===r&&(e=E(e,(function(n){return b(n).reverse()})));var u=("u"===i?n.predecessors:n.successors).bind(n),a=function(n,e,r,t){var o={},i={},u={};return l(e,(function(n){l(n,(function(n,e){o[n]=n,i[n]=n,u[n]=e}))})),l(e,(function(n){var e=-1;l(n,(function(n){var a=t(n);if(a.length)for(var d=((a=M(a,(function(n){return u[n]}))).length-1)/2,c=Math.floor(d),f=Math.ceil(d);c<=f;++c){var s=a[c];i[n]===n&&e<u[s]&&!zn(r,n,s)&&(i[s]=n,i[n]=o[n]=o[s],e=u[s])}}))})),{root:o,align:i}}(0,e,t,u),d=Dn(n,e,a.root,a.align,"r"===r);"r"===r&&(d=P(d,(function(n){return-n}))),o[i+r]=d}))}));var i=An(n,o);return function(n,e){var r=b(e),t=N(r),o=S(r);l(["u","d"],(function(r){l(["l","r"],(function(i){var u,a=r+i,d=n[a];if(d!==e){var c=b(d);(u="l"===i?t-N(c):o-S(c))&&(n[a]=P(d,(function(n){return n+u})))}}))}))}(o,i),function(n,e){return P(n.ul,(function(r,t){if(e)return n[e.toLowerCase()][t];var o=M(E(n,t));return(o[1]+o[2])/2}))}(o,n.graph().align)}function Jn(n){var e,r;(function(n){var e=X(n),r=n.graph().ranksep,t=0;l(e,(function(e){var o=S(E(e,(function(e){return n.node(e).height})));l(e,(function(e){n.node(e).y=t+o/2})),t+=o+r}))})(n=J(n)),e=Un(n),r=function(e,r){n.node(r).x=e},e&&T(e,v(r))}function Wn(e,r){var t=Q;t("layout",(function(){var r=t(" buildLayoutGraph",(function(){return function(e){var r=new n({multigraph:!0,compound:!0}),t=te(e.graph());return r.setGraph(g({},Hn,re(t,Xn),s(t,Kn))),l(e.nodes(),(function(n){var t=te(e.node(n));r.setNode(n,R(re(t,Qn),Zn)),r.setParent(n,e.parent(n))})),l(e.edges(),(function(n){var t=te(e.edge(n));r.setEdge(n,g({},ne,re(t,$n),s(t,ee)))})),r}(e)}));t(" runLayout",(function(){!function(n,e){e(" makeSpaceForEdgeLabels",(function(){!function(n){var e=n.graph();e.ranksep/=2,l(n.edges(),(function(r){var t=n.edge(r);t.minlen*=2,"c"!==t.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?t.width+=t.labeloffset:t.height+=t.labeloffset)}))}(n)})),e(" removeSelfEdges",(function(){!function(n){l(n.edges(),(function(e){if(e.v===e.w){var r=n.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:e,label:n.edge(e)}),n.removeEdge(e)}}))}(n)})),e(" acyclic",(function(){A(n)})),e(" nestingGraph.run",(function(){In(n)})),e(" rank",(function(){En(J(n))})),e(" injectEdgeLabelProxies",(function(){!function(n){l(n.edges(),(function(e){var r=n.edge(e);if(r.width&&r.height){var t=n.node(e.v),o={rank:(n.node(e.w).rank-t.rank)/2+t.rank,e:e};U(n,"edge-proxy",o,"_ep")}}))}(n)})),e(" removeEmptyRanks",(function(){!function(n){var e=N(E(n.nodes(),(function(e){return n.node(e).rank}))),r=[];l(n.nodes(),(function(t){var o=n.node(t).rank-e;r[o]||(r[o]=[]),r[o].push(t)}));var t=0,o=n.graph().nodeRankFactor;l(r,(function(e,r){m(e)&&r%o!=0?--t:t&&l(e,(function(e){n.node(e).rank+=t}))}))}(n)})),e(" nestingGraph.cleanup",(function(){!function(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,l(n.edges(),(function(e){n.edge(e).nestingEdge&&n.removeEdge(e)}))}(n)})),e(" normalizeRanks",(function(){!function(n){var e=N(E(n.nodes(),(function(e){return n.node(e).rank})));l(n.nodes(),(function(r){var t=n.node(r);p(t,"rank")&&(t.rank-=e)}))}(n)})),e(" assignRankMinMax",(function(){!function(n){var e=0;l(n.nodes(),(function(r){var t=n.node(r);t.borderTop&&(t.minRank=n.node(t.borderTop).rank,t.maxRank=n.node(t.borderBottom).rank,e=S(e,t.maxRank))})),n.graph().maxRank=e}(n)})),e(" removeEdgeLabelProxies",(function(){!function(n){l(n.nodes(),(function(e){var r=n.node(e);"edge-proxy"===r.dummy&&(n.edge(r.e).labelRank=r.rank,n.removeNode(e))}))}(n)})),e(" normalize.run",(function(){on(n)})),e(" parentDummyChains",(function(){On(n)})),e(" addBorderSegments",(function(){!function(n){l(n.children(),(function e(r){var t=n.children(r),o=n.node(r);if(t.length&&l(t,e),p(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,u=o.maxRank+1;i<u;++i)Z(n,"borderLeft","_bl",r,o,i),Z(n,"borderRight","_br",r,o,i)}}))}(n)})),e(" order",(function(){Gn(n)})),e(" insertSelfEdges",(function(){!function(n){var e=X(n);l(e,(function(e){var r=0;l(e,(function(e,t){var o=n.node(e);o.order=t+r,l(o.selfEdges,(function(e){U(n,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:t+ ++r,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(n)})),e(" adjustCoordinateSystem",(function(){!function(n){var e=n.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||nn(n)}(n)})),e(" position",(function(){Jn(n)})),e(" positionSelfEdges",(function(){!function(n){l(n.nodes(),(function(e){var r=n.node(e);if("selfedge"===r.dummy){var t=n.node(r.e.v),o=t.x+t.width/2,i=t.y,u=r.x-o,a=t.height/2;n.setEdge(r.e,r.label),n.removeNode(e),r.label.points=[{x:o+2*u/3,y:i-a},{x:o+5*u/6,y:i-a},{x:o+u,y:i},{x:o+5*u/6,y:i+a},{x:o+2*u/3,y:i+a}],r.label.x=r.x,r.label.y=r.y}}))}(n)})),e(" removeBorderNodes",(function(){!function(n){l(n.nodes(),(function(e){if(n.children(e).length){var r=n.node(e),t=n.node(r.borderTop),o=n.node(r.borderBottom),i=n.node(I(r.borderLeft)),u=n.node(I(r.borderRight));r.width=Math.abs(u.x-i.x),r.height=Math.abs(o.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}})),l(n.nodes(),(function(e){"border"===n.node(e).dummy&&n.removeNode(e)}))}(n)})),e(" normalize.undo",(function(){!function(n){l(n.graph().dummyChains,(function(e){var r,t=n.node(e),o=t.edgeLabel;for(n.setEdge(t.edgeObj,o);t.dummy;)r=n.successors(e)[0],n.removeNode(e),o.points.push({x:t.x,y:t.y}),"edge-label"===t.dummy&&(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height),e=r,t=n.node(e)}))}(n)})),e(" fixupEdgeLabelCoords",(function(){!function(n){l(n.edges(),(function(e){var r=n.edge(e);if(p(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}}))}(n)})),e(" undoCoordinateSystem",(function(){$(n)})),e(" translateGraph",(function(){!function(n){var e=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,o=0,i=n.graph(),u=i.marginx||0,a=i.marginy||0;function d(n){var i=n.x,u=n.y,a=n.width,d=n.height;e=Math.min(e,i-a/2),r=Math.max(r,i+a/2),t=Math.min(t,u-d/2),o=Math.max(o,u+d/2)}l(n.nodes(),(function(e){d(n.node(e))})),l(n.edges(),(function(e){var r=n.edge(e);p(r,"x")&&d(r)})),e-=u,t-=a,l(n.nodes(),(function(r){var o=n.node(r);o.x-=e,o.y-=t})),l(n.edges(),(function(r){var o=n.edge(r);l(o.points,(function(n){n.x-=e,n.y-=t})),p(o,"x")&&(o.x-=e),p(o,"y")&&(o.y-=t)})),i.width=r-e+u,i.height=o-t+a}(n)})),e(" assignNodeIntersects",(function(){!function(n){l(n.edges(),(function(e){var r,t,o=n.edge(e),i=n.node(e.v),u=n.node(e.w);o.points?(r=o.points[0],t=o.points[o.points.length-1]):(o.points=[],r=u,t=i),o.points.unshift(W(i,r)),o.points.push(W(u,t))}))}(n)})),e(" reversePoints",(function(){!function(n){l(n.edges(),(function(e){var r=n.edge(e);r.reversed&&r.points.reverse()}))}(n)})),e(" acyclic.undo",(function(){!function(n){l(n.edges(),(function(e){var r=n.edge(e);if(r.reversed){n.removeEdge(e);var t=r.forwardName;delete r.reversed,delete r.forwardName,n.setEdge(e.w,e.v,r,t)}}))}(n)}))}(r,t)})),t(" updateInputGraph",(function(){!function(n,e){l(n.nodes(),(function(r){var t=n.node(r),o=e.node(r);t&&(t.x=o.x,t.y=o.y,e.children(r).length&&(t.width=o.width,t.height=o.height))})),l(n.edges(),(function(r){var t=n.edge(r),o=e.edge(r);t.points=o.points,p(o,"x")&&(t.x=o.x,t.y=o.y)})),n.graph().width=e.graph().width,n.graph().height=e.graph().height}(e,r)}))}))}var Xn=["nodesep","edgesep","ranksep","marginx","marginy"],Hn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Kn=["acyclicer","ranker","rankdir","align"],Qn=["width","height"],Zn={width:0,height:0},$n=["minlen","weight","width","height","labeloffset"],ne={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ee=["labelpos"];function re(n,e){return P(s(n,e),Number)}function te(n){var e={};return l(n,(function(n,r){e[r.toLowerCase()]=n})),e}export{Wn as l};
|
|
1
|
+
import{G as n}from"./graph-Ce9EVb2r.js";import{cc as e,bG as r,cT as t,aj as o,cU as i,cL as u,cV as a,cW as d,B as c,ah as f,cX as s,cY as g}from"./index-BRpzR354.js";import{b as h,e as v,c as l,h as p,i as m,f as w,v as b,r as y}from"./_baseUniq-BhoJhkdJ.js";import{b as x,a as k,m as E,c as N,f as _,l as I,d as R}from"./min-DLUXj_qx.js";import{c as T,a as L}from"./_baseEach-CJ925SFO.js";import{s as M}from"./sortBy-CIRmqD_x.js";function C(n,e){return n>e}function P(n,e){var r={};return e=L(e),T(n,(function(n,o,i){t(r,o,e(n,o,i))})),r}function S(n){return n&&n.length?x(n,o,C):void 0}function j(n,e){return n&&n.length?x(n,L(e),k):void 0}var G=0;function V(n){var e=++G;return i(n)+e}class B{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,e=n._prev;if(e!==n)return F(e),e}enqueue(n){var e=this._sentinel;n._prev&&n._next&&F(n),n._next=e._next,e._next._prev=n,e._next=n,n._prev=e}toString(){for(var n=[],e=this._sentinel,r=e._prev;r!==e;)n.push(JSON.stringify(r,O)),r=r._prev;return"["+n.join(", ")+"]"}}function F(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function O(n,e){if("_next"!==n&&"_prev"!==n)return e}var q=c(1);function Y(e,r){if(e.nodeCount()<=1)return[];var t=function(e,r){var t=new n,o=0,i=0;l(e.nodes(),(function(n){t.setNode(n,{v:n,in:0,out:0})})),l(e.edges(),(function(n){var e=t.edge(n.v,n.w)||0,u=r(n),a=e+u;t.setEdge(n.v,n.w,a),i=Math.max(i,t.node(n.v).out+=u),o=Math.max(o,t.node(n.w).in+=u)}));var u=d(i+o+3).map((function(){return new B})),a=o+1;return l(t.nodes(),(function(n){D(u,a,t.node(n))})),{graph:t,buckets:u,zeroIdx:a}}(e,r||q),o=function(n,e,r){var t,o=[],i=e[e.length-1],u=e[0];for(;n.nodeCount();){for(;t=u.dequeue();)z(n,e,r,t);for(;t=i.dequeue();)z(n,e,r,t);if(n.nodeCount())for(var a=e.length-2;a>0;--a)if(t=e[a].dequeue()){o=o.concat(z(n,e,r,t,!0));break}}return o}(t.graph,t.buckets,t.zeroIdx);return a(E(o,(function(n){return e.outEdges(n.v,n.w)})))}function z(n,e,r,t,o){var i=o?[]:void 0;return l(n.inEdges(t.v),(function(t){var u=n.edge(t),a=n.node(t.v);o&&i.push({v:t.v,w:t.w}),a.out-=u,D(e,r,a)})),l(n.outEdges(t.v),(function(t){var o=n.edge(t),i=t.w,u=n.node(i);u.in-=o,D(e,r,u)})),n.removeNode(t.v),i}function D(n,e,r){r.out?r.in?n[r.out-r.in+e].enqueue(r):n[n.length-1].enqueue(r):n[0].enqueue(r)}function A(n){var e,r="greedy"===n.graph().acyclicer?Y(n,(e=n,function(n){return e.edge(n).weight})):function(n){var e=[],r={},t={};function o(i){p(t,i)||(t[i]=!0,r[i]=!0,l(n.outEdges(i),(function(n){p(r,n.w)?e.push(n):o(n.w)})),delete r[i])}return l(n.nodes(),o),e}(n);l(r,(function(e){var r=n.edge(e);n.removeEdge(e),r.forwardName=e.name,r.reversed=!0,n.setEdge(e.w,e.v,r,V("rev"))}))}function U(n,e,r,t){var o;do{o=V(t)}while(n.hasNode(o));return r.dummy=e,n.setNode(o,r),o}function J(e){var r=new n({multigraph:e.isMultigraph()}).setGraph(e.graph());return l(e.nodes(),(function(n){e.children(n).length||r.setNode(n,e.node(n))})),l(e.edges(),(function(n){r.setEdge(n,e.edge(n))})),r}function W(n,e){var r,t,o=n.x,i=n.y,u=e.x-o,a=e.y-i,d=n.width/2,c=n.height/2;if(!u&&!a)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*d>Math.abs(u)*c?(a<0&&(c=-c),r=c*u/a,t=c):(u<0&&(d=-d),r=d,t=d*a/u),{x:o+r,y:i+t}}function X(n){var e=E(d(K(n)+1),(function(){return[]}));return l(n.nodes(),(function(r){var t=n.node(r),o=t.rank;m(o)||(e[o][t.order]=r)})),e}function H(n,e,r,t){var o={width:0,height:0};return arguments.length>=4&&(o.rank=r,o.order=t),U(n,"border",o,e)}function K(n){return S(E(n.nodes(),(function(e){var r=n.node(e).rank;if(!m(r))return r})))}function Q(n,e){return e()}function Z(n,e,r,t,o,i){var u={width:0,height:0,rank:i,borderType:e},a=o[e][i-1],d=U(n,"border",u,r);o[e][i]=d,n.setParent(d,t),a&&n.setEdge(a,d,{weight:1})}function $(n){var e=n.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(n){l(n.nodes(),(function(e){rn(n.node(e))})),l(n.edges(),(function(e){var r=n.edge(e);l(r.points,rn),p(r,"y")&&rn(r)}))}(n),"lr"!==e&&"rl"!==e||(!function(n){l(n.nodes(),(function(e){tn(n.node(e))})),l(n.edges(),(function(e){var r=n.edge(e);l(r.points,tn),p(r,"x")&&tn(r)}))}(n),nn(n))}function nn(n){l(n.nodes(),(function(e){en(n.node(e))})),l(n.edges(),(function(e){en(n.edge(e))}))}function en(n){var e=n.width;n.width=n.height,n.height=e}function rn(n){n.y=-n.y}function tn(n){var e=n.x;n.x=n.y,n.y=e}function on(n){n.graph().dummyChains=[],l(n.edges(),(function(e){!function(n,e){var r,t,o,i=e.v,u=n.node(i).rank,a=e.w,d=n.node(a).rank,c=e.name,f=n.edge(e),s=f.labelRank;if(d===u+1)return;for(n.removeEdge(e),o=0,++u;u<d;++o,++u)f.points=[],r=U(n,"edge",t={width:0,height:0,edgeLabel:f,edgeObj:e,rank:u},"_d"),u===s&&(t.width=f.width,t.height=f.height,t.dummy="edge-label",t.labelpos=f.labelpos),n.setEdge(i,r,{weight:f.weight},c),0===o&&n.graph().dummyChains.push(r),i=r;n.setEdge(i,a,{weight:f.weight},c)}(n,e)}))}function un(n){var e={};l(n.sources(),(function r(t){var o=n.node(t);if(p(e,t))return o.rank;e[t]=!0;var i=N(E(n.outEdges(t),(function(e){return r(e.w)-n.edge(e).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))}function an(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen}function dn(e){var r,t,o=new n({directed:!1}),i=e.nodes()[0],u=e.nodeCount();for(o.setNode(i,{});cn(o,e)<u;)r=fn(o,e),t=o.hasNode(r.v)?an(e,r):-an(e,r),sn(o,e,t);return o}function cn(n,e){return l(n.nodes(),(function r(t){l(e.nodeEdges(t),(function(o){var i=o.v,u=t===i?o.w:i;n.hasNode(u)||an(e,o)||(n.setNode(u,{}),n.setEdge(t,u,{}),r(u))}))})),n.nodeCount()}function fn(n,e){return j(e.edges(),(function(r){if(n.hasNode(r.v)!==n.hasNode(r.w))return an(e,r)}))}function sn(n,e,r){l(n.nodes(),(function(n){e.node(n).rank+=r}))}function gn(n,e,r){f(e)||(e=[e]);var t=(n.isDirected()?n.successors:n.neighbors).bind(n),o=[],i={};return l(e,(function(e){if(!n.hasNode(e))throw new Error("Graph does not have node: "+e);hn(n,e,"post"===r,i,t,o)})),o}function hn(n,e,r,t,o,i){p(t,e)||(t[e]=!0,r||i.push(e),l(o(e),(function(e){hn(n,e,r,t,o,i)})),r&&i.push(e))}function vn(e){e=function(e){var r=(new n).setGraph(e.graph());return l(e.nodes(),(function(n){r.setNode(n,e.node(n))})),l(e.edges(),(function(n){var t=r.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);r.setEdge(n.v,n.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})})),r}(e),un(e);var r,t=dn(e);for(mn(t),ln(t,e);r=bn(t);)xn(t,e,r,yn(t,e,r))}function ln(n,e){var r=function(n,e){return gn(n,e,"post")}(n,n.nodes());r=r.slice(0,r.length-1),l(r,(function(r){!function(n,e,r){var t=n.node(r),o=t.parent;n.edge(r,o).cutvalue=pn(n,e,r)}(n,e,r)}))}function pn(n,e,r){var t=n.node(r).parent,o=!0,i=e.edge(r,t),u=0;return i||(o=!1,i=e.edge(t,r)),u=i.weight,l(e.nodeEdges(r),(function(i){var a,d,c=i.v===r,f=c?i.w:i.v;if(f!==t){var s=c===o,g=e.edge(i).weight;if(u+=s?g:-g,a=r,d=f,n.hasEdge(a,d)){var h=n.edge(r,f).cutvalue;u+=s?-h:h}}})),u}function mn(n,e){arguments.length<2&&(e=n.nodes()[0]),wn(n,{},1,e)}function wn(n,e,r,t,o){var i=r,u=n.node(t);return e[t]=!0,l(n.neighbors(t),(function(o){p(e,o)||(r=wn(n,e,r,o,t))})),u.low=i,u.lim=r++,o?u.parent=o:delete u.parent,r}function bn(n){return _(n.edges(),(function(e){return n.edge(e).cutvalue<0}))}function yn(n,e,r){var t=r.v,o=r.w;e.hasEdge(t,o)||(t=r.w,o=r.v);var i=n.node(t),u=n.node(o),a=i,d=!1;return i.lim>u.lim&&(a=u,d=!0),j(w(e.edges(),(function(e){return d===kn(n,n.node(e.v),a)&&d!==kn(n,n.node(e.w),a)})),(function(n){return an(e,n)}))}function xn(n,e,r,t){var o=r.v,i=r.w;n.removeEdge(o,i),n.setEdge(t.v,t.w,{}),mn(n),ln(n,e),function(n,e){var r=_(n.nodes(),(function(n){return!e.node(n).parent})),t=function(n,e){return gn(n,e,"pre")}(n,r);t=t.slice(1),l(t,(function(r){var t=n.node(r).parent,o=e.edge(r,t),i=!1;o||(o=e.edge(t,r),i=!0),e.node(r).rank=e.node(t).rank+(i?o.minlen:-o.minlen)}))}(n,e)}function kn(n,e,r){return r.low<=e.lim&&e.lim<=r.lim}function En(n){switch(n.graph().ranker){case"network-simplex":default:_n(n);break;case"tight-tree":!function(n){un(n),dn(n)}(n);break;case"longest-path":Nn(n)}}new Error,vn.initLowLimValues=mn,vn.initCutValues=ln,vn.calcCutValue=pn,vn.leaveEdge=bn,vn.enterEdge=yn,vn.exchangeEdges=xn;var Nn=un;function _n(n){vn(n)}function In(n){var e=U(n,"root",{},"_root"),r=function(n){var e={};function r(t,o){var i=n.children(t);i&&i.length&&l(i,(function(n){r(n,o+1)})),e[t]=o}return l(n.children(),(function(n){r(n,1)})),e}(n),t=S(b(r))-1,o=2*t+1;n.graph().nestingRoot=e,l(n.edges(),(function(e){n.edge(e).minlen*=o}));var i=function(n){return y(n.edges(),(function(e,r){return e+n.edge(r).weight}),0)}(n)+1;l(n.children(),(function(u){Rn(n,e,o,i,t,r,u)})),n.graph().nodeRankFactor=o}function Rn(n,e,r,t,o,i,u){var a=n.children(u);if(a.length){var d=H(n,"_bt"),c=H(n,"_bb"),f=n.node(u);n.setParent(d,u),f.borderTop=d,n.setParent(c,u),f.borderBottom=c,l(a,(function(a){Rn(n,e,r,t,o,i,a);var f=n.node(a),s=f.borderTop?f.borderTop:a,g=f.borderBottom?f.borderBottom:a,h=f.borderTop?t:2*t,v=s!==g?1:o-i[u]+1;n.setEdge(d,s,{weight:h,minlen:v,nestingEdge:!0}),n.setEdge(g,c,{weight:h,minlen:v,nestingEdge:!0})})),n.parent(u)||n.setEdge(e,d,{weight:0,minlen:o+i[u]})}else u!==e&&n.setEdge(e,u,{weight:0,minlen:r})}function Tn(e,r,t){var o=function(n){var e;for(;n.hasNode(e=V("_root")););return e}(e),i=new n({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(n){return e.node(n)}));return l(e.nodes(),(function(n){var u=e.node(n),a=e.parent(n);(u.rank===r||u.minRank<=r&&r<=u.maxRank)&&(i.setNode(n),i.setParent(n,a||o),l(e[t](n),(function(r){var t=r.v===n?r.w:r.v,o=i.edge(t,n),u=m(o)?0:o.weight;i.setEdge(t,n,{weight:e.edge(r).weight+u})})),p(u,"minRank")&&i.setNode(n,{borderLeft:u.borderLeft[r],borderRight:u.borderRight[r]}))})),i}function Ln(n,e){for(var r=0,t=1;t<e.length;++t)r+=Mn(n,e[t-1],e[t]);return r}function Mn(n,e,r){for(var t,o,i=(t=r,o=E(r,(function(n,e){return e})),function(n,e,r){for(var t=-1,o=n.length,i=e.length,u={};++t<o;){var a=t<i?e[t]:void 0;r(u,n[t],a)}return u}(t||[],o||[],u)),d=a(E(e,(function(e){return M(E(n.outEdges(e),(function(e){return{pos:i[e.w],weight:n.edge(e).weight}})),"pos")}))),c=1;c<r.length;)c<<=1;var f=2*c-1;c-=1;var s=E(new Array(f),(function(){return 0})),g=0;return l(d.forEach((function(n){var e=n.pos+c;s[e]+=n.weight;for(var r=0;e>0;)e%2&&(r+=s[e+1]),s[e=e-1>>1]+=n.weight;g+=n.weight*r}))),g}function Cn(n,e){var r={};return l(n,(function(n,e){var t=r[n.v]={indegree:0,in:[],out:[],vs:[n.v],i:e};m(n.barycenter)||(t.barycenter=n.barycenter,t.weight=n.weight)})),l(e.edges(),(function(n){var e=r[n.v],t=r[n.w];m(e)||m(t)||(t.indegree++,e.out.push(r[n.w]))})),function(n){var e=[];function r(n){return function(e){e.merged||(m(e.barycenter)||m(n.barycenter)||e.barycenter>=n.barycenter)&&function(n,e){var r=0,t=0;n.weight&&(r+=n.barycenter*n.weight,t+=n.weight);e.weight&&(r+=e.barycenter*e.weight,t+=e.weight);n.vs=e.vs.concat(n.vs),n.barycenter=r/t,n.weight=t,n.i=Math.min(e.i,n.i),e.merged=!0}(n,e)}}function t(e){return function(r){r.in.push(e),0==--r.indegree&&n.push(r)}}for(;n.length;){var o=n.pop();e.push(o),l(o.in.reverse(),r(o)),l(o.out,t(o))}return E(w(e,(function(n){return!n.merged})),(function(n){return s(n,["vs","i","barycenter","weight"])}))}(w(r,(function(n){return!n.indegree})))}function Pn(n,e){var r,t=function(n,e){var r={lhs:[],rhs:[]};return l(n,(function(n){e(n)?r.lhs.push(n):r.rhs.push(n)})),r}(n,(function(n){return p(n,"barycenter")})),o=t.lhs,i=M(t.rhs,(function(n){return-n.i})),u=[],d=0,c=0,f=0;o.sort((r=!!e,function(n,e){return n.barycenter<e.barycenter?-1:n.barycenter>e.barycenter?1:r?e.i-n.i:n.i-e.i})),f=Sn(u,i,f),l(o,(function(n){f+=n.vs.length,u.push(n.vs),d+=n.barycenter*n.weight,c+=n.weight,f=Sn(u,i,f)}));var s={vs:a(u)};return c&&(s.barycenter=d/c,s.weight=c),s}function Sn(n,e,r){for(var t;e.length&&(t=I(e)).i<=r;)e.pop(),n.push(t.vs),r++;return r}function jn(n,e,r,t){var o=n.children(e),i=n.node(e),u=i?i.borderLeft:void 0,d=i?i.borderRight:void 0,c={};u&&(o=w(o,(function(n){return n!==u&&n!==d})));var f=function(n,e){return E(e,(function(e){var r=n.inEdges(e);if(r.length){var t=y(r,(function(e,r){var t=n.edge(r),o=n.node(r.v);return{sum:e.sum+t.weight*o.order,weight:e.weight+t.weight}}),{sum:0,weight:0});return{v:e,barycenter:t.sum/t.weight,weight:t.weight}}return{v:e}}))}(n,o);l(f,(function(e){if(n.children(e.v).length){var o=jn(n,e.v,r,t);c[e.v]=o,p(o,"barycenter")&&(u=o,m((i=e).barycenter)?(i.barycenter=u.barycenter,i.weight=u.weight):(i.barycenter=(i.barycenter*i.weight+u.barycenter*u.weight)/(i.weight+u.weight),i.weight+=u.weight))}var i,u}));var s=Cn(f,r);!function(n,e){l(n,(function(n){n.vs=a(n.vs.map((function(n){return e[n]?e[n].vs:n})))}))}(s,c);var g=Pn(s,t);if(u&&(g.vs=a([u,g.vs,d]),n.predecessors(u).length)){var h=n.node(n.predecessors(u)[0]),v=n.node(n.predecessors(d)[0]);p(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+h.order+v.order)/(g.weight+2),g.weight+=2}return g}function Gn(n){var e=K(n),r=Vn(n,d(1,e+1),"inEdges"),t=Vn(n,d(e-1,-1,-1),"outEdges"),o=function(n){var e={},r=w(n.nodes(),(function(e){return!n.children(e).length})),t=S(E(r,(function(e){return n.node(e).rank}))),o=E(d(t+1),(function(){return[]})),i=M(r,(function(e){return n.node(e).rank}));return l(i,(function r(t){if(!p(e,t)){e[t]=!0;var i=n.node(t);o[i.rank].push(t),l(n.successors(t),r)}})),o}(n);Fn(n,o);for(var i,u=Number.POSITIVE_INFINITY,a=0,c=0;c<4;++a,++c){Bn(a%2?r:t,a%4>=2);var f=Ln(n,o=X(n));f<u&&(c=0,i=h(o,5),u=f)}Fn(n,i)}function Vn(n,e,r){return E(e,(function(e){return Tn(n,e,r)}))}function Bn(e,r){var t=new n;l(e,(function(n){var e=n.graph().root,o=jn(n,e,t,r);l(o.vs,(function(e,r){n.node(e).order=r})),function(n,e,r){var t,o={};l(r,(function(r){for(var i,u,a=n.parent(r);a;){if((i=n.parent(a))?(u=o[i],o[i]=a):(u=t,t=a),u&&u!==a)return void e.setEdge(u,a);a=i}}))}(n,t,o.vs)}))}function Fn(n,e){l(e,(function(e){l(e,(function(e,r){n.node(e).order=r}))}))}function On(n){var e=function(n){var e={},r=0;function t(o){var i=r;l(n.children(o),t),e[o]={low:i,lim:r++}}return l(n.children(),t),e}(n);l(n.graph().dummyChains,(function(r){for(var t=n.node(r),o=t.edgeObj,i=function(n,e,r,t){var o,i,u=[],a=[],d=Math.min(e[r].low,e[t].low),c=Math.max(e[r].lim,e[t].lim);o=r;do{o=n.parent(o),u.push(o)}while(o&&(e[o].low>d||c>e[o].lim));i=o,o=t;for(;(o=n.parent(o))!==i;)a.push(o);return{path:u.concat(a.reverse()),lca:i}}(n,e,o.v,o.w),u=i.path,a=i.lca,d=0,c=u[d],f=!0;r!==o.w;){if(t=n.node(r),f){for(;(c=u[d])!==a&&n.node(c).maxRank<t.rank;)d++;c===a&&(f=!1)}if(!f){for(;d<u.length-1&&n.node(c=u[d+1]).minRank<=t.rank;)d++;c=u[d]}n.setParent(r,c),r=n.successors(r)[0]}}))}function qn(n,e){var r={};return y(e,(function(e,t){var o=0,i=0,u=e.length,a=I(t);return l(t,(function(e,d){var c=function(n,e){if(n.node(e).dummy)return _(n.predecessors(e),(function(e){return n.node(e).dummy}))}(n,e),f=c?n.node(c).order:u;(c||e===a)&&(l(t.slice(i,d+1),(function(e){l(n.predecessors(e),(function(t){var i=n.node(t),u=i.order;!(u<o||f<u)||i.dummy&&n.node(e).dummy||Yn(r,t,e)}))})),i=d+1,o=f)})),t})),r}function Yn(n,e,r){if(e>r){var t=e;e=r,r=t}var o=n[e];o||(n[e]=o={}),o[r]=!0}function zn(n,e,r){if(e>r){var t=e;e=r,r=t}return p(n[e],r)}function Dn(e,r,t,o,i){var u={},a=function(e,r,t,o){var i=new n,u=e.graph(),a=function(n,e,r){return function(t,o,i){var u,a=t.node(o),d=t.node(i),c=0;if(c+=a.width/2,p(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2}if(u&&(c+=r?u:-u),u=0,c+=(a.dummy?e:n)/2,c+=(d.dummy?e:n)/2,c+=d.width/2,p(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":u=d.width/2;break;case"r":u=-d.width/2}return u&&(c+=r?u:-u),u=0,c}}(u.nodesep,u.edgesep,o);return l(r,(function(n){var r;l(n,(function(n){var o=t[n];if(i.setNode(o),r){var u=t[r],d=i.edge(u,o);i.setEdge(u,o,Math.max(a(e,n,r),d||0))}r=n}))})),i}(e,r,t,i),d=i?"borderLeft":"borderRight";function c(n,e){for(var r=a.nodes(),t=r.pop(),o={};t;)o[t]?n(t):(o[t]=!0,r.push(t),r=r.concat(e(t))),t=r.pop()}return c((function(n){u[n]=a.inEdges(n).reduce((function(n,e){return Math.max(n,u[e.v]+a.edge(e))}),0)}),a.predecessors.bind(a)),c((function(n){var r=a.outEdges(n).reduce((function(n,e){return Math.min(n,u[e.w]-a.edge(e))}),Number.POSITIVE_INFINITY),t=e.node(n);r!==Number.POSITIVE_INFINITY&&t.borderType!==d&&(u[n]=Math.max(u[n],r))}),a.successors.bind(a)),l(o,(function(n){u[n]=u[t[n]]})),u}function An(n,t){return j(b(t),(function(t){var o,i,u=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return i=function(e,r){var t=function(n,e){return n.node(e).width}(n,r)/2;u=Math.max(e+t,u),a=Math.min(e-t,a)},null==(o=t)||e(o,v(i),r),u-a}))}function Un(n){var e,r=X(n),t=g(qn(n,r),function(n,e){var r={};function t(e,t,o,i,u){var a;l(d(t,o),(function(t){a=e[t],n.node(a).dummy&&l(n.predecessors(a),(function(e){var t=n.node(e);t.dummy&&(t.order<i||t.order>u)&&Yn(r,e,a)}))}))}return y(e,(function(e,r){var o,i=-1,u=0;return l(r,(function(a,d){if("border"===n.node(a).dummy){var c=n.predecessors(a);c.length&&(o=n.node(c[0]).order,t(r,u,d,i,o),u=d,i=o)}t(r,u,r.length,o,e.length)})),r})),r}(n,r)),o={};l(["u","d"],(function(i){e="u"===i?r:b(r).reverse(),l(["l","r"],(function(r){"r"===r&&(e=E(e,(function(n){return b(n).reverse()})));var u=("u"===i?n.predecessors:n.successors).bind(n),a=function(n,e,r,t){var o={},i={},u={};return l(e,(function(n){l(n,(function(n,e){o[n]=n,i[n]=n,u[n]=e}))})),l(e,(function(n){var e=-1;l(n,(function(n){var a=t(n);if(a.length)for(var d=((a=M(a,(function(n){return u[n]}))).length-1)/2,c=Math.floor(d),f=Math.ceil(d);c<=f;++c){var s=a[c];i[n]===n&&e<u[s]&&!zn(r,n,s)&&(i[s]=n,i[n]=o[n]=o[s],e=u[s])}}))})),{root:o,align:i}}(0,e,t,u),d=Dn(n,e,a.root,a.align,"r"===r);"r"===r&&(d=P(d,(function(n){return-n}))),o[i+r]=d}))}));var i=An(n,o);return function(n,e){var r=b(e),t=N(r),o=S(r);l(["u","d"],(function(r){l(["l","r"],(function(i){var u,a=r+i,d=n[a];if(d!==e){var c=b(d);(u="l"===i?t-N(c):o-S(c))&&(n[a]=P(d,(function(n){return n+u})))}}))}))}(o,i),function(n,e){return P(n.ul,(function(r,t){if(e)return n[e.toLowerCase()][t];var o=M(E(n,t));return(o[1]+o[2])/2}))}(o,n.graph().align)}function Jn(n){var e,r;(function(n){var e=X(n),r=n.graph().ranksep,t=0;l(e,(function(e){var o=S(E(e,(function(e){return n.node(e).height})));l(e,(function(e){n.node(e).y=t+o/2})),t+=o+r}))})(n=J(n)),e=Un(n),r=function(e,r){n.node(r).x=e},e&&T(e,v(r))}function Wn(e,r){var t=Q;t("layout",(function(){var r=t(" buildLayoutGraph",(function(){return function(e){var r=new n({multigraph:!0,compound:!0}),t=te(e.graph());return r.setGraph(g({},Hn,re(t,Xn),s(t,Kn))),l(e.nodes(),(function(n){var t=te(e.node(n));r.setNode(n,R(re(t,Qn),Zn)),r.setParent(n,e.parent(n))})),l(e.edges(),(function(n){var t=te(e.edge(n));r.setEdge(n,g({},ne,re(t,$n),s(t,ee)))})),r}(e)}));t(" runLayout",(function(){!function(n,e){e(" makeSpaceForEdgeLabels",(function(){!function(n){var e=n.graph();e.ranksep/=2,l(n.edges(),(function(r){var t=n.edge(r);t.minlen*=2,"c"!==t.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?t.width+=t.labeloffset:t.height+=t.labeloffset)}))}(n)})),e(" removeSelfEdges",(function(){!function(n){l(n.edges(),(function(e){if(e.v===e.w){var r=n.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:e,label:n.edge(e)}),n.removeEdge(e)}}))}(n)})),e(" acyclic",(function(){A(n)})),e(" nestingGraph.run",(function(){In(n)})),e(" rank",(function(){En(J(n))})),e(" injectEdgeLabelProxies",(function(){!function(n){l(n.edges(),(function(e){var r=n.edge(e);if(r.width&&r.height){var t=n.node(e.v),o={rank:(n.node(e.w).rank-t.rank)/2+t.rank,e:e};U(n,"edge-proxy",o,"_ep")}}))}(n)})),e(" removeEmptyRanks",(function(){!function(n){var e=N(E(n.nodes(),(function(e){return n.node(e).rank}))),r=[];l(n.nodes(),(function(t){var o=n.node(t).rank-e;r[o]||(r[o]=[]),r[o].push(t)}));var t=0,o=n.graph().nodeRankFactor;l(r,(function(e,r){m(e)&&r%o!=0?--t:t&&l(e,(function(e){n.node(e).rank+=t}))}))}(n)})),e(" nestingGraph.cleanup",(function(){!function(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,l(n.edges(),(function(e){n.edge(e).nestingEdge&&n.removeEdge(e)}))}(n)})),e(" normalizeRanks",(function(){!function(n){var e=N(E(n.nodes(),(function(e){return n.node(e).rank})));l(n.nodes(),(function(r){var t=n.node(r);p(t,"rank")&&(t.rank-=e)}))}(n)})),e(" assignRankMinMax",(function(){!function(n){var e=0;l(n.nodes(),(function(r){var t=n.node(r);t.borderTop&&(t.minRank=n.node(t.borderTop).rank,t.maxRank=n.node(t.borderBottom).rank,e=S(e,t.maxRank))})),n.graph().maxRank=e}(n)})),e(" removeEdgeLabelProxies",(function(){!function(n){l(n.nodes(),(function(e){var r=n.node(e);"edge-proxy"===r.dummy&&(n.edge(r.e).labelRank=r.rank,n.removeNode(e))}))}(n)})),e(" normalize.run",(function(){on(n)})),e(" parentDummyChains",(function(){On(n)})),e(" addBorderSegments",(function(){!function(n){l(n.children(),(function e(r){var t=n.children(r),o=n.node(r);if(t.length&&l(t,e),p(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,u=o.maxRank+1;i<u;++i)Z(n,"borderLeft","_bl",r,o,i),Z(n,"borderRight","_br",r,o,i)}}))}(n)})),e(" order",(function(){Gn(n)})),e(" insertSelfEdges",(function(){!function(n){var e=X(n);l(e,(function(e){var r=0;l(e,(function(e,t){var o=n.node(e);o.order=t+r,l(o.selfEdges,(function(e){U(n,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:t+ ++r,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(n)})),e(" adjustCoordinateSystem",(function(){!function(n){var e=n.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||nn(n)}(n)})),e(" position",(function(){Jn(n)})),e(" positionSelfEdges",(function(){!function(n){l(n.nodes(),(function(e){var r=n.node(e);if("selfedge"===r.dummy){var t=n.node(r.e.v),o=t.x+t.width/2,i=t.y,u=r.x-o,a=t.height/2;n.setEdge(r.e,r.label),n.removeNode(e),r.label.points=[{x:o+2*u/3,y:i-a},{x:o+5*u/6,y:i-a},{x:o+u,y:i},{x:o+5*u/6,y:i+a},{x:o+2*u/3,y:i+a}],r.label.x=r.x,r.label.y=r.y}}))}(n)})),e(" removeBorderNodes",(function(){!function(n){l(n.nodes(),(function(e){if(n.children(e).length){var r=n.node(e),t=n.node(r.borderTop),o=n.node(r.borderBottom),i=n.node(I(r.borderLeft)),u=n.node(I(r.borderRight));r.width=Math.abs(u.x-i.x),r.height=Math.abs(o.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}})),l(n.nodes(),(function(e){"border"===n.node(e).dummy&&n.removeNode(e)}))}(n)})),e(" normalize.undo",(function(){!function(n){l(n.graph().dummyChains,(function(e){var r,t=n.node(e),o=t.edgeLabel;for(n.setEdge(t.edgeObj,o);t.dummy;)r=n.successors(e)[0],n.removeNode(e),o.points.push({x:t.x,y:t.y}),"edge-label"===t.dummy&&(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height),e=r,t=n.node(e)}))}(n)})),e(" fixupEdgeLabelCoords",(function(){!function(n){l(n.edges(),(function(e){var r=n.edge(e);if(p(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}}))}(n)})),e(" undoCoordinateSystem",(function(){$(n)})),e(" translateGraph",(function(){!function(n){var e=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,o=0,i=n.graph(),u=i.marginx||0,a=i.marginy||0;function d(n){var i=n.x,u=n.y,a=n.width,d=n.height;e=Math.min(e,i-a/2),r=Math.max(r,i+a/2),t=Math.min(t,u-d/2),o=Math.max(o,u+d/2)}l(n.nodes(),(function(e){d(n.node(e))})),l(n.edges(),(function(e){var r=n.edge(e);p(r,"x")&&d(r)})),e-=u,t-=a,l(n.nodes(),(function(r){var o=n.node(r);o.x-=e,o.y-=t})),l(n.edges(),(function(r){var o=n.edge(r);l(o.points,(function(n){n.x-=e,n.y-=t})),p(o,"x")&&(o.x-=e),p(o,"y")&&(o.y-=t)})),i.width=r-e+u,i.height=o-t+a}(n)})),e(" assignNodeIntersects",(function(){!function(n){l(n.edges(),(function(e){var r,t,o=n.edge(e),i=n.node(e.v),u=n.node(e.w);o.points?(r=o.points[0],t=o.points[o.points.length-1]):(o.points=[],r=u,t=i),o.points.unshift(W(i,r)),o.points.push(W(u,t))}))}(n)})),e(" reversePoints",(function(){!function(n){l(n.edges(),(function(e){var r=n.edge(e);r.reversed&&r.points.reverse()}))}(n)})),e(" acyclic.undo",(function(){!function(n){l(n.edges(),(function(e){var r=n.edge(e);if(r.reversed){n.removeEdge(e);var t=r.forwardName;delete r.reversed,delete r.forwardName,n.setEdge(e.w,e.v,r,t)}}))}(n)}))}(r,t)})),t(" updateInputGraph",(function(){!function(n,e){l(n.nodes(),(function(r){var t=n.node(r),o=e.node(r);t&&(t.x=o.x,t.y=o.y,e.children(r).length&&(t.width=o.width,t.height=o.height))})),l(n.edges(),(function(r){var t=n.edge(r),o=e.edge(r);t.points=o.points,p(o,"x")&&(t.x=o.x,t.y=o.y)})),n.graph().width=e.graph().width,n.graph().height=e.graph().height}(e,r)}))}))}var Xn=["nodesep","edgesep","ranksep","marginx","marginy"],Hn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Kn=["acyclicer","ranker","rankdir","align"],Qn=["width","height"],Zn={width:0,height:0},$n=["minlen","weight","width","height","labeloffset"],ne={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ee=["labelpos"];function re(n,e){return P(s(n,e),Number)}function te(n){var e={};return l(n,(function(n,r){e[r.toLowerCase()]=n})),e}export{Wn as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{y as n,z as r,A as t,B as e,D as a}from"./step-DY8hpDjU.js";import{bi as i,cd as u,bj as o,ce as c,cf as f,cg as s,ch as l,ci as h,cj as p,ck as m,cl as g}from"./index-
|
|
1
|
+
import{y as n,z as r,A as t,B as e,D as a}from"./step-DY8hpDjU.js";import{bi as i,cd as u,bj as o,ce as c,cf as f,cg as s,ch as l,ci as h,cj as p,ck as m,cl as g}from"./index-BRpzR354.js";import{i as v}from"./init-DLRA0X12.js";function y(n){return null===n?NaN:+n}function*M(n,r){if(void 0===r)for(let t of n)null!=t&&(t=+t)>=t&&(yield t);else{let t=-1;for(let e of n)null!=(e=r(e,++t,n))&&(e=+e)>=e&&(yield e)}}const N=i(u),b=N.right,d=N.left;function w(n,r){r||(r=[]);var t,e=n?Math.min(r.length,n.length):0,a=r.slice();return function(i){for(t=0;t<e;++t)a[t]=n[t]*(1-i)+r[t]*i;return a}}function A(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function k(n,r){return(A(r)?w:j)(n,r)}function j(n,r){var t,e=r?r.length:0,a=n?Math.min(e,n.length):0,i=new Array(a),u=new Array(e);for(t=0;t<a;++t)i[t]=B(n[t],r[t]);for(;t<e;++t)u[t]=r[t];return function(n){for(t=0;t<a;++t)u[t]=i[t](n);return u}}function x(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function D(n,r){var t,e={},a={};for(t in null!==n&&"object"==typeof n||(n={}),null!==r&&"object"==typeof r||(r={}),r)t in n?e[t]=B(n[t],r[t]):a[t]=r[t];return function(n){for(t in e)a[t]=e[t](n);return a}}function B(i,u){var o,c=typeof u;return null==u||"boolean"===c?n(u):("number"===c?r:"string"===c?(o=t(u))?(u=o,e):a:u instanceof t?e:u instanceof Date?x:A(u)?w:Array.isArray(u)?j:"function"!=typeof u.valueOf&&"function"!=typeof u.toString||isNaN(u)?D:r)(i,u)}function V(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function q(n){return+n}i(y).center;var z=[0,1];function F(n){return n}function O(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:(t=isNaN(r)?NaN:.5,function(){return t});var t}function R(n,r,t){var e=n[0],a=n[1],i=r[0],u=r[1];return a<e?(e=O(a,e),i=t(u,i)):(e=O(e,a),i=t(i,u)),function(n){return i(e(n))}}function S(n,r,t){var e=Math.min(n.length,r.length)-1,a=new Array(e),i=new Array(e),u=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++u<e;)a[u]=O(n[u],n[u+1]),i[u]=t(r[u],r[u+1]);return function(r){var t=b(n,r,1,e)-1;return i[t](a[t](r))}}function T(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function C(){var n,t,e,a,i,u,o=z,c=z,f=B,s=F;function l(){var n,r,t,e=Math.min(o.length,c.length);return s!==F&&(n=o[0],r=o[e-1],n>r&&(t=n,n=r,r=t),s=function(t){return Math.max(n,Math.min(r,t))}),a=e>2?S:R,i=u=null,h}function h(r){return null==r||isNaN(r=+r)?e:(i||(i=a(o.map(n),c,f)))(n(s(r)))}return h.invert=function(e){return s(t((u||(u=a(c,o.map(n),r)))(e)))},h.domain=function(n){return arguments.length?(o=Array.from(n,q),l()):o.slice()},h.range=function(n){return arguments.length?(c=Array.from(n),l()):c.slice()},h.rangeRound=function(n){return c=Array.from(n),f=V,l()},h.clamp=function(n){return arguments.length?(s=!!n||F,l()):s!==F},h.interpolate=function(n){return arguments.length?(f=n,l()):f},h.unknown=function(n){return arguments.length?(e=n,h):e},function(r,e){return n=r,t=e,l()}}function E(){return C()(F,F)}function G(n,r,t,e){var a,i=o(n,r,t);switch((e=c(null==e?",f":e)).type){case"s":var u=Math.max(Math.abs(n),Math.abs(r));return null!=e.precision||isNaN(a=l(i,u))||(e.precision=a),h(e,u);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(a=s(i,Math.max(Math.abs(n),Math.abs(r))))||(e.precision=a-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(a=f(i))||(e.precision=a-2*("%"===e.type))}return p(e)}function H(n){var r=n.domain;return n.ticks=function(n){var t=r();return m(t[0],t[t.length-1],null==n?10:n)},n.tickFormat=function(n,t){var e=r();return G(e[0],e[e.length-1],null==n?10:n,t)},n.nice=function(t){null==t&&(t=10);var e,a,i=r(),u=0,o=i.length-1,c=i[u],f=i[o],s=10;for(f<c&&(a=c,c=f,f=a,a=u,u=o,o=a);s-- >0;){if((a=g(c,f,t))===e)return i[u]=c,i[o]=f,r(i);if(a>0)c=Math.floor(c/a)*a,f=Math.ceil(f/a)*a;else{if(!(a<0))break;c=Math.ceil(c*a)/a,f=Math.floor(f*a)/a}e=a}return n},n}function I(){var n=E();return n.copy=function(){return T(n,I())},v.apply(n,arguments),H(n)}export{T as a,y as b,E as c,k as d,x as e,w as f,V as g,q as h,B as i,H as j,F as k,I as l,b as m,M as n,D as o,G as p,d as q,C as t};
|