1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5189],{45189:(e,t,r)=>{r.d(t,{Graph:()=>s,layout:()=>ey});var n=Object.defineProperty;((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})({},{Graph:()=>s,alg:()=>p,json:()=>c,version:()=>u});var o=Object.defineProperty,i=(e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:!0})},s=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=!("directed"in e)||e.directed,this._isMultigraph="multigraph"in e&&e.multigraph,this._isCompound="compound"in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return"function"!=typeof e?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>0===Object.keys(this._in[e]).length)}sinks(){return this.nodes().filter(e=>0===Object.keys(this._out[e]).length)}setNodes(e,t){return e.forEach(e=>{void 0!==t?this.setNode(e,t):this.setNode(e)}),this}setNode(e,t){return e in this._nodes?arguments.length>1&&(this._nodes[e]=t):(this._nodes[e]=arguments.length>
11?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount),this}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(void 0===t)t="\0";else{t+="";for(let r=t;void 0!==r;r=this.parent(r))if(r===e)throw Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if("\0"!==t)return t}}children(e="\0"){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if("\0"===e)return this.nodes();this.hasNode(e)}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let r=new Set(t);for(let t of this.successors(e))r.add(t);return Array.from(r.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([r,n])=>{e(r)&&t.setNode(r,n)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let r={},n=e=>{let o=this.parent(e);return!o||t.hasNode(o)?(r[e]=null!=o?o:void 0,null!=o?o:void 0):o in r?r[o]:n(o)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,n(e))),t}setDefaultEdgeLabel(e){return"function"!=typeof e?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,r)=>(void 0!==t?this.setEdge(e,r,t):this.setEdge(e,r),r)),this}setEdge(e,t,r,n){let o,i,s,a,l=!1;"object"==typeof e&&null!==e&&"v"in e?(o=e.v,i=e.w,s=e.name,2==arguments.length&&(a=t,l=!0)):(o=e,i=t,s=n,arguments.length>2&&(a=r,l=!0)),o=""+o,i=""+i,void 0!==s&&(s=""+s);let u=h(this._isDirected,o,i,s);if(u in this._edgeLabels)return l&&(this._edgeLabels[u]=a),this;if(void 0!==s&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(o),this.setNode(i),this._edgeLabels[u]=l?a:this._defaultEdgeLabelFn(o,i,s);let c=function(e,t,r,n){let o=""+t,i=""+r;if(!e&&o>i){let e=o;o=i,i=e}let s={v:o,w:i};return n&&(s.name=n),s}(this._isDirected,o,i,s);return o=c.v,i=c.w,Object.freeze(c),this._edgeObjs[u]=c,d(this._preds[i],o),d(this._sucs[o],i),this._in[i][u]=c,this._out[o][u]=c,this._edgeCount++,this}edge(e,t,r){let n=1==arguments.length?l(this._isDirected,e):h(this._isDirected,e,t,r);return this._edgeLabels[n]}edgeAsObj(e,t,r){let n=1==arguments.length?this.edge(e):this.edge(e,t,r);return"object"!=typeof n?{label:n}:n}hasEdge(e,t,r){return(1==arguments.length?l(this._isDirected,e):h(this._isDirected,e,t,r))in this._edgeLabels}removeEdge(e,t,r){let n=1==arguments.length?l(this._isDirected,e):h(this._isDirected,e,t,r),o=this._edgeObjs[n];if(o){let e=o.v,t=o.w;delete this._edgeLabels[n],delete this._edgeObjs[n],a(this._preds[t],e),a(this._sucs[e],t),delete this._in[t][n],delete this._out[e][n],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,r){if(!e)return;let n=Object.values(e);return r?n.filter(e=>e.v===t&&e.w===r||e.v===r&&e.w===t):n}};function d(e,t){e[t]?e[t]++:e[t]=1}function a(e,t){void 0===e[t]||--e[t]||delete e[t]}function h(e,t,r,n){let o=""+t,i=""+r;if(!e&&o>i){let e=o;o=i,i=e}return o+"\x01"+i+"\x01"+(void 0===n?"\0":n)}function l(e,t){return h(e,t.v,t.w,t.name)}
1var u="4.0.1",c={};function f(e){var t,r;let n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:(t=e).nodes().map(e=>{let r=t.node(e),n=t.parent(e),o={v:e};return void 0!==r&&(o.value=r),void 0!==n&&(o.parent=n),o}),edges:(r=e).edges().map(e=>{let t=r.edge(e),n={v:e.v,w:e.w};return void 0!==e.name&&(n.name=e.name),void 0!==t&&(n.value=t),n})},o=e.graph();return void 0!==o&&(n.value=structuredClone(o)),n}function g(e){let t=new s(e.options);return void 0!==e.value&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}i(c,{read:()=>g,write:()=>f});var p={};i(p,{CycleException:()=>N,bellmanFord:()=>w,components:()=>E,dijkstra:()=>_,dijkstraAll:()=>y,findCycles:()=>x,floydWarshall:()=>j,isAcyclic:()=>M,postorder:()=>R,preorder:()=>D,prim:()=>P,shortestPaths:()=>S,tarjan:()=>k,topsort:()=>C});var v=()=>1;function w(e,t,r,n){return function(e,t,r,n){let o={},i,s=0,d=e.nodes(),a=function(e){let t=r(e);o[e.v].distance+t<o[e.w].distance&&(o[e.w]={distance:o[e.v].distance+t,predecessor:e.v},i=!0)},h=function(){d.forEach(function(e){n(e).forEach(function(t){let r=t.v===e?t.v:t.w,n=r===t.v?t.w:t.v;a({v:r,w:n})})})};d.forEach(function(e){o[e]={distance:e===t?0:1/0,predecessor:""}});let l=d.length;for(let e=1;e<l&&(i=!1,s++,h(),i);e++);if(s===l-1&&(i=!1,h(),i))throw Error("The graph contains a negative weight cycle");return o}(e,String(t),r||v,n||function(t){return e.outEdges(t)})}function E(e){let t={},r=[],n;return e.nodes().forEach(function(o){n=[],function r(o){o in t||(t[o]=!0,n.push(o),e.successors(o).forEach(r),e.predecessors(o).forEach(r))}(o),n.length&&r.push(n)}),r}var m=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw Error("Queue underflow");return this._arr[0].key}add(e,t){let r=this._keyIndices,n=String(e);if(!(n in r)){let e=this._arr,o=e.length;return r[n]=o,e.push({key:n,priority:t}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let r=this._keyIndices[e];if(void 0===r)throw Error(`Key not found: ${e}`);let n=this._arr[r].priority;if(t>n)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${n} New: ${t}`);this._arr[r].priority=t,this._decrease(r)}_heapify(e){let t=this._arr,r=2*e,n=r+1,o=e;r<t.length&&(o=t[r].priority<t[o].priority?r:o,n<t.length&&(o=t[n].priority<t[o].priority?n:o),o!==e&&(this._swap(e,o),this._heapify(o)
1))}_decrease(e){let t=this._arr,r=t[e].priority,n;for(;0!==e&&!(t[n=e>>1].priority<r);)this._swap(e,n),e=n}_swap(e,t){let r=this._arr,n=this._keyIndices,o=r[e],i=r[t];r[e]=i,r[t]=o,n[i.key]=e,n[o.key]=t}},b=()=>1;function _(e,t,r,n){return function(e,t,r,n){let o={},i=new m,s,d,a=function(e){let t=e.v!==s?e.v:e.w,n=o[t],a=r(e),h=d.distance+a;if(a<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+a);h<n.distance&&(n.distance=h,n.predecessor=s,i.decrease(t,h))};for(e.nodes().forEach(function(e){let r=e===t?0:1/0;o[e]={distance:r,predecessor:""},i.add(e,r)});i.size()>0&&(d=o[s=i.removeMin()]).distance!==1/0;)n(s).forEach(a);return o}(e,String(t),r||b,n||function(t){return e.outEdges(t)})}function y(e,t,r){return e.nodes().reduce(function(n,o){return n[o]=_(e,o,t,r),n},{})}function k(e){let t=0,r=[],n={},o=[];return e.nodes().forEach(function(i){i in n||function i(s){let d=n[s]={onStack:!0,lowlink:t,index:t++};if(r.push(s),e.successors(s).forEach(function(e){e in n?n[e].onStack&&(d.lowlink=Math.min(d.lowlink,n[e].index)):(i(e),d.lowlink=Math.min(d.lowlink,n[e].lowlink))}),d.lowlink===d.index){let e=[],t;do n[t=r.pop()].onStack=!1,e.push(t);while(s!==t);o.push(e)}}(i)}),o}function x(e){return k(e).filter(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}var O=()=>1;function j(e,t,r){var n,o,i;let s,d;return n=e,o=t||O,i=r||function(t){return e.outEdges(t)},s={},(d=n.nodes()).forEach(function(e){s[e]={},s[e][e]={distance:0,predecessor:""},d.forEach(function(t){e!==t&&(s[e][t]={distance:1/0,predecessor:""})}),i(e).forEach(function(t){let r=t.v===e?t.w:t.v,n=o(t);s[e][r]={distance:n,predecessor:e}})}),d.forEach(function(e){let t=s[e];d.forEach(function(r){let n=s[r];d.forEach(function(r){let o=n[e],i=t[r],s=n[r],d=o.distance+i.distance;d<s.distance&&(s.distance=d,s.predecessor=i.predecessor)})})}),s}var N=class extends Error{constructor(...e){super(...e)}};function C(e){let t={},r={},n=[];if(e.sinks().forEach(function o(i){if(i in r)throw new N;i in t||(r[i]=!0,t[i]=!0,e.predecessors(i).forEach(o),delete r[i],n.push(i))}),Object.keys(t).length!==e.nodeCount())throw new N;return n}function M(e){try{C(e)}catch(e){if(e instanceof N)return!1;throw e}return!0}function L(e,t,r){var n,o,i;let s,d;return n=t,o=function(e,t){return e.push(t),e},i=[],Array.isArray(n)||(n=[n]),s=t=>{var r;return null!=(r=e.isDirected()?e.successors(t):e.neighbors(t))?r:[]},d={},n.forEach(function(t){if(!e.hasNode(t))throw Error("Graph does not have node: "+t);i=function e(t,r,n,o,i,s,d){return r in o||(o[r]=!0,n||(d=s(d,r)),i(r).forEach(function(r){d=e(t,r,n,o,i,s,d)}),n&&(d=s(d,r))),d}(e,t,"post"===r,d,s,o,i)}),i}function R(e,t){return L(e,t,"post")}function D(e,t){return L(e,t,"pre")}function P(e,t){let r=new s,n={},o=new m,i;function d(e){let r=e.v===i?e.w:e.v,s=o.priority(r);if(void 0!==s){let d=t(e);d<s&&(n[r]=i,o.decrease(r,d))}}if(0===e.nodeCount())return r;e.nodes().forEach(function(e){o.add(e,1/0),r.setNode(e)}),o.decrease(e.nodes()[0],0);let a=!1;for(;o.size()>0;){if((i=o.removeMin())in n)r.setEdge(i,n[i]);else{if(a)throw Error("Input graph is not connected: "+e);a=!0}e.nodeEdges(i).forEach(d)}return r}function S(e,t,r,n){return function(e,t,r,n){if(void 0===r)return _(e,t,r,n);let o=!1,i=e.nodes();for(let s=0;s<i.length;s++){let d=n(i[s]);for(let e=0;e<d.length;e++){let t=d[e],n=t.v===i[s]?t.v:t.w,a=n===t.v?t.w:t.v;0>r({v:n,w:a})&&(o=!0)}if(o)return w(e,t,r,n)}return _(e,t,r,n)}(e,t,r,null!=n?n:t=>{let r=e.outEdges(t);return null!=r?r:[]})}function G(e,t,r,n){let o=n;for(;e.hasNode(o);)o=n+""+ ++$;return r.dummy=t,e.setNode(o,r),o}function F(e){let t=new s({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(r=>{e.children(r).length||t.setNode(r,e.node(r))}
1),e.edges().forEach(r=>{t.setEdge(r,e.edge(r))}),t}function T(e,t){let r,n,o=e.x,i=e.y,s=t.x-o,d=t.y-i,a=e.width/2,h=e.height/2;if(!s&&!d)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(d)*a>Math.abs(s)*h?(d<0&&(h=-h),r=h*s/d,n=h):(s<0&&(a=-a),r=a,n=a*d/s),{x:o+r,y:i+n}}function I(e){let t=K(A(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let n=e.node(r),o=n.rank;void 0!==o&&(t[o]||(t[o]=[]),t[o][n.order]=r)}),t}function B(e,t,r,n){let o={width:0,height:0};return arguments.length>=4&&(o.rank=r,o.order=n),G(e,"border",o,t)}function z(e,t){return t.length>65535?e(...(function(e,t=65535){let r=[];for(let n=0;n<e.length;n+=t){let o=e.slice(n,n+t);r.push(o)}return r})(t).map(t=>e(...t))):e(...t)}function A(e){return z(Math.max,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?5e-324:r}))}function q(e,t){let r=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-r)+"ms")}}function V(e,t){return t()}var $=0;function K(e,t,r=1){null==t&&(t=e,e=0);let n=e=>e<t;r<0&&(n=e=>t<e);let o=[];for(let t=e;n(t);t+=r)o.push(t);return o}function W(e,t){let r={};for(let n of t)void 0!==e[n]&&(r[n]=e[n]);return r}function H(e,t){let r;return r="string"==typeof t?e=>e[t]:t,Object.entries(e).reduce((e,[t,n])=>(e[t]=r(n,t),e),{})}var J=class{constructor(){((e,t,r)=>((e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r))(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Q(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Q(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,r=t._prev;for(;r!==t;)e.push(JSON.stringify(r,U)),r=r._prev;return"["+e.join(", ")+"]"}};function Q(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function U(e,t){if("_next"!==e&&"_prev"!==e)return t}var X=()=>1;function Y(e,t,r,n,o){let i=[],s=o?i:void 0;return(e.inEdges(n.v)||[]).forEach(n=>{let s=e.edge(n),d=e.node(n.v);o&&i.push({v:n.v,w:n.w}),d.out-=s,Z(t,r,d)}),(e.outEdges(n.v)||[]).forEach(n=>{let o=e.edge(n),i=n.w,s=e.node(i);s.in-=o,Z(t,r,s)}),e.removeNode(n.v),s}function Z(e,t,r){var n,o,i;r.out?r.in?null==(i=e[r.out-r.in+t])||i.enqueue(r):null==(o=e[e.length-1])||o.enqueue(r):null==(n=e[0])||n.enqueue(r)}function ee(e){let t={};e.sources().forEach(function r(n){let o=e.node(n);if(Object.hasOwn(t,n))return o.rank;t[n]=!0;let i=e.outEdges(n),s=z(Math.min,i?i.map(t=>null==t?1/0:r(t.w)-e.edge(t).minlen):[]);return s===1/0&&(s=0),o.rank=s})}function et(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var er=function(e){var t,r,n,o;let i,d,a=new s({directed:!1}),h=e.nodes();if(0===h.length)throw Error("Graph must have at least one node");let l=h[0],u=e.nodeCount();for(a.setNode(l,{});t=a,r=e,t.nodes().forEach(function e(n){let o=r.nodeEdges(n);o&&o.forEach(o=>{let i=o.v,s=n===i?o.w:i;t.hasNode(s)||et(r,o)||(t.setNode(s,{}),t.setEdge(n,s,{}),e(s))})}),t.nodeCount()<u&&(n=a,i=(o=e).edges().reduce((e,t)=>{let r=1/0;return n.hasNode(t.v)!==n.hasNode(t.w)&&(r=et(o,t)),r<e[0]?[r,t]:e},[1/0,null])[1]);)d=a.hasNode(i.v)?et(e,i):-et(e,i),function(e,t,r){e.nodes().forEach(e=>t.node(e).rank+=r)}(a,e,d);return a},{preorder:en,postorder:eo}=p;function ei(e){var t;let r,n,o;t=e,o=new s().setGraph(t.graph()),t.nodes().forEach(e=>
1o.setNode(e,t.node(e))),t.edges().forEach(e=>{let r=o.edge(e.v,e.w)||{weight:0,minlen:1},n=t.edge(e);o.setEdge(e.v,e.w,{weight:r.weight+n.weight,minlen:Math.max(r.minlen,n.minlen)})}),ee(e=o);let i=er(e);for(ea(i),es(i,e);r=eh(i);)n=el(i,e,r),eu(i,e,r,n)}function es(e,t){let r=eo(e,e.nodes());(r=r.slice(0,r.length-1)).forEach(r=>{var n,o,i;let s;return n=e,o=t,i=r,s=n.node(i).parent,void(n.edge(i,s).cutvalue=ed(n,o,i))})}function ed(e,t,r){let n=e.node(r).parent,o=!0,i=t.edge(r,n),s=0;i||(o=!1,i=t.edge(n,r)),s=i.weight;let d=t.nodeEdges(r);return d&&d.forEach(i=>{let d=i.v===r,a=d?i.w:i.v;if(a!==n){var h,l,u;let n=d===o,c=t.edge(i).weight;if(s+=n?c:-c,h=e,l=r,u=a,h.hasEdge(l,u)){let t=e.edge(r,a).cutvalue;s+=n?-t:t}}}),s}function ea(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,r,n,o,i){let s=n,d=t.node(o);r[o]=!0;let a=t.neighbors(o);return a&&a.forEach(i=>{Object.hasOwn(r,i)||(n=e(t,r,n,i,o))}),d.low=s,d.lim=n++,i?d.parent=i:delete d.parent,n}(e,{},1,t)}function eh(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function el(e,t,r){let n=r.v,o=r.w;t.hasEdge(n,o)||(n=r.w,o=r.v);let i=e.node(n),s=e.node(o),d=i,a=!1;return i.lim>s.lim&&(d=s,a=!0),t.edges().filter(t=>a===ec(e,e.node(t.v),d)&&a!==ec(e,e.node(t.w),d)).reduce((e,r)=>et(t,r)<et(t,e)?r:e)}function eu(e,t,r,n){let o=r.v,i=r.w;e.removeEdge(o,i),e.setEdge(n.v,n.w,{}),ea(e),es(e,t),function(e,t){let r=e.nodes().find(t=>!e.node(t).parent);if(!r)return;let n=en(e,[r]);(n=n.slice(1)).forEach(r=>{let n=e.node(r).parent,o=t.edge(r,n),i=!1;o||(o=t.edge(n,r),i=!0),t.node(r).rank=t.node(n).rank+(i?o.minlen:-o.minlen)})}(e,t)}function ec(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}ei.initLowLimValues=ea,ei.initCutValues=es,ei.calcCutValue=ed,ei.leaveEdge=eh,ei.enterEdge=el,ei.exchangeEdges=eu;function ef(e,t,r,n,o,i){let s=o[t][i-1],d=G(e,"border",{width:0,height:0,rank:i,borderType:t},r);o[t][i]=d,e.setParent(d,n),s&&e.setEdge(s,d,{weight:1})}function eg(e){e.nodes().forEach(t=>
1ep(e.node(t))),e.edges().forEach(t=>ep(e.edge(t)))}function ep(e){let t=e.width;e.width=e.height,e.height=t}function ev(e){e.y=-e.y}function ew(e){let t=e.x;e.x=e.y,e.y=t}function eE(e,t,r){let n;for(;t.length&&(n=t[t.length-1]).i<=r;)t.pop(),e.push(n.vs),r++;return r}function em(e,t,r){let n=new Map,o=(e,t)=>{n.has(e)||n.set(e,[]),n.get(e).push(t)};for(let t of e.nodes()){let r=e.node(t);if("number"==typeof r.rank&&o(r.rank,t),"number"==typeof r.minRank&&"number"==typeof r.maxRank)for(let e=r.minRank;e<=r.maxRank;e++)e!==r.rank&&o(e,t)}return t.map(function(t){var o;let i,d;return o=n.get(t)||[],i=function(e){let t;for(;e.hasNode(t="_root"+ ++$););return t}(e),d=new s({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t)),o.forEach(n=>{let o=e.node(n),s=e.parent(n);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){d.setNode(n),d.setParent(n,s||i);let a=e[r](n);a&&a.forEach(t=>{let r=t.v===n?t.w:t.v,o=d.edge(r,n),i=void 0!==o?o.weight:0;d.setEdge(r,n,{weight:e.edge(t).weight+i})}),Object.hasOwn(o,"minRank")&&d.setNode(n,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),d})}function eb(e,t){Object.values(t).forEach(t=>t.forEach((t,r)=>e.node(t).order=r))}function e_(e,t,r){if(t>r){let e=t;t=r,r=e}let n=e[t];n||(e[t]=n={}),n[r]=!0}function ey(e,t={}){let r=t.debugTiming?q:V;return r("layout",()=>{let n=r(" buildLayoutGraph",()=>{var t;let r,n;return t=e,r=new s({multigraph:!0,compound:!0}),n=eD(t.graph()),r.setGraph(Object.assign({},ex,eR(n,ek),W(n,eO))),t.nodes().forEach(e=>{let n=eR(eD(t.node(e)),ej);Object.keys(eN).forEach(e=>{void 0===n[e]&&(n[e]=eN[e])}),r.setNode(e,n);let o=t.parent(e);void 0!==o&&r.setParent(e,o)}
1),t.edges().forEach(e=>{let n=eD(t.edge(e));r.setEdge(e,Object.assign({},eM,eR(n,eC),W(n,eL)))}),r});return r(" runLayout",()=>{var e,o,i;return e=n,o=r,i=t,void(o(" makeSpaceForEdgeLabels",()=>{var t;let r;return r=(t=e).graph(),void(r.ranksep/=2,t.edges().forEach(e=>{let n=t.edge(e);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===r.rankdir||"BT"===r.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)}))}),o(" removeSelfEdges",()=>{var t;(t=e).edges().forEach(e=>{if(e.v===e.w){let r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}),o(" acyclic",()=>{var t,r;let n,o,i;("greedy"===e.graph().acyclicer?function(e,t){var r,n;let o,i,d,a,h;if(1>=e.nodeCount())return[];let l=(r=e,n=t||X,o=new s,i=0,d=0,r.nodes().forEach(e=>{o.setNode(e,{v:e,in:0,out:0})}),r.edges().forEach(e=>{let t=o.edge(e.v,e.w)||0,r=n(e);o.setEdge(e.v,e.w,t+r);let s=o.node(e.v),a=o.node(e.w);d=Math.max(d,s.out+=r),i=Math.max(i,a.in+=r)}),a=(function(e){let t=[];for(let r=0;r<e;r++)t.push(r);return t})(d+i+3).map(()=>new J),h=i+1,o.nodes().forEach(e=>{Z(a,h,o.node(e))}),{graph:o,buckets:a,zeroIdx:h});return(function(e,t,r){var n;let o=[],i=t[t.length-1],s=t[0],d;for(;e.nodeCount();){for(;d=s.dequeue();)Y(e,t,r,d);for(;d=i.dequeue();)Y(e,t,r,d);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(d=null==(n=t[i])?void 0:n.dequeue()){o=o.concat(Y(e,t,r,d,!0)||[]);break}}}return o})(l.graph,l.buckets,l.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}(e,(t=e,e=>t.edge(e).weight)):(n=[],o={},i={},(r=e).nodes().forEach(function e(t){Object.hasOwn(i,t)||(i[t]=!0,o[t]=!0,r.outEdges(t).forEach(t=>{Object.hasOwn(o,t.w)?n.push(t):e(t.w)}),delete o[t])}),n)).forEach(t=>{let r=e.edge(t);e.removeEdge(t),r.forwardName=t.name,r.reversed=!0,e.setEdge(t.w,t.v,r,"rev"+ ++$)})}),o(" nestingGraph.run",()=>{var t,r;let n,o,i,s,d,a;return n=G(e,"root",{},"_root"),s=2*(i=z(Math.max,Object.values((a={},(t=e).children("\0").forEach(e=>(function e(r,n){let o=t.children(r);o&&o.length&&o.forEach(t=>e(t,n+1)),a[r]=n}
1)(e,1)),o=a)))-1)+1,e.graph().nestingRoot=n,e.edges().forEach(t=>e.edge(t).minlen*=s),d=(r=e).edges().reduce((e,t)=>e+r.edge(t).weight,0)+1,void(e.children("\0").forEach(t=>(function e(t,r,n,o,i,s,d){var a;let h=t.children(d);if(!h.length){d!==r&&t.setEdge(r,d,{weight:0,minlen:n});return}let l=B(t,"_bt"),u=B(t,"_bb"),c=t.node(d);t.setParent(l,d),c.borderTop=l,t.setParent(u,d),c.borderBottom=u,h.forEach(a=>{var h;e(t,r,n,o,i,s,a);let c=t.node(a),f=c.borderTop?c.borderTop:a,g=c.borderBottom?c.borderBottom:a,p=c.borderTop?o:2*o,v=f!==g?1:i-(null!=(h=s[d])?h:0)+1;t.setEdge(l,f,{weight:p,minlen:v,nestingEdge:!0}),t.setEdge(g,u,{weight:p,minlen:v,nestingEdge:!0})}),t.parent(d)||t.setEdge(r,l,{weight:0,minlen:i+(null!=(a=s[d])?a:0)})})(e,n,s,d,i,o,t)),e.graph().nodeRankFactor=s)}),o(" rank",()=>(function(e){let t=e.graph().ranker;if("function"==typeof t)return t(e);switch(t){case"network-simplex":default:ei(e);break;case"tight-tree":var r;ee(r=e),er(r);break;case"longest-path":ee(e);case"none":}})(F(e))),o(" injectEdgeLabelProxies",()=>{var t;
1(t=e).edges().forEach(e=>{let r=t.edge(e);if(r.width&&r.height){let r=t.node(e.v),n={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};G(t,"edge-proxy",n,"_ep")}})}),o(" removeEmptyRanks",()=>{let t,r,n,o;return t=z(Math.min,e.nodes().map(t=>e.node(t).rank).filter(e=>void 0!==e)),r=[],e.nodes().forEach(n=>{let o=e.node(n).rank-t;r[o]||(r[o]=[]),r[o].push(n)}),n=0,o=e.graph().nodeRankFactor,void Array.from(r).forEach((t,r)=>{void 0===t&&r%o!=0?--n:void 0!==t&&n&&t.forEach(t=>e.node(t).rank+=n)})}),o(" nestingGraph.cleanup",()=>{let t;return t=e.graph(),void(e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)}))}),o(" normalizeRanks",()=>{let t;return t=z(Math.min,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?Number.MAX_VALUE:r})),void e.nodes().forEach(r=>{let n=e.node(r);Object.hasOwn(n,"rank")&&(n.rank-=t)})}),o(" assignRankMinMax",()=>{var t;let r;return r=0,void((t=e).nodes().forEach(e=>{let n=t.node(e);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,r=Math.max(r,n.maxRank))}),t.graph().maxRank=r)}),o(" removeEdgeLabelProxies",()=>{var t;(t=e).nodes().forEach(e=>{let r=t.node(e);"edge-proxy"===r.dummy&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}),o(" normalize.run",()=>
1{e.graph().dummyChains=[],e.edges().forEach(t=>(function(e,t){let r,n,o,i=t.v,s=e.node(i).rank,d=t.w,a=e.node(d).rank,h=t.name,l=e.edge(t),u=l.labelRank;if(a!==s+1){for(e.removeEdge(t),o=0,++s;s<a;++o,++s)l.points=[],r=G(e,"edge",n={width:0,height:0,edgeLabel:l,edgeObj:t,rank:s},"_d"),s===u&&(n.width=l.width,n.height=l.height,n.dummy="edge-label",n.labelpos=l.labelpos),e.setEdge(i,r,{weight:l.weight},h),0===o&&e.graph().dummyChains.push(r),i=r;e.setEdge(i,d,{weight:l.weight},h)}})(e,t))}),o(" parentDummyChains",()=>{var t,r;let n,o,i;return i=(n={},o=0,(r=t=e).children("\0").forEach(function e(t){let i=o;r.children(t).forEach(e),n[t]={low:i,lim:o++}}),n),void t.graph().dummyChains.forEach(e=>{let r=t.node(e),n=r.edgeObj,o=function(e,t,r,n){let o=[],i=[],s=Math.min(t[r].low,t[n].low),d=Math.max(t[r].lim,t[n].lim),a;a=r;do o.push(a=e.parent(a));while(a&&(t[a].low>s||d>t[a].lim));let h=a,l=n;for(;(l=e.parent(l))!==h;)i.push(l);return{path:o.concat(i.reverse()),lca:h}}(t,i,n.v,n.w),s=o.path,d=o.lca,a=0,h=s[0],l=!0;for(;e!==n.w;){if(r=t.node(e),l){for(;(h=s[a])!==d&&t.node(h).maxRank<r.rank;)a++;h===d&&(l=!1)}if(!l){for(;a<s.length-1&&t.node(s[a+1]).minRank<=r.rank;)a++;h=s[a]}void 0!==h&&t.setParent(e,h),e=t.successors(e)[0]}})}),o(" addBorderSegments",()=>{var t;(t=e).children("\0").forEach(function e(r){let n=t.children(r),o=t.node(r);if(n.length&&n.forEach(e),Object.hasOwn(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(let e=o.minRank,n=o.maxRank+1;e<n;++e)ef(t,"borderLeft","_bl",r,o,e),ef(t,"borderRight","_br",r,o,e)}})}),o(" order",()=>(function e(t,r={}){let n,o,i;if("function"==typeof r.customOrder)return void r.customOrder(t,e);let d=A(t),a=em(t,K(1,d+1),"inEdges"),h=em(t,K(d-1,-1,-1),"outEdges"),l=(n={},i=K(z(Math.max,(o=t.nodes().filter(e=>!t.children(e).length)).map(e=>t.node(e).rank))+1).map(()=>[]),o.sort((e,r)=>t.node(e).rank-t.node(r).rank).forEach(function e(r){if(n[r])return;n[r]=!0,i[t.node(r).rank].push(r);let o=t.successors(r);o&&o.forEach(e)}),i);if(eb(t,l),r.disableOptimalOrderHeuristic)return;let u=1/0,c,f=r.constraints||[];for(let e=0,r=0;r<4;++e,++r){(function(e,t,r){let n=new s;e.forEach(function(e){var o;let i,s;r.forEach(e=>n.setEdge(e.left,e.right));let d=e.graph().root,a=function e(t,r,n,o){var i;let s,d,a,h,l,u,c,f,g,p,v=t.children(r),w=t.node(r),E=w?w.borderLeft:void 0,m=w?w.borderRight:void 0,b={};E&&(v=v.filter(e=>e!==E&&e!==m));let _=function(e,t=[]){return t.map(t=>{let r=e.inEdges(t);if(!r||!r.length)return{v:t};{let n=r.reduce((t,r)=>{let n=e.edge(r),o=e.node(r.v);return{sum:t.sum+n.weight*o.order,weight:t.weight+n.weight}},{sum:0,weight:0});return{v:t,barycenter:n.sum/n.weight,weight:n.weight}}})}(t,v);_.forEach(r=>{if(t.children(r.v).length){var i,s;let d=e(t,r.v,n,o);b[r.v]=d,Object.hasOwn(d,"barycenter")&&(i=r,s=d,void 0!==i.barycenter?(i.barycenter=(i.barycenter*i.weight+s.barycenter*s.weight)/(i.weight+s.weight),i.weight+=s.weight):(i.barycenter=s.barycenter,i.weight=s.weight))}});let y=(s={},_.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(r.barycenter=e.barycenter,r.weight=e.weight),s[e.v]=r}
1),n.edges().forEach(e=>{let t=s[e.v],r=s[e.w];void 0!==t&&void 0!==r&&(r.indegree++,t.out.push(r))}),function(e){let t=[];for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(function(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}(r)),r.out.forEach(function(t){return r=>{r.in.push(t),0==--r.indegree&&e.push(r)}}(r))}return t.filter(e=>!e.merged).map(e=>W(e,["vs","i","barycenter","weight"]))}(Object.values(s).filter(e=>!e.indegree)));!function(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}(y,b);let k=(h=(i=e=>Object.hasOwn(e,"barycenter"),d={lhs:[],rhs:[]},y.forEach(e=>{i(e)?d.lhs.push(e):d.rhs.push(e)}),a=d).lhs,l=a.rhs.sort((e,t)=>t.i-e.i),u=[],c=0,f=0,g=0,h.sort(function(e){return(t,r)=>t.barycenter<r.barycenter?-1:t.barycenter>r.barycenter?1:e?r.i-t.i:t.i-r.i}(!!o)),g=eE(u,l,g),h.forEach(e=>{g+=e.vs.length,u.push(e.vs),c+=e.barycenter*e.weight,f+=e.weight,g=eE(u,l,g)}),p={vs:u.flat(1)},f&&(p.barycenter=c/f,p.weight=f),p);if(E&&m){k.vs=[E,k.vs,m].flat(1);let e=t.predecessors(E);if(e&&e.length){let r=t.node(e[0]),n=t.predecessors(m),o=t.node(n[0]);Object.hasOwn(k,"barycenter")||(k.barycenter=0,k.weight=0),k.barycenter=(k.barycenter*k.weight+r.order+o.order)/(k.weight+2),k.weight+=2}}return k}(e,d,n,t);a.vs.forEach((t,r)=>e.node(t).order=r),o=a.vs,i={},o.forEach(t=>{let r=e.parent(t),o,d;for(;r;){if((o=e.parent(r))?(d=i[o],i[o]=r):(d=s,s=r),d&&d!==r)return void n.setEdge(d,r);r=o}})})})(e%2?a:h,e%4>=2,f),l=I(t);let n=function(e,t){let r=0;for(let n=1;n<t.length;++n)r+=function(e,t,r){var n;let o=(n=r.map((e,t)=>t),r.reduce((e,t,r)=>(e[t]=n[r],e),{})),i=t.flatMap(t=>{let r=e.outEdges(t);return r?r.map(t=>({pos:o[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),s=1;for(;s<r.length;)s<<=1;let d=2*s-1;s-=1;let a=Array(d).fill(0),h=0;return i.forEach(e=>{let t=e.pos+s;a[t]+=e.weight;let r=0;for(;t>0;)t%2&&(r+=a[t+1]),t=t-1>>1,a[t]+=e.weight;h+=e.weight*r}),h}(e,t[n-1],t[n]);return r}(t,l);n<u?(r=0,c=Object.assign({},l),u=n):n===u&&(c=structuredClone(l))}eb(t,c)})(e,i)),o(" insertSelfEdges",()=>{var t;I(t=e).forEach(e=>{let r=0;e.forEach((e,n)=>{let o=t.node(e);o.order=n+r,(o.selfEdges||[]).forEach(e=>{G(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:n+ ++r,e:e.e,label:e.label},"_se")}),delete o.selfEdges})})}),o(" adjustCoordinateSystem",()=>{var t;let r;("lr"===(r=null==(t=e.graph().rankdir)?void 0:t.toLowerCase())||"rl"===r)&&eg(e)}),o(" position",()=>{var t,r,n,o;let i,d,a,h,l,u,c,f,g,p,v,w,E,m,b;v=I(o=t=F(t=e)),E=(w=o.graph()).ranksep,m=w.rankalign,b=0,v.forEach(e=>{let t=e.reduce((e,t)=>{var r;let n=null!=(r=o.node(t).height)?r:0;return e>n?e:n},0);e.forEach(e=>{let r=o.node(e);"top"===m?r.y=b+r.height/2:"bottom"===m?r.y=b+t-r.height/2:r.y=b+t/2}),b+=t+E}),Object.entries((d=I(r=t),a=Object.assign((i={},d.length&&d.reduce(function(e,t){let n=0,o=0,s=e.length,d=t[t.length-1];return t.forEach((e,a)=>{let h=function(e,t){if(e.node(t).dummy){let r=e.predecessors(t);if(r)return r.find(t=>e.node(t).dummy)}}(r,e),l=h?r.node(h).order:s;(h||e===d)&&(t.slice(o,a+1).forEach(e=>{let t=r.predecessors(e);t&&t.forEach(t=>{let o=r.node(t),s=o.order;(s<n||l<s)&&!(o.dummy&&r.node(e).dummy)&&e_(i,t,e)})}),o=a+1,n=l)}),t}),i),function(e,t){let r={};function n(t,n,o,i,s){K(n,o).forEach(n=>{let o=t[n];if(void 0!==o&&e.node(o).dummy){let t=e.predecessors(o);t&&t.forEach(t=>{if(void 0===t)return;let n=e.node(t);n.dummy&&(n.order<i||n.order>s)&&e_(r,t,o)})}})}return t.length&&t.reduce(function(t,r){let o=-1,i=-1,s=0;return r.forEach((d,a)=>{if("border"===e.node(d).dummy){let t=e.predecessors(d);if(t&&t.length){let d=t[0];if(void 0===d)return;i=e.node(d).order,n(r,s,a,o,i),s=a,o=i}}n(r,s,r.length,i,t.length)}),r}),r}(r,d)),h={},["u","d"].forEach(e=>{l="u"===e?d:Object.values(d).reverse(),["l","r"].forEach(t=>{var n,o;let i,d,u;"r"===t&&(l=l.map(e=>Object.values(e).reverse()));let c=(n=l,o=t=>("u"===e?r.predecessors(t):r.successors(t))||[],i={},d={},u={}
1,n.forEach(e=>{e.forEach((e,t)=>{i[e]=e,d[e]=e,u[e]=t})}),n.forEach(e=>{let t=-1;e.forEach(e=>{let r=o(e);if(r&&r.length){let n=r.sort((e,t)=>{let r=u[e],n=u[t];return(void 0!==r?r:0)-(void 0!==n?n:0)}),o=(n.length-1)/2;for(let r=Math.floor(o),s=Math.ceil(o);r<=s;++r){let o=n[r];if(void 0===o)continue;let s=u[o];if(void 0!==s&&d[e]===e&&t<s&&!function(e,t,r){if(t>r){let e=t;t=r,r=e}let n=e[t];return void 0!==n&&Object.hasOwn(n,r)}(a,e,o)){let r=i[o];void 0!==r&&(d[o]=e,d[e]=i[e]=r,t=s)}}}})}),{root:i,align:d}),f=function(e,t,r,n,o=!1){var i,d,a,h,l,u,c;let f,g,p,v={},w=(i=e,d=t,a=r,h=o,f=new s,p=(l=(g=i.graph()).nodesep,u=g.edgesep,c=h,(e,t,r)=>{let n=e.node(t),o=e.node(r),i,s;if(i=0+n.width/2,Object.hasOwn(n,"labelpos"))switch(n.labelpos.toLowerCase()){case"l":s=-n.width/2;break;case"r":s=n.width/2}if(s&&(i+=c?s:-s),s=void 0,i+=(n.dummy?u:l)/2,i+=(o.dummy?u:l)/2,i+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":s=o.width/2;break;case"r":s=-o.width/2}return s&&(i+=c?s:-s),i}),d.forEach(e=>{let t;e.forEach(e=>{let r=a[e];if(void 0!==r){if(f.setNode(r),void 0!==t){let n=a[t];if(void 0!==n){let o=f.edge(n,r);f.setEdge(n,r,Math.max(p(i,e,t),o||0))}}t=e}})}),f),E=o?"borderLeft":"borderRight";function m(e,t){let r=w.nodes().slice(),n={},o=r.pop();for(;o;){if(n[o])e(o);else for(let e of(n[o]=!0,r.push(o),t(o)))r.push(e);o=r.pop()}}return m(function(e){let t=w.inEdges(e);t?v[e]=t.reduce((e,t)=>{var r;let n=null!=(r=v[t.v])?r:0,o=w.edge(t);return Math.max(e,n+(void 0!==o?o:0))},0):v[e]=0},function(e){return w.predecessors(e)||[]}),m(function(t){let r=w.outEdges(t),n=1/0;r&&(n=r.reduce((e,t)=>{let r=v[t.w],n=w.edge(t);return Math.min(e,(void 0!==r?r:0)-(void 0!==n?n:0))},1/0));let o=e.node(t);n!==1/0&&o.borderType!==E&&(v[t]=Math.max(void 0!==v[t]?v[t]:0,n))},function(e){return w.successors(e)||[]}),Object.keys(n).forEach(e=>{var t;let n=r[e];void 0!==n&&(v[e]=null!=(t=v[n])?t:0)}),v}(r,l,c.root,c.align,"r"===t);"r"===t&&(f=H(f,e=>-e)),h[e+t]=f})}),u=Object.values(h).reduce((e,t)=>{let n=-1/0,o=1/0;Object.entries(t).forEach(([e,t])=>{var i,s;let d=(i=r,s=e,i.node(s).width/2);n=Math.max(t+d,n),o=Math.min(t-d,o)});let i=n-o;return i<e[0]&&(e=[i,t]),e},[1/0,null])[1],f=z(Math.min,c=Object.values(u)),g=z(Math.max,c),["u","d"].forEach(e=>{["l","r"].forEach(t=>{let r=e+t,n=h[r];if(!n||n===u)return;let o=Object.values(n),i=f-z(Math.min,o);"l"!==t&&(i=g-z(Math.max,o)),i&&(h[r]=H(n,e=>e+i))})}),n=r.graph().align,(p=h.ul)?H(p,(e,t)=>{var r,o;if(n){let e=h[n.toLowerCase()];if(e&&void 0!==e[t])return e[t]}let i=Object.values(h).map(e=>{let r=e[t];return void 0!==r?r:0}).sort((e,t)=>e-t);return((null!=(r=i[1])?r:0)+(null!=(o=i[2])?o:0))/2}):{})).forEach(([e,r])=>t.node(e).x=r)}),o(" positionSelfEdges",()=>{var t;(t=e).nodes().forEach(e=>{let r=t.node(e);if("selfedge"===r.dummy){let n=t.node(r.e.v),o=n.x+n.width/2,i=n.y,s=r.x-o,d=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:o+2*s/3,y:i-d},{x:o+5*s/6,y:i-d},{x:o+s,y:i},{x:o+5*s/6,y:i+d},{x:o+2*s/3,y:i+d}],r.label.x=r.x,r.label.y=r.y}})}),o(" removeBorderNodes",()=>{var t;(t=e).nodes().forEach(e=>{if(t.children(e).length){let r=t.node(e),n=t.node(r.borderTop),o=t.node(r.borderBottom),i=t.node(r.borderLeft[r.borderLeft.length-1]),s=t.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(s.x-i.x),r.height=Math.abs(o.y-n.y),r.x=i.x+r.width/2,r.y=n.y+r.height/2}}),t.nodes().forEach(e=>{"border"===t.node(e).dummy&&t.removeNode(e)})}),o(" normalize.undo",()=>{e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeLabel,o;for(e.setEdge(r.edgeObj,n);r.dummy;)o=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=o,r=e.node(t)})}),o(" fixupEdgeLabelCoords",()=>{var t;
1(t=e).edges().forEach(e=>{let r=t.edge(e);if(Object.hasOwn(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}})}),o(" undoCoordinateSystem",()=>{var t,r,n;let o;("bt"===(o=null==(t=e.graph().rankdir)?void 0:t.toLowerCase())||"rl"===o)&&((r=e).nodes().forEach(e=>ev(r.node(e))),r.edges().forEach(e=>{var t;let n=r.edge(e);null==(t=n.points)||t.forEach(ev),Object.hasOwn(n,"y")&&ev(n)})),("lr"===o||"rl"===o)&&((n=e).nodes().forEach(e=>ew(n.node(e))),n.edges().forEach(e=>{var t;let r=n.edge(e);null==(t=r.points)||t.forEach(ew),Object.hasOwn(r,"x")&&ew(r)}),eg(e))}),o(" translateGraph",()=>(function(e){let t=1/0,r=0,n=1/0,o=0,i=e.graph(),s=i.marginx||0,d=i.marginy||0;function a(e){let i=e.x,s=e.y,d=e.width,a=e.height;t=Math.min(t,i-d/2),r=Math.max(r,i+d/2),n=Math.min(n,s-a/2),o=Math.max(o,s+a/2)}e.nodes().forEach(t=>a(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);Object.hasOwn(r,"x")&&a(r)}),t-=s,n-=d,e.nodes().forEach(r=>{let o=e.node(r);o.x-=t,o.y-=n}
1),e.edges().forEach(r=>{let o=e.edge(r);o.points.forEach(e=>{e.x-=t,e.y-=n}),Object.hasOwn(o,"x")&&(o.x-=t),Object.hasOwn(o,"y")&&(o.y-=n)}),i.width=r-t+s,i.height=o-n+d})(e)),o(" assignNodeIntersects",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e),n=t.node(e.v),o=t.node(e.w),i,s;r.points?(i=r.points[0],s=r.points[r.points.length-1]):(r.points=[],i=o,s=n),r.points.unshift(T(n,i)),r.points.push(T(o,s))})}),o(" reversePoints",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);r.reversed&&r.points.reverse()})}),o(" acyclic.undo",()=>{e.edges().forEach(t=>{let r=e.edge(t);if(r.reversed){e.removeEdge(t);let n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}))}),r(" updateInputGraph",()=>{var t,r;return t=e,r=n,void(t.nodes().forEach(e=>{let n=t.node(e),o=r.node(e);n&&(n.x=o.x,n.y=o.y,n.order=o.order,n.rank=o.rank,r.children(e).length&&(n.width=o.width,n.height=o.height))}),t.edges().forEach(e=>{let n=t.edge(e),o=r.edge(e);n.points=o.points,Object.hasOwn(o,"x")&&(n.x=o.x,n.y=o.y)}),t.graph().width=r.graph().width,t.graph().height=r.graph().height)}),n})}var ek=["nodesep","edgesep","ranksep","marginx","marginy"],ex={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},eO=["acyclicer","ranker","rankdir","align","rankalign"],ej=["width","height","rank"],eN={width:0,height:0},eC=["minlen","weight","width","height","labeloffset"],eM={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},eL=["labelpos"];function eR(e,t){return H(W(e,t),Number)}function eD(e){let t={};return e&&Object.entries(e).forEach(([e,r])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=r}),t}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.