@popcorn245/cornfield-components 0.50.0 → 0.51.0

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.
@@ -1,37 +1,36 @@
1
- import { n as e, r as t, t as n } from "./runtime-DFu6W5g-.js";
2
- import { $ as r, B as i, C as a, D as o, E as s, F as c, G as l, H as u, I as d, J as f, K as p, L as m, M as h, N as g, O as _, P as v, Q as y, R as b, S as x, T as S, U as C, V as w, W as T, X as E, Z as D, _ as O, a as k, b as A, c as j, ct as M, d as N, et as P, f as F, g as I, h as ee, it as te, j as L, k as R, l as ne, lt as z, m as B, mt as V, nt as H, o as U, p as re, pt as W, q as G, rt as ie, s as ae, t as oe, tt as se, ut as ce, v as le, w as ue, x as de, y as fe, z as pe } from "./_corn-default-tokens-BpIL6q5N.js";
3
- var K = 96, me = "letters:", he = (e) => `${me}${e}`, ge = (e) => typeof e == "string" && e.startsWith(me), _e = (e) => e.slice(8), ve = (e, t) => !!e.letters && !e.icon && e.r * 2 * t >= 14, ye = /* @__PURE__ */ new Map();
4
- function be(e, t = null) {
1
+ import { $ as e, At as t, B as n, Ct as r, Dt as i, Et as a, F as o, G as s, H as c, I as l, J as u, L as d, M as f, N as p, Ot as m, P as h, Q as g, Qt as _, St as v, Tt as y, U as b, V as x, W as S, X as C, Y as w, Z as T, _ as E, an as D, at as O, b as k, c as A, d as ee, g as j, gt as M, h as N, ht as te, it as P, j as F, ln as I, lt as L, mt as R, o as z, on as B, q as V, rt as H, s as ne, sn as re, tt as U, u as ie, ut as W, v as G, vt as K, wt as ae, xt as oe, yt as se, z as ce } from "./engine-ClfnAsgM.js";
2
+ var q = 96, le = "letters:", ue = (e) => `${le}${e}`, de = (e) => typeof e == "string" && e.startsWith(le), fe = (e) => e.slice(8), pe = (e, t) => !!e.letters && !e.icon && e.r * 2 * t >= 14, me = /* @__PURE__ */ new Map();
3
+ function he(e, t = null) {
5
4
  if (typeof e != "string" || !e) return null;
6
5
  let n = `${typeof t == "string" ? t : ""}|${e}`;
7
- if (ye.has(n)) return ye.get(n);
8
- if (ye.size >= 128) return null;
6
+ if (me.has(n)) return me.get(n);
7
+ if (me.size >= 128) return null;
9
8
  let r = null;
10
9
  try {
11
- let n = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(K, K) : typeof document < "u" ? Object.assign(document.createElement("canvas"), {
12
- width: K,
13
- height: K
10
+ let n = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(q, q) : typeof document < "u" ? Object.assign(document.createElement("canvas"), {
11
+ width: q,
12
+ height: q
14
13
  }) : null, i = n && n.getContext && n.getContext("2d");
15
14
  if (i && i.fillText) {
16
- i.font = `700 ${e.length > 1 ? 56 : 72}px ${L}`, i.textAlign = "center", i.textBaseline = "middle", i.lineJoin = "round", i.lineWidth = 10;
17
- let a = typeof t == "string" ? t : f;
18
- i.strokeStyle = P(a) === "#ffffff" ? "rgba(11, 18, 32, 0.92)" : "rgba(255, 255, 255, 0.92)", i.strokeText(e, K / 2, 51), i.fillStyle = a, i.fillText(e, K / 2, 51), r = n;
15
+ i.font = `700 ${e.length > 1 ? 56 : 72}px ${V}`, i.textAlign = "center", i.textBaseline = "middle", i.lineJoin = "round", i.lineWidth = 10;
16
+ let a = typeof t == "string" ? t : se;
17
+ i.strokeStyle = y(a) === "#ffffff" ? "rgba(11, 18, 32, 0.92)" : "rgba(255, 255, 255, 0.92)", i.strokeText(e, q / 2, 51), i.fillStyle = a, i.fillText(e, q / 2, 51), r = n;
19
18
  }
20
19
  } catch {
21
20
  r = null;
22
21
  }
23
- return ye.set(n, r), r;
22
+ return me.set(n, r), r;
24
23
  }
25
24
  // ../explorer/renderer-canvas2d.js
26
- var xe = Math.PI * 2, Se = 1.5, q = (e, t, n, r) => {
27
- e.beginPath(), e.arc(t, n, r, 0, xe);
25
+ var ge = Math.PI * 2, _e = 1.5, J = (e, t, n, r) => {
26
+ e.beginPath(), e.arc(t, n, r, 0, ge);
28
27
  };
29
- function Ce(e, t, n, r, i) {
28
+ function ve(e, t, n, r, i) {
30
29
  if (t === "rounded-square" || t === "square") {
31
- let a = i * (t === "square" ? v.squareHalf : v.roundedHalf), o = i * (t === "square" ? v.squareCorner : v.roundedCorner);
30
+ let a = i * (t === "square" ? C.squareHalf : C.roundedHalf), o = i * (t === "square" ? C.squareCorner : C.roundedCorner);
32
31
  e.beginPath(), e.roundRect ? e.roundRect(n - a, r - a, a * 2, a * 2, o) : e.rect(n - a, r - a, a * 2, a * 2);
33
32
  } else if (t === "hexagon") {
34
- let t = i * v.hexInradius / Math.cos(Math.PI / 6);
33
+ let t = i * C.hexInradius / Math.cos(Math.PI / 6);
35
34
  e.beginPath();
36
35
  for (let i = 0; i < 6; i++) {
37
36
  let a = Math.PI / 6 + i * Math.PI / 3, o = n + t * Math.cos(a), s = r + t * Math.sin(a);
@@ -39,167 +38,167 @@ function Ce(e, t, n, r, i) {
39
38
  }
40
39
  e.closePath();
41
40
  } else if (t === "diamond") {
42
- let t = i * v.diamondHalf;
41
+ let t = i * C.diamondHalf;
43
42
  e.beginPath(), e.moveTo(n, r - t), e.lineTo(n + t, r), e.lineTo(n, r + t), e.lineTo(n - t, r), e.closePath();
44
- } else q(e, n, r, i);
43
+ } else J(e, n, r, i);
45
44
  }
46
- function we(e, t, n, r, i) {
45
+ function ye(e, t, n, r, i) {
47
46
  let a = -n.x / n.zoom - t.margin, o = (r - n.x) / n.zoom + t.margin, s = -n.y / n.zoom - t.margin, c = (i - n.y) / n.zoom + t.margin;
48
47
  e.beginPath(), e.strokeStyle = t.color, e.lineWidth = t.width;
49
48
  for (let n = Math.floor(a / t.size) * t.size; n < o; n += t.size) e.moveTo(n, s), e.lineTo(n, c);
50
49
  for (let n = Math.floor(s / t.size) * t.size; n < c; n += t.size) e.moveTo(a, n), e.lineTo(o, n);
51
50
  e.stroke();
52
51
  }
53
- function Te(e, t) {
52
+ function be(e, t) {
54
53
  e.save(), t.forEach((t) => {
55
- e.lineWidth = t.width, e.setLineDash(t.dash), e.strokeStyle = t.color, q(e, t.x, t.y, t.r), e.stroke();
54
+ e.lineWidth = t.width, e.setLineDash(t.dash), e.strokeStyle = t.color, J(e, t.x, t.y, t.r), e.stroke();
56
55
  }), e.restore();
57
56
  }
58
- function Ee(e, t) {
57
+ function xe(e, t) {
59
58
  e.save(), t.forEach((t) => {
60
59
  e.fillStyle = t.fill, e.strokeStyle = t.stroke, e.lineWidth = t.strokeWidth, e.beginPath(), e.roundRect(t.x, t.y, t.w, t.h, t.radius), e.fill(), e.stroke();
61
60
  }), e.restore();
62
61
  }
63
- function De(e, t, n, r, i = !0) {
64
- if (e.save(), e.globalAlpha = t.alpha, e.beginPath(), e.moveTo(t.x1, t.y1), t.curve ? e.quadraticCurveTo(t.curve.cx, t.curve.cy, t.x2, t.y2) : e.lineTo(t.x2, t.y2), e.strokeStyle = t.color, e.lineWidth = t.mark && t.mark !== "none" ? Math.max(t.width, g.edge / r) : t.width, e.setLineDash(t.dash || []), t.glow && t.glow * r >= Se) {
65
- let n = e.lineWidth;
66
- e.save(), e.globalAlpha = t.alpha * .3, e.strokeStyle = t.glowColor || t.color, e.lineWidth = n + t.glow * .6, e.stroke(), e.restore();
62
+ function Se(t, n, r, i, a = !0) {
63
+ if (t.save(), t.globalAlpha = n.alpha, t.beginPath(), t.moveTo(n.x1, n.y1), n.curve ? t.quadraticCurveTo(n.curve.cx, n.curve.cy, n.x2, n.y2) : t.lineTo(n.x2, n.y2), t.strokeStyle = n.color, t.lineWidth = n.mark && n.mark !== "none" ? Math.max(n.width, w.edge / i) : n.width, t.setLineDash(n.dash || []), n.glow && n.glow * i >= _e) {
64
+ let e = t.lineWidth;
65
+ t.save(), t.globalAlpha = n.alpha * .3, t.strokeStyle = n.glowColor || n.color, t.lineWidth = e + n.glow * .6, t.stroke(), t.restore();
67
66
  }
68
- if (e.stroke(), e.setLineDash([]), t.mark === "removed") {
69
- let n = m(t, .5), i = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [a, o] = i > 0 ? [(t.x2 - t.x1) / i, (t.y2 - t.y1) / i] : [1, 0];
70
- e.beginPath(), e.moveTo(n.x - o * _.halfLength, n.y + a * _.halfLength), e.lineTo(n.x + o * _.halfLength, n.y - a * _.halfLength), e.lineWidth = Math.max(_.width, 1.5 / r), e.stroke();
67
+ if (t.stroke(), t.setLineDash([]), n.mark === "removed") {
68
+ let r = e(n, .5), a = Math.hypot(n.x2 - n.x1, n.y2 - n.y1), [o, s] = a > 0 ? [(n.x2 - n.x1) / a, (n.y2 - n.y1) / a] : [1, 0];
69
+ t.beginPath(), t.moveTo(r.x - s * S.halfLength, r.y + o * S.halfLength), t.lineTo(r.x + s * S.halfLength, r.y - o * S.halfLength), t.lineWidth = Math.max(S.width, 1.5 / i), t.stroke();
71
70
  }
72
- if (t.ticks && ke(e, t, r), t.arrow) {
73
- let { cx: n, cy: i } = t.curve || {
74
- cx: t.x1,
75
- cy: t.y1
71
+ if (n.ticks && we(t, n, i), n.arrow) {
72
+ let { cx: e, cy: r } = n.curve || {
73
+ cx: n.x1,
74
+ cy: n.y1
76
75
  };
77
- Oe(e, t, Math.atan2(t.y2 - i, t.x2 - n), r);
76
+ Ce(t, n, Math.atan2(n.y2 - r, n.x2 - e), i);
78
77
  }
79
- i && t.packet && Ae(e, t, n, r), e.restore();
78
+ a && n.packet && Te(t, n, r, i), t.restore();
80
79
  }
81
- function Oe(e, t, n, r) {
82
- let i = t.end || "triangle", { x2: a, y2: o, color: c } = t, l = Math.cos(n), u = Math.sin(n), d = (e, t) => [a - l * e - u * t, o - u * e + l * t], f = Math.max(R.strokeWidth, 1.2 / r);
83
- if (e.beginPath(), i === "triangle") e.moveTo(a, o), e.lineTo(a - Math.cos(n - s.spread) * s.length, o - Math.sin(n - s.spread) * s.length), e.lineTo(a - Math.cos(n + s.spread) * s.length, o - Math.sin(n + s.spread) * s.length), e.closePath(), e.fillStyle = c, e.fill();
80
+ function Ce(e, t, n, r) {
81
+ let i = t.end || "triangle", { x2: a, y2: o, color: l } = t, u = Math.cos(n), d = Math.sin(n), f = (e, t) => [a - u * e - d * t, o - d * e + u * t], p = Math.max(s.strokeWidth, 1.2 / r);
82
+ if (e.beginPath(), i === "triangle") e.moveTo(a, o), e.lineTo(a - Math.cos(n - c.spread) * c.length, o - Math.sin(n - c.spread) * c.length), e.lineTo(a - Math.cos(n + c.spread) * c.length, o - Math.sin(n + c.spread) * c.length), e.closePath(), e.fillStyle = l, e.fill();
84
83
  else {
85
- if (e.strokeStyle = c, e.lineWidth = f, e.lineJoin = "miter", i === "chevron") {
86
- let t = s.length * Math.cos(s.spread), n = s.length * Math.sin(s.spread);
87
- e.moveTo(...d(t, n)), e.lineTo(a, o), e.lineTo(...d(t, -n));
88
- } else if (i === "bar") e.moveTo(...d(f / 2, R.barHalf)), e.lineTo(...d(f / 2, -R.barHalf));
84
+ if (e.strokeStyle = l, e.lineWidth = p, e.lineJoin = "miter", i === "chevron") {
85
+ let t = c.length * Math.cos(c.spread), n = c.length * Math.sin(c.spread);
86
+ e.moveTo(...f(t, n)), e.lineTo(a, o), e.lineTo(...f(t, -n));
87
+ } else if (i === "bar") e.moveTo(...f(p / 2, s.barHalf)), e.lineTo(...f(p / 2, -s.barHalf));
89
88
  else {
90
- let t = R.diamondHalf;
91
- e.moveTo(a, o), e.lineTo(...d(t, R.diamondAcross)), e.lineTo(...d(2 * t, 0)), e.lineTo(...d(t, -R.diamondAcross)), e.closePath();
89
+ let t = s.diamondHalf;
90
+ e.moveTo(a, o), e.lineTo(...f(t, s.diamondAcross)), e.lineTo(...f(2 * t, 0)), e.lineTo(...f(t, -s.diamondAcross)), e.closePath();
92
91
  }
93
92
  e.stroke();
94
93
  }
95
94
  }
96
- function ke(e, t, n) {
97
- let r = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [i, a] = r > 0 ? [(t.x2 - t.x1) / r, (t.y2 - t.y1) / r] : [1, 0], o = m(t, .5);
98
- e.beginPath();
99
- for (let n = 0; n < t.ticks; n++) {
100
- let r = (n - (t.ticks - 1) / 2) * R.tickGap, s = o.x + i * r, c = o.y + a * r;
101
- e.moveTo(s - a * R.tickHalf, c + i * R.tickHalf), e.lineTo(s + a * R.tickHalf, c - i * R.tickHalf);
95
+ function we(t, n, r) {
96
+ let i = Math.hypot(n.x2 - n.x1, n.y2 - n.y1), [a, o] = i > 0 ? [(n.x2 - n.x1) / i, (n.y2 - n.y1) / i] : [1, 0], c = e(n, .5);
97
+ t.beginPath();
98
+ for (let e = 0; e < n.ticks; e++) {
99
+ let r = (e - (n.ticks - 1) / 2) * s.tickGap, i = c.x + a * r, l = c.y + o * r;
100
+ t.moveTo(i - o * s.tickHalf, l + a * s.tickHalf), t.lineTo(i + o * s.tickHalf, l - a * s.tickHalf);
102
101
  }
103
- e.strokeStyle = t.color, e.lineWidth = Math.max(R.tickWidth, 1.5 / n), e.setLineDash([]), e.stroke();
102
+ t.strokeStyle = n.color, t.lineWidth = Math.max(s.tickWidth, 1.5 / r), t.setLineDash([]), t.stroke();
104
103
  }
105
- function Ae(e, t, n, r) {
106
- let i = w(t, n), { packet: a } = t;
107
- a.glow && a.glow * r >= Se && (e.beginPath(), e.arc(i.x, i.y, a.radius + a.glow * .5, 0, xe), e.globalAlpha = t.alpha * .3, e.fillStyle = a.glowColor || a.color, e.fill(), e.globalAlpha = t.alpha), e.beginPath(), e.arc(i.x, i.y, a.radius, 0, xe), e.fillStyle = a.color, e.fill();
104
+ function Te(e, t, n, r) {
105
+ let i = O(t, n), { packet: a } = t;
106
+ a.glow && a.glow * r >= _e && (e.beginPath(), e.arc(i.x, i.y, a.radius + a.glow * .5, 0, ge), e.globalAlpha = t.alpha * .3, e.fillStyle = a.glowColor || a.color, e.fill(), e.globalAlpha = t.alpha), e.beginPath(), e.arc(i.x, i.y, a.radius, 0, ge), e.fillStyle = a.color, e.fill();
108
107
  }
109
- function je(e, t, n, r) {
110
- e.save(), e.globalAlpha = t.alpha, Ae(e, t, n, r), e.restore();
108
+ function Ee(e, t, n, r) {
109
+ e.save(), e.globalAlpha = t.alpha, Te(e, t, n, r), e.restore();
111
110
  }
112
- var Me = 16, Ne = /* @__PURE__ */ new WeakMap();
113
- function Pe(e) {
114
- let t = Ne.get(e);
111
+ var De = 16, Oe = /* @__PURE__ */ new WeakMap();
112
+ function ke(e) {
113
+ let t = Oe.get(e);
115
114
  return t || (t = new Float64Array(e.edges.length * 4), e.edges.forEach((e, n) => {
116
- let r = e.curve ? e.curve.cx : e.x1, i = e.curve ? e.curve.cy : e.y1, a = (e.glow || 0) * .6 + (e.packet ? e.packet.radius + (e.packet.glow || 0) * .5 : 0), o = (e.width || 0) / 2 + a + Me;
115
+ let r = e.curve ? e.curve.cx : e.x1, i = e.curve ? e.curve.cy : e.y1, a = (e.glow || 0) * .6 + (e.packet ? e.packet.radius + (e.packet.glow || 0) * .5 : 0), o = (e.width || 0) / 2 + a + De;
117
116
  t[n * 4] = Math.min(e.x1, e.x2, r) - o, t[n * 4 + 1] = Math.min(e.y1, e.y2, i) - o, t[n * 4 + 2] = Math.max(e.x1, e.x2, r) + o, t[n * 4 + 3] = Math.max(e.y1, e.y2, i) + o;
118
- }), Ne.set(e, t)), t;
117
+ }), Oe.set(e, t)), t;
119
118
  }
120
- function Fe(e, t, n, r) {
121
- let i = Pe(e), a = t.zoom || 1, o = 4 / a, s = -t.x / a - o, c = -t.y / a - o, l = (n - t.x) / a + o, u = (r - t.y) / a + o, d = [];
119
+ function Ae(e, t, n, r) {
120
+ let i = ke(e), a = t.zoom || 1, o = 4 / a, s = -t.x / a - o, c = -t.y / a - o, l = (n - t.x) / a + o, u = (r - t.y) / a + o, d = [];
122
121
  for (let t = 0; t < e.edges.length; t++) i[t * 4 + 2] < s || i[t * 4] > l || i[t * 4 + 3] < c || i[t * 4 + 1] > u || d.push(e.edges[t]);
123
122
  return d;
124
123
  }
125
- function Ie(e, t, n, r, i) {
124
+ function je(e, t, n, r, a) {
126
125
  e.save(), e.globalAlpha = t.alpha;
127
- let a = r.halo[t.halo];
128
- a && (a.fill && (q(e, t.x, t.y, t.r + a.fillR), e.fillStyle = a.fill, e.fill()), q(e, t.x, t.y, t.r + a.ringR), e.strokeStyle = a.ring, e.lineWidth = a.ringWidth, e.stroke());
126
+ let o = r.halo[t.halo];
127
+ o && (o.fill && (J(e, t.x, t.y, t.r + o.fillR), e.fillStyle = o.fill, e.fill()), J(e, t.x, t.y, t.r + o.ringR), e.strokeStyle = o.ring, e.lineWidth = o.ringWidth, e.stroke());
129
128
  let s = r.mark[t.mark];
130
129
  if (s) {
131
- let r = t.r + Math.max(s.ringR, g.gap / n);
132
- q(e, t.x, t.y, r), e.strokeStyle = s.color, e.lineWidth = Math.max(s.ringWidth, g.ring / n), e.setLineDash(s.ringDash || []), e.stroke(), e.setLineDash([]), t.mark === "removed" && (e.beginPath(), e.moveTo(t.x - r, t.y), e.lineTo(t.x + r, t.y), e.stroke());
133
- }
134
- Ce(e, t.shape, t.x, t.y, t.r), t.glow && t.glow * n >= Se && (e.save(), e.globalAlpha = t.alpha * .28, q(e, t.x, t.y, t.r + t.glow * .7), e.fillStyle = t.color, e.fill(), e.restore(), Ce(e, t.shape, t.x, t.y, t.r)), e.fillStyle = t.color, e.fill();
135
- let c = t.icon && i.icons ? i.icons.get(t.icon) : null, l = !c && ve(t, n), u = !c && !l && H(t, n) ? E(t.glyph, D(t, i)) : null;
136
- if (u || (q(e, t.x, t.y, t.r * o), e.fillStyle = r.core, e.fill()), t.stroke && (Ce(e, t.shape, t.x, t.y, Math.max(0, t.r - t.stroke.width / 2)), e.strokeStyle = t.stroke.color, e.lineWidth = t.stroke.width, e.stroke()), c) {
137
- let n = t.r * de;
138
- e.imageSmoothingEnabled = !i.pixelated, e.drawImage(c, t.x - n / 2, t.y - n / 2, n, n);
139
- } else if (l) {
140
- let n = be(t.letters, i.values && i.values["--corn-map-glyph"]);
130
+ let r = t.r + Math.max(s.ringR, w.gap / n);
131
+ J(e, t.x, t.y, r), e.strokeStyle = s.color, e.lineWidth = Math.max(s.ringWidth, w.ring / n), e.setLineDash(s.ringDash || []), e.stroke(), e.setLineDash([]), t.mark === "removed" && (e.beginPath(), e.moveTo(t.x - r, t.y), e.lineTo(t.x + r, t.y), e.stroke());
132
+ }
133
+ ve(e, t.shape, t.x, t.y, t.r), t.glow && t.glow * n >= _e && (e.save(), e.globalAlpha = t.alpha * .28, J(e, t.x, t.y, t.r + t.glow * .7), e.fillStyle = t.color, e.fill(), e.restore(), ve(e, t.shape, t.x, t.y, t.r)), e.fillStyle = t.color, e.fill();
134
+ let c = t.icon && a.icons ? a.icons.get(t.icon) : null, u = !c && pe(t, n), d = !c && !u && i(t, n) ? oe(t.glyph, v(t, a)) : null;
135
+ if (d || (J(e, t.x, t.y, t.r * b), e.fillStyle = r.core, e.fill()), t.stroke && (ve(e, t.shape, t.x, t.y, Math.max(0, t.r - t.stroke.width / 2)), e.strokeStyle = t.stroke.color, e.lineWidth = t.stroke.width, e.stroke()), c) {
136
+ let n = t.r * l;
137
+ e.imageSmoothingEnabled = !a.pixelated, e.drawImage(c, t.x - n / 2, t.y - n / 2, n, n);
138
+ } else if (u) {
139
+ let n = he(t.letters, a.values && a.values["--corn-map-glyph"]);
141
140
  if (n) {
142
141
  let r = t.r * 1;
143
142
  e.imageSmoothingEnabled = !0, e.drawImage(n, t.x - r / 2, t.y - r / 2, r, r);
144
143
  }
145
- } else if (u) {
146
- let n = t.r * G;
147
- e.imageSmoothingEnabled = !0, e.drawImage(u, t.x - n / 2, t.y - n / 2, n, n);
144
+ } else if (d) {
145
+ let n = t.r * K;
146
+ e.imageSmoothingEnabled = !0, e.drawImage(d, t.x - n / 2, t.y - n / 2, n, n);
148
147
  }
149
148
  e.restore();
150
149
  }
151
- function Le(e, t = {}) {
152
- let n = t.mapStyle || (() => x), r = e.getContext("2d"), o = 0, s = 0, c = 1, l = null, u = null, d = null, f = () => {
153
- if (l) return l;
150
+ function Me(e, t = {}) {
151
+ let n = t.mapStyle || (() => d), r = e.getContext("2d"), i = 0, a = 0, o = 1, s = null, c = null, l = null, u = () => {
152
+ if (s) return s;
154
153
  try {
155
- l = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(e.width || 1, e.height || 1) : e.ownerDocument ? e.ownerDocument.createElement("canvas") : null, u = l && l.getContext ? l.getContext("2d") : null;
154
+ s = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(e.width || 1, e.height || 1) : e.ownerDocument ? e.ownerDocument.createElement("canvas") : null, c = s && s.getContext ? s.getContext("2d") : null;
156
155
  } catch {
157
- u = null;
156
+ c = null;
158
157
  }
159
- return u || (l = null), l;
160
- }, p = t.layerMinEdges ?? 600, m = /* @__PURE__ */ new WeakMap(), h = (e) => (m.has(e) || m.set(e, e.edges.some((e) => e.packet)), m.get(e));
161
- function g(e, t, n) {
158
+ return c || (s = null), s;
159
+ }, f = t.layerMinEdges ?? 600, p = /* @__PURE__ */ new WeakMap(), m = (e) => (p.has(e) || p.set(e, e.edges.some((e) => e.packet)), p.get(e));
160
+ function h(e, t, n) {
162
161
  e.save(), e.translate(n.x, n.y), e.scale(n.zoom, n.zoom);
163
162
  let { decor: r } = t;
164
- r.grid && we(e, r.grid, n, o, s), r.lanes.length && Ee(e, r.lanes), r.rings.length && Te(e, r.rings), Fe(t, n, o, s).forEach((t) => De(e, t, 0, n.zoom, !1)), e.restore();
163
+ r.grid && ye(e, r.grid, n, i, a), r.lanes.length && xe(e, r.lanes), r.rings.length && be(e, r.rings), Ae(t, n, i, a).forEach((t) => Se(e, t, 0, n.zoom, !1)), e.restore();
165
164
  }
166
165
  return {
167
166
  kind: "canvas2d",
168
- resize(t, n, i) {
169
- o = t, s = n, c = i, e.width = t * i, e.height = n * i, r.setTransform(i, 0, 0, i, 0, 0), d = null, l && (l.width = e.width, l.height = e.height, u.setTransform(i, 0, 0, i, 0, 0));
167
+ resize(t, n, u) {
168
+ i = t, a = n, o = u, e.width = t * u, e.height = n * u, r.setTransform(u, 0, 0, u, 0, 0), l = null, s && (s.width = e.width, s.height = e.height, c.setTransform(u, 0, 0, u, 0, 0));
170
169
  },
171
- draw(t, m, _) {
172
- let v = n(), y = S(t, v);
173
- r.clearRect(0, 0, o, s);
174
- let b = a(i(y.theme), v), x = Fe(y, m, o, s);
175
- if (h(y) && x.length > p && f()) {
176
- d && d.scene === y && d.x === m.x && d.y === m.y && d.zoom === m.zoom && d.w === e.width && d.h === e.height || ((l.width !== e.width || l.height !== e.height) && (l.width = e.width, l.height = e.height), u.setTransform(c, 0, 0, c, 0, 0), u.clearRect(0, 0, o, s), g(u, y, m), d = {
177
- scene: y,
178
- x: m.x,
179
- y: m.y,
180
- zoom: m.zoom,
170
+ draw(t, d, p) {
171
+ let g = n(), _ = x(t, g);
172
+ r.clearRect(0, 0, i, a);
173
+ let v = ce(P(_.theme), g), y = Ae(_, d, i, a);
174
+ if (m(_) && y.length > f && u()) {
175
+ l && l.scene === _ && l.x === d.x && l.y === d.y && l.zoom === d.zoom && l.w === e.width && l.h === e.height || ((s.width !== e.width || s.height !== e.height) && (s.width = e.width, s.height = e.height), c.setTransform(o, 0, 0, o, 0, 0), c.clearRect(0, 0, i, a), h(c, _, d), l = {
176
+ scene: _,
177
+ x: d.x,
178
+ y: d.y,
179
+ zoom: d.zoom,
181
180
  w: e.width,
182
181
  h: e.height
183
- }), r.save(), r.setTransform(1, 0, 0, 1, 0, 0), r.drawImage(l, 0, 0), r.restore(), r.save(), r.translate(m.x, m.y), r.scale(m.zoom, m.zoom), x.forEach((e) => {
184
- e.packet && je(r, e, _, m.zoom);
185
- }), y.nodes.forEach((e) => Ie(r, e, m.zoom, b, v)), r.restore();
182
+ }), r.save(), r.setTransform(1, 0, 0, 1, 0, 0), r.drawImage(s, 0, 0), r.restore(), r.save(), r.translate(d.x, d.y), r.scale(d.zoom, d.zoom), y.forEach((e) => {
183
+ e.packet && Ee(r, e, p, d.zoom);
184
+ }), _.nodes.forEach((e) => je(r, e, d.zoom, v, g)), r.restore();
186
185
  return;
187
186
  }
188
- r.save(), r.translate(m.x, m.y), r.scale(m.zoom, m.zoom);
189
- let { decor: C } = y;
190
- C.grid && we(r, C.grid, m, o, s), C.lanes.length && Ee(r, C.lanes), C.rings.length && Te(r, C.rings), x.forEach((e) => De(r, e, _, m.zoom)), y.nodes.forEach((e) => Ie(r, e, m.zoom, b, v)), r.restore();
187
+ r.save(), r.translate(d.x, d.y), r.scale(d.zoom, d.zoom);
188
+ let { decor: b } = _;
189
+ b.grid && ye(r, b.grid, d, i, a), b.lanes.length && xe(r, b.lanes), b.rings.length && be(r, b.rings), y.forEach((e) => Se(r, e, p, d.zoom)), _.nodes.forEach((e) => je(r, e, d.zoom, v, g)), r.restore();
191
190
  },
192
191
  destroy() {
193
- l = null, u = null, d = null;
192
+ s = null, c = null, l = null;
194
193
  }
195
194
  };
196
195
  }
197
- var Re = (e) => typeof e.hitR == "number" && e.hitR > e.r ? e.hitR : e.r;
198
- function ze(e, { cellSize: t = 64 } = {}) {
196
+ var Ne = (e) => typeof e.hitR == "number" && e.hitR > e.r ? e.hitR : e.r;
197
+ function Pe(e, { cellSize: t = 64 } = {}) {
199
198
  let n = /* @__PURE__ */ new Map(), r = 0, i = (e, t) => e * 4194304 + t;
200
199
  for (let a = 0; a < e.length; a++) {
201
200
  let o = e[a];
202
- Re(o) > r && (r = Re(o));
201
+ Ne(o) > r && (r = Ne(o));
203
202
  let s = i(Math.floor(o.x / t), Math.floor(o.y / t)), c = n.get(s);
204
203
  c ? c.push(a) : n.set(s, [a]);
205
204
  }
@@ -215,7 +214,7 @@ function ze(e, { cellSize: t = 64 } = {}) {
215
214
  if (a) for (let t = 0; t < a.length; t++) {
216
215
  let n = a[t];
217
216
  if (n <= _) continue;
218
- let r = e[n], i = Math.max(Re(r) + u, d);
217
+ let r = e[n], i = Math.max(Ne(r) + u, d);
219
218
  Math.hypot(r.x - s, r.y - c) <= i && (_ = n);
220
219
  }
221
220
  }
@@ -228,32 +227,32 @@ function ze(e, { cellSize: t = 64 } = {}) {
228
227
  let a = n.get(i(t, r));
229
228
  if (a) for (let t = 0; t < a.length; t++) {
230
229
  let n = a[t], r = e[n], i = r.x - Math.min(Math.max(r.x, o), c), u = r.y - Math.min(Math.max(r.y, s), l);
231
- i * i + u * u <= Re(r) ** 2 && m.push(n);
230
+ i * i + u * u <= Ne(r) ** 2 && m.push(n);
232
231
  }
233
232
  }
234
233
  return m.sort((e, t) => e - t).map((t) => e[t]);
235
234
  }
236
235
  };
237
236
  }
238
- function Be(e, t, n, r, i = !1) {
237
+ function Fe(e, t, n, r, i = !1) {
239
238
  let a = t.zoom;
240
239
  return e.nodeAt((n - t.x) / a, (r - t.y) / a, {
241
240
  pad: (i ? 16 : 6) / a,
242
241
  min: (i ? 32 : 12) / a
243
242
  });
244
243
  }
245
- function Ve(e) {
244
+ function Ie(e) {
246
245
  let t = null, n = null, r = {
247
246
  builds: 0,
248
247
  get(i) {
249
- return n && t === i || (n = ze(i.nodes, e), t = i, r.builds++), n;
248
+ return n && t === i || (n = Pe(i.nodes, e), t = i, r.builds++), n;
250
249
  }
251
250
  };
252
251
  return r;
253
252
  }
254
253
  // ../explorer/frame.js
255
- var He = 3e4;
256
- function Ue({ dirty: e, packetsVisible: t, hidden: n, reduceMotion: r, idleMs: i, clientsWant: a = !1 }) {
254
+ var Le = 3e4;
255
+ function Re({ dirty: e, packetsVisible: t, hidden: n, reduceMotion: r, idleMs: i, clientsWant: a = !1 }) {
257
256
  if (n) return {
258
257
  draw: !1,
259
258
  again: !1
@@ -264,8 +263,8 @@ function Ue({ dirty: e, packetsVisible: t, hidden: n, reduceMotion: r, idleMs: i
264
263
  again: o
265
264
  };
266
265
  }
267
- function We(e, t, n, r) {
268
- let i = Ke(e);
266
+ function ze(e, t, n, r) {
267
+ let i = Ve(e);
269
268
  if (i.length === 0) return !1;
270
269
  if (!(n > 0) || !(r > 0)) return !0;
271
270
  let a = -t.x / t.zoom, o = -t.y / t.zoom, s = (n - t.x) / t.zoom, c = (r - t.y) / t.zoom;
@@ -275,12 +274,12 @@ function We(e, t, n, r) {
275
274
  }
276
275
  return !1;
277
276
  }
278
- var Ge = /* @__PURE__ */ new WeakMap();
279
- function Ke(e) {
280
- let t = Ge.get(e);
281
- return t || (t = e.edges.filter((e) => e.packet), Ge.set(e, t)), t;
277
+ var Be = /* @__PURE__ */ new WeakMap();
278
+ function Ve(e) {
279
+ let t = Be.get(e);
280
+ return t || (t = e.edges.filter((e) => e.packet), Be.set(e, t)), t;
282
281
  }
283
- function qe(e) {
282
+ function He(e) {
284
283
  let { draw: t, packetsVisible: n, isHidden: r, reduceMotion: i, extraDirty: a, tickClients: o, clientsWant: s, now: c, raf: l, caf: u } = e, d = !0, f = null, p = -Infinity, m = c(), h = !1, g = /* @__PURE__ */ new Set(), _ = () => {
285
284
  if (g.size === 0) return;
286
285
  let e = [...g];
@@ -293,7 +292,7 @@ function qe(e) {
293
292
  let n = o && !r() ? o(e) : !1, i = d || (a ? a() : !1), { draw: s, again: c } = b(i, n);
294
293
  s && (i || e - p >= 31) && (d = !1, p = e, x.draws++, t()), x.frames++, c && v();
295
294
  }
296
- let b = (e, t) => Ue({
295
+ let b = (e, t) => Re({
297
296
  dirty: e,
298
297
  packetsVisible: n(),
299
298
  hidden: r(),
@@ -313,7 +312,7 @@ function qe(e) {
313
312
  v();
314
313
  },
315
314
  noteInput() {
316
- let e = c(), t = e - m >= He;
315
+ let e = c(), t = e - m >= Le;
317
316
  m = e, t && v();
318
317
  },
319
318
  shown() {
@@ -336,7 +335,7 @@ function qe(e) {
336
335
  };
337
336
  return x;
338
337
  }
339
- var Je = 1, Ye = .3, Xe = .58, Ze = 3, Qe = 100, J = 64, Y = {
338
+ var Ue = 1, We = .3, Ge = .58, Ke = 3, qe = 100, Y = 64, X = {
340
339
  selected: 0,
341
340
  current: 1,
342
341
  match: 2,
@@ -345,19 +344,19 @@ var Je = 1, Ye = .3, Xe = .58, Ze = 3, Qe = 100, J = 64, Y = {
345
344
  hub: 5,
346
345
  rest: 6,
347
346
  greyed: 7
348
- }, $e = 1.5, et = (e) => Number.isFinite(e) && e >= 9 ? Math.max(11, e) : 11, tt = (e) => et(e.labelMin), nt = (e) => h.includes(e.type) && !e.greyed, rt = (e, t) => e.selected ? Y.selected : e.current ? Y.current : e.match ? Y.match : t && e.connected ? Y.lit : e.mark && e.mark !== "none" || e.labelKeep && !nt(e) ? Y.marked : e.greyed ? Y.greyed : nt(e) ? Y.hub : Y.rest;
349
- function it(e, t, n = {}) {
350
- let { measure: r = null } = n, i = tt(e), a = e.nodes.some((e) => e.selected || !e.connected), o = [];
347
+ }, Je = 1.5, Ye = (e) => Number.isFinite(e) && e >= 9 ? Math.max(11, e) : 11, Xe = (e) => Ye(e.labelMin), Ze = (e) => u.includes(e.type) && !e.greyed, Qe = (e, t) => e.selected ? X.selected : e.current ? X.current : e.match ? X.match : t && e.connected ? X.lit : e.mark && e.mark !== "none" || e.labelKeep && !Ze(e) ? X.marked : e.greyed ? X.greyed : Ze(e) ? X.hub : X.rest;
348
+ function $e(e, t, n = {}) {
349
+ let { measure: r = null } = n, i = Xe(e), a = e.nodes.some((e) => e.selected || !e.connected), o = [];
351
350
  e.nodes.forEach((e, t) => {
352
351
  e.label && e.labelAlpha >= .15 && o.push({
353
352
  node: e,
354
353
  index: t,
355
- tier: rt(e, a)
354
+ tier: Qe(e, a)
356
355
  });
357
356
  }), o.sort((e, t) => e.tier - t.tier || t.node.r - e.node.r || (t.node.degree || 0) - (e.node.degree || 0) || e.index - t.index);
358
- let s = /* @__PURE__ */ new Map(), c = (e, t) => (e + 8192) * 16384 + (t + 8192), l = [], u = Math.max(Ze, Ze * t);
357
+ let s = /* @__PURE__ */ new Map(), c = (e, t) => (e + 8192) * 16384 + (t + 8192), l = [], u = Math.max(Ke, Ke * t);
359
358
  for (let { node: e, index: n, tier: a } of o) {
360
- let o = nt(e), d = !e.greyed && (!!e.labelBold || o), f = Math.max(o ? i + 2 : i, e.labelSize * t), p = r ? r(e.label, Qe, d) * f / Qe : e.label.length * f * Xe, m = e.x * t, h = e.y * t + e.r * t + u + f, g = m - p / 2, _ = m + p / 2, v = h - f * Je, y = h + f * Ye, b = a === Y.greyed ? 2 + f * $e : 2, x = Math.floor((g - b) / J), S = Math.floor((_ + b) / J), C = Math.floor((v - b) / J), w = Math.floor((y + b) / J), T = !1;
359
+ let o = Ze(e), d = !e.greyed && (!!e.labelBold || o), f = Math.max(o ? i + 2 : i, e.labelSize * t), p = r ? r(e.label, qe, d) * f / qe : e.label.length * f * Ge, m = e.x * t, h = e.y * t + e.r * t + u + f, g = m - p / 2, _ = m + p / 2, v = h - f * Ue, y = h + f * We, b = a === X.greyed ? 2 + f * Je : 2, x = Math.floor((g - b) / Y), S = Math.floor((_ + b) / Y), C = Math.floor((v - b) / Y), w = Math.floor((y + b) / Y), T = !1;
361
360
  for (let e = x; e <= S && !T; e++) for (let t = C; t <= w && !T; t++) {
362
361
  let n = s.get(c(e, t));
363
362
  if (n) for (let e = 0; e < n.length; e++) {
@@ -387,7 +386,7 @@ function it(e, t, n = {}) {
387
386
  b: y
388
387
  };
389
388
  l.push(E);
390
- let D = Math.floor(g / J), O = Math.floor(_ / J), k = Math.floor(v / J), A = Math.floor(y / J);
389
+ let D = Math.floor(g / Y), O = Math.floor(_ / Y), k = Math.floor(v / Y), A = Math.floor(y / Y);
391
390
  for (let e = D; e <= O; e++) for (let t = k; t <= A; t++) {
392
391
  let n = c(e, t), r = s.get(n);
393
392
  r ? r.push(E) : s.set(n, [E]);
@@ -395,13 +394,13 @@ function it(e, t, n = {}) {
395
394
  }
396
395
  return l;
397
396
  }
398
- function at(e, t, n, r = {}) {
399
- let { max: a = 400, margin: o = 32, measure: s = null, hover: c = null } = r, l = [], u = e.labelOutline || i(e.theme).labelOutline;
397
+ function et(e, t, n, r = {}) {
398
+ let { max: i = 400, margin: a = 32, measure: o = null, hover: s = null } = r, c = [], l = e.labelOutline || P(e.theme).labelOutline;
400
399
  for (let t of e.decor.lanes) for (let n of [
401
400
  t.title,
402
401
  t.note,
403
402
  t.arrow
404
- ]) n && l.push({
403
+ ]) n && c.push({
405
404
  kind: "lane",
406
405
  text: n.text,
407
406
  x: n.x,
@@ -415,12 +414,12 @@ function at(e, t, n, r = {}) {
415
414
  align: "center",
416
415
  family: e.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif"
417
416
  });
418
- let { zoom: d } = t, f = r.placed || it(e, d, { measure: s }), p = -o - t.x, m = n.width + o - t.x, h = -o - t.y, g = n.height + o - t.y, _ = f.filter((e) => e.r >= p && e.l <= m && e.b >= h && e.t <= g);
419
- _.length > a && (_ = _.slice(0, Math.max(0, a))), _.sort((e, t) => e.index - t.index);
420
- let v = e.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif";
421
- for (let e of _) {
422
- let t = Math.max(1, 1 / d);
423
- l.push({
417
+ let { zoom: u } = t, d = r.placed || $e(e, u, { measure: o }), f = -a - t.x, p = n.width + a - t.x, m = -a - t.y, h = n.height + a - t.y, g = d.filter((e) => e.r >= f && e.l <= p && e.b >= m && e.t <= h);
418
+ g.length > i && (g = g.slice(0, Math.max(0, i))), g.sort((e, t) => e.index - t.index);
419
+ let _ = e.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif";
420
+ for (let e of g) {
421
+ let t = Math.max(1, 1 / u);
422
+ c.push({
424
423
  kind: "node",
425
424
  id: e.id,
426
425
  text: e.node.label,
@@ -431,18 +430,18 @@ function at(e, t, n, r = {}) {
431
430
  italic: !1,
432
431
  color: e.node.labelColor,
433
432
  alpha: e.node.labelAlpha,
434
- outline: u.node ? {
435
- color: u.node.color,
436
- width: u.node.width * t
433
+ outline: l.node ? {
434
+ color: l.node.color,
435
+ width: l.node.width * t
437
436
  } : null,
438
437
  align: "center",
439
- family: v,
438
+ family: _,
440
439
  strike: !!e.node.labelStrike,
441
440
  px: e.px,
442
441
  screen: e.screen
443
442
  });
444
443
  }
445
- let y = tt(e), b = _.map((e) => ({
444
+ let v = Xe(e), y = g.map((e) => ({
446
445
  l: t.x + e.l,
447
446
  r: t.x + e.r,
448
447
  t: t.y + e.t,
@@ -450,80 +449,80 @@ function at(e, t, n, r = {}) {
450
449
  }));
451
450
  for (let r of e.nodes) {
452
451
  if (r.alpha < .5) continue;
453
- let e = t.x + r.x * d, i = t.y + r.y * d, a = r.r * d;
454
- e + a < 0 || e - a > n.width || i + a < 0 || i - a > n.height || b.push({
452
+ let e = t.x + r.x * u, i = t.y + r.y * u, a = r.r * u;
453
+ e + a < 0 || e - a > n.width || i + a < 0 || i - a > n.height || y.push({
455
454
  l: e - a,
456
455
  r: e + a,
457
456
  t: i - a,
458
457
  b: i + a
459
458
  });
460
459
  }
461
- let x = 0;
460
+ let b = 0;
462
461
  for (let r of e.edges) {
463
462
  let i = r.label;
464
- if (!i || x >= 120) continue;
465
- let a = t.x + i.x * d, o = t.y + i.y * d;
466
- if (a < 0 || a > n.width || o < 0 || o > n.height) continue;
467
- let c = (s ? s(i.text, y, !1) : i.text.length * y * .55) / 2 + 2, f = {
468
- l: a - c,
469
- r: a + c,
470
- t: o - y * .6 - 2,
471
- b: o + y * .6 + 2
463
+ if (!i || b >= 120) continue;
464
+ let a = t.x + i.x * u, s = t.y + i.y * u;
465
+ if (a < 0 || a > n.width || s < 0 || s > n.height) continue;
466
+ let d = (o ? o(i.text, v, !1) : i.text.length * v * .55) / 2 + 2, f = {
467
+ l: a - d,
468
+ r: a + d,
469
+ t: s - v * .6 - 2,
470
+ b: s + v * .6 + 2
472
471
  };
473
- b.some((e) => f.l < e.r && f.r > e.l && f.t < e.b && f.b > e.t) || (b.push(f), x++, l.push({
472
+ y.some((e) => f.l < e.r && f.r > e.l && f.t < e.b && f.b > e.t) || (y.push(f), b++, c.push({
474
473
  kind: "edge",
475
474
  text: i.text,
476
475
  x: i.x,
477
- y: i.y + y * .35 / d,
478
- size: y / d,
479
- px: y,
476
+ y: i.y + v * .35 / u,
477
+ size: v / u,
478
+ px: v,
480
479
  screen: !0,
481
480
  bold: !1,
482
481
  italic: !!i.italic,
483
482
  color: i.color,
484
483
  alpha: r.alpha,
485
- outline: u.edge,
484
+ outline: l.edge,
486
485
  align: "center",
487
486
  family: e.labelFont || "\"Segoe UI\", -apple-system, sans-serif"
488
487
  }));
489
488
  }
490
- if (c) {
491
- let n = e.nodes.find((e) => e.id === c);
492
- if (n && n.label && !f.some((e) => e.id === c && _.includes(e))) {
493
- let r = tt(e), i = t.y + n.y * d - n.r * d > 40 ? n.y - n.r - 5 / d : n.y + n.r + (5 + r) / d;
494
- l.push({
489
+ if (s) {
490
+ let n = e.nodes.find((e) => e.id === s);
491
+ if (n && n.label && !d.some((e) => e.id === s && g.includes(e))) {
492
+ let r = Xe(e), i = t.y + n.y * u - n.r * u > 40 ? n.y - n.r - 5 / u : n.y + n.r + (5 + r) / u;
493
+ c.push({
495
494
  kind: "chip",
496
495
  id: n.id,
497
496
  text: n.label,
498
497
  x: n.x,
499
498
  y: i,
500
- size: r / d,
499
+ size: r / u,
501
500
  px: r,
502
501
  screen: !0,
503
502
  bold: !1,
504
503
  italic: !1,
505
504
  color: (e.nodes.find((e) => e.connected) || n).labelColor,
506
505
  alpha: 1,
507
- outline: u.node,
506
+ outline: l.node,
508
507
  align: "center",
509
- family: v,
508
+ family: _,
510
509
  strike: !1
511
510
  });
512
511
  }
513
512
  }
514
- return l;
513
+ return c;
515
514
  }
516
- var ot = (e) => `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${e.screen ? e.px : e.size}px ${e.family}`, st = {
515
+ var tt = (e) => `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${e.screen ? e.px : e.size}px ${e.family}`, nt = {
517
516
  ox: 0,
518
517
  oy: 0,
519
518
  k: 1
520
519
  };
521
- function ct(e, t, n) {
522
- e.font = ot(t);
523
- let r = e.measureText(t.text).width + 8, i = t.px * 1.3 + 4, a = n.ox + t.x * n.k, o = n.oy + t.y * n.k, s = a - r / 2, c = o - t.px * Je - 2;
520
+ function rt(e, t, n) {
521
+ e.font = tt(t);
522
+ let r = e.measureText(t.text).width + 8, i = t.px * 1.3 + 4, a = n.ox + t.x * n.k, o = n.oy + t.y * n.k, s = a - r / 2, c = o - t.px * Ue - 2;
524
523
  e.globalAlpha = 1, e.beginPath(), e.roundRect ? e.roundRect(s, c, r, i, 4) : e.rect(s, c, r, i), e.fillStyle = t.outline ? t.outline.color : "rgba(9, 13, 22, 0.95)", e.fill(), e.lineWidth = 1, e.strokeStyle = t.color, e.stroke(), e.textAlign = t.align, e.fillStyle = t.color, e.fillText(t.text, a, o);
525
524
  }
526
- function lt() {
525
+ function it() {
527
526
  return {
528
527
  font: "",
529
528
  alpha: -1,
@@ -533,13 +532,13 @@ function lt() {
533
532
  align: ""
534
533
  };
535
534
  }
536
- function ut(e, t, n, r = st) {
535
+ function at(e, t, n, r = nt) {
537
536
  if (t.kind === "chip") {
538
- ct(e, t, r);
537
+ rt(e, t, r);
539
538
  return;
540
539
  }
541
540
  n.alpha !== t.alpha && (e.globalAlpha = t.alpha, n.alpha = t.alpha);
542
- let i = ot(t);
541
+ let i = tt(t);
543
542
  n.font !== i && (e.font = i, n.font = i), n.align !== t.align && (e.textAlign = t.align, n.align = t.align);
544
543
  let a = r.ox + t.x * r.k, o = r.oy + t.y * r.k;
545
544
  if (t.outline) {
@@ -552,69 +551,69 @@ function ut(e, t, n, r = st) {
552
551
  e.beginPath(), e.moveTo(a - i, o - s * .32), e.lineTo(a + i, o - s * .32), e.strokeStyle = t.color, e.lineWidth = 1.4, e.stroke(), n.stroke = t.color, n.width = 1.4;
553
552
  }
554
553
  }
555
- function dt(e, t, n, r) {
554
+ function ot(e, t, n, r) {
556
555
  let i = null;
557
556
  for (let a of e) n >= t.x + a.l && n <= t.x + a.r && r >= t.y + a.t && r <= t.y + a.b && (!i || a.index > i.index) && (i = a);
558
557
  return i ? i.id : null;
559
558
  }
560
- function ft(e, t = {}) {
561
- let n = t.mapStyle || (() => x), r = e.getContext("2d"), i = 0, a = 0, o = 1, s = null, c, l, u, d, f, p, m = null, h = !0, g = !1, _ = /* @__PURE__ */ new Map(), v = L, y = (e, t, n) => {
562
- let i = `${n ? "b" : "n"}${t}|${v}|${e}`, a = _.get(i);
563
- return a === void 0 && (_.size > 2e4 && _.clear(), r.font = ot({
559
+ function st(e, t = {}) {
560
+ let n = t.mapStyle || (() => d), r = e.getContext("2d"), i = 0, a = 0, o = 1, s = null, c, l, u, f, p, m, h = null, g = !0, _ = !1, v = /* @__PURE__ */ new Map(), y = V, b = (e, t, n) => {
561
+ let i = `${n ? "b" : "n"}${t}|${y}|${e}`, a = v.get(i);
562
+ return a === void 0 && (v.size > 2e4 && v.clear(), r.font = tt({
564
563
  italic: !1,
565
564
  bold: n,
566
565
  size: t,
567
- family: v
568
- }), a = r.measureText(e).width, _.set(i, a)), a;
566
+ family: y
567
+ }), a = r.measureText(e).width, v.set(i, a)), a;
569
568
  };
570
569
  return {
571
570
  hit(e, t) {
572
- return m && s ? dt(m, {
571
+ return h && s ? ot(h, {
573
572
  x: l,
574
573
  y: u,
575
- zoom: d
574
+ zoom: f
576
575
  }, e, t) : null;
577
576
  },
578
577
  resize(t, n, s) {
579
- i = t, a = n, o = s, e.width = t * s, e.height = n * s, r.setTransform(s, 0, 0, s, 0, 0), h = !0;
578
+ i = t, a = n, o = s, e.width = t * s, e.height = n * s, r.setTransform(s, 0, 0, s, 0, 0), g = !0;
580
579
  },
581
- draw(e, t, _ = {}) {
582
- if (g) return !1;
583
- let b = n(), x = b.plain ? 0 : b.version, C = _.hover || null;
584
- if (!h && e === s && e.version === c && t.x === l && t.y === u && t.zoom === d && x === f && C === p) return !1;
585
- let w = m && e === s && e.version === c && t.zoom === d && x === f && !h;
586
- s = e, c = e.version, l = t.x, u = t.y, d = t.zoom, f = x, p = C, h = !1;
587
- let T = S(e, b);
588
- v = T.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif", r.setTransform(o, 0, 0, o, 0, 0), r.clearRect(0, 0, i, a), r.save(), r.translate(t.x, t.y), r.scale(t.zoom, t.zoom), w || (m = it(T, t.zoom, { measure: y }));
589
- let E = at(T, t, {
580
+ draw(e, t, d = {}) {
581
+ if (_) return !1;
582
+ let v = n(), S = v.plain ? 0 : v.version, C = d.hover || null;
583
+ if (!g && e === s && e.version === c && t.x === l && t.y === u && t.zoom === f && S === p && C === m) return !1;
584
+ let w = h && e === s && e.version === c && t.zoom === f && S === p && !g;
585
+ s = e, c = e.version, l = t.x, u = t.y, f = t.zoom, p = S, m = C, g = !1;
586
+ let T = x(e, v);
587
+ y = T.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif", r.setTransform(o, 0, 0, o, 0, 0), r.clearRect(0, 0, i, a), r.save(), r.translate(t.x, t.y), r.scale(t.zoom, t.zoom), w || (h = $e(T, t.zoom, { measure: b }));
588
+ let E = et(T, t, {
590
589
  width: i,
591
590
  height: a
592
591
  }, {
593
- measure: y,
592
+ measure: b,
594
593
  hover: C,
595
- placed: m
596
- }), D = lt();
597
- for (let e of E) e.kind === "lane" && ut(r, e, D);
598
- for (let e of E) e.kind === "node" && !e.screen && ut(r, e, D);
594
+ placed: h
595
+ }), D = it();
596
+ for (let e of E) e.kind === "lane" && at(r, e, D);
597
+ for (let e of E) e.kind === "node" && !e.screen && at(r, e, D);
599
598
  r.restore();
600
599
  let O = {
601
600
  ox: t.x,
602
601
  oy: t.y,
603
602
  k: t.zoom
604
603
  };
605
- D = lt();
606
- for (let e of E) e.kind === "node" && e.screen && ut(r, e, D, O);
607
- for (let e of E) e.kind === "edge" && ut(r, e, D, O);
608
- for (let e of E) e.kind === "chip" && ut(r, e, D, O);
604
+ D = it();
605
+ for (let e of E) e.kind === "node" && e.screen && at(r, e, D, O);
606
+ for (let e of E) e.kind === "edge" && at(r, e, D, O);
607
+ for (let e of E) e.kind === "chip" && at(r, e, D, O);
609
608
  return !0;
610
609
  },
611
610
  destroy() {
612
- g = !0, s = null, m = null, _.clear(), r.setTransform(1, 0, 0, 1, 0, 0), r.clearRect(0, 0, i, a);
611
+ _ = !0, s = null, h = null, v.clear(), r.setTransform(1, 0, 0, 1, 0, 0), r.clearRect(0, 0, i, a);
613
612
  }
614
613
  };
615
614
  }
616
615
  // ../explorer/engine/render.js
617
- var pt = [
616
+ var ct = [
618
617
  "pointerdown",
619
618
  "pointermove",
620
619
  "mousedown",
@@ -624,50 +623,50 @@ var pt = [
624
623
  "touchmove",
625
624
  "keydown"
626
625
  ];
627
- function mt(e, t = {}) {
626
+ function lt(e, t = {}) {
628
627
  if (e.map) return e.map;
629
- let { state: n } = e, r = t.measureCovered || (() => n.coveredBottom || 0), i = ue(e).get, a = !1, o = (e) => pe(n, e), s = (e) => pe(n, e, { viewer: !0 }), l = (t, r = e.viewEdges(), i = {
630
- throughChildren: !!n.throughChildren,
631
- kind: n.selectedKind || null
632
- }) => b(t, r, i), f = d((t) => c(t, { reduceMotion: e.reducedMotion })), p = () => f.get(n), m = () => f.builds, h = Ve(), g = () => h.get(p()), _ = () => h.builds, v = null, y = null;
633
- function x() {
634
- return v && y === n.canvas || (v && v.destroy(), v = Le(n.canvas, { mapStyle: i }), y = n.canvas, n.width && v.resize(n.width, n.height, e.dpr())), v;
635
- }
636
- let S = null, w = null;
637
- function T() {
638
- return n.labelCanvas ? (S && w === n.labelCanvas || (S && S.destroy(), S = ft(n.labelCanvas, { mapStyle: i }), w = n.labelCanvas, n.width && S.resize(n.width, n.height, e.dpr())), S) : null;
639
- }
640
- function E(t) {
641
- v && v !== t && v.destroy(), v = t, y = n.canvas, n.width && v.resize(n.width, n.height, e.dpr()), V();
642
- }
643
- function D() {
644
- let { canvas: t } = n;
645
- n.width = t.parentElement.clientWidth, n.height = t.parentElement.clientHeight, x().resize(n.width, n.height, e.dpr());
646
- let r = T();
647
- r && r.resize(n.width, n.height, e.dpr()), V();
648
- }
649
- function O() {
650
- let t = n.canvas && n.canvas.parentElement, r = e.win && e.win.ResizeObserver;
651
- if (!t || !r) return () => {};
652
- let i = new r(() => {
653
- n.canvas && (t.clientWidth !== n.width || t.clientHeight !== n.height) && D();
628
+ let { state: r } = e, i = t.measureCovered || (() => r.coveredBottom || 0), a = n(e).get, o = !1, s = (e) => H(r, e), c = (e) => H(r, e, { viewer: !0 }), l = (t, n = e.viewEdges(), i = {
629
+ throughChildren: !!r.throughChildren,
630
+ kind: r.selectedKind || null
631
+ }) => U(t, n, i), u = g((t) => T(t, { reduceMotion: e.reducedMotion })), d = () => u.get(r), f = () => u.builds, p = Ie(), m = () => p.get(d()), h = () => p.builds, _ = null, v = null;
632
+ function y() {
633
+ return _ && v === r.canvas || (_ && _.destroy(), _ = Me(r.canvas, { mapStyle: a }), v = r.canvas, r.width && _.resize(r.width, r.height, e.dpr())), _;
634
+ }
635
+ let b = null, x = null;
636
+ function S() {
637
+ return r.labelCanvas ? (b && x === r.labelCanvas || (b && b.destroy(), b = st(r.labelCanvas, { mapStyle: a }), x = r.labelCanvas, r.width && b.resize(r.width, r.height, e.dpr())), b) : null;
638
+ }
639
+ function C(t) {
640
+ _ && _ !== t && _.destroy(), _ = t, v = r.canvas, r.width && _.resize(r.width, r.height, e.dpr()), V();
641
+ }
642
+ function w() {
643
+ let { canvas: t } = r;
644
+ r.width = t.parentElement.clientWidth, r.height = t.parentElement.clientHeight, y().resize(r.width, r.height, e.dpr());
645
+ let n = S();
646
+ n && n.resize(r.width, r.height, e.dpr()), V();
647
+ }
648
+ function E() {
649
+ let t = r.canvas && r.canvas.parentElement, n = e.win && e.win.ResizeObserver;
650
+ if (!t || !n) return () => {};
651
+ let i = new n(() => {
652
+ r.canvas && (t.clientWidth !== r.width || t.clientHeight !== r.height) && w();
654
653
  });
655
654
  i.observe(t);
656
655
  let a = () => i.disconnect();
657
656
  return e.own(a), a;
658
657
  }
659
- function k(e, t = null) {
660
- let { nodes: i, width: a, height: s } = n, c = i.filter(o);
658
+ function D(e, t = null) {
659
+ let { nodes: n, width: a, height: o } = r, c = n.filter(s);
661
660
  if (t) {
662
661
  let e = c.filter((e) => t.has(e.id));
663
662
  e.length && (c = e);
664
663
  }
665
664
  if (c.length === 0) return null;
666
- let l = Math.max(160, s - r()), u = Infinity, d = -Infinity, f = Infinity, p = -Infinity;
665
+ let l = Math.max(160, o - i()), u = Infinity, d = -Infinity, f = Infinity, p = -Infinity;
667
666
  c.forEach((e) => {
668
667
  let t = e.r || 18;
669
668
  u = Math.min(u, e.x - t - 25), d = Math.max(d, e.x + t + 25), f = Math.min(f, e.y - t - 25), p = Math.max(p, e.y + t + 35);
670
- }), n.view === "dataflow" && n.flow && (f = Math.min(f, n.flow.top - 10)), n.view === "house" && n.house && n.house.fit && !t && ({minX: u, maxX: d, minY: f, maxY: p} = n.house.fit);
669
+ }), r.view === "dataflow" && r.flow && (f = Math.min(f, r.flow.top - 10)), r.view === "house" && r.house && r.house.fit && !t && ({minX: u, maxX: d, minY: f, maxY: p} = r.house.fit);
671
670
  let m = Math.max(160, a - e * 2), h = Math.max(160, l - e * 2), g = Math.min(m / (d - u), h / (p - f));
672
671
  return {
673
672
  minX: u,
@@ -678,47 +677,47 @@ function mt(e, t = {}) {
678
677
  raw: g
679
678
  };
680
679
  }
681
- let A = "", j = C;
682
- function M() {
683
- let e = `${n.sceneVersion}|${n.width}|${n.height}|${n.view}|${r()}`;
684
- if (e !== A) {
685
- A = e;
686
- let t = k(P());
687
- j = t && t.raw > 0 && Number.isFinite(t.raw) ? Math.max(u, Math.min(C, t.raw)) : C;
680
+ let O = "", k = W;
681
+ function A() {
682
+ let e = `${r.sceneVersion}|${r.width}|${r.height}|${r.view}|${i()}`;
683
+ if (e !== O) {
684
+ O = e;
685
+ let t = D(j());
686
+ k = t && t.raw > 0 && Number.isFinite(t.raw) ? Math.max(L, Math.min(W, t.raw)) : W;
688
687
  }
689
- return j;
688
+ return k;
690
689
  }
691
- function N(e = 40, t = null) {
692
- let { width: r, camera: i } = n, a = k(e, t);
690
+ function ee(e = 40, t = null) {
691
+ let { width: n, camera: i } = r, a = D(e, t);
693
692
  if (!a) return;
694
- let { minX: o, maxX: s, minY: c, maxY: l, mapHeight: d } = a, f = Math.min(1, Math.max(u, a.raw));
695
- i.zoom = f, i.x = r / 2 - (o + s) / 2 * f, i.y = d / 2 - (c + l) / 2 * f, V();
696
- }
697
- let P = () => n.width < 640 ? 24 : 48, F = (e, t) => ({
698
- x: (e - n.camera.x) / n.camera.zoom,
699
- y: (t - n.camera.y) / n.camera.zoom
700
- }), I = -1;
701
- function ee() {
702
- if (!n.canvas) return;
703
- let e = p();
704
- I = e.version, x().draw(e, n.camera, performance.now());
705
- let t = T();
706
- t && t.draw(e, n.camera, { hover: n.hoverNodeId }), R.forEach((t) => t(e, n.camera));
707
- }
708
- function te(e, t) {
709
- let n = T();
693
+ let { minX: o, maxX: s, minY: c, maxY: l, mapHeight: u } = a, d = Math.min(1, Math.max(L, a.raw));
694
+ i.zoom = d, i.x = n / 2 - (o + s) / 2 * d, i.y = u / 2 - (c + l) / 2 * d, V();
695
+ }
696
+ let j = () => r.width < 640 ? 24 : 48, M = (e, t) => ({
697
+ x: (e - r.camera.x) / r.camera.zoom,
698
+ y: (t - r.camera.y) / r.camera.zoom
699
+ }), N = -1;
700
+ function te() {
701
+ if (!r.canvas) return;
702
+ let e = d();
703
+ N = e.version, y().draw(e, r.camera, performance.now());
704
+ let t = S();
705
+ t && t.draw(e, r.camera, { hover: r.hoverNodeId }), I.forEach((t) => t(e, r.camera));
706
+ }
707
+ function P(e, t) {
708
+ let n = S();
710
709
  return n ? n.hit(e, t) : null;
711
710
  }
712
- function L(e) {
711
+ function F(e) {
713
712
  let t = e || null;
714
- if (n.hoverNodeId === t) return;
715
- n.hoverNodeId = t;
716
- let r = T();
717
- r && n.canvas && n.width && r.draw(p(), n.camera, { hover: t });
718
- }
719
- let R = /* @__PURE__ */ new Set(), ne = (e) => (R.add(e), () => R.delete(e)), z = /* @__PURE__ */ new Set(), B = qe({
720
- draw: ee,
721
- packetsVisible: () => !!n.canvas && We(p(), n.camera, n.width, n.height),
713
+ if (r.hoverNodeId === t) return;
714
+ r.hoverNodeId = t;
715
+ let n = S();
716
+ n && r.canvas && r.width && n.draw(d(), r.camera, { hover: t });
717
+ }
718
+ let I = /* @__PURE__ */ new Set(), R = (e) => (I.add(e), () => I.delete(e)), z = /* @__PURE__ */ new Set(), B = He({
719
+ draw: te,
720
+ packetsVisible: () => !!r.canvas && ze(d(), r.camera, r.width, r.height),
722
721
  isHidden: () => e.hidden(),
723
722
  tickClients: (e) => {
724
723
  let t = !1;
@@ -728,73 +727,73 @@ function mt(e, t = {}) {
728
727
  },
729
728
  clientsWant: () => [...z].some((e) => e.wants()),
730
729
  reduceMotion: () => e.reducedMotion,
731
- extraDirty: () => n.sceneVersion !== I,
730
+ extraDirty: () => r.sceneVersion !== N,
732
731
  now: () => performance.now(),
733
732
  raf: (e) => requestAnimationFrame(e),
734
733
  caf: (e) => cancelAnimationFrame(e)
735
734
  });
736
735
  function V() {
737
- !a && n.canvas && B.markDirty();
736
+ !o && r.canvas && B.markDirty();
738
737
  }
739
- function H() {
740
- !a && n.canvas && B.drawNow();
738
+ function ne() {
739
+ !o && r.canvas && B.drawNow();
741
740
  }
742
- function U(e) {
741
+ function re(e) {
743
742
  return z.add(e), () => z.delete(e);
744
743
  }
745
744
  if (e.root) {
746
745
  let t = () => B.noteInput();
747
- for (let n of pt) e.listen(e.root, n, t, {
746
+ for (let n of ct) e.listen(e.root, n, t, {
748
747
  passive: !0,
749
748
  capture: !0
750
749
  });
751
750
  }
752
751
  e.onShown(() => B.shown());
753
- function re() {
754
- a = !0, e.map === W && (e.map = null), B.cancel(), v && (v.release ? v.release() : v.destroy(), v = null, y = null), S && (S.destroy(), S = null, w = null), R.clear(), z.clear();
752
+ function ie() {
753
+ o = !0, e.map === G && (e.map = null), B.cancel(), _ && (_.release ? _.release() : _.destroy(), _ = null, v = null), b && (b.destroy(), b = null, x = null), I.clear(), z.clear();
755
754
  }
756
- let W = {
757
- isNodeVisible: o,
758
- isNodeVisibleToViewer: s,
755
+ let G = {
756
+ isNodeVisible: s,
757
+ isNodeVisibleToViewer: c,
759
758
  getActiveSubgraph: l,
760
- getScene: p,
761
- sceneBuilds: m,
762
- getSpatialIndex: g,
763
- spatialBuilds: _,
764
- getRenderer: x,
765
- setRenderer: E,
766
- resize: D,
767
- watchSize: O,
768
- getMinZoom: M,
769
- fitGraphToViewport: N,
770
- fitPadding: P,
771
- screenToWorld: F,
772
- labelNodeAt: te,
773
- setHoverNode: L,
774
- onPaint: ne,
759
+ getScene: d,
760
+ sceneBuilds: f,
761
+ getSpatialIndex: m,
762
+ spatialBuilds: h,
763
+ getRenderer: y,
764
+ setRenderer: C,
765
+ resize: w,
766
+ watchSize: E,
767
+ getMinZoom: A,
768
+ fitGraphToViewport: ee,
769
+ fitPadding: j,
770
+ screenToWorld: M,
771
+ labelNodeAt: P,
772
+ setHoverNode: F,
773
+ onPaint: R,
775
774
  render: V,
776
- renderNow: H,
777
- addFrameClient: U,
775
+ renderNow: ne,
776
+ addFrameClient: re,
778
777
  queueFrameWork: (e, t) => {
779
- a || B.queue(e, t);
778
+ o || B.queue(e, t);
780
779
  },
781
780
  frameStats: () => ({
782
781
  frames: B.frames,
783
782
  draws: B.draws
784
783
  }),
785
784
  holdFrames: (e) => {
786
- a || B.hold(e);
785
+ o || B.hold(e);
787
786
  },
788
787
  cancelFrame: () => B.cancel(),
789
788
  ensureFlowLoop: () => {
790
- a || B.wake();
789
+ o || B.wake();
791
790
  },
792
- destroy: re
791
+ destroy: ie
793
792
  };
794
- return e.map = W, e.own(re), W;
793
+ return e.map = G, e.own(ie), G;
795
794
  }
796
795
  // ../explorer/flow-build.js
797
- function ht(e, t) {
796
+ function ut(e, t) {
798
797
  let n = new Map(e.map((e) => [e.id, e])), r = /* @__PURE__ */ new Map();
799
798
  t.forEach((e) => {
800
799
  !e.kind && !e.dashed && n.get(e.from)?.type === "app" && n.get(e.to)?.type === "page" && r.set(e.to, e.from);
@@ -882,51 +881,55 @@ function ht(e, t) {
882
881
  };
883
882
  }
884
883
  // ../explorer/engine/topology.js
885
- function gt(e) {
884
+ function dt(e) {
886
885
  return {
887
886
  nodes: e && Array.isArray(e.nodes) ? e.nodes.filter((e) => e && typeof e.id == "string") : [],
888
887
  edges: e && Array.isArray(e.edges) ? e.edges.filter((e) => e && typeof e.from == "string" && typeof e.to == "string") : []
889
888
  };
890
889
  }
891
- function _t(e, t) {
892
- let { state: n } = e, { nodes: r, edges: i } = gt(t), a = n.selectedNode ? n.selectedNode.id : null;
893
- n.baseNodes = r, n.baseEdges = i, n.nodes = r.map((e) => ({ ...e })), n.edges = i.map((e) => ({ ...e })), n.mapNodes = n.nodes, n.mapEdges = n.edges, n.flow = ht(n.nodes, n.edges);
890
+ function ft(e, t) {
891
+ let { state: n } = e, { nodes: r, edges: i } = dt(t), a = n.selectedNode ? n.selectedNode.id : null;
892
+ n.baseNodes = r, n.baseEdges = i, n.nodes = r.map((e) => ({ ...e })), n.edges = i.map((e) => ({ ...e })), n.mapNodes = n.nodes, n.mapEdges = n.edges, n.flow = ut(n.nodes, n.edges);
894
893
  let o = a && n.nodes.find((e) => e.id === a) || null;
895
894
  return o ? (n.selectedEdge = null, n.selectedNode = o) : (n.selectedNode || n.selectedEdge) && (n.selectedNode = null, n.selectedEdge = null), e.touchScene(), n.nodes.length > 0;
896
895
  }
897
- function vt(e, { placeLive: t } = {}) {
896
+ function pt(e, { placeLive: t } = {}) {
898
897
  let { state: n } = e;
899
- I(e), n.view === "dataflow" && n.flow ? (n.flow.tiers.forEach((e) => e.nodes.forEach((e) => {
898
+ F(e), n.view === "dataflow" && n.flow ? (n.flow.tiers.forEach((e) => e.nodes.forEach((e) => {
900
899
  e.r = Math.min(e.r, 13);
901
- })), n.proposal && n.baseNodes && yt(e) || O(e, n.flow)) : n.baseNodes && (n.proposal || n.nodes.some((e) => e.live)) ? bt(e, t) : le(e);
900
+ })), n.proposal && n.baseNodes && ht(e) || f(e, n.flow)) : n.baseNodes && (n.proposal || n.nodes.some((e) => e.live)) ? gt(e, t) : p(e);
901
+ }
902
+ function mt(e, t, n) {
903
+ let { state: r } = e;
904
+ r.mapNodes = t, r.mapEdges = n, r.nodes = t, r.edges = n, r.flow = ut(t, n), D(r.flow), e.touchScene(), pt(e);
902
905
  }
903
- function yt(e) {
906
+ function ht(e) {
904
907
  let { state: t } = e, n = {
905
908
  nodes: t.nodes,
906
909
  edges: t.edges
907
910
  }, r = t.baseNodes.map((e) => ({ ...e }));
908
- t.nodes = r, t.edges = t.baseEdges, I(e);
909
- let i = ht(r, t.baseEdges);
911
+ t.nodes = r, t.edges = t.baseEdges, F(e);
912
+ let i = ut(r, t.baseEdges);
910
913
  i.tiers.forEach((e) => e.nodes.forEach((e) => {
911
914
  e.r = Math.min(e.r, 13);
912
- })), O(e, i), t.nodes = n.nodes, t.edges = n.edges;
913
- let a = z(t.flow, i);
915
+ })), f(e, i), t.nodes = n.nodes, t.edges = n.edges;
916
+ let a = B(t.flow, i);
914
917
  return e.touchScene(), a;
915
918
  }
916
- function bt(e, t) {
919
+ function gt(e, t) {
917
920
  let { state: n } = e, r = {
918
921
  nodes: n.nodes,
919
922
  edges: n.edges
920
923
  }, i = n.baseNodes.map((e) => ({ ...e }));
921
- n.nodes = i, n.edges = n.baseEdges, I(e), le(e);
924
+ n.nodes = i, n.edges = n.baseEdges, F(e), p(e);
922
925
  let a = new Map(i.map((e) => [e.id, e]));
923
- n.nodes = r.nodes, n.edges = r.edges, I(e), n.nodes.forEach((e) => {
926
+ n.nodes = r.nodes, n.edges = r.edges, F(e), n.nodes.forEach((e) => {
924
927
  let t = a.get(e.id);
925
928
  t && (e.x = t.x, e.y = t.y, e.r = t.r);
926
- }), ce(n.nodes, n.edges), t && t(n.nodes, n.edges), e.touchScene();
929
+ }), re(n.nodes, n.edges), t && t(n.nodes, n.edges), e.touchScene();
927
930
  }
928
931
  // ../explorer/shaders.js
929
- var X = "#version 300 es\nprecision highp float;\nuniform vec2 u_viewport;\nuniform vec3 u_cam;\nuniform float u_dpr;\n", Z = "\nvec4 toClip(vec2 pos) {\n return vec4(pos.x / u_viewport.x * 2.0 - 1.0, 1.0 - pos.y / u_viewport.y * 2.0, 0.0, 1.0);\n}\n", Q = "\nout vec4 outColor;\n\n// Coverage of one device pixel by the half plane d < 0 (d: signed distance in CSS px, pix: the pixel's size)\nfloat coverEdge(float d, float pix) {\n return clamp(0.5 - d / pix, 0.0, 1.0);\n}\n\n// Coverage of one pixel by a band of half width hw around dist = 0 (dist >= 0: distance from the centre line)\nfloat coverBand(float dist, float hw, float pix) {\n float hi = min(hw, dist + 0.5 * pix);\n float lo = max(-hw, dist - 0.5 * pix);\n return clamp((hi - lo) / pix, 0.0, 1.0);\n}\n\n// Coverage by a dash pattern along an arc (on / off in world units; on <= 0 or off <= 0 is solid)\nfloat coverDash(float arc, float on, float off, float pixWorld) {\n if (on <= 0.0 || off <= 0.0) return 1.0;\n float period = on + off;\n float u = mod(arc - on * 0.5 + period * 0.5, period) - period * 0.5;\n return clamp((on * 0.5 - abs(u)) / pixWorld + 0.5, 0.0, 1.0);\n}\n\n// Straight colour at alpha a, composited over acc (premultiplied)\nvoid over(inout vec4 acc, vec3 rgb, float a) {\n acc = vec4(rgb * a, a) + acc * (1.0 - a);\n}\n\n// What Canvas 2D's shadowBlur gives a disc of radius R at distance len from its centre: a blurred copy\n// of the disc. s is the blur's sigma in CSS px (shadowBlur is in DEVICE px and sigma = blur / 2). A big\n// disc has a straight-edge profile (a logistic stands in for the Gaussian's CDF); a small one is a\n// Gaussian bump whose height is what the blur leaves of it.\nfloat glowDisc(float len, float R, float s) {\n float wide = 1.0 / (1.0 + exp(clamp(1.702 * (len - R) / s, -30.0, 30.0)));\n float narrow = (1.0 - exp(-R * R / (2.0 * s * s))) * exp(-len * len / (2.0 * s * s));\n return mix(narrow, wide, smoothstep(0.5 * s, 2.5 * s, R));\n}\n\n// The normal distribution's CDF, as the same logistic (error under 0.01)\nfloat phi(float x) {\n return 1.0 / (1.0 + exp(clamp(-1.702 * x, -30.0, 30.0)));\n}\n", xt = `${X}
932
+ var Z = "#version 300 es\nprecision highp float;\nuniform vec2 u_viewport;\nuniform vec3 u_cam;\nuniform float u_dpr;\n", _t = "\nvec4 toClip(vec2 pos) {\n return vec4(pos.x / u_viewport.x * 2.0 - 1.0, 1.0 - pos.y / u_viewport.y * 2.0, 0.0, 1.0);\n}\n", Q = "\nout vec4 outColor;\n\n// Coverage of one device pixel by the half plane d < 0 (d: signed distance in CSS px, pix: the pixel's size)\nfloat coverEdge(float d, float pix) {\n return clamp(0.5 - d / pix, 0.0, 1.0);\n}\n\n// Coverage of one pixel by a band of half width hw around dist = 0 (dist >= 0: distance from the centre line)\nfloat coverBand(float dist, float hw, float pix) {\n float hi = min(hw, dist + 0.5 * pix);\n float lo = max(-hw, dist - 0.5 * pix);\n return clamp((hi - lo) / pix, 0.0, 1.0);\n}\n\n// Coverage by a dash pattern along an arc (on / off in world units; on <= 0 or off <= 0 is solid)\nfloat coverDash(float arc, float on, float off, float pixWorld) {\n if (on <= 0.0 || off <= 0.0) return 1.0;\n float period = on + off;\n float u = mod(arc - on * 0.5 + period * 0.5, period) - period * 0.5;\n return clamp((on * 0.5 - abs(u)) / pixWorld + 0.5, 0.0, 1.0);\n}\n\n// Straight colour at alpha a, composited over acc (premultiplied)\nvoid over(inout vec4 acc, vec3 rgb, float a) {\n acc = vec4(rgb * a, a) + acc * (1.0 - a);\n}\n\n// What Canvas 2D's shadowBlur gives a disc of radius R at distance len from its centre: a blurred copy\n// of the disc. s is the blur's sigma in CSS px (shadowBlur is in DEVICE px and sigma = blur / 2). A big\n// disc has a straight-edge profile (a logistic stands in for the Gaussian's CDF); a small one is a\n// Gaussian bump whose height is what the blur leaves of it.\nfloat glowDisc(float len, float R, float s) {\n float wide = 1.0 / (1.0 + exp(clamp(1.702 * (len - R) / s, -30.0, 30.0)));\n float narrow = (1.0 - exp(-R * R / (2.0 * s * s))) * exp(-len * len / (2.0 * s * s));\n return mix(narrow, wide, smoothstep(0.5 * s, 2.5 * s, R));\n}\n\n// The normal distribution's CDF, as the same logistic (error under 0.01)\nfloat phi(float x) {\n return 1.0 / (1.0 + exp(clamp(-1.702 * x, -30.0, 30.0)));\n}\n", vt = `${Z}
930
933
  layout(location = 0) in vec2 a_corner;
931
934
  layout(location = 1) in vec4 a_grid; // size, width
932
935
  layout(location = 2) in vec4 a_color;
@@ -939,7 +942,7 @@ void main() {
939
942
  v_color = a_color;
940
943
  gl_Position = vec4(a_corner, 0.0, 1.0);
941
944
  }
942
- `, St = `${X}${Q}
945
+ `, yt = `${Z}${Q}
943
946
  in vec2 v_pos;
944
947
  flat in vec4 v_grid;
945
948
  flat in vec4 v_color;
@@ -952,7 +955,7 @@ void main() {
952
955
  float cover = max(coverBand(dist.x, hw, pix), coverBand(dist.y, hw, pix));
953
956
  outColor = vec4(v_color.rgb * v_color.a, v_color.a) * cover;
954
957
  }
955
- `, Ct = `${X}${Z}
958
+ `, bt = `${Z}${_t}
956
959
  layout(location = 0) in vec2 a_corner;
957
960
  layout(location = 1) in vec4 a_rect; // x, y, w, h (world)
958
961
  layout(location = 2) in vec4 a_fill;
@@ -976,7 +979,7 @@ void main() {
976
979
  v_stroke = a_stroke;
977
980
  gl_Position = toClip(pos);
978
981
  }
979
- `, wt = `${X}${Q}
982
+ `, xt = `${Z}${Q}
980
983
  in vec2 v_local;
981
984
  flat in vec2 v_half;
982
985
  flat in vec2 v_style;
@@ -993,7 +996,7 @@ void main() {
993
996
  over(acc, v_stroke.rgb, v_stroke.a * coverBand(abs(sd), v_style.y * zoom * 0.5, pix));
994
997
  outColor = acc;
995
998
  }
996
- `, Tt = `${X}${Z}
999
+ `, St = `${Z}${_t}
997
1000
  layout(location = 0) in vec2 a_corner;
998
1001
  layout(location = 1) in vec4 a_geom; // x, y, r, width (world)
999
1002
  layout(location = 2) in vec4 a_color;
@@ -1013,7 +1016,7 @@ void main() {
1013
1016
  v_dash = a_dash;
1014
1017
  gl_Position = toClip(pos);
1015
1018
  }
1016
- `, Et = `${X}${Q}
1019
+ `, Ct = `${Z}${Q}
1017
1020
  in vec2 v_local;
1018
1021
  flat in vec4 v_geom;
1019
1022
  flat in vec4 v_color;
@@ -1028,7 +1031,7 @@ void main() {
1028
1031
  cover *= coverDash(arc, v_dash.x, v_dash.y, pix / zoom);
1029
1032
  outColor = vec4(v_color.rgb * v_color.a, v_color.a) * cover;
1030
1033
  }
1031
- `, Dt = `${X}${Z}
1034
+ `, wt = `${Z}${_t}
1032
1035
  layout(location = 0) in vec2 a_corner;
1033
1036
  layout(location = 1) in vec4 a_geom; // x, y, r (world), alpha
1034
1037
  layout(location = 2) in vec4 a_color; // r, g, b (0..1), glow (px)
@@ -1056,7 +1059,7 @@ void main() {
1056
1059
  v_kind = a_kind;
1057
1060
  gl_Position = toClip(centre + v_local);
1058
1061
  }
1059
- `, Ot = `${X}${Q}
1062
+ `, Tt = `${Z}${Q}
1060
1063
  in vec2 v_local;
1061
1064
  flat in vec4 v_geom;
1062
1065
  flat in vec4 v_color;
@@ -1146,7 +1149,7 @@ void main() {
1146
1149
 
1147
1150
  outColor = acc;
1148
1151
  }
1149
- `, kt = "\nvec2 bez(vec2 a, vec2 c, vec2 b, float t) {\n float u = 1.0 - t;\n return u * u * a + 2.0 * u * t * c + t * t * b;\n}\nvec2 bezD(vec2 a, vec2 c, vec2 b, float t) {\n return 2.0 * (1.0 - t) * (c - a) + 2.0 * t * (b - c);\n}\n// Arc length from 0 to t, in world units (midpoint rule, 8 steps: the speed is smooth)\nfloat bezArc(vec2 a, vec2 c, vec2 b, float t) {\n float sum = 0.0;\n for (int j = 0; j < 8; j++) sum += length(bezD(a, c, b, (float(j) + 0.5) * t / 8.0));\n return sum * t / 8.0;\n}\n", At = "\nvec2 packetPos(vec4 ends, vec4 mot, float timeSec) {\n float k = fract(timeSec * mot.z + mot.w);\n return bez(ends.xy, mot.xy, ends.zw, k);\n}\n", jt = (e) => `${X}${kt}
1152
+ `, Et = "\nvec2 bez(vec2 a, vec2 c, vec2 b, float t) {\n float u = 1.0 - t;\n return u * u * a + 2.0 * u * t * c + t * t * b;\n}\nvec2 bezD(vec2 a, vec2 c, vec2 b, float t) {\n return 2.0 * (1.0 - t) * (c - a) + 2.0 * t * (b - c);\n}\n// Arc length from 0 to t, in world units (midpoint rule, 8 steps: the speed is smooth)\nfloat bezArc(vec2 a, vec2 c, vec2 b, float t) {\n float sum = 0.0;\n for (int j = 0; j < 8; j++) sum += length(bezD(a, c, b, (float(j) + 0.5) * t / 8.0));\n return sum * t / 8.0;\n}\n", Dt = "\nvec2 packetPos(vec4 ends, vec4 mot, float timeSec) {\n float k = fract(timeSec * mot.z + mot.w);\n return bez(ends.xy, mot.xy, ends.zw, k);\n}\n", Ot = (e) => `${Z}${Et}
1150
1153
  #define SEGS ${e}
1151
1154
  layout(location = 1) in vec4 a_ends; // x1, y1, x2, y2 (world)
1152
1155
  layout(location = 2) in vec4 a_geom; // control x, y (world), width (world), glow blur (px)
@@ -1188,7 +1191,7 @@ void main() {
1188
1191
  v_dash = a_dash;
1189
1192
  gl_Position = vec4(pos.x / u_viewport.x * 2.0 - 1.0, 1.0 - pos.y / u_viewport.y * 2.0, 0.0, 1.0);
1190
1193
  }
1191
- `, Mt = `${X}${Q}
1194
+ `, kt = `${Z}${Q}
1192
1195
  in float v_across;
1193
1196
  in float v_arc;
1194
1197
  flat in float v_len;
@@ -1238,7 +1241,7 @@ void main() {
1238
1241
  over(acc, v_color.rgb, v_color.a * cover);
1239
1242
  outColor = acc;
1240
1243
  }
1241
- `, Nt = `${X}${Z}
1244
+ `, At = `${Z}${_t}
1242
1245
  layout(location = 0) in vec2 a_corner;
1243
1246
  layout(location = 1) in vec4 a_tip; // x, y (world), direction x, y (unit)
1244
1247
  layout(location = 2) in vec4 a_color;
@@ -1258,7 +1261,7 @@ void main() {
1258
1261
  v_kind = a_kind;
1259
1262
  gl_Position = toClip(u_cam.xy + a_tip.xy * zoom + off);
1260
1263
  }
1261
- `, Pt = `${X}${Q}
1264
+ `, jt = `${Z}${Q}
1262
1265
  in vec2 v_local;
1263
1266
  flat in vec4 v_color;
1264
1267
  flat in float v_kind;
@@ -1314,7 +1317,7 @@ void main() {
1314
1317
  }
1315
1318
  outColor = vec4(v_color.rgb * v_color.a, v_color.a) * coverEdge(sd, pix);
1316
1319
  }
1317
- `, Ft = `${X}${Z}${kt}${At}
1320
+ `, Mt = `${Z}${_t}${Et}${Dt}
1318
1321
  layout(location = 0) in vec2 a_corner;
1319
1322
  layout(location = 1) in vec4 a_ends; // x1, y1, x2, y2 (world)
1320
1323
  layout(location = 2) in vec4 a_mot; // control x, y (world), speed (trips per second), phase
@@ -1335,7 +1338,7 @@ void main() {
1335
1338
  v_glow = a_glow;
1336
1339
  gl_Position = toClip(centre + v_local);
1337
1340
  }
1338
- `, It = `${X}${Q}
1341
+ `, Nt = `${Z}${Q}
1339
1342
  in vec2 v_local;
1340
1343
  flat in vec4 v_size;
1341
1344
  flat in vec4 v_color;
@@ -1350,7 +1353,7 @@ void main() {
1350
1353
  over(acc, v_color.rgb, v_color.a * coverEdge(len - R, pix));
1351
1354
  outColor = acc;
1352
1355
  }
1353
- `, Lt = `${X}${Z}
1356
+ `, Pt = `${Z}${_t}
1354
1357
  layout(location = 0) in vec2 a_corner;
1355
1358
  layout(location = 1) in vec4 a_geom; // x, y, side (world), alpha
1356
1359
  uniform float u_minR; // letters and glyphs: the least on-screen radius (px) of a node that shows them; 0 for a theme's icon
@@ -1365,7 +1368,7 @@ void main() {
1365
1368
  v_alpha = a_geom.w;
1366
1369
  gl_Position = toClip(pos);
1367
1370
  }
1368
- `, Rt = `${X}
1371
+ `, Ft = `${Z}
1369
1372
  uniform sampler2D u_tex;
1370
1373
  in vec2 v_uv;
1371
1374
  flat in float v_alpha;
@@ -1373,34 +1376,34 @@ out vec4 outColor;
1373
1376
  void main() {
1374
1377
  outColor = texture(u_tex, v_uv) * v_alpha; // the texture is uploaded premultiplied
1375
1378
  }
1376
- `, zt = {
1379
+ `, It = {
1377
1380
  none: 0,
1378
1381
  selected: 1,
1379
1382
  match: 2,
1380
1383
  child: 3
1381
- }, Bt = {
1384
+ }, Lt = {
1382
1385
  arrow: 1,
1383
1386
  strike: 2,
1384
1387
  chevron: 3,
1385
1388
  bar: 4,
1386
1389
  diamond: 5,
1387
1390
  tick: 6
1388
- }, Vt = Object.freeze(Object.fromEntries(M.map((e, t) => [e, t]))), Ht = {
1391
+ }, Rt = Object.freeze(Object.fromEntries(_.map((e, t) => [e, t]))), zt = {
1389
1392
  none: 0,
1390
1393
  added: 1,
1391
1394
  changed: 2,
1392
1395
  removed: 3,
1393
1396
  edit: 4
1394
1397
  }, $ = (e) => {
1395
- let [t, n, r, i] = te(e);
1398
+ let [n, r, i, a] = t(e);
1396
1399
  return [
1397
- t / 255,
1398
1400
  n / 255,
1399
1401
  r / 255,
1400
- i
1402
+ i / 255,
1403
+ a
1401
1404
  ];
1402
- }, Ut = (e, t) => Object.hasOwn(e, t) ? e[t] : 0;
1403
- function Wt(e) {
1405
+ }, Bt = (e, t) => Object.hasOwn(e, t) ? e[t] : 0;
1406
+ function Vt(e) {
1404
1407
  let { nodes: t } = e, n = new Float32Array(t.length * 12);
1405
1408
  return t.forEach((e, t) => {
1406
1409
  let [r, i, a, o] = $(e.color);
@@ -1413,10 +1416,10 @@ function Wt(e) {
1413
1416
  i,
1414
1417
  a,
1415
1418
  e.glow || 0,
1416
- Ut(zt, e.halo),
1417
- Ut(Ht, e.mark),
1419
+ Bt(It, e.halo),
1420
+ Bt(zt, e.mark),
1418
1421
  o,
1419
- Ut(Vt, e.shape) + (e.glyph && !e.icon && !e.letters ? 8 : 0)
1422
+ Bt(Rt, e.shape) + (e.glyph && !e.icon && !e.letters ? 8 : 0)
1420
1423
  ], t * 12);
1421
1424
  }), {
1422
1425
  data: n,
@@ -1424,7 +1427,7 @@ function Wt(e) {
1424
1427
  stride: 12
1425
1428
  };
1426
1429
  }
1427
- function Gt(e) {
1430
+ function Ht(e) {
1428
1431
  let { grid: t, rings: n, lanes: r } = e.decor, i = new Float32Array(t ? 8 : 0);
1429
1432
  t && i.set([
1430
1433
  t.size,
@@ -1476,110 +1479,110 @@ function Gt(e) {
1476
1479
  }
1477
1480
  };
1478
1481
  }
1479
- function Kt(e) {
1480
- let t = {
1482
+ function Ut(t) {
1483
+ let n = {
1481
1484
  straight: [],
1482
1485
  curved: [],
1483
1486
  tips: [],
1484
1487
  packets: []
1485
1488
  };
1486
- e.edges.forEach((e) => {
1487
- let [n, r, i, a] = $(e.color), o = e.alpha, s = a * o, [c, l] = e.dash && e.dash.length >= 2 ? e.dash : [0, 0], u = e.glow > 0 && !!e.glowColor, [d, f, p, h] = u ? $(e.glowColor) : [
1489
+ t.edges.forEach((t) => {
1490
+ let [r, i, a, o] = $(t.color), c = t.alpha, l = o * c, [u, d] = t.dash && t.dash.length >= 2 ? t.dash : [0, 0], f = t.glow > 0 && !!t.glowColor, [p, m, h, g] = f ? $(t.glowColor) : [
1488
1491
  0,
1489
1492
  0,
1490
1493
  0,
1491
1494
  0
1492
- ], g = e.curve ? e.curve.cx : (e.x1 + e.x2) / 2, _ = e.curve ? e.curve.cy : (e.y1 + e.y2) / 2, v = e.mark && e.mark !== "none" ? 1 : 0;
1493
- if (t[e.curve ? "curved" : "straight"].push([
1494
- e.x1,
1495
- e.y1,
1496
- e.x2,
1497
- e.y2,
1498
- g,
1495
+ ], _ = t.curve ? t.curve.cx : (t.x1 + t.x2) / 2, v = t.curve ? t.curve.cy : (t.y1 + t.y2) / 2, y = t.mark && t.mark !== "none" ? 1 : 0;
1496
+ if (n[t.curve ? "curved" : "straight"].push([
1497
+ t.x1,
1498
+ t.y1,
1499
+ t.x2,
1500
+ t.y2,
1499
1501
  _,
1500
- e.width,
1501
- u ? e.glow : 0,
1502
- n,
1502
+ v,
1503
+ t.width,
1504
+ f ? t.glow : 0,
1503
1505
  r,
1504
1506
  i,
1505
- s,
1506
- d,
1507
- f,
1508
- p,
1509
- h * s,
1510
- c,
1507
+ a,
1511
1508
  l,
1512
- v
1513
- ]), e.arrow) {
1514
- let a = Math.atan2(e.y2 - (e.curve ? e.curve.cy : e.y1), e.x2 - (e.curve ? e.curve.cx : e.x1)), o = e.end && e.end !== "triangle" && Ut(Bt, e.end) || Bt.arrow;
1515
- t.tips.push([
1516
- e.x2,
1517
- e.y2,
1518
- Math.cos(a),
1519
- Math.sin(a),
1520
- n,
1509
+ p,
1510
+ m,
1511
+ h,
1512
+ g * l,
1513
+ u,
1514
+ d,
1515
+ y
1516
+ ]), t.arrow) {
1517
+ let e = Math.atan2(t.y2 - (t.curve ? t.curve.cy : t.y1), t.x2 - (t.curve ? t.curve.cx : t.x1)), o = t.end && t.end !== "triangle" && Bt(Lt, t.end) || Lt.arrow;
1518
+ n.tips.push([
1519
+ t.x2,
1520
+ t.y2,
1521
+ Math.cos(e),
1522
+ Math.sin(e),
1521
1523
  r,
1522
1524
  i,
1523
- s,
1525
+ a,
1526
+ l,
1524
1527
  o
1525
1528
  ]);
1526
1529
  }
1527
- if (e.ticks) {
1528
- let a = m(e, .5), o = Math.hypot(e.x2 - e.x1, e.y2 - e.y1), [c, l] = o > 0 ? [(e.x2 - e.x1) / o, (e.y2 - e.y1) / o] : [1, 0];
1529
- for (let o = 0; o < e.ticks; o++) {
1530
- let u = (o - (e.ticks - 1) / 2) * R.tickGap;
1531
- t.tips.push([
1532
- a.x + c * u,
1533
- a.y + l * u,
1534
- c,
1535
- l,
1536
- n,
1530
+ if (t.ticks) {
1531
+ let o = e(t, .5), c = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [u, d] = c > 0 ? [(t.x2 - t.x1) / c, (t.y2 - t.y1) / c] : [1, 0];
1532
+ for (let e = 0; e < t.ticks; e++) {
1533
+ let c = (e - (t.ticks - 1) / 2) * s.tickGap;
1534
+ n.tips.push([
1535
+ o.x + u * c,
1536
+ o.y + d * c,
1537
+ u,
1538
+ d,
1537
1539
  r,
1538
1540
  i,
1539
- s,
1540
- Bt.tick
1541
+ a,
1542
+ l,
1543
+ Lt.tick
1541
1544
  ]);
1542
1545
  }
1543
1546
  }
1544
- if (e.mark === "removed") {
1545
- let a = m(e, .5), o = Math.hypot(e.x2 - e.x1, e.y2 - e.y1), [c, l] = o > 0 ? [(e.x2 - e.x1) / o, (e.y2 - e.y1) / o] : [1, 0];
1546
- t.tips.push([
1547
- a.x,
1548
- a.y,
1547
+ if (t.mark === "removed") {
1548
+ let o = e(t, .5), s = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [c, u] = s > 0 ? [(t.x2 - t.x1) / s, (t.y2 - t.y1) / s] : [1, 0];
1549
+ n.tips.push([
1550
+ o.x,
1551
+ o.y,
1549
1552
  c,
1550
- l,
1551
- n,
1553
+ u,
1552
1554
  r,
1553
1555
  i,
1554
- s,
1555
- Bt.strike
1556
+ a,
1557
+ l,
1558
+ Lt.strike
1556
1559
  ]);
1557
1560
  }
1558
- if (e.packet) {
1559
- let n = e.packet, [r, i, a, s] = $(n.color), [c, l, u, d] = $(n.glowColor);
1560
- t.packets.push([
1561
- e.x1,
1562
- e.y1,
1563
- e.x2,
1564
- e.y2,
1565
- g,
1561
+ if (t.packet) {
1562
+ let e = t.packet, [r, i, a, o] = $(e.color), [s, l, u, d] = $(e.glowColor);
1563
+ n.packets.push([
1564
+ t.x1,
1565
+ t.y1,
1566
+ t.x2,
1567
+ t.y2,
1566
1568
  _,
1567
- n.speed,
1568
- n.phase,
1569
+ v,
1570
+ e.speed,
1571
+ e.phase,
1569
1572
  r,
1570
1573
  i,
1571
1574
  a,
1572
- s * o,
1573
- c,
1575
+ o * c,
1576
+ s,
1574
1577
  l,
1575
1578
  u,
1576
- d * s * o,
1577
- n.radius,
1578
- n.glow
1579
+ d * o * c,
1580
+ e.radius,
1581
+ e.glow
1579
1582
  ]);
1580
1583
  }
1581
1584
  });
1582
- let n = (e, t) => {
1585
+ let r = (e, t) => {
1583
1586
  let n = new Float32Array(e.length * t);
1584
1587
  return e.forEach((e, r) => n.set(e, r * t)), {
1585
1588
  data: n,
@@ -1588,18 +1591,18 @@ function Kt(e) {
1588
1591
  };
1589
1592
  };
1590
1593
  return {
1591
- straight: n(t.straight, 19),
1592
- curved: n(t.curved, 19),
1593
- tips: n(t.tips, 9),
1594
- packets: n(t.packets, 18)
1594
+ straight: r(n.straight, 19),
1595
+ curved: r(n.curved, 19),
1596
+ tips: r(n.tips, 9),
1597
+ packets: r(n.packets, 18)
1595
1598
  };
1596
1599
  }
1597
- var qt = (e) => ({
1598
- ...Gt(e),
1599
- nodes: Wt(e),
1600
- ...Kt(e)
1600
+ var Wt = (e) => ({
1601
+ ...Ht(e),
1602
+ nodes: Vt(e),
1603
+ ...Ut(e)
1601
1604
  });
1602
- function Jt(e) {
1605
+ function Gt(e) {
1603
1606
  let t = [];
1604
1607
  e.nodes.forEach((e) => {
1605
1608
  if (!e.stroke) return;
@@ -1624,87 +1627,87 @@ function Jt(e) {
1624
1627
  stride: 10
1625
1628
  };
1626
1629
  }
1627
- function Yt(e, t, n = null) {
1628
- let r = /* @__PURE__ */ new Map();
1630
+ function Kt(e, t, n = null) {
1631
+ let i = /* @__PURE__ */ new Map();
1629
1632
  e.nodes.forEach((e) => {
1630
- let i = e.icon && t(e.icon) ? e.icon : null, a = e.r * de;
1631
- if (!i && !e.icon && e.letters && t(he(e.letters)) && (i = he(e.letters), a = e.r * 1), !i && !e.icon && !e.letters && e.glyph) {
1632
- let r = y(e.glyph, D(e, n));
1633
- t(r) && (i = r, a = e.r * G);
1633
+ let a = e.icon && t(e.icon) ? e.icon : null, o = e.r * l;
1634
+ if (!a && !e.icon && e.letters && t(ue(e.letters)) && (a = ue(e.letters), o = e.r * 1), !a && !e.icon && !e.letters && e.glyph) {
1635
+ let i = r(e.glyph, v(e, n));
1636
+ t(i) && (a = i, o = e.r * K);
1634
1637
  }
1635
- if (!i) return;
1636
- r.has(i) || r.set(i, {
1638
+ if (!a) return;
1639
+ i.has(a) || i.set(a, {
1637
1640
  rows: [],
1638
1641
  minR: Infinity,
1639
1642
  maxR: 0
1640
1643
  });
1641
- let o = r.get(i);
1642
- o.maxR = Math.max(o.maxR, e.r), o.rows.push([
1644
+ let s = i.get(a);
1645
+ s.maxR = Math.max(s.maxR, e.r), s.rows.push([
1643
1646
  e.x,
1644
1647
  e.y,
1645
- a,
1648
+ o,
1646
1649
  e.alpha
1647
- ]), o.minR = Math.min(o.minR, e.r);
1650
+ ]), s.minR = Math.min(s.minR, e.r);
1648
1651
  });
1649
- let i = [], a = [];
1650
- for (let [e, { rows: t, minR: n, maxR: o }] of r) i.push({
1652
+ let a = [], o = [];
1653
+ for (let [e, { rows: t, minR: n, maxR: r }] of i) a.push({
1651
1654
  kind: e,
1652
- first: a.length,
1655
+ first: o.length,
1653
1656
  count: t.length,
1654
1657
  minR: n,
1655
- maxR: o
1656
- }), a.push(...t);
1657
- let o = new Float32Array(a.length * 4);
1658
- return a.forEach((e, t) => o.set(e, t * 4)), {
1659
- data: o,
1660
- count: a.length,
1658
+ maxR: r
1659
+ }), o.push(...t);
1660
+ let s = new Float32Array(o.length * 4);
1661
+ return o.forEach((e, t) => s.set(e, t * 4)), {
1662
+ data: s,
1663
+ count: o.length,
1661
1664
  stride: 4,
1662
- groups: i
1665
+ groups: a
1663
1666
  };
1664
1667
  }
1665
- function Xt(e = "dark", t = null) {
1666
- let { halo: n, mark: r, core: s } = t ? a(i(e), t) : i(e), c = /* @__PURE__ */ new Float32Array(16), l = /* @__PURE__ */ new Float32Array(16), u = /* @__PURE__ */ new Float32Array(16);
1667
- Object.entries(zt).forEach(([e, t]) => {
1668
+ function qt(e = "dark", t = null) {
1669
+ let { halo: n, mark: r, core: i } = t ? ce(P(e), t) : P(e), a = /* @__PURE__ */ new Float32Array(16), o = /* @__PURE__ */ new Float32Array(16), s = /* @__PURE__ */ new Float32Array(16);
1670
+ Object.entries(It).forEach(([e, t]) => {
1668
1671
  let r = n[e];
1669
- t && r && (c.set($(r.fill), t * 4), l.set($(r.ring), t * 4), u.set([
1672
+ t && r && (a.set($(r.fill), t * 4), o.set($(r.ring), t * 4), s.set([
1670
1673
  r.fillR,
1671
1674
  r.ringR,
1672
1675
  r.ringWidth,
1673
1676
  0
1674
1677
  ], t * 4));
1675
1678
  });
1676
- let d = /* @__PURE__ */ new Float32Array(20), f = /* @__PURE__ */ new Float32Array(20);
1677
- return Object.entries(Ht).forEach(([e, t]) => {
1679
+ let c = /* @__PURE__ */ new Float32Array(20), l = /* @__PURE__ */ new Float32Array(20);
1680
+ return Object.entries(zt).forEach(([e, t]) => {
1678
1681
  if (!t) return;
1679
1682
  let n = r[e];
1680
- d.set($(n.color), t * 4);
1683
+ c.set($(n.color), t * 4);
1681
1684
  let [i, a] = n.ringDash || [0, 0];
1682
- f.set([
1685
+ l.set([
1683
1686
  n.ringR,
1684
1687
  n.ringWidth,
1685
1688
  i,
1686
1689
  a
1687
1690
  ], t * 4);
1688
1691
  }), {
1689
- haloFill: c,
1690
- haloRing: l,
1691
- haloGeom: u,
1692
- markColor: d,
1693
- markGeom: f,
1692
+ haloFill: a,
1693
+ haloRing: o,
1694
+ haloGeom: s,
1695
+ markColor: c,
1696
+ markGeom: l,
1694
1697
  markMin: new Float32Array([
1695
- g.ring,
1696
- g.edge,
1697
- g.gap
1698
+ w.ring,
1699
+ w.edge,
1700
+ w.gap
1698
1701
  ]),
1699
- core: new Float32Array($(s)),
1700
- coreRatio: o
1702
+ core: new Float32Array($(i)),
1703
+ coreRatio: b
1701
1704
  };
1702
1705
  }
1703
- var Zt = [
1706
+ var Jt = [
1704
1707
  {
1705
1708
  name: "grid",
1706
- vert: xt,
1707
- frag: St,
1709
+ vert: vt,
1710
+ frag: yt,
1708
1711
  stride: 8,
1709
1712
  attribs: [[
1710
1713
  1,
@@ -1718,8 +1721,8 @@ var Zt = [
1718
1721
  },
1719
1722
  {
1720
1723
  name: "lanes",
1721
- vert: Ct,
1722
- frag: wt,
1724
+ vert: bt,
1725
+ frag: xt,
1723
1726
  stride: 14,
1724
1727
  attribs: [
1725
1728
  [
@@ -1746,8 +1749,8 @@ var Zt = [
1746
1749
  },
1747
1750
  {
1748
1751
  name: "rings",
1749
- vert: Tt,
1750
- frag: Et,
1752
+ vert: St,
1753
+ frag: Ct,
1751
1754
  stride: 10,
1752
1755
  attribs: [
1753
1756
  [
@@ -1769,8 +1772,8 @@ var Zt = [
1769
1772
  },
1770
1773
  {
1771
1774
  name: "straight",
1772
- vert: jt(1),
1773
- frag: Mt,
1775
+ vert: Ot(1),
1776
+ frag: kt,
1774
1777
  stride: 19,
1775
1778
  verts: 8,
1776
1779
  attribs: [
@@ -1809,8 +1812,8 @@ var Zt = [
1809
1812
  },
1810
1813
  {
1811
1814
  name: "curved",
1812
- vert: jt(24),
1813
- frag: Mt,
1815
+ vert: Ot(24),
1816
+ frag: kt,
1814
1817
  stride: 19,
1815
1818
  verts: 54,
1816
1819
  attribs: [
@@ -1849,8 +1852,8 @@ var Zt = [
1849
1852
  },
1850
1853
  {
1851
1854
  name: "tips",
1852
- vert: Nt,
1853
- frag: Pt,
1855
+ vert: At,
1856
+ frag: jt,
1854
1857
  stride: 9,
1855
1858
  attribs: [
1856
1859
  [
@@ -1873,8 +1876,8 @@ var Zt = [
1873
1876
  },
1874
1877
  {
1875
1878
  name: "packets",
1876
- vert: Ft,
1877
- frag: It,
1879
+ vert: Mt,
1880
+ frag: Nt,
1878
1881
  stride: 18,
1879
1882
  attribs: [
1880
1883
  [
@@ -1907,8 +1910,8 @@ var Zt = [
1907
1910
  },
1908
1911
  {
1909
1912
  name: "nodes",
1910
- vert: Dt,
1911
- frag: Ot,
1913
+ vert: wt,
1914
+ frag: Tt,
1912
1915
  stride: 12,
1913
1916
  attribs: [
1914
1917
  [
@@ -1929,17 +1932,17 @@ var Zt = [
1929
1932
  ],
1930
1933
  constants: "nodes"
1931
1934
  }
1932
- ], Qt = {
1935
+ ], Yt = {
1933
1936
  nodes(e, t, n) {
1934
- e.uniform4fv(t("u_haloFill"), n.haloFill), e.uniform4fv(t("u_haloRing"), n.haloRing), e.uniform4fv(t("u_haloGeom"), n.haloGeom), e.uniform4fv(t("u_markColor"), n.markColor), e.uniform4fv(t("u_markGeom"), n.markGeom), e.uniform3fv(t("u_markMin"), n.markMin), e.uniform4fv(t("u_core"), n.core), e.uniform1f(t("u_coreRatio"), n.coreRatio), e.uniform4f(t("u_shape"), v.roundedHalf, v.roundedCorner, v.hexInradius, v.squareHalf), e.uniform2f(t("u_shape2"), v.squareCorner, v.diamondHalf), e.uniform1f(t("u_glyphMin"), 14);
1937
+ e.uniform4fv(t("u_haloFill"), n.haloFill), e.uniform4fv(t("u_haloRing"), n.haloRing), e.uniform4fv(t("u_haloGeom"), n.haloGeom), e.uniform4fv(t("u_markColor"), n.markColor), e.uniform4fv(t("u_markGeom"), n.markGeom), e.uniform3fv(t("u_markMin"), n.markMin), e.uniform4fv(t("u_core"), n.core), e.uniform1f(t("u_coreRatio"), n.coreRatio), e.uniform4f(t("u_shape"), C.roundedHalf, C.roundedCorner, C.hexInradius, C.squareHalf), e.uniform2f(t("u_shape2"), C.squareCorner, C.diamondHalf), e.uniform1f(t("u_glyphMin"), 14);
1935
1938
  },
1936
1939
  edges(e, t, n) {
1937
1940
  e.uniform3fv(t("u_markMin"), n.markMin);
1938
1941
  },
1939
1942
  tips(e, t) {
1940
- e.uniform4f(t("u_tip"), s.length, s.spread, _.halfLength, _.width), e.uniform4f(t("u_end"), R.strokeWidth, R.barHalf, R.diamondHalf, R.diamondAcross), e.uniform2f(t("u_tick"), R.tickHalf, R.tickWidth);
1943
+ e.uniform4f(t("u_tip"), c.length, c.spread, S.halfLength, S.width), e.uniform4f(t("u_end"), s.strokeWidth, s.barHalf, s.diamondHalf, s.diamondAcross), e.uniform2f(t("u_tick"), s.tickHalf, s.tickWidth);
1941
1944
  }
1942
- }, $t = {
1945
+ }, Xt = {
1943
1946
  alpha: !0,
1944
1947
  premultipliedAlpha: !0,
1945
1948
  antialias: !1,
@@ -1948,7 +1951,7 @@ var Zt = [
1948
1951
  preserveDrawingBuffer: !1,
1949
1952
  powerPreference: "high-performance"
1950
1953
  };
1951
- function en(e, t, n, r) {
1954
+ function Zt(e, t, n, r) {
1952
1955
  let i = e.createShader(t);
1953
1956
  if (e.shaderSource(i, n), e.compileShader(i), !e.getShaderParameter(i, e.COMPILE_STATUS)) {
1954
1957
  let t = e.getShaderInfoLog(i);
@@ -1956,23 +1959,23 @@ function en(e, t, n, r) {
1956
1959
  }
1957
1960
  return i;
1958
1961
  }
1959
- function tn(e, t, n, r) {
1960
- let i = en(e, e.VERTEX_SHADER, t, `${r} vertex`), a = en(e, e.FRAGMENT_SHADER, n, `${r} fragment`), o = e.createProgram();
1962
+ function Qt(e, t, n, r) {
1963
+ let i = Zt(e, e.VERTEX_SHADER, t, `${r} vertex`), a = Zt(e, e.FRAGMENT_SHADER, n, `${r} fragment`), o = e.createProgram();
1961
1964
  if (e.attachShader(o, i), e.attachShader(o, a), e.linkProgram(o), e.deleteShader(i), e.deleteShader(a), !e.getProgramParameter(o, e.LINK_STATUS)) {
1962
1965
  let t = e.getProgramInfoLog(o);
1963
1966
  throw e.deleteProgram(o), Error(`${r} program did not link: ${t}`);
1964
1967
  }
1965
1968
  return o;
1966
1969
  }
1967
- var nn = (e) => !e || e.plain ? 0 : e.version;
1968
- function rn(e, t, n, r = null) {
1969
- let i = Xt(n, r);
1970
+ var $t = (e) => !e || e.plain ? 0 : e.version;
1971
+ function en(e, t, n, r = null) {
1972
+ let i = qt(n, r);
1970
1973
  t.passes.forEach((t) => {
1971
- t.spec.constants && (e.useProgram(t.program), Qt[t.spec.constants](e, t.at, i));
1972
- }), t.theme = n, t.styleKey = nn(r);
1974
+ t.spec.constants && (e.useProgram(t.program), Yt[t.spec.constants](e, t.at, i));
1975
+ }), t.theme = n, t.styleKey = $t(r);
1973
1976
  }
1974
- function an(e, t, n) {
1975
- let r = tn(e, t.vert, t.frag, t.name), i = e.createVertexArray(), a = e.createBuffer();
1977
+ function tn(e, t, n) {
1978
+ let r = Qt(e, t.vert, t.frag, t.name), i = e.createVertexArray(), a = e.createBuffer();
1976
1979
  e.bindVertexArray(i), t.verts || (e.bindBuffer(e.ARRAY_BUFFER, n), e.enableVertexAttribArray(0), e.vertexAttribPointer(0, 2, e.FLOAT, !1, 0, 0), e.vertexAttribDivisor(0, 0)), e.bindBuffer(e.ARRAY_BUFFER, a), t.attribs.forEach(([n, r, i]) => {
1977
1980
  e.enableVertexAttribArray(n), e.vertexAttribPointer(n, r, e.FLOAT, !1, t.stride * 4, i * 4), e.vertexAttribDivisor(n, 1);
1978
1981
  }), e.bindVertexArray(null);
@@ -1992,11 +1995,11 @@ function an(e, t, n) {
1992
1995
  }
1993
1996
  };
1994
1997
  }
1995
- var on = {
1998
+ var nn = {
1996
1999
  strokes: {
1997
2000
  name: "strokes",
1998
- vert: Tt,
1999
- frag: Et,
2001
+ vert: St,
2002
+ frag: Ct,
2000
2003
  stride: 10,
2001
2004
  attribs: [
2002
2005
  [
@@ -2018,8 +2021,8 @@ var on = {
2018
2021
  },
2019
2022
  icons: {
2020
2023
  name: "icons",
2021
- vert: Lt,
2022
- frag: Rt,
2024
+ vert: Pt,
2025
+ frag: Ft,
2023
2026
  stride: 4,
2024
2027
  attribs: [[
2025
2028
  1,
@@ -2028,7 +2031,7 @@ var on = {
2028
2031
  ]]
2029
2032
  }
2030
2033
  };
2031
- function sn(e, t = "dark", n = null) {
2034
+ function rn(e, t = "dark", n = null) {
2032
2035
  let r = e.createBuffer();
2033
2036
  e.bindBuffer(e.ARRAY_BUFFER, r), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
2034
2037
  -1,
@@ -2042,7 +2045,7 @@ function sn(e, t = "dark", n = null) {
2042
2045
  ]), e.STATIC_DRAW);
2043
2046
  let i = {
2044
2047
  corners: r,
2045
- passes: Zt.map((t) => an(e, t, r)),
2048
+ passes: Jt.map((t) => tn(e, t, r)),
2046
2049
  theme: t,
2047
2050
  styleKey: 0,
2048
2051
  extras: {
@@ -2052,41 +2055,41 @@ function sn(e, t = "dark", n = null) {
2052
2055
  textures: /* @__PURE__ */ new Map(),
2053
2056
  iconStore: null
2054
2057
  };
2055
- return rn(e, i, t, n), i;
2058
+ return en(e, i, t, n), i;
2056
2059
  }
2057
- function cn(e, t) {
2060
+ function an(e, t) {
2058
2061
  e.deleteBuffer(t.corners), t.textures.forEach(({ texture: t }) => e.deleteTexture(t)), [...t.passes, ...Object.values(t.extras).filter(Boolean)].forEach((t) => {
2059
2062
  e.deleteProgram(t.program), e.deleteVertexArray(t.vao), e.deleteBuffer(t.buffer);
2060
2063
  });
2061
2064
  }
2062
- function ln(e, t = {}) {
2063
- let n = t.gl || e.getContext("webgl2", $t);
2065
+ function on(e, t = {}) {
2066
+ let n = t.gl || e.getContext("webgl2", Xt);
2064
2067
  if (!n) throw Error("WebGL2 is not available");
2065
- let i = t.mapStyle || (() => x), a = {
2068
+ let r = t.mapStyle || (() => d), i = {
2066
2069
  uploads: 0,
2067
2070
  draws: 0
2068
- }, o = sn(n), s = !1, c = 0, l = 0, u = null, d = null, f, p = null;
2069
- function m(e) {
2070
- return o.extras[e] || (o.extras[e] = an(n, on[e], o.corners)), o.extras[e];
2071
+ }, s = rn(n), c = !1, l = 0, u = 0, f = null, p = null, m, h = null;
2072
+ function g(e) {
2073
+ return s.extras[e] || (s.extras[e] = tn(n, nn[e], s.corners)), s.extras[e];
2071
2074
  }
2072
- function h() {
2073
- o.passes.forEach((e) => {
2074
- let t = u[e.spec.name];
2075
+ function _() {
2076
+ s.passes.forEach((e) => {
2077
+ let t = f[e.spec.name];
2075
2078
  e.count = t.count, t.count && (n.bindBuffer(n.ARRAY_BUFFER, e.buffer), n.bufferData(n.ARRAY_BUFFER, t.data, n.DYNAMIC_DRAW));
2076
2079
  });
2077
- for (let e of Object.keys(on)) {
2078
- let t = u[e];
2079
- if (!t.count && !o.extras[e]) continue;
2080
- let r = m(e);
2080
+ for (let e of Object.keys(nn)) {
2081
+ let t = f[e];
2082
+ if (!t.count && !s.extras[e]) continue;
2083
+ let r = g(e);
2081
2084
  r.count = t.count, t.count && (n.bindBuffer(n.ARRAY_BUFFER, r.buffer), n.bufferData(n.ARRAY_BUFFER, t.data, n.DYNAMIC_DRAW));
2082
2085
  }
2083
- a.uploads++;
2086
+ i.uploads++;
2084
2087
  }
2085
- function g(e, t) {
2088
+ function v(e, t) {
2086
2089
  n.bindTexture(n.TEXTURE_2D, e), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, t ? n.NEAREST : n.LINEAR_MIPMAP_LINEAR), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MAG_FILTER, t ? n.NEAREST : n.LINEAR);
2087
2090
  }
2088
- function _(e, t, r) {
2089
- let i = o.textures.get(e);
2091
+ function y(e, t, r) {
2092
+ let i = s.textures.get(e);
2090
2093
  if (!i || i.image !== t) {
2091
2094
  i && n.deleteTexture(i.texture);
2092
2095
  let r = n.createTexture();
@@ -2094,92 +2097,92 @@ function ln(e, t = {}) {
2094
2097
  image: t,
2095
2098
  texture: r,
2096
2099
  pixelated: null
2097
- }, o.textures.set(e, i);
2100
+ }, s.textures.set(e, i);
2098
2101
  }
2099
- return i.pixelated !== r && (g(i.texture, r), i.pixelated = r), i.texture;
2102
+ return i.pixelated !== r && (v(i.texture, r), i.pixelated = r), i.texture;
2100
2103
  }
2101
- function v(t, m, g) {
2102
- if (p = [
2104
+ function b(t, d, g) {
2105
+ if (h = [
2103
2106
  t,
2104
- m,
2107
+ d,
2105
2108
  g
2106
- ], s || !o || !c || !l) return;
2107
- let v = i(), y = S(t, v), b = v.values ? v.values[A] : void 0;
2108
- (o.iconStore !== v.icons || o.glyphInk !== b) && (o.textures.forEach(({ texture: e }) => n.deleteTexture(e)), o.textures.clear(), o.iconStore = v.icons, o.glyphInk = b, d = null), (y !== d || y.version !== f) && (u = {
2109
- ...qt(y),
2110
- strokes: Jt(y),
2111
- icons: Yt(y, (e) => ge(e) ? !!be(_e(e), b) : se(e) ? !!E(r(e).type, r(e).ink) : !!(v.icons && v.icons.get(e)), v)
2112
- }, d = y, f = y.version, h());
2113
- let x = y.theme || "dark";
2114
- (o.theme !== x || o.styleKey !== nn(v)) && rn(n, o, x, v), n.viewport(0, 0, e.width, e.height), n.clearColor(0, 0, 0, 0), n.clear(n.COLOR_BUFFER_BIT), n.enable(n.BLEND), n.blendFunc(n.ONE, n.ONE_MINUS_SRC_ALPHA), o.passes.forEach((t) => {
2115
- t.count && (n.useProgram(t.program), n.uniform2f(t.uniforms.viewport, c, l), n.uniform3f(t.uniforms.cam, m.x, m.y, m.zoom), n.uniform1f(t.uniforms.dpr, e.width / c), n.bindVertexArray(t.vao), t.uniforms.time && n.uniform1f(t.uniforms.time, (g || 0) / 1e3), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, t.spec.verts || 4, t.count), a.draws++);
2109
+ ], c || !s || !l || !u) return;
2110
+ let v = r(), b = x(t, v), S = v.values ? v.values[o] : void 0;
2111
+ (s.iconStore !== v.icons || s.glyphInk !== S) && (s.textures.forEach(({ texture: e }) => n.deleteTexture(e)), s.textures.clear(), s.iconStore = v.icons, s.glyphInk = S, p = null), (b !== p || b.version !== m) && (f = {
2112
+ ...Wt(b),
2113
+ strokes: Gt(b),
2114
+ icons: Kt(b, (e) => de(e) ? !!he(fe(e), S) : a(e) ? !!oe(ae(e).type, ae(e).ink) : !!(v.icons && v.icons.get(e)), v)
2115
+ }, p = b, m = b.version, _());
2116
+ let C = b.theme || "dark";
2117
+ (s.theme !== C || s.styleKey !== $t(v)) && en(n, s, C, v), n.viewport(0, 0, e.width, e.height), n.clearColor(0, 0, 0, 0), n.clear(n.COLOR_BUFFER_BIT), n.enable(n.BLEND), n.blendFunc(n.ONE, n.ONE_MINUS_SRC_ALPHA), s.passes.forEach((t) => {
2118
+ t.count && (n.useProgram(t.program), n.uniform2f(t.uniforms.viewport, l, u), n.uniform3f(t.uniforms.cam, d.x, d.y, d.zoom), n.uniform1f(t.uniforms.dpr, e.width / l), n.bindVertexArray(t.vao), t.uniforms.time && n.uniform1f(t.uniforms.time, (g || 0) / 1e3), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, t.spec.verts || 4, t.count), i.draws++);
2116
2119
  });
2117
- let C = o.extras.strokes;
2118
- C && C.count && (n.useProgram(C.program), n.uniform2f(C.uniforms.viewport, c, l), n.uniform3f(C.uniforms.cam, m.x, m.y, m.zoom), n.uniform1f(C.uniforms.dpr, e.width / c), n.bindVertexArray(C.vao), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, C.count), a.draws++);
2119
- let w = o.extras.icons;
2120
- if (w && w.count) {
2121
- n.useProgram(w.program), n.uniform2f(w.uniforms.viewport, c, l), n.uniform3f(w.uniforms.cam, m.x, m.y, m.zoom), n.uniform1f(w.uniforms.dpr, e.width / c), n.uniform1i(w.at("u_tex"), 0), n.activeTexture(n.TEXTURE0), n.bindVertexArray(w.vao), n.bindBuffer(n.ARRAY_BUFFER, w.buffer);
2122
- for (let e of u.icons.groups) {
2123
- let t = ge(e.kind), i = se(e.kind), o = t || i ? 14 : 0;
2124
- if (o && e.maxR * 2 * m.zoom < o) continue;
2125
- n.uniform1f(w.at("u_minR"), o / 2), n.uniform1f(w.at("u_sideRatio"), t ? 1 : i ? G : 1);
2126
- let s = t ? be(_e(e.kind), v.values && v.values["--corn-map-glyph"]) : i ? E(r(e.kind).type, r(e.kind).ink) : v.icons && v.icons.get(e.kind);
2127
- s && (n.bindTexture(n.TEXTURE_2D, _(e.kind, s, !!v.pixelated && !t && !i)), n.vertexAttribPointer(1, 4, n.FLOAT, !1, 16, e.first * 4 * 4), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, e.count), a.draws++);
2120
+ let w = s.extras.strokes;
2121
+ w && w.count && (n.useProgram(w.program), n.uniform2f(w.uniforms.viewport, l, u), n.uniform3f(w.uniforms.cam, d.x, d.y, d.zoom), n.uniform1f(w.uniforms.dpr, e.width / l), n.bindVertexArray(w.vao), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, w.count), i.draws++);
2122
+ let T = s.extras.icons;
2123
+ if (T && T.count) {
2124
+ n.useProgram(T.program), n.uniform2f(T.uniforms.viewport, l, u), n.uniform3f(T.uniforms.cam, d.x, d.y, d.zoom), n.uniform1f(T.uniforms.dpr, e.width / l), n.uniform1i(T.at("u_tex"), 0), n.activeTexture(n.TEXTURE0), n.bindVertexArray(T.vao), n.bindBuffer(n.ARRAY_BUFFER, T.buffer);
2125
+ for (let e of f.icons.groups) {
2126
+ let t = de(e.kind), r = a(e.kind), o = t || r ? 14 : 0;
2127
+ if (o && e.maxR * 2 * d.zoom < o) continue;
2128
+ n.uniform1f(T.at("u_minR"), o / 2), n.uniform1f(T.at("u_sideRatio"), t ? 1 : r ? K : 1);
2129
+ let s = t ? he(fe(e.kind), v.values && v.values["--corn-map-glyph"]) : r ? oe(ae(e.kind).type, ae(e.kind).ink) : v.icons && v.icons.get(e.kind);
2130
+ s && (n.bindTexture(n.TEXTURE_2D, y(e.kind, s, !!v.pixelated && !t && !r)), n.vertexAttribPointer(1, 4, n.FLOAT, !1, 16, e.first * 4 * 4), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, e.count), i.draws++);
2128
2131
  }
2129
2132
  }
2130
2133
  n.bindVertexArray(null);
2131
2134
  }
2132
- let y = (e) => {
2133
- e.preventDefault(), s = !0, o = null;
2134
- }, b = () => {
2135
+ let S = (e) => {
2136
+ e.preventDefault(), c = !0, s = null;
2137
+ }, C = () => {
2135
2138
  try {
2136
- o = sn(n, p && p[0].theme || "dark", i()), s = !1, u && h(), p && v(...p);
2139
+ s = rn(n, h && h[0].theme || "dark", r()), c = !1, f && _(), h && b(...h);
2137
2140
  } catch (e) {
2138
2141
  console.warn("WebGL2 context restored but the renderer could not be rebuilt:", e.message);
2139
2142
  }
2140
2143
  };
2141
- return e.addEventListener("webglcontextlost", y), e.addEventListener("webglcontextrestored", b), {
2144
+ return e.addEventListener("webglcontextlost", S), e.addEventListener("webglcontextrestored", C), {
2142
2145
  kind: "webgl2",
2143
- stats: a,
2146
+ stats: i,
2144
2147
  resize(t, n, r) {
2145
- c = t, l = n, e.width = Math.round(t * r), e.height = Math.round(n * r), p && v(...p);
2148
+ l = t, u = n, e.width = Math.round(t * r), e.height = Math.round(n * r), h && b(...h);
2146
2149
  },
2147
- draw: v,
2148
- destroy: C,
2150
+ draw: b,
2151
+ destroy: w,
2149
2152
  release() {
2150
- let e = s;
2151
- C();
2153
+ let e = c;
2154
+ w();
2152
2155
  try {
2153
2156
  let t = !e && n.getExtension ? n.getExtension("WEBGL_lose_context") : null;
2154
2157
  t && t.loseContext();
2155
2158
  } catch {}
2156
2159
  }
2157
2160
  };
2158
- function C() {
2159
- e.removeEventListener("webglcontextlost", y), e.removeEventListener("webglcontextrestored", b), o && !s && cn(n, o), o = null, s = !0;
2161
+ function w() {
2162
+ e.removeEventListener("webglcontextlost", S), e.removeEventListener("webglcontextrestored", C), s && !c && an(n, s), s = null, c = !0;
2160
2163
  }
2161
2164
  }
2162
2165
  // ../explorer/renderer.js
2163
- function un(e) {
2166
+ function sn(e) {
2164
2167
  let t = e.ownerDocument.createElement("canvas");
2165
2168
  return t.className = "hx-overlay", t.setAttribute("data-corn", "map-overlay"), t.setAttribute("part", "map-overlay"), t.setAttribute("aria-hidden", "true"), e.after(t), t;
2166
2169
  }
2167
- function dn(e, t = {}) {
2170
+ function cn(e, t = {}) {
2168
2171
  let n = t.prefer || null, r = t.mapStyle ? { mapStyle: t.mapStyle } : {};
2169
- if (n === "canvas2d") return Le(e, r);
2172
+ if (n === "canvas2d") return Me(e, r);
2170
2173
  let i = null;
2171
2174
  try {
2172
- i = e.getContext("webgl2", $t);
2175
+ i = e.getContext("webgl2", Xt);
2173
2176
  } catch {}
2174
- if (!i) return Le(e, r);
2177
+ if (!i) return Me(e, r);
2175
2178
  try {
2176
- return ln(e, {
2179
+ return on(e, {
2177
2180
  gl: i,
2178
2181
  ...r
2179
2182
  });
2180
2183
  } catch (n) {
2181
2184
  console.warn(`WebGL2 renderer unavailable, drawing with Canvas 2D: ${n.message}`);
2182
- let i = (t.makeStandIn || un)(e), a = Le(i, r);
2185
+ let i = (t.makeStandIn || sn)(e), a = Me(i, r);
2183
2186
  return {
2184
2187
  ...a,
2185
2188
  destroy() {
@@ -2189,7 +2192,7 @@ function dn(e, t = {}) {
2189
2192
  }
2190
2193
  }
2191
2194
  // ../explorer/cluster.js
2192
- function fn(e, t) {
2195
+ function ln(e, t) {
2193
2196
  let n = /* @__PURE__ */ new Map();
2194
2197
  for (let e of t) !e.kind && !e.dashed && e.from && e.to && (n.get(e.from) || n.set(e.from, []).get(e.from)).push(e.to);
2195
2198
  let r = /* @__PURE__ */ new Set([e]), i = [e];
@@ -2197,38 +2200,38 @@ function fn(e, t) {
2197
2200
  return r;
2198
2201
  }
2199
2202
  // ../explorer/input.js
2200
- function pn(e) {
2201
- let { state: t } = e, { render: n, getSpatialIndex: r, queueFrameWork: i, screenToWorld: a, getMinZoom: o, setHoverNode: s, labelNodeAt: c, fitGraphToViewport: u, fitPadding: d } = e.map, f = (t) => e.emit("select", t), m = () => e.emit("background"), g = () => e.emit("grab"), _ = !1, v = null, y = {
2203
+ function un(e) {
2204
+ let { state: t } = e, { render: n, getSpatialIndex: r, queueFrameWork: i, screenToWorld: a, getMinZoom: o, setHoverNode: s, labelNodeAt: c, fitGraphToViewport: l, fitPadding: d } = e.map, f = (t) => e.emit("select", t), p = () => e.emit("background"), m = () => e.emit("grab"), g = !1, _ = null, v = {
2202
2205
  x: 0,
2203
2206
  y: 0
2204
- }, b = {
2207
+ }, y = {
2205
2208
  x: 0,
2206
2209
  y: 0
2207
- }, x = !1, S = null, C = null, w = 0, E = null, D = !1, O = null, k = null, A = null, j = !1, M = "", N = () => t.isFreeform && t.view === "orbit";
2208
- function P(e) {
2210
+ }, b = !1, x = null, S = null, C = 0, w = null, T = !1, E = null, D = null, O = null, k = !1, A = "", ee = () => t.isFreeform && t.view === "orbit";
2211
+ function j(e) {
2209
2212
  let n = t.canvas.getBoundingClientRect(), r = e.touches ? e.touches[0] : e, i = n.width && t.width ? t.width / n.width : 1, a = n.height && t.height ? t.height / n.height : 1;
2210
2213
  return {
2211
2214
  x: (r.clientX - n.left) * i,
2212
2215
  y: (r.clientY - n.top) * a
2213
2216
  };
2214
2217
  }
2215
- let F = {
2218
+ let N = {
2216
2219
  nodes: null,
2217
2220
  size: -1,
2218
2221
  map: null
2219
2222
  };
2220
- function I(e) {
2221
- return (F.nodes !== t.nodes || F.size !== t.nodes.length) && (F = {
2223
+ function P(e) {
2224
+ return (N.nodes !== t.nodes || N.size !== t.nodes.length) && (N = {
2222
2225
  nodes: t.nodes,
2223
2226
  size: t.nodes.length,
2224
2227
  map: new Map(t.nodes.map((e) => [e.id, e]))
2225
- }), F.map.get(e) || null;
2228
+ }), N.map.get(e) || null;
2226
2229
  }
2227
- function ee(e, n, i) {
2228
- let a = Be(r(), t.camera, e, n, i);
2229
- return a ? I(a.id) : null;
2230
+ function F(e, n, i) {
2231
+ let a = Fe(r(), t.camera, e, n, i);
2232
+ return a ? P(a.id) : null;
2230
2233
  }
2231
- let te = (e) => Math.hypot(e.touches[0].clientX - e.touches[1].clientX, e.touches[0].clientY - e.touches[1].clientY);
2234
+ let I = (e) => Math.hypot(e.touches[0].clientX - e.touches[1].clientX, e.touches[0].clientY - e.touches[1].clientY);
2232
2235
  function L(e) {
2233
2236
  let n = t.canvas.getBoundingClientRect();
2234
2237
  return {
@@ -2236,100 +2239,100 @@ function pn(e) {
2236
2239
  y: (e.touches[0].clientY + e.touches[1].clientY) / 2 - n.top
2237
2240
  };
2238
2241
  }
2239
- function R(e) {
2240
- if (D = !0, g(), s(null), e.touches && e.touches.length === 2) {
2241
- E = l(t.camera, te(e), L(e)), O = null, _ = !1, v = null, S = null;
2242
+ function z(e) {
2243
+ if (T = !0, m(), s(null), e.touches && e.touches.length === 2) {
2244
+ w = te(t.camera, I(e), L(e)), E = null, g = !1, _ = null, x = null;
2242
2245
  return;
2243
2246
  }
2244
- let n = !!(e.touches && e.touches.length > 0), r = P(e);
2245
- b = {
2247
+ let n = !!(e.touches && e.touches.length > 0), r = j(e);
2248
+ y = {
2246
2249
  x: r.x,
2247
2250
  y: r.y
2248
- }, x = !1, O = null, S = ee(r.x, r.y, n), N() && S ? (v = S, e.cancelable && e.preventDefault()) : (_ = !0, y = r);
2251
+ }, b = !1, E = null, x = F(r.x, r.y, n), ee() && x ? (_ = x, e.cancelable && e.preventDefault()) : (g = !0, v = r);
2249
2252
  }
2250
- function ne() {
2251
- k && E && Object.assign(t.camera, T(E, k.dist, k.mid, o())), k = null;
2252
- let n = O;
2253
- if (O = null, n) {
2254
- if (v && N()) {
2253
+ function B() {
2254
+ D && w && Object.assign(t.camera, R(w, D.dist, D.mid, o())), D = null;
2255
+ let n = E;
2256
+ if (E = null, n) {
2257
+ if (_ && ee()) {
2255
2258
  let r = a(n.x, n.y);
2256
- v.x = r.x, v.y = r.y, t.freeformPositions[v.id] = {
2259
+ _.x = r.x, _.y = r.y, t.freeformPositions[_.id] = {
2257
2260
  x: r.x,
2258
2261
  y: r.y
2259
- }, e.touchScene(), fe(e);
2260
- } else _ && (t.camera.x += n.x - y.x, t.camera.y += n.y - y.y, y = n);
2262
+ }, e.touchScene(), h(e);
2263
+ } else g && (t.camera.x += n.x - v.x, t.camera.y += n.y - v.y, v = n);
2261
2264
  }
2262
2265
  }
2263
- function z() {
2264
- let e = A;
2265
- if (A = null, !e || _ || v) return;
2266
- let t = ee(e.x, e.y, !1);
2267
- B(!!t), s(t ? t.id : null);
2266
+ function V() {
2267
+ let e = O;
2268
+ if (O = null, !e || g || _) return;
2269
+ let t = F(e.x, e.y, !1);
2270
+ H(!!t), s(t ? t.id : null);
2268
2271
  }
2269
- function B(e) {
2270
- e !== j && t.canvas && (e && (M = t.canvas.style.cursor), j = e, t.canvas.style.cursor = e ? "pointer" : M);
2272
+ function H(e) {
2273
+ e !== k && t.canvas && (e && (A = t.canvas.style.cursor), k = e, t.canvas.style.cursor = e ? "pointer" : A);
2271
2274
  }
2272
- function V(e) {
2273
- if (e.touches && e.touches.length === 2 && E) {
2274
- e.cancelable && e.preventDefault(), k = {
2275
- dist: te(e),
2275
+ function ne(e) {
2276
+ if (e.touches && e.touches.length === 2 && w) {
2277
+ e.cancelable && e.preventDefault(), D = {
2278
+ dist: I(e),
2276
2279
  mid: L(e)
2277
- }, i(ne);
2280
+ }, i(B);
2278
2281
  return;
2279
2282
  }
2280
- let t = P(e);
2281
- Math.hypot(t.x - b.x, t.y - b.y) > 8 && (x = !0), v && N() || _ ? (e.cancelable && e.preventDefault(), O = t, i(ne)) : e.touches || (A = t, i(z, { draw: !1 }));
2283
+ let t = j(e);
2284
+ Math.hypot(t.x - y.x, t.y - y.y) > 8 && (b = !0), _ && ee() || g ? (e.cancelable && e.preventDefault(), E = t, i(B)) : e.touches || (O = t, i(V, { draw: !1 }));
2282
2285
  }
2283
- function H(e) {
2284
- ne();
2286
+ function re(e) {
2287
+ B();
2285
2288
  let n = !!(e.changedTouches && e.changedTouches.length > 0), r = t.canvas.getBoundingClientRect(), i = n ? {
2286
2289
  x: e.changedTouches[0].clientX - r.left,
2287
2290
  y: e.changedTouches[0].clientY - r.top
2288
- } : P(e);
2289
- if (!x && D) {
2290
- if (S) {
2291
- let e = ee(i.x, i.y, n);
2292
- if (e && e.id === S.id) {
2293
- if (!N()) f(S);
2291
+ } : j(e);
2292
+ if (!b && T) {
2293
+ if (x) {
2294
+ let e = F(i.x, i.y, n);
2295
+ if (e && e.id === x.id) {
2296
+ if (!ee()) f(x);
2294
2297
  else {
2295
2298
  let e = Date.now();
2296
- C && C.id === S.id && e - w < 380 ? (f(S), C = null, w = 0) : (C = S, w = e);
2299
+ S && S.id === x.id && e - C < 380 ? (f(x), S = null, C = 0) : (S = x, C = e);
2297
2300
  }
2298
2301
  }
2299
2302
  } else {
2300
- let e = I(c(i.x, i.y));
2301
- e && h.includes(e.type) && e.id !== "root" ? u(d(), fn(e.id, t.edges)) : t.selectedNode && m();
2303
+ let e = P(c(i.x, i.y));
2304
+ e && u.includes(e.type) && e.id !== "root" ? l(d(), ln(e.id, t.edges)) : t.selectedNode && p();
2302
2305
  }
2303
2306
  }
2304
- _ = !1, v = null, S = null, E = null, k = null, D = !1;
2305
- }
2306
- let { canvas: U } = t, re = !(e.root && e.root.nodeType === 9), W = (r) => {
2307
- if (re && !r.ctrlKey && !r.metaKey && e.active() !== t.canvas) return;
2308
- r.preventDefault(), g();
2309
- let i = P(r);
2310
- Object.assign(t.camera, p(t.camera, r.deltaY < 0 ? 1.12 : .88, i.x, i.y, o())), n();
2311
- }, G = e.root || U, ie = [
2312
- e.listen(U, "mousedown", R),
2313
- e.listen(U, "mousemove", V),
2307
+ g = !1, _ = null, x = null, w = null, D = null, T = !1;
2308
+ }
2309
+ let { canvas: U } = t, ie = !(e.root && e.root.nodeType === 9), W = (r) => {
2310
+ if (ie && !r.ctrlKey && !r.metaKey && e.active() !== t.canvas) return;
2311
+ r.preventDefault(), m();
2312
+ let i = j(r);
2313
+ Object.assign(t.camera, M(t.camera, r.deltaY < 0 ? 1.12 : .88, i.x, i.y, o())), n();
2314
+ }, G = e.root || U, K = [
2315
+ e.listen(U, "mousedown", z),
2316
+ e.listen(U, "mousemove", ne),
2314
2317
  e.listen(U, "mouseleave", () => {
2315
- A = null, B(!1), s(null);
2318
+ O = null, H(!1), s(null);
2316
2319
  }),
2317
- e.listen(G, "mouseup", H),
2318
- e.listen(U, "touchstart", R, { passive: !1 }),
2319
- e.listen(U, "touchmove", V, { passive: !1 }),
2320
- e.listen(G, "touchend", H, { passive: !1 }),
2321
- e.listen(G, "touchcancel", H, { passive: !1 }),
2320
+ e.listen(G, "mouseup", re),
2321
+ e.listen(U, "touchstart", z, { passive: !1 }),
2322
+ e.listen(U, "touchmove", ne, { passive: !1 }),
2323
+ e.listen(G, "touchend", re, { passive: !1 }),
2324
+ e.listen(G, "touchcancel", re, { passive: !1 }),
2322
2325
  e.listen(U, "wheel", W, { passive: !1 })
2323
2326
  ];
2324
- return () => ie.forEach((e) => e());
2327
+ return () => K.forEach((e) => e());
2325
2328
  }
2326
2329
  // ../explorer/pieces/map.js
2327
- var mn = "Arrow keys pan, plus and minus zoom, 0 fits the map. N and P select the next and the previous node, Home and End the first and the last. F frames the selected node and what it lights. Escape clears the selection.", hn = "<canvas id=\"graph-canvas\" data-corn=\"map-canvas\" tabindex=\"0\" role=\"application\" aria-roledescription=\"map\" aria-label=\"Topology map\" aria-describedby=\"map-keys-help\"></canvas>", gn = ({ keysHelp: e = mn } = {}) => ({ stage: `${hn}
2328
- <p id="map-keys-help" class="hx-sr-only">${W(e)}</p>
2330
+ var dn = "Arrow keys pan, plus and minus zoom, 0 fits the map. N and P select the next and the previous node, Home and End the first and the last. F frames the selected node and what it lights. Escape clears the selection.", fn = "<canvas id=\"graph-canvas\" data-corn=\"map-canvas\" tabindex=\"0\" role=\"application\" aria-roledescription=\"map\" aria-label=\"Topology map\" aria-describedby=\"map-keys-help\"></canvas>", pn = ({ keysHelp: e = dn } = {}) => ({ stage: `${fn}
2331
+ <p id="map-keys-help" class="hx-sr-only">${A(e)}</p>
2329
2332
  <p id="map-announcer" class="hx-sr-only" role="status" aria-live="polite"></p>
2330
2333
  <canvas id="label-canvas" data-corn="label-canvas" aria-hidden="true"></canvas>` });
2331
- function _n(e, t, n) {
2332
- let r = j(t, e, "<div data-corn=\"map-stage\"></div>", null, "stage"), i = n.mountStatus(r[0], t, { follow: !1 });
2334
+ function mn(e, t, n) {
2335
+ let r = ie(t, e, "<div data-corn=\"map-stage\"></div>", null, "stage"), i = n.mountStatus(r[0], t, { follow: !1 });
2333
2336
  i.refuse("second-map"), t.emit("piece:refused", {
2334
2337
  piece: "map",
2335
2338
  reason: "second-map",
@@ -2351,16 +2354,16 @@ function _n(e, t, n) {
2351
2354
  }
2352
2355
  };
2353
2356
  }
2354
- function vn(e) {
2357
+ function hn(e) {
2355
2358
  let t = e.nodeType === 11 ? e.host : e;
2356
2359
  return t && typeof t.getRootNode == "function" ? t.getRootNode() : null;
2357
2360
  }
2358
- function yn(e, t, n = {}) {
2359
- return !t && n.src !== void 0 && n.src !== null && n.src !== "" ? bn(e, n) : xn(e, t, n, null);
2361
+ function gn(e, t, n = {}) {
2362
+ return !t && n.src !== void 0 && n.src !== null && n.src !== "" ? _n(e, n) : vn(e, t, n, null);
2360
2363
  }
2361
- function bn(e, t) {
2364
+ function _n(e, t) {
2362
2365
  let n = e.nodeType === 11 ? e.host : e, r = {}, i = null, a = !1;
2363
- return import("./scope-CmIkJ1qf.js").then((e) => e.n).then(({ mountScope: o }) => {
2366
+ return import("./scope-Dg_uzefP.js").then((e) => e.n).then(({ mountScope: o }) => {
2364
2367
  if (a) return;
2365
2368
  let s = o(n, {
2366
2369
  src: t.src,
@@ -2372,7 +2375,7 @@ function bn(e, t) {
2372
2375
  onAuth: t.onAuth,
2373
2376
  onError: t.onError
2374
2377
  });
2375
- i = xn(e, s.instance, {
2378
+ i = vn(e, s.instance, {
2376
2379
  ...t,
2377
2380
  ...r
2378
2381
  }, s);
@@ -2408,296 +2411,178 @@ function bn(e, t) {
2408
2411
  }
2409
2412
  };
2410
2413
  }
2411
- function xn(e, t, n, r) {
2412
- let i = !t;
2413
- i && (t = V({
2414
+ function vn(e, t, r, i) {
2415
+ let a = !t;
2416
+ a && (t = I({
2414
2417
  root: e,
2415
- base: n.base || "",
2416
- fetch: n.fetch,
2417
- strings: n.strings
2418
+ base: r.base || "",
2419
+ fetch: r.fetch,
2420
+ strings: r.strings
2418
2421
  }));
2419
- let a = U(t), o = () => {};
2420
- if (a) try {
2421
- o = t.attach(e);
2422
+ let o = z(t), s = () => {};
2423
+ if (o) try {
2424
+ s = t.attach(e);
2422
2425
  } catch {
2423
- return r && r.destroy(), _n(e, t, a);
2424
- }
2425
- let { state: s } = t, c = a ? a.source : null;
2426
- if (n.tokens) {
2427
- let t = vn(e);
2428
- t && ae(t.nodeType === 9 ? t : t.ownerDocument, n.tokens), t && t.nodeType === 11 && ae(t, n.tokens);
2429
- }
2430
- let l = ne(t);
2431
- l.own(o), r && l.own(() => r.destroy());
2432
- let u = (e) => e === "canvas2d" ? "canvas2d" : "auto", d = (e) => e === "light" || e === "dark" ? e : "auto", f = {
2433
- renderer: u(n.renderer),
2434
- theme: d(n.theme),
2426
+ return i && i.destroy(), mn(e, t, o);
2427
+ }
2428
+ let { state: c } = t, l = o ? o.source : null;
2429
+ if (r.tokens) {
2430
+ let t = hn(e);
2431
+ t && ne(t.nodeType === 9 ? t : t.ownerDocument, r.tokens), t && t.nodeType === 11 && ne(t, r.tokens);
2432
+ }
2433
+ let u = ee(t);
2434
+ u.own(s), i && u.own(() => i.destroy());
2435
+ let d = (e) => e === "canvas2d" ? "canvas2d" : "auto", f = (e) => e === "light" || e === "dark" ? e : "auto", p = {
2436
+ renderer: d(r.renderer),
2437
+ theme: f(r.theme),
2435
2438
  topology: void 0
2436
- }, p = n.topology !== void 0 && n.topology !== null, m = !1, h = !1, g = gn({ keysHelp: n.keysHelp }).stage, _ = n.slots && n.slots.stage ? n.slots : null, v = j(t, e, _ ? g : `<div data-corn="map-stage">${g}</div>`, _, "stage"), y = (e) => v.map((t) => t.matches(e) ? t : t.querySelector(e)).find(Boolean);
2437
- l.own(() => {
2438
- for (let e of [...v, s.canvas]) e && e.remove();
2439
+ }, h = r.topology !== void 0 && r.topology !== null, g = !1, _ = !1, v = pn({ keysHelp: r.keysHelp }).stage, y = r.slots && r.slots.stage ? r.slots : null, b = ie(t, e, y ? v : `<div data-corn="map-stage">${v}</div>`, y, "stage"), x = (e) => b.map((t) => t.matches(e) ? t : t.querySelector(e)).find(Boolean);
2440
+ u.own(() => {
2441
+ for (let e of [...b, c.canvas]) e && e.remove();
2439
2442
  });
2440
- let b = v.find((e) => e.matches("[data-corn=\"map-stage\"]")) || null;
2441
- if (c && b) {
2442
- let e = a.mountStatus(b, t, {
2443
- onRetry: () => c.load(),
2443
+ let S = b.find((e) => e.matches("[data-corn=\"map-stage\"]")) || null;
2444
+ if (l && S) {
2445
+ let e = o.mountStatus(S, t, {
2446
+ onRetry: () => l.load(),
2444
2447
  focusMap: () => {
2445
- s.canvas && s.canvas.focus();
2448
+ c.canvas && c.canvas.focus();
2446
2449
  }
2447
2450
  });
2448
- l.own(e.destroy);
2449
- }
2450
- s.canvas = y("[data-corn=\"map-canvas\"]"), s.labelCanvas = y("[data-corn=\"label-canvas\"]"), s.ctx = t.doc.createElement("canvas").getContext("2d");
2451
- let x = mt(t, n.measureCovered ? { measureCovered: n.measureCovered } : {}), S = ue(t);
2452
- l.own(S.watch()), l.own(S.onChange(() => x.render()));
2453
- let C = () => f.renderer === "canvas2d" ? "canvas2d" : null, w = () => x.setRenderer(dn(s.canvas, {
2454
- prefer: C(),
2455
- mapStyle: S.get
2456
- })), T = t.win && t.win.matchMedia ? t.win.matchMedia("(prefers-color-scheme: light)") : null;
2457
- function E() {
2458
- if (f.theme === "light" || f.theme === "dark") return f.theme;
2459
- if (a && (a.theme === "light" || a.theme === "dark")) return a.theme;
2451
+ u.own(e.destroy);
2452
+ }
2453
+ c.canvas = x("[data-corn=\"map-canvas\"]"), c.labelCanvas = x("[data-corn=\"label-canvas\"]"), c.ctx = t.doc.createElement("canvas").getContext("2d");
2454
+ let C = lt(t, r.measureCovered ? { measureCovered: r.measureCovered } : {}), w = n(t);
2455
+ u.own(w.watch()), u.own(w.onChange(() => C.render()));
2456
+ let T = () => p.renderer === "canvas2d" ? "canvas2d" : null, D = () => C.setRenderer(cn(c.canvas, {
2457
+ prefer: T(),
2458
+ mapStyle: w.get
2459
+ })), O = t.win && t.win.matchMedia ? t.win.matchMedia("(prefers-color-scheme: light)") : null;
2460
+ function A() {
2461
+ if (p.theme === "light" || p.theme === "dark") return p.theme;
2462
+ if (o && (o.theme === "light" || o.theme === "dark")) return o.theme;
2460
2463
  let e = t.doc && t.doc.documentElement, n = e ? e.getAttribute("data-theme") : null;
2461
- return n === "light" || n === "dark" ? n : ie("system", !!(T && T.matches));
2464
+ return n === "light" || n === "dark" ? n : m("system", !!(O && O.matches));
2462
2465
  }
2463
- function D() {
2464
- if (m) return;
2465
- let e = E();
2466
- S.refresh(), s.theme !== e && (s.theme = e, t.touchScene()), x.render();
2467
- }
2468
- s.theme = E(), a && l.own(a.serverTheme.adopt(e)), a && (l.on("theme", () => D()), l.on("scope:theme", () => D())), T && T.addEventListener && (T.addEventListener("change", D), l.own(() => T.removeEventListener("change", D)));
2469
- let O = t.win && t.win.MutationObserver;
2470
- if (O && t.doc && t.doc.documentElement) {
2471
- let e = new O(D);
2466
+ function M() {
2467
+ if (g) return;
2468
+ let e = A();
2469
+ w.refresh(), c.theme !== e && (c.theme = e, t.touchScene()), C.render();
2470
+ }
2471
+ c.theme = A(), o && u.own(o.serverTheme.adopt(e)), o && (u.on("theme", () => M()), u.on("scope:theme", () => M())), O && O.addEventListener && (O.addEventListener("change", M), u.own(() => O.removeEventListener("change", M)));
2472
+ let te = t.win && t.win.MutationObserver;
2473
+ if (te && t.doc && t.doc.documentElement) {
2474
+ let e = new te(M);
2472
2475
  e.observe(t.doc.documentElement, {
2473
2476
  attributes: !0,
2474
2477
  attributeFilter: ["data-theme", "class"]
2475
- }), l.own(() => e.disconnect());
2476
- }
2477
- w();
2478
- let k = () => vt(t), A = !1, M = () => {
2479
- s.nodes.length && (A = !s.width || !s.height, A || x.fitGraphToViewport(x.fitPadding()));
2480
- }, P = (e) => s.nodes.find((t) => t.id === e) || null, I = null;
2481
- l.on("select", (e) => B(t, e, { source: "tap" })), l.on("background", () => re(t, { source: "tap" })), l.on("grab", () => ee(t)), l.on("selection", ({ node: e, edge: t, source: r }) => {
2482
- m || ((e || t) && (I = null), n.onSelect && (e ? n.onSelect({
2478
+ }), u.own(() => e.disconnect());
2479
+ }
2480
+ D();
2481
+ let P = () => pt(t), F = !1, L = () => {
2482
+ c.nodes.length && (F = !c.width || !c.height, F || C.fitGraphToViewport(C.fitPadding()));
2483
+ }, R = (e) => c.nodes.find((t) => t.id === e) || null, B = null;
2484
+ u.on("select", (e) => G(t, e, { source: "tap" })), u.on("background", () => E(t, { source: "tap" })), u.on("grab", () => k(t)), u.on("selection", ({ node: e, edge: t, source: n }) => {
2485
+ g || ((e || t) && (B = null), r.onSelect && (e ? r.onSelect({
2483
2486
  id: e.id,
2484
2487
  kind: "node",
2485
- source: r
2486
- }) : t ? n.onSelect({
2488
+ source: n
2489
+ }) : t ? r.onSelect({
2487
2490
  id: `${t.from}->${t.to}`,
2488
2491
  kind: "edge",
2489
2492
  from: t.from,
2490
2493
  to: t.to,
2491
- source: r
2492
- }) : n.onSelect({
2494
+ source: n
2495
+ }) : r.onSelect({
2493
2496
  id: null,
2494
2497
  kind: null,
2495
- source: r
2498
+ source: n
2496
2499
  })));
2497
2500
  });
2498
- function te(e) {
2499
- let n = P(String(e));
2500
- return !n || m ? !1 : (B(t, n, {
2501
+ function V(e) {
2502
+ let n = R(String(e));
2503
+ return !n || g ? !1 : (G(t, n, {
2501
2504
  frame: !0,
2502
2505
  source: "api"
2503
2506
  }), !0);
2504
2507
  }
2505
- let L = () => {}, R = !!t.root && t.root.nodeType === 9;
2506
- function z() {
2507
- let e = s.canvas, n = [pn(t)];
2508
- R || n.push(t.listen(e, "pointerdown", (t) => {
2508
+ let H = () => {}, re = !!t.root && t.root.nodeType === 9;
2509
+ function U() {
2510
+ let e = c.canvas, n = [un(t)];
2511
+ re || n.push(t.listen(e, "pointerdown", (t) => {
2509
2512
  if (t.pointerType === "mouse" && e.setPointerCapture) try {
2510
2513
  e.setPointerCapture(t.pointerId);
2511
2514
  } catch {}
2512
- })), F(t), N(t), n.push(() => F(t)), L = () => n.forEach((e) => e());
2515
+ })), j(t), N(t), n.push(() => j(t)), H = () => n.forEach((e) => e());
2513
2516
  }
2514
- l.own(x.onPaint(() => {
2515
- A && s.width && s.height && M(), !h && s.nodes.length && (h = !0, n.onReady && n.onReady());
2516
- })), z(), l.own(() => L());
2517
- let H = () => {
2518
- !p && c && c.topology && c.topology !== f.topology && (f.topology = c.topology, W(c.topology));
2517
+ u.own(C.onPaint(() => {
2518
+ F && c.width && c.height && L(), !_ && c.nodes.length && (_ = !0, r.onReady && r.onReady());
2519
+ })), U(), u.own(() => H());
2520
+ let W = () => {
2521
+ !h && l && l.topology && l.topology !== p.topology && (p.topology = l.topology, K(l.topology));
2519
2522
  };
2520
- c && l.on("source", (e) => {
2521
- e.state === "ready" && H();
2522
- }), l.own(x.watchSize()), x.resize();
2523
- function W(e) {
2524
- let n = s.selectedNode ? s.selectedNode.id : null;
2525
- _t(t, e);
2526
- let r = n ? P(n) : null;
2527
- s.nodes.length && (k(), M());
2528
- let i = !r && I ? P(I) : null;
2529
- i && B(t, i, { source: "api" }), x.render(), x.ensureFlowLoop();
2530
- }
2531
- function G(e) {
2523
+ l && u.on("source", (e) => {
2524
+ e.state === "ready" && W();
2525
+ }), u.own(C.watchSize()), C.resize();
2526
+ function K(e) {
2527
+ let n = c.selectedNode ? c.selectedNode.id : null;
2528
+ ft(t, e);
2529
+ let r = n ? R(n) : null;
2530
+ c.nodes.length && (P(), L());
2531
+ let i = !r && B ? R(B) : null;
2532
+ i && G(t, i, { source: "api" }), C.render(), C.ensureFlowLoop();
2533
+ }
2534
+ function ae(e) {
2532
2535
  let n = e === "dataflow" ? "dataflow" : "orbit";
2533
- s.view !== n && (s.view = n, t.touchScene(), s.nodes.length && (k(), M(), x.ensureFlowLoop()));
2536
+ c.view !== n && (c.view = n, t.touchScene(), c.nodes.length && (P(), L(), C.ensureFlowLoop()));
2534
2537
  }
2535
2538
  function oe() {
2536
- let e = x.getRenderer();
2537
- e.release ? e.release() : e.destroy(), L();
2539
+ let e = C.getRenderer();
2540
+ e.release ? e.release() : e.destroy(), H();
2538
2541
  let n = t.doc.createElement("template");
2539
- n.innerHTML = hn;
2542
+ n.innerHTML = fn;
2540
2543
  let r = n.content.firstElementChild;
2541
2544
  r.setAttribute("part", "map-canvas");
2542
- let i = t.active() === s.canvas;
2543
- s.canvas.replaceWith(r), s.canvas = r, z(), w(), x.resize(), i && r.focus();
2545
+ let i = t.active() === c.canvas;
2546
+ c.canvas.replaceWith(r), c.canvas = r, U(), D(), C.resize(), i && r.focus();
2544
2547
  }
2545
2548
  function se(e = {}) {
2546
- if (!m) {
2549
+ if (!g) {
2547
2550
  if ("renderer" in e) {
2548
- let t = u(e.renderer);
2549
- t !== f.renderer && (f.renderer = t, oe());
2551
+ let t = d(e.renderer);
2552
+ t !== p.renderer && (p.renderer = t, oe());
2550
2553
  }
2551
2554
  if ("theme" in e) {
2552
- let t = d(e.theme);
2553
- t !== f.theme && (f.theme = t, D());
2555
+ let t = f(e.theme);
2556
+ t !== p.theme && (p.theme = t, M());
2554
2557
  }
2555
- if ("topology" in e && (p = e.topology !== void 0 && e.topology !== null, p && e.topology !== f.topology ? (f.topology = e.topology, W(e.topology)) : !p && c && c.topology ? (f.topology = void 0, H()) : !p && e.topology !== f.topology && (f.topology = e.topology, W(e.topology))), "view" in e && G(e.view === "dataflow" ? "dataflow" : "orbit"), "node" in e) {
2558
+ if ("topology" in e && (h = e.topology !== void 0 && e.topology !== null, h && e.topology !== p.topology ? (p.topology = e.topology, K(e.topology)) : !h && l && l.topology ? (p.topology = void 0, W()) : !h && e.topology !== p.topology && (p.topology = e.topology, K(e.topology))), "view" in e && ae(e.view === "dataflow" ? "dataflow" : "orbit"), "node" in e) {
2556
2559
  let n = e.node == null || e.node === "" ? null : String(e.node);
2557
- if (n === null) I = null, (s.selectedNode || s.selectedEdge) && re(t, { source: "api" });
2560
+ if (n === null) B = null, (c.selectedNode || c.selectedEdge) && E(t, { source: "api" });
2558
2561
  else {
2559
- let e = P(n);
2560
- e ? s.selectedNode && s.selectedNode.id === n || B(t, e, { source: "api" }) : I = n;
2562
+ let e = R(n);
2563
+ e ? c.selectedNode && c.selectedNode.id === n || G(t, e, { source: "api" }) : B = n;
2561
2564
  }
2562
2565
  }
2563
2566
  }
2564
2567
  }
2565
2568
  function ce() {
2566
- m || (m = !0, l.destroy(), x.destroy(), i && t.destroy());
2569
+ g || (g = !0, u.destroy(), C.destroy(), a && t.destroy());
2567
2570
  }
2568
- let le = {};
2571
+ let q = {};
2569
2572
  for (let e of [
2570
2573
  "topology",
2571
2574
  "view",
2572
2575
  "node"
2573
- ]) n[e] !== void 0 && (le[e] = n[e]);
2574
- return se(le), H(), D(), {
2576
+ ]) r[e] !== void 0 && (q[e] = r[e]);
2577
+ return se(q), W(), M(), {
2575
2578
  inst: t,
2576
- map: x,
2579
+ map: C,
2577
2580
  update: se,
2578
2581
  destroy: ce,
2579
- fit: M,
2580
- focusNode: te,
2581
- refresh: D,
2582
- applyTheme: (e) => S.applyTheme(e)
2582
+ fit: L,
2583
+ focusNode: V,
2584
+ refresh: M,
2585
+ applyTheme: (e) => w.applyTheme(e)
2583
2586
  };
2584
2587
  }
2585
- // \0stencil-css:/home/runner/work/CornField/CornField/explorer/pieces/map-stage?tag=corn-map&encapsulation=shadow&__ext=css
2586
- var Sn = () => "[data-corn=map-stage]{background:var(--corn-ground-image), var(--corn-ground);width:100%;height:100%;min-height:16rem;display:block;position:relative;overflow:hidden}[data-corn=map-canvas]{cursor:grab;touch-action:none;width:100%;height:100%;display:block;position:absolute;inset:0}[data-corn=map-canvas]:active{cursor:grabbing}[data-corn=map-canvas]:focus-visible{outline:var(--corn-focus-width) solid var(--corn-focus);outline-offset:calc(var(--corn-focus-width) * -1)}[data-corn=label-canvas]{pointer-events:none;width:100%;height:100%;position:absolute;inset:0}[data-corn=map-overlay]{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0}.hx-sr-only{clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;overflow:hidden;position:absolute!important}", Cn = () => "[data-corn=source-status]{z-index:2;box-sizing:border-box;align-items:center;gap:var(--corn-space-3);width:min(26rem, calc(100% - var(--corn-space-6) * 2));padding:var(--corn-space-6);border:var(--corn-border) solid var(--corn-line);border-radius:var(--corn-radius-lg);background:var(--corn-surface-1);color:var(--corn-text-2);box-shadow:var(--corn-shadow);text-align:center;font-family:var(--corn-font);font-size:var(--corn-text-md);flex-direction:column;line-height:1.5;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}[data-corn=source-status][hidden]{display:none}[data-corn=source-status]:focus-visible{outline:var(--corn-focus-width) solid var(--corn-focus);outline-offset:var(--corn-focus-offset)}[data-corn=source-status][data-corn-state=running]{box-shadow:none;color:var(--corn-text-3);background:0 0;border-color:#0000;padding:0}[data-corn=source-status][data-corn-state=running] [data-corn=source-title]{font-size:var(--corn-text-md);color:var(--corn-text-3);font-weight:400}[data-corn=source-status][data-corn-state=failure] [data-corn=source-title]{color:var(--corn-bad)}[data-corn=source-status][data-corn-state=waiting] [data-corn=source-title]{color:var(--corn-accent-text)}[data-corn=source-title],[data-corn=source-text]{margin:0}[data-corn=source-title]{font-size:var(--corn-text-lg);color:var(--corn-text);font-weight:600}[data-corn=source-text]{overflow-wrap:anywhere;user-select:text}[data-corn=source-origin]{font-family:var(--corn-mono);color:var(--corn-warn);overflow-wrap:anywhere;user-select:all}[data-corn=source-sign-in],[data-corn=source-retry]{box-sizing:border-box;min-height:max(var(--corn-control-height), 2.75rem);padding:0 var(--corn-space-6);border:var(--corn-border) solid var(--corn-line);border-radius:var(--corn-radius);background:var(--corn-surface-2);color:var(--corn-text);font-family:inherit;font-size:inherit;cursor:pointer;justify-content:center;align-items:center;text-decoration:none;display:inline-flex}[data-corn=source-sign-in]{border-color:var(--corn-accent);background:var(--corn-accent);color:var(--corn-text-on-accent);font-weight:600}[data-corn=source-sign-in]:hover{background:var(--corn-accent-hover)}[data-corn=source-retry]:hover{background:var(--corn-surface-3)}[data-corn=source-sign-in]:focus-visible,[data-corn=source-retry]:focus-visible{outline:var(--corn-focus-width) solid var(--corn-focus);outline-offset:var(--corn-focus-offset)}[data-corn=source-notice]{z-index:2;box-sizing:border-box;padding:var(--corn-space-3) var(--corn-space-6);background:var(--corn-surface-1);border-top:var(--corn-border) solid var(--corn-line-soft);color:var(--corn-text-2);font-family:var(--corn-font);font-size:var(--corn-text-sm);text-align:center;overflow-wrap:anywhere;margin:0;position:absolute;bottom:0;left:0;right:0}[data-corn=source-notice][hidden]{display:none}", wn = () => ":host{contain:layout;min-width:0;color:var(--corn-text);font-family:var(--corn-font);display:block;position:relative}:host([hidden]){display:none!important}", Tn = class extends n {
2587
- constructor(t) {
2588
- super(), t !== !1 && this.__registerHost(), this.__attachShadow(), this.cornSelect = e(this, "cornSelect", 7), this.cornReady = e(this, "cornReady", 7), this.cornAuth = e(this, "cornAuth", 7), this.cornError = e(this, "cornError", 7);
2589
- }
2590
- get el() {
2591
- return this;
2592
- }
2593
- topology;
2594
- node;
2595
- view = "map";
2596
- theme;
2597
- renderer = "auto";
2598
- src;
2599
- useTheme = !1;
2600
- cornSelect;
2601
- cornReady;
2602
- cornAuth;
2603
- cornError;
2604
- piece = null;
2605
- scope = null;
2606
- loaded = !1;
2607
- changes = {};
2608
- connectedCallback() {
2609
- this.loaded && this.mountPiece();
2610
- }
2611
- componentDidLoad() {
2612
- this.loaded = !0, this.mountPiece();
2613
- }
2614
- disconnectedCallback() {
2615
- this.unmountPiece();
2616
- }
2617
- unmountPiece() {
2618
- this.piece && this.piece.destroy(), this.piece = null, this.scope && this.scope.leave(), this.scope = null;
2619
- }
2620
- remount() {
2621
- this.unmountPiece(), this.loaded && this.el.isConnected && this.mountPiece();
2622
- }
2623
- mountPiece() {
2624
- !this.piece && this.el.shadowRoot && (this.changes = {}, this.scope = k(this.el, () => this.remount()), this.piece = yn(this.el.shadowRoot, this.scope.inst, {
2625
- topology: this.topology,
2626
- view: this.view,
2627
- node: this.node,
2628
- theme: this.theme,
2629
- renderer: this.renderer,
2630
- tokens: oe,
2631
- src: this.src,
2632
- useTheme: this.useTheme,
2633
- version: "0.50.0",
2634
- pageUrl: () => typeof location > "u" ? "" : location.href,
2635
- onAuth: (e) => this.cornAuth.emit(e),
2636
- onError: (e) => this.cornError.emit(e),
2637
- onSelect: (e) => {
2638
- this.node = e.kind === "node" ? e.id : null, delete this.changes.node, this.cornSelect.emit(e);
2639
- },
2640
- onReady: () => this.cornReady.emit()
2641
- }));
2642
- }
2643
- componentDidRender() {
2644
- let e = this.changes;
2645
- this.changes = {}, this.piece && Object.keys(e).length && this.piece.update(e);
2646
- }
2647
- changed(e, t, n) {
2648
- this.changes[n] = e;
2649
- }
2650
- addressChanged() {
2651
- this.piece && this.scope && !this.scope.inst && this.remount();
2652
- }
2653
- async fit() {
2654
- this.piece && this.piece.fit();
2655
- }
2656
- async focusNode(e) {
2657
- this.piece && this.piece.focusNode(e);
2658
- }
2659
- async refresh() {
2660
- this.piece && this.piece.refresh();
2661
- }
2662
- static get watchers() {
2663
- return {
2664
- topology: [{ changed: 0 }],
2665
- view: [{ changed: 0 }],
2666
- node: [{ changed: 0 }],
2667
- theme: [{ changed: 0 }],
2668
- renderer: [{ changed: 0 }],
2669
- src: [{ addressChanged: 0 }],
2670
- useTheme: [{ addressChanged: 0 }]
2671
- };
2672
- }
2673
- static get style() {
2674
- return Sn() + Cn() + wn();
2675
- }
2676
- };
2677
- t(Tn, [
2678
- 513,
2679
- "corn-map",
2680
- {
2681
- topology: [16],
2682
- node: [1537],
2683
- view: [1],
2684
- theme: [513],
2685
- renderer: [1],
2686
- src: [1],
2687
- useTheme: [4, "use-theme"],
2688
- fit: [64],
2689
- focusNode: [64],
2690
- refresh: [64]
2691
- },
2692
- void 0,
2693
- {
2694
- topology: [{ changed: 0 }],
2695
- view: [{ changed: 0 }],
2696
- node: [{ changed: 0 }],
2697
- theme: [{ changed: 0 }],
2698
- renderer: [{ changed: 0 }],
2699
- src: [{ addressChanged: 0 }],
2700
- useTheme: [{ addressChanged: 0 }]
2701
- }
2702
- ]);
2703
- export { Tn as t };
2588
+ export { ft as i, pt as n, mt as r, gn as t };