UNPKG

24.6 kBJavaScriptView Raw
1import { aK as I, aL as qe, aM as O, ah as y, ag as Te, aN as Xe, aO as Qe, aP as We, aQ as Ee, aR as G, ae as X, aS as Je, aT as Oe, aU as ze, aV as C, aW as R, an as $e, a8 as me, aX as Ve, aY as Z, aZ as ke, a_ as en, a$ as L, am as nn, b0 as rn, af as tn, b1 as re, b2 as sn, b3 as an, al as un, ak as we, ai as fn, b4 as B, ac as on, b5 as dn, ao as M, z as te, b6 as ie } from "./mermaid-9f2aa176.js";
2var hn = "[object Symbol]";
3function Q(e) {
4 return typeof e == "symbol" || I(e) && qe(e) == hn;
5}
6function ve(e, n) {
7 for (var r = -1, t = e == null ? 0 : e.length, i = Array(t); ++r < t; )
8 i[r] = n(e[r], r, e);
9 return i;
10}
11var ln = 1 / 0, se = O ? O.prototype : void 0, ae = se ? se.toString : void 0;
12function Pe(e) {
13 if (typeof e == "string")
14 return e;
15 if (y(e))
16 return ve(e, Pe) + "";
17 if (Q(e))
18 return ae ? ae.call(e) : "";
19 var n = e + "";
20 return n == "0" && 1 / e == -ln ? "-0" : n;
21}
22function gn() {
23}
24function Le(e, n) {
25 for (var r = -1, t = e == null ? 0 : e.length; ++r < t && n(e[r], r, e) !== !1; )
26 ;
27 return e;
28}
29function cn(e, n, r, t) {
30 for (var i = e.length, s = r + (t ? 1 : -1); t ? s-- : ++s < i; )
31 if (n(e[s], s, e))
32 return s;
33 return -1;
34}
35function _n(e) {
36 return e !== e;
37}
38function pn(e, n, r) {
39 for (var t = r - 1, i = e.length; ++t < i; )
40 if (e[t] === n)
41 return t;
42 return -1;
43}
44function bn(e, n, r) {
45 return n === n ? pn(e, n, r) : cn(e, _n, r);
46}
47function yn(e, n) {
48 var r = e == null ? 0 : e.length;
49 return !!r && bn(e, n, 0) > -1;
50}
51function T(e) {
52 return Te(e) ? Xe(e) : Qe(e);
53}
54var An = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Tn = /^\w*$/;
55function W(e, n) {
56 if (y(e))
57 return !1;
58 var r = typeof e;
59 return r == "number" || r == "symbol" || r == "boolean" || e == null || Q(e) ? !0 : Tn.test(e) || !An.test(e) || n != null && e in Object(n);
60}
61var En = 500;
62function On(e) {
63 var n = We(e, function(t) {
64 return r.size === En && r.clear(), t;
65 }), r = n.cache;
66 return n;
67}
68var $n = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, mn = /\\(\\)?/g, wn = On(function(e) {
69 var n = [];
70 return e.charCodeAt(0) === 46 && n.push(""), e.replace($n, function(r, t, i, s) {
71 n.push(i ? s.replace(mn, "$1") : t || r);
72 }), n;
73});
74const vn = wn;
75function Pn(e) {
76 return e == null ? "" : Pe(e);
77}
78function Ie(e, n) {
79 return y(e) ? e : W(e, n) ? [e] : vn(Pn(e));
80}
81var Ln = 1 / 0;
82function U(e) {
83 if (typeof e == "string" || Q(e))
84 return e;
85 var n = e + "";
86 return n == "0" && 1 / e == -Ln ? "-0" : n;
87}
88function Ce(e, n) {
89 n = Ie(n, e);
90 for (var r = 0, t = n.length; e != null && r < t; )
91 e = e[U(n[r++])];
92 return r && r == t ? e : void 0;
93}
94function In(e, n, r) {
95 var t = e == null ? void 0 : Ce(e, n);
96 return t === void 0 ? r : t;
97}
98function J(e, n) {
99 for (var r = -1, t = n.length, i = e.length; ++r < t; )
100 e[i + r] = n[r];
101 return e;
102}
103var ue = O ? O.isConcatSpreadable : void 0;
104function Cn(e) {
105 return y(e) || Ee(e) || !!(ue && e && e[ue]);
106}
107function Se(e, n, r, t, i) {
108 var s = -1, a = e.length;
109 for (r || (r = Cn), i || (i = []); ++s < a; ) {
110 var u = e[s];
111 n > 0 && r(u) ? n > 1 ? Se(u, n - 1, r, t, i) : J(i, u) : t || (i[i.length] = u);
112 }
113 return i;
114}
115function Sn(e, n, r, t) {
116 var i = -1, s = e == null ? 0 : e.length;
117 for (t && s && (r = e[++i]); ++i < s; )
118 r = n(r, e[i], i, e);
119 return r;
120}
121function Nn(e, n) {
122 return e && G(n, T(n), e);
123}
124function Fn(e, n) {
125 return e && G(n, X(n), e);
126}
127function Ne(e, n) {
128 for (var r = -1, t = e == null ? 0 : e.length, i = 0, s = []; ++r < t; ) {
129 var a = e[r];
130 n(a, r, e) && (s[i++] = a);
131 }
132 return s;
133}
134function Fe() {
135 return [];
136}
137var Mn = Object.prototype, xn = Mn.propertyIsEnumerable, fe = Object.getOwnPropertySymbols, Dn = fe ? function(e) {
138 return e == null ? [] : (e = Object(e), Ne(fe(e), function(n) {
139 return xn.call(e, n);
140 }));
141} : Fe;
142const z = Dn;
143function Rn(e, n) {
144 return G(e, z(e), n);
145}
146var Gn = Object.getOwnPropertySymbols, Un = Gn ? function(e) {
147 for (var n = []; e; )
148 J(n, z(e)), e = Je(e);
149 return n;
150} : Fe;
151const Me = Un;
152function Bn(e, n) {
153 return G(e, Me(e), n);
154}
155function xe(e, n, r) {
156 var t = n(e);
157 return y(e) ? t : J(t, r(e));
158}
159function q(e) {
160 return xe(e, T, z);
161}
162function jn(e) {
163 return xe(e, X, Me);
164}
165var Kn = Object.prototype, Hn = Kn.hasOwnProperty;
166function Yn(e) {
167 var n = e.length, r = new e.constructor(n);
168 return n && typeof e[0] == "string" && Hn.call(e, "index") && (r.index = e.index, r.input = e.input), r;
169}
170function Zn(e, n) {
171 var r = n ? Oe(e.buffer) : e.buffer;
172 return new e.constructor(r, e.byteOffset, e.byteLength);
173}
174var qn = /\w*$/;
175function Xn(e) {
176 var n = new e.constructor(e.source, qn.exec(e));
177 return n.lastIndex = e.lastIndex, n;
178}
179var oe = O ? O.prototype : void 0, de = oe ? oe.valueOf : void 0;
180function Qn(e) {
181 return de ? Object(de.call(e)) : {};
182}
183var Wn = "[object Boolean]", Jn = "[object Date]", zn = "[object Map]", Vn = "[object Number]", kn = "[object RegExp]", er = "[object Set]", nr = "[object String]", rr = "[object Symbol]", tr = "[object ArrayBuffer]", ir = "[object DataView]", sr = "[object Float32Array]", ar = "[object Float64Array]", ur = "[object Int8Array]", fr = "[object Int16Array]", or = "[object Int32Array]", dr = "[object Uint8Array]", hr = "[object Uint8ClampedArray]", lr = "[object Uint16Array]", gr = "[object Uint32Array]";
184function cr(e, n, r) {
185 var t = e.constructor;
186 switch (n) {
187 case tr:
188 return Oe(e);
189 case Wn:
190 case Jn:
191 return new t(+e);
192 case ir:
193 return Zn(e, r);
194 case sr:
195 case ar:
196 case ur:
197 case fr:
198 case or:
199 case dr:
200 case hr:
201 case lr:
202 case gr:
203 return ze(e, r);
204 case zn:
205 return new t();
206 case Vn:
207 case nr:
208 return new t(e);
209 case kn:
210 return Xn(e);
211 case er:
212 return new t();
213 case rr:
214 return Qn(e);
215 }
216}
217var _r = "[object Map]";
218function pr(e) {
219 return I(e) && C(e) == _r;
220}
221var he = R && R.isMap, br = he ? $e(he) : pr;
222const yr = br;
223var Ar = "[object Set]";
224function Tr(e) {
225 return I(e) && C(e) == Ar;
226}
227var le = R && R.isSet, Er = le ? $e(le) : Tr;
228const Or = Er;
229var $r = 1, mr = 2, wr = 4, De = "[object Arguments]", vr = "[object Array]", Pr = "[object Boolean]", Lr = "[object Date]", Ir = "[object Error]", Re = "[object Function]", Cr = "[object GeneratorFunction]", Sr = "[object Map]", Nr = "[object Number]", Ge = "[object Object]", Fr = "[object RegExp]", Mr = "[object Set]", xr = "[object String]", Dr = "[object Symbol]", Rr = "[object WeakMap]", Gr = "[object ArrayBuffer]", Ur = "[object DataView]", Br = "[object Float32Array]", jr = "[object Float64Array]", Kr = "[object Int8Array]", Hr = "[object Int16Array]", Yr = "[object Int32Array]", Zr = "[object Uint8Array]", qr = "[object Uint8ClampedArray]", Xr = "[object Uint16Array]", Qr = "[object Uint32Array]", h = {};
230h[De] = h[vr] = h[Gr] = h[Ur] = h[Pr] = h[Lr] = h[Br] = h[jr] = h[Kr] = h[Hr] = h[Yr] = h[Sr] = h[Nr] = h[Ge] = h[Fr] = h[Mr] = h[xr] = h[Dr] = h[Zr] = h[qr] = h[Xr] = h[Qr] = !0;
231h[Ir] = h[Re] = h[Rr] = !1;
232function j(e, n, r, t, i, s) {
233 var a, u = n & $r, f = n & mr, g = n & wr;
234 if (r && (a = i ? r(e, t, i, s) : r(e)), a !== void 0)
235 return a;
236 if (!me(e))
237 return e;
238 var l = y(e);
239 if (l) {
240 if (a = Yn(e), !u)
241 return Ve(e, a);
242 } else {
243 var o = C(e), d = o == Re || o == Cr;
244 if (Z(e))
245 return ke(e, u);
246 if (o == Ge || o == De || d && !i) {
247 if (a = f || d ? {} : en(e), !u)
248 return f ? Bn(e, Fn(a, e)) : Rn(e, Nn(a, e));
249 } else {
250 if (!h[o])
251 return i ? e : {};
252 a = cr(e, o, u);
253 }
254 }
255 s || (s = new L());
256 var A = s.get(e);
257 if (A)
258 return A;
259 s.set(e, a), Or(e) ? e.forEach(function(c) {
260 a.add(j(c, n, r, c, e, s));
261 }) : yr(e) && e.forEach(function(c, _) {
262 a.set(_, j(c, n, r, _, e, s));
263 });
264 var p = g ? f ? jn : q : f ? X : T, b = l ? void 0 : p(e);
265 return Le(b || e, function(c, _) {
266 b && (_ = c, c = e[_]), nn(a, _, j(c, n, r, _, e, s));
267 }), a;
268}
269var Wr = "__lodash_hash_undefined__";
270function Jr(e) {
271 return this.__data__.set(e, Wr), this;
272}
273function zr(e) {
274 return this.__data__.has(e);
275}
276function S(e) {
277 var n = -1, r = e == null ? 0 : e.length;
278 for (this.__data__ = new rn(); ++n < r; )
279 this.add(e[n]);
280}
281S.prototype.add = S.prototype.push = Jr;
282S.prototype.has = zr;
283function Vr(e, n) {
284 for (var r = -1, t = e == null ? 0 : e.length; ++r < t; )
285 if (n(e[r], r, e))
286 return !0;
287 return !1;
288}
289function Ue(e, n) {
290 return e.has(n);
291}
292var kr = 1, et = 2;
293function Be(e, n, r, t, i, s) {
294 var a = r & kr, u = e.length, f = n.length;
295 if (u != f && !(a && f > u))
296 return !1;
297 var g = s.get(e), l = s.get(n);
298 if (g && l)
299 return g == n && l == e;
300 var o = -1, d = !0, A = r & et ? new S() : void 0;
301 for (s.set(e, n), s.set(n, e); ++o < u; ) {
302 var p = e[o], b = n[o];
303 if (t)
304 var c = a ? t(b, p, o, n, e, s) : t(p, b, o, e, n, s);
305 if (c !== void 0) {
306 if (c)
307 continue;
308 d = !1;
309 break;
310 }
311 if (A) {
312 if (!Vr(n, function(_, $) {
313 if (!Ue(A, $) && (p === _ || i(p, _, r, t, s)))
314 return A.push($);
315 })) {
316 d = !1;
317 break;
318 }
319 } else if (!(p === b || i(p, b, r, t, s))) {
320 d = !1;
321 break;
322 }
323 }
324 return s.delete(e), s.delete(n), d;
325}
326function nt(e) {
327 var n = -1, r = Array(e.size);
328 return e.forEach(function(t, i) {
329 r[++n] = [i, t];
330 }), r;
331}
332function V(e) {
333 var n = -1, r = Array(e.size);
334 return e.forEach(function(t) {
335 r[++n] = t;
336 }), r;
337}
338var rt = 1, tt = 2, it = "[object Boolean]", st = "[object Date]", at = "[object Error]", ut = "[object Map]", ft = "[object Number]", ot = "[object RegExp]", dt = "[object Set]", ht = "[object String]", lt = "[object Symbol]", gt = "[object ArrayBuffer]", ct = "[object DataView]", ge = O ? O.prototype : void 0, K = ge ? ge.valueOf : void 0;
339function _t(e, n, r, t, i, s, a) {
340 switch (r) {
341 case ct:
342 if (e.byteLength != n.byteLength || e.byteOffset != n.byteOffset)
343 return !1;
344 e = e.buffer, n = n.buffer;
345 case gt:
346 return !(e.byteLength != n.byteLength || !s(new re(e), new re(n)));
347 case it:
348 case st:
349 case ft:
350 return tn(+e, +n);
351 case at:
352 return e.name == n.name && e.message == n.message;
353 case ot:
354 case ht:
355 return e == n + "";
356 case ut:
357 var u = nt;
358 case dt:
359 var f = t & rt;
360 if (u || (u = V), e.size != n.size && !f)
361 return !1;
362 var g = a.get(e);
363 if (g)
364 return g == n;
365 t |= tt, a.set(e, n);
366 var l = Be(u(e), u(n), t, i, s, a);
367 return a.delete(e), l;
368 case lt:
369 if (K)
370 return K.call(e) == K.call(n);
371 }
372 return !1;
373}
374var pt = 1, bt = Object.prototype, yt = bt.hasOwnProperty;
375function At(e, n, r, t, i, s) {
376 var a = r & pt, u = q(e), f = u.length, g = q(n), l = g.length;
377 if (f != l && !a)
378 return !1;
379 for (var o = f; o--; ) {
380 var d = u[o];
381 if (!(a ? d in n : yt.call(n, d)))
382 return !1;
383 }
384 var A = s.get(e), p = s.get(n);
385 if (A && p)
386 return A == n && p == e;
387 var b = !0;
388 s.set(e, n), s.set(n, e);
389 for (var c = a; ++o < f; ) {
390 d = u[o];
391 var _ = e[d], $ = n[d];
392 if (t)
393 var ne = a ? t($, _, d, n, e, s) : t(_, $, d, e, n, s);
394 if (!(ne === void 0 ? _ === $ || i(_, $, r, t, s) : ne)) {
395 b = !1;
396 break;
397 }
398 c || (c = d == "constructor");
399 }
400 if (b && !c) {
401 var N = e.constructor, F = n.constructor;
402 N != F && "constructor" in e && "constructor" in n && !(typeof N == "function" && N instanceof N && typeof F == "function" && F instanceof F) && (b = !1);
403 }
404 return s.delete(e), s.delete(n), b;
405}
406var Tt = 1, ce = "[object Arguments]", _e = "[object Array]", x = "[object Object]", Et = Object.prototype, pe = Et.hasOwnProperty;
407function Ot(e, n, r, t, i, s) {
408 var a = y(e), u = y(n), f = a ? _e : C(e), g = u ? _e : C(n);
409 f = f == ce ? x : f, g = g == ce ? x : g;
410 var l = f == x, o = g == x, d = f == g;
411 if (d && Z(e)) {
412 if (!Z(n))
413 return !1;
414 a = !0, l = !1;
415 }
416 if (d && !l)
417 return s || (s = new L()), a || sn(e) ? Be(e, n, r, t, i, s) : _t(e, n, f, r, t, i, s);
418 if (!(r & Tt)) {
419 var A = l && pe.call(e, "__wrapped__"), p = o && pe.call(n, "__wrapped__");
420 if (A || p) {
421 var b = A ? e.value() : e, c = p ? n.value() : n;
422 return s || (s = new L()), i(b, c, r, t, s);
423 }
424 }
425 return d ? (s || (s = new L()), At(e, n, r, t, i, s)) : !1;
426}
427function k(e, n, r, t, i) {
428 return e === n ? !0 : e == null || n == null || !I(e) && !I(n) ? e !== e && n !== n : Ot(e, n, r, t, k, i);
429}
430var $t = 1, mt = 2;
431function wt(e, n, r, t) {
432 var i = r.length, s = i, a = !t;
433 if (e == null)
434 return !s;
435 for (e = Object(e); i--; ) {
436 var u = r[i];
437 if (a && u[2] ? u[1] !== e[u[0]] : !(u[0] in e))
438 return !1;
439 }
440 for (; ++i < s; ) {
441 u = r[i];
442 var f = u[0], g = e[f], l = u[1];
443 if (a && u[2]) {
444 if (g === void 0 && !(f in e))
445 return !1;
446 } else {
447 var o = new L();
448 if (t)
449 var d = t(g, l, f, e, n, o);
450 if (!(d === void 0 ? k(l, g, $t | mt, t, o) : d))
451 return !1;
452 }
453 }
454 return !0;
455}
456function je(e) {
457 return e === e && !me(e);
458}
459function vt(e) {
460 for (var n = T(e), r = n.length; r--; ) {
461 var t = n[r], i = e[t];
462 n[r] = [t, i, je(i)];
463 }
464 return n;
465}
466function Ke(e, n) {
467 return function(r) {
468 return r == null ? !1 : r[e] === n && (n !== void 0 || e in Object(r));
469 };
470}
471function Pt(e) {
472 var n = vt(e);
473 return n.length == 1 && n[0][2] ? Ke(n[0][0], n[0][1]) : function(r) {
474 return r === e || wt(r, e, n);
475 };
476}
477function Lt(e, n) {
478 return e != null && n in Object(e);
479}
480function He(e, n, r) {
481 n = Ie(n, e);
482 for (var t = -1, i = n.length, s = !1; ++t < i; ) {
483 var a = U(n[t]);
484 if (!(s = e != null && r(e, a)))
485 break;
486 e = e[a];
487 }
488 return s || ++t != i ? s : (i = e == null ? 0 : e.length, !!i && an(i) && un(a, i) && (y(e) || Ee(e)));
489}
490function It(e, n) {
491 return e != null && He(e, n, Lt);
492}
493var Ct = 1, St = 2;
494function Nt(e, n) {
495 return W(e) && je(n) ? Ke(U(e), n) : function(r) {
496 var t = In(r, e);
497 return t === void 0 && t === n ? It(r, e) : k(n, t, Ct | St);
498 };
499}
500function Ft(e) {
501 return function(n) {
502 return n == null ? void 0 : n[e];
503 };
504}
505function Mt(e) {
506 return function(n) {
507 return Ce(n, e);
508 };
509}
510function xt(e) {
511 return W(e) ? Ft(U(e)) : Mt(e);
512}
513function Ye(e) {
514 return typeof e == "function" ? e : e == null ? we : typeof e == "object" ? y(e) ? Nt(e[0], e[1]) : Pt(e) : xt(e);
515}
516function Dt(e, n) {
517 return e && fn(e, n, T);
518}
519function Rt(e, n) {
520 return function(r, t) {
521 if (r == null)
522 return r;
523 if (!Te(r))
524 return e(r, t);
525 for (var i = r.length, s = n ? i : -1, a = Object(r); (n ? s-- : ++s < i) && t(a[s], s, a) !== !1; )
526 ;
527 return r;
528 };
529}
530var Gt = Rt(Dt);
531const ee = Gt;
532function Ut(e, n, r) {
533 for (var t = -1, i = e == null ? 0 : e.length; ++t < i; )
534 if (r(n, e[t]))
535 return !0;
536 return !1;
537}
538function Bt(e) {
539 return typeof e == "function" ? e : we;
540}
541function m(e, n) {
542 var r = y(e) ? Le : ee;
543 return r(e, Bt(n));
544}
545function jt(e, n) {
546 var r = [];
547 return ee(e, function(t, i, s) {
548 n(t, i, s) && r.push(t);
549 }), r;
550}
551function D(e, n) {
552 var r = y(e) ? Ne : jt;
553 return r(e, Ye(n));
554}
555var Kt = Object.prototype, Ht = Kt.hasOwnProperty;
556function Yt(e, n) {
557 return e != null && Ht.call(e, n);
558}
559function E(e, n) {
560 return e != null && He(e, n, Yt);
561}
562function Zt(e, n) {
563 return ve(n, function(r) {
564 return e[r];
565 });
566}
567function H(e) {
568 return e == null ? [] : Zt(e, T(e));
569}
570function v(e) {
571 return e === void 0;
572}
573function qt(e, n, r, t, i) {
574 return i(e, function(s, a, u) {
575 r = t ? (t = !1, s) : n(r, s, a, u);
576 }), r;
577}
578function Xt(e, n, r) {
579 var t = y(e) ? Sn : qt, i = arguments.length < 3;
580 return t(e, Ye(n), r, i, ee);
581}
582var Qt = 1 / 0, Wt = B && 1 / V(new B([, -0]))[1] == Qt ? function(e) {
583 return new B(e);
584} : gn;
585const Jt = Wt;
586var zt = 200;
587function Vt(e, n, r) {
588 var t = -1, i = yn, s = e.length, a = !0, u = [], f = u;
589 if (r)
590 a = !1, i = Ut;
591 else if (s >= zt) {
592 var g = n ? null : Jt(e);
593 if (g)
594 return V(g);
595 a = !1, i = Ue, f = new S();
596 } else
597 f = n ? [] : u;
598 e:
599 for (; ++t < s; ) {
600 var l = e[t], o = n ? n(l) : l;
601 if (l = r || l !== 0 ? l : 0, a && o === o) {
602 for (var d = f.length; d--; )
603 if (f[d] === o)
604 continue e;
605 n && f.push(o), u.push(l);
606 } else
607 i(f, o, r) || (f !== u && f.push(o), u.push(l));
608 }
609 return u;
610}
611var kt = on(function(e) {
612 return Vt(Se(e, 1, dn, !0));
613});
614const ei = kt;
615var ni = "\0", w = "\0", be = "";
616class Ze {
617 constructor(n = {}) {
618 this._isDirected = E(n, "directed") ? n.directed : !0, this._isMultigraph = E(n, "multigraph") ? n.multigraph : !1, this._isCompound = E(n, "compound") ? n.compound : !1, this._label = void 0, this._defaultNodeLabelFn = M(void 0), this._defaultEdgeLabelFn = M(void 0), this._nodes = {}, this._isCompound && (this._parent = {}, this._children = {}, this._children[w] = {}), this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {};
619 }
620 /* === Graph functions ========= */
621 isDirected() {
622 return this._isDirected;
623 }
624 isMultigraph() {
625 return this._isMultigraph;
626 }
627 isCompound() {
628 return this._isCompound;
629 }
630 setGraph(n) {
631 return this._label = n, this;
632 }
633 graph() {
634 return this._label;
635 }
636 /* === Node functions ========== */
637 setDefaultNodeLabel(n) {
638 return te(n) || (n = M(n)), this._defaultNodeLabelFn = n, this;
639 }
640 nodeCount() {
641 return this._nodeCount;
642 }
643 nodes() {
644 return T(this._nodes);
645 }
646 sources() {
647 var n = this;
648 return D(this.nodes(), function(r) {
649 return ie(n._in[r]);
650 });
651 }
652 sinks() {
653 var n = this;
654 return D(this.nodes(), function(r) {
655 return ie(n._out[r]);
656 });
657 }
658 setNodes(n, r) {
659 var t = arguments, i = this;
660 return m(n, function(s) {
661 t.length > 1 ? i.setNode(s, r) : i.setNode(s);
662 }), this;
663 }
664 setNode(n, r) {
665 return E(this._nodes, n) ? (arguments.length > 1 && (this._nodes[n] = r), this) : (this._nodes[n] = arguments.length > 1 ? r : this._defaultNodeLabelFn(n), this._isCompound && (this._parent[n] = w, this._children[n] = {}, this._children[w][n] = !0), this._in[n] = {}, this._preds[n] = {}, this._out[n] = {}, this._sucs[n] = {}, ++this._nodeCount, this);
666 }
667 node(n) {
668 return this._nodes[n];
669 }
670 hasNode(n) {
671 return E(this._nodes, n);
672 }
673 removeNode(n) {
674 var r = this;
675 if (E(this._nodes, n)) {
676 var t = function(i) {
677 r.removeEdge(r._edgeObjs[i]);
678 };
679 delete this._nodes[n], this._isCompound && (this._removeFromParentsChildList(n), delete this._parent[n], m(this.children(n), function(i) {
680 r.setParent(i);
681 }), delete this._children[n]), m(T(this._in[n]), t), delete this._in[n], delete this._preds[n], m(T(this._out[n]), t), delete this._out[n], delete this._sucs[n], --this._nodeCount;
682 }
683 return this;
684 }
685 setParent(n, r) {
686 if (!this._isCompound)
687 throw new Error("Cannot set parent in a non-compound graph");
688 if (v(r))
689 r = w;
690 else {
691 r += "";
692 for (var t = r; !v(t); t = this.parent(t))
693 if (t === n)
694 throw new Error("Setting " + r + " as parent of " + n + " would create a cycle");
695 this.setNode(r);
696 }
697 return this.setNode(n), this._removeFromParentsChildList(n), this._parent[n] = r, this._children[r][n] = !0, this;
698 }
699 _removeFromParentsChildList(n) {
700 delete this._children[this._parent[n]][n];
701 }
702 parent(n) {
703 if (this._isCompound) {
704 var r = this._parent[n];
705 if (r !== w)
706 return r;
707 }
708 }
709 children(n) {
710 if (v(n) && (n = w), this._isCompound) {
711 var r = this._children[n];
712 if (r)
713 return T(r);
714 } else {
715 if (n === w)
716 return this.nodes();
717 if (this.hasNode(n))
718 return [];
719 }
720 }
721 predecessors(n) {
722 var r = this._preds[n];
723 if (r)
724 return T(r);
725 }
726 successors(n) {
727 var r = this._sucs[n];
728 if (r)
729 return T(r);
730 }
731 neighbors(n) {
732 var r = this.predecessors(n);
733 if (r)
734 return ei(r, this.successors(n));
735 }
736 isLeaf(n) {
737 var r;
738 return this.isDirected() ? r = this.successors(n) : r = this.neighbors(n), r.length === 0;
739 }
740 filterNodes(n) {
741 var r = new this.constructor({
742 directed: this._isDirected,
743 multigraph: this._isMultigraph,
744 compound: this._isCompound
745 });
746 r.setGraph(this.graph());
747 var t = this;
748 m(this._nodes, function(a, u) {
749 n(u) && r.setNode(u, a);
750 }), m(this._edgeObjs, function(a) {
751 r.hasNode(a.v) && r.hasNode(a.w) && r.setEdge(a, t.edge(a));
752 });
753 var i = {};
754 function s(a) {
755 var u = t.parent(a);
756 return u === void 0 || r.hasNode(u) ? (i[a] = u, u) : u in i ? i[u] : s(u);
757 }
758 return this._isCompound && m(r.nodes(), function(a) {
759 r.setParent(a, s(a));
760 }), r;
761 }
762 /* === Edge functions ========== */
763 setDefaultEdgeLabel(n) {
764 return te(n) || (n = M(n)), this._defaultEdgeLabelFn = n, this;
765 }
766 edgeCount() {
767 return this._edgeCount;
768 }
769 edges() {
770 return H(this._edgeObjs);
771 }
772 setPath(n, r) {
773 var t = this, i = arguments;
774 return Xt(n, function(s, a) {
775 return i.length > 1 ? t.setEdge(s, a, r) : t.setEdge(s, a), a;
776 }), this;
777 }
778 /*
779 * setEdge(v, w, [value, [name]])
780 * setEdge({ v, w, [name] }, [value])
781 */
782 setEdge() {
783 var n, r, t, i, s = !1, a = arguments[0];
784 typeof a == "object" && a !== null && "v" in a ? (n = a.v, r = a.w, t = a.name, arguments.length === 2 && (i = arguments[1], s = !0)) : (n = a, r = arguments[1], t = arguments[3], arguments.length > 2 && (i = arguments[2], s = !0)), n = "" + n, r = "" + r, v(t) || (t = "" + t);
785 var u = P(this._isDirected, n, r, t);
786 if (E(this._edgeLabels, u))
787 return s && (this._edgeLabels[u] = i), this;
788 if (!v(t) && !this._isMultigraph)
789 throw new Error("Cannot set a named edge when isMultigraph = false");
790 this.setNode(n), this.setNode(r), this._edgeLabels[u] = s ? i : this._defaultEdgeLabelFn(n, r, t);
791 var f = ri(this._isDirected, n, r, t);
792 return n = f.v, r = f.w, Object.freeze(f), this._edgeObjs[u] = f, ye(this._preds[r], n), ye(this._sucs[n], r), this._in[r][u] = f, this._out[n][u] = f, this._edgeCount++, this;
793 }
794 edge(n, r, t) {
795 var i = arguments.length === 1 ? Y(this._isDirected, arguments[0]) : P(this._isDirected, n, r, t);
796 return this._edgeLabels[i];
797 }
798 hasEdge(n, r, t) {
799 var i = arguments.length === 1 ? Y(this._isDirected, arguments[0]) : P(this._isDirected, n, r, t);
800 return E(this._edgeLabels, i);
801 }
802 removeEdge(n, r, t) {
803 var i = arguments.length === 1 ? Y(this._isDirected, arguments[0]) : P(this._isDirected, n, r, t), s = this._edgeObjs[i];
804 return s && (n = s.v, r = s.w, delete this._edgeLabels[i], delete this._edgeObjs[i], Ae(this._preds[r], n), Ae(this._sucs[n], r), delete this._in[r][i], delete this._out[n][i], this._edgeCount--), this;
805 }
806 inEdges(n, r) {
807 var t = this._in[n];
808 if (t) {
809 var i = H(t);
810 return r ? D(i, function(s) {
811 return s.v === r;
812 }) : i;
813 }
814 }
815 outEdges(n, r) {
816 var t = this._out[n];
817 if (t) {
818 var i = H(t);
819 return r ? D(i, function(s) {
820 return s.w === r;
821 }) : i;
822 }
823 }
824 nodeEdges(n, r) {
825 var t = this.inEdges(n, r);
826 if (t)
827 return t.concat(this.outEdges(n, r));
828 }
829}
830Ze.prototype._nodeCount = 0;
831Ze.prototype._edgeCount = 0;
832function ye(e, n) {
833 e[n] ? e[n]++ : e[n] = 1;
834}
835function Ae(e, n) {
836 --e[n] || delete e[n];
837}
838function P(e, n, r, t) {
839 var i = "" + n, s = "" + r;
840 if (!e && i > s) {
841 var a = i;
842 i = s, s = a;
843 }
844 return i + be + s + be + (v(t) ? ni : t);
845}
846function ri(e, n, r, t) {
847 var i = "" + n, s = "" + r;
848 if (!e && i > s) {
849 var a = i;
850 i = s, s = a;
851 }
852 var u = { v: i, w: s };
853 return t && (u.name = t), u;
854}
855function Y(e, n) {
856 return P(e, n.v, n.w, n.name);
857}
858export {
859 Ze as G,
860 Q as a,
861 Se as b,
862 j as c,
863 Ye as d,
864 cn as e,
865 m as f,
866 ee as g,
867 E as h,
868 v as i,
869 ve as j,
870 T as k,
871 Bt as l,
872 Dt as m,
873 Ie as n,
874 Ce as o,
875 It as p,
876 Pn as q,
877 D as r,
878 Xt as s,
879 U as t,
880 H as v
881};