@popcorn245/cornfield-components 0.50.1 → 0.51.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/dist/chunks/corn-map-up67JPxU.js +122 -0
- package/dist/chunks/corn-review-Dw-G3_0h.js +4417 -0
- package/dist/chunks/{_corn-default-tokens-DfrjTpZt.js → engine-ClfnAsgM.js} +990 -1046
- package/dist/chunks/{corn-map-Bd7PO6yD.js → map-B6AeKeiu.js} +772 -887
- package/dist/chunks/review-source-CPiFTfyc.js +60 -0
- package/dist/chunks/scope-Dg_uzefP.js +136 -0
- package/dist/chunks/source-address-B7hYRgt8.js +251 -0
- package/dist/chunks/status-CYQD5PwL.js +614 -0
- package/dist/corn-map.js +1 -1
- package/dist/corn-review.js +1 -0
- package/dist/corn-scope.js +3 -3
- package/dist/index.js +5 -4
- package/dist/manifest.json +57 -22
- package/dist/tokens.css +2 -0
- package/dist/types/components.d.ts +135 -0
- package/dist/types/corn-review.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/version.json +1 -1
- package/package.json +5 -1
- package/dist/chunks/scope-HD2C0JDl.js +0 -847
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
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 (
|
|
8
|
-
if (
|
|
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(
|
|
12
|
-
width:
|
|
13
|
-
height:
|
|
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 ${
|
|
17
|
-
let a = typeof t == "string" ? t :
|
|
18
|
-
i.strokeStyle =
|
|
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
|
|
22
|
+
return me.set(n, r), r;
|
|
24
23
|
}
|
|
25
24
|
// ../explorer/renderer-canvas2d.js
|
|
26
|
-
var
|
|
27
|
-
e.beginPath(), e.arc(t, n, r, 0,
|
|
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
|
|
28
|
+
function ve(e, t, n, r, i) {
|
|
30
29
|
if (t === "rounded-square" || t === "square") {
|
|
31
|
-
let a = i * (t === "square" ?
|
|
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 *
|
|
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 *
|
|
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
|
|
43
|
+
} else J(e, n, r, i);
|
|
45
44
|
}
|
|
46
|
-
function
|
|
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
|
|
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,
|
|
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
|
|
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
|
|
64
|
-
if (
|
|
65
|
-
let
|
|
66
|
-
|
|
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 (
|
|
69
|
-
let
|
|
70
|
-
|
|
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 (
|
|
73
|
-
let { cx:
|
|
74
|
-
cx:
|
|
75
|
-
cy:
|
|
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
|
-
|
|
76
|
+
Ce(t, n, Math.atan2(n.y2 - r, n.x2 - e), i);
|
|
78
77
|
}
|
|
79
|
-
|
|
78
|
+
a && n.packet && Te(t, n, r, i), t.restore();
|
|
80
79
|
}
|
|
81
|
-
function
|
|
82
|
-
let i = t.end || "triangle", { x2: a, y2: o, color:
|
|
83
|
-
if (e.beginPath(), i === "triangle") e.moveTo(a, o), e.lineTo(a - Math.cos(n -
|
|
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 =
|
|
86
|
-
let t =
|
|
87
|
-
e.moveTo(...
|
|
88
|
-
} else if (i === "bar") e.moveTo(...
|
|
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 =
|
|
91
|
-
e.moveTo(a, o), e.lineTo(...
|
|
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
|
|
97
|
-
let
|
|
98
|
-
|
|
99
|
-
for (let
|
|
100
|
-
let r = (
|
|
101
|
-
|
|
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
|
-
|
|
102
|
+
t.strokeStyle = n.color, t.lineWidth = Math.max(s.tickWidth, 1.5 / r), t.setLineDash([]), t.stroke();
|
|
104
103
|
}
|
|
105
|
-
function
|
|
106
|
-
let i =
|
|
107
|
-
a.glow && a.glow * r >=
|
|
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
|
|
110
|
-
e.save(), e.globalAlpha = t.alpha,
|
|
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
|
|
113
|
-
function
|
|
114
|
-
let t =
|
|
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 +
|
|
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
|
-
}),
|
|
117
|
+
}), Oe.set(e, t)), t;
|
|
119
118
|
}
|
|
120
|
-
function
|
|
121
|
-
let i =
|
|
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
|
|
124
|
+
function je(e, t, n, r, a) {
|
|
126
125
|
e.save(), e.globalAlpha = t.alpha;
|
|
127
|
-
let
|
|
128
|
-
|
|
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,
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
let c = t.icon &&
|
|
136
|
-
if (
|
|
137
|
-
let n = t.r *
|
|
138
|
-
e.imageSmoothingEnabled = !
|
|
139
|
-
} else if (
|
|
140
|
-
let n =
|
|
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 (
|
|
146
|
-
let n = t.r *
|
|
147
|
-
e.imageSmoothingEnabled = !0, e.drawImage(
|
|
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
|
|
152
|
-
let n = t.mapStyle || (() =>
|
|
153
|
-
if (
|
|
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
|
-
|
|
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
|
-
|
|
156
|
+
c = null;
|
|
158
157
|
}
|
|
159
|
-
return
|
|
160
|
-
},
|
|
161
|
-
function
|
|
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 &&
|
|
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,
|
|
169
|
-
|
|
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,
|
|
172
|
-
let
|
|
173
|
-
r.clearRect(0, 0,
|
|
174
|
-
let
|
|
175
|
-
if (
|
|
176
|
-
|
|
177
|
-
scene:
|
|
178
|
-
x:
|
|
179
|
-
y:
|
|
180
|
-
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(
|
|
184
|
-
e.packet &&
|
|
185
|
-
}),
|
|
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(
|
|
189
|
-
let { decor:
|
|
190
|
-
|
|
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
|
-
|
|
192
|
+
s = null, c = null, l = null;
|
|
194
193
|
}
|
|
195
194
|
};
|
|
196
195
|
}
|
|
197
|
-
var
|
|
198
|
-
function
|
|
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
|
-
|
|
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(
|
|
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 <=
|
|
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
|
|
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
|
|
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 =
|
|
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
|
|
256
|
-
function
|
|
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
|
|
268
|
-
let i =
|
|
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
|
|
279
|
-
function
|
|
280
|
-
let t =
|
|
281
|
-
return t || (t = e.edges.filter((e) => e.packet),
|
|
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
|
|
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) =>
|
|
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 >=
|
|
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
|
|
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
|
-
},
|
|
349
|
-
function
|
|
350
|
-
let { measure: r = null } = n, i =
|
|
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:
|
|
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(
|
|
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 =
|
|
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 /
|
|
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
|
|
399
|
-
let { max:
|
|
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 &&
|
|
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:
|
|
419
|
-
|
|
420
|
-
let
|
|
421
|
-
for (let e of
|
|
422
|
-
let t = Math.max(1, 1 /
|
|
423
|
-
|
|
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:
|
|
435
|
-
color:
|
|
436
|
-
width:
|
|
433
|
+
outline: l.node ? {
|
|
434
|
+
color: l.node.color,
|
|
435
|
+
width: l.node.width * t
|
|
437
436
|
} : null,
|
|
438
437
|
align: "center",
|
|
439
|
-
family:
|
|
438
|
+
family: _,
|
|
440
439
|
strike: !!e.node.labelStrike,
|
|
441
440
|
px: e.px,
|
|
442
441
|
screen: e.screen
|
|
443
442
|
});
|
|
444
443
|
}
|
|
445
|
-
let
|
|
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 *
|
|
454
|
-
e + a < 0 || e - a > n.width || i + a < 0 || i - a > n.height ||
|
|
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
|
|
460
|
+
let b = 0;
|
|
462
461
|
for (let r of e.edges) {
|
|
463
462
|
let i = r.label;
|
|
464
|
-
if (!i ||
|
|
465
|
-
let a = t.x + i.x *
|
|
466
|
-
if (a < 0 || a > n.width ||
|
|
467
|
-
let
|
|
468
|
-
l: a -
|
|
469
|
-
r: a +
|
|
470
|
-
t:
|
|
471
|
-
b:
|
|
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
|
-
|
|
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 +
|
|
478
|
-
size:
|
|
479
|
-
px:
|
|
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:
|
|
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 (
|
|
491
|
-
let n = e.nodes.find((e) => e.id ===
|
|
492
|
-
if (n && n.label && !
|
|
493
|
-
let r =
|
|
494
|
-
|
|
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 /
|
|
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:
|
|
506
|
+
outline: l.node,
|
|
508
507
|
align: "center",
|
|
509
|
-
family:
|
|
508
|
+
family: _,
|
|
510
509
|
strike: !1
|
|
511
510
|
});
|
|
512
511
|
}
|
|
513
512
|
}
|
|
514
|
-
return
|
|
513
|
+
return c;
|
|
515
514
|
}
|
|
516
|
-
var
|
|
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
|
|
522
|
-
e.font =
|
|
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 *
|
|
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
|
|
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
|
|
535
|
+
function at(e, t, n, r = nt) {
|
|
537
536
|
if (t.kind === "chip") {
|
|
538
|
-
|
|
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 =
|
|
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
|
|
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
|
|
561
|
-
let n = t.mapStyle || (() =>
|
|
562
|
-
let i = `${n ? "b" : "n"}${t}|${
|
|
563
|
-
return a === void 0 && (
|
|
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:
|
|
568
|
-
}), a = r.measureText(e).width,
|
|
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
|
|
571
|
+
return h && s ? ot(h, {
|
|
573
572
|
x: l,
|
|
574
573
|
y: u,
|
|
575
|
-
zoom:
|
|
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),
|
|
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 (
|
|
583
|
-
let
|
|
584
|
-
if (!
|
|
585
|
-
let w =
|
|
586
|
-
s = e, c = e.version, l = t.x, u = t.y,
|
|
587
|
-
let T =
|
|
588
|
-
|
|
589
|
-
let E =
|
|
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:
|
|
592
|
+
measure: b,
|
|
594
593
|
hover: C,
|
|
595
|
-
placed:
|
|
596
|
-
}), D =
|
|
597
|
-
for (let e of E) e.kind === "lane" &&
|
|
598
|
-
for (let e of E) e.kind === "node" && !e.screen &&
|
|
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 =
|
|
606
|
-
for (let e of E) e.kind === "node" && e.screen &&
|
|
607
|
-
for (let e of E) e.kind === "edge" &&
|
|
608
|
-
for (let e of E) e.kind === "chip" &&
|
|
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
|
-
|
|
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
|
|
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
|
|
626
|
+
function lt(e, t = {}) {
|
|
628
627
|
if (e.map) return e.map;
|
|
629
|
-
let { state:
|
|
630
|
-
throughChildren: !!
|
|
631
|
-
kind:
|
|
632
|
-
}) =>
|
|
633
|
-
function
|
|
634
|
-
return
|
|
635
|
-
}
|
|
636
|
-
let
|
|
637
|
-
function
|
|
638
|
-
return
|
|
639
|
-
}
|
|
640
|
-
function
|
|
641
|
-
|
|
642
|
-
}
|
|
643
|
-
function
|
|
644
|
-
let { canvas: t } =
|
|
645
|
-
|
|
646
|
-
let
|
|
647
|
-
|
|
648
|
-
}
|
|
649
|
-
function
|
|
650
|
-
let t =
|
|
651
|
-
if (!t || !
|
|
652
|
-
let i = new
|
|
653
|
-
|
|
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
|
|
660
|
-
let { nodes:
|
|
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,
|
|
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
|
-
}),
|
|
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
|
|
682
|
-
function
|
|
683
|
-
let e = `${
|
|
684
|
-
if (e !==
|
|
685
|
-
|
|
686
|
-
let t =
|
|
687
|
-
|
|
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
|
|
688
|
+
return k;
|
|
690
689
|
}
|
|
691
|
-
function
|
|
692
|
-
let { width:
|
|
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:
|
|
695
|
-
i.zoom =
|
|
696
|
-
}
|
|
697
|
-
let
|
|
698
|
-
x: (e -
|
|
699
|
-
y: (t -
|
|
700
|
-
}),
|
|
701
|
-
function
|
|
702
|
-
if (!
|
|
703
|
-
let e =
|
|
704
|
-
|
|
705
|
-
let t =
|
|
706
|
-
t && t.draw(e,
|
|
707
|
-
}
|
|
708
|
-
function
|
|
709
|
-
let n =
|
|
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
|
|
711
|
+
function F(e) {
|
|
713
712
|
let t = e || null;
|
|
714
|
-
if (
|
|
715
|
-
|
|
716
|
-
let
|
|
717
|
-
|
|
718
|
-
}
|
|
719
|
-
let
|
|
720
|
-
draw:
|
|
721
|
-
packetsVisible: () => !!
|
|
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: () =>
|
|
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
|
-
!
|
|
736
|
+
!o && r.canvas && B.markDirty();
|
|
738
737
|
}
|
|
739
|
-
function
|
|
740
|
-
!
|
|
738
|
+
function ne() {
|
|
739
|
+
!o && r.canvas && B.drawNow();
|
|
741
740
|
}
|
|
742
|
-
function
|
|
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
|
|
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
|
|
754
|
-
|
|
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
|
|
757
|
-
isNodeVisible:
|
|
758
|
-
isNodeVisibleToViewer:
|
|
755
|
+
let G = {
|
|
756
|
+
isNodeVisible: s,
|
|
757
|
+
isNodeVisibleToViewer: c,
|
|
759
758
|
getActiveSubgraph: l,
|
|
760
|
-
getScene:
|
|
761
|
-
sceneBuilds:
|
|
762
|
-
getSpatialIndex:
|
|
763
|
-
spatialBuilds:
|
|
764
|
-
getRenderer:
|
|
765
|
-
setRenderer:
|
|
766
|
-
resize:
|
|
767
|
-
watchSize:
|
|
768
|
-
getMinZoom:
|
|
769
|
-
fitGraphToViewport:
|
|
770
|
-
fitPadding:
|
|
771
|
-
screenToWorld:
|
|
772
|
-
labelNodeAt:
|
|
773
|
-
setHoverNode:
|
|
774
|
-
onPaint:
|
|
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:
|
|
777
|
-
addFrameClient:
|
|
775
|
+
renderNow: ne,
|
|
776
|
+
addFrameClient: re,
|
|
778
777
|
queueFrameWork: (e, t) => {
|
|
779
|
-
|
|
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
|
-
|
|
785
|
+
o || B.hold(e);
|
|
787
786
|
},
|
|
788
787
|
cancelFrame: () => B.cancel(),
|
|
789
788
|
ensureFlowLoop: () => {
|
|
790
|
-
|
|
789
|
+
o || B.wake();
|
|
791
790
|
},
|
|
792
|
-
destroy:
|
|
791
|
+
destroy: ie
|
|
793
792
|
};
|
|
794
|
-
return e.map =
|
|
793
|
+
return e.map = G, e.own(ie), G;
|
|
795
794
|
}
|
|
796
795
|
// ../explorer/flow-build.js
|
|
797
|
-
function
|
|
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
|
|
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
|
|
892
|
-
let { state: n } = e, { nodes: r, edges: i } =
|
|
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 =
|
|
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
|
|
896
|
+
function pt(e, { placeLive: t } = {}) {
|
|
898
897
|
let { state: n } = e;
|
|
899
|
-
|
|
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 &&
|
|
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
|
|
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,
|
|
909
|
-
let i =
|
|
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
|
-
})),
|
|
913
|
-
let a =
|
|
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
|
|
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,
|
|
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,
|
|
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
|
-
}),
|
|
929
|
+
}), re(n.nodes, n.edges), t && t(n.nodes, n.edges), e.touchScene();
|
|
927
930
|
}
|
|
928
931
|
// ../explorer/shaders.js
|
|
929
|
-
var
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
1379
|
+
`, It = {
|
|
1377
1380
|
none: 0,
|
|
1378
1381
|
selected: 1,
|
|
1379
1382
|
match: 2,
|
|
1380
1383
|
child: 3
|
|
1381
|
-
},
|
|
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
|
-
},
|
|
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 [
|
|
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
|
-
},
|
|
1403
|
-
function
|
|
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
|
-
|
|
1417
|
-
|
|
1419
|
+
Bt(It, e.halo),
|
|
1420
|
+
Bt(zt, e.mark),
|
|
1418
1421
|
o,
|
|
1419
|
-
|
|
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
|
|
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
|
|
1480
|
-
let
|
|
1482
|
+
function Ut(t) {
|
|
1483
|
+
let n = {
|
|
1481
1484
|
straight: [],
|
|
1482
1485
|
curved: [],
|
|
1483
1486
|
tips: [],
|
|
1484
1487
|
packets: []
|
|
1485
1488
|
};
|
|
1486
|
-
|
|
1487
|
-
let [
|
|
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
|
-
],
|
|
1493
|
-
if (t
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
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
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1502
|
+
v,
|
|
1503
|
+
t.width,
|
|
1504
|
+
f ? t.glow : 0,
|
|
1503
1505
|
r,
|
|
1504
1506
|
i,
|
|
1505
|
-
|
|
1506
|
-
d,
|
|
1507
|
-
f,
|
|
1508
|
-
p,
|
|
1509
|
-
h * s,
|
|
1510
|
-
c,
|
|
1507
|
+
a,
|
|
1511
1508
|
l,
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
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
|
-
|
|
1525
|
+
a,
|
|
1526
|
+
l,
|
|
1524
1527
|
o
|
|
1525
1528
|
]);
|
|
1526
1529
|
}
|
|
1527
|
-
if (
|
|
1528
|
-
let
|
|
1529
|
-
for (let
|
|
1530
|
-
let
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
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
|
-
|
|
1540
|
-
|
|
1541
|
+
a,
|
|
1542
|
+
l,
|
|
1543
|
+
Lt.tick
|
|
1541
1544
|
]);
|
|
1542
1545
|
}
|
|
1543
1546
|
}
|
|
1544
|
-
if (
|
|
1545
|
-
let
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
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
|
-
|
|
1551
|
-
n,
|
|
1553
|
+
u,
|
|
1552
1554
|
r,
|
|
1553
1555
|
i,
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
+
a,
|
|
1557
|
+
l,
|
|
1558
|
+
Lt.strike
|
|
1556
1559
|
]);
|
|
1557
1560
|
}
|
|
1558
|
-
if (
|
|
1559
|
-
let
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
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
|
-
|
|
1568
|
-
|
|
1569
|
+
v,
|
|
1570
|
+
e.speed,
|
|
1571
|
+
e.phase,
|
|
1569
1572
|
r,
|
|
1570
1573
|
i,
|
|
1571
1574
|
a,
|
|
1572
|
-
|
|
1573
|
-
|
|
1575
|
+
o * c,
|
|
1576
|
+
s,
|
|
1574
1577
|
l,
|
|
1575
1578
|
u,
|
|
1576
|
-
d *
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
+
d * o * c,
|
|
1580
|
+
e.radius,
|
|
1581
|
+
e.glow
|
|
1579
1582
|
]);
|
|
1580
1583
|
}
|
|
1581
1584
|
});
|
|
1582
|
-
let
|
|
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
|
|
1592
|
-
curved: n
|
|
1593
|
-
tips: n
|
|
1594
|
-
packets: n
|
|
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
|
|
1598
|
-
...
|
|
1599
|
-
nodes:
|
|
1600
|
-
...
|
|
1600
|
+
var Wt = (e) => ({
|
|
1601
|
+
...Ht(e),
|
|
1602
|
+
nodes: Vt(e),
|
|
1603
|
+
...Ut(e)
|
|
1601
1604
|
});
|
|
1602
|
-
function
|
|
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
|
|
1628
|
-
let
|
|
1630
|
+
function Kt(e, t, n = null) {
|
|
1631
|
+
let i = /* @__PURE__ */ new Map();
|
|
1629
1632
|
e.nodes.forEach((e) => {
|
|
1630
|
-
let
|
|
1631
|
-
if (!
|
|
1632
|
-
let
|
|
1633
|
-
t(
|
|
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 (!
|
|
1636
|
-
|
|
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
|
|
1642
|
-
|
|
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
|
-
|
|
1648
|
+
o,
|
|
1646
1649
|
e.alpha
|
|
1647
|
-
]),
|
|
1650
|
+
]), s.minR = Math.min(s.minR, e.r);
|
|
1648
1651
|
});
|
|
1649
|
-
let
|
|
1650
|
-
for (let [e, { rows: t, minR: n, maxR:
|
|
1652
|
+
let a = [], o = [];
|
|
1653
|
+
for (let [e, { rows: t, minR: n, maxR: r }] of i) a.push({
|
|
1651
1654
|
kind: e,
|
|
1652
|
-
first:
|
|
1655
|
+
first: o.length,
|
|
1653
1656
|
count: t.length,
|
|
1654
1657
|
minR: n,
|
|
1655
|
-
maxR:
|
|
1656
|
-
}),
|
|
1657
|
-
let
|
|
1658
|
-
return
|
|
1659
|
-
data:
|
|
1660
|
-
count:
|
|
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:
|
|
1665
|
+
groups: a
|
|
1663
1666
|
};
|
|
1664
1667
|
}
|
|
1665
|
-
function
|
|
1666
|
-
let { halo: n, mark: r, core:
|
|
1667
|
-
Object.entries(
|
|
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 && (
|
|
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
|
|
1677
|
-
return Object.entries(
|
|
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
|
-
|
|
1683
|
+
c.set($(n.color), t * 4);
|
|
1681
1684
|
let [i, a] = n.ringDash || [0, 0];
|
|
1682
|
-
|
|
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:
|
|
1690
|
-
haloRing:
|
|
1691
|
-
haloGeom:
|
|
1692
|
-
markColor:
|
|
1693
|
-
markGeom:
|
|
1692
|
+
haloFill: a,
|
|
1693
|
+
haloRing: o,
|
|
1694
|
+
haloGeom: s,
|
|
1695
|
+
markColor: c,
|
|
1696
|
+
markGeom: l,
|
|
1694
1697
|
markMin: new Float32Array([
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
+
w.ring,
|
|
1699
|
+
w.edge,
|
|
1700
|
+
w.gap
|
|
1698
1701
|
]),
|
|
1699
|
-
core: new Float32Array($(
|
|
1700
|
-
coreRatio:
|
|
1702
|
+
core: new Float32Array($(i)),
|
|
1703
|
+
coreRatio: b
|
|
1701
1704
|
};
|
|
1702
1705
|
}
|
|
1703
|
-
var
|
|
1706
|
+
var Jt = [
|
|
1704
1707
|
{
|
|
1705
1708
|
name: "grid",
|
|
1706
|
-
vert:
|
|
1707
|
-
frag:
|
|
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:
|
|
1722
|
-
frag:
|
|
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:
|
|
1750
|
-
frag:
|
|
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:
|
|
1773
|
-
frag:
|
|
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:
|
|
1813
|
-
frag:
|
|
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:
|
|
1853
|
-
frag:
|
|
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:
|
|
1877
|
-
frag:
|
|
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:
|
|
1911
|
-
frag:
|
|
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
|
-
],
|
|
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"),
|
|
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"),
|
|
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
|
-
},
|
|
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
|
|
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
|
|
1960
|
-
let i =
|
|
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
|
|
1968
|
-
function
|
|
1969
|
-
let i =
|
|
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),
|
|
1972
|
-
}), t.theme = n, t.styleKey =
|
|
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
|
|
1975
|
-
let r =
|
|
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
|
|
1998
|
+
var nn = {
|
|
1996
1999
|
strokes: {
|
|
1997
2000
|
name: "strokes",
|
|
1998
|
-
vert:
|
|
1999
|
-
frag:
|
|
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:
|
|
2022
|
-
frag:
|
|
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
|
|
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:
|
|
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
|
|
2058
|
+
return en(e, i, t, n), i;
|
|
2056
2059
|
}
|
|
2057
|
-
function
|
|
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
|
|
2063
|
-
let n = t.gl || e.getContext("webgl2",
|
|
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
|
|
2068
|
+
let r = t.mapStyle || (() => d), i = {
|
|
2066
2069
|
uploads: 0,
|
|
2067
2070
|
draws: 0
|
|
2068
|
-
},
|
|
2069
|
-
function
|
|
2070
|
-
return
|
|
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
|
|
2073
|
-
|
|
2074
|
-
let t =
|
|
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(
|
|
2078
|
-
let t =
|
|
2079
|
-
if (!t.count && !
|
|
2080
|
-
let r =
|
|
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
|
-
|
|
2086
|
+
i.uploads++;
|
|
2084
2087
|
}
|
|
2085
|
-
function
|
|
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
|
|
2089
|
-
let i =
|
|
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
|
-
},
|
|
2100
|
+
}, s.textures.set(e, i);
|
|
2098
2101
|
}
|
|
2099
|
-
return i.pixelated !== r && (
|
|
2102
|
+
return i.pixelated !== r && (v(i.texture, r), i.pixelated = r), i.texture;
|
|
2100
2103
|
}
|
|
2101
|
-
function
|
|
2102
|
-
if (
|
|
2104
|
+
function b(t, d, g) {
|
|
2105
|
+
if (h = [
|
|
2103
2106
|
t,
|
|
2104
|
-
|
|
2107
|
+
d,
|
|
2105
2108
|
g
|
|
2106
|
-
],
|
|
2107
|
-
let v =
|
|
2108
|
-
(
|
|
2109
|
-
...
|
|
2110
|
-
strokes:
|
|
2111
|
-
icons:
|
|
2112
|
-
},
|
|
2113
|
-
let
|
|
2114
|
-
(
|
|
2115
|
-
t.count && (n.useProgram(t.program), n.uniform2f(t.uniforms.viewport,
|
|
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
|
|
2118
|
-
|
|
2119
|
-
let
|
|
2120
|
-
if (
|
|
2121
|
-
n.useProgram(
|
|
2122
|
-
for (let e of
|
|
2123
|
-
let t =
|
|
2124
|
-
if (o && e.maxR * 2 *
|
|
2125
|
-
n.uniform1f(
|
|
2126
|
-
let s = t ?
|
|
2127
|
-
s && (n.bindTexture(n.TEXTURE_2D,
|
|
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
|
|
2133
|
-
e.preventDefault(),
|
|
2134
|
-
},
|
|
2135
|
+
let S = (e) => {
|
|
2136
|
+
e.preventDefault(), c = !0, s = null;
|
|
2137
|
+
}, C = () => {
|
|
2135
2138
|
try {
|
|
2136
|
-
|
|
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",
|
|
2144
|
+
return e.addEventListener("webglcontextlost", S), e.addEventListener("webglcontextrestored", C), {
|
|
2142
2145
|
kind: "webgl2",
|
|
2143
|
-
stats:
|
|
2146
|
+
stats: i,
|
|
2144
2147
|
resize(t, n, r) {
|
|
2145
|
-
|
|
2148
|
+
l = t, u = n, e.width = Math.round(t * r), e.height = Math.round(n * r), h && b(...h);
|
|
2146
2149
|
},
|
|
2147
|
-
draw:
|
|
2148
|
-
destroy:
|
|
2150
|
+
draw: b,
|
|
2151
|
+
destroy: w,
|
|
2149
2152
|
release() {
|
|
2150
|
-
let e =
|
|
2151
|
-
|
|
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
|
|
2159
|
-
e.removeEventListener("webglcontextlost",
|
|
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
|
|
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
|
|
2170
|
+
function cn(e, t = {}) {
|
|
2168
2171
|
let n = t.prefer || null, r = t.mapStyle ? { mapStyle: t.mapStyle } : {};
|
|
2169
|
-
if (n === "canvas2d") return
|
|
2172
|
+
if (n === "canvas2d") return Me(e, r);
|
|
2170
2173
|
let i = null;
|
|
2171
2174
|
try {
|
|
2172
|
-
i = e.getContext("webgl2",
|
|
2175
|
+
i = e.getContext("webgl2", Xt);
|
|
2173
2176
|
} catch {}
|
|
2174
|
-
if (!i) return
|
|
2177
|
+
if (!i) return Me(e, r);
|
|
2175
2178
|
try {
|
|
2176
|
-
return
|
|
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 ||
|
|
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
|
|
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
|
|
2201
|
-
let { state: t } = e, { render: n, getSpatialIndex: r, queueFrameWork: i, screenToWorld: a, getMinZoom: o, setHoverNode: s, labelNodeAt: c, fitGraphToViewport:
|
|
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
|
-
},
|
|
2207
|
+
}, y = {
|
|
2205
2208
|
x: 0,
|
|
2206
2209
|
y: 0
|
|
2207
|
-
},
|
|
2208
|
-
function
|
|
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
|
|
2218
|
+
let N = {
|
|
2216
2219
|
nodes: null,
|
|
2217
2220
|
size: -1,
|
|
2218
2221
|
map: null
|
|
2219
2222
|
};
|
|
2220
|
-
function
|
|
2221
|
-
return (
|
|
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
|
-
}),
|
|
2228
|
+
}), N.map.get(e) || null;
|
|
2226
2229
|
}
|
|
2227
|
-
function
|
|
2228
|
-
let a =
|
|
2229
|
-
return a ?
|
|
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
|
|
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
|
|
2240
|
-
if (
|
|
2241
|
-
|
|
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 =
|
|
2245
|
-
|
|
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
|
-
},
|
|
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
|
|
2251
|
-
|
|
2252
|
-
let n =
|
|
2253
|
-
if (
|
|
2254
|
-
if (
|
|
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
|
-
|
|
2259
|
+
_.x = r.x, _.y = r.y, t.freeformPositions[_.id] = {
|
|
2257
2260
|
x: r.x,
|
|
2258
2261
|
y: r.y
|
|
2259
|
-
}, e.touchScene(),
|
|
2260
|
-
} else
|
|
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
|
|
2264
|
-
let e =
|
|
2265
|
-
if (
|
|
2266
|
-
let t =
|
|
2267
|
-
|
|
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
|
|
2270
|
-
e !==
|
|
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
|
|
2273
|
-
if (e.touches && e.touches.length === 2 &&
|
|
2274
|
-
e.cancelable && e.preventDefault(),
|
|
2275
|
-
dist:
|
|
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(
|
|
2280
|
+
}, i(B);
|
|
2278
2281
|
return;
|
|
2279
2282
|
}
|
|
2280
|
-
let t =
|
|
2281
|
-
Math.hypot(t.x -
|
|
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
|
|
2284
|
-
|
|
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
|
-
} :
|
|
2289
|
-
if (!
|
|
2290
|
-
if (
|
|
2291
|
-
let e =
|
|
2292
|
-
if (e && e.id ===
|
|
2293
|
-
if (!
|
|
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
|
-
|
|
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 =
|
|
2301
|
-
e &&
|
|
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
|
-
|
|
2305
|
-
}
|
|
2306
|
-
let { canvas: U } = t,
|
|
2307
|
-
if (
|
|
2308
|
-
r.preventDefault(),
|
|
2309
|
-
let i =
|
|
2310
|
-
Object.assign(t.camera,
|
|
2311
|
-
}, G = e.root || U,
|
|
2312
|
-
e.listen(U, "mousedown",
|
|
2313
|
-
e.listen(U, "mousemove",
|
|
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
|
-
|
|
2318
|
+
O = null, H(!1), s(null);
|
|
2316
2319
|
}),
|
|
2317
|
-
e.listen(G, "mouseup",
|
|
2318
|
-
e.listen(U, "touchstart",
|
|
2319
|
-
e.listen(U, "touchmove",
|
|
2320
|
-
e.listen(G, "touchend",
|
|
2321
|
-
e.listen(G, "touchcancel",
|
|
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 () =>
|
|
2327
|
+
return () => K.forEach((e) => e());
|
|
2325
2328
|
}
|
|
2326
2329
|
// ../explorer/pieces/map.js
|
|
2327
|
-
var
|
|
2328
|
-
<p id="map-keys-help" class="hx-sr-only">${
|
|
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
|
|
2332
|
-
let r =
|
|
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
|
|
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
|
|
2359
|
-
return !t && n.src !== void 0 && n.src !== null && n.src !== "" ?
|
|
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
|
|
2364
|
+
function _n(e, t) {
|
|
2362
2365
|
let n = e.nodeType === 11 ? e.host : e, r = {}, i = null, a = !1;
|
|
2363
|
-
return import("./scope-
|
|
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 =
|
|
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
|
|
2412
|
-
let
|
|
2413
|
-
|
|
2414
|
+
function vn(e, t, r, i) {
|
|
2415
|
+
let a = !t;
|
|
2416
|
+
a && (t = I({
|
|
2414
2417
|
root: e,
|
|
2415
|
-
base:
|
|
2416
|
-
fetch:
|
|
2417
|
-
strings:
|
|
2418
|
+
base: r.base || "",
|
|
2419
|
+
fetch: r.fetch,
|
|
2420
|
+
strings: r.strings
|
|
2418
2421
|
}));
|
|
2419
|
-
let
|
|
2420
|
-
if (
|
|
2421
|
-
|
|
2422
|
+
let o = z(t), s = () => {};
|
|
2423
|
+
if (o) try {
|
|
2424
|
+
s = t.attach(e);
|
|
2422
2425
|
} catch {
|
|
2423
|
-
return
|
|
2424
|
-
}
|
|
2425
|
-
let { state:
|
|
2426
|
-
if (
|
|
2427
|
-
let t =
|
|
2428
|
-
t &&
|
|
2429
|
-
}
|
|
2430
|
-
let
|
|
2431
|
-
|
|
2432
|
-
let
|
|
2433
|
-
renderer:
|
|
2434
|
-
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
|
-
},
|
|
2437
|
-
|
|
2438
|
-
for (let e of [...
|
|
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
|
|
2441
|
-
if (
|
|
2442
|
-
let e =
|
|
2443
|
-
onRetry: () =>
|
|
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
|
-
|
|
2448
|
+
c.canvas && c.canvas.focus();
|
|
2446
2449
|
}
|
|
2447
2450
|
});
|
|
2448
|
-
|
|
2449
|
-
}
|
|
2450
|
-
|
|
2451
|
-
let
|
|
2452
|
-
|
|
2453
|
-
let
|
|
2454
|
-
prefer:
|
|
2455
|
-
mapStyle:
|
|
2456
|
-
})),
|
|
2457
|
-
function
|
|
2458
|
-
if (
|
|
2459
|
-
if (
|
|
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 :
|
|
2464
|
+
return n === "light" || n === "dark" ? n : m("system", !!(O && O.matches));
|
|
2462
2465
|
}
|
|
2463
|
-
function
|
|
2464
|
-
if (
|
|
2465
|
-
let e =
|
|
2466
|
-
|
|
2467
|
-
}
|
|
2468
|
-
|
|
2469
|
-
let
|
|
2470
|
-
if (
|
|
2471
|
-
let e = new
|
|
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
|
-
}),
|
|
2476
|
-
}
|
|
2477
|
-
|
|
2478
|
-
let
|
|
2479
|
-
|
|
2480
|
-
},
|
|
2481
|
-
|
|
2482
|
-
|
|
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:
|
|
2486
|
-
}) : t ?
|
|
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:
|
|
2492
|
-
}) :
|
|
2494
|
+
source: n
|
|
2495
|
+
}) : r.onSelect({
|
|
2493
2496
|
id: null,
|
|
2494
2497
|
kind: null,
|
|
2495
|
-
source:
|
|
2498
|
+
source: n
|
|
2496
2499
|
})));
|
|
2497
2500
|
});
|
|
2498
|
-
function
|
|
2499
|
-
let n =
|
|
2500
|
-
return !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
|
|
2506
|
-
function
|
|
2507
|
-
let e =
|
|
2508
|
-
|
|
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
|
-
})),
|
|
2515
|
+
})), j(t), N(t), n.push(() => j(t)), H = () => n.forEach((e) => e());
|
|
2513
2516
|
}
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
})),
|
|
2517
|
-
let
|
|
2518
|
-
!
|
|
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
|
-
|
|
2521
|
-
e.state === "ready" &&
|
|
2522
|
-
}),
|
|
2523
|
-
function
|
|
2524
|
-
let n =
|
|
2525
|
-
|
|
2526
|
-
let r = n ?
|
|
2527
|
-
|
|
2528
|
-
let i = !r &&
|
|
2529
|
-
i &&
|
|
2530
|
-
}
|
|
2531
|
-
function
|
|
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
|
-
|
|
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 =
|
|
2537
|
-
e.release ? e.release() : e.destroy(),
|
|
2539
|
+
let e = C.getRenderer();
|
|
2540
|
+
e.release ? e.release() : e.destroy(), H();
|
|
2538
2541
|
let n = t.doc.createElement("template");
|
|
2539
|
-
n.innerHTML =
|
|
2542
|
+
n.innerHTML = fn;
|
|
2540
2543
|
let r = n.content.firstElementChild;
|
|
2541
2544
|
r.setAttribute("part", "map-canvas");
|
|
2542
|
-
let i = t.active() ===
|
|
2543
|
-
|
|
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 (!
|
|
2549
|
+
if (!g) {
|
|
2547
2550
|
if ("renderer" in e) {
|
|
2548
|
-
let t =
|
|
2549
|
-
t !==
|
|
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 =
|
|
2553
|
-
t !==
|
|
2555
|
+
let t = f(e.theme);
|
|
2556
|
+
t !== p.theme && (p.theme = t, M());
|
|
2554
2557
|
}
|
|
2555
|
-
if ("topology" 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)
|
|
2560
|
+
if (n === null) B = null, (c.selectedNode || c.selectedEdge) && E(t, { source: "api" });
|
|
2558
2561
|
else {
|
|
2559
|
-
let e =
|
|
2560
|
-
e ?
|
|
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
|
-
|
|
2569
|
+
g || (g = !0, u.destroy(), C.destroy(), a && t.destroy());
|
|
2567
2570
|
}
|
|
2568
|
-
let
|
|
2571
|
+
let q = {};
|
|
2569
2572
|
for (let e of [
|
|
2570
2573
|
"topology",
|
|
2571
2574
|
"view",
|
|
2572
2575
|
"node"
|
|
2573
|
-
])
|
|
2574
|
-
return se(
|
|
2576
|
+
]) r[e] !== void 0 && (q[e] = r[e]);
|
|
2577
|
+
return se(q), W(), M(), {
|
|
2575
2578
|
inst: t,
|
|
2576
|
-
map:
|
|
2579
|
+
map: C,
|
|
2577
2580
|
update: se,
|
|
2578
2581
|
destroy: ce,
|
|
2579
|
-
fit:
|
|
2580
|
-
focusNode:
|
|
2581
|
-
refresh:
|
|
2582
|
-
applyTheme: (e) =>
|
|
2582
|
+
fit: L,
|
|
2583
|
+
focusNode: V,
|
|
2584
|
+
refresh: M,
|
|
2585
|
+
applyTheme: (e) => w.applyTheme(e)
|
|
2583
2586
|
};
|
|
2584
2587
|
}
|
|
2585
|
-
|
|
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.1",
|
|
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 };
|