@groupviz/react 2.1.2 → 2.1.4
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/index.js +869 -1047
- package/index.js.map +1 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createContext as e, createElement as t, memo as n, useCallback as r, useContext as i, useEffect as a, useId as o, useLayoutEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
2
2
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
3
3
|
import m from "katex";
|
|
4
|
-
import { COLOR_PALETTE as h, FACE_COLOR_PALETTE as g, buildCosetViewData as _, buildUndirectedEdgeKeys as v, cayleyCircleLayout as y,
|
|
5
|
-
import { Canvas as
|
|
6
|
-
import { Html as
|
|
4
|
+
import { COLOR_PALETTE as h, FACE_COLOR_PALETTE as g, buildCosetViewData as _, buildUndirectedEdgeKeys as v, cayleyCircleLayout as y, circleLayoutRadius as b, compute3DPositions as x, computeCayleyActionEdges as S, computeCycleCandidates as C, computeElementRotation as w, computeFixedPoints as T, computeLatticeLayout as E, computeShape2DPositions as D, computeSubgroupLattice as O, cosetStripLayout as k, cycleGraphLayout as A, elementOrder as j, factorizeOrder as M, findAllSubgroups as N, findMinimalGenerators as P, getDefaultLayout3D as F, getDefaultShape2D as I, getGroupCenter as L, getHomomorphismProperties as R, getSemidirectProductMeta as ee, getSymmetryType as te, isTooLarge as z, latticeFitScale as ne, latticeLodTier as B, latticeSlotScreenSize as V, mergeLatticeByConjugacy as re, resolveElement as H, semidirectFactorMap as ie, semidirectFixedPoints as U, subgroupFaces as W, subgroupSetKey as G, subgroupStructureSymbol as K, verifyHomomorphism as q } from "@groupviz/core";
|
|
5
|
+
import { Canvas as ae, useFrame as oe, useThree as se } from "@react-three/fiber";
|
|
6
|
+
import { Html as ce, OrbitControls as le } from "@react-three/drei";
|
|
7
7
|
import * as J from "three";
|
|
8
8
|
//#region src/components/Canvas/SceneThemeRoot.tsx
|
|
9
|
-
function
|
|
9
|
+
function Y({ theme: e, children: t, style: n, className: r }) {
|
|
10
10
|
return e ? /* @__PURE__ */ f("div", {
|
|
11
11
|
"data-theme": e,
|
|
12
12
|
className: r,
|
|
@@ -111,18 +111,18 @@ var ue = {
|
|
|
111
111
|
"⟩": "\\rangle",
|
|
112
112
|
"⁻": "^{-1}"
|
|
113
113
|
};
|
|
114
|
-
function
|
|
114
|
+
function X(e) {
|
|
115
115
|
let t = "";
|
|
116
116
|
for (let n = 0; n < e.length; n++) {
|
|
117
117
|
let r = e[n], i = n + 1 < e.length ? e[n + 1] : "";
|
|
118
118
|
if (pe[r]) {
|
|
119
119
|
let e = pe[r];
|
|
120
|
-
t += e,
|
|
120
|
+
t += e, Z(e) && me(i) && (t += " ");
|
|
121
121
|
continue;
|
|
122
122
|
}
|
|
123
123
|
if (fe[r]) {
|
|
124
124
|
let e = fe[r];
|
|
125
|
-
t += e,
|
|
125
|
+
t += e, Z(e) && me(i) && (t += " ");
|
|
126
126
|
continue;
|
|
127
127
|
}
|
|
128
128
|
if (ue[r]) {
|
|
@@ -143,7 +143,7 @@ function Y(e) {
|
|
|
143
143
|
}
|
|
144
144
|
return t;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Z(e) {
|
|
147
147
|
if (!e.startsWith("\\") || e.length < 2) return !1;
|
|
148
148
|
for (let t = 1; t < e.length; t++) {
|
|
149
149
|
let n = e[t];
|
|
@@ -151,10 +151,10 @@ function me(e) {
|
|
|
151
151
|
}
|
|
152
152
|
return !0;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function me(e) {
|
|
155
155
|
return e ? e >= "a" && e <= "z" || e >= "A" && e <= "Z" : !1;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function Q(e, t = !1) {
|
|
158
158
|
try {
|
|
159
159
|
return m.renderToString(e, {
|
|
160
160
|
displayMode: t,
|
|
@@ -168,13 +168,13 @@ function Z(e, t = !1) {
|
|
|
168
168
|
}
|
|
169
169
|
//#endregion
|
|
170
170
|
//#region src/components/Canvas/SetView.tsx
|
|
171
|
-
function
|
|
172
|
-
return /* @__PURE__ */ f(
|
|
171
|
+
function he(e) {
|
|
172
|
+
return /* @__PURE__ */ f(Y, {
|
|
173
173
|
theme: e.theme,
|
|
174
|
-
children: /* @__PURE__ */ f(
|
|
174
|
+
children: /* @__PURE__ */ f(ve, { ...e })
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
|
-
var
|
|
177
|
+
var ge = [
|
|
178
178
|
"#ff6b6b",
|
|
179
179
|
"#4ecdc4",
|
|
180
180
|
"#ffd93d",
|
|
@@ -192,7 +192,7 @@ var he = [
|
|
|
192
192
|
"#0ea5e9",
|
|
193
193
|
"#22c55e"
|
|
194
194
|
];
|
|
195
|
-
function
|
|
195
|
+
function _e(e, t, n, r, i, a, o = !0) {
|
|
196
196
|
let s = e.cosetMemberLabels, c = Math.min(s.length, 12), l = Math.min(10, Math.max(4, Math.floor(t / (Math.max(3, Math.sqrt(c)) * 1.8)))), u = t * .72, m = e.cosetInternalLayout && e.cosetInternalLayout.length >= c, h = (n) => {
|
|
197
197
|
if (m) {
|
|
198
198
|
let t = e.cosetInternalLayout[n];
|
|
@@ -213,7 +213,7 @@ function ge(e, t, n, r, i, a, o = !0) {
|
|
|
213
213
|
cx: t.x,
|
|
214
214
|
cy: t.y,
|
|
215
215
|
r: l,
|
|
216
|
-
fill:
|
|
216
|
+
fill: ge[e % ge.length],
|
|
217
217
|
stroke: "var(--node-stroke)",
|
|
218
218
|
strokeWidth: .8
|
|
219
219
|
}, e));
|
|
@@ -293,7 +293,7 @@ function ge(e, t, n, r, i, a, o = !0) {
|
|
|
293
293
|
})
|
|
294
294
|
] });
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function ve({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r, subsets: i, selfInverseElementId: a, cosetElementMap: o, cosetHighlightSet: s, cosetColors: l, onSelect: u, onHover: m, noGroupText: h, nodeRadius: g, gap: _, columns: v, showLabels: y, largeGroupThreshold: b = 60 }) {
|
|
297
297
|
let x = c(() => {
|
|
298
298
|
let e = /* @__PURE__ */ new Map();
|
|
299
299
|
return i?.forEach((t) => t.elementIds.forEach((n) => {
|
|
@@ -301,7 +301,7 @@ function _e({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
301
301
|
})), e;
|
|
302
302
|
}, [i]), S = c(() => {
|
|
303
303
|
let t = /* @__PURE__ */ new Map();
|
|
304
|
-
return e?.elements.forEach((e) => t.set(e.id,
|
|
304
|
+
return e?.elements.forEach((e) => t.set(e.id, Q(X(e.label)))), t;
|
|
305
305
|
}, [e]), C = l ?? [];
|
|
306
306
|
if (!e) return /* @__PURE__ */ f("div", {
|
|
307
307
|
className: "view-empty",
|
|
@@ -355,7 +355,7 @@ function _e({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
355
355
|
onMouseLeave: () => m?.(null, null),
|
|
356
356
|
style: { cursor: "pointer" },
|
|
357
357
|
children: [
|
|
358
|
-
T ?
|
|
358
|
+
T ? _e(e, E, c, _, v, b, !0) : /* @__PURE__ */ p(d, { children: [
|
|
359
359
|
/* @__PURE__ */ f("circle", {
|
|
360
360
|
r: E,
|
|
361
361
|
fill: _,
|
|
@@ -433,13 +433,13 @@ function _e({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
433
433
|
}
|
|
434
434
|
//#endregion
|
|
435
435
|
//#region src/components/Canvas/CycleView.tsx
|
|
436
|
-
function
|
|
437
|
-
return /* @__PURE__ */ f(
|
|
436
|
+
function ye(e) {
|
|
437
|
+
return /* @__PURE__ */ f(Y, {
|
|
438
438
|
theme: e.theme,
|
|
439
|
-
children: /* @__PURE__ */ f(
|
|
439
|
+
children: /* @__PURE__ */ f(Se, { ...e })
|
|
440
440
|
});
|
|
441
441
|
}
|
|
442
|
-
var
|
|
442
|
+
var be = 0, xe = [
|
|
443
443
|
"#ff6b6b",
|
|
444
444
|
"#4ecdc4",
|
|
445
445
|
"#ffd93d",
|
|
@@ -448,25 +448,25 @@ var ye = 0, be = [
|
|
|
448
448
|
"#3498db",
|
|
449
449
|
"#e67e22"
|
|
450
450
|
];
|
|
451
|
-
function
|
|
452
|
-
let [
|
|
453
|
-
key:
|
|
451
|
+
function Se({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i, showMaximalCycles: a = !0, nodeRadius: o = 24, showLabels: s = !0, showCycleLabels: l = !0, locked: d = !1, subsets: m, selfInverseElementId: h, cosetElementMap: g, cosetHighlightSet: _, cosetColors: v, getNodePosition: y, onNodePositionChange: x, onSelect: S, onHover: C, noGroupText: w, largeGroupThreshold: T = 60 }) {
|
|
452
|
+
let [E] = u(() => `cyv${++be}`), D = e ? `${e.symbol}|${e.order}|${a}` : "", [O, k] = u({
|
|
453
|
+
key: D,
|
|
454
454
|
map: /* @__PURE__ */ new Map()
|
|
455
455
|
});
|
|
456
|
-
|
|
457
|
-
key:
|
|
456
|
+
O.key !== D && k({
|
|
457
|
+
key: D,
|
|
458
458
|
map: /* @__PURE__ */ new Map()
|
|
459
459
|
});
|
|
460
|
-
let
|
|
461
|
-
|
|
462
|
-
if (n.key !==
|
|
460
|
+
let j = c(() => O.key === D ? O.map : /* @__PURE__ */ new Map(), [O, D]), M = r((e, t) => {
|
|
461
|
+
k((n) => {
|
|
462
|
+
if (n.key !== D) return n;
|
|
463
463
|
let r = new Map(n.map);
|
|
464
464
|
return r.set(e, t), {
|
|
465
465
|
key: n.key,
|
|
466
466
|
map: r
|
|
467
467
|
};
|
|
468
468
|
});
|
|
469
|
-
}, [
|
|
469
|
+
}, [D]), N = c(() => {
|
|
470
470
|
if (!e) return [];
|
|
471
471
|
let t = [], n = /* @__PURE__ */ new Set();
|
|
472
472
|
for (let r of e.elements) {
|
|
@@ -493,50 +493,54 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
493
493
|
return [...n].every((e) => r.has(e));
|
|
494
494
|
});
|
|
495
495
|
}).sort((e, t) => e.order - t.order) : t.sort((e, t) => e.order - t.order);
|
|
496
|
-
}, [e, a]),
|
|
496
|
+
}, [e, a]), P = c(() => !e || !a || N.length === 0 ? null : A(e.elements, N.map((e) => ({ elementIds: e.elements.map((e) => e.id) })), i.width, i.height, e.identity.id), [
|
|
497
497
|
e,
|
|
498
498
|
a,
|
|
499
|
-
|
|
499
|
+
N,
|
|
500
500
|
i.width,
|
|
501
501
|
i.height
|
|
502
|
-
]),
|
|
502
|
+
]), F = c(() => {
|
|
503
503
|
let e = /* @__PURE__ */ new Map();
|
|
504
504
|
return m?.forEach((t) => t.elementIds.forEach((n) => {
|
|
505
505
|
e.has(n) || e.set(n, t);
|
|
506
506
|
})), e;
|
|
507
|
-
}, [m]),
|
|
507
|
+
}, [m]), I = v ?? [], L = c(() => {
|
|
508
508
|
let t = /* @__PURE__ */ new Map();
|
|
509
|
-
return e?.elements.forEach((e) => t.set(e.id,
|
|
509
|
+
return e?.elements.forEach((e) => t.set(e.id, Q(X(e.label)))), t;
|
|
510
510
|
}, [e]);
|
|
511
511
|
if (!e) return /* @__PURE__ */ f("div", {
|
|
512
512
|
className: "view-empty",
|
|
513
|
-
children: /* @__PURE__ */ f("p", { children:
|
|
513
|
+
children: /* @__PURE__ */ f("p", { children: w ?? "" })
|
|
514
514
|
});
|
|
515
|
-
let
|
|
516
|
-
if (!
|
|
515
|
+
let R = e.order > T, ee = (e, t) => {
|
|
516
|
+
if (!R) return !0;
|
|
517
517
|
let r = e * n.scale + n.x, a = t * n.scale + n.y, s = o * n.scale * 1.5;
|
|
518
518
|
return r + s > 0 && r - s < i.width && a + s > 0 && a - s < i.height;
|
|
519
|
-
},
|
|
519
|
+
}, te = i.width / 2, z = i.height / 2, ne = b(i.width, i.height, e.order, o, {
|
|
520
|
+
widthFactor: .32,
|
|
521
|
+
base: 160,
|
|
522
|
+
growth: 16
|
|
523
|
+
}), B = (t) => {
|
|
520
524
|
let n = y?.(t);
|
|
521
525
|
if (n) return n;
|
|
522
|
-
let r =
|
|
526
|
+
let r = j.get(t);
|
|
523
527
|
if (r) return r;
|
|
524
|
-
if (
|
|
525
|
-
let e =
|
|
528
|
+
if (P) {
|
|
529
|
+
let e = P.get(t);
|
|
526
530
|
if (e) return e;
|
|
527
531
|
}
|
|
528
532
|
let i = e.elements.findIndex((e) => e.id === t) * 2 * Math.PI / e.order - Math.PI / 2;
|
|
529
533
|
return {
|
|
530
|
-
x:
|
|
531
|
-
y:
|
|
534
|
+
x: te + ne * Math.cos(i),
|
|
535
|
+
y: z + ne * Math.sin(i)
|
|
532
536
|
};
|
|
533
537
|
};
|
|
534
538
|
return /* @__PURE__ */ p("svg", {
|
|
535
539
|
viewBox: `0 0 ${i.width} ${i.height}`,
|
|
536
540
|
className: "view-svg",
|
|
537
541
|
style: { userSelect: "none" },
|
|
538
|
-
children: [!
|
|
539
|
-
id: `${
|
|
542
|
+
children: [!R && /* @__PURE__ */ f("defs", { children: /* @__PURE__ */ f("filter", {
|
|
543
|
+
id: `${E}-node-shadow`,
|
|
540
544
|
x: "-30%",
|
|
541
545
|
y: "-30%",
|
|
542
546
|
width: "160%",
|
|
@@ -550,10 +554,10 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
550
554
|
})
|
|
551
555
|
}) }), /* @__PURE__ */ p("g", {
|
|
552
556
|
transform: `translate(${n.x}, ${n.y}) scale(${n.scale})`,
|
|
553
|
-
children: [
|
|
554
|
-
let r = e.elements.map((e) =>
|
|
557
|
+
children: [N.map((e, n) => {
|
|
558
|
+
let r = e.elements.map((e) => B(e.id));
|
|
555
559
|
if (r.length < 2) return null;
|
|
556
|
-
let i = r.map((e, t) => t === 0 ? `M ${e.x} ${e.y}` : `L ${e.x} ${e.y}`).join(" ") + " Z", o = t.size > 0 && e.elements.some((e) => t.has(e.id)), s =
|
|
560
|
+
let i = r.map((e, t) => t === 0 ? `M ${e.x} ${e.y}` : `L ${e.x} ${e.y}`).join(" ") + " Z", o = t.size > 0 && e.elements.some((e) => t.has(e.id)), s = xe[n % xe.length];
|
|
557
561
|
if (a) {
|
|
558
562
|
if (r.length === 2) return /* @__PURE__ */ f("line", {
|
|
559
563
|
x1: r[0].x,
|
|
@@ -588,7 +592,7 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
588
592
|
})] }, n);
|
|
589
593
|
}
|
|
590
594
|
if (!l) return null;
|
|
591
|
-
let c =
|
|
595
|
+
let c = xe[n % xe.length], u = r.reduce((e, t) => e + t.x, 0) / r.length, d = r.reduce((e, t) => e + t.y, 0) / r.length;
|
|
592
596
|
return /* @__PURE__ */ p("g", { children: [
|
|
593
597
|
/* @__PURE__ */ f("path", {
|
|
594
598
|
d: i,
|
|
@@ -621,13 +625,13 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
621
625
|
})
|
|
622
626
|
] }, n);
|
|
623
627
|
}), e.elements.map((e) => {
|
|
624
|
-
let r =
|
|
625
|
-
if (!
|
|
626
|
-
let a = t.has(e.id), c =
|
|
627
|
-
return a ? (m = "var(--node-fill-selected)", v = "#ffd93d", y = 3) : u && l !== void 0 &&
|
|
628
|
+
let r = B(e.id);
|
|
629
|
+
if (!ee(r.x, r.y)) return null;
|
|
630
|
+
let a = t.has(e.id), c = F.get(e.id), l = g?.get(e.id), u = l !== void 0 && (_?.has(l) ?? !1), m = "var(--node-fill)", v = "var(--node-stroke)", y = 2.5;
|
|
631
|
+
return a ? (m = "var(--node-fill-selected)", v = "#ffd93d", y = 3) : u && l !== void 0 && I[l] ? (m = I[l] + "33", v = I[l], y = 3) : c && (m = c.color + "33", v = c.color, y = 2.5), /* @__PURE__ */ p("g", {
|
|
628
632
|
transform: `translate(${r.x}, ${r.y})`,
|
|
629
633
|
onClick: (t) => {
|
|
630
|
-
t.stopPropagation(),
|
|
634
|
+
t.stopPropagation(), S?.(e.id, t.ctrlKey || t.metaKey);
|
|
631
635
|
},
|
|
632
636
|
onMouseDown: (t) => {
|
|
633
637
|
if (d || t.button !== 0) return;
|
|
@@ -636,9 +640,9 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
636
640
|
if (!r) return;
|
|
637
641
|
let a = r.getBoundingClientRect();
|
|
638
642
|
if (a.width === 0 || a.height === 0) return;
|
|
639
|
-
let o = i.width / a.width, s = i.height / a.height, c = (t.clientX - a.left) * o, l = (t.clientY - a.top) * s, u =
|
|
643
|
+
let o = i.width / a.width, s = i.height / a.height, c = (t.clientX - a.left) * o, l = (t.clientY - a.top) * s, u = B(e.id), f = (t) => {
|
|
640
644
|
let r = (t.clientX - a.left) * o, i = (t.clientY - a.top) * s, d = u.x + (r - c) / n.scale, f = u.y + (i - l) / n.scale;
|
|
641
|
-
|
|
645
|
+
x ? x(e.id, d, f) : M(e.id, {
|
|
642
646
|
x: d,
|
|
643
647
|
y: f
|
|
644
648
|
});
|
|
@@ -647,11 +651,11 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
647
651
|
};
|
|
648
652
|
window.addEventListener("mousemove", f), window.addEventListener("mouseup", p);
|
|
649
653
|
},
|
|
650
|
-
onMouseEnter: () =>
|
|
654
|
+
onMouseEnter: () => C?.(e, {
|
|
651
655
|
x: r.x * n.scale + n.x,
|
|
652
656
|
y: r.y * n.scale + n.y
|
|
653
657
|
}),
|
|
654
|
-
onMouseLeave: () =>
|
|
658
|
+
onMouseLeave: () => C?.(null, null),
|
|
655
659
|
style: { cursor: "grab" },
|
|
656
660
|
children: [
|
|
657
661
|
/* @__PURE__ */ f("circle", {
|
|
@@ -659,19 +663,19 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
659
663
|
fill: m,
|
|
660
664
|
stroke: v,
|
|
661
665
|
strokeWidth: y,
|
|
662
|
-
filter:
|
|
666
|
+
filter: R ? void 0 : `url(#${E}-node-shadow)`
|
|
663
667
|
}),
|
|
664
668
|
c && /* @__PURE__ */ f("circle", {
|
|
665
669
|
r: o,
|
|
666
670
|
fill: `${c.color}22`,
|
|
667
671
|
stroke: "none"
|
|
668
672
|
}),
|
|
669
|
-
u && l !== void 0 &&
|
|
673
|
+
u && l !== void 0 && I[l] && /* @__PURE__ */ f("circle", {
|
|
670
674
|
r: o,
|
|
671
|
-
fill: `${
|
|
675
|
+
fill: `${I[l]}22`,
|
|
672
676
|
stroke: "none"
|
|
673
677
|
}),
|
|
674
|
-
s && (!
|
|
678
|
+
s && (!R || a || t.size === 0) && /* @__PURE__ */ f("foreignObject", {
|
|
675
679
|
x: -o,
|
|
676
680
|
y: -15,
|
|
677
681
|
width: o * 2,
|
|
@@ -688,9 +692,9 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
688
692
|
width: "100%",
|
|
689
693
|
height: "100%",
|
|
690
694
|
color: "var(--node-text)",
|
|
691
|
-
fontSize:
|
|
695
|
+
fontSize: R ? "10px" : "14px"
|
|
692
696
|
},
|
|
693
|
-
dangerouslySetInnerHTML: { __html:
|
|
697
|
+
dangerouslySetInnerHTML: { __html: L.get(e.id) ?? "" }
|
|
694
698
|
})
|
|
695
699
|
}),
|
|
696
700
|
h === e.id && /* @__PURE__ */ p("g", { children: [/* @__PURE__ */ f("circle", {
|
|
@@ -720,37 +724,37 @@ function xe({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
720
724
|
}
|
|
721
725
|
//#endregion
|
|
722
726
|
//#region src/utils/elementRef.ts
|
|
723
|
-
var
|
|
724
|
-
function
|
|
727
|
+
var Ce = /* @__PURE__ */ new Set();
|
|
728
|
+
function we(e, t, n) {
|
|
725
729
|
let r = H(e, t);
|
|
726
730
|
if (r) return r;
|
|
727
731
|
if (!e || t == null || t === "") return null;
|
|
728
732
|
let i = `${n}|${e.symbol}|${t}`;
|
|
729
|
-
return
|
|
733
|
+
return Ce.has(i) || (Ce.add(i), console.warn(`[groupviz] ${n}: 元素引用 ${JSON.stringify(t)} 在群 ${e?.symbol ?? "?"} 中解析不到(已试 id / label / value / 循环记号四种写法),该项已忽略。`)), null;
|
|
730
734
|
}
|
|
731
|
-
function
|
|
735
|
+
function Te(e, t, n) {
|
|
732
736
|
if (!t) return [];
|
|
733
737
|
let r = [], i = /* @__PURE__ */ new Set();
|
|
734
738
|
for (let a of t) {
|
|
735
|
-
let t =
|
|
739
|
+
let t = we(e, a, n);
|
|
736
740
|
!t || i.has(t.id) || (i.add(t.id), r.push(t.id));
|
|
737
741
|
}
|
|
738
742
|
return r;
|
|
739
743
|
}
|
|
740
744
|
//#endregion
|
|
741
745
|
//#region src/context/cayleyActions.ts
|
|
742
|
-
function
|
|
746
|
+
function Ee(e) {
|
|
743
747
|
return e.generators.map((t, n) => ({
|
|
744
748
|
elementId: t.apply(e.identity)?.id || e.elements[0]?.id || e.identity.id,
|
|
745
749
|
enabled: !0,
|
|
746
750
|
color: h[n % h.length]
|
|
747
751
|
}));
|
|
748
752
|
}
|
|
749
|
-
function
|
|
750
|
-
if (!t) return
|
|
753
|
+
function De(e, t) {
|
|
754
|
+
if (!t) return Ee(e);
|
|
751
755
|
let n = [], r = /* @__PURE__ */ new Set();
|
|
752
756
|
for (let i of t) {
|
|
753
|
-
let t =
|
|
757
|
+
let t = we(e, i.elementId, "CayleyView.actions[].elementId");
|
|
754
758
|
!t || r.has(t.id) || (r.add(t.id), n.push({
|
|
755
759
|
elementId: t.id,
|
|
756
760
|
enabled: i.enabled !== !1,
|
|
@@ -761,14 +765,14 @@ function Ee(e, t) {
|
|
|
761
765
|
}
|
|
762
766
|
//#endregion
|
|
763
767
|
//#region src/components/Canvas/CayleyView.tsx
|
|
764
|
-
function
|
|
765
|
-
return /* @__PURE__ */ f(
|
|
768
|
+
function Oe(e) {
|
|
769
|
+
return /* @__PURE__ */ f(Y, {
|
|
766
770
|
theme: e.theme,
|
|
767
|
-
children: /* @__PURE__ */ f(
|
|
771
|
+
children: /* @__PURE__ */ f(je, { ...e })
|
|
768
772
|
});
|
|
769
773
|
}
|
|
770
|
-
var
|
|
771
|
-
function
|
|
774
|
+
var ke = 0;
|
|
775
|
+
function Ae(e, t, n, r, i, a) {
|
|
772
776
|
let o = t.get(e.fromId), s = t.get(e.toId);
|
|
773
777
|
if (!o || !s) return null;
|
|
774
778
|
let c = s.x - o.x, l = s.y - o.y, u = Math.sqrt(c * c + l * l);
|
|
@@ -799,100 +803,100 @@ function ke(e, t, n, r, i, a) {
|
|
|
799
803
|
opacity: .9
|
|
800
804
|
}, `${e.fromId}-${e.toId}-${e.actionElementId}`);
|
|
801
805
|
}
|
|
802
|
-
function
|
|
803
|
-
let [
|
|
804
|
-
key:
|
|
806
|
+
function je({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i, shape2D: a, multiplyType: o, actions: s, nodeRadius: l, showLabels: d, locked: m = !1, onSelect: h, onHover: g, hoveredElementId: _, noGroupText: v, largeGroupThreshold: x = 60 }) {
|
|
807
|
+
let [C] = u(() => `cv${++ke}`), w = e?.order ?? 0, T = e ? a ?? I(e) : "circular", E = o ?? "right", O = l ?? 28, k = w > x, A = c(() => e ? De(e, s) : [], [e, s]), j = e ? `${e.symbol}|${e.order}|${T}` : "", [M, N] = u({
|
|
808
|
+
key: j,
|
|
805
809
|
map: /* @__PURE__ */ new Map()
|
|
806
810
|
});
|
|
807
|
-
|
|
808
|
-
key:
|
|
811
|
+
M.key !== j && N({
|
|
812
|
+
key: j,
|
|
809
813
|
map: /* @__PURE__ */ new Map()
|
|
810
814
|
});
|
|
811
|
-
let
|
|
812
|
-
|
|
813
|
-
if (n.key !==
|
|
815
|
+
let P = c(() => M.key === j ? M.map : /* @__PURE__ */ new Map(), [M, j]), F = r((e, t) => {
|
|
816
|
+
N((n) => {
|
|
817
|
+
if (n.key !== j) return n;
|
|
814
818
|
let r = new Map(n.map);
|
|
815
819
|
return r.set(e, t), {
|
|
816
820
|
key: n.key,
|
|
817
821
|
map: r
|
|
818
822
|
};
|
|
819
823
|
});
|
|
820
|
-
}, [
|
|
824
|
+
}, [j]), L = i.width / 2, R = i.height / 2, te = b(i.width, i.height, w, O), z = c(() => e ? D(e, T, i.width, i.height) : null, [
|
|
821
825
|
e,
|
|
822
|
-
|
|
826
|
+
T,
|
|
823
827
|
i.width,
|
|
824
828
|
i.height
|
|
825
|
-
]),
|
|
829
|
+
]), ne = c(() => !e || w === 0 ? /* @__PURE__ */ new Map() : y(e, L, R, te), [
|
|
826
830
|
e,
|
|
827
|
-
I,
|
|
828
831
|
L,
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
+
R,
|
|
833
|
+
te,
|
|
834
|
+
w
|
|
835
|
+
]), B = c(() => e ? ee(e) : null, [e]), V = c(() => {
|
|
832
836
|
let t = /* @__PURE__ */ new Map();
|
|
833
|
-
if (!e || !
|
|
834
|
-
let n =
|
|
835
|
-
return n ?
|
|
836
|
-
}, [e,
|
|
837
|
+
if (!e || !B) return t;
|
|
838
|
+
let n = ie(e, B);
|
|
839
|
+
return n ? U(e, B, n) : t;
|
|
840
|
+
}, [e, B]), re = c(() => A.filter((e) => e.enabled), [A]), H = c(() => {
|
|
837
841
|
let e = /* @__PURE__ */ new Map();
|
|
838
|
-
return
|
|
839
|
-
}, [
|
|
842
|
+
return re.forEach((t, n) => e.set(t.elementId, n)), e;
|
|
843
|
+
}, [re]), W = c(() => e ? S(e, A, E) : [], [
|
|
840
844
|
e,
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
]),
|
|
845
|
+
A,
|
|
846
|
+
E
|
|
847
|
+
]), G = r((e) => {
|
|
844
848
|
let t;
|
|
845
|
-
if (
|
|
846
|
-
let n =
|
|
849
|
+
if (z) {
|
|
850
|
+
let n = z.get(e);
|
|
847
851
|
if (!n) return {
|
|
848
|
-
x:
|
|
849
|
-
y:
|
|
852
|
+
x: L,
|
|
853
|
+
y: R
|
|
850
854
|
};
|
|
851
855
|
t = n;
|
|
852
856
|
} else {
|
|
853
|
-
let n =
|
|
857
|
+
let n = ne.get(e);
|
|
854
858
|
if (!n) return {
|
|
855
|
-
x:
|
|
856
|
-
y:
|
|
859
|
+
x: L,
|
|
860
|
+
y: R
|
|
857
861
|
};
|
|
858
862
|
t = n;
|
|
859
863
|
}
|
|
860
|
-
let n =
|
|
864
|
+
let n = P.get(e);
|
|
861
865
|
return n && (Math.abs(n.x - t.x) > 1 || Math.abs(n.y - t.y) > 1) ? n : t;
|
|
862
866
|
}, [
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
]),
|
|
867
|
+
z,
|
|
868
|
+
ne,
|
|
869
|
+
P,
|
|
870
|
+
L,
|
|
871
|
+
R
|
|
872
|
+
]), K = c(() => {
|
|
869
873
|
let t = /* @__PURE__ */ new Map();
|
|
870
|
-
return e && e.elements.forEach((e) => t.set(e.id,
|
|
871
|
-
}, [e,
|
|
874
|
+
return e && e.elements.forEach((e) => t.set(e.id, G(e.id))), t;
|
|
875
|
+
}, [e, G]), q = c(() => {
|
|
872
876
|
let t = /* @__PURE__ */ new Map();
|
|
873
|
-
return e && e.elements.forEach((e) => t.set(e.id,
|
|
874
|
-
}, [e]),
|
|
877
|
+
return e && e.elements.forEach((e) => t.set(e.id, Q(X(e.label)))), t;
|
|
878
|
+
}, [e]), ae = c(() => t.size, [t]), oe = c(() => e ? W.map((e) => Ae(e, K, O, H, !1, C)) : null, [
|
|
875
879
|
W,
|
|
876
|
-
|
|
880
|
+
K,
|
|
877
881
|
H,
|
|
878
|
-
|
|
882
|
+
O,
|
|
879
883
|
e,
|
|
880
|
-
|
|
881
|
-
]),
|
|
884
|
+
C
|
|
885
|
+
]), se = c(() => !e || t.size === 0 ? null : W.filter((e) => t.has(e.fromId) || t.has(e.toId)).map((e) => Ae(e, K, O, H, !0, C)), [
|
|
882
886
|
W,
|
|
883
887
|
t,
|
|
884
|
-
|
|
888
|
+
K,
|
|
885
889
|
H,
|
|
886
|
-
|
|
890
|
+
O,
|
|
887
891
|
e,
|
|
888
|
-
|
|
889
|
-
]),
|
|
890
|
-
let t =
|
|
891
|
-
x:
|
|
892
|
-
y:
|
|
893
|
-
}, r = t.x * n.scale + n.x, a = t.y * n.scale + n.y, o =
|
|
894
|
-
if (!(!
|
|
895
|
-
let s =
|
|
892
|
+
C
|
|
893
|
+
]), ce = c(() => e ? e.elements.map((e) => {
|
|
894
|
+
let t = K.get(e.id) || {
|
|
895
|
+
x: L,
|
|
896
|
+
y: R
|
|
897
|
+
}, r = t.x * n.scale + n.x, a = t.y * n.scale + n.y, o = O * n.scale * 1.5;
|
|
898
|
+
if (!(!k || r + o > 0 && r - o < i.width && a + o > 0 && a - o < i.height)) return null;
|
|
899
|
+
let s = T === "rewiring" && !!B && V.get(e.id) === !0, c = "var(--node-fill)", l = "var(--node-stroke)", u = 2.5;
|
|
896
900
|
return s && (c = "var(--accent-teal)22", l = "var(--accent-teal)", u = 3), /* @__PURE__ */ p("g", {
|
|
897
901
|
transform: `translate(${t.x}, ${t.y})`,
|
|
898
902
|
onClick: (t) => {
|
|
@@ -905,8 +909,8 @@ function Ae({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
905
909
|
if (!r) return;
|
|
906
910
|
let a = r.getBoundingClientRect();
|
|
907
911
|
if (a.width === 0 || a.height === 0) return;
|
|
908
|
-
let o = i.width / a.width, s = i.height / a.height, c = (t.clientX - a.left) * o, l = (t.clientY - a.top) * s, u =
|
|
909
|
-
d &&
|
|
912
|
+
let o = i.width / a.width, s = i.height / a.height, c = (t.clientX - a.left) * o, l = (t.clientY - a.top) * s, u = G(e.id), d = null, f = { current: 0 }, p = () => {
|
|
913
|
+
d && F(e.id, d);
|
|
910
914
|
}, h = (e) => {
|
|
911
915
|
let t = (e.clientX - a.left) * o, r = (e.clientY - a.top) * s;
|
|
912
916
|
d = {
|
|
@@ -928,24 +932,24 @@ function Ae({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
928
932
|
style: { cursor: "grab" },
|
|
929
933
|
children: [
|
|
930
934
|
/* @__PURE__ */ f("circle", {
|
|
931
|
-
r:
|
|
935
|
+
r: O,
|
|
932
936
|
fill: c,
|
|
933
937
|
stroke: l,
|
|
934
938
|
strokeWidth: u,
|
|
935
|
-
filter:
|
|
939
|
+
filter: k ? void 0 : `url(#${C}-node-shadow)`
|
|
936
940
|
}),
|
|
937
941
|
e.id === _ && /* @__PURE__ */ f("circle", {
|
|
938
|
-
r:
|
|
942
|
+
r: O + 5,
|
|
939
943
|
fill: "none",
|
|
940
944
|
stroke: "#4ecdc4",
|
|
941
945
|
strokeWidth: 3.5,
|
|
942
946
|
opacity: .95,
|
|
943
947
|
style: { filter: "drop-shadow(0 0 4px rgba(78,205,196,0.7))" }
|
|
944
948
|
}),
|
|
945
|
-
d !== !1 && (!
|
|
946
|
-
x: -
|
|
949
|
+
d !== !1 && (!k || ae === 0) && /* @__PURE__ */ f("foreignObject", {
|
|
950
|
+
x: -O,
|
|
947
951
|
y: -16,
|
|
948
|
-
width:
|
|
952
|
+
width: O * 2,
|
|
949
953
|
height: 32,
|
|
950
954
|
style: {
|
|
951
955
|
pointerEvents: "none",
|
|
@@ -959,53 +963,53 @@ function Ae({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
959
963
|
width: "100%",
|
|
960
964
|
height: "100%",
|
|
961
965
|
color: s ? "var(--accent-teal)" : "var(--node-text)",
|
|
962
|
-
fontSize:
|
|
966
|
+
fontSize: k ? "10px" : "15px",
|
|
963
967
|
fontWeight: s ? 700 : 400
|
|
964
968
|
},
|
|
965
|
-
dangerouslySetInnerHTML: { __html:
|
|
969
|
+
dangerouslySetInnerHTML: { __html: q.get(e.id) ?? "" }
|
|
966
970
|
})
|
|
967
971
|
})
|
|
968
972
|
]
|
|
969
973
|
}, e.id);
|
|
970
974
|
}) : null, [
|
|
971
975
|
e,
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
D,
|
|
976
|
+
K,
|
|
977
|
+
ae,
|
|
978
|
+
B,
|
|
979
|
+
V,
|
|
977
980
|
O,
|
|
981
|
+
k,
|
|
978
982
|
n,
|
|
979
983
|
i,
|
|
980
|
-
I,
|
|
981
984
|
L,
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
+
R,
|
|
986
|
+
q,
|
|
987
|
+
T,
|
|
988
|
+
G,
|
|
985
989
|
h,
|
|
986
990
|
g,
|
|
987
|
-
|
|
991
|
+
C,
|
|
988
992
|
d,
|
|
989
|
-
|
|
993
|
+
F,
|
|
990
994
|
m,
|
|
991
995
|
_
|
|
992
|
-
]),
|
|
993
|
-
let t =
|
|
994
|
-
x:
|
|
995
|
-
y:
|
|
996
|
-
}, r = t.x * n.scale + n.x, a = t.y * n.scale + n.y, o =
|
|
997
|
-
return
|
|
996
|
+
]), le = c(() => !e || t.size === 0 ? null : [...t].map((e) => {
|
|
997
|
+
let t = K.get(e) || {
|
|
998
|
+
x: L,
|
|
999
|
+
y: R
|
|
1000
|
+
}, r = t.x * n.scale + n.x, a = t.y * n.scale + n.y, o = O * n.scale * 1.5;
|
|
1001
|
+
return k && !(r + o > 0 && r - o < i.width && a + o > 0 && a - o < i.height) ? null : /* @__PURE__ */ p("g", {
|
|
998
1002
|
transform: `translate(${t.x}, ${t.y})`,
|
|
999
1003
|
children: [/* @__PURE__ */ f("circle", {
|
|
1000
|
-
r:
|
|
1004
|
+
r: O + 3,
|
|
1001
1005
|
fill: "none",
|
|
1002
1006
|
stroke: "#ffd93d",
|
|
1003
1007
|
strokeWidth: 3,
|
|
1004
1008
|
opacity: .95
|
|
1005
|
-
}),
|
|
1006
|
-
x: -
|
|
1009
|
+
}), k && /* @__PURE__ */ f("foreignObject", {
|
|
1010
|
+
x: -O,
|
|
1007
1011
|
y: -16,
|
|
1008
|
-
width:
|
|
1012
|
+
width: O * 2,
|
|
1009
1013
|
height: 32,
|
|
1010
1014
|
style: {
|
|
1011
1015
|
pointerEvents: "none",
|
|
@@ -1021,28 +1025,28 @@ function Ae({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
1021
1025
|
color: "var(--node-text)",
|
|
1022
1026
|
fontSize: "10px"
|
|
1023
1027
|
},
|
|
1024
|
-
dangerouslySetInnerHTML: { __html:
|
|
1028
|
+
dangerouslySetInnerHTML: { __html: q.get(e) ?? "" }
|
|
1025
1029
|
})
|
|
1026
1030
|
})]
|
|
1027
1031
|
}, `selected-${e}`);
|
|
1028
1032
|
}), [
|
|
1029
1033
|
e,
|
|
1030
1034
|
t,
|
|
1031
|
-
|
|
1032
|
-
|
|
1035
|
+
K,
|
|
1036
|
+
O,
|
|
1033
1037
|
n,
|
|
1034
1038
|
i,
|
|
1035
|
-
|
|
1036
|
-
I,
|
|
1039
|
+
k,
|
|
1037
1040
|
L,
|
|
1038
|
-
|
|
1041
|
+
R,
|
|
1042
|
+
q
|
|
1039
1043
|
]);
|
|
1040
1044
|
return e ? /* @__PURE__ */ p("svg", {
|
|
1041
1045
|
viewBox: `0 0 ${i.width} ${i.height}`,
|
|
1042
1046
|
className: "view-svg",
|
|
1043
1047
|
style: { userSelect: "none" },
|
|
1044
1048
|
children: [/* @__PURE__ */ p("defs", { children: [/* @__PURE__ */ f("filter", {
|
|
1045
|
-
id: `${
|
|
1049
|
+
id: `${C}-node-shadow`,
|
|
1046
1050
|
x: "-30%",
|
|
1047
1051
|
y: "-30%",
|
|
1048
1052
|
width: "160%",
|
|
@@ -1054,8 +1058,8 @@ function Ae({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
1054
1058
|
floodColor: "#000000",
|
|
1055
1059
|
floodOpacity: "0.25"
|
|
1056
1060
|
})
|
|
1057
|
-
}),
|
|
1058
|
-
id: `${
|
|
1061
|
+
}), re.map((e, t) => /* @__PURE__ */ f("marker", {
|
|
1062
|
+
id: `${C}-arrow-${t}`,
|
|
1059
1063
|
markerWidth: 10,
|
|
1060
1064
|
markerHeight: 10,
|
|
1061
1065
|
refX: 9,
|
|
@@ -1069,10 +1073,10 @@ function Ae({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
1069
1073
|
}, t))] }), /* @__PURE__ */ p("g", {
|
|
1070
1074
|
transform: `translate(${n.x}, ${n.y}) scale(${n.scale})`,
|
|
1071
1075
|
children: [
|
|
1072
|
-
ae,
|
|
1073
1076
|
oe,
|
|
1074
1077
|
se,
|
|
1075
|
-
ce
|
|
1078
|
+
ce,
|
|
1079
|
+
le
|
|
1076
1080
|
]
|
|
1077
1081
|
})]
|
|
1078
1082
|
}) : /* @__PURE__ */ f("div", {
|
|
@@ -1080,7 +1084,7 @@ function Ae({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: i,
|
|
|
1080
1084
|
children: /* @__PURE__ */ f("p", { children: v ?? "" })
|
|
1081
1085
|
});
|
|
1082
1086
|
}
|
|
1083
|
-
var
|
|
1087
|
+
var Me = {
|
|
1084
1088
|
zh: {
|
|
1085
1089
|
"app.title": "GroupViz - 群论可视化",
|
|
1086
1090
|
"app.header": "GroupViz - 群论可视化",
|
|
@@ -1090,7 +1094,7 @@ var je = {
|
|
|
1090
1094
|
"theme.viewWindowDark": "视图窗口切换为浅色",
|
|
1091
1095
|
"theme.viewWindowLight": "视图窗口切换为深色",
|
|
1092
1096
|
"welcome.subtitle": "群论可视化平台",
|
|
1093
|
-
"welcome.version": "v2.1.
|
|
1097
|
+
"welcome.version": "v2.1.4",
|
|
1094
1098
|
"welcome.tagline": "探索抽象代数的对称之美 — 交互式群论可视化与学习工具",
|
|
1095
1099
|
"welcome.enter": "进入应用",
|
|
1096
1100
|
"welcome.section.done": "已实现",
|
|
@@ -1719,7 +1723,7 @@ var je = {
|
|
|
1719
1723
|
"theme.viewWindowDark": "View windows: switch to light",
|
|
1720
1724
|
"theme.viewWindowLight": "View windows: switch to dark",
|
|
1721
1725
|
"welcome.subtitle": "Group Theory Visualization Platform",
|
|
1722
|
-
"welcome.version": "v2.1.
|
|
1726
|
+
"welcome.version": "v2.1.4",
|
|
1723
1727
|
"welcome.tagline": "Explore the beauty of symmetry in abstract algebra — Interactive group theory visualization & learning tool",
|
|
1724
1728
|
"welcome.enter": "Enter",
|
|
1725
1729
|
"welcome.section.done": "Implemented",
|
|
@@ -2340,33 +2344,33 @@ var je = {
|
|
|
2340
2344
|
"theme.switchToDark": "Switch to Dark Mode"
|
|
2341
2345
|
}
|
|
2342
2346
|
};
|
|
2343
|
-
function
|
|
2347
|
+
function $() {
|
|
2344
2348
|
if (typeof window > "u") return "zh";
|
|
2345
2349
|
let e = localStorage.getItem("groupviz-lang");
|
|
2346
2350
|
return e === "en" || e === "zh" ? e : ((navigator.language || "").startsWith("zh"), "zh");
|
|
2347
2351
|
}
|
|
2348
2352
|
//#endregion
|
|
2349
2353
|
//#region src/i18n/I18nContext.tsx
|
|
2350
|
-
function
|
|
2351
|
-
let n =
|
|
2354
|
+
function Ne(e, t) {
|
|
2355
|
+
let n = Me.zh[e] ?? Me.en[e] ?? e;
|
|
2352
2356
|
if (t) for (let [e, r] of Object.entries(t)) n = n.replace(RegExp(`\\{${e}\\}`, "g"), String(r));
|
|
2353
2357
|
return n;
|
|
2354
2358
|
}
|
|
2355
|
-
var
|
|
2359
|
+
var Pe = e({
|
|
2356
2360
|
lang: "zh",
|
|
2357
2361
|
setLang: () => {},
|
|
2358
|
-
t:
|
|
2362
|
+
t: Ne
|
|
2359
2363
|
});
|
|
2360
|
-
function
|
|
2361
|
-
let [i, a] = u(() => t ??
|
|
2364
|
+
function Fe({ children: e, lang: t, persist: n = !0 }) {
|
|
2365
|
+
let [i, a] = u(() => t ?? $()), o = r((e) => {
|
|
2362
2366
|
a(e), n && localStorage.setItem("groupviz-lang", e);
|
|
2363
2367
|
}, [n]), s = r((e, t) => {
|
|
2364
|
-
let n =
|
|
2365
|
-
if (n === void 0 && (n =
|
|
2368
|
+
let n = Me[i][e];
|
|
2369
|
+
if (n === void 0 && (n = Me.en[e]), n === void 0) return console.warn(`Missing translation key: "${e}" for lang "${i}"`), e;
|
|
2366
2370
|
if (t) for (let [e, r] of Object.entries(t)) n = n.replace(RegExp(`\\{${e}\\}`, "g"), String(r));
|
|
2367
2371
|
return n;
|
|
2368
2372
|
}, [i]);
|
|
2369
|
-
return /* @__PURE__ */ f(
|
|
2373
|
+
return /* @__PURE__ */ f(Pe.Provider, {
|
|
2370
2374
|
value: {
|
|
2371
2375
|
lang: i,
|
|
2372
2376
|
setLang: o,
|
|
@@ -2377,41 +2381,41 @@ function Pe({ children: e, lang: t, persist: n = !0 }) {
|
|
|
2377
2381
|
}
|
|
2378
2382
|
//#endregion
|
|
2379
2383
|
//#region src/i18n/useTranslation.ts
|
|
2380
|
-
function
|
|
2381
|
-
return i(
|
|
2384
|
+
function Ie() {
|
|
2385
|
+
return i(Pe);
|
|
2382
2386
|
}
|
|
2383
2387
|
//#endregion
|
|
2384
2388
|
//#region src/components/Canvas/CosetStripScene.tsx
|
|
2385
|
-
var
|
|
2386
|
-
function
|
|
2389
|
+
var Le = /* @__PURE__ */ new Set();
|
|
2390
|
+
function Re(e, t) {
|
|
2387
2391
|
let n = `${e.symbol}|${[...t].sort().join(",")}`;
|
|
2388
|
-
|
|
2392
|
+
Le.has(n) || (Le.add(n), console.warn(`[groupviz] CosetStripScene.subgroup: 元素集合 [${n.split("|")[1]}] 在群 ${e.symbol} 中不构成子群(不含单位元或乘法不封闭),陪集视图显示空态。`));
|
|
2389
2393
|
}
|
|
2390
|
-
function
|
|
2391
|
-
return /* @__PURE__ */ f(
|
|
2394
|
+
function ze(e) {
|
|
2395
|
+
return /* @__PURE__ */ f(Y, {
|
|
2392
2396
|
theme: e.theme,
|
|
2393
|
-
children: /* @__PURE__ */ f(
|
|
2397
|
+
children: /* @__PURE__ */ f(Be, { ...e })
|
|
2394
2398
|
});
|
|
2395
2399
|
}
|
|
2396
|
-
function
|
|
2397
|
-
let { t: T } =
|
|
2398
|
-
if (i || !e || !
|
|
2399
|
-
let n =
|
|
2400
|
+
function Be({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r, cosetElementMap: i, cosetColors: a, cosetHighlightSet: s, subsets: l, showLabels: u = !0, showSubgroupCayley: d = !0, onSelect: m, onHover: g, noGroupText: v, noCosetsText: b, subgroup: x, cosetType: C = "left", highlightAllCosets: w = !1 }) {
|
|
2401
|
+
let { t: T } = Ie(), E = o(), D = `${E}-cs-node-shadow`, O = (e) => `${E}-cs-cayley-arrow-${e}`, A = c(() => {
|
|
2402
|
+
if (i || !e || !x || x.length === 0) return null;
|
|
2403
|
+
let n = Te(e, x, "CosetStripScene.subgroup");
|
|
2400
2404
|
if (n.length === 0) return null;
|
|
2401
2405
|
let r = _(e, n, {
|
|
2402
2406
|
side: C,
|
|
2403
2407
|
highlightAll: w,
|
|
2404
2408
|
selected: t ?? []
|
|
2405
2409
|
});
|
|
2406
|
-
return r ||
|
|
2410
|
+
return r || Re(e, n), r;
|
|
2407
2411
|
}, [
|
|
2408
2412
|
i,
|
|
2409
2413
|
e,
|
|
2410
|
-
|
|
2414
|
+
x,
|
|
2411
2415
|
C,
|
|
2412
2416
|
w,
|
|
2413
2417
|
t
|
|
2414
|
-
]), j = i ?? A?.cosetElementMap, M = a ?? A?.cosetColors,
|
|
2418
|
+
]), j = i ?? A?.cosetElementMap, M = a ?? A?.cosetColors, N = s ?? A?.cosetHighlightSet, F = c(() => {
|
|
2415
2419
|
let e = /* @__PURE__ */ new Map();
|
|
2416
2420
|
return (l ?? []).forEach((t) => t.elementIds.forEach((n) => {
|
|
2417
2421
|
e.has(n) || e.set(n, t);
|
|
@@ -2429,7 +2433,7 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2429
2433
|
r,
|
|
2430
2434
|
topPad: 2 * r + 64
|
|
2431
2435
|
};
|
|
2432
|
-
}, [e, j]), L = c(() => !e || !j || j.size === 0 ? null :
|
|
2436
|
+
}, [e, j]), L = c(() => !e || !j || j.size === 0 ? null : k(e, r.width, r.height, void 0, j, new Set(j.values()).size, M, I && d ? I.topPad : void 0), [
|
|
2433
2437
|
e,
|
|
2434
2438
|
r.width,
|
|
2435
2439
|
r.height,
|
|
@@ -2444,7 +2448,7 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2444
2448
|
let n = [];
|
|
2445
2449
|
for (let [e, r] of j) r === t && n.push(e);
|
|
2446
2450
|
if (n.length < 2 || n.length > 12) return null;
|
|
2447
|
-
let r = new Set(n), i = e.elements.filter((e) => r.has(e.id)), a =
|
|
2451
|
+
let r = new Set(n), i = e.elements.filter((e) => r.has(e.id)), a = P(i, e);
|
|
2448
2452
|
if (a.length === 0) return null;
|
|
2449
2453
|
let o = /* @__PURE__ */ new Map();
|
|
2450
2454
|
return {
|
|
@@ -2452,7 +2456,7 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2452
2456
|
hElements: i,
|
|
2453
2457
|
hGenerators: a,
|
|
2454
2458
|
genIndex: o,
|
|
2455
|
-
edges:
|
|
2459
|
+
edges: S(e, a.map((e, t) => (o.set(e.id, t), {
|
|
2456
2460
|
elementId: e.id,
|
|
2457
2461
|
enabled: !0,
|
|
2458
2462
|
color: h[t % h.length]
|
|
@@ -2462,11 +2466,11 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2462
2466
|
e,
|
|
2463
2467
|
j,
|
|
2464
2468
|
d
|
|
2465
|
-
]),
|
|
2469
|
+
]), ee = c(() => {
|
|
2466
2470
|
if (!e) return 28;
|
|
2467
2471
|
let t = Math.max(...e.elements.map((e) => e.label.length));
|
|
2468
2472
|
return t > 15 ? 20 : t > 8 ? 24 : 28;
|
|
2469
|
-
}, [e]),
|
|
2473
|
+
}, [e]), te = !e, z = (e, t) => {
|
|
2470
2474
|
g && g(e, t);
|
|
2471
2475
|
};
|
|
2472
2476
|
return /* @__PURE__ */ p("svg", {
|
|
@@ -2487,7 +2491,7 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2487
2491
|
floodOpacity: "0.25"
|
|
2488
2492
|
})
|
|
2489
2493
|
}), R && R.hGenerators.map((e, t) => /* @__PURE__ */ f("marker", {
|
|
2490
|
-
id:
|
|
2494
|
+
id: O(t),
|
|
2491
2495
|
markerWidth: 13,
|
|
2492
2496
|
markerHeight: 13,
|
|
2493
2497
|
refX: 10,
|
|
@@ -2558,7 +2562,7 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2558
2562
|
stroke: e.color,
|
|
2559
2563
|
strokeWidth: 2.2,
|
|
2560
2564
|
opacity: .9,
|
|
2561
|
-
markerEnd: e.isBidirectional ? void 0 : `url(#${
|
|
2565
|
+
markerEnd: e.isBidirectional ? void 0 : `url(#${O(r)})`
|
|
2562
2566
|
}, `${e.fromId}-${e.toId}-${e.actionElementId}`);
|
|
2563
2567
|
}),
|
|
2564
2568
|
R.hElements.map((t) => {
|
|
@@ -2589,7 +2593,7 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2589
2593
|
color: "var(--node-text)",
|
|
2590
2594
|
fontSize: `${o}px`
|
|
2591
2595
|
},
|
|
2592
|
-
dangerouslySetInnerHTML: { __html:
|
|
2596
|
+
dangerouslySetInnerHTML: { __html: Q(X(t.label)) }
|
|
2593
2597
|
})
|
|
2594
2598
|
})]
|
|
2595
2599
|
}, `h-cayley-${t.id}`) : null;
|
|
@@ -2612,7 +2616,7 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2612
2616
|
L && e && e.elements.map((e) => {
|
|
2613
2617
|
let r = L.positions.get(e.id);
|
|
2614
2618
|
if (!r) return null;
|
|
2615
|
-
let i = t?.has(e.id) ?? !1, a = F.get(e.id), o = j?.get(e.id), s = o !== void 0 && (
|
|
2619
|
+
let i = t?.has(e.id) ?? !1, a = F.get(e.id), o = j?.get(e.id), s = o !== void 0 && (N?.has(o) ?? !1), c = "var(--node-fill)", l = "var(--node-stroke)", d = 2.5;
|
|
2616
2620
|
return i ? (c = "var(--node-fill-selected)", l = "#ffd93d", d = 3) : s && o !== void 0 && M ? (c = M[o] + "33", l = M[o], d = 3) : a && (c = a.color + "33", l = a.color, d = 2.5), /* @__PURE__ */ p("g", {
|
|
2617
2621
|
"data-coset-node": e.id,
|
|
2618
2622
|
transform: `translate(${r.x}, ${r.y})`,
|
|
@@ -2621,35 +2625,35 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2621
2625
|
},
|
|
2622
2626
|
onMouseEnter: () => {
|
|
2623
2627
|
let t = n?.scale ?? 1;
|
|
2624
|
-
|
|
2628
|
+
z(e, {
|
|
2625
2629
|
x: r.x * t + (n?.x ?? 0),
|
|
2626
2630
|
y: r.y * t + (n?.y ?? 0)
|
|
2627
2631
|
});
|
|
2628
2632
|
},
|
|
2629
|
-
onMouseLeave: () =>
|
|
2633
|
+
onMouseLeave: () => z(null),
|
|
2630
2634
|
style: { cursor: "pointer" },
|
|
2631
2635
|
children: [
|
|
2632
2636
|
/* @__PURE__ */ f("circle", {
|
|
2633
|
-
r:
|
|
2637
|
+
r: ee,
|
|
2634
2638
|
fill: c,
|
|
2635
2639
|
stroke: l,
|
|
2636
2640
|
strokeWidth: d,
|
|
2637
2641
|
filter: "url(#${shadowId})"
|
|
2638
2642
|
}),
|
|
2639
2643
|
a && /* @__PURE__ */ f("circle", {
|
|
2640
|
-
r:
|
|
2644
|
+
r: ee,
|
|
2641
2645
|
fill: `${a.color}22`,
|
|
2642
2646
|
stroke: "none"
|
|
2643
2647
|
}),
|
|
2644
2648
|
s && o !== void 0 && M && /* @__PURE__ */ f("circle", {
|
|
2645
|
-
r:
|
|
2649
|
+
r: ee,
|
|
2646
2650
|
fill: `${M[o]}22`,
|
|
2647
2651
|
stroke: "none"
|
|
2648
2652
|
}),
|
|
2649
2653
|
u && /* @__PURE__ */ f("foreignObject", {
|
|
2650
|
-
x: -
|
|
2654
|
+
x: -ee,
|
|
2651
2655
|
y: -16,
|
|
2652
|
-
width:
|
|
2656
|
+
width: ee * 2,
|
|
2653
2657
|
height: 32,
|
|
2654
2658
|
style: {
|
|
2655
2659
|
pointerEvents: "none",
|
|
@@ -2665,13 +2669,13 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2665
2669
|
color: "var(--node-text)",
|
|
2666
2670
|
fontSize: e.label.length <= 4 ? "15px" : e.label.length <= 6 ? "13px" : "10px"
|
|
2667
2671
|
},
|
|
2668
|
-
dangerouslySetInnerHTML: { __html:
|
|
2672
|
+
dangerouslySetInnerHTML: { __html: Q(X(e.label)) }
|
|
2669
2673
|
})
|
|
2670
2674
|
})
|
|
2671
2675
|
]
|
|
2672
2676
|
}, e.id);
|
|
2673
2677
|
}),
|
|
2674
|
-
|
|
2678
|
+
te && /* @__PURE__ */ f("text", {
|
|
2675
2679
|
x: r.width / 2,
|
|
2676
2680
|
y: r.height / 2,
|
|
2677
2681
|
textAnchor: "middle",
|
|
@@ -2693,13 +2697,13 @@ function ze({ group: e, selectedElements: t, canvasTransform: n, viewBoxSize: r,
|
|
|
2693
2697
|
}
|
|
2694
2698
|
//#endregion
|
|
2695
2699
|
//#region src/utils/download.ts
|
|
2696
|
-
function
|
|
2700
|
+
function Ve(e, t) {
|
|
2697
2701
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
2698
2702
|
r.href = n, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), setTimeout(() => URL.revokeObjectURL(n), 1e3);
|
|
2699
2703
|
}
|
|
2700
2704
|
//#endregion
|
|
2701
2705
|
//#region src/components/Canvas/TableView.tsx
|
|
2702
|
-
var
|
|
2706
|
+
var He = [
|
|
2703
2707
|
"#ff6b6b",
|
|
2704
2708
|
"#4ecdc4",
|
|
2705
2709
|
"#ffd93d",
|
|
@@ -2715,15 +2719,15 @@ var Ve = [
|
|
|
2715
2719
|
"#3071a9",
|
|
2716
2720
|
"#d35400",
|
|
2717
2721
|
"#c0392b"
|
|
2718
|
-
],
|
|
2719
|
-
function
|
|
2720
|
-
return /* @__PURE__ */ f(
|
|
2722
|
+
], Ue = 60, We = 80;
|
|
2723
|
+
function Ge(e) {
|
|
2724
|
+
return /* @__PURE__ */ f(Y, {
|
|
2721
2725
|
theme: e.theme,
|
|
2722
|
-
children: /* @__PURE__ */ f(
|
|
2726
|
+
children: /* @__PURE__ */ f(Xe, { ...e })
|
|
2723
2727
|
});
|
|
2724
2728
|
}
|
|
2725
|
-
var
|
|
2726
|
-
function
|
|
2729
|
+
var Ke = /* @__PURE__ */ new Map(), qe = [];
|
|
2730
|
+
function Je(e, t) {
|
|
2727
2731
|
let n = e.order, r = new Set([t.get(e.identity.id) ?? 0]), i = Math.max(r.size, Math.min(n, 6 + Math.floor(Math.random() * 7))), a = [];
|
|
2728
2732
|
for (let e = 0; e < n; e++) r.has(e) || a.push(e);
|
|
2729
2733
|
for (; r.size < i && a.length > 0;) {
|
|
@@ -2732,7 +2736,7 @@ function qe(e, t) {
|
|
|
2732
2736
|
}
|
|
2733
2737
|
return [...r].sort((e, t) => e - t);
|
|
2734
2738
|
}
|
|
2735
|
-
function
|
|
2739
|
+
function Ye(e, t, n) {
|
|
2736
2740
|
let r = /* @__PURE__ */ new Map(), i = (e, t) => {
|
|
2737
2741
|
let n = [...e].sort((e, t) => e - t).join(",");
|
|
2738
2742
|
r.has(n) || r.set(n, {
|
|
@@ -2769,7 +2773,7 @@ function Je(e, t, n) {
|
|
|
2769
2773
|
i(a, `⟨${e.label}⟩`);
|
|
2770
2774
|
}
|
|
2771
2775
|
}
|
|
2772
|
-
if (e.order <= 60) for (let n of
|
|
2776
|
+
if (e.order <= 60) for (let n of N(e)) {
|
|
2773
2777
|
if (n.order < 2 || n.order > 16) continue;
|
|
2774
2778
|
let e = [], r = !0;
|
|
2775
2779
|
for (let i of n.elements) {
|
|
@@ -2787,24 +2791,24 @@ function Je(e, t, n) {
|
|
|
2787
2791
|
let c = [...r.values()], l = c.filter((e) => e.order >= 6 && e.order <= 12), u = l.length > 0 ? l : c;
|
|
2788
2792
|
return u.length === 0 ? null : u[Math.floor(Math.random() * u.length)];
|
|
2789
2793
|
}
|
|
2790
|
-
function
|
|
2791
|
-
let { t: A } =
|
|
2794
|
+
function Xe({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i, subsets: o, cosetElementMap: s, cosetColors: m, cosetData: h, cosetType: g, showAllCosets: _, forceShowLargeGroup: v, onForceShowLargeGroup: y, strategy: b, cellSize: x, showHeatmap: S = !1, onStrategyChange: C, onLayoutSize: w, onSelect: T, onHover: E, noGroupText: D, maxTableOrder: O, maxHeatmapOrder: k }) {
|
|
2795
|
+
let { t: A } = Ie(), j = o ?? qe, M = s ?? Ke, N = h ?? null, P = g ?? "left", F = _ ?? !1, I = e ? e.order > 16 : !1, [L, R] = u(() => b ?? "subgroup"), [ee, te] = u(0), [ne, B] = u(!1), [V, re] = u(!1), [H, ie] = u(1), [U, W] = u(!1), [G, K] = u({
|
|
2792
2796
|
l: 0,
|
|
2793
2797
|
t: 0
|
|
2794
2798
|
}), [q, ae] = u({
|
|
2795
2799
|
w: 0,
|
|
2796
2800
|
h: 0
|
|
2797
|
-
}), oe = l(null), se = l(0), ce = l(null),
|
|
2798
|
-
y ? y(!0) :
|
|
2799
|
-
}, [y]), [
|
|
2800
|
-
b !==
|
|
2801
|
-
let
|
|
2801
|
+
}), oe = l(null), se = l(0), ce = l(null), le = l(null), [J, Y] = u(!1), ue = v ?? J, de = r(() => {
|
|
2802
|
+
y ? y(!0) : Y(!0);
|
|
2803
|
+
}, [y]), [fe, pe] = u(b);
|
|
2804
|
+
b !== fe && (pe(b), b !== void 0 && R(b));
|
|
2805
|
+
let X = r((e) => {
|
|
2802
2806
|
R(e), C?.(e);
|
|
2803
|
-
}, [C]),
|
|
2807
|
+
}, [C]), Z = c(() => {
|
|
2804
2808
|
if (!e) return /* @__PURE__ */ new Map();
|
|
2805
2809
|
let t = /* @__PURE__ */ new Map();
|
|
2806
2810
|
return e.elements.forEach((e, n) => t.set(e.id, n)), t;
|
|
2807
|
-
}, [e]),
|
|
2811
|
+
}, [e]), me = c(() => {
|
|
2808
2812
|
if (!e) return /* @__PURE__ */ new Map();
|
|
2809
2813
|
let t = /* @__PURE__ */ new Map();
|
|
2810
2814
|
return e.elements.forEach((e, n) => t.set(e.label, n)), t;
|
|
@@ -2824,18 +2828,18 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
2824
2828
|
}
|
|
2825
2829
|
return i;
|
|
2826
2830
|
}, [e]), he = (e) => {
|
|
2827
|
-
let t =
|
|
2828
|
-
return t === void 0 ? "#ccc" :
|
|
2831
|
+
let t = me.get(e);
|
|
2832
|
+
return t === void 0 ? "#ccc" : He[t % He.length];
|
|
2829
2833
|
}, ge = c(() => {
|
|
2830
2834
|
let e = /* @__PURE__ */ new Set();
|
|
2831
2835
|
return t.forEach((t) => {
|
|
2832
|
-
let n =
|
|
2836
|
+
let n = Z.get(t);
|
|
2833
2837
|
n !== void 0 && e.add(n);
|
|
2834
2838
|
}), e;
|
|
2835
|
-
}, [t,
|
|
2839
|
+
}, [t, Z]), _e = c(() => e ? j.filter((e) => e.isSubgroup).map((e) => {
|
|
2836
2840
|
let t = /* @__PURE__ */ new Set();
|
|
2837
2841
|
return e.elementIds.forEach((e) => {
|
|
2838
|
-
let n =
|
|
2842
|
+
let n = Z.get(e);
|
|
2839
2843
|
n !== void 0 && t.add(n);
|
|
2840
2844
|
}), {
|
|
2841
2845
|
color: e.color,
|
|
@@ -2843,26 +2847,26 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
2843
2847
|
};
|
|
2844
2848
|
}) : [], [
|
|
2845
2849
|
j,
|
|
2846
|
-
|
|
2850
|
+
Z,
|
|
2847
2851
|
e
|
|
2848
2852
|
]), ve = c(() => {
|
|
2849
2853
|
let e = /* @__PURE__ */ new Set();
|
|
2850
2854
|
for (let t of j) if (!t.isSubgroup) for (let n of t.elementIds) {
|
|
2851
|
-
let t =
|
|
2855
|
+
let t = Z.get(n);
|
|
2852
2856
|
t !== void 0 && e.add(t);
|
|
2853
2857
|
}
|
|
2854
2858
|
return e;
|
|
2855
|
-
}, [j,
|
|
2859
|
+
}, [j, Z]), ye = c(() => {
|
|
2856
2860
|
let e = /* @__PURE__ */ new Map();
|
|
2857
2861
|
for (let t of j) for (let n of t.elementIds) {
|
|
2858
|
-
let r =
|
|
2862
|
+
let r = Z.get(n);
|
|
2859
2863
|
r !== void 0 && (e.has(r) || e.set(r, {
|
|
2860
2864
|
color: t.color,
|
|
2861
2865
|
isSubgroup: t.isSubgroup
|
|
2862
2866
|
}));
|
|
2863
2867
|
}
|
|
2864
2868
|
return e;
|
|
2865
|
-
}, [j,
|
|
2869
|
+
}, [j, Z]), be = c(() => {
|
|
2866
2870
|
if (!e) return /* @__PURE__ */ new Map();
|
|
2867
2871
|
let t = /* @__PURE__ */ new Map();
|
|
2868
2872
|
for (let e of _e) for (let n of e.indices) for (let r of e.indices) t.set(`${n},${r}`, e.color);
|
|
@@ -2871,14 +2875,14 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
2871
2875
|
let t = /* @__PURE__ */ new Set();
|
|
2872
2876
|
if (!e || !N) return t;
|
|
2873
2877
|
for (let e of N.subgroup.elements) {
|
|
2874
|
-
let n =
|
|
2878
|
+
let n = Z.get(e.id);
|
|
2875
2879
|
n !== void 0 && t.add(n);
|
|
2876
2880
|
}
|
|
2877
2881
|
return t;
|
|
2878
2882
|
}, [
|
|
2879
2883
|
e,
|
|
2880
2884
|
N,
|
|
2881
|
-
|
|
2885
|
+
Z
|
|
2882
2886
|
]), Se = c(() => {
|
|
2883
2887
|
if (!e || !N) return /* @__PURE__ */ new Set();
|
|
2884
2888
|
if (F) {
|
|
@@ -2911,18 +2915,18 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
2911
2915
|
let e = /* @__PURE__ */ new Set();
|
|
2912
2916
|
for (let t of _e) for (let n of t.indices) e.add(n);
|
|
2913
2917
|
return e;
|
|
2914
|
-
}, [_e]), Te = c(() => !e || !I || L !== "subgroup" ? null :
|
|
2918
|
+
}, [_e]), Te = c(() => !e || !I || L !== "subgroup" ? null : Ye(e, Z, j), [
|
|
2915
2919
|
e,
|
|
2916
2920
|
I,
|
|
2917
2921
|
L,
|
|
2918
2922
|
j,
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
]), Ee = c(() => !e || !I ? [] :
|
|
2923
|
+
Z,
|
|
2924
|
+
ee
|
|
2925
|
+
]), Ee = c(() => !e || !I ? [] : Je(e, Z), [
|
|
2922
2926
|
e,
|
|
2923
2927
|
I,
|
|
2924
|
-
|
|
2925
|
-
|
|
2928
|
+
Z,
|
|
2929
|
+
ee
|
|
2926
2930
|
]), De = c(() => e ? !I || L === "full" ? e.elements.map((e, t) => t) : L === "random" ? Ee : Te ? Te.indices : Ee : [], [
|
|
2927
2931
|
e,
|
|
2928
2932
|
I,
|
|
@@ -2930,8 +2934,8 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
2930
2934
|
Te,
|
|
2931
2935
|
Ee
|
|
2932
2936
|
]), Oe = c(() => {
|
|
2933
|
-
if (!e || !Q || !(S && L === "full" && e.order >
|
|
2934
|
-
let t = e.order, n = Math.min(
|
|
2937
|
+
if (!e || !Q || !(S && L === "full" && e.order > Ue)) return null;
|
|
2938
|
+
let t = e.order, n = Math.min(We, t), r = [];
|
|
2935
2939
|
for (let e = 0; e < n; e++) {
|
|
2936
2940
|
let i = Math.floor(e * t / n), a = Math.floor((e + 1) * t / n), o = Array(n);
|
|
2937
2941
|
for (let e = 0; e < n; e++) {
|
|
@@ -2939,11 +2943,11 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
2939
2943
|
for (let e = i; e < a; e++) {
|
|
2940
2944
|
let t = Q[e];
|
|
2941
2945
|
for (let e = r; e < s; e++) {
|
|
2942
|
-
let n =
|
|
2946
|
+
let n = Z.get(t[e].id) ?? 0;
|
|
2943
2947
|
c.set(n, (c.get(n) ?? 0) + 1);
|
|
2944
2948
|
}
|
|
2945
2949
|
}
|
|
2946
|
-
let l =
|
|
2950
|
+
let l = Z.get(Q[i][r].id) ?? 0, u = -1;
|
|
2947
2951
|
for (let [e, t] of c) t > u && (u = t, l = e);
|
|
2948
2952
|
o[e] = l;
|
|
2949
2953
|
}
|
|
@@ -2953,10 +2957,10 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
2953
2957
|
}, [
|
|
2954
2958
|
e,
|
|
2955
2959
|
Q,
|
|
2956
|
-
|
|
2960
|
+
Z,
|
|
2957
2961
|
S,
|
|
2958
2962
|
L
|
|
2959
|
-
]), ke = x ?? 50, Ae = S && e !== null && (!I || L === "full"), je = Oe ? Oe.length : De.length, Me = Math.max(4, Math.floor((Math.min(n.width, n.height) - 60) / Math.max(1, je))), $ = Ae ? Math.min(ke, Me) : ke, Ne = e ?
|
|
2963
|
+
]), ke = x ?? 50, Ae = S && e !== null && (!I || L === "full"), je = Oe ? Oe.length : De.length, Me = Math.max(4, Math.floor((Math.min(n.width, n.height) - 60) / Math.max(1, je))), $ = Ae ? Math.min(ke, Me) : ke, Ne = e ? z(e.order, S ? "heatmap" : "table", S ? k : O) && !ue : !1, Pe = !S && I && L === "full" && !!e && e.order > 30 && !V;
|
|
2960
2964
|
a(() => {
|
|
2961
2965
|
if (!e || !Q) {
|
|
2962
2966
|
w?.(null);
|
|
@@ -2982,61 +2986,61 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
2982
2986
|
w,
|
|
2983
2987
|
S
|
|
2984
2988
|
]);
|
|
2985
|
-
let
|
|
2986
|
-
|
|
2987
|
-
}, [
|
|
2989
|
+
let Fe = r(() => {
|
|
2990
|
+
re(!1), X("subgroup");
|
|
2991
|
+
}, [X]);
|
|
2988
2992
|
a(() => {
|
|
2989
2993
|
if (!V) return;
|
|
2990
2994
|
let e = (e) => {
|
|
2991
|
-
e.key === "Escape" &&
|
|
2995
|
+
e.key === "Escape" && Fe();
|
|
2992
2996
|
};
|
|
2993
2997
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
2994
|
-
}, [V,
|
|
2998
|
+
}, [V, Fe]), a(() => {
|
|
2995
2999
|
if (V) {
|
|
2996
3000
|
let e = oe.current;
|
|
2997
3001
|
e && (e.scrollLeft = 0, e.scrollTop = 0);
|
|
2998
3002
|
}
|
|
2999
3003
|
}, [V]);
|
|
3000
3004
|
let Le = () => {
|
|
3001
|
-
|
|
3005
|
+
ie(1), re(!0);
|
|
3002
3006
|
}, Re = (t) => {
|
|
3003
3007
|
if (t === L) {
|
|
3004
|
-
|
|
3008
|
+
te((e) => e + 1);
|
|
3005
3009
|
return;
|
|
3006
3010
|
}
|
|
3007
3011
|
if (t === "full") {
|
|
3008
3012
|
if (!S && e && e.order > 30) {
|
|
3009
|
-
|
|
3013
|
+
B(!0);
|
|
3010
3014
|
return;
|
|
3011
3015
|
}
|
|
3012
|
-
|
|
3016
|
+
X("full");
|
|
3013
3017
|
return;
|
|
3014
3018
|
}
|
|
3015
|
-
|
|
3019
|
+
X(t);
|
|
3016
3020
|
}, ze = () => {
|
|
3017
|
-
|
|
3018
|
-
},
|
|
3021
|
+
B(!1), Le();
|
|
3022
|
+
}, Be = r((e, t, n) => {
|
|
3019
3023
|
let r = oe.current;
|
|
3020
3024
|
if (!r) return;
|
|
3021
|
-
let i = r.getBoundingClientRect(), a = t ?? i.width / 2, o = n ?? i.height / 2, s = (r.scrollLeft + a) /
|
|
3022
|
-
|
|
3025
|
+
let i = r.getBoundingClientRect(), a = t ?? i.width / 2, o = n ?? i.height / 2, s = (r.scrollLeft + a) / H, c = (r.scrollTop + o) / H, l = Math.min(6, Math.max(.25, H * e));
|
|
3026
|
+
ie(l), requestAnimationFrame(() => {
|
|
3023
3027
|
r.scrollLeft = s * l - a, r.scrollTop = c * l - o;
|
|
3024
3028
|
});
|
|
3025
|
-
}, [
|
|
3026
|
-
|
|
3029
|
+
}, [H]), Ge = (e) => {
|
|
3030
|
+
Be(e / 100 / H);
|
|
3027
3031
|
}, Xe = (e) => {
|
|
3028
3032
|
let t = oe.current;
|
|
3029
|
-
t && (
|
|
3033
|
+
t && (le.current = {
|
|
3030
3034
|
x: e.clientX,
|
|
3031
3035
|
y: e.clientY,
|
|
3032
3036
|
sl: t.scrollLeft,
|
|
3033
3037
|
st: t.scrollTop
|
|
3034
|
-
},
|
|
3038
|
+
}, W(!0), t.setPointerCapture(e.pointerId));
|
|
3035
3039
|
}, Ze = (e) => {
|
|
3036
|
-
let t = oe.current, n =
|
|
3040
|
+
let t = oe.current, n = le.current;
|
|
3037
3041
|
!t || !n || (t.scrollLeft = n.sl - (e.clientX - n.x), t.scrollTop = n.st - (e.clientY - n.y));
|
|
3038
3042
|
}, Qe = () => {
|
|
3039
|
-
|
|
3043
|
+
le.current = null, W(!1);
|
|
3040
3044
|
}, $e = r(() => {
|
|
3041
3045
|
let e = oe.current;
|
|
3042
3046
|
!e || se.current || (se.current = requestAnimationFrame(() => {
|
|
@@ -3064,17 +3068,17 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3064
3068
|
let t = ce.current;
|
|
3065
3069
|
if (!t || !e) return;
|
|
3066
3070
|
let n = t.cloneNode(!0), r = (t.getAttribute("viewBox") || "0 0 800 600").trim().split(/\s+/).map(Number);
|
|
3067
|
-
n.setAttribute("width", String(r[2] || 800)), n.setAttribute("height", String(r[3] || 600)), n.removeAttribute("style"),
|
|
3071
|
+
n.setAttribute("width", String(r[2] || 800)), n.setAttribute("height", String(r[3] || 600)), n.removeAttribute("style"), Ve(new Blob([new XMLSerializer().serializeToString(n)], { type: "image/svg+xml;charset=utf-8" }), `table_${e.symbol.replace(/[^A-Za-z0-9]+/g, "_")}_${e.order}x${e.order}.svg`);
|
|
3068
3072
|
};
|
|
3069
3073
|
if (!e || !Q) return /* @__PURE__ */ f("div", {
|
|
3070
3074
|
className: "view-empty",
|
|
3071
3075
|
children: /* @__PURE__ */ f("p", { children: D ?? A("canvas.noGroup") })
|
|
3072
3076
|
});
|
|
3073
|
-
if (
|
|
3077
|
+
if (z(e.order, "table", O) && !ue) return /* @__PURE__ */ p("div", {
|
|
3074
3078
|
className: "large-group-warning",
|
|
3075
3079
|
children: [/* @__PURE__ */ f("p", { children: A("canvas.orderTooLarge", { n: e.order }) }), /* @__PURE__ */ f("button", {
|
|
3076
3080
|
className: "panel-btn",
|
|
3077
|
-
onClick:
|
|
3081
|
+
onClick: de,
|
|
3078
3082
|
children: A("canvas.show")
|
|
3079
3083
|
})]
|
|
3080
3084
|
});
|
|
@@ -3128,7 +3132,7 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3128
3132
|
transform: `translate(${i.x}, ${i.y}) scale(${i.scale}) translate(${ot}, ${st})`,
|
|
3129
3133
|
children: [
|
|
3130
3134
|
!S && De.map((e, t) => {
|
|
3131
|
-
let n = tt[e], r = ge.has(e), i = ye.get(e), a = we.has(e), o = N !== null, s = Se.has(n.id), c = M.get(n.id), l = s && c !== void 0, u =
|
|
3135
|
+
let n = tt[e], r = ge.has(e), i = ye.get(e), a = we.has(e), o = N !== null, s = Se.has(n.id), c = M.get(n.id), l = s && c !== void 0, u = He[e % He.length], d = null;
|
|
3132
3136
|
return !o && r ? d = "#ffd93d33" : l ? d = (m ?? [])[c] + "33" : !o && a && i && (d = i.color + "33"), !o && r && (u = "#ffd93d"), /* @__PURE__ */ p("g", {
|
|
3133
3137
|
transform: `translate(0, ${t * ke})`,
|
|
3134
3138
|
onClick: () => T?.(n.id, !0),
|
|
@@ -3154,7 +3158,7 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3154
3158
|
}, n.id);
|
|
3155
3159
|
}),
|
|
3156
3160
|
!S && De.map((e, t) => {
|
|
3157
|
-
let n = tt[e], r = ge.has(e), i = ye.get(e), a = we.has(e), o = N !== null, s = Ce.has(n.id), c = M.get(n.id), l = s && c !== void 0, u =
|
|
3161
|
+
let n = tt[e], r = ge.has(e), i = ye.get(e), a = we.has(e), o = N !== null, s = Ce.has(n.id), c = M.get(n.id), l = s && c !== void 0, u = He[e % He.length], d = null;
|
|
3158
3162
|
return !o && r ? d = "#ffd93d33" : l ? d = (m ?? [])[c] + "33" : !o && a && i && (d = i.color + "33"), !o && r && (u = "#ffd93d"), /* @__PURE__ */ p("g", {
|
|
3159
3163
|
onClick: () => T?.(n.id, !0),
|
|
3160
3164
|
style: { cursor: "pointer" },
|
|
@@ -3179,7 +3183,7 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3179
3183
|
}, `head-${n.id}`);
|
|
3180
3184
|
}),
|
|
3181
3185
|
Oe && Oe.map((e, t) => e.map((e, n) => {
|
|
3182
|
-
let r =
|
|
3186
|
+
let r = He[e % He.length], i = $ <= 8 ? .5 : $ <= 20 ? 1 : 2, a = $ <= 8 ? 1 : $ <= 20 ? 2 : 3;
|
|
3183
3187
|
return /* @__PURE__ */ f("g", {
|
|
3184
3188
|
transform: `translate(${n * $}, ${t * $})`,
|
|
3185
3189
|
children: /* @__PURE__ */ f("rect", {
|
|
@@ -3193,7 +3197,7 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3193
3197
|
}, `agg-${t}-${n}`);
|
|
3194
3198
|
})),
|
|
3195
3199
|
!Oe && De.map((t, n) => De.map((r, i) => {
|
|
3196
|
-
let a = tt[t], o = tt[r], s = Q[t][r], c = he(s.label), l = ge.has(t), u = ge.has(r), d = `${t},${r}`, h = be.get(d), g =
|
|
3200
|
+
let a = tt[t], o = tt[r], s = Q[t][r], c = he(s.label), l = ge.has(t), u = ge.has(r), d = `${t},${r}`, h = be.get(d), g = Z.get(e.identity.id) ?? -1, _ = g >= 0 && t === g && ve.has(r), v = g >= 0 && r === g && ve.has(t), y = xe.has(r), b = xe.has(t), x = N !== null, C = Se.has(a.id), w = Ce.has(o.id), D = P === "left" && C && y || P === "right" && w && b;
|
|
3197
3201
|
if (S) {
|
|
3198
3202
|
let e = $ <= 8 ? .5 : $ <= 20 ? 1 : 2, t = $ <= 8 ? 1 : $ <= 20 ? 2 : 3, r = c, d = "rgba(0,0,0,0.18)", p = $ <= 8 ? .2 : .5;
|
|
3199
3203
|
if (D) {
|
|
@@ -3283,7 +3287,7 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3283
3287
|
})
|
|
3284
3288
|
]
|
|
3285
3289
|
}),
|
|
3286
|
-
|
|
3290
|
+
ne && /* @__PURE__ */ f("div", {
|
|
3287
3291
|
className: "table-confirm-overlay",
|
|
3288
3292
|
children: /* @__PURE__ */ p("div", {
|
|
3289
3293
|
className: "table-confirm-modal",
|
|
@@ -3300,7 +3304,7 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3300
3304
|
className: "table-confirm-actions",
|
|
3301
3305
|
children: [/* @__PURE__ */ f("button", {
|
|
3302
3306
|
className: "panel-btn",
|
|
3303
|
-
onClick: () =>
|
|
3307
|
+
onClick: () => B(!1),
|
|
3304
3308
|
children: A("table.confirmCancel")
|
|
3305
3309
|
}), /* @__PURE__ */ f("button", {
|
|
3306
3310
|
className: "panel-btn",
|
|
@@ -3327,19 +3331,19 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3327
3331
|
/* @__PURE__ */ f("button", {
|
|
3328
3332
|
className: "table-fs-btn",
|
|
3329
3333
|
title: A("table.fullZoomOut"),
|
|
3330
|
-
onClick: () =>
|
|
3334
|
+
onClick: () => Be(1 / 1.25),
|
|
3331
3335
|
children: "−"
|
|
3332
3336
|
}),
|
|
3333
3337
|
/* @__PURE__ */ f("button", {
|
|
3334
3338
|
className: "table-fs-btn",
|
|
3335
3339
|
title: A("table.fullZoomIn"),
|
|
3336
|
-
onClick: () =>
|
|
3340
|
+
onClick: () => Be(1.25),
|
|
3337
3341
|
children: "+"
|
|
3338
3342
|
}),
|
|
3339
3343
|
/* @__PURE__ */ f("button", {
|
|
3340
3344
|
className: "table-fs-btn",
|
|
3341
3345
|
title: A("table.fullZoomReset"),
|
|
3342
|
-
onClick: () =>
|
|
3346
|
+
onClick: () => Be(1 / H),
|
|
3343
3347
|
children: "⟳"
|
|
3344
3348
|
}),
|
|
3345
3349
|
/* @__PURE__ */ f("input", {
|
|
@@ -3348,9 +3352,9 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3348
3352
|
min: 25,
|
|
3349
3353
|
max: 600,
|
|
3350
3354
|
step: 1,
|
|
3351
|
-
value: Math.round(
|
|
3355
|
+
value: Math.round(H * 100),
|
|
3352
3356
|
"aria-label": A("table.zoomSlider"),
|
|
3353
|
-
onChange: (e) =>
|
|
3357
|
+
onChange: (e) => Ge(Number(e.target.value))
|
|
3354
3358
|
}),
|
|
3355
3359
|
/* @__PURE__ */ f("button", {
|
|
3356
3360
|
className: "panel-btn",
|
|
@@ -3359,13 +3363,13 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3359
3363
|
}),
|
|
3360
3364
|
/* @__PURE__ */ f("button", {
|
|
3361
3365
|
className: "panel-btn",
|
|
3362
|
-
onClick:
|
|
3366
|
+
onClick: Fe,
|
|
3363
3367
|
children: A("table.fullExit")
|
|
3364
3368
|
})
|
|
3365
3369
|
]
|
|
3366
3370
|
})]
|
|
3367
3371
|
}), /* @__PURE__ */ f("div", {
|
|
3368
|
-
className: `table-fullscreen-body${
|
|
3372
|
+
className: `table-fullscreen-body${U ? " dragging" : ""}`,
|
|
3369
3373
|
ref: oe,
|
|
3370
3374
|
onScroll: $e,
|
|
3371
3375
|
onPointerDown: Xe,
|
|
@@ -3373,14 +3377,14 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3373
3377
|
onPointerUp: Qe,
|
|
3374
3378
|
onPointerLeave: Qe,
|
|
3375
3379
|
children: (() => {
|
|
3376
|
-
let t = e.order, n = t * 32 + 44 + 16, r = t * 32 + 26 + 34, i =
|
|
3380
|
+
let t = e.order, n = t * 32 + 44 + 16, r = t * 32 + 26 + 34, i = Z.get(e.identity.id) ?? -1, a = q.w || 960, o = q.h || 600, s = G.l / H, c = G.t / H, l = a / H, u = o / H, d = Math.max(0, Math.floor((s - 44) / 32) - 3), h = Math.min(t - 1, Math.ceil((s + l - 44) / 32) + 3), g = Math.max(0, Math.floor((c - 26) / 32) - 3), _ = Math.min(t - 1, Math.ceil((c + u - 26) / 32) + 3), v = Array.from({ length: _ - g + 1 }, (e, t) => g + t), y = Array.from({ length: h - d + 1 }, (e, t) => d + t);
|
|
3377
3381
|
return /* @__PURE__ */ p("svg", {
|
|
3378
3382
|
ref: ce,
|
|
3379
3383
|
className: "table-fullscreen-svg",
|
|
3380
3384
|
viewBox: `0 0 ${n} ${r}`,
|
|
3381
3385
|
style: {
|
|
3382
|
-
width: n *
|
|
3383
|
-
height: r *
|
|
3386
|
+
width: n * H,
|
|
3387
|
+
height: r * H
|
|
3384
3388
|
},
|
|
3385
3389
|
children: [/* @__PURE__ */ p("g", {
|
|
3386
3390
|
transform: `translate(${S ? 8 : 44}, ${S ? 8 : 26})`,
|
|
@@ -3391,7 +3395,7 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3391
3395
|
x: -6,
|
|
3392
3396
|
y: e * 32 + 32 / 2 + 4,
|
|
3393
3397
|
textAnchor: "end",
|
|
3394
|
-
fill:
|
|
3398
|
+
fill: He[e % He.length],
|
|
3395
3399
|
fontSize: 11,
|
|
3396
3400
|
fontFamily: "serif",
|
|
3397
3401
|
children: t.label
|
|
@@ -3403,7 +3407,7 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3403
3407
|
x: e * 32 + 32 / 2,
|
|
3404
3408
|
y: -6,
|
|
3405
3409
|
textAnchor: "middle",
|
|
3406
|
-
fill:
|
|
3410
|
+
fill: He[e % He.length],
|
|
3407
3411
|
fontSize: 11,
|
|
3408
3412
|
fontFamily: "serif",
|
|
3409
3413
|
children: t.label
|
|
@@ -3472,15 +3476,15 @@ function Ye({ group: e, selectedElements: t, viewBoxSize: n, canvasTransform: i,
|
|
|
3472
3476
|
}
|
|
3473
3477
|
//#endregion
|
|
3474
3478
|
//#region src/components/Canvas/ActionScene.tsx
|
|
3475
|
-
var
|
|
3476
|
-
function
|
|
3479
|
+
var Ze = 28, Qe = 26, $e = 90, et = 100, tt = 30, nt = 10, rt = tt + 10, it = 8, at = 8, ot = 18, st = 14, ct = "#ffd93d", lt = 44;
|
|
3480
|
+
function ut(e) {
|
|
3477
3481
|
return e <= 1 ? 52 : Math.max(52, Math.ceil(110 / Math.sin(Math.PI / e)));
|
|
3478
3482
|
}
|
|
3479
|
-
function
|
|
3483
|
+
function dt(e, t, n, r = 10) {
|
|
3480
3484
|
let i = n - Math.PI / 6, a = n + Math.PI / 6;
|
|
3481
3485
|
return `${e},${t} ${e - Math.cos(i) * r},${t - Math.sin(i) * r} ${e - Math.cos(a) * r},${t - Math.sin(a) * r}`;
|
|
3482
3486
|
}
|
|
3483
|
-
function
|
|
3487
|
+
function ft({ sx: e, sy: t, ex: n, ey: r, color: i, width: a = 2.2, dashed: o, dir: s = 1, opacity: c = .85, headSize: l = 12, nodeR: u = 0, offset: d = 0, tFrom: m, onClick: h, onDrop: g, highlight: _ }) {
|
|
3484
3488
|
let v = n - e, y = r - t, b = Math.sqrt(v * v + y * y) || 1, x = v / b, S = y / b, C = Math.min(l * 1.25, Math.max(12, b * .25)), w = Math.min(l, C), T = m ? m.x : -S, E = m ? m.y : x, D = e + x * u + T * d, O = t + S * u + E * d, k = n - x * (u + C) + T * d, A = r - S * (u + C) + E * d, j = (D + k) / 2, M = (O + A) / 2, N = Math.atan2(A - M, k - j), P = `M${D},${O} Q${j},${M} ${k},${A}`;
|
|
3485
3489
|
return /* @__PURE__ */ p("g", { children: [
|
|
3486
3490
|
/* @__PURE__ */ f("path", {
|
|
@@ -3493,7 +3497,7 @@ function dt({ sx: e, sy: t, ex: n, ey: r, color: i, width: a = 2.2, dashed: o, d
|
|
|
3493
3497
|
strokeLinecap: "round"
|
|
3494
3498
|
}),
|
|
3495
3499
|
/* @__PURE__ */ f("polygon", {
|
|
3496
|
-
points:
|
|
3500
|
+
points: dt(k, A, N, w),
|
|
3497
3501
|
fill: i,
|
|
3498
3502
|
stroke: i,
|
|
3499
3503
|
strokeWidth: .5,
|
|
@@ -3502,7 +3506,7 @@ function dt({ sx: e, sy: t, ex: n, ey: r, color: i, width: a = 2.2, dashed: o, d
|
|
|
3502
3506
|
_ && /* @__PURE__ */ f("path", {
|
|
3503
3507
|
d: P,
|
|
3504
3508
|
fill: "none",
|
|
3505
|
-
stroke:
|
|
3509
|
+
stroke: ct,
|
|
3506
3510
|
strokeWidth: 6.5,
|
|
3507
3511
|
strokeDasharray: o ? "8 5" : void 0,
|
|
3508
3512
|
strokeOpacity: .95,
|
|
@@ -3530,8 +3534,8 @@ function dt({ sx: e, sy: t, ex: n, ey: r, color: i, width: a = 2.2, dashed: o, d
|
|
|
3530
3534
|
})
|
|
3531
3535
|
] });
|
|
3532
3536
|
}
|
|
3533
|
-
function
|
|
3534
|
-
let m = r ? "var(--node-fill-selected)" : "var(--node-fill)", h = r ?
|
|
3537
|
+
function pt({ x: e, y: t, label: n, isSelected: r, isFixed: i, nodeR: a = Ze, onClick: o, onPointerDown: s, showNumber: c, onHoverIn: l, onHoverOut: u, testId: d }) {
|
|
3538
|
+
let m = r ? "var(--node-fill-selected)" : "var(--node-fill)", h = r ? ct : "var(--node-stroke)";
|
|
3535
3539
|
return /* @__PURE__ */ p("g", {
|
|
3536
3540
|
transform: `translate(${e}, ${t})`,
|
|
3537
3541
|
onClick: (e) => {
|
|
@@ -3554,7 +3558,7 @@ function ft({ x: e, y: t, label: n, isSelected: r, isFixed: i, nodeR: a = Xe, on
|
|
|
3554
3558
|
x: a - 2,
|
|
3555
3559
|
y: -(a + 2),
|
|
3556
3560
|
textAnchor: "middle",
|
|
3557
|
-
fill:
|
|
3561
|
+
fill: ct,
|
|
3558
3562
|
fontSize: 13,
|
|
3559
3563
|
fontWeight: "bold",
|
|
3560
3564
|
children: "★"
|
|
@@ -3592,7 +3596,7 @@ function ft({ x: e, y: t, label: n, isSelected: r, isFixed: i, nodeR: a = Xe, on
|
|
|
3592
3596
|
]
|
|
3593
3597
|
});
|
|
3594
3598
|
}
|
|
3595
|
-
function
|
|
3599
|
+
function mt({ label: e, color: t, symbol: n, isSelected: r, onClick: i, onHover: a, onPointerDown: o }) {
|
|
3596
3600
|
return /* @__PURE__ */ p("g", {
|
|
3597
3601
|
onClick: (e) => {
|
|
3598
3602
|
e.stopPropagation(), i();
|
|
@@ -3605,17 +3609,17 @@ function pt({ label: e, color: t, symbol: n, isSelected: r, onClick: i, onHover:
|
|
|
3605
3609
|
touchAction: "none"
|
|
3606
3610
|
},
|
|
3607
3611
|
children: [/* @__PURE__ */ f("rect", {
|
|
3608
|
-
width:
|
|
3609
|
-
height:
|
|
3612
|
+
width: et,
|
|
3613
|
+
height: tt,
|
|
3610
3614
|
rx: 6,
|
|
3611
3615
|
fill: r ? "var(--node-fill-selected)" : "var(--node-fill)",
|
|
3612
|
-
stroke: r ?
|
|
3616
|
+
stroke: r ? ct : t || "var(--node-stroke)",
|
|
3613
3617
|
strokeWidth: r ? 2.5 : 1.5
|
|
3614
3618
|
}), /* @__PURE__ */ f("foreignObject", {
|
|
3615
3619
|
x: 0,
|
|
3616
3620
|
y: 0,
|
|
3617
|
-
width:
|
|
3618
|
-
height:
|
|
3621
|
+
width: et,
|
|
3622
|
+
height: tt,
|
|
3619
3623
|
style: {
|
|
3620
3624
|
pointerEvents: "none",
|
|
3621
3625
|
userSelect: "none"
|
|
@@ -3637,27 +3641,27 @@ function pt({ label: e, color: t, symbol: n, isSelected: r, onClick: i, onHover:
|
|
|
3637
3641
|
})]
|
|
3638
3642
|
});
|
|
3639
3643
|
}
|
|
3640
|
-
var
|
|
3641
|
-
function
|
|
3644
|
+
var ht = "#f59e0b";
|
|
3645
|
+
function gt(e, t, n, r) {
|
|
3642
3646
|
let i = 1 - r;
|
|
3643
3647
|
return {
|
|
3644
3648
|
x: i * i * e.x + 2 * i * r * t.x + r * r * n.x,
|
|
3645
3649
|
y: i * i * e.y + 2 * i * r * t.y + r * r * n.y
|
|
3646
3650
|
};
|
|
3647
3651
|
}
|
|
3648
|
-
function
|
|
3652
|
+
function _t(e, t, n) {
|
|
3649
3653
|
let r = t.x - e.x, i = t.y - e.y, a = Math.sqrt(r * r + i * i) || 1, o = -i / a, s = r / a, c = {
|
|
3650
3654
|
x: (e.x + t.x) / 2 + o * 8,
|
|
3651
3655
|
y: (e.y + t.y) / 2 + s * 8
|
|
3652
3656
|
}, l = Infinity;
|
|
3653
3657
|
for (let r = 0; r <= 20; r++) {
|
|
3654
|
-
let i =
|
|
3658
|
+
let i = gt(e, c, t, r / 20);
|
|
3655
3659
|
l = Math.min(l, Math.hypot(i.x - n.x, i.y - n.y));
|
|
3656
3660
|
}
|
|
3657
3661
|
return l;
|
|
3658
3662
|
}
|
|
3659
|
-
function
|
|
3660
|
-
let { t: m } =
|
|
3663
|
+
function vt({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArrow: o, onBindArrow: s, onRemoveArrow: c, onReplaceGenArrows: d }) {
|
|
3664
|
+
let { t: m } = Ie(), [h, g] = u(null), [_, v] = u(null), [y, b] = u(null), [x, S] = u(null), w = l(null), T = l(!1), E = l(null), D = l(null), O = l(!1), k = l(null), A = r, j = Math.max(220, A * 22), M = t / 2, N = n / 2 + 40, P = (e) => {
|
|
3661
3665
|
let t = e / A * 2 * Math.PI - Math.PI / 2;
|
|
3662
3666
|
return {
|
|
3663
3667
|
x: M + Math.cos(t) * j,
|
|
@@ -3692,14 +3696,14 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3692
3696
|
let r = null, a = 48;
|
|
3693
3697
|
i.forEach((e, t) => {
|
|
3694
3698
|
if (e.generatorId !== null) return;
|
|
3695
|
-
let i =
|
|
3699
|
+
let i = _t(P(e.from), P(e.to), n);
|
|
3696
3700
|
i < a && (a = i, r = t);
|
|
3697
3701
|
}), k.current = r, b(r), v((e) => e && {
|
|
3698
3702
|
...e,
|
|
3699
3703
|
x: n.x,
|
|
3700
3704
|
y: n.y
|
|
3701
3705
|
});
|
|
3702
|
-
},
|
|
3706
|
+
}, ee = () => {
|
|
3703
3707
|
if (!E.current) return;
|
|
3704
3708
|
let e = k.current, t = O.current, n = E.current.symbol;
|
|
3705
3709
|
if (E.current = null, D.current = null, k.current = null, v(null), b(null), t && e !== null) {
|
|
@@ -3709,7 +3713,7 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3709
3713
|
window.setTimeout(() => {
|
|
3710
3714
|
O.current = !1;
|
|
3711
3715
|
}, 0);
|
|
3712
|
-
},
|
|
3716
|
+
}, te = (e, t) => {
|
|
3713
3717
|
if (e.button !== 0 || w.current) return;
|
|
3714
3718
|
let n = e.currentTarget.ownerSVGElement;
|
|
3715
3719
|
if (!n) return;
|
|
@@ -3721,13 +3725,13 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3721
3725
|
snap: null,
|
|
3722
3726
|
justStarted: !0,
|
|
3723
3727
|
justPicked: !1
|
|
3724
|
-
},
|
|
3728
|
+
}, S({
|
|
3725
3729
|
from: t,
|
|
3726
3730
|
x: r.x,
|
|
3727
3731
|
y: r.y,
|
|
3728
3732
|
snap: null
|
|
3729
3733
|
});
|
|
3730
|
-
},
|
|
3734
|
+
}, z = (e) => {
|
|
3731
3735
|
let t = w.current;
|
|
3732
3736
|
if (!t) return;
|
|
3733
3737
|
let n = e.currentTarget.ownerSVGElement;
|
|
@@ -3737,7 +3741,7 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3737
3741
|
let i = null;
|
|
3738
3742
|
for (let e = 0; e < A; e++) {
|
|
3739
3743
|
let t = P(e);
|
|
3740
|
-
if (Math.hypot(r.x - t.x, r.y - t.y) <
|
|
3744
|
+
if (Math.hypot(r.x - t.x, r.y - t.y) < lt) {
|
|
3741
3745
|
i = e;
|
|
3742
3746
|
break;
|
|
3743
3747
|
}
|
|
@@ -3745,19 +3749,19 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3745
3749
|
w.current = {
|
|
3746
3750
|
...t,
|
|
3747
3751
|
snap: i
|
|
3748
|
-
},
|
|
3752
|
+
}, S((e) => e && {
|
|
3749
3753
|
...e,
|
|
3750
3754
|
x: r.x,
|
|
3751
3755
|
y: r.y,
|
|
3752
3756
|
snap: i
|
|
3753
3757
|
});
|
|
3754
|
-
},
|
|
3755
|
-
o(e, t, h), w.current = null,
|
|
3756
|
-
},
|
|
3758
|
+
}, ne = (e, t) => {
|
|
3759
|
+
o(e, t, h), w.current = null, S(null);
|
|
3760
|
+
}, B = () => {
|
|
3757
3761
|
let e = w.current;
|
|
3758
3762
|
if (e) {
|
|
3759
3763
|
if (T.current) {
|
|
3760
|
-
w.current = null,
|
|
3764
|
+
w.current = null, S(null), e.snap !== null && e.snap !== e.from && o(e.from, e.snap, h);
|
|
3761
3765
|
return;
|
|
3762
3766
|
}
|
|
3763
3767
|
e.justStarted && (w.current = {
|
|
@@ -3766,12 +3770,12 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3766
3770
|
justPicked: !0
|
|
3767
3771
|
});
|
|
3768
3772
|
}
|
|
3769
|
-
}, V = e.generators.length,
|
|
3770
|
-
transform: `translate(60, ${
|
|
3773
|
+
}, V = e.generators.length, re = N - (V - 1) / 2 * rt, H = e.generators.map((e, t) => /* @__PURE__ */ f("g", {
|
|
3774
|
+
transform: `translate(60, ${re + t * rt})`,
|
|
3771
3775
|
onPointerMove: R,
|
|
3772
|
-
onPointerUp:
|
|
3773
|
-
children: /* @__PURE__ */ f(
|
|
3774
|
-
label:
|
|
3776
|
+
onPointerUp: ee,
|
|
3777
|
+
children: /* @__PURE__ */ f(mt, {
|
|
3778
|
+
label: Q(X(e.symbol)),
|
|
3775
3779
|
color: e.color,
|
|
3776
3780
|
symbol: e.symbol,
|
|
3777
3781
|
isSelected: h === e.symbol,
|
|
@@ -3780,22 +3784,22 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3780
3784
|
},
|
|
3781
3785
|
onPointerDown: L
|
|
3782
3786
|
})
|
|
3783
|
-
}, `genchip-${t}`)),
|
|
3787
|
+
}, `genchip-${t}`)), ie = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map();
|
|
3784
3788
|
i.forEach((e, t) => {
|
|
3785
3789
|
if (e.from === e.to) return;
|
|
3786
|
-
let n = `${Math.min(e.from, e.to)}|${Math.max(e.from, e.to)}`, r = e.from < e.to ? `${n}f` : `${n}b`, i =
|
|
3787
|
-
|
|
3790
|
+
let n = `${Math.min(e.from, e.to)}|${Math.max(e.from, e.to)}`, r = e.from < e.to ? `${n}f` : `${n}b`, i = ie.get(r) ?? 0;
|
|
3791
|
+
ie.set(r, i + 1), U.set(t, i);
|
|
3788
3792
|
});
|
|
3789
|
-
let
|
|
3793
|
+
let W = /* @__PURE__ */ new Map();
|
|
3790
3794
|
i.forEach((e, t) => {
|
|
3791
3795
|
if (e.from !== e.to) return;
|
|
3792
|
-
let n =
|
|
3793
|
-
n ? n.push(t) :
|
|
3796
|
+
let n = W.get(e.from);
|
|
3797
|
+
n ? n.push(t) : W.set(e.from, [t]);
|
|
3794
3798
|
});
|
|
3795
3799
|
let G = /* @__PURE__ */ new Map();
|
|
3796
|
-
|
|
3800
|
+
W.forEach((e) => e.forEach((e, t) => G.set(e, t)));
|
|
3797
3801
|
let K = i.map((e, t) => {
|
|
3798
|
-
let n = P(e.from), r = P(e.to), i = e.generatorId === null, a = e.generatorId === null ?
|
|
3802
|
+
let n = P(e.from), r = P(e.to), i = e.generatorId === null, a = e.generatorId === null ? ht : F(e.generatorId), o = () => {
|
|
3799
3803
|
O.current || (i ? h ? s(e.from, e.to, h) : c(e.from, null, e.to) : c(e.from, e.generatorId));
|
|
3800
3804
|
};
|
|
3801
3805
|
if (e.from === e.to) {
|
|
@@ -3832,8 +3836,8 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3832
3836
|
]
|
|
3833
3837
|
}, `loop-${e.generatorId ?? "u"}-${e.from}`);
|
|
3834
3838
|
}
|
|
3835
|
-
let l = 8 + (
|
|
3836
|
-
return /* @__PURE__ */ f(
|
|
3839
|
+
let l = 8 + (U.get(t) ?? 0) * 18;
|
|
3840
|
+
return /* @__PURE__ */ f(ft, {
|
|
3837
3841
|
sx: n.x,
|
|
3838
3842
|
sy: n.y,
|
|
3839
3843
|
ex: r.x,
|
|
@@ -3848,10 +3852,10 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3848
3852
|
highlight: y === t,
|
|
3849
3853
|
onClick: o
|
|
3850
3854
|
}, `${e.from}-${t}`);
|
|
3851
|
-
}), q =
|
|
3855
|
+
}), q = re + V * rt + 16, ae = C(h === null ? i.filter((e) => e.generatorId === null) : i.some((e) => e.generatorId === h) ? i.filter((e) => e.generatorId === h) : i.filter((e) => e.generatorId === null), A);
|
|
3852
3856
|
return /* @__PURE__ */ p("g", {
|
|
3853
|
-
onPointerMove:
|
|
3854
|
-
onPointerUp:
|
|
3857
|
+
onPointerMove: z,
|
|
3858
|
+
onPointerUp: B,
|
|
3855
3859
|
children: [
|
|
3856
3860
|
/* @__PURE__ */ f("rect", {
|
|
3857
3861
|
x: 0,
|
|
@@ -3860,10 +3864,10 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3860
3864
|
height: n,
|
|
3861
3865
|
fill: "transparent",
|
|
3862
3866
|
onClick: () => {
|
|
3863
|
-
w.current = null,
|
|
3867
|
+
w.current = null, S(null);
|
|
3864
3868
|
}
|
|
3865
3869
|
}),
|
|
3866
|
-
|
|
3870
|
+
H,
|
|
3867
3871
|
ae.length > 0 && /* @__PURE__ */ f("foreignObject", {
|
|
3868
3872
|
x: 0,
|
|
3869
3873
|
y: 24,
|
|
@@ -3923,19 +3927,19 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3923
3927
|
children: m("action.genSelectHint")
|
|
3924
3928
|
}),
|
|
3925
3929
|
K,
|
|
3926
|
-
x && /* @__PURE__ */ f(
|
|
3930
|
+
x && /* @__PURE__ */ f(ft, {
|
|
3927
3931
|
sx: P(x.from).x,
|
|
3928
3932
|
sy: P(x.from).y,
|
|
3929
3933
|
ex: x.snap === null ? x.x : P(x.snap).x,
|
|
3930
3934
|
ey: x.snap === null ? x.y : P(x.snap).y,
|
|
3931
|
-
color:
|
|
3935
|
+
color: ct,
|
|
3932
3936
|
width: 3,
|
|
3933
3937
|
headSize: 13,
|
|
3934
3938
|
nodeR: 20,
|
|
3935
3939
|
dashed: !0,
|
|
3936
3940
|
opacity: .9
|
|
3937
3941
|
}),
|
|
3938
|
-
Array.from({ length: A }, (e, t) => /* @__PURE__ */ f(
|
|
3942
|
+
Array.from({ length: A }, (e, t) => /* @__PURE__ */ f(pt, {
|
|
3939
3943
|
x: P(t).x,
|
|
3940
3944
|
y: P(t).y,
|
|
3941
3945
|
label: "",
|
|
@@ -3944,7 +3948,7 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3944
3948
|
isFixed: !1,
|
|
3945
3949
|
nodeR: 20,
|
|
3946
3950
|
testId: `action-edit-node-${t + 1}`,
|
|
3947
|
-
onPointerDown: (e) =>
|
|
3951
|
+
onPointerDown: (e) => te(e, t),
|
|
3948
3952
|
onClick: () => {
|
|
3949
3953
|
let e = w.current;
|
|
3950
3954
|
if (e) {
|
|
@@ -3955,7 +3959,7 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3955
3959
|
};
|
|
3956
3960
|
return;
|
|
3957
3961
|
}
|
|
3958
|
-
|
|
3962
|
+
ne(e.from, t);
|
|
3959
3963
|
}
|
|
3960
3964
|
}
|
|
3961
3965
|
}, t)),
|
|
@@ -3965,10 +3969,10 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3965
3969
|
style: { pointerEvents: "none" },
|
|
3966
3970
|
children: [
|
|
3967
3971
|
/* @__PURE__ */ f("rect", {
|
|
3968
|
-
x:
|
|
3969
|
-
y: -
|
|
3970
|
-
width:
|
|
3971
|
-
height:
|
|
3972
|
+
x: -et / 2,
|
|
3973
|
+
y: -tt / 2,
|
|
3974
|
+
width: et,
|
|
3975
|
+
height: tt,
|
|
3972
3976
|
rx: 6,
|
|
3973
3977
|
fill: F(_.symbol),
|
|
3974
3978
|
fillOpacity: .35,
|
|
@@ -3987,9 +3991,9 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
3987
3991
|
}),
|
|
3988
3992
|
/* @__PURE__ */ f("text", {
|
|
3989
3993
|
x: 0,
|
|
3990
|
-
y:
|
|
3994
|
+
y: tt / 2 + 16,
|
|
3991
3995
|
textAnchor: "middle",
|
|
3992
|
-
fill:
|
|
3996
|
+
fill: ct,
|
|
3993
3997
|
fontSize: 13,
|
|
3994
3998
|
style: { pointerEvents: "none" },
|
|
3995
3999
|
children: m("action.dropHint")
|
|
@@ -4015,24 +4019,24 @@ function _t({ group: e, vw: t, vh: n, setSize: r, arrows: i, error: a, onAddArro
|
|
|
4015
4019
|
]
|
|
4016
4020
|
});
|
|
4017
4021
|
}
|
|
4018
|
-
function
|
|
4019
|
-
let n = e.orbits.map((e) => 2 * (
|
|
4022
|
+
function yt(e, t = !0) {
|
|
4023
|
+
let n = e.orbits.map((e) => 2 * (ut(e.elements.length) + Ze + Qe)), r = n.reduce((e, t) => e + t, 0) + $e * Math.max(0, e.orbits.length - 1), i = 0;
|
|
4020
4024
|
t && e.orbits.forEach((e) => {
|
|
4021
4025
|
let t = e.elements.length;
|
|
4022
|
-
i +=
|
|
4026
|
+
i += ot + Math.ceil(t / it) * rt + 2 * at + st;
|
|
4023
4027
|
});
|
|
4024
|
-
let a = t ? i -
|
|
4028
|
+
let a = t ? i - st : 0, o = (t ? 12 : 42) + a + 30, s = Math.max(0, ...n), c = o + 60 + s + 60, l = Math.max(r + 2 * $e, 320);
|
|
4025
4029
|
return {
|
|
4026
4030
|
width: Math.ceil(l),
|
|
4027
4031
|
height: Math.ceil(c)
|
|
4028
4032
|
};
|
|
4029
4033
|
}
|
|
4030
|
-
function
|
|
4031
|
-
let { t: y } =
|
|
4034
|
+
function bt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedElementChange: i, hoveredElement: a, onHoverElementChange: o, onSetElementSelect: s, showLabels: l, onHover: u, legendHover: m, onLegendHover: h, viewBoxOverride: g, canvasTransform: _, viewBoxSize: v }) {
|
|
4035
|
+
let { t: y } = Ie(), b = g?.width ?? v.width, x = g?.height ?? v.height, { n: S, perms: C, orbits: w, orbitOf: E } = t, D = c(() => new Set(T(C, S)), [C, S]), O = n === "conjugation", k = O || n === "regular", A = !!a, j = Math.min(v.width / Math.max(b, 1), v.height / Math.max(x, 1)), M = (v.width - b * j) / 2, N = (v.height - x * j) / 2, P = (e) => ({
|
|
4032
4036
|
x: (e.x * _.scale + _.x) * j + M,
|
|
4033
4037
|
y: (e.y * _.scale + _.y) * j + N
|
|
4034
|
-
}), F =
|
|
4035
|
-
transform: `translate(${
|
|
4038
|
+
}), F = w.map((e) => 2 * (ut(e.elements.length) + Ze + Qe)), I = F.reduce((e, t) => e + t, 0) + $e * (w.length - 1), L = w.map((e) => 2 * (ut(e.elements.length) + Ze + Qe)), R = Math.max(0, ...L), ee = b - 40 - e.generators.length * 110, te = e.generators.map((e, t) => /* @__PURE__ */ p("g", {
|
|
4039
|
+
transform: `translate(${ee + t * 110}, 0)`,
|
|
4036
4040
|
onMouseEnter: () => h(e.symbol),
|
|
4037
4041
|
onMouseLeave: () => h(null),
|
|
4038
4042
|
style: { cursor: "pointer" },
|
|
@@ -4048,25 +4052,25 @@ function yt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedE
|
|
|
4048
4052
|
fontSize: 14,
|
|
4049
4053
|
children: e.symbol
|
|
4050
4054
|
})]
|
|
4051
|
-
}, `legend-${t}`)),
|
|
4052
|
-
|
|
4053
|
-
let t = e.elements.length, n = Math.min(
|
|
4054
|
-
|
|
4055
|
+
}, `legend-${t}`)), z = [], ne = [];
|
|
4056
|
+
w.forEach((e) => {
|
|
4057
|
+
let t = e.elements.length, n = Math.min(it, t);
|
|
4058
|
+
z.push(n * et + (n - 1) * nt + 2 * at), ne.push(ot + Math.ceil(t / it) * rt + 2 * at);
|
|
4055
4059
|
});
|
|
4056
|
-
let
|
|
4057
|
-
let n =
|
|
4058
|
-
return
|
|
4059
|
-
}),
|
|
4060
|
-
for (let e = 0; e <
|
|
4061
|
-
let t =
|
|
4062
|
-
|
|
4060
|
+
let B = 0, V = w.map((e, t) => {
|
|
4061
|
+
let n = B;
|
|
4062
|
+
return B += ne[t] + st, n;
|
|
4063
|
+
}), re = l ? B - st : 0, H = (l ? 12 : 42) + re + 30, ie = H + 60 + R, U = Math.max(30, (x - ie) / 2), W = [], G = Math.max(0, (b - I) / 2);
|
|
4064
|
+
for (let e = 0; e < w.length; e++) {
|
|
4065
|
+
let t = ut(w[e].elements.length);
|
|
4066
|
+
W.push({
|
|
4063
4067
|
x: G + F[e] / 2,
|
|
4064
|
-
y:
|
|
4068
|
+
y: U + H + 60 + R / 2,
|
|
4065
4069
|
r: t
|
|
4066
|
-
}), G += F[e] +
|
|
4070
|
+
}), G += F[e] + $e;
|
|
4067
4071
|
}
|
|
4068
4072
|
let K = (e) => {
|
|
4069
|
-
let t = E[e], n =
|
|
4073
|
+
let t = E[e], n = W[t], r = w[t].elements.indexOf(e) / w[t].elements.length * 2 * Math.PI - Math.PI / 2;
|
|
4070
4074
|
return {
|
|
4071
4075
|
x: n.x + Math.cos(r) * n.r,
|
|
4072
4076
|
y: n.y + Math.sin(r) * n.r
|
|
@@ -4092,11 +4096,11 @@ function yt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedE
|
|
|
4092
4096
|
}
|
|
4093
4097
|
let se = [];
|
|
4094
4098
|
for (let { key: t, rec: n } of oe) {
|
|
4095
|
-
let { x: r, y: i, gi: a } = n, o = e.generators[a], s = ae.get(t), c = s.indexOf(n), l = s.length, u = K(r), d = K(i), p = Math.sqrt((d.x - u.x) ** 2 + (d.y - u.y) ** 2) || 1, h = Math.max(10, Math.min(16, p * .06)), g = (c - (l - 1) / 2) * h, _ =
|
|
4099
|
+
let { x: r, y: i, gi: a } = n, o = e.generators[a], s = ae.get(t), c = s.indexOf(n), l = s.length, u = K(r), d = K(i), p = Math.sqrt((d.x - u.x) ** 2 + (d.y - u.y) ** 2) || 1, h = Math.max(10, Math.min(16, p * .06)), g = (c - (l - 1) / 2) * h, _ = W[E[r]], v = K(s[0].x), y = Math.atan2(v.y - _.y, v.x - _.x), b = {
|
|
4096
4100
|
x: -Math.sin(y),
|
|
4097
4101
|
y: Math.cos(y)
|
|
4098
4102
|
}, x = m !== null && m === o.symbol, S = A || m !== null && !x;
|
|
4099
|
-
se.push(/* @__PURE__ */ f(
|
|
4103
|
+
se.push(/* @__PURE__ */ f(ft, {
|
|
4100
4104
|
sx: u.x,
|
|
4101
4105
|
sy: u.y,
|
|
4102
4106
|
ex: d.x,
|
|
@@ -4104,7 +4108,7 @@ function yt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedE
|
|
|
4104
4108
|
color: S ? "var(--node-stroke)" : o.color || "var(--node-stroke)",
|
|
4105
4109
|
width: S ? 1.2 : x ? 3.4 : 3,
|
|
4106
4110
|
headSize: 18,
|
|
4107
|
-
nodeR:
|
|
4111
|
+
nodeR: Ze,
|
|
4108
4112
|
offset: g,
|
|
4109
4113
|
tFrom: b,
|
|
4110
4114
|
dashed: S,
|
|
@@ -4118,35 +4122,35 @@ function yt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedE
|
|
|
4118
4122
|
let t = K(e);
|
|
4119
4123
|
ce.push(/* @__PURE__ */ f("circle", {
|
|
4120
4124
|
cx: t.x,
|
|
4121
|
-
cy: t.y -
|
|
4125
|
+
cy: t.y - Ze - 6,
|
|
4122
4126
|
r: 5,
|
|
4123
4127
|
fill: "none",
|
|
4124
|
-
stroke:
|
|
4128
|
+
stroke: ct,
|
|
4125
4129
|
strokeWidth: 1.5
|
|
4126
4130
|
}, `loop-${e}`));
|
|
4127
4131
|
continue;
|
|
4128
4132
|
}
|
|
4129
4133
|
let n = K(e), r = K(t);
|
|
4130
|
-
ce.push(/* @__PURE__ */ f(
|
|
4134
|
+
ce.push(/* @__PURE__ */ f(ft, {
|
|
4131
4135
|
sx: n.x,
|
|
4132
4136
|
sy: n.y,
|
|
4133
4137
|
ex: r.x,
|
|
4134
4138
|
ey: r.y,
|
|
4135
|
-
color:
|
|
4139
|
+
color: ct,
|
|
4136
4140
|
width: 3,
|
|
4137
4141
|
headSize: 18,
|
|
4138
|
-
nodeR:
|
|
4142
|
+
nodeR: Ze,
|
|
4139
4143
|
opacity: .95,
|
|
4140
4144
|
dir: e < t ? 1 : -1
|
|
4141
4145
|
}, `h-${e}`));
|
|
4142
4146
|
}
|
|
4143
|
-
let
|
|
4144
|
-
return
|
|
4145
|
-
let l = (b -
|
|
4146
|
-
let l = Math.floor(c /
|
|
4147
|
+
let le = r === null ? -1 : E[r], J = [];
|
|
4148
|
+
return w.forEach((n, c) => {
|
|
4149
|
+
let l = (b - z[c]) / 2, u = U + 12 + V[c], d = n.elements.map((n, c) => {
|
|
4150
|
+
let l = Math.floor(c / it), u = c % it, d = k ? e.elements[n] : null, p = d ? Q(X(d.label)) : t.setLabels?.[n] ? Q(X(t.setLabels[n])) : String(n + 1);
|
|
4147
4151
|
return /* @__PURE__ */ f("g", {
|
|
4148
|
-
transform: `translate(${
|
|
4149
|
-
children: /* @__PURE__ */ f(
|
|
4152
|
+
transform: `translate(${at + u * (et + nt)}, ${ot + at + l * rt})`,
|
|
4153
|
+
children: /* @__PURE__ */ f(mt, {
|
|
4150
4154
|
label: p,
|
|
4151
4155
|
isSelected: d ? a === d.id : r === n,
|
|
4152
4156
|
onClick: d ? () => s?.(d.id) : () => {
|
|
@@ -4157,12 +4161,12 @@ function yt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedE
|
|
|
4157
4161
|
})
|
|
4158
4162
|
}, d ? d.id : `s-${n}`);
|
|
4159
4163
|
});
|
|
4160
|
-
|
|
4164
|
+
J.push(/* @__PURE__ */ p("g", {
|
|
4161
4165
|
transform: `translate(${l}, ${u})`,
|
|
4162
4166
|
children: [
|
|
4163
4167
|
/* @__PURE__ */ f("rect", {
|
|
4164
|
-
width:
|
|
4165
|
-
height:
|
|
4168
|
+
width: z[c],
|
|
4169
|
+
height: ne[c],
|
|
4166
4170
|
rx: 8,
|
|
4167
4171
|
fill: "var(--node-fill)",
|
|
4168
4172
|
fillOpacity: .15,
|
|
@@ -4171,8 +4175,8 @@ function yt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedE
|
|
|
4171
4175
|
strokeDasharray: "3 3"
|
|
4172
4176
|
}),
|
|
4173
4177
|
/* @__PURE__ */ f("text", {
|
|
4174
|
-
x:
|
|
4175
|
-
y:
|
|
4178
|
+
x: at + 2,
|
|
4179
|
+
y: ot - 4,
|
|
4176
4180
|
fill: "var(--text-secondary)",
|
|
4177
4181
|
fontSize: 13,
|
|
4178
4182
|
children: y("action.orbitGroup", { size: String(n.elements.length) })
|
|
@@ -4181,26 +4185,26 @@ function yt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedE
|
|
|
4181
4185
|
]
|
|
4182
4186
|
}, `grp-${c}`));
|
|
4183
4187
|
}), /* @__PURE__ */ p(d, { children: [
|
|
4184
|
-
|
|
4185
|
-
l &&
|
|
4186
|
-
|
|
4188
|
+
te,
|
|
4189
|
+
l && J,
|
|
4190
|
+
W.map((e, t) => /* @__PURE__ */ f("circle", {
|
|
4187
4191
|
cx: e.x,
|
|
4188
4192
|
cy: e.y,
|
|
4189
|
-
r: e.r +
|
|
4193
|
+
r: e.r + Ze + 14,
|
|
4190
4194
|
fill: "none",
|
|
4191
|
-
stroke:
|
|
4192
|
-
strokeWidth:
|
|
4193
|
-
strokeOpacity:
|
|
4194
|
-
strokeDasharray:
|
|
4195
|
+
stroke: le === t ? ct : "var(--node-stroke)",
|
|
4196
|
+
strokeWidth: le === t ? 3 : 1,
|
|
4197
|
+
strokeOpacity: le === t ? .9 : .25,
|
|
4198
|
+
strokeDasharray: le === t ? void 0 : "4 6"
|
|
4195
4199
|
}, `glow-${t}`)),
|
|
4196
4200
|
se,
|
|
4197
4201
|
ce,
|
|
4198
4202
|
Array.from({ length: S }, (n, a) => {
|
|
4199
4203
|
let s = K(a), c = k ? e.elements[a] : null, d = !!c && !!u;
|
|
4200
|
-
return /* @__PURE__ */ f(
|
|
4204
|
+
return /* @__PURE__ */ f(pt, {
|
|
4201
4205
|
x: s.x,
|
|
4202
4206
|
y: s.y,
|
|
4203
|
-
label: l && k ?
|
|
4207
|
+
label: l && k ? Q(X(e.elements[a].label)) : l && t.setLabels?.[a] ? Q(X(t.setLabels[a])) : "",
|
|
4204
4208
|
showNumber: k || t.setLabels ? void 0 : a + 1,
|
|
4205
4209
|
isSelected: r === a,
|
|
4206
4210
|
isFixed: D.has(a),
|
|
@@ -4216,25 +4220,25 @@ function yt({ group: e, computation: t, kind: n, selectedElement: r, onSelectedE
|
|
|
4216
4220
|
})
|
|
4217
4221
|
] });
|
|
4218
4222
|
}
|
|
4219
|
-
function
|
|
4220
|
-
return /* @__PURE__ */ f(
|
|
4223
|
+
function xt(e) {
|
|
4224
|
+
return /* @__PURE__ */ f(Y, {
|
|
4221
4225
|
theme: e.theme,
|
|
4222
|
-
children: /* @__PURE__ */ f(
|
|
4226
|
+
children: /* @__PURE__ */ f(wt, { ...e })
|
|
4223
4227
|
});
|
|
4224
4228
|
}
|
|
4225
|
-
var
|
|
4229
|
+
var St = {
|
|
4226
4230
|
x: 0,
|
|
4227
4231
|
y: 0,
|
|
4228
4232
|
scale: 1
|
|
4229
|
-
},
|
|
4233
|
+
}, Ct = {
|
|
4230
4234
|
width: 2e3,
|
|
4231
4235
|
height: 2e3
|
|
4232
4236
|
};
|
|
4233
|
-
function
|
|
4234
|
-
let { t: T } =
|
|
4237
|
+
function wt({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = null, arrows: a = [], error: o = null, onAddArrow: s, onBindArrow: c, onRemoveArrow: l, onReplaceGenArrows: m, selectedElement: h = null, onSelectedElementChange: g, hoveredElement: _ = null, onHoverElementChange: v, onSetElementSelect: y, showLabels: b = !0, onHover: x, canvasTransform: S = St, viewBoxSize: C = Ct, prime: w = null }) {
|
|
4238
|
+
let { t: T } = Ie(), [E, D] = u(null), O = t === "conjugation", k = O || t === "regular", A = _ ? e.elements.find((e) => e.id === _) ?? null : null, j = !!n && !r, M = !!x, N = M ? O ? "g·x = g·x·g⁻¹" : t === "regular" ? "g·x = g·x" : "" : O ? T("action.viewTitle.conjugation") : t === "sylow" ? T("action.viewTitle.sylow", { p: w ?? "" }) : T(t === "regular" ? "action.viewTitle.regular" : t === "coset" ? "action.viewTitle.coset" : "action.viewTitle.custom"), P = A ? T("action.hoverElEdges", { el: A.label }) : E ? T("action.hoverGenEdges", { gen: E }) : T(h === null ? "action.edgeBlurb" : "action.selHint"), F = A || E ? ct : "var(--text-secondary)", I = n && !r ? yt(n, b) : null, L = Math.max(220, (i ?? 1) * 22), R = Math.max(900, 2 * L + 520), ee = r ? {
|
|
4235
4239
|
width: 1200,
|
|
4236
4240
|
height: R
|
|
4237
|
-
} : I ?? C,
|
|
4241
|
+
} : I ?? C, te = n && h !== null ? (n.stabilizers.get(h) ?? []).map((t) => e.elements.find((e) => e.id === t)).filter((e) => !!e) : [], z = n && h !== null ? k ? Q(X(e.elements[h]?.label ?? "")) : n.setLabels?.[h] ? Q(X(n.setLabels[h])) : String(h + 1) : "", ne = !!n && !r && h !== null && te.length > 0;
|
|
4238
4242
|
return /* @__PURE__ */ p(d, { children: [
|
|
4239
4243
|
j && N !== "" && /* @__PURE__ */ p("div", {
|
|
4240
4244
|
style: {
|
|
@@ -4269,7 +4273,7 @@ function Ct({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = n
|
|
|
4269
4273
|
})]
|
|
4270
4274
|
}),
|
|
4271
4275
|
/* @__PURE__ */ p("svg", {
|
|
4272
|
-
viewBox: `0 0 ${
|
|
4276
|
+
viewBox: `0 0 ${ee.width} ${ee.height}`,
|
|
4273
4277
|
className: "view-svg",
|
|
4274
4278
|
style: { userSelect: "none" },
|
|
4275
4279
|
children: [/* @__PURE__ */ f("defs", { children: /* @__PURE__ */ f("filter", {
|
|
@@ -4287,7 +4291,7 @@ function Ct({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = n
|
|
|
4287
4291
|
})
|
|
4288
4292
|
}) }), /* @__PURE__ */ f("g", {
|
|
4289
4293
|
transform: r ? void 0 : `translate(${S.x}, ${S.y}) scale(${S.scale})`,
|
|
4290
|
-
children: r ? /* @__PURE__ */ f(
|
|
4294
|
+
children: r ? /* @__PURE__ */ f(vt, {
|
|
4291
4295
|
group: e,
|
|
4292
4296
|
vw: 1200,
|
|
4293
4297
|
vh: R,
|
|
@@ -4298,7 +4302,7 @@ function Ct({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = n
|
|
|
4298
4302
|
onBindArrow: c ?? (() => {}),
|
|
4299
4303
|
onRemoveArrow: l ?? (() => {}),
|
|
4300
4304
|
onReplaceGenArrows: m ?? (() => {})
|
|
4301
|
-
}) : n ? /* @__PURE__ */ f(
|
|
4305
|
+
}) : n ? /* @__PURE__ */ f(bt, {
|
|
4302
4306
|
group: e,
|
|
4303
4307
|
computation: n,
|
|
4304
4308
|
kind: t,
|
|
@@ -4324,7 +4328,7 @@ function Ct({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = n
|
|
|
4324
4328
|
})
|
|
4325
4329
|
})]
|
|
4326
4330
|
}),
|
|
4327
|
-
|
|
4331
|
+
ne && /* @__PURE__ */ p("div", {
|
|
4328
4332
|
style: {
|
|
4329
4333
|
position: "absolute",
|
|
4330
4334
|
bottom: 8,
|
|
@@ -4352,14 +4356,14 @@ function Ct({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = n
|
|
|
4352
4356
|
color: "var(--text-primary)"
|
|
4353
4357
|
},
|
|
4354
4358
|
children: [
|
|
4355
|
-
/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: T("action.stabilizerFor", { el:
|
|
4359
|
+
/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: T("action.stabilizerFor", { el: z }) } }),
|
|
4356
4360
|
" ",
|
|
4357
4361
|
/* @__PURE__ */ p("span", {
|
|
4358
4362
|
style: {
|
|
4359
4363
|
color: "var(--text-secondary)",
|
|
4360
4364
|
fontWeight: 400
|
|
4361
4365
|
},
|
|
4362
|
-
children: ["|G_x| = ",
|
|
4366
|
+
children: ["|G_x| = ", te.length]
|
|
4363
4367
|
})
|
|
4364
4368
|
]
|
|
4365
4369
|
}), /* @__PURE__ */ f("button", {
|
|
@@ -4386,7 +4390,7 @@ function Ct({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = n
|
|
|
4386
4390
|
maxHeight: 160,
|
|
4387
4391
|
overflowY: "auto"
|
|
4388
4392
|
},
|
|
4389
|
-
children:
|
|
4393
|
+
children: te.map((e) => /* @__PURE__ */ f("span", {
|
|
4390
4394
|
style: {
|
|
4391
4395
|
padding: "2px 8px",
|
|
4392
4396
|
borderRadius: 10,
|
|
@@ -4396,7 +4400,7 @@ function Ct({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = n
|
|
|
4396
4400
|
color: "var(--text-primary)",
|
|
4397
4401
|
whiteSpace: "nowrap"
|
|
4398
4402
|
},
|
|
4399
|
-
dangerouslySetInnerHTML: { __html:
|
|
4403
|
+
dangerouslySetInnerHTML: { __html: Q(X(e.label)) }
|
|
4400
4404
|
}, e.id))
|
|
4401
4405
|
})]
|
|
4402
4406
|
})
|
|
@@ -4404,7 +4408,7 @@ function Ct({ group: e, kind: t, computation: n, editing: r = !1, setSize: i = n
|
|
|
4404
4408
|
}
|
|
4405
4409
|
//#endregion
|
|
4406
4410
|
//#region src/components/Canvas/HomomorphismScene.tsx
|
|
4407
|
-
var
|
|
4411
|
+
var Tt = [
|
|
4408
4412
|
"#4ecdc4",
|
|
4409
4413
|
"#a78bfa",
|
|
4410
4414
|
"#ffd93d",
|
|
@@ -4420,12 +4424,12 @@ var wt = [
|
|
|
4420
4424
|
"#22c55e",
|
|
4421
4425
|
"#a855f7",
|
|
4422
4426
|
"#06b6d4"
|
|
4423
|
-
],
|
|
4424
|
-
function
|
|
4427
|
+
], Et = "#ff6b6b", Dt = "#4ecdc4";
|
|
4428
|
+
function Ot(e, t, n, r) {
|
|
4425
4429
|
let i = Math.abs(n - e) * .3;
|
|
4426
4430
|
return `M ${e} ${t} C ${e + i} ${t}, ${n - i} ${r}, ${n} ${r}`;
|
|
4427
4431
|
}
|
|
4428
|
-
function
|
|
4432
|
+
function kt(e) {
|
|
4429
4433
|
let t = [];
|
|
4430
4434
|
for (let n of e.generators) {
|
|
4431
4435
|
let r = e.elements.find((e) => e.label === n.symbol || e.label === n.name);
|
|
@@ -4437,19 +4441,19 @@ function Ot(e) {
|
|
|
4437
4441
|
}
|
|
4438
4442
|
return t;
|
|
4439
4443
|
}
|
|
4440
|
-
function
|
|
4441
|
-
return /* @__PURE__ */ f(
|
|
4444
|
+
function At(e) {
|
|
4445
|
+
return /* @__PURE__ */ f(Y, {
|
|
4442
4446
|
theme: e.theme,
|
|
4443
|
-
children: /* @__PURE__ */ f(
|
|
4447
|
+
children: /* @__PURE__ */ f(jt, { ...e })
|
|
4444
4448
|
});
|
|
4445
4449
|
}
|
|
4446
|
-
function
|
|
4447
|
-
let { t: v } =
|
|
4450
|
+
function jt({ source: e, target: t, mapping: n, result: i, name: a, theoremMode: o = !1, onTheoremModeChange: s, theoremAnimation: m, showLabels: g = !0, onHover: _ }) {
|
|
4451
|
+
let { t: v } = Ie(), b = l(null), [x, C] = u(null), [w, T] = u(null), [E, D] = u(null), O = c(() => i === void 0 ? !e || !t || n.size === 0 ? null : q(e, t, n) : i, [
|
|
4448
4452
|
e,
|
|
4449
4453
|
t,
|
|
4450
4454
|
n,
|
|
4451
4455
|
i
|
|
4452
|
-
]), k = O?.kernel || [], A = O?.image || [], j = O?.isHomomorphism ?
|
|
4456
|
+
]), k = O?.kernel || [], A = O?.image || [], j = O?.isHomomorphism ? R(e, t, O) : null, M = new Set(k), N = new Set(A), P = E || x, F = P ? n.get(P) : w, I = c(() => {
|
|
4453
4457
|
if (!F || P) return /* @__PURE__ */ new Set();
|
|
4454
4458
|
let e = /* @__PURE__ */ new Set();
|
|
4455
4459
|
return n.forEach((t, n) => {
|
|
@@ -4459,20 +4463,20 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4459
4463
|
F,
|
|
4460
4464
|
P,
|
|
4461
4465
|
n
|
|
4462
|
-
]),
|
|
4466
|
+
]), L = r((e) => {
|
|
4463
4467
|
D((t) => t === e ? null : e);
|
|
4464
|
-
}, []),
|
|
4468
|
+
}, []), ee = c(() => {
|
|
4465
4469
|
if (!e) return [];
|
|
4466
|
-
let t =
|
|
4467
|
-
return t.length === 0 ? [] :
|
|
4470
|
+
let t = kt(e);
|
|
4471
|
+
return t.length === 0 ? [] : S(e, t.map((e, t) => ({
|
|
4468
4472
|
elementId: e.id,
|
|
4469
4473
|
enabled: !0,
|
|
4470
4474
|
color: h[t % h.length]
|
|
4471
4475
|
})), "right");
|
|
4472
|
-
}, [e]),
|
|
4476
|
+
}, [e]), te = c(() => {
|
|
4473
4477
|
if (!t) return [];
|
|
4474
|
-
let e =
|
|
4475
|
-
return e.length === 0 ? [] :
|
|
4478
|
+
let e = kt(t);
|
|
4479
|
+
return e.length === 0 ? [] : S(t, e.map((e, t) => ({
|
|
4476
4480
|
elementId: e.id,
|
|
4477
4481
|
enabled: !0,
|
|
4478
4482
|
color: h[t % h.length]
|
|
@@ -4520,8 +4524,8 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4520
4524
|
children: m
|
|
4521
4525
|
})]
|
|
4522
4526
|
});
|
|
4523
|
-
let
|
|
4524
|
-
function
|
|
4527
|
+
let z = Math.min(140, Math.max(65, e.order * 4.5)), ne = Math.min(140, Math.max(65, t.order * 4.5)), B = y(e, 170, 240, z), V = y(t, 630, 240, ne);
|
|
4528
|
+
function re(e, t, n, r, i, a = 1.5, o = .5, s = !1, c = !1, l = 0) {
|
|
4525
4529
|
let u = e.get(t), d = e.get(n);
|
|
4526
4530
|
if (!u || !d || s) return null;
|
|
4527
4531
|
let p = d.x - u.x, m = d.y - u.y, h = Math.sqrt(p * p + m * m);
|
|
@@ -4544,7 +4548,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4544
4548
|
opacity: o
|
|
4545
4549
|
}, i);
|
|
4546
4550
|
}
|
|
4547
|
-
function
|
|
4551
|
+
function H(e) {
|
|
4548
4552
|
let t = /* @__PURE__ */ new Map();
|
|
4549
4553
|
e.forEach((e, n) => {
|
|
4550
4554
|
let r = [e.fromId, e.toId].sort(), i = `${r[0]}|${r[1]}`, a = t.get(i);
|
|
@@ -4559,16 +4563,16 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4559
4563
|
});
|
|
4560
4564
|
}), n;
|
|
4561
4565
|
}
|
|
4562
|
-
let
|
|
4566
|
+
let ie = [];
|
|
4563
4567
|
return n.forEach((e, n) => {
|
|
4564
|
-
let r =
|
|
4568
|
+
let r = B.get(n), i = V.get(e);
|
|
4565
4569
|
if (!r || !i) return;
|
|
4566
|
-
let a = M.has(n), o = t.elements.findIndex((t) => t.id === e), s = a ?
|
|
4567
|
-
|
|
4570
|
+
let a = M.has(n), o = t.elements.findIndex((t) => t.id === e), s = a ? Et : Tt[o >= 0 ? o % Tt.length : 0], c = P === n || F === e;
|
|
4571
|
+
ie.push({
|
|
4568
4572
|
srcId: n,
|
|
4569
4573
|
tgtId: e,
|
|
4570
4574
|
color: s,
|
|
4571
|
-
pathD:
|
|
4575
|
+
pathD: Ot(r.x, r.y, i.x, i.y),
|
|
4572
4576
|
isKernel: a,
|
|
4573
4577
|
isHighlighted: !!c
|
|
4574
4578
|
});
|
|
@@ -4603,7 +4607,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4603
4607
|
color: "var(--text-primary)",
|
|
4604
4608
|
lineHeight: "28px"
|
|
4605
4609
|
},
|
|
4606
|
-
dangerouslySetInnerHTML: { __html:
|
|
4610
|
+
dangerouslySetInnerHTML: { __html: Q(X(a || `${e.symbol} → ${t.symbol}`)) }
|
|
4607
4611
|
})
|
|
4608
4612
|
}),
|
|
4609
4613
|
/* @__PURE__ */ f("foreignObject", {
|
|
@@ -4619,7 +4623,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4619
4623
|
color: "var(--text-primary)",
|
|
4620
4624
|
lineHeight: "22px"
|
|
4621
4625
|
},
|
|
4622
|
-
dangerouslySetInnerHTML: { __html: `${
|
|
4626
|
+
dangerouslySetInnerHTML: { __html: `${Q(X(e.symbol))} <span style="color:var(--text-muted);font-weight:400">(|G|=${e.order})</span>` }
|
|
4623
4627
|
})
|
|
4624
4628
|
}),
|
|
4625
4629
|
/* @__PURE__ */ f("foreignObject", {
|
|
@@ -4635,25 +4639,25 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4635
4639
|
color: "var(--text-primary)",
|
|
4636
4640
|
lineHeight: "22px"
|
|
4637
4641
|
},
|
|
4638
|
-
dangerouslySetInnerHTML: { __html: `${
|
|
4642
|
+
dangerouslySetInnerHTML: { __html: `${Q(X(t.symbol))} <span style="color:var(--text-muted);font-weight:400">(|H|=${t.order})</span>` }
|
|
4639
4643
|
})
|
|
4640
4644
|
}),
|
|
4641
4645
|
(() => {
|
|
4642
|
-
let e =
|
|
4643
|
-
return
|
|
4646
|
+
let e = H(ee);
|
|
4647
|
+
return ee.map((t, n) => re(B, t.fromId, t.toId, t.color, `gce-${n}`, 1.8, .7, t.isSelfLoop, t.isBidirectional, e[n]));
|
|
4644
4648
|
})(),
|
|
4645
4649
|
(() => {
|
|
4646
|
-
let e =
|
|
4647
|
-
return
|
|
4650
|
+
let e = H(te);
|
|
4651
|
+
return te.map((t, n) => re(V, t.fromId, t.toId, t.color, `hce-${n}`, 1.4, .65, t.isSelfLoop, t.isBidirectional, e[n]));
|
|
4648
4652
|
})(),
|
|
4649
|
-
|
|
4653
|
+
ie.filter((e) => !e.isHighlighted).map((e, t) => /* @__PURE__ */ f("path", {
|
|
4650
4654
|
d: e.pathD,
|
|
4651
4655
|
stroke: e.color,
|
|
4652
4656
|
strokeWidth: e.isKernel ? 2 : 1,
|
|
4653
4657
|
strokeOpacity: e.isKernel ? .45 : .28,
|
|
4654
4658
|
fill: "none"
|
|
4655
4659
|
}, `nl-${t}`)),
|
|
4656
|
-
|
|
4660
|
+
ie.filter((e) => e.isHighlighted).map((e, t) => /* @__PURE__ */ f("path", {
|
|
4657
4661
|
d: e.pathD,
|
|
4658
4662
|
stroke: e.color,
|
|
4659
4663
|
strokeWidth: 2.5,
|
|
@@ -4662,13 +4666,13 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4662
4666
|
style: { filter: "drop-shadow(0 0 4px currentColor)" }
|
|
4663
4667
|
}, `hl-${t}`)),
|
|
4664
4668
|
e.elements.map((e) => {
|
|
4665
|
-
let r =
|
|
4669
|
+
let r = B.get(e.id);
|
|
4666
4670
|
if (!r) return null;
|
|
4667
4671
|
let i = M.has(e.id), a = n.has(e.id), o = P === e.id || I.has(e.id), s = E === e.id, c = P && !o, l = "var(--node-fill)";
|
|
4668
|
-
if (i) l =
|
|
4672
|
+
if (i) l = Et;
|
|
4669
4673
|
else if (a) {
|
|
4670
4674
|
let r = n.get(e.id), i = t.elements.findIndex((e) => e.id === r);
|
|
4671
|
-
i >= 0 && (l =
|
|
4675
|
+
i >= 0 && (l = Tt[i % Tt.length]);
|
|
4672
4676
|
}
|
|
4673
4677
|
return /* @__PURE__ */ p("g", {
|
|
4674
4678
|
"data-homo-source-node": !0,
|
|
@@ -4683,7 +4687,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4683
4687
|
onMouseLeave: () => {
|
|
4684
4688
|
C(null), _?.(null, null);
|
|
4685
4689
|
},
|
|
4686
|
-
onClick: () =>
|
|
4690
|
+
onClick: () => L(e.id),
|
|
4687
4691
|
style: { cursor: "pointer" },
|
|
4688
4692
|
children: [
|
|
4689
4693
|
o && /* @__PURE__ */ f("circle", {
|
|
@@ -4691,7 +4695,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4691
4695
|
cy: r.y,
|
|
4692
4696
|
r: 18,
|
|
4693
4697
|
fill: "none",
|
|
4694
|
-
stroke: i ?
|
|
4698
|
+
stroke: i ? Et : "var(--accent-teal)",
|
|
4695
4699
|
strokeWidth: 2,
|
|
4696
4700
|
opacity: .6,
|
|
4697
4701
|
style: { filter: "drop-shadow(0 0 6px currentColor)" }
|
|
@@ -4701,7 +4705,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4701
4705
|
cy: r.y,
|
|
4702
4706
|
r: a ? 13 : 8,
|
|
4703
4707
|
fill: l,
|
|
4704
|
-
stroke: i ?
|
|
4708
|
+
stroke: i ? Et : "var(--border-color)",
|
|
4705
4709
|
strokeWidth: i ? 2 : 1,
|
|
4706
4710
|
opacity: c ? .3 : 1
|
|
4707
4711
|
}),
|
|
@@ -4724,11 +4728,11 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4724
4728
|
style: {
|
|
4725
4729
|
fontSize: "8px",
|
|
4726
4730
|
textAlign: "center",
|
|
4727
|
-
color: i ?
|
|
4731
|
+
color: i ? Et : c ? "var(--text-muted)" : "var(--text-primary)",
|
|
4728
4732
|
fontWeight: i || o ? 700 : 400,
|
|
4729
4733
|
pointerEvents: "none"
|
|
4730
4734
|
},
|
|
4731
|
-
dangerouslySetInnerHTML: { __html:
|
|
4735
|
+
dangerouslySetInnerHTML: { __html: Q(e.label) }
|
|
4732
4736
|
})
|
|
4733
4737
|
})
|
|
4734
4738
|
]
|
|
@@ -4758,7 +4762,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4758
4762
|
cy: t.y,
|
|
4759
4763
|
r: 18,
|
|
4760
4764
|
fill: "none",
|
|
4761
|
-
stroke:
|
|
4765
|
+
stroke: Dt,
|
|
4762
4766
|
strokeWidth: 2,
|
|
4763
4767
|
opacity: .6,
|
|
4764
4768
|
style: { filter: "drop-shadow(0 0 8px currentColor)" }
|
|
@@ -4767,8 +4771,8 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4767
4771
|
cx: t.x,
|
|
4768
4772
|
cy: t.y,
|
|
4769
4773
|
r: n ? 13 : 8,
|
|
4770
|
-
fill: n ?
|
|
4771
|
-
stroke: n ?
|
|
4774
|
+
fill: n ? Dt : "var(--node-fill)",
|
|
4775
|
+
stroke: n ? Dt : "var(--border-color)",
|
|
4772
4776
|
strokeWidth: n ? 2 : 1,
|
|
4773
4777
|
opacity: i ? .3 : 1
|
|
4774
4778
|
}),
|
|
@@ -4790,11 +4794,11 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4790
4794
|
style: {
|
|
4791
4795
|
fontSize: "8px",
|
|
4792
4796
|
textAlign: "center",
|
|
4793
|
-
color: n ?
|
|
4797
|
+
color: n ? Dt : i ? "var(--text-muted)" : "var(--text-primary)",
|
|
4794
4798
|
fontWeight: n || r ? 700 : 400,
|
|
4795
4799
|
pointerEvents: "none"
|
|
4796
4800
|
},
|
|
4797
|
-
dangerouslySetInnerHTML: { __html:
|
|
4801
|
+
dangerouslySetInnerHTML: { __html: Q(e.label) }
|
|
4798
4802
|
})
|
|
4799
4803
|
})
|
|
4800
4804
|
]
|
|
@@ -4817,7 +4821,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4817
4821
|
y: 0,
|
|
4818
4822
|
textAnchor: "middle",
|
|
4819
4823
|
fontSize: "9",
|
|
4820
|
-
fill: j.isInjective ? "var(--accent-teal)" :
|
|
4824
|
+
fill: j.isInjective ? "var(--accent-teal)" : Et,
|
|
4821
4825
|
children: j.isInjective ? v("homo.injective") : v("homo.notInjective")
|
|
4822
4826
|
}),
|
|
4823
4827
|
/* @__PURE__ */ f("rect", {
|
|
@@ -4866,7 +4870,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4866
4870
|
y: 0,
|
|
4867
4871
|
textAnchor: "middle",
|
|
4868
4872
|
fontSize: "9",
|
|
4869
|
-
fill: j.isSurjective ? "var(--accent-teal)" :
|
|
4873
|
+
fill: j.isSurjective ? "var(--accent-teal)" : Et,
|
|
4870
4874
|
children: j.isSurjective ? v("homo.surjective") : v("homo.notSurjective")
|
|
4871
4875
|
}),
|
|
4872
4876
|
j.isIsomorphism && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("rect", {
|
|
@@ -4893,7 +4897,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4893
4897
|
y: 0,
|
|
4894
4898
|
textAnchor: "middle",
|
|
4895
4899
|
fontSize: "10",
|
|
4896
|
-
fill:
|
|
4900
|
+
fill: Et,
|
|
4897
4901
|
fontWeight: "bold",
|
|
4898
4902
|
children: ["✗ ", v("homo.invalid")]
|
|
4899
4903
|
}),
|
|
@@ -4913,7 +4917,7 @@ function At({ source: e, target: t, mapping: n, result: i, name: a, theoremMode:
|
|
|
4913
4917
|
}
|
|
4914
4918
|
//#endregion
|
|
4915
4919
|
//#region src/components/Canvas/SymmetryViewScene.tsx
|
|
4916
|
-
function
|
|
4920
|
+
function Mt(e, t) {
|
|
4917
4921
|
let n = [], r = [];
|
|
4918
4922
|
for (let i = 0; i < e; i++) {
|
|
4919
4923
|
let a = 2 * Math.PI * i / e - Math.PI / 2;
|
|
@@ -4925,7 +4929,7 @@ function jt(e, t) {
|
|
|
4925
4929
|
directed: !0
|
|
4926
4930
|
};
|
|
4927
4931
|
}
|
|
4928
|
-
function
|
|
4932
|
+
function Nt(e, t) {
|
|
4929
4933
|
let n = [], r = [];
|
|
4930
4934
|
for (let i = 0; i < e; i++) {
|
|
4931
4935
|
let a = 2 * Math.PI * i / e - Math.PI / 2;
|
|
@@ -4936,7 +4940,7 @@ function Mt(e, t) {
|
|
|
4936
4940
|
edges: r
|
|
4937
4941
|
};
|
|
4938
4942
|
}
|
|
4939
|
-
function
|
|
4943
|
+
function Pt(e) {
|
|
4940
4944
|
let t = e / Math.sqrt(3), n = [
|
|
4941
4945
|
new J.Vector3(1, 1, 1).multiplyScalar(t),
|
|
4942
4946
|
new J.Vector3(1, -1, -1).multiplyScalar(t),
|
|
@@ -4949,7 +4953,7 @@ function Nt(e) {
|
|
|
4949
4953
|
edges: r
|
|
4950
4954
|
};
|
|
4951
4955
|
}
|
|
4952
|
-
function
|
|
4956
|
+
function Ft(e) {
|
|
4953
4957
|
let t = e / Math.sqrt(3), n = [-1, 1], r = [];
|
|
4954
4958
|
for (let e of n) for (let i of n) for (let a of n) r.push(new J.Vector3(e * t, i * t, a * t));
|
|
4955
4959
|
let i = [];
|
|
@@ -4963,7 +4967,7 @@ function Pt(e) {
|
|
|
4963
4967
|
edges: i
|
|
4964
4968
|
};
|
|
4965
4969
|
}
|
|
4966
|
-
function
|
|
4970
|
+
function It(e) {
|
|
4967
4971
|
let t = (1 + Math.sqrt(5)) / 2, n = [
|
|
4968
4972
|
[
|
|
4969
4973
|
0,
|
|
@@ -5032,11 +5036,8 @@ function Ft(e) {
|
|
|
5032
5036
|
edges: a
|
|
5033
5037
|
};
|
|
5034
5038
|
}
|
|
5035
|
-
var
|
|
5036
|
-
function Rt(e
|
|
5037
|
-
return `${t}:${e.vertices.map((e) => `${e.x.toFixed(4)},${e.y.toFixed(4)},${e.z.toFixed(4)}`).join("|")}:${e.edges.map((e) => e.join("-")).join("|")}`;
|
|
5038
|
-
}
|
|
5039
|
-
function zt(e) {
|
|
5039
|
+
var Lt = /* @__PURE__ */ new Map();
|
|
5040
|
+
function Rt(e) {
|
|
5040
5041
|
let t = e * 1, n = e * .55;
|
|
5041
5042
|
return {
|
|
5042
5043
|
vertices: [
|
|
@@ -5053,7 +5054,7 @@ function zt(e) {
|
|
|
5053
5054
|
]
|
|
5054
5055
|
};
|
|
5055
5056
|
}
|
|
5056
|
-
function
|
|
5057
|
+
function zt(e) {
|
|
5057
5058
|
let t = [
|
|
5058
5059
|
new J.Vector3(e, 0, 0),
|
|
5059
5060
|
new J.Vector3(-e, 0, 0),
|
|
@@ -5068,7 +5069,7 @@ function Bt(e) {
|
|
|
5068
5069
|
edges: n
|
|
5069
5070
|
};
|
|
5070
5071
|
}
|
|
5071
|
-
function
|
|
5072
|
+
function Bt(e) {
|
|
5072
5073
|
let t = (1 + Math.sqrt(5)) / 2, n = 1 / t, r = t, i = [];
|
|
5073
5074
|
for (let e of [-1, 1]) for (let t of [-1, 1]) for (let n of [-1, 1]) i.push([
|
|
5074
5075
|
e * 1,
|
|
@@ -5097,11 +5098,11 @@ function Vt(e) {
|
|
|
5097
5098
|
edges: l
|
|
5098
5099
|
};
|
|
5099
5100
|
}
|
|
5100
|
-
function
|
|
5101
|
+
function Vt(e, t) {
|
|
5101
5102
|
return `hsl(${e / t * 360}, 70%, 60%)`;
|
|
5102
5103
|
}
|
|
5103
|
-
function
|
|
5104
|
-
let t = `${e.vertices.length}:${e.edges.map((e) => e.join("-")).join("|")}`, n =
|
|
5104
|
+
function Ht(e) {
|
|
5105
|
+
let t = `${e.vertices.length}:${e.edges.map((e) => e.join("-")).join("|")}`, n = Lt.get(t);
|
|
5105
5106
|
if (n) return n;
|
|
5106
5107
|
let r = /* @__PURE__ */ new Map();
|
|
5107
5108
|
for (let t = 0; t < e.vertices.length; t++) r.set(t, []);
|
|
@@ -5131,9 +5132,9 @@ function Ut(e) {
|
|
|
5131
5132
|
}
|
|
5132
5133
|
}
|
|
5133
5134
|
}
|
|
5134
|
-
return
|
|
5135
|
+
return Lt.set(t, a), a;
|
|
5135
5136
|
}
|
|
5136
|
-
function
|
|
5137
|
+
function Ut(e) {
|
|
5137
5138
|
let t = e.vertices[0].length() / Math.sqrt(3);
|
|
5138
5139
|
return [
|
|
5139
5140
|
new J.Vector3(t, 0, 0),
|
|
@@ -5144,13 +5145,13 @@ function Wt(e) {
|
|
|
5144
5145
|
new J.Vector3(0, 0, -t)
|
|
5145
5146
|
];
|
|
5146
5147
|
}
|
|
5147
|
-
function
|
|
5148
|
+
function Wt(e, t) {
|
|
5148
5149
|
let n = [];
|
|
5149
5150
|
if (t.length > 0 && e.vertices.length <= 12) {
|
|
5150
5151
|
for (let [r, i, a] of t) n.push(e.vertices[r].clone().add(e.vertices[i]).add(e.vertices[a]).multiplyScalar(1 / 3));
|
|
5151
5152
|
return n;
|
|
5152
5153
|
}
|
|
5153
|
-
if (e.vertices.length === 8) return
|
|
5154
|
+
if (e.vertices.length === 8) return Ut(e);
|
|
5154
5155
|
if (e.vertices.length >= 20) {
|
|
5155
5156
|
let t = /* @__PURE__ */ new Map();
|
|
5156
5157
|
for (let n = 0; n < e.vertices.length; n++) t.set(n, /* @__PURE__ */ new Set());
|
|
@@ -5185,207 +5186,29 @@ function Gt(e, t) {
|
|
|
5185
5186
|
}
|
|
5186
5187
|
return [];
|
|
5187
5188
|
}
|
|
5188
|
-
function
|
|
5189
|
-
|
|
5190
|
-
if (r) return r;
|
|
5191
|
-
let i = {
|
|
5192
|
-
vertexAxes: [],
|
|
5193
|
-
faceAxes: [],
|
|
5194
|
-
edgeAxes: []
|
|
5195
|
-
}, a = /* @__PURE__ */ new Set();
|
|
5196
|
-
function o(e, t) {
|
|
5197
|
-
let n = [
|
|
5198
|
-
Math.round(e.x * 1e6) / 1e6,
|
|
5199
|
-
Math.round(e.y * 1e6) / 1e6,
|
|
5200
|
-
Math.round(e.z * 1e6) / 1e6
|
|
5201
|
-
], r = n.join(","), i = n.map((e) => -e).join(",");
|
|
5202
|
-
a.has(r) || a.has(i) || (a.add(r), t.push([
|
|
5203
|
-
e.x,
|
|
5204
|
-
e.y,
|
|
5205
|
-
e.z
|
|
5206
|
-
]));
|
|
5207
|
-
}
|
|
5208
|
-
if (t === "tetrahedron") {
|
|
5209
|
-
for (let t of e.vertices) o(t.clone().normalize(), i.vertexAxes);
|
|
5210
|
-
i.edgeAxes = [
|
|
5211
|
-
[
|
|
5212
|
-
1,
|
|
5213
|
-
0,
|
|
5214
|
-
0
|
|
5215
|
-
],
|
|
5216
|
-
[
|
|
5217
|
-
0,
|
|
5218
|
-
1,
|
|
5219
|
-
0
|
|
5220
|
-
],
|
|
5221
|
-
[
|
|
5222
|
-
0,
|
|
5223
|
-
0,
|
|
5224
|
-
1
|
|
5225
|
-
]
|
|
5226
|
-
];
|
|
5227
|
-
} else if (t === "cube") i.faceAxes = [
|
|
5228
|
-
[
|
|
5229
|
-
1,
|
|
5230
|
-
0,
|
|
5231
|
-
0
|
|
5232
|
-
],
|
|
5233
|
-
[
|
|
5234
|
-
0,
|
|
5235
|
-
1,
|
|
5236
|
-
0
|
|
5237
|
-
],
|
|
5238
|
-
[
|
|
5239
|
-
0,
|
|
5240
|
-
0,
|
|
5241
|
-
1
|
|
5242
|
-
]
|
|
5243
|
-
], i.vertexAxes = [
|
|
5244
|
-
[
|
|
5245
|
-
1,
|
|
5246
|
-
1,
|
|
5247
|
-
1
|
|
5248
|
-
],
|
|
5249
|
-
[
|
|
5250
|
-
1,
|
|
5251
|
-
-1,
|
|
5252
|
-
-1
|
|
5253
|
-
],
|
|
5254
|
-
[
|
|
5255
|
-
-1,
|
|
5256
|
-
1,
|
|
5257
|
-
-1
|
|
5258
|
-
],
|
|
5259
|
-
[
|
|
5260
|
-
-1,
|
|
5261
|
-
-1,
|
|
5262
|
-
1
|
|
5263
|
-
]
|
|
5264
|
-
].map((e) => [
|
|
5265
|
-
e[0] / Math.sqrt(3),
|
|
5266
|
-
e[1] / Math.sqrt(3),
|
|
5267
|
-
e[2] / Math.sqrt(3)
|
|
5268
|
-
]), i.edgeAxes = [
|
|
5269
|
-
[
|
|
5270
|
-
1,
|
|
5271
|
-
1,
|
|
5272
|
-
0
|
|
5273
|
-
],
|
|
5274
|
-
[
|
|
5275
|
-
1,
|
|
5276
|
-
0,
|
|
5277
|
-
1
|
|
5278
|
-
],
|
|
5279
|
-
[
|
|
5280
|
-
0,
|
|
5281
|
-
1,
|
|
5282
|
-
1
|
|
5283
|
-
],
|
|
5284
|
-
[
|
|
5285
|
-
1,
|
|
5286
|
-
-1,
|
|
5287
|
-
0
|
|
5288
|
-
],
|
|
5289
|
-
[
|
|
5290
|
-
1,
|
|
5291
|
-
0,
|
|
5292
|
-
-1
|
|
5293
|
-
],
|
|
5294
|
-
[
|
|
5295
|
-
0,
|
|
5296
|
-
1,
|
|
5297
|
-
-1
|
|
5298
|
-
]
|
|
5299
|
-
].map((e) => [
|
|
5300
|
-
e[0] / Math.sqrt(2),
|
|
5301
|
-
e[1] / Math.sqrt(2),
|
|
5302
|
-
e[2] / Math.sqrt(2)
|
|
5303
|
-
]);
|
|
5304
|
-
else if (t === "icosahedron") {
|
|
5305
|
-
let t = e.vertices.length >= 20;
|
|
5306
|
-
for (let t of e.vertices) o(t.clone().normalize(), i.vertexAxes);
|
|
5307
|
-
let n = Gt(e, Ut(e));
|
|
5308
|
-
for (let e of n) o(e.clone().normalize(), i.faceAxes);
|
|
5309
|
-
for (let [t, n] of e.edges) o(e.vertices[t].clone().add(e.vertices[n]).multiplyScalar(.5).clone().normalize(), i.edgeAxes);
|
|
5310
|
-
if (t) {
|
|
5311
|
-
let e = i.vertexAxes;
|
|
5312
|
-
i.vertexAxes = i.faceAxes, i.faceAxes = e;
|
|
5313
|
-
}
|
|
5314
|
-
}
|
|
5315
|
-
return Lt.set(n, i), i;
|
|
5316
|
-
}
|
|
5317
|
-
function qt(e, t) {
|
|
5318
|
-
if (t === "1") return "identity";
|
|
5319
|
-
if (e.startsWith("C")) return "face";
|
|
5320
|
-
if (e.startsWith("D")) return t === "1-1" || t === "1" ? null : "vertex";
|
|
5321
|
-
if (e === "S_{4}") {
|
|
5322
|
-
if (t === "4" || t === "2-2") return "face";
|
|
5323
|
-
if (t === "3") return "vertex";
|
|
5324
|
-
if (t === "2") return "edge";
|
|
5325
|
-
}
|
|
5326
|
-
if (e === "A_{4}") {
|
|
5327
|
-
if (t === "3") return "vertex";
|
|
5328
|
-
if (t === "2-2") return "edge";
|
|
5329
|
-
}
|
|
5330
|
-
if (e === "A_{5}") {
|
|
5331
|
-
if (t === "5") return "vertex";
|
|
5332
|
-
if (t === "3") return "face";
|
|
5333
|
-
if (t === "2-2") return "edge";
|
|
5334
|
-
}
|
|
5335
|
-
return null;
|
|
5336
|
-
}
|
|
5337
|
-
function Jt(e, t, n, r) {
|
|
5338
|
-
let i = C(e, t);
|
|
5339
|
-
if (!i) return null;
|
|
5340
|
-
if (i.angleRad === 0) return i;
|
|
5341
|
-
let a = t.value, o = (() => {
|
|
5342
|
-
let e = a.length;
|
|
5343
|
-
if (e < 2) return "1";
|
|
5344
|
-
let t = Array(e).fill(!1), n = [], r = a.map((e) => e - 1);
|
|
5345
|
-
for (let i = 0; i < e; i++) {
|
|
5346
|
-
if (t[i]) continue;
|
|
5347
|
-
let e = 0, a = i;
|
|
5348
|
-
for (; !t[a];) t[a] = !0, a = r[a], e++;
|
|
5349
|
-
e > 1 && n.push(e);
|
|
5350
|
-
}
|
|
5351
|
-
return n.sort().join("-") || "1";
|
|
5352
|
-
})(), s = qt(e.symbol, o);
|
|
5353
|
-
if (!s || s === "identity") return i;
|
|
5354
|
-
let c = Kt(n, r), l = t.id, u;
|
|
5355
|
-
if (u = s === "vertex" ? c.vertexAxes : s === "face" ? c.faceAxes : c.edgeAxes, u.length === 0) return i;
|
|
5356
|
-
let d = 0;
|
|
5357
|
-
for (let e = 0; e < l.length; e++) d = (d << 5) - d + l.charCodeAt(e) | 0;
|
|
5358
|
-
let f = Math.abs(d) % u.length, p = u[f];
|
|
5359
|
-
return {
|
|
5360
|
-
axis: [
|
|
5361
|
-
p[0],
|
|
5362
|
-
p[1],
|
|
5363
|
-
p[2]
|
|
5364
|
-
],
|
|
5365
|
-
angleRad: i.angleRad,
|
|
5366
|
-
label: i.label
|
|
5367
|
-
};
|
|
5189
|
+
function Gt(e, t) {
|
|
5190
|
+
return w(e, t);
|
|
5368
5191
|
}
|
|
5369
|
-
function
|
|
5370
|
-
let v = t ??
|
|
5192
|
+
function Kt({ group: e, symmetryType: t, dark: n = !1, variant: r = !1, showAction: i = !1, actionElementId: a = null, rotateSpeed: o = 1, showFigureTitle: s = !0, locked: l = !1, onHint: u, hintOnIdle: d = !0, replaySignal: m = 0, theme: h, lockCameraOnAction: g = !1, onAnimationEnd: _ }) {
|
|
5193
|
+
let v = t ?? te(e), y = h ? h === "dark" : n, b = c(() => {
|
|
5371
5194
|
switch (v) {
|
|
5372
|
-
case "cyclic": return
|
|
5195
|
+
case "cyclic": return Mt(e.order, 4);
|
|
5373
5196
|
case "dihedral": {
|
|
5374
5197
|
let t = e.order / 2;
|
|
5375
|
-
return
|
|
5198
|
+
return Nt(Math.round(t), 4);
|
|
5376
5199
|
}
|
|
5377
|
-
case "tetrahedron": return
|
|
5378
|
-
case "cube": return r ?
|
|
5379
|
-
case "icosahedron": return r ?
|
|
5380
|
-
case "rectangle": return
|
|
5381
|
-
default: return
|
|
5200
|
+
case "tetrahedron": return Pt(4);
|
|
5201
|
+
case "cube": return r ? zt(4) : Ft(4);
|
|
5202
|
+
case "icosahedron": return r ? Bt(4) : It(4);
|
|
5203
|
+
case "rectangle": return Rt(4);
|
|
5204
|
+
default: return Mt(1, 4);
|
|
5382
5205
|
}
|
|
5383
5206
|
}, [
|
|
5384
5207
|
e,
|
|
5385
5208
|
v,
|
|
5386
5209
|
r
|
|
5387
5210
|
]);
|
|
5388
|
-
if (v === "unsupported") return /* @__PURE__ */ f(
|
|
5211
|
+
if (v === "unsupported") return /* @__PURE__ */ f(Zt, { group: e });
|
|
5389
5212
|
let x = y ? "#0a0a1a" : "#f4f4f7";
|
|
5390
5213
|
return /* @__PURE__ */ f("div", {
|
|
5391
5214
|
style: {
|
|
@@ -5393,7 +5216,7 @@ function Yt({ group: e, symmetryType: t, dark: n = !1, variant: r = !1, showActi
|
|
|
5393
5216
|
height: "100%",
|
|
5394
5217
|
background: x
|
|
5395
5218
|
},
|
|
5396
|
-
children: /* @__PURE__ */ p(
|
|
5219
|
+
children: /* @__PURE__ */ p(ae, {
|
|
5397
5220
|
camera: {
|
|
5398
5221
|
position: [
|
|
5399
5222
|
0,
|
|
@@ -5412,7 +5235,7 @@ function Yt({ group: e, symmetryType: t, dark: n = !1, variant: r = !1, showActi
|
|
|
5412
5235
|
children: [/* @__PURE__ */ f("color", {
|
|
5413
5236
|
attach: "background",
|
|
5414
5237
|
args: [x]
|
|
5415
|
-
}), /* @__PURE__ */ f(
|
|
5238
|
+
}), /* @__PURE__ */ f(Xt, {
|
|
5416
5239
|
group: e,
|
|
5417
5240
|
symmetryType: v,
|
|
5418
5241
|
data: b,
|
|
@@ -5432,7 +5255,7 @@ function Yt({ group: e, symmetryType: t, dark: n = !1, variant: r = !1, showActi
|
|
|
5432
5255
|
})
|
|
5433
5256
|
});
|
|
5434
5257
|
}
|
|
5435
|
-
function
|
|
5258
|
+
function qt(e, t, n, r, i) {
|
|
5436
5259
|
let o = l({
|
|
5437
5260
|
target: null,
|
|
5438
5261
|
t: 2,
|
|
@@ -5450,7 +5273,7 @@ function Xt(e, t, n, r, i) {
|
|
|
5450
5273
|
}, [e, n]), a(() => {
|
|
5451
5274
|
let e = o.current;
|
|
5452
5275
|
!r || !e.target || (e.t = 0, e.phase = "reset", e.settled = !1, n("reset"));
|
|
5453
|
-
}, [r]),
|
|
5276
|
+
}, [r]), oe((e, t) => {
|
|
5454
5277
|
let r = o.current;
|
|
5455
5278
|
if (!(!r.target || r.t > 1.5)) {
|
|
5456
5279
|
if (r.t += t * r.speed, r.phase === "reset") if (r.t >= .5) r.phase = "rotating", r.t = .5, n("rotating");
|
|
@@ -5462,16 +5285,16 @@ function Xt(e, t, n, r, i) {
|
|
|
5462
5285
|
}
|
|
5463
5286
|
}), o;
|
|
5464
5287
|
}
|
|
5465
|
-
function
|
|
5288
|
+
function Jt({ data: e, symmetryType: t, isDirected: n, animState: r }) {
|
|
5466
5289
|
let [i] = u(() => new J.Group());
|
|
5467
5290
|
return a(() => {
|
|
5468
5291
|
for (; i.children.length > 0;) i.remove(i.children[0]);
|
|
5469
5292
|
if (e.vertices.forEach((t, n) => {
|
|
5470
5293
|
let r = new J.Mesh(new J.SphereGeometry(.28, 16, 16), new J.MeshStandardMaterial({
|
|
5471
|
-
color:
|
|
5294
|
+
color: Vt(n, e.vertices.length),
|
|
5472
5295
|
roughness: .3,
|
|
5473
5296
|
metalness: .1,
|
|
5474
|
-
emissive:
|
|
5297
|
+
emissive: Vt(n, e.vertices.length),
|
|
5475
5298
|
emissiveIntensity: .3
|
|
5476
5299
|
}));
|
|
5477
5300
|
r.position.copy(t), i.add(r);
|
|
@@ -5490,7 +5313,7 @@ function Zt({ data: e, symmetryType: t, isDirected: n, animState: r }) {
|
|
|
5490
5313
|
"cube",
|
|
5491
5314
|
"icosahedron"
|
|
5492
5315
|
].includes(t)) {
|
|
5493
|
-
let n = t === "cube" ? "#ff9944" : t === "tetrahedron" ? "#44cc88" : "#cc66ff", r =
|
|
5316
|
+
let n = t === "cube" ? "#ff9944" : t === "tetrahedron" ? "#44cc88" : "#cc66ff", r = Ht(e);
|
|
5494
5317
|
if (r.length > 0) {
|
|
5495
5318
|
let t = [], a = [];
|
|
5496
5319
|
for (let [n, i, o] of r) {
|
|
@@ -5512,11 +5335,11 @@ function Zt({ data: e, symmetryType: t, isDirected: n, animState: r }) {
|
|
|
5512
5335
|
t,
|
|
5513
5336
|
n,
|
|
5514
5337
|
i
|
|
5515
|
-
]),
|
|
5338
|
+
]), oe(() => {
|
|
5516
5339
|
i.quaternion.copy(r.current.currentQuat);
|
|
5517
5340
|
}), /* @__PURE__ */ f("primitive", { object: i });
|
|
5518
5341
|
}
|
|
5519
|
-
function
|
|
5342
|
+
function Yt({ from: e, to: t, intersections: n }) {
|
|
5520
5343
|
let r = c(() => e.clone().add(t).multiplyScalar(.5), [e, t]), i = c(() => t.clone().sub(e).normalize(), [e, t]), a = c(() => t.distanceTo(e), [e, t]), o = c(() => {
|
|
5521
5344
|
let e = new J.Quaternion();
|
|
5522
5345
|
return e.setFromUnitVectors(new J.Vector3(0, 1, 0), i), e;
|
|
@@ -5567,24 +5390,23 @@ function Qt({ from: e, to: t, intersections: n }) {
|
|
|
5567
5390
|
}, t))
|
|
5568
5391
|
] });
|
|
5569
5392
|
}
|
|
5570
|
-
function
|
|
5571
|
-
let { t: x } =
|
|
5393
|
+
function Xt({ group: e, symmetryType: t, data: n, variant: r, showAction: i, actionElementId: o, rotateSpeed: s, showFigureTitle: l, dark: m, locked: h, onHint: g, hintOnIdle: _, replaySignal: v, lockCameraOnAction: y, onAnimationEnd: b }) {
|
|
5394
|
+
let { t: x } = Ie(), [S, C] = u("rest"), w = c(() => {
|
|
5572
5395
|
if (!i || !o || !n) return null;
|
|
5573
|
-
let
|
|
5574
|
-
if (!
|
|
5575
|
-
let
|
|
5576
|
-
return !
|
|
5396
|
+
let t = we(e, o, "SymmetryViewScene.actionElementId");
|
|
5397
|
+
if (!t) return null;
|
|
5398
|
+
let r = Gt(e, t);
|
|
5399
|
+
return !r || r.angleRad === 0 ? null : r;
|
|
5577
5400
|
}, [
|
|
5578
5401
|
i,
|
|
5579
5402
|
o,
|
|
5580
5403
|
e,
|
|
5581
|
-
n
|
|
5582
|
-
|
|
5583
|
-
]), T = Xt(c(() => {
|
|
5404
|
+
n
|
|
5405
|
+
]), T = qt(c(() => {
|
|
5584
5406
|
if (!w || w.angleRad === 0) return null;
|
|
5585
5407
|
let e = new J.Quaternion();
|
|
5586
5408
|
return e.setFromAxisAngle(new J.Vector3(...w.axis), w.angleRad), e;
|
|
5587
|
-
}, [w]), s, C, v, b), E = c(() => i && o ?
|
|
5409
|
+
}, [w]), s, C, v, b), E = c(() => i && o ? we(e, o, "SymmetryViewScene.actionElementId") : null, [
|
|
5588
5410
|
i,
|
|
5589
5411
|
o,
|
|
5590
5412
|
e
|
|
@@ -5634,7 +5456,7 @@ function $t({ group: e, symmetryType: t, data: n, variant: r, showAction: i, act
|
|
|
5634
5456
|
kind: "edge"
|
|
5635
5457
|
});
|
|
5636
5458
|
}
|
|
5637
|
-
let r =
|
|
5459
|
+
let r = Wt(n, Ht(n));
|
|
5638
5460
|
for (let n of r) {
|
|
5639
5461
|
let r = n.dot(e), i = e.clone().multiplyScalar(r);
|
|
5640
5462
|
n.distanceTo(i) < .25 && t.push({
|
|
@@ -5679,7 +5501,7 @@ function $t({ group: e, symmetryType: t, data: n, variant: r, showAction: i, act
|
|
|
5679
5501
|
],
|
|
5680
5502
|
intensity: .5
|
|
5681
5503
|
}),
|
|
5682
|
-
l && /* @__PURE__ */ f(
|
|
5504
|
+
l && /* @__PURE__ */ f(ce, {
|
|
5683
5505
|
position: [
|
|
5684
5506
|
0,
|
|
5685
5507
|
A + 1.5,
|
|
@@ -5698,10 +5520,10 @@ function $t({ group: e, symmetryType: t, data: n, variant: r, showAction: i, act
|
|
|
5698
5520
|
userSelect: "none",
|
|
5699
5521
|
pointerEvents: "none"
|
|
5700
5522
|
},
|
|
5701
|
-
dangerouslySetInnerHTML: { __html:
|
|
5523
|
+
dangerouslySetInnerHTML: { __html: Q(X(e.name)) }
|
|
5702
5524
|
})
|
|
5703
5525
|
}),
|
|
5704
|
-
l && /* @__PURE__ */ f(
|
|
5526
|
+
l && /* @__PURE__ */ f(ce, {
|
|
5705
5527
|
position: [
|
|
5706
5528
|
0,
|
|
5707
5529
|
A + 2.2,
|
|
@@ -5719,15 +5541,15 @@ function $t({ group: e, symmetryType: t, data: n, variant: r, showAction: i, act
|
|
|
5719
5541
|
userSelect: "none",
|
|
5720
5542
|
pointerEvents: "none"
|
|
5721
5543
|
},
|
|
5722
|
-
dangerouslySetInnerHTML: { __html:
|
|
5544
|
+
dangerouslySetInnerHTML: { __html: Q(t === "cyclic" ? x("symmetry.geo.cyclicText", { n: e.order }) : t === "dihedral" ? x("symmetry.geo.dihedralText", { n: e.order / 2 }) : x(t === "cube" ? r ? "symmetry.geo.octahedron" : "symmetry.geo.cube" : t === "icosahedron" ? r ? "symmetry.geo.dodecahedron" : "symmetry.geo.icosahedron" : "symmetry.geo." + t)) }
|
|
5723
5545
|
})
|
|
5724
5546
|
}),
|
|
5725
|
-
M && /* @__PURE__ */ f(
|
|
5547
|
+
M && /* @__PURE__ */ f(Yt, {
|
|
5726
5548
|
from: F,
|
|
5727
5549
|
to: P,
|
|
5728
5550
|
intersections: I
|
|
5729
5551
|
}),
|
|
5730
|
-
/* @__PURE__ */ f(
|
|
5552
|
+
/* @__PURE__ */ f(Jt, {
|
|
5731
5553
|
data: n,
|
|
5732
5554
|
symmetryType: t,
|
|
5733
5555
|
isDirected: k,
|
|
@@ -5765,7 +5587,7 @@ function $t({ group: e, symmetryType: t, data: n, variant: r, showAction: i, act
|
|
|
5765
5587
|
depthWrite: !1
|
|
5766
5588
|
})]
|
|
5767
5589
|
}),
|
|
5768
|
-
/* @__PURE__ */ f(
|
|
5590
|
+
/* @__PURE__ */ f(le, {
|
|
5769
5591
|
enableDamping: !1,
|
|
5770
5592
|
minDistance: 2,
|
|
5771
5593
|
maxDistance: 20,
|
|
@@ -5775,8 +5597,8 @@ function $t({ group: e, symmetryType: t, data: n, variant: r, showAction: i, act
|
|
|
5775
5597
|
})
|
|
5776
5598
|
] }) : null;
|
|
5777
5599
|
}
|
|
5778
|
-
function
|
|
5779
|
-
let { t } =
|
|
5600
|
+
function Zt({ group: e }) {
|
|
5601
|
+
let { t } = Ie();
|
|
5780
5602
|
return /* @__PURE__ */ p("div", {
|
|
5781
5603
|
style: {
|
|
5782
5604
|
width: "100%",
|
|
@@ -5794,7 +5616,7 @@ function en({ group: e }) {
|
|
|
5794
5616
|
fontSize: "18px",
|
|
5795
5617
|
marginBottom: "8px"
|
|
5796
5618
|
},
|
|
5797
|
-
children: /* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html:
|
|
5619
|
+
children: /* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(X(e.name)) } })
|
|
5798
5620
|
}),
|
|
5799
5621
|
/* @__PURE__ */ f("p", {
|
|
5800
5622
|
style: {
|
|
@@ -5816,7 +5638,7 @@ function en({ group: e }) {
|
|
|
5816
5638
|
}
|
|
5817
5639
|
//#endregion
|
|
5818
5640
|
//#region src/theme/ThemeContext.tsx
|
|
5819
|
-
var
|
|
5641
|
+
var Qt = e({
|
|
5820
5642
|
theme: "dark",
|
|
5821
5643
|
toggleTheme: () => {},
|
|
5822
5644
|
viewWindowTheme: "dark",
|
|
@@ -5824,25 +5646,25 @@ var tn = e({
|
|
|
5824
5646
|
});
|
|
5825
5647
|
//#endregion
|
|
5826
5648
|
//#region src/theme/useTheme.ts
|
|
5827
|
-
function
|
|
5828
|
-
return i(
|
|
5649
|
+
function $t() {
|
|
5650
|
+
return i(Qt);
|
|
5829
5651
|
}
|
|
5830
5652
|
//#endregion
|
|
5831
5653
|
//#region src/utils/cayley3dControls.ts
|
|
5832
|
-
var
|
|
5833
|
-
function
|
|
5834
|
-
|
|
5654
|
+
var en = null;
|
|
5655
|
+
function tn(e) {
|
|
5656
|
+
en = e;
|
|
5835
5657
|
}
|
|
5836
|
-
function
|
|
5837
|
-
|
|
5658
|
+
function nn(e) {
|
|
5659
|
+
en === e && (en = null);
|
|
5838
5660
|
}
|
|
5839
5661
|
//#endregion
|
|
5840
5662
|
//#region src/components/Canvas/Cayley3DScene.tsx
|
|
5841
|
-
function
|
|
5663
|
+
function rn(e, t, n) {
|
|
5842
5664
|
return n ? `hsl(${e / t * 360}, 60%, 55%)` : `hsl(${e * 137.508 % 360}, 65%, 55%)`;
|
|
5843
5665
|
}
|
|
5844
|
-
var
|
|
5845
|
-
let g = c(() =>
|
|
5666
|
+
var an = n(function({ position: e, label: t, color: n, isSelected: r, isHovered: i, subsetColor: a, element: o, nodeScale: s, showLabel: l, isDark: u, onSelectElement: d, onPointerEnter: m, onPointerLeave: h }) {
|
|
5667
|
+
let g = c(() => Q(X(t)), [t]), _ = r || i, v = _ ? 24 : 12;
|
|
5846
5668
|
return /* @__PURE__ */ p("group", {
|
|
5847
5669
|
position: e,
|
|
5848
5670
|
children: [
|
|
@@ -5882,7 +5704,7 @@ var cn = n(function({ position: e, label: t, color: n, isSelected: r, isHovered:
|
|
|
5882
5704
|
transparent: !0,
|
|
5883
5705
|
opacity: .3
|
|
5884
5706
|
})] }),
|
|
5885
|
-
l && _ && /* @__PURE__ */ f(
|
|
5707
|
+
l && _ && /* @__PURE__ */ f(ce, {
|
|
5886
5708
|
distanceFactor: 12,
|
|
5887
5709
|
center: !0,
|
|
5888
5710
|
style: {
|
|
@@ -5907,7 +5729,7 @@ var cn = n(function({ position: e, label: t, color: n, isSelected: r, isHovered:
|
|
|
5907
5729
|
})
|
|
5908
5730
|
]
|
|
5909
5731
|
});
|
|
5910
|
-
}),
|
|
5732
|
+
}), on = n(function({ start: e, end: t, color: n, isHighlighted: r }) {
|
|
5911
5733
|
let i = l(null), o = new J.Vector3().subVectors(t, e), s = o.length();
|
|
5912
5734
|
o.normalize();
|
|
5913
5735
|
let c = new J.Vector3().addVectors(e, t).multiplyScalar(.5), u = r ? .08 : .05;
|
|
@@ -5932,7 +5754,7 @@ var cn = n(function({ position: e, label: t, color: n, isSelected: r, isHovered:
|
|
|
5932
5754
|
roughness: .4
|
|
5933
5755
|
})]
|
|
5934
5756
|
});
|
|
5935
|
-
}),
|
|
5757
|
+
}), sn = n(function({ position: e, direction: t, color: n, isHighlighted: r }) {
|
|
5936
5758
|
return /* @__PURE__ */ p("mesh", {
|
|
5937
5759
|
position: e,
|
|
5938
5760
|
quaternion: c(() => {
|
|
@@ -5951,7 +5773,7 @@ var cn = n(function({ position: e, label: t, color: n, isSelected: r, isHovered:
|
|
|
5951
5773
|
roughness: .4
|
|
5952
5774
|
})]
|
|
5953
5775
|
});
|
|
5954
|
-
}),
|
|
5776
|
+
}), cn = n(function({ start: e, end: t, color: n, isHighlighted: r, isSelfLoop: i, isBidirectional: a, showArrow: o }) {
|
|
5955
5777
|
if (i) return /* @__PURE__ */ p("group", {
|
|
5956
5778
|
position: e,
|
|
5957
5779
|
children: [/* @__PURE__ */ p("mesh", {
|
|
@@ -5996,29 +5818,29 @@ var cn = n(function({ position: e, label: t, color: n, isSelected: r, isHovered:
|
|
|
5996
5818
|
})]
|
|
5997
5819
|
});
|
|
5998
5820
|
let s = new J.Vector3().subVectors(t, e);
|
|
5999
|
-
return s.normalize(), /* @__PURE__ */ p("group", { children: [/* @__PURE__ */ f(
|
|
5821
|
+
return s.normalize(), /* @__PURE__ */ p("group", { children: [/* @__PURE__ */ f(on, {
|
|
6000
5822
|
start: e,
|
|
6001
5823
|
end: t,
|
|
6002
5824
|
color: n,
|
|
6003
5825
|
isHighlighted: r
|
|
6004
|
-
}), o && !a && /* @__PURE__ */ f(
|
|
5826
|
+
}), o && !a && /* @__PURE__ */ f(sn, {
|
|
6005
5827
|
position: t.clone().addScaledVector(s, -.66),
|
|
6006
5828
|
direction: s,
|
|
6007
5829
|
color: n,
|
|
6008
5830
|
isHighlighted: r
|
|
6009
5831
|
})] });
|
|
6010
|
-
}),
|
|
6011
|
-
function
|
|
6012
|
-
let { t: T } =
|
|
5832
|
+
}), ln = () => {};
|
|
5833
|
+
function un({ group: e, selectedElements: t, onSelectElement: n, actions: i, multiplyType: o, layout3D: s, nodeScale: m, autoRotate: h, showLabels: _, locked: y = !1, subsetHighlights: b = [], theme: C = "dark", faceFill: w }) {
|
|
5834
|
+
let { t: T } = Ie(), { gl: E, camera: D, scene: O } = se(), k = c(() => De(e, i), [e, i]), A = o ?? "right", j = s ?? F(e), M = m ?? 1, N = _ !== !1, P = n ?? ln, [I, L] = u(!1), R = h ?? I, [ee, te] = u(null), z = l({
|
|
6013
5835
|
theta: 0,
|
|
6014
5836
|
phi: Math.acos(3 / Math.sqrt(153)),
|
|
6015
5837
|
radius: Math.sqrt(153),
|
|
6016
5838
|
target: new J.Vector3(0, 0, 0),
|
|
6017
5839
|
initialized: !1
|
|
6018
|
-
}),
|
|
5840
|
+
}), ne = l({
|
|
6019
5841
|
x: 0,
|
|
6020
5842
|
y: 0
|
|
6021
|
-
}),
|
|
5843
|
+
}), B = l({
|
|
6022
5844
|
active: !1,
|
|
6023
5845
|
lastX: 0,
|
|
6024
5846
|
lastY: 0,
|
|
@@ -6034,11 +5856,11 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6034
5856
|
target: new J.Vector3(),
|
|
6035
5857
|
renderer: null,
|
|
6036
5858
|
ecam: null
|
|
6037
|
-
}),
|
|
6038
|
-
let e =
|
|
5859
|
+
}), re = r(() => {
|
|
5860
|
+
let e = ne.current, t = Math.hypot(e.x, e.y);
|
|
6039
5861
|
return (t >= 8 ? .35 + Math.min(.65, t / 360) : 1) * 2 * Math.PI;
|
|
6040
|
-
}, []),
|
|
6041
|
-
if (!
|
|
5862
|
+
}, []), H = e.order > 100, ie = c(() => {
|
|
5863
|
+
if (!H) return new Set(e.elements.map((e) => e.id));
|
|
6042
5864
|
let n = new Set([e.identity.id]);
|
|
6043
5865
|
for (let e of k.filter((e) => e.enabled).slice(0, 4)) n.add(e.elementId);
|
|
6044
5866
|
for (let e of t) n.add(e);
|
|
@@ -6048,12 +5870,12 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6048
5870
|
e,
|
|
6049
5871
|
k,
|
|
6050
5872
|
t,
|
|
6051
|
-
|
|
6052
|
-
]),
|
|
5873
|
+
H
|
|
5874
|
+
]), U = c(() => S(e, k, A), [
|
|
6053
5875
|
e,
|
|
6054
5876
|
k,
|
|
6055
5877
|
A
|
|
6056
|
-
]), G = c(() =>
|
|
5878
|
+
]), G = c(() => x(e, j).map((e) => new J.Vector3(e[0], e[1], e[2])), [e, j]), K = c(() => {
|
|
6057
5879
|
let e = new J.Vector3(0, 0, 0);
|
|
6058
5880
|
if (G.length === 0) return {
|
|
6059
5881
|
center: e,
|
|
@@ -6077,24 +5899,24 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6077
5899
|
maxRadius: Math.max(30, t * 3),
|
|
6078
5900
|
target: K.center.clone()
|
|
6079
5901
|
};
|
|
6080
|
-
}, [K, D]),
|
|
5902
|
+
}, [K, D]), ae = l(q);
|
|
6081
5903
|
a(() => {
|
|
6082
|
-
|
|
5904
|
+
ae.current = q;
|
|
6083
5905
|
});
|
|
6084
|
-
let le = `${e.symbol}|${e.order}`,
|
|
6085
|
-
let e =
|
|
5906
|
+
let le = `${e.symbol}|${e.order}`, Y = r(() => {
|
|
5907
|
+
let e = z.current, t = ae.current;
|
|
6086
5908
|
e.theta = t.theta, e.phi = t.phi, e.radius = t.radius, e.target.copy(t.target);
|
|
6087
5909
|
}, []);
|
|
6088
5910
|
a(() => {
|
|
6089
|
-
|
|
5911
|
+
Y();
|
|
6090
5912
|
}, [
|
|
6091
5913
|
le,
|
|
6092
5914
|
j,
|
|
6093
|
-
|
|
5915
|
+
Y
|
|
6094
5916
|
]), a(() => {
|
|
6095
5917
|
if (y) return;
|
|
6096
5918
|
let e = E.domElement, t = (t) => {
|
|
6097
|
-
|
|
5919
|
+
B.current = {
|
|
6098
5920
|
active: !0,
|
|
6099
5921
|
lastX: t.clientX,
|
|
6100
5922
|
lastY: t.clientY,
|
|
@@ -6103,24 +5925,24 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6103
5925
|
button: t.button
|
|
6104
5926
|
}, e.setPointerCapture?.(t.pointerId);
|
|
6105
5927
|
}, n = (e) => {
|
|
6106
|
-
let t =
|
|
5928
|
+
let t = B.current;
|
|
6107
5929
|
if (!t.active) return;
|
|
6108
5930
|
let n = e.clientX - t.lastX, r = e.clientY - t.lastY;
|
|
6109
5931
|
t.lastX = e.clientX, t.lastY = e.clientY, t.x += n, t.y += r;
|
|
6110
|
-
let i =
|
|
5932
|
+
let i = z.current;
|
|
6111
5933
|
if (t.button === 2) {
|
|
6112
5934
|
let e = new J.Vector3().setFromMatrixColumn(D.matrix, 0), t = new J.Vector3().setFromMatrixColumn(D.matrix, 1);
|
|
6113
5935
|
i.target.addScaledVector(e, -n * i.radius * .0012).addScaledVector(t, r * i.radius * .0012);
|
|
6114
5936
|
} else i.theta -= n * .006, i.phi -= r * .006;
|
|
6115
5937
|
}, r = (t) => {
|
|
6116
|
-
let n =
|
|
6117
|
-
n.active = !1, Math.hypot(n.x, n.y) >= 8 && (
|
|
5938
|
+
let n = B.current;
|
|
5939
|
+
n.active = !1, Math.hypot(n.x, n.y) >= 8 && (ne.current = {
|
|
6118
5940
|
x: n.x,
|
|
6119
5941
|
y: n.y
|
|
6120
5942
|
}), e.releasePointerCapture?.(t.pointerId);
|
|
6121
5943
|
}, i = (e) => {
|
|
6122
5944
|
e.preventDefault();
|
|
6123
|
-
let t =
|
|
5945
|
+
let t = z.current;
|
|
6124
5946
|
t.radius = Math.min(q.maxRadius, Math.max(q.minRadius, t.radius * .95 ** (-e.deltaY / 100)));
|
|
6125
5947
|
};
|
|
6126
5948
|
return e.addEventListener("pointerdown", t), e.addEventListener("pointermove", n), e.addEventListener("pointerup", r), e.addEventListener("pointercancel", r), e.addEventListener("wheel", i, { passive: !1 }), () => {
|
|
@@ -6132,25 +5954,25 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6132
5954
|
q,
|
|
6133
5955
|
y
|
|
6134
5956
|
]);
|
|
6135
|
-
let
|
|
6136
|
-
let r =
|
|
5957
|
+
let ue = (e, t, n) => {
|
|
5958
|
+
let r = ne.current, i = Math.hypot(r.x, r.y);
|
|
6137
5959
|
i >= 8 ? (e.theta -= r.x / i * t * n, e.phi -= r.y / i * t * n) : e.theta -= t * n;
|
|
6138
|
-
},
|
|
5960
|
+
}, de = r((e) => {
|
|
6139
5961
|
let t = Math.sin(e.phi);
|
|
6140
5962
|
D.position.set(e.target.x + e.radius * t * Math.sin(e.theta), e.target.y + e.radius * Math.cos(e.phi), e.target.z + e.radius * t * Math.cos(e.theta)), D.up.set(0, t >= 0 ? 1 : -1, 0), D.lookAt(e.target);
|
|
6141
5963
|
}, [D]);
|
|
6142
|
-
|
|
6143
|
-
let n =
|
|
6144
|
-
n.initialized ||= (n.theta = q.theta, n.phi = q.phi, n.radius = q.radius, n.target.copy(q.target), !0), R &&
|
|
5964
|
+
oe((e, t) => {
|
|
5965
|
+
let n = z.current;
|
|
5966
|
+
n.initialized ||= (n.theta = q.theta, n.phi = q.phi, n.radius = q.radius, n.target.copy(q.target), !0), R && ue(n, re(), t), de(n);
|
|
6145
5967
|
}), a(() => {
|
|
6146
|
-
let e = E.domElement, t = () =>
|
|
5968
|
+
let e = E.domElement, t = () => Y();
|
|
6147
5969
|
return e.addEventListener("dblclick", t), () => e.removeEventListener("dblclick", t);
|
|
6148
|
-
}, [E,
|
|
5970
|
+
}, [E, Y]), a(() => {
|
|
6149
5971
|
if (!E.domElement.closest(".canvas-viewport")) return;
|
|
6150
5972
|
let e = {
|
|
6151
5973
|
isReady: () => !0,
|
|
6152
5974
|
snapshotOrbit: () => {
|
|
6153
|
-
let e =
|
|
5975
|
+
let e = z.current;
|
|
6154
5976
|
return {
|
|
6155
5977
|
theta: e.theta,
|
|
6156
5978
|
phi: e.phi,
|
|
@@ -6158,9 +5980,9 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6158
5980
|
target: e.target.clone()
|
|
6159
5981
|
};
|
|
6160
5982
|
},
|
|
6161
|
-
displayAngVel: () =>
|
|
5983
|
+
displayAngVel: () => re(),
|
|
6162
5984
|
beginRotation: (e) => {
|
|
6163
|
-
let t =
|
|
5985
|
+
let t = z.current, n = new J.WebGLRenderer({
|
|
6164
5986
|
antialias: !1,
|
|
6165
5987
|
preserveDrawingBuffer: !0
|
|
6166
5988
|
});
|
|
@@ -6182,7 +6004,7 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6182
6004
|
frameAt: (e, t) => {
|
|
6183
6005
|
let n = V.current;
|
|
6184
6006
|
if (!n.active || !n.renderer || !n.ecam) return null;
|
|
6185
|
-
let r = n.radPerSec * e * t / 1e3, i =
|
|
6007
|
+
let r = n.radPerSec * e * t / 1e3, i = ne.current, a = Math.hypot(i.x, i.y), o, s;
|
|
6186
6008
|
a >= 8 ? (o = n.baseTheta - i.x / a * r, s = n.basePhi - i.y / a * r) : (o = n.baseTheta - r, s = n.basePhi);
|
|
6187
6009
|
let c = Math.sin(s);
|
|
6188
6010
|
return n.ecam.position.set(n.target.x + n.radius * c * Math.sin(o), n.target.y + n.radius * Math.cos(s), n.target.z + n.radius * c * Math.cos(o)), n.ecam.up.set(0, c >= 0 ? 1 : -1, 0), n.ecam.lookAt(n.target), n.renderer.render(O, n.ecam), n.renderer.domElement;
|
|
@@ -6192,21 +6014,21 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6192
6014
|
e.active = !1, e.renderer?.dispose(), e.renderer = null, e.ecam = null;
|
|
6193
6015
|
}
|
|
6194
6016
|
};
|
|
6195
|
-
return
|
|
6017
|
+
return tn(e), () => nn(e);
|
|
6196
6018
|
}, [
|
|
6197
6019
|
E,
|
|
6198
6020
|
O,
|
|
6199
6021
|
D,
|
|
6200
|
-
|
|
6022
|
+
re
|
|
6201
6023
|
]);
|
|
6202
|
-
let
|
|
6024
|
+
let fe = c(() => {
|
|
6203
6025
|
let t = /* @__PURE__ */ new Map();
|
|
6204
6026
|
for (let n of e.elements) t.set(n.id, n);
|
|
6205
6027
|
return t;
|
|
6206
|
-
}, [e]),
|
|
6028
|
+
}, [e]), pe = w?.enabled === !1 ? 0 : w?.opacity ?? .45, Z = c(() => {
|
|
6207
6029
|
let t = w?.subgroup;
|
|
6208
|
-
if (
|
|
6209
|
-
let n = v(
|
|
6030
|
+
if (pe <= 0 || !t || t.length === 0) return [];
|
|
6031
|
+
let n = v(U.map((e) => [e.fromIdx, e.toIdx])), r = W(e, t, G.map((e) => [
|
|
6210
6032
|
e.x,
|
|
6211
6033
|
e.y,
|
|
6212
6034
|
e.z
|
|
@@ -6234,28 +6056,28 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6234
6056
|
}, [
|
|
6235
6057
|
e,
|
|
6236
6058
|
w,
|
|
6237
|
-
|
|
6059
|
+
U,
|
|
6238
6060
|
G,
|
|
6239
|
-
|
|
6061
|
+
pe
|
|
6240
6062
|
]);
|
|
6241
6063
|
a(() => () => {
|
|
6242
|
-
for (let e of
|
|
6243
|
-
}, [
|
|
6244
|
-
let
|
|
6064
|
+
for (let e of Z) e.geometry.dispose();
|
|
6065
|
+
}, [Z]);
|
|
6066
|
+
let me = c(() => {
|
|
6245
6067
|
let e = /* @__PURE__ */ new Map();
|
|
6246
6068
|
for (let t of k) {
|
|
6247
|
-
let n =
|
|
6069
|
+
let n = fe.get(t.elementId);
|
|
6248
6070
|
n && e.set(t.elementId, n.label);
|
|
6249
6071
|
}
|
|
6250
6072
|
return e;
|
|
6251
|
-
}, [k,
|
|
6073
|
+
}, [k, fe]), he = c(() => {
|
|
6252
6074
|
let e = /* @__PURE__ */ new Map();
|
|
6253
|
-
for (let t of
|
|
6075
|
+
for (let t of b) for (let n of t.elementIds) e.has(n) || e.set(n, t);
|
|
6254
6076
|
return e;
|
|
6255
|
-
}, [
|
|
6256
|
-
let t = /* @__PURE__ */ new Map(), n =
|
|
6257
|
-
for (let r of
|
|
6258
|
-
if (
|
|
6077
|
+
}, [b]), ge = c(() => {
|
|
6078
|
+
let t = /* @__PURE__ */ new Map(), n = H ? Math.max(60, e.order * 2) : Infinity;
|
|
6079
|
+
for (let r of U) {
|
|
6080
|
+
if (H && !ie.has(r.fromId) && !ie.has(r.toId)) continue;
|
|
6259
6081
|
let i = `${Math.min(r.fromIdx, r.toIdx)}|${Math.max(r.fromIdx, r.toIdx)}|${r.actionElementId}`;
|
|
6260
6082
|
if (t.has(i) || t.set(i, {
|
|
6261
6083
|
fromIdx: r.fromIdx,
|
|
@@ -6266,7 +6088,7 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6266
6088
|
toPos: G[r.toIdx],
|
|
6267
6089
|
gen: {
|
|
6268
6090
|
name: r.actionElementId,
|
|
6269
|
-
symbol:
|
|
6091
|
+
symbol: fe.get(r.actionElementId)?.label || "",
|
|
6270
6092
|
color: r.color,
|
|
6271
6093
|
apply: () => e.elements[0],
|
|
6272
6094
|
inverse: {}
|
|
@@ -6277,12 +6099,12 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6277
6099
|
}
|
|
6278
6100
|
return t;
|
|
6279
6101
|
}, [
|
|
6280
|
-
|
|
6102
|
+
U,
|
|
6281
6103
|
G,
|
|
6282
6104
|
e,
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6105
|
+
H,
|
|
6106
|
+
ie,
|
|
6107
|
+
fe
|
|
6286
6108
|
]);
|
|
6287
6109
|
return /* @__PURE__ */ p(d, { children: [
|
|
6288
6110
|
/* @__PURE__ */ f("ambientLight", { intensity: .3 }),
|
|
@@ -6313,7 +6135,7 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6313
6135
|
intensity: .3,
|
|
6314
6136
|
color: "#ffffff"
|
|
6315
6137
|
}),
|
|
6316
|
-
/* @__PURE__ */ f(
|
|
6138
|
+
/* @__PURE__ */ f(ce, {
|
|
6317
6139
|
fullscreen: !0,
|
|
6318
6140
|
position: [
|
|
6319
6141
|
0,
|
|
@@ -6345,7 +6167,7 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6345
6167
|
},
|
|
6346
6168
|
children: [/* @__PURE__ */ f("span", {
|
|
6347
6169
|
style: { fontWeight: "bold" },
|
|
6348
|
-
dangerouslySetInnerHTML: { __html:
|
|
6170
|
+
dangerouslySetInnerHTML: { __html: Q(X(e.symbol)) }
|
|
6349
6171
|
}), /* @__PURE__ */ p("span", {
|
|
6350
6172
|
style: {
|
|
6351
6173
|
marginLeft: 8,
|
|
@@ -6371,7 +6193,7 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6371
6193
|
children: R ? "❚❚" : "▶"
|
|
6372
6194
|
}),
|
|
6373
6195
|
/* @__PURE__ */ f("button", {
|
|
6374
|
-
onClick:
|
|
6196
|
+
onClick: Y,
|
|
6375
6197
|
title: T("cayley3d.resetView"),
|
|
6376
6198
|
"aria-label": T("cayley3d.resetView"),
|
|
6377
6199
|
style: {
|
|
@@ -6389,7 +6211,7 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6389
6211
|
]
|
|
6390
6212
|
})
|
|
6391
6213
|
}),
|
|
6392
|
-
k.length > 0 && /* @__PURE__ */ f(
|
|
6214
|
+
k.length > 0 && /* @__PURE__ */ f(ce, {
|
|
6393
6215
|
fullscreen: !0,
|
|
6394
6216
|
position: [
|
|
6395
6217
|
0,
|
|
@@ -6418,7 +6240,7 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6418
6240
|
},
|
|
6419
6241
|
children: T(A === "right" ? "cayley3d.multiplyRight" : "cayley3d.multiplyLeft")
|
|
6420
6242
|
}), k.filter((e) => e.enabled).map((e) => {
|
|
6421
|
-
let t =
|
|
6243
|
+
let t = me.get(e.elementId) || e.elementId;
|
|
6422
6244
|
return /* @__PURE__ */ p("div", {
|
|
6423
6245
|
style: {
|
|
6424
6246
|
display: "flex",
|
|
@@ -6432,60 +6254,60 @@ function pn({ group: e, selectedElements: t, onSelectElement: n, actions: i, mul
|
|
|
6432
6254
|
height: 3,
|
|
6433
6255
|
background: e.color,
|
|
6434
6256
|
borderRadius: 2
|
|
6435
|
-
} }), /* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html:
|
|
6257
|
+
} }), /* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(X(t)) } })]
|
|
6436
6258
|
}, e.elementId);
|
|
6437
6259
|
})]
|
|
6438
6260
|
})
|
|
6439
6261
|
}),
|
|
6440
|
-
|
|
6262
|
+
Z.map((e) => /* @__PURE__ */ f("mesh", {
|
|
6441
6263
|
geometry: e.geometry,
|
|
6442
6264
|
renderOrder: -2,
|
|
6443
6265
|
children: /* @__PURE__ */ f("meshBasicMaterial", {
|
|
6444
6266
|
color: e.color,
|
|
6445
6267
|
transparent: !0,
|
|
6446
|
-
opacity:
|
|
6268
|
+
opacity: pe,
|
|
6447
6269
|
side: J.DoubleSide,
|
|
6448
6270
|
depthWrite: !1
|
|
6449
6271
|
})
|
|
6450
6272
|
}, e.key)),
|
|
6451
6273
|
Array.from(ge.values()).map((e) => {
|
|
6452
|
-
let n =
|
|
6274
|
+
let n = fe.get(e.fromId), r = fe.get(e.toId);
|
|
6453
6275
|
if (!n || !r) return null;
|
|
6454
6276
|
let i = t.has(n.id) || t.has(r.id);
|
|
6455
|
-
return /* @__PURE__ */ f(
|
|
6277
|
+
return /* @__PURE__ */ f(cn, {
|
|
6456
6278
|
start: e.fromPos,
|
|
6457
6279
|
end: e.toPos,
|
|
6458
6280
|
color: e.gen.color,
|
|
6459
6281
|
isHighlighted: i,
|
|
6460
6282
|
isSelfLoop: e.isSelfLoop,
|
|
6461
6283
|
isBidirectional: e.isBidirectional,
|
|
6462
|
-
showArrow: !
|
|
6284
|
+
showArrow: !H
|
|
6463
6285
|
}, `edge-${e.fromIdx}-${e.toIdx}`);
|
|
6464
6286
|
}),
|
|
6465
6287
|
G.map((n, r) => {
|
|
6466
6288
|
let i = e.elements[r];
|
|
6467
|
-
if (
|
|
6289
|
+
if (H && !ie.has(i.id)) return null;
|
|
6468
6290
|
let a = t.has(i.id), o = he.get(i.id);
|
|
6469
|
-
return /* @__PURE__ */ f(
|
|
6291
|
+
return /* @__PURE__ */ f(an, {
|
|
6470
6292
|
position: n,
|
|
6471
6293
|
label: i.label,
|
|
6472
|
-
color:
|
|
6294
|
+
color: rn(r, e.order, e.isAbelian),
|
|
6473
6295
|
isSelected: a,
|
|
6474
|
-
isHovered:
|
|
6296
|
+
isHovered: ee?.id === i.id,
|
|
6475
6297
|
subsetColor: o ? o.color : null,
|
|
6476
6298
|
element: i,
|
|
6477
6299
|
nodeScale: M,
|
|
6478
6300
|
showLabel: N,
|
|
6479
6301
|
isDark: C === "dark",
|
|
6480
|
-
onSelectElement:
|
|
6481
|
-
onPointerEnter:
|
|
6482
|
-
onPointerLeave:
|
|
6302
|
+
onSelectElement: P,
|
|
6303
|
+
onPointerEnter: te,
|
|
6304
|
+
onPointerLeave: te
|
|
6483
6305
|
}, i.id);
|
|
6484
6306
|
})
|
|
6485
6307
|
] });
|
|
6486
6308
|
}
|
|
6487
|
-
function
|
|
6488
|
-
let { group: t, theme: n } = e, { t: r } =
|
|
6309
|
+
function dn(e) {
|
|
6310
|
+
let { group: t, theme: n } = e, { t: r } = Ie(), { theme: i } = $t(), a = n ?? i;
|
|
6489
6311
|
if (!t) return /* @__PURE__ */ f("div", {
|
|
6490
6312
|
className: "view-empty",
|
|
6491
6313
|
children: /* @__PURE__ */ f("p", { children: r("canvas.noGroup") })
|
|
@@ -6497,7 +6319,7 @@ function mn(e) {
|
|
|
6497
6319
|
height: "100%",
|
|
6498
6320
|
background: o
|
|
6499
6321
|
},
|
|
6500
|
-
children: /* @__PURE__ */ p(
|
|
6322
|
+
children: /* @__PURE__ */ p(ae, {
|
|
6501
6323
|
camera: {
|
|
6502
6324
|
position: [
|
|
6503
6325
|
0,
|
|
@@ -6520,7 +6342,7 @@ function mn(e) {
|
|
|
6520
6342
|
children: [/* @__PURE__ */ f("color", {
|
|
6521
6343
|
attach: "background",
|
|
6522
6344
|
args: [o]
|
|
6523
|
-
}), /* @__PURE__ */ f(
|
|
6345
|
+
}), /* @__PURE__ */ f(un, {
|
|
6524
6346
|
...e,
|
|
6525
6347
|
group: t,
|
|
6526
6348
|
theme: a
|
|
@@ -6530,7 +6352,7 @@ function mn(e) {
|
|
|
6530
6352
|
}
|
|
6531
6353
|
//#endregion
|
|
6532
6354
|
//#region src/components/Canvas/SublatticeScene.tsx
|
|
6533
|
-
var
|
|
6355
|
+
var fn = {
|
|
6534
6356
|
derived: {
|
|
6535
6357
|
light: "#b8860b",
|
|
6536
6358
|
dark: "#ffd93d"
|
|
@@ -6547,15 +6369,15 @@ var hn = {
|
|
|
6547
6369
|
light: "#7c3aed",
|
|
6548
6370
|
dark: "#c084fc"
|
|
6549
6371
|
}
|
|
6550
|
-
},
|
|
6372
|
+
}, pn = {
|
|
6551
6373
|
w: 104,
|
|
6552
6374
|
h: 28,
|
|
6553
6375
|
font: 13
|
|
6554
|
-
},
|
|
6555
|
-
function
|
|
6376
|
+
}, mn = 8, hn = 11;
|
|
6377
|
+
function gn(e, t, n) {
|
|
6556
6378
|
return Math.min(e / Math.max(t, 1e-4), n);
|
|
6557
6379
|
}
|
|
6558
|
-
function
|
|
6380
|
+
function _n(e) {
|
|
6559
6381
|
return e === "light" ? {
|
|
6560
6382
|
edge: "#a9adbc",
|
|
6561
6383
|
edgeOpacity: .95,
|
|
@@ -6608,12 +6430,12 @@ function bn(e) {
|
|
|
6608
6430
|
seriesBadgeText: "#111"
|
|
6609
6431
|
};
|
|
6610
6432
|
}
|
|
6611
|
-
function
|
|
6433
|
+
function vn(e, t) {
|
|
6612
6434
|
let n = Array.from({ length: e }, () => []);
|
|
6613
6435
|
for (let r of t) r.from >= 0 && r.from < e && r.to >= 0 && r.to < e && (n[r.from].push(r.to), n[r.to].push(r.from));
|
|
6614
6436
|
return n;
|
|
6615
6437
|
}
|
|
6616
|
-
function
|
|
6438
|
+
function yn(e, t, n) {
|
|
6617
6439
|
if (t === n) return [t];
|
|
6618
6440
|
let r = /* @__PURE__ */ new Set(), i = [[t]];
|
|
6619
6441
|
for (; i.length > 0;) {
|
|
@@ -6626,9 +6448,9 @@ function Sn(e, t, n) {
|
|
|
6626
6448
|
}
|
|
6627
6449
|
return null;
|
|
6628
6450
|
}
|
|
6629
|
-
function
|
|
6630
|
-
let { t: i } =
|
|
6631
|
-
let r = t.length === 1 ? "\\langle e \\rangle" : t.length === e.order ?
|
|
6451
|
+
function bn({ group: e, series: t, color: n, theme: r }) {
|
|
6452
|
+
let { t: i } = Ie(), { theme: a } = $t(), o = r ?? a, { type: s, terms: c, factors: l, solvable: u, nilpotent: m, chainCount: h, truncated: g, loading: _ } = t, v = c ? c.map((t, n) => {
|
|
6453
|
+
let r = t.length === 1 ? "\\langle e \\rangle" : t.length === e.order ? X(e.symbol) : `N_{${n}}`;
|
|
6632
6454
|
return (n === 0 ? "" : " \\trianglerighteq ") + r;
|
|
6633
6455
|
}).join("") : "", y = c ? c.map((e, t) => `|N_{${t}}| = ${e.length}`).join(",\\;") : "", b = l ? l.map((e, t) => `N_{${t}}/N_{${t + 1}} \\cong ${e.label}`).join(",\\;") : "", x = l ? [...l].sort((e, t) => e.order - t.order || e.label.localeCompare(t.label)).map((e) => e.label).join(", ") : "", S = o === "light" ? "#15803d" : "#4ade80", C = o === "light" ? "#0369a1" : "#38bdf8";
|
|
6634
6456
|
return /* @__PURE__ */ f("div", {
|
|
@@ -6655,7 +6477,7 @@ function Cn({ group: e, series: t, color: n, theme: r }) {
|
|
|
6655
6477
|
color: n ?? void 0
|
|
6656
6478
|
},
|
|
6657
6479
|
children: i(`series.${s}`)
|
|
6658
|
-
}), /* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html:
|
|
6480
|
+
}), /* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(v) } })]
|
|
6659
6481
|
}),
|
|
6660
6482
|
/* @__PURE__ */ f("div", {
|
|
6661
6483
|
style: {
|
|
@@ -6667,7 +6489,7 @@ function Cn({ group: e, series: t, color: n, theme: r }) {
|
|
|
6667
6489
|
},
|
|
6668
6490
|
children: /* @__PURE__ */ f("span", {
|
|
6669
6491
|
style: { color: "var(--text-muted)" },
|
|
6670
|
-
dangerouslySetInnerHTML: { __html:
|
|
6492
|
+
dangerouslySetInnerHTML: { __html: Q(y) }
|
|
6671
6493
|
})
|
|
6672
6494
|
}),
|
|
6673
6495
|
l && l.length > 0 && /* @__PURE__ */ f("div", {
|
|
@@ -6678,7 +6500,7 @@ function Cn({ group: e, series: t, color: n, theme: r }) {
|
|
|
6678
6500
|
gap: "4px 14px",
|
|
6679
6501
|
marginTop: 3
|
|
6680
6502
|
},
|
|
6681
|
-
children: /* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html:
|
|
6503
|
+
children: /* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(b) } })
|
|
6682
6504
|
}),
|
|
6683
6505
|
/* @__PURE__ */ p("div", {
|
|
6684
6506
|
style: {
|
|
@@ -6736,13 +6558,13 @@ function Cn({ group: e, series: t, color: n, theme: r }) {
|
|
|
6736
6558
|
})
|
|
6737
6559
|
});
|
|
6738
6560
|
}
|
|
6739
|
-
function
|
|
6740
|
-
let { t: S } =
|
|
6561
|
+
function xn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelDetail: i = "auto", mergeConjugates: a = !1, nodeScale: o = 1, showSeriesPanel: d = !0, series: m = null, centerIds: h, subsets: g, activeNodeIdx: _, onActivateNode: v, noGroupText: y, theme: b, maxEnumerateOrder: x = 60 }) {
|
|
6562
|
+
let { t: S } = Ie(), { theme: C } = $t(), w = b ?? C, T = c(() => _n(w), [w]), D = l(null), [k, A] = u({
|
|
6741
6563
|
width: 0,
|
|
6742
6564
|
height: 0
|
|
6743
6565
|
});
|
|
6744
6566
|
s(() => {
|
|
6745
|
-
let e =
|
|
6567
|
+
let e = D.current;
|
|
6746
6568
|
if (!e) return;
|
|
6747
6569
|
let t = () => {
|
|
6748
6570
|
let t = e.getBoundingClientRect();
|
|
@@ -6755,15 +6577,15 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6755
6577
|
let n = new ResizeObserver(t);
|
|
6756
6578
|
return n.observe(e), () => n.disconnect();
|
|
6757
6579
|
}, [e?.symbol]);
|
|
6758
|
-
let
|
|
6580
|
+
let j = r?.width ?? k.width, N = r?.height ?? k.height, P = n ?? {
|
|
6759
6581
|
x: 0,
|
|
6760
6582
|
y: 0,
|
|
6761
6583
|
scale: 1
|
|
6762
|
-
}, F = c(() => t === void 0 ? !e || e.order > x ? null :
|
|
6584
|
+
}, F = c(() => t === void 0 ? !e || e.order > x ? null : O(e) : t, [
|
|
6763
6585
|
e,
|
|
6764
6586
|
t,
|
|
6765
6587
|
x
|
|
6766
|
-
]), { viewNodes:
|
|
6588
|
+
]), { viewNodes: I, viewEdges: R, mergedOf: ee, mergeUnavailable: te } = c(() => {
|
|
6767
6589
|
if (!F) return {
|
|
6768
6590
|
viewNodes: [],
|
|
6769
6591
|
viewEdges: [],
|
|
@@ -6777,7 +6599,7 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6777
6599
|
mergeUnavailable: !1
|
|
6778
6600
|
};
|
|
6779
6601
|
if (!a || !e) return t;
|
|
6780
|
-
let n =
|
|
6602
|
+
let n = re(e, F.nodes, F.edges);
|
|
6781
6603
|
return n ? {
|
|
6782
6604
|
viewNodes: n.nodes,
|
|
6783
6605
|
viewEdges: n.edges,
|
|
@@ -6791,125 +6613,125 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6791
6613
|
F,
|
|
6792
6614
|
a,
|
|
6793
6615
|
e
|
|
6794
|
-
]),
|
|
6795
|
-
|
|
6616
|
+
]), z = c(() => E(I, R, { nodeScale: o }), [
|
|
6617
|
+
I,
|
|
6796
6618
|
R,
|
|
6797
6619
|
o
|
|
6798
|
-
]), { eff:
|
|
6799
|
-
let e =
|
|
6620
|
+
]), { eff: H, slotScreenWidth: ie, tier: U, edgeWidth: W } = c(() => {
|
|
6621
|
+
let e = ne(j, N, z.viewW, z.viewH), t = e * P.scale, { slotScreenWidth: n, rowScreenHeight: r } = V(z.slotW, z.rowH, e, P.scale), a = i === "auto" ? B(n, r) : i;
|
|
6800
6622
|
return {
|
|
6801
6623
|
fit: e,
|
|
6802
6624
|
eff: t,
|
|
6803
6625
|
slotScreenWidth: n,
|
|
6804
6626
|
rowScreenHeight: r,
|
|
6805
6627
|
tier: a,
|
|
6806
|
-
edgeWidth: a === "full" ?
|
|
6628
|
+
edgeWidth: a === "full" ? T.edgeWidth : gn(1.7, t, z.nodeRx * .1)
|
|
6807
6629
|
};
|
|
6808
6630
|
}, [
|
|
6809
|
-
|
|
6631
|
+
j,
|
|
6810
6632
|
N,
|
|
6811
|
-
|
|
6633
|
+
z,
|
|
6812
6634
|
P.scale,
|
|
6813
6635
|
i,
|
|
6814
|
-
|
|
6636
|
+
T
|
|
6815
6637
|
]), { fullIdx: q, trivialIdx: ae } = c(() => {
|
|
6816
6638
|
let t = e?.order ?? 0;
|
|
6817
6639
|
return {
|
|
6818
|
-
fullIdx:
|
|
6819
|
-
trivialIdx:
|
|
6640
|
+
fullIdx: I.findIndex((e) => e.order === t),
|
|
6641
|
+
trivialIdx: I.findIndex((e) => e.order === 1)
|
|
6820
6642
|
};
|
|
6821
|
-
}, [
|
|
6643
|
+
}, [I, e]), oe = c(() => h ? new Set(h) : !e || e.order > x ? null : new Set(L(e).map((e) => e.id)), [
|
|
6822
6644
|
e,
|
|
6823
6645
|
h,
|
|
6824
6646
|
x
|
|
6825
|
-
]), se = c(() => !oe || oe.size === 0 ? -1 :
|
|
6647
|
+
]), se = c(() => !oe || oe.size === 0 ? -1 : I.findIndex((e) => e.elementIds.length === oe.size ? e.elementIds.every((e) => oe.has(e)) : !1), [I, oe]), ce = c(() => {
|
|
6826
6648
|
let t = /* @__PURE__ */ new Map();
|
|
6827
6649
|
if (!e) return t;
|
|
6828
|
-
for (let { prime: n, exponent: r } of
|
|
6650
|
+
for (let { prime: n, exponent: r } of M(e.order)) {
|
|
6829
6651
|
let e = 1;
|
|
6830
6652
|
for (let t = 0; t < r; t++) e *= n;
|
|
6831
6653
|
t.set(e, n);
|
|
6832
6654
|
}
|
|
6833
6655
|
return t;
|
|
6834
|
-
}, [e]), [
|
|
6835
|
-
if (
|
|
6836
|
-
let e = /* @__PURE__ */ new Set(), t = q >= 0 ?
|
|
6656
|
+
}, [e]), [le, J] = u(null), Y = _ ?? le, [ue, de] = u(null), fe = c(() => vn(I.length, R), [I, R]), pe = c(() => {
|
|
6657
|
+
if (Y === null || I.length === 0) return /* @__PURE__ */ new Set();
|
|
6658
|
+
let e = /* @__PURE__ */ new Set(), t = q >= 0 ? yn(fe, Y, q) : null, n = ae >= 0 ? yn(fe, Y, ae) : null;
|
|
6837
6659
|
return t && t.forEach((t) => e.add(t)), n && n.forEach((t) => e.add(t)), e;
|
|
6838
6660
|
}, [
|
|
6839
|
-
|
|
6840
|
-
|
|
6661
|
+
Y,
|
|
6662
|
+
fe,
|
|
6841
6663
|
q,
|
|
6842
6664
|
ae,
|
|
6843
|
-
|
|
6844
|
-
]),
|
|
6665
|
+
I
|
|
6666
|
+
]), Z = c(() => {
|
|
6845
6667
|
let e = /* @__PURE__ */ new Set();
|
|
6846
|
-
if (
|
|
6668
|
+
if (pe.size === 0) return e;
|
|
6847
6669
|
for (let t = 0; t < R.length; t++) {
|
|
6848
6670
|
let n = R[t];
|
|
6849
|
-
|
|
6671
|
+
pe.has(n.from) && pe.has(n.to) && e.add(t);
|
|
6850
6672
|
}
|
|
6851
6673
|
return e;
|
|
6852
|
-
}, [
|
|
6674
|
+
}, [pe, R]), me = c(() => {
|
|
6853
6675
|
if (!m) return null;
|
|
6854
|
-
let e =
|
|
6676
|
+
let e = fn[m.type];
|
|
6855
6677
|
return w === "light" ? e.light : e.dark;
|
|
6856
6678
|
}, [m, w]), he = c(() => {
|
|
6857
6679
|
let e = /* @__PURE__ */ new Map();
|
|
6858
6680
|
return F && F.nodes.forEach((t, n) => {
|
|
6859
|
-
let r =
|
|
6860
|
-
e.has(r) || e.set(r,
|
|
6681
|
+
let r = G(t.elementIds);
|
|
6682
|
+
e.has(r) || e.set(r, ee ? ee[n] : n);
|
|
6861
6683
|
}), e;
|
|
6862
|
-
}, [F,
|
|
6684
|
+
}, [F, ee]), ge = c(() => {
|
|
6863
6685
|
let e = /* @__PURE__ */ new Map();
|
|
6864
6686
|
return m?.terms && m.terms.forEach((t, n) => {
|
|
6865
|
-
let r = he.get(
|
|
6687
|
+
let r = he.get(G(t.map((e) => e.id)));
|
|
6866
6688
|
r !== void 0 && !e.has(r) && e.set(r, n);
|
|
6867
6689
|
}), e;
|
|
6868
6690
|
}, [m, he]), _e = c(() => new Set(ge.keys()), [ge]), ve = c(() => {
|
|
6869
|
-
let e =
|
|
6691
|
+
let e = U === "compact" ? gn(pn.h / 2, H, z.nodeRy * .9) : U === "dots" ? gn(mn, H, z.nodeRx * .42) : z.nodeRy;
|
|
6870
6692
|
return R.map((t, n) => {
|
|
6871
|
-
let r =
|
|
6693
|
+
let r = z.positions[t.from], i = z.positions[t.to];
|
|
6872
6694
|
if (!r || !i) return null;
|
|
6873
|
-
let a =
|
|
6695
|
+
let a = Z.has(n);
|
|
6874
6696
|
return /* @__PURE__ */ f("line", {
|
|
6875
6697
|
x1: r.x,
|
|
6876
6698
|
y1: r.y + e,
|
|
6877
6699
|
x2: i.x,
|
|
6878
6700
|
y2: i.y - e,
|
|
6879
|
-
stroke: a ?
|
|
6880
|
-
strokeWidth: a ? Math.max(
|
|
6881
|
-
opacity: a ? 1 :
|
|
6701
|
+
stroke: a ? T.pathEdge : T.edge,
|
|
6702
|
+
strokeWidth: a ? Math.max(T.pathEdgeWidth, W) : W,
|
|
6703
|
+
opacity: a ? 1 : U === "dots" ? .75 : T.edgeOpacity
|
|
6882
6704
|
}, `edge-${n}`);
|
|
6883
6705
|
});
|
|
6884
6706
|
}, [
|
|
6885
6707
|
R,
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6708
|
+
z,
|
|
6709
|
+
Z,
|
|
6710
|
+
T,
|
|
6711
|
+
U,
|
|
6889
6712
|
W,
|
|
6890
|
-
|
|
6891
|
-
U
|
|
6713
|
+
H
|
|
6892
6714
|
]), ye = c(() => (g ?? []).map((e) => ({
|
|
6893
6715
|
color: e.color,
|
|
6894
6716
|
set: new Set(e.elementIds)
|
|
6895
|
-
})), [g]), be = c(() =>
|
|
6896
|
-
let r =
|
|
6717
|
+
})), [g]), be = c(() => I.map((t, n) => {
|
|
6718
|
+
let r = z.positions[n];
|
|
6897
6719
|
if (!r) return null;
|
|
6898
|
-
let i = t.orbitSize ?? 1, a =
|
|
6899
|
-
a && !(d !== void 0 &&
|
|
6720
|
+
let i = t.orbitSize ?? 1, a = pe.has(n), o = Y === n, s = t.order === 1, c = t.order === (e?.order ?? 0), l = n === se, u = t.order > 1 ? ce.get(t.order) : void 0, d = ge.get(n), h = !!m?.terms && d === void 0 && !_e.has(n), g = T.nodeFill, _ = t.isNormal ? T.nodeStrokeNormal : T.nodeStroke, y = 2.5, b = T.nodeText;
|
|
6721
|
+
a && !(d !== void 0 && me) && (g = T.pathFill, _ = T.pathStroke, y = 4, b = T.pathText), o && (g = T.activeFill, y = 4), l && !a && (g = T.centerFill, _ = T.centerStroke), s && !a && (g = T.trivialFill, _ = T.trivialStroke, y = 2), c && !a && (g = T.fullFill, _ = T.fullStroke), d !== void 0 && me && (_ = me, y = U === "full" ? 4 : Math.max(gn(3, H, z.nodeRx * .1), W));
|
|
6900
6722
|
let x = ye.find((e) => t.elementIds.every((t) => e.set.has(t))), C = {
|
|
6901
6723
|
onMouseDown: (e) => e.stopPropagation(),
|
|
6902
6724
|
onClick: (e) => {
|
|
6903
|
-
e.stopPropagation(),
|
|
6725
|
+
e.stopPropagation(), Y === n ? (J(null), v?.(null, null)) : (J(n), v?.(n, t));
|
|
6904
6726
|
},
|
|
6905
|
-
onMouseEnter: () =>
|
|
6906
|
-
onMouseLeave: () =>
|
|
6727
|
+
onMouseEnter: () => de(n),
|
|
6728
|
+
onMouseLeave: () => de((e) => e === n ? null : e)
|
|
6907
6729
|
}, w = {
|
|
6908
6730
|
cursor: "pointer",
|
|
6909
6731
|
opacity: h ? .22 : 1
|
|
6910
6732
|
};
|
|
6911
|
-
if (
|
|
6912
|
-
let e =
|
|
6733
|
+
if (U === "dots") {
|
|
6734
|
+
let e = gn(mn, H, z.nodeRx * .42), m = d !== void 0 && me ? me : l ? T.centerStroke : u === void 0 ? c ? T.fullStroke : s ? T.trivialStroke : t.isNormal ? T.nodeStrokeNormal : T.dotPlain : T.sylowText;
|
|
6913
6735
|
return /* @__PURE__ */ p("g", {
|
|
6914
6736
|
transform: `translate(${r.x}, ${r.y})`,
|
|
6915
6737
|
style: w,
|
|
@@ -6919,7 +6741,7 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6919
6741
|
/* @__PURE__ */ f("circle", {
|
|
6920
6742
|
cx: 0,
|
|
6921
6743
|
cy: 0,
|
|
6922
|
-
r:
|
|
6744
|
+
r: gn(14, H, z.nodeRx),
|
|
6923
6745
|
fill: "transparent",
|
|
6924
6746
|
stroke: "none"
|
|
6925
6747
|
}),
|
|
@@ -6927,16 +6749,16 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6927
6749
|
cx: 0,
|
|
6928
6750
|
cy: 0,
|
|
6929
6751
|
r: e,
|
|
6930
|
-
fill: a ?
|
|
6931
|
-
stroke: a ?
|
|
6932
|
-
strokeWidth: a || o ?
|
|
6752
|
+
fill: a ? T.pathFill : m,
|
|
6753
|
+
stroke: a ? T.pathStroke : m,
|
|
6754
|
+
strokeWidth: a || o ? gn(2.5, H, e) : 0
|
|
6933
6755
|
}),
|
|
6934
6756
|
i > 1 && /* @__PURE__ */ p("text", {
|
|
6935
|
-
x: e +
|
|
6936
|
-
y:
|
|
6757
|
+
x: e + gn(3, H, z.nodeRx * .2),
|
|
6758
|
+
y: gn(-3, H, z.nodeRy * .5),
|
|
6937
6759
|
textAnchor: "start",
|
|
6938
|
-
fill:
|
|
6939
|
-
fontSize:
|
|
6760
|
+
fill: T.nodeSubText,
|
|
6761
|
+
fontSize: gn(hn, H, z.nodeRx * .6),
|
|
6940
6762
|
fontFamily: "monospace",
|
|
6941
6763
|
style: {
|
|
6942
6764
|
pointerEvents: "none",
|
|
@@ -6947,8 +6769,8 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6947
6769
|
]
|
|
6948
6770
|
}, t.id);
|
|
6949
6771
|
}
|
|
6950
|
-
if (
|
|
6951
|
-
let u =
|
|
6772
|
+
if (U === "compact") {
|
|
6773
|
+
let u = gn(pn.w / 2, H, z.nodeRx * .94), m = gn(pn.h / 2, H, z.nodeRy * .9), h = gn(pn.font, H, z.nodeRx * .5);
|
|
6952
6774
|
return /* @__PURE__ */ p("g", {
|
|
6953
6775
|
transform: `translate(${r.x}, ${r.y})`,
|
|
6954
6776
|
style: w,
|
|
@@ -6993,7 +6815,7 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
6993
6815
|
x: u - h * .35,
|
|
6994
6816
|
y: h * .36,
|
|
6995
6817
|
textAnchor: "end",
|
|
6996
|
-
fill:
|
|
6818
|
+
fill: T.nodeSubText,
|
|
6997
6819
|
fontSize: h * .85,
|
|
6998
6820
|
fontFamily: "monospace",
|
|
6999
6821
|
style: {
|
|
@@ -7021,14 +6843,14 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7021
6843
|
color: b,
|
|
7022
6844
|
fontSize: h
|
|
7023
6845
|
},
|
|
7024
|
-
dangerouslySetInnerHTML: { __html:
|
|
6846
|
+
dangerouslySetInnerHTML: { __html: Q(X(e.symbol)) }
|
|
7025
6847
|
})
|
|
7026
6848
|
}),
|
|
7027
|
-
d !== void 0 &&
|
|
6849
|
+
d !== void 0 && me && /* @__PURE__ */ f("circle", {
|
|
7028
6850
|
cx: -u + m * .55,
|
|
7029
6851
|
cy: 0,
|
|
7030
6852
|
r: m * .3,
|
|
7031
|
-
fill:
|
|
6853
|
+
fill: me,
|
|
7032
6854
|
stroke: "none",
|
|
7033
6855
|
style: { pointerEvents: "none" }
|
|
7034
6856
|
}),
|
|
@@ -7036,14 +6858,14 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7036
6858
|
cx: u - m * .55,
|
|
7037
6859
|
cy: 0,
|
|
7038
6860
|
r: m * .3,
|
|
7039
|
-
fill:
|
|
6861
|
+
fill: T.centerStroke,
|
|
7040
6862
|
stroke: "none",
|
|
7041
6863
|
style: { pointerEvents: "none" }
|
|
7042
6864
|
})
|
|
7043
6865
|
]
|
|
7044
6866
|
}, t.id);
|
|
7045
6867
|
}
|
|
7046
|
-
let
|
|
6868
|
+
let E = z.nodeRx, D = z.nodeRy;
|
|
7047
6869
|
return /* @__PURE__ */ p("g", {
|
|
7048
6870
|
transform: `translate(${r.x}, ${r.y})`,
|
|
7049
6871
|
style: w,
|
|
@@ -7051,9 +6873,9 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7051
6873
|
...C,
|
|
7052
6874
|
children: [
|
|
7053
6875
|
/* @__PURE__ */ f("rect", {
|
|
7054
|
-
x: -
|
|
6876
|
+
x: -E,
|
|
7055
6877
|
y: -D,
|
|
7056
|
-
width:
|
|
6878
|
+
width: E * 2,
|
|
7057
6879
|
height: D * 2,
|
|
7058
6880
|
rx: 12,
|
|
7059
6881
|
ry: 12,
|
|
@@ -7062,9 +6884,9 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7062
6884
|
strokeWidth: y
|
|
7063
6885
|
}),
|
|
7064
6886
|
x && !a && /* @__PURE__ */ f("rect", {
|
|
7065
|
-
x: -
|
|
6887
|
+
x: -E,
|
|
7066
6888
|
y: -D,
|
|
7067
|
-
width:
|
|
6889
|
+
width: E * 2,
|
|
7068
6890
|
height: D * 2,
|
|
7069
6891
|
rx: 12,
|
|
7070
6892
|
ry: 12,
|
|
@@ -7085,10 +6907,10 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7085
6907
|
children: s ? "⟨e⟩" : c ? "" : i > 1 ? `|H|=${t.order} ×${i}` : `|H|=${t.order}`
|
|
7086
6908
|
}),
|
|
7087
6909
|
l && /* @__PURE__ */ f("text", {
|
|
7088
|
-
x:
|
|
6910
|
+
x: E - 6,
|
|
7089
6911
|
y: -D + 12,
|
|
7090
6912
|
textAnchor: "end",
|
|
7091
|
-
fill:
|
|
6913
|
+
fill: T.centerStroke,
|
|
7092
6914
|
fontSize: 10,
|
|
7093
6915
|
fontWeight: "bold",
|
|
7094
6916
|
fontFamily: "monospace",
|
|
@@ -7099,10 +6921,10 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7099
6921
|
children: "Z(G)"
|
|
7100
6922
|
}),
|
|
7101
6923
|
u !== void 0 && /* @__PURE__ */ f("text", {
|
|
7102
|
-
x: -
|
|
6924
|
+
x: -E + 6,
|
|
7103
6925
|
y: -D + 12,
|
|
7104
6926
|
textAnchor: "start",
|
|
7105
|
-
fill:
|
|
6927
|
+
fill: T.sylowText,
|
|
7106
6928
|
fontSize: 10,
|
|
7107
6929
|
fontWeight: "bold",
|
|
7108
6930
|
fontFamily: "monospace",
|
|
@@ -7112,29 +6934,29 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7112
6934
|
},
|
|
7113
6935
|
children: S("lattice.sylow", { p: String(u) })
|
|
7114
6936
|
}),
|
|
7115
|
-
d !== void 0 &&
|
|
6937
|
+
d !== void 0 && me && /* @__PURE__ */ p("g", {
|
|
7116
6938
|
style: { pointerEvents: "none" },
|
|
7117
6939
|
children: [/* @__PURE__ */ f("circle", {
|
|
7118
|
-
cx: -
|
|
6940
|
+
cx: -E + 12,
|
|
7119
6941
|
cy: D - 12,
|
|
7120
6942
|
r: 9,
|
|
7121
|
-
fill:
|
|
6943
|
+
fill: me,
|
|
7122
6944
|
stroke: "none"
|
|
7123
6945
|
}), /* @__PURE__ */ f("text", {
|
|
7124
|
-
x: -
|
|
6946
|
+
x: -E + 12,
|
|
7125
6947
|
y: D - 8,
|
|
7126
6948
|
textAnchor: "middle",
|
|
7127
6949
|
fontSize: "10",
|
|
7128
6950
|
fontWeight: "bold",
|
|
7129
|
-
fill:
|
|
6951
|
+
fill: T.seriesBadgeText,
|
|
7130
6952
|
fontFamily: "monospace",
|
|
7131
6953
|
children: d
|
|
7132
6954
|
})]
|
|
7133
6955
|
}),
|
|
7134
6956
|
c && e && /* @__PURE__ */ f("foreignObject", {
|
|
7135
|
-
x: -
|
|
6957
|
+
x: -E + 6,
|
|
7136
6958
|
y: -D + 2,
|
|
7137
|
-
width:
|
|
6959
|
+
width: E * 2 - 12,
|
|
7138
6960
|
height: D * 2 - 4,
|
|
7139
6961
|
style: {
|
|
7140
6962
|
pointerEvents: "none",
|
|
@@ -7150,13 +6972,13 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7150
6972
|
color: b,
|
|
7151
6973
|
fontSize: "15px"
|
|
7152
6974
|
},
|
|
7153
|
-
dangerouslySetInnerHTML: { __html:
|
|
6975
|
+
dangerouslySetInnerHTML: { __html: Q(X(e.symbol)) }
|
|
7154
6976
|
})
|
|
7155
6977
|
}),
|
|
7156
6978
|
/* @__PURE__ */ f("text", {
|
|
7157
6979
|
y: 13,
|
|
7158
6980
|
textAnchor: "middle",
|
|
7159
|
-
fill: a ?
|
|
6981
|
+
fill: a ? T.pathSubText : t.isNormal ? T.nodeStrokeNormal : T.nodeSubText,
|
|
7160
6982
|
fontSize: "11px",
|
|
7161
6983
|
fontFamily: "monospace",
|
|
7162
6984
|
style: {
|
|
@@ -7168,29 +6990,29 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7168
6990
|
]
|
|
7169
6991
|
}, t.id);
|
|
7170
6992
|
}), [
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
6993
|
+
I,
|
|
6994
|
+
z,
|
|
6995
|
+
pe,
|
|
6996
|
+
Y,
|
|
7175
6997
|
e,
|
|
7176
6998
|
se,
|
|
7177
6999
|
ce,
|
|
7178
7000
|
ge,
|
|
7179
7001
|
m,
|
|
7180
7002
|
_e,
|
|
7181
|
-
|
|
7182
|
-
|
|
7003
|
+
me,
|
|
7004
|
+
T,
|
|
7183
7005
|
ye,
|
|
7184
7006
|
S,
|
|
7185
|
-
W,
|
|
7186
7007
|
U,
|
|
7187
|
-
|
|
7008
|
+
H,
|
|
7009
|
+
W,
|
|
7188
7010
|
v
|
|
7189
7011
|
]), xe = c(() => {
|
|
7190
|
-
if (!
|
|
7012
|
+
if (!me) return null;
|
|
7191
7013
|
let e = [...ge.entries()].sort((e, t) => e[1] - t[1]), t = [];
|
|
7192
7014
|
for (let n = 0; n + 1 < e.length; n++) {
|
|
7193
|
-
let r =
|
|
7015
|
+
let r = z.positions[e[n][0]], i = z.positions[e[n + 1][0]];
|
|
7194
7016
|
r && i && t.push({
|
|
7195
7017
|
from: r,
|
|
7196
7018
|
to: i
|
|
@@ -7198,39 +7020,39 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7198
7020
|
}
|
|
7199
7021
|
return t;
|
|
7200
7022
|
}, [
|
|
7201
|
-
|
|
7023
|
+
me,
|
|
7202
7024
|
ge,
|
|
7203
|
-
|
|
7204
|
-
]), Se =
|
|
7025
|
+
z
|
|
7026
|
+
]), Se = ue ?? Y, Ce = Se === null ? null : I[Se] ?? null, we = c(() => !e || !Ce || Ce.order === e.order ? null : K(e, Ce.elementIds), [e, Ce]), Te = Ce, Ee = Se === null ? void 0 : ge.get(Se), De = c(() => {
|
|
7205
7027
|
if (!e || !Ce || Se === null) return null;
|
|
7206
|
-
let t =
|
|
7028
|
+
let t = z.positions[Se];
|
|
7207
7029
|
if (!t) return null;
|
|
7208
|
-
let n =
|
|
7209
|
-
c.push(/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html:
|
|
7210
|
-
style: { color:
|
|
7030
|
+
let n = z.nodeRy, r = 12 / H, i = 6 / H, a = 280 / H, o = 18 / H, s = 8 / H, c = [];
|
|
7031
|
+
c.push(/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(`|H| = ${Ce.order}`) } }, "order")), we && c.push(/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(`\\cong ${we}`) } }, "sym")), Ce.isNormal && Ce.order !== e.order && c.push(/* @__PURE__ */ f("span", {
|
|
7032
|
+
style: { color: T.nodeStrokeNormal },
|
|
7211
7033
|
children: `◁ ${S("badge.normal")}`
|
|
7212
|
-
}, "normal")), c.push(/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html:
|
|
7034
|
+
}, "normal")), c.push(/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(`[G:H] = ${Math.round(e.order / Ce.order)}`) } }, "idx")), (Te?.orbitSize ?? 1) > 1 && c.push(/* @__PURE__ */ p("span", {
|
|
7213
7035
|
style: { color: "var(--text-muted)" },
|
|
7214
7036
|
children: [
|
|
7215
7037
|
S("lattice.orbitMembers", { n: String(Te.orbitSize) }),
|
|
7216
7038
|
" · ",
|
|
7217
|
-
/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html:
|
|
7039
|
+
/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(`|N_G(H)| = ${Te.normalizerOrder}`) } })
|
|
7218
7040
|
]
|
|
7219
|
-
}, "orbit")), Ce.label && Ce.label !== `${Ce.order}` && c.push(/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html:
|
|
7220
|
-
style: { color:
|
|
7041
|
+
}, "orbit")), Ce.label && Ce.label !== `${Ce.order}` && c.push(/* @__PURE__ */ f("span", { dangerouslySetInnerHTML: { __html: Q(X(Ce.label)) } }, "label")), Ee !== void 0 && m && c.push(/* @__PURE__ */ f("span", {
|
|
7042
|
+
style: { color: me ?? void 0 },
|
|
7221
7043
|
children: `N_${Ee} · ${S(`series.${m.type}`)}`
|
|
7222
7044
|
}, "term"));
|
|
7223
7045
|
let l = o * c.length + i * 2, u = t.y - n - s - l, d = t.y + n + s, h = u, g = "down";
|
|
7224
|
-
(u < 0 || d + l >
|
|
7225
|
-
let _ = t.x - a / 2, v = Math.min(Math.max(_, 0), Math.max(
|
|
7046
|
+
(u < 0 || d + l > z.viewH) && (u >= z.viewH - (d + l) ? (h = Math.max(u, 0), g = "down") : (h = Math.min(d, z.viewH - l), g = "up"));
|
|
7047
|
+
let _ = t.x - a / 2, v = Math.min(Math.max(_, 0), Math.max(z.viewW - a, 0)), y = Math.min(Math.max(t.x, v + r), v + a - r), b = g === "down" ? h + l : h, x = g === "down" ? h : h + l;
|
|
7226
7048
|
return /* @__PURE__ */ p("g", {
|
|
7227
7049
|
style: { pointerEvents: "none" },
|
|
7228
7050
|
"data-testid": "lattice-bubble",
|
|
7229
7051
|
children: [/* @__PURE__ */ f("polygon", {
|
|
7230
|
-
points: `${y - 6 /
|
|
7052
|
+
points: `${y - 6 / H},${x} ${y + 6 / H},${x} ${y},${b}`,
|
|
7231
7053
|
fill: "var(--bg-panel)",
|
|
7232
7054
|
stroke: "var(--border-primary)",
|
|
7233
|
-
strokeWidth: 1 /
|
|
7055
|
+
strokeWidth: 1 / H
|
|
7234
7056
|
}), /* @__PURE__ */ f("foreignObject", {
|
|
7235
7057
|
x: v,
|
|
7236
7058
|
y: h,
|
|
@@ -7243,21 +7065,21 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7243
7065
|
height: "100%",
|
|
7244
7066
|
padding: `${i}px ${r}px`,
|
|
7245
7067
|
border: "1px solid var(--border-primary)",
|
|
7246
|
-
borderRadius: `${6 /
|
|
7068
|
+
borderRadius: `${6 / H}px`,
|
|
7247
7069
|
background: "var(--bg-panel)",
|
|
7248
7070
|
color: "var(--text-primary)",
|
|
7249
|
-
fontSize: `${13 /
|
|
7071
|
+
fontSize: `${13 / H}px`,
|
|
7250
7072
|
lineHeight: 1.4,
|
|
7251
7073
|
boxShadow: "0 2px 8px rgba(0,0,0,0.25)",
|
|
7252
7074
|
display: "flex",
|
|
7253
7075
|
flexDirection: "column",
|
|
7254
|
-
gap: `${2 /
|
|
7076
|
+
gap: `${2 / H}px`
|
|
7255
7077
|
},
|
|
7256
7078
|
children: c.map((e, t) => /* @__PURE__ */ f("span", {
|
|
7257
7079
|
style: {
|
|
7258
7080
|
display: "inline-flex",
|
|
7259
7081
|
alignItems: "center",
|
|
7260
|
-
gap: `${8 /
|
|
7082
|
+
gap: `${8 / H}px`
|
|
7261
7083
|
},
|
|
7262
7084
|
children: e
|
|
7263
7085
|
}, t))
|
|
@@ -7270,21 +7092,21 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7270
7092
|
Te,
|
|
7271
7093
|
Ee,
|
|
7272
7094
|
we,
|
|
7095
|
+
z,
|
|
7273
7096
|
H,
|
|
7274
|
-
U,
|
|
7275
7097
|
e,
|
|
7276
7098
|
m,
|
|
7277
|
-
|
|
7099
|
+
me,
|
|
7278
7100
|
S,
|
|
7279
|
-
|
|
7101
|
+
T.nodeStrokeNormal
|
|
7280
7102
|
]);
|
|
7281
|
-
return !e || !F ||
|
|
7103
|
+
return !e || !F || I.length === 0 ? /* @__PURE__ */ f("div", {
|
|
7282
7104
|
className: "view-empty",
|
|
7283
7105
|
children: /* @__PURE__ */ f("p", { children: y ?? S(e ? "lattice.backendOnly" : "canvas.noGroup") })
|
|
7284
7106
|
}) : /* @__PURE__ */ p("div", {
|
|
7285
7107
|
className: "sublattice-view-wrap",
|
|
7286
|
-
"data-lattice-tier":
|
|
7287
|
-
"data-lattice-slot-width": Math.round(
|
|
7108
|
+
"data-lattice-tier": U,
|
|
7109
|
+
"data-lattice-slot-width": Math.round(ie),
|
|
7288
7110
|
style: {
|
|
7289
7111
|
height: "100%",
|
|
7290
7112
|
display: "flex",
|
|
@@ -7298,8 +7120,8 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7298
7120
|
position: "relative"
|
|
7299
7121
|
},
|
|
7300
7122
|
children: /* @__PURE__ */ f("svg", {
|
|
7301
|
-
ref:
|
|
7302
|
-
viewBox: `0 0 ${
|
|
7123
|
+
ref: D,
|
|
7124
|
+
viewBox: `0 0 ${z.viewW} ${z.viewH}`,
|
|
7303
7125
|
className: "view-svg",
|
|
7304
7126
|
style: {
|
|
7305
7127
|
position: "absolute",
|
|
@@ -7318,8 +7140,8 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7318
7140
|
y1: e.from.y,
|
|
7319
7141
|
x2: e.to.x,
|
|
7320
7142
|
y2: e.to.y,
|
|
7321
|
-
stroke:
|
|
7322
|
-
strokeWidth:
|
|
7143
|
+
stroke: me,
|
|
7144
|
+
strokeWidth: U === "full" ? 4 : Math.max(gn(4, H, z.nodeRx * .1), W),
|
|
7323
7145
|
strokeLinecap: "round",
|
|
7324
7146
|
opacity: .85
|
|
7325
7147
|
}, `series-line-${t}`)),
|
|
@@ -7329,7 +7151,7 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7329
7151
|
})
|
|
7330
7152
|
})
|
|
7331
7153
|
}),
|
|
7332
|
-
|
|
7154
|
+
te && /* @__PURE__ */ f("div", {
|
|
7333
7155
|
"data-testid": "lattice-merge-hint",
|
|
7334
7156
|
style: {
|
|
7335
7157
|
padding: "2px 10px",
|
|
@@ -7339,10 +7161,10 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7339
7161
|
},
|
|
7340
7162
|
children: S("lattice.mergeTooLarge")
|
|
7341
7163
|
}),
|
|
7342
|
-
d && m && /* @__PURE__ */ f(
|
|
7164
|
+
d && m && /* @__PURE__ */ f(bn, {
|
|
7343
7165
|
group: e,
|
|
7344
7166
|
series: m,
|
|
7345
|
-
color:
|
|
7167
|
+
color: me,
|
|
7346
7168
|
theme: w
|
|
7347
7169
|
})
|
|
7348
7170
|
]
|
|
@@ -7350,19 +7172,19 @@ function wn({ group: e, lattice: t, canvasTransform: n, availableSize: r, labelD
|
|
|
7350
7172
|
}
|
|
7351
7173
|
//#endregion
|
|
7352
7174
|
//#region src/components/Canvas/SceneWindow.tsx
|
|
7353
|
-
var
|
|
7175
|
+
var Sn = 32, Cn = 220, wn = 160, Tn = 208, En = 8, Dn = 5e3, On = {
|
|
7354
7176
|
x: 12,
|
|
7355
7177
|
y: 12
|
|
7356
|
-
},
|
|
7178
|
+
}, kn = {
|
|
7357
7179
|
width: 440,
|
|
7358
7180
|
height: 320
|
|
7359
|
-
},
|
|
7181
|
+
}, An = {
|
|
7360
7182
|
locked: !1,
|
|
7361
7183
|
showInfo: !1,
|
|
7362
7184
|
resizable: !0,
|
|
7363
7185
|
viewportFixed: !1,
|
|
7364
7186
|
showControls: !0
|
|
7365
|
-
},
|
|
7187
|
+
}, jn = {
|
|
7366
7188
|
n: "ns-resize",
|
|
7367
7189
|
s: "ns-resize",
|
|
7368
7190
|
e: "ew-resize",
|
|
@@ -7371,7 +7193,7 @@ var Tn = 32, En = 220, Dn = 160, On = 208, kn = 8, An = 5e3, jn = {
|
|
|
7371
7193
|
sw: "nesw-resize",
|
|
7372
7194
|
nw: "nwse-resize",
|
|
7373
7195
|
se: "nwse-resize"
|
|
7374
|
-
},
|
|
7196
|
+
}, Mn = [
|
|
7375
7197
|
"n",
|
|
7376
7198
|
"s",
|
|
7377
7199
|
"e",
|
|
@@ -7380,7 +7202,7 @@ var Tn = 32, En = 220, Dn = 160, On = 208, kn = 8, An = 5e3, jn = {
|
|
|
7380
7202
|
"nw",
|
|
7381
7203
|
"se",
|
|
7382
7204
|
"sw"
|
|
7383
|
-
],
|
|
7205
|
+
], Nn = {
|
|
7384
7206
|
dark: {
|
|
7385
7207
|
tbarBg: "#131c2b",
|
|
7386
7208
|
tbarBorder: "#24324a",
|
|
@@ -7404,7 +7226,7 @@ var Tn = 32, En = 220, Dn = 160, On = 208, kn = 8, An = 5e3, jn = {
|
|
|
7404
7226
|
accent: "#0e7490"
|
|
7405
7227
|
}
|
|
7406
7228
|
};
|
|
7407
|
-
function
|
|
7229
|
+
function Pn(e, t) {
|
|
7408
7230
|
try {
|
|
7409
7231
|
let n = localStorage.getItem(`gv-sw-${e}`);
|
|
7410
7232
|
return n ? t(JSON.parse(n)) : null;
|
|
@@ -7412,19 +7234,19 @@ function Ln(e, t) {
|
|
|
7412
7234
|
return null;
|
|
7413
7235
|
}
|
|
7414
7236
|
}
|
|
7415
|
-
function
|
|
7237
|
+
function Fn(e, t) {
|
|
7416
7238
|
try {
|
|
7417
7239
|
localStorage.setItem(`gv-sw-${e}`, JSON.stringify(t));
|
|
7418
7240
|
} catch {}
|
|
7419
7241
|
}
|
|
7420
|
-
function
|
|
7242
|
+
function In(e, t) {
|
|
7421
7243
|
return t ? {
|
|
7422
7244
|
...e,
|
|
7423
7245
|
...t
|
|
7424
7246
|
} : e;
|
|
7425
7247
|
}
|
|
7426
|
-
function
|
|
7427
|
-
return !e || !t ? null :
|
|
7248
|
+
function Ln(e, t = !0) {
|
|
7249
|
+
return !e || !t ? null : Pn(e, (e) => {
|
|
7428
7250
|
let t = e.pos, n = e.size, r = e.config;
|
|
7429
7251
|
return {
|
|
7430
7252
|
pos: t && typeof t.x == "number" && typeof t.y == "number" ? {
|
|
@@ -7432,35 +7254,35 @@ function Bn(e, t = !0) {
|
|
|
7432
7254
|
y: t.y
|
|
7433
7255
|
} : void 0,
|
|
7434
7256
|
size: n && typeof n.width == "number" && typeof n.height == "number" ? {
|
|
7435
|
-
width: Math.max(
|
|
7436
|
-
height: Math.max(
|
|
7257
|
+
width: Math.max(Cn, n.width),
|
|
7258
|
+
height: Math.max(wn, n.height)
|
|
7437
7259
|
} : void 0,
|
|
7438
7260
|
cfg: r && typeof r == "object" ? r : void 0
|
|
7439
7261
|
};
|
|
7440
7262
|
});
|
|
7441
7263
|
}
|
|
7442
|
-
var
|
|
7443
|
-
function
|
|
7444
|
-
let _ =
|
|
7264
|
+
var Rn = {};
|
|
7265
|
+
function zn({ title: e, group: t, theme: n = "dark", shell: i = "chrome", capabilities: o, config: s, onConfigChange: c, storageKey: l, defaultPosition: d, defaultSize: m, onClose: h, children: g }) {
|
|
7266
|
+
let _ = Nn[n], v = !!l && o?.persist !== !1, [y, b] = u(() => {
|
|
7445
7267
|
let e = {
|
|
7446
|
-
...
|
|
7447
|
-
...s ??
|
|
7448
|
-
}, t =
|
|
7449
|
-
return t?.cfg ?
|
|
7268
|
+
...An,
|
|
7269
|
+
...s ?? Rn
|
|
7270
|
+
}, t = Ln(l, v);
|
|
7271
|
+
return t?.cfg ? In(e, t.cfg) : e;
|
|
7450
7272
|
}), x = r((e) => {
|
|
7451
7273
|
b((t) => {
|
|
7452
|
-
let n =
|
|
7274
|
+
let n = In(t, e);
|
|
7453
7275
|
return c?.(n), n;
|
|
7454
7276
|
});
|
|
7455
7277
|
}, [c]), [S, C] = u(() => {
|
|
7456
|
-
let e =
|
|
7278
|
+
let e = Ln(l, v);
|
|
7457
7279
|
return {
|
|
7458
|
-
pos: e?.pos ?? d ??
|
|
7459
|
-
size: e?.size ?? m ??
|
|
7280
|
+
pos: e?.pos ?? d ?? On,
|
|
7281
|
+
size: e?.size ?? m ?? kn
|
|
7460
7282
|
};
|
|
7461
7283
|
}), { pos: w, size: T } = S;
|
|
7462
7284
|
a(() => {
|
|
7463
|
-
v &&
|
|
7285
|
+
v && Fn(l, {
|
|
7464
7286
|
pos: w,
|
|
7465
7287
|
size: T,
|
|
7466
7288
|
config: y
|
|
@@ -7472,7 +7294,7 @@ function Hn({ title: e, group: t, theme: n = "dark", shell: i = "chrome", capabi
|
|
|
7472
7294
|
l,
|
|
7473
7295
|
v
|
|
7474
7296
|
]);
|
|
7475
|
-
let [E, D] = u(() => ++
|
|
7297
|
+
let [E, D] = u(() => ++Dn), O = r(() => D(++Dn), []), [k, A] = u(!1), j = r((e) => {
|
|
7476
7298
|
if (y.locked || e.target.closest("button")) return;
|
|
7477
7299
|
e.preventDefault(), O();
|
|
7478
7300
|
let t = {
|
|
@@ -7512,7 +7334,7 @@ function Hn({ title: e, group: t, theme: n = "dark", shell: i = "chrome", capabi
|
|
|
7512
7334
|
width: n.ow,
|
|
7513
7335
|
height: n.oh
|
|
7514
7336
|
};
|
|
7515
|
-
e.includes("e") && (s = Math.max(
|
|
7337
|
+
e.includes("e") && (s = Math.max(Cn, n.ow + r)), e.includes("s") && (c = Math.max(wn, n.oh + i)), e.includes("w") && (s = Math.max(Cn, n.ow - r), a = n.ox + (n.ow - s)), e.includes("n") && (c = Math.max(wn, n.oh - i), o = n.oy + (n.oh - c)), C({
|
|
7516
7338
|
pos: {
|
|
7517
7339
|
x: a,
|
|
7518
7340
|
y: o
|
|
@@ -7552,7 +7374,7 @@ function Hn({ title: e, group: t, theme: n = "dark", shell: i = "chrome", capabi
|
|
|
7552
7374
|
params: !0,
|
|
7553
7375
|
close: !0,
|
|
7554
7376
|
persist: !0,
|
|
7555
|
-
...o ??
|
|
7377
|
+
...o ?? Rn
|
|
7556
7378
|
}, P = y.showControls !== !1, F = e ?? (t ? t.symbol : "View"), I = y.showInfo && t ? `${t.symbol} · |G|=${t.order} · ${t.name ?? ""}` : "", L = {
|
|
7557
7379
|
background: "none",
|
|
7558
7380
|
border: "none",
|
|
@@ -7590,7 +7412,7 @@ function Hn({ title: e, group: t, theme: n = "dark", shell: i = "chrome", capabi
|
|
|
7590
7412
|
alignItems: "center",
|
|
7591
7413
|
justifyContent: "space-between",
|
|
7592
7414
|
padding: "0 6px 0 10px",
|
|
7593
|
-
height:
|
|
7415
|
+
height: Sn,
|
|
7594
7416
|
background: _.tbarBg,
|
|
7595
7417
|
borderBottom: `1px solid ${_.tbarBorder}`,
|
|
7596
7418
|
cursor: N.drag && !y.locked ? "grab" : "default",
|
|
@@ -7657,15 +7479,15 @@ function Hn({ title: e, group: t, theme: n = "dark", shell: i = "chrome", capabi
|
|
|
7657
7479
|
}), /* @__PURE__ */ p("div", {
|
|
7658
7480
|
style: {
|
|
7659
7481
|
position: "relative",
|
|
7660
|
-
height: T.height - (N.titlebar && P ?
|
|
7482
|
+
height: T.height - (N.titlebar && P ? Sn : 0),
|
|
7661
7483
|
overflow: "hidden",
|
|
7662
7484
|
background: _.contentBg
|
|
7663
7485
|
},
|
|
7664
|
-
children: [g, N.resize && y.resizable !== !1 &&
|
|
7486
|
+
children: [g, N.resize && y.resizable !== !1 && Mn.map((e) => {
|
|
7665
7487
|
let t = {
|
|
7666
7488
|
position: "absolute",
|
|
7667
7489
|
zIndex: 10,
|
|
7668
|
-
cursor:
|
|
7490
|
+
cursor: jn[e],
|
|
7669
7491
|
background: "transparent"
|
|
7670
7492
|
}, n = (() => {
|
|
7671
7493
|
switch (e) {
|
|
@@ -7731,9 +7553,9 @@ function Hn({ title: e, group: t, theme: n = "dark", shell: i = "chrome", capabi
|
|
|
7731
7553
|
}), k && N.params && /* @__PURE__ */ p("div", {
|
|
7732
7554
|
style: {
|
|
7733
7555
|
position: y.viewportFixed ? "fixed" : "absolute",
|
|
7734
|
-
left: T.width +
|
|
7556
|
+
left: T.width + En,
|
|
7735
7557
|
top: 0,
|
|
7736
|
-
width:
|
|
7558
|
+
width: Tn,
|
|
7737
7559
|
maxHeight: T.height,
|
|
7738
7560
|
overflowY: "auto",
|
|
7739
7561
|
zIndex: E + 1,
|
|
@@ -7839,9 +7661,9 @@ function Hn({ title: e, group: t, theme: n = "dark", shell: i = "chrome", capabi
|
|
|
7839
7661
|
}
|
|
7840
7662
|
//#endregion
|
|
7841
7663
|
//#region src/components/Canvas/SceneHoverBubble.tsx
|
|
7842
|
-
function
|
|
7664
|
+
function Bn({ element: e, anchor: t, theme: n = "dark", group: r, offset: i }) {
|
|
7843
7665
|
if (!e || !t) return null;
|
|
7844
|
-
let a = i?.x ?? 0, o = i?.y ?? -14, s = r ?
|
|
7666
|
+
let a = i?.x ?? 0, o = i?.y ?? -14, s = r ? j(r, e) : null;
|
|
7845
7667
|
return /* @__PURE__ */ f("div", {
|
|
7846
7668
|
"data-theme": n,
|
|
7847
7669
|
style: {
|
|
@@ -7887,18 +7709,18 @@ function Un({ element: e, anchor: t, theme: n = "dark", group: r, offset: i }) {
|
|
|
7887
7709
|
}
|
|
7888
7710
|
//#endregion
|
|
7889
7711
|
//#region src/hooks/useSceneState.ts
|
|
7890
|
-
var
|
|
7712
|
+
var Vn = {
|
|
7891
7713
|
x: 0,
|
|
7892
7714
|
y: 0,
|
|
7893
7715
|
scale: 1
|
|
7894
|
-
},
|
|
7716
|
+
}, Hn = {
|
|
7895
7717
|
width: 800,
|
|
7896
7718
|
height: 600
|
|
7897
|
-
},
|
|
7898
|
-
function
|
|
7899
|
-
let { initialTransform: i, locked: o = !1, enableZoom: s = !0, enablePan: d = !0, minScale: f =
|
|
7719
|
+
}, Un = .25, Wn = 8;
|
|
7720
|
+
function Gn(e, n = {}) {
|
|
7721
|
+
let { initialTransform: i, locked: o = !1, enableZoom: s = !0, enablePan: d = !0, minScale: f = Un, maxScale: p = Wn, selectedElements: m, onSelectionChange: h, fallbackViewBoxSize: g, hostStyle: _, theme: v = "dark", renderHoverBubble: y } = n, b = l(null), x = r((e) => {
|
|
7900
7722
|
b.current = e;
|
|
7901
|
-
}, []), S = r(() => b.current, []), [C, w] = u(g ??
|
|
7723
|
+
}, []), S = r(() => b.current, []), [C, w] = u(g ?? Hn);
|
|
7902
7724
|
a(() => {
|
|
7903
7725
|
let e = b.current;
|
|
7904
7726
|
if (!e) return;
|
|
@@ -7913,9 +7735,9 @@ function Jn(e, n = {}) {
|
|
|
7913
7735
|
let n = new ResizeObserver(t);
|
|
7914
7736
|
return n.observe(e), () => n.disconnect();
|
|
7915
7737
|
}, []);
|
|
7916
|
-
let [T, E] = u(i ??
|
|
7738
|
+
let [T, E] = u(i ?? Vn), D = l(T), O = r((e) => {
|
|
7917
7739
|
D.current = e, E(e);
|
|
7918
|
-
}, []), k = r(() => O(i ??
|
|
7740
|
+
}, []), k = r(() => O(i ?? Vn), [O, i]), A = r((e, t) => {
|
|
7919
7741
|
let n = b.current, r = n?.getBoundingClientRect();
|
|
7920
7742
|
if (!r) return {
|
|
7921
7743
|
x: 0,
|
|
@@ -7976,7 +7798,7 @@ function Jn(e, n = {}) {
|
|
|
7976
7798
|
ox: D.current.x,
|
|
7977
7799
|
oy: D.current.y
|
|
7978
7800
|
}, F(!0));
|
|
7979
|
-
}, [I]),
|
|
7801
|
+
}, [I]), ee = r((e) => {
|
|
7980
7802
|
if (!N.current.active) return;
|
|
7981
7803
|
let t = N.current;
|
|
7982
7804
|
O({
|
|
@@ -7988,7 +7810,7 @@ function Jn(e, n = {}) {
|
|
|
7988
7810
|
a(() => {
|
|
7989
7811
|
if (P) return globalThis.addEventListener("mouseup", L), () => globalThis.removeEventListener("mouseup", L);
|
|
7990
7812
|
}, [P, L]);
|
|
7991
|
-
let
|
|
7813
|
+
let te = c(() => ({
|
|
7992
7814
|
ref: x,
|
|
7993
7815
|
style: {
|
|
7994
7816
|
position: "relative",
|
|
@@ -8000,7 +7822,7 @@ function Jn(e, n = {}) {
|
|
|
8000
7822
|
..._
|
|
8001
7823
|
},
|
|
8002
7824
|
onMouseDown: R,
|
|
8003
|
-
onMouseMove:
|
|
7825
|
+
onMouseMove: ee,
|
|
8004
7826
|
onMouseUp: L,
|
|
8005
7827
|
onMouseLeave: L
|
|
8006
7828
|
}), [
|
|
@@ -8009,44 +7831,44 @@ function Jn(e, n = {}) {
|
|
|
8009
7831
|
I,
|
|
8010
7832
|
P,
|
|
8011
7833
|
R,
|
|
8012
|
-
|
|
7834
|
+
ee,
|
|
8013
7835
|
L
|
|
8014
|
-
]), [
|
|
8015
|
-
m ||
|
|
8016
|
-
}, [m, h]),
|
|
8017
|
-
V(typeof e == "function" ? e(m ??
|
|
7836
|
+
]), [z, ne] = u(() => /* @__PURE__ */ new Set()), B = m ?? z, V = r((e) => {
|
|
7837
|
+
m || ne(e), h?.(e);
|
|
7838
|
+
}, [m, h]), re = r((e) => {
|
|
7839
|
+
V(typeof e == "function" ? e(m ?? z) : e);
|
|
8018
7840
|
}, [
|
|
8019
7841
|
m,
|
|
8020
|
-
|
|
7842
|
+
z,
|
|
8021
7843
|
V
|
|
8022
|
-
]),
|
|
8023
|
-
let n = m ??
|
|
7844
|
+
]), H = r((e, t = !1) => {
|
|
7845
|
+
let n = m ?? z;
|
|
8024
7846
|
if (t) {
|
|
8025
7847
|
let t = new Set(n);
|
|
8026
7848
|
t.has(e) ? t.delete(e) : t.add(e), V(t);
|
|
8027
7849
|
} else V(new Set([e]));
|
|
8028
7850
|
}, [
|
|
8029
7851
|
m,
|
|
8030
|
-
|
|
7852
|
+
z,
|
|
8031
7853
|
V
|
|
8032
|
-
]),
|
|
8033
|
-
if (
|
|
7854
|
+
]), ie = r(() => V(/* @__PURE__ */ new Set()), [V]), [U, W] = u(null), [G, K] = u(null), q = r((e, t) => {
|
|
7855
|
+
if (W(e), !e || !t) {
|
|
8034
7856
|
K(null);
|
|
8035
7857
|
return;
|
|
8036
7858
|
}
|
|
8037
7859
|
K(t);
|
|
8038
|
-
}, []), ae = c(() =>
|
|
8039
|
-
element:
|
|
7860
|
+
}, []), ae = c(() => U ? y ? y(U, G) : t(Bn, {
|
|
7861
|
+
element: U,
|
|
8040
7862
|
anchor: G,
|
|
8041
7863
|
theme: v,
|
|
8042
7864
|
group: e ?? null
|
|
8043
7865
|
}) : null, [
|
|
8044
|
-
|
|
7866
|
+
U,
|
|
8045
7867
|
G,
|
|
8046
7868
|
y,
|
|
8047
7869
|
v,
|
|
8048
7870
|
e
|
|
8049
|
-
]), [oe, se] = u(() => /* @__PURE__ */ new Map()), ce = r((e) => oe.get(e), [oe]),
|
|
7871
|
+
]), [oe, se] = u(() => /* @__PURE__ */ new Map()), ce = r((e) => oe.get(e), [oe]), le = r((e, t, n) => {
|
|
8050
7872
|
se((r) => {
|
|
8051
7873
|
let i = new Map(r);
|
|
8052
7874
|
return i.set(e, {
|
|
@@ -8054,42 +7876,42 @@ function Jn(e, n = {}) {
|
|
|
8054
7876
|
y: n
|
|
8055
7877
|
}), i;
|
|
8056
7878
|
});
|
|
8057
|
-
}, []),
|
|
8058
|
-
return
|
|
8059
|
-
hostProps:
|
|
7879
|
+
}, []), J = r(() => se(/* @__PURE__ */ new Map()), []), [Y, ue] = u(e);
|
|
7880
|
+
return Y !== e && (ue(e), W(null), K(null), se(/* @__PURE__ */ new Map()), m || ne(/* @__PURE__ */ new Set())), {
|
|
7881
|
+
hostProps: te,
|
|
8060
7882
|
viewBoxSize: C,
|
|
8061
7883
|
getHostElement: S,
|
|
8062
7884
|
canvasTransform: T,
|
|
8063
7885
|
setCanvasTransform: O,
|
|
8064
|
-
selectedElements:
|
|
8065
|
-
setSelectedElements:
|
|
8066
|
-
select:
|
|
8067
|
-
clearSelection:
|
|
8068
|
-
hovered:
|
|
7886
|
+
selectedElements: B,
|
|
7887
|
+
setSelectedElements: re,
|
|
7888
|
+
select: H,
|
|
7889
|
+
clearSelection: ie,
|
|
7890
|
+
hovered: U,
|
|
8069
7891
|
hoverAnchor: G,
|
|
8070
7892
|
hoverBubble: ae,
|
|
8071
7893
|
sceneProps: c(() => ({
|
|
8072
|
-
selectedElements:
|
|
7894
|
+
selectedElements: B,
|
|
8073
7895
|
canvasTransform: T,
|
|
8074
7896
|
viewBoxSize: C,
|
|
8075
|
-
onSelect:
|
|
7897
|
+
onSelect: H,
|
|
8076
7898
|
onHover: q
|
|
8077
7899
|
}), [
|
|
8078
|
-
|
|
7900
|
+
B,
|
|
8079
7901
|
T,
|
|
8080
7902
|
C,
|
|
8081
|
-
|
|
7903
|
+
H,
|
|
8082
7904
|
q
|
|
8083
7905
|
]),
|
|
8084
7906
|
resetTransform: k,
|
|
8085
7907
|
zoomBy: M,
|
|
8086
7908
|
locked: o,
|
|
8087
7909
|
getNodePosition: ce,
|
|
8088
|
-
onNodePositionChange:
|
|
8089
|
-
resetNodePositions:
|
|
7910
|
+
onNodePositionChange: le,
|
|
7911
|
+
resetNodePositions: J
|
|
8090
7912
|
};
|
|
8091
7913
|
}
|
|
8092
7914
|
//#endregion
|
|
8093
|
-
export {
|
|
7915
|
+
export { xt as ActionScene, dn as Cayley3DScene, Oe as CayleyView, ze as CosetStripScene, ye as CycleView, At as HomomorphismScene, Fe as I18nProvider, Bn as SceneHoverBubble, Y as SceneThemeRoot, zn as SceneWindow, he as SetView, xn as SublatticeScene, Kt as SymmetryViewScene, Ge as TableView, Gn as useSceneState, Ie as useTranslation };
|
|
8094
7916
|
|
|
8095
7917
|
//# sourceMappingURL=index.js.map
|