@likec4/diagram 1.39.2 → 1.39.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/bundle/{chunk-CaxOLfbm.js → chunk-CW_KClZe.js} +762 -770
- package/bundle/custom.js +20 -20
- package/bundle/index.js +660 -630
- package/dist/LikeC4Diagram.js +2 -2
- package/dist/LikeC4Styles.js +0 -10
- package/dist/base/primitives/edge/EdgeLabelContainer.js +1 -7
- package/dist/bundle/ShadowRoot.js +1 -7
- package/dist/bundle/styles.css.js +6 -5
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useId.d.ts +1 -0
- package/dist/hooks/useId.js +7 -0
- package/dist/likec4diagram/DiagramXYFlow.js +2 -4
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +1 -1
- package/dist/navigationpanel/NavigationPanel.js +2 -3
- package/dist/navigationpanel/NavigationPanelDropdown.js +7 -0
- package/dist/state/DiagramActorProvider.js +12 -19
- package/dist/state/diagram-machine.d.ts +111 -91
- package/dist/state/diagram-machine.js +57 -19
- package/dist/styles-min.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css2.js +1 -1
- package/package.json +8 -8
- package/panda.buildinfo.json +5 -5
- package/src/LikeC4Diagram.tsx +2 -2
- package/src/LikeC4Styles.tsx +0 -6
- package/src/base/primitives/edge/EdgeLabelContainer.tsx +0 -6
- package/src/bundle/ShadowRoot.tsx +1 -7
- package/src/bundle/styles.css.ts +5 -6
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useId.ts +5 -0
- package/src/likec4diagram/DiagramXYFlow.tsx +2 -4
- package/src/likec4diagram/relationship-popover/RelationshipPopover.tsx +1 -1
- package/src/navigationpanel/NavigationPanel.tsx +2 -3
- package/src/navigationpanel/NavigationPanelDropdown.tsx +9 -0
- package/src/state/DiagramActorProvider.tsx +12 -24
- package/src/state/diagram-machine.ts +69 -28
- package/dist/globals.css.js +0 -3
- package/src/globals.css +0 -124
|
@@ -321,23 +321,23 @@ function sva(config) {
|
|
|
321
321
|
}
|
|
322
322
|
var __assign = function() {
|
|
323
323
|
return __assign = Object.assign || function(t2) {
|
|
324
|
-
for (var
|
|
325
|
-
|
|
326
|
-
for (var p in
|
|
324
|
+
for (var s, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
|
|
325
|
+
s = arguments[i2];
|
|
326
|
+
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t2[p] = s[p]);
|
|
327
327
|
}
|
|
328
328
|
return t2;
|
|
329
329
|
}, __assign.apply(this, arguments);
|
|
330
330
|
};
|
|
331
|
-
function __rest(
|
|
331
|
+
function __rest(s, e2) {
|
|
332
332
|
var t2 = {};
|
|
333
|
-
for (var p in
|
|
334
|
-
if (
|
|
335
|
-
for (var i2 = 0, p = Object.getOwnPropertySymbols(
|
|
336
|
-
e2.indexOf(p[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(
|
|
333
|
+
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e2.indexOf(p) < 0 && (t2[p] = s[p]);
|
|
334
|
+
if (s != null && typeof Object.getOwnPropertySymbols == "function")
|
|
335
|
+
for (var i2 = 0, p = Object.getOwnPropertySymbols(s); i2 < p.length; i2++)
|
|
336
|
+
e2.indexOf(p[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i2]) && (t2[p[i2]] = s[p[i2]]);
|
|
337
337
|
return t2;
|
|
338
338
|
}
|
|
339
339
|
function __spreadArray(to, from, pack) {
|
|
340
|
-
if (pack || arguments.length === 2) for (var i2 = 0,
|
|
340
|
+
if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar; i2 < l; i2++)
|
|
341
341
|
(ar || !(i2 in from)) && (ar || (ar = Array.prototype.slice.call(from, 0, i2)), ar[i2] = from[i2]);
|
|
342
342
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
343
343
|
}
|
|
@@ -687,8 +687,8 @@ var nonPassive = passiveSupported ? { passive: !1 } : !1, alwaysContainsScroll =
|
|
|
687
687
|
return [event.deltaX, event.deltaY];
|
|
688
688
|
}, extractRef = function(ref) {
|
|
689
689
|
return ref && "current" in ref ? ref.current : ref;
|
|
690
|
-
}, deltaCompare = function(x,
|
|
691
|
-
return x[0] ===
|
|
690
|
+
}, deltaCompare = function(x, y) {
|
|
691
|
+
return x[0] === y[0] && x[1] === y[1];
|
|
692
692
|
}, generateStyle = function(id2) {
|
|
693
693
|
return `
|
|
694
694
|
.block-interactivity-`.concat(id2, ` {pointer-events: none;}
|
|
@@ -1043,10 +1043,14 @@ function useMediaQuery(query, initialValue, { getInitialValueInEffect } = {
|
|
|
1043
1043
|
}) {
|
|
1044
1044
|
const [matches2, setMatches] = useState(
|
|
1045
1045
|
getInitialValueInEffect ? initialValue : getInitialValue(query)
|
|
1046
|
-
)
|
|
1046
|
+
);
|
|
1047
1047
|
return useEffect(() => {
|
|
1048
|
-
|
|
1049
|
-
|
|
1048
|
+
try {
|
|
1049
|
+
const mediaQuery = window.matchMedia(query);
|
|
1050
|
+
return setMatches(mediaQuery.matches), attachMediaListener(mediaQuery, (event) => setMatches(event.matches));
|
|
1051
|
+
} catch {
|
|
1052
|
+
return;
|
|
1053
|
+
}
|
|
1050
1054
|
}, [query]), matches2 || !1;
|
|
1051
1055
|
}
|
|
1052
1056
|
function useDebouncedState(defaultValue, wait, options = { leading: !1 }) {
|
|
@@ -1063,7 +1067,7 @@ function useDebouncedState(defaultValue, wait, options = { leading: !1 }) {
|
|
|
1063
1067
|
return [value, debouncedSetValue];
|
|
1064
1068
|
}
|
|
1065
1069
|
function useDebouncedValue(value, wait, options = { leading: !1 }) {
|
|
1066
|
-
const [_value, setValue] = useState(value), mountedRef = useRef(!1), timeoutRef = useRef(null), cooldownRef = useRef(!1), cancel2 = () => window.clearTimeout(timeoutRef.current);
|
|
1070
|
+
const [_value, setValue] = useState(value), mountedRef = useRef(!1), timeoutRef = useRef(null), cooldownRef = useRef(!1), cancel2 = useCallback(() => window.clearTimeout(timeoutRef.current), []);
|
|
1067
1071
|
return useEffect(() => {
|
|
1068
1072
|
mountedRef.current && (!cooldownRef.current && options.leading ? (cooldownRef.current = !0, setValue(value)) : (cancel2(), timeoutRef.current = window.setTimeout(() => {
|
|
1069
1073
|
cooldownRef.current = !1, setValue(value);
|
|
@@ -1223,7 +1227,7 @@ function useMove(onChange, handlers, dir = "ltr") {
|
|
|
1223
1227
|
(node) => {
|
|
1224
1228
|
if (cleanupRef.current && (cleanupRef.current(), cleanupRef.current = null), !node)
|
|
1225
1229
|
return;
|
|
1226
|
-
const onScrub = ({ x, y
|
|
1230
|
+
const onScrub = ({ x, y }) => {
|
|
1227
1231
|
cancelAnimationFrame(frame2.current), frame2.current = requestAnimationFrame(() => {
|
|
1228
1232
|
if (mounted.current && node) {
|
|
1229
1233
|
node.style.userSelect = "none";
|
|
@@ -1232,7 +1236,7 @@ function useMove(onChange, handlers, dir = "ltr") {
|
|
|
1232
1236
|
const _x = clamp$3((x - rect.left) / rect.width, 0, 1);
|
|
1233
1237
|
onChange({
|
|
1234
1238
|
x: dir === "ltr" ? _x : 1 - _x,
|
|
1235
|
-
y: clamp$3((
|
|
1239
|
+
y: clamp$3((y - rect.top) / rect.height, 0, 1)
|
|
1236
1240
|
});
|
|
1237
1241
|
}
|
|
1238
1242
|
}
|
|
@@ -1361,17 +1365,17 @@ function getRefProp(element) {
|
|
|
1361
1365
|
function createVarsResolver(resolver) {
|
|
1362
1366
|
return resolver;
|
|
1363
1367
|
}
|
|
1364
|
-
function r$
|
|
1365
|
-
var t2,
|
|
1368
|
+
function r$2(e2) {
|
|
1369
|
+
var t2, f, n2 = "";
|
|
1366
1370
|
if (typeof e2 == "string" || typeof e2 == "number") n2 += e2;
|
|
1367
1371
|
else if (typeof e2 == "object") if (Array.isArray(e2)) {
|
|
1368
|
-
var
|
|
1369
|
-
for (t2 = 0; t2 <
|
|
1370
|
-
} else for (
|
|
1372
|
+
var o = e2.length;
|
|
1373
|
+
for (t2 = 0; t2 < o; t2++) e2[t2] && (f = r$2(e2[t2])) && (n2 && (n2 += " "), n2 += f);
|
|
1374
|
+
} else for (f in e2) e2[f] && (n2 && (n2 += " "), n2 += f);
|
|
1371
1375
|
return n2;
|
|
1372
1376
|
}
|
|
1373
1377
|
function clsx() {
|
|
1374
|
-
for (var e2, t2,
|
|
1378
|
+
for (var e2, t2, f = 0, n2 = "", o = arguments.length; f < o; f++) (e2 = arguments[f]) && (t2 = r$2(e2)) && (n2 && (n2 += " "), n2 += t2);
|
|
1375
1379
|
return n2;
|
|
1376
1380
|
}
|
|
1377
1381
|
const EMPTY_CLASS_NAMES = {};
|
|
@@ -1469,7 +1473,7 @@ function hslStringToRgba(hslaString) {
|
|
|
1469
1473
|
b: 0,
|
|
1470
1474
|
a: 1
|
|
1471
1475
|
};
|
|
1472
|
-
const h = parseInt(matches2[1], 10),
|
|
1476
|
+
const h = parseInt(matches2[1], 10), s = parseInt(matches2[2], 10) / 100, l = parseInt(matches2[3], 10) / 100, a = matches2[5] ? parseFloat(matches2[5]) : void 0, chroma = (1 - Math.abs(2 * l - 1)) * s, huePrime = h / 60, x = chroma * (1 - Math.abs(huePrime % 2 - 1)), m2 = l - chroma / 2;
|
|
1473
1477
|
let r2, g, b;
|
|
1474
1478
|
return huePrime >= 0 && huePrime < 1 ? (r2 = chroma, g = x, b = 0) : huePrime >= 1 && huePrime < 2 ? (r2 = x, g = chroma, b = 0) : huePrime >= 2 && huePrime < 3 ? (r2 = 0, g = chroma, b = x) : huePrime >= 3 && huePrime < 4 ? (r2 = 0, g = x, b = chroma) : huePrime >= 4 && huePrime < 5 ? (r2 = x, g = 0, b = chroma) : (r2 = chroma, g = 0, b = x), {
|
|
1475
1479
|
r: Math.round((r2 + m2) * 255),
|
|
@@ -1489,7 +1493,7 @@ function toRgba(color2) {
|
|
|
1489
1493
|
function darken(color2, alpha2) {
|
|
1490
1494
|
if (color2.startsWith("var("))
|
|
1491
1495
|
return `color-mix(in srgb, ${color2}, black ${alpha2 * 100}%)`;
|
|
1492
|
-
const { r: r2, g, b, a } = toRgba(color2),
|
|
1496
|
+
const { r: r2, g, b, a } = toRgba(color2), f = 1 - alpha2, dark = (input) => Math.round(input * f);
|
|
1493
1497
|
return `rgba(${dark(r2)}, ${dark(g)}, ${dark(b)}, ${a})`;
|
|
1494
1498
|
}
|
|
1495
1499
|
function getPrimaryShade(theme, colorScheme) {
|
|
@@ -3057,19 +3061,19 @@ function getPaddingObject(padding) {
|
|
|
3057
3061
|
function rectToClientRect(rect) {
|
|
3058
3062
|
const {
|
|
3059
3063
|
x,
|
|
3060
|
-
y
|
|
3064
|
+
y,
|
|
3061
3065
|
width,
|
|
3062
3066
|
height
|
|
3063
3067
|
} = rect;
|
|
3064
3068
|
return {
|
|
3065
3069
|
width,
|
|
3066
3070
|
height,
|
|
3067
|
-
top:
|
|
3071
|
+
top: y,
|
|
3068
3072
|
left: x,
|
|
3069
3073
|
right: x + width,
|
|
3070
|
-
bottom:
|
|
3074
|
+
bottom: y + height,
|
|
3071
3075
|
x,
|
|
3072
|
-
y
|
|
3076
|
+
y
|
|
3073
3077
|
};
|
|
3074
3078
|
}
|
|
3075
3079
|
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
@@ -3133,7 +3137,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
3133
3137
|
strategy
|
|
3134
3138
|
}), {
|
|
3135
3139
|
x,
|
|
3136
|
-
y
|
|
3140
|
+
y
|
|
3137
3141
|
} = computeCoordsFromPlacement(rects, placement, rtl), statefulPlacement = placement, middlewareData = {}, resetCount = 0;
|
|
3138
3142
|
for (let i2 = 0; i2 < validMiddleware.length; i2++) {
|
|
3139
3143
|
const {
|
|
@@ -3146,7 +3150,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
3146
3150
|
reset
|
|
3147
3151
|
} = await fn({
|
|
3148
3152
|
x,
|
|
3149
|
-
y
|
|
3153
|
+
y,
|
|
3150
3154
|
initialPlacement: placement,
|
|
3151
3155
|
placement: statefulPlacement,
|
|
3152
3156
|
strategy,
|
|
@@ -3158,7 +3162,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
3158
3162
|
floating
|
|
3159
3163
|
}
|
|
3160
3164
|
});
|
|
3161
|
-
x = nextX ?? x,
|
|
3165
|
+
x = nextX ?? x, y = nextY ?? y, middlewareData = {
|
|
3162
3166
|
...middlewareData,
|
|
3163
3167
|
[name]: {
|
|
3164
3168
|
...middlewareData[name],
|
|
@@ -3170,12 +3174,12 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
3170
3174
|
strategy
|
|
3171
3175
|
}) : reset.rects), {
|
|
3172
3176
|
x,
|
|
3173
|
-
y
|
|
3177
|
+
y
|
|
3174
3178
|
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl)), i2 = -1);
|
|
3175
3179
|
}
|
|
3176
3180
|
return {
|
|
3177
3181
|
x,
|
|
3178
|
-
y
|
|
3182
|
+
y,
|
|
3179
3183
|
placement: statefulPlacement,
|
|
3180
3184
|
strategy,
|
|
3181
3185
|
middlewareData
|
|
@@ -3186,7 +3190,7 @@ async function detectOverflow(state, options) {
|
|
|
3186
3190
|
options === void 0 && (options = {});
|
|
3187
3191
|
const {
|
|
3188
3192
|
x,
|
|
3189
|
-
y
|
|
3193
|
+
y,
|
|
3190
3194
|
platform: platform2,
|
|
3191
3195
|
rects,
|
|
3192
3196
|
elements,
|
|
@@ -3204,7 +3208,7 @@ async function detectOverflow(state, options) {
|
|
|
3204
3208
|
strategy
|
|
3205
3209
|
})), rect = elementContext === "floating" ? {
|
|
3206
3210
|
x,
|
|
3207
|
-
y
|
|
3211
|
+
y,
|
|
3208
3212
|
width: rects.floating.width,
|
|
3209
3213
|
height: rects.floating.height
|
|
3210
3214
|
} : rects.reference, offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating)), offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
|
|
@@ -3232,7 +3236,7 @@ const arrow$3 = (options) => ({
|
|
|
3232
3236
|
async fn(state) {
|
|
3233
3237
|
const {
|
|
3234
3238
|
x,
|
|
3235
|
-
y
|
|
3239
|
+
y,
|
|
3236
3240
|
placement,
|
|
3237
3241
|
rects,
|
|
3238
3242
|
platform: platform2,
|
|
@@ -3246,7 +3250,7 @@ const arrow$3 = (options) => ({
|
|
|
3246
3250
|
return {};
|
|
3247
3251
|
const paddingObject = getPaddingObject(padding), coords = {
|
|
3248
3252
|
x,
|
|
3249
|
-
y
|
|
3253
|
+
y
|
|
3250
3254
|
}, axis = getAlignmentAxis(placement), length = getAxisLength(axis), arrowDimensions = await platform2.getDimensions(element), isYAxis = axis === "y", minProp = isYAxis ? "top" : "left", maxProp = isYAxis ? "bottom" : "right", clientProp = isYAxis ? "clientHeight" : "clientWidth", endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length], startDiff = coords[axis] - rects.reference[axis], arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
|
|
3251
3255
|
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
3252
3256
|
(!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) && (clientSize = elements.floating[clientProp] || rects.floating[length]);
|
|
@@ -3309,20 +3313,20 @@ const autoPlacement$1 = function(options) {
|
|
|
3309
3313
|
placement: nextPlacement
|
|
3310
3314
|
}
|
|
3311
3315
|
};
|
|
3312
|
-
const placementsSortedByMostSpace = allOverflows.map((
|
|
3313
|
-
const alignment2 = getAlignment(
|
|
3314
|
-
return [
|
|
3316
|
+
const placementsSortedByMostSpace = allOverflows.map((d) => {
|
|
3317
|
+
const alignment2 = getAlignment(d.placement);
|
|
3318
|
+
return [d.placement, alignment2 && crossAxis ? (
|
|
3315
3319
|
// Check along the mainAxis and main crossAxis side.
|
|
3316
|
-
|
|
3320
|
+
d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0)
|
|
3317
3321
|
) : (
|
|
3318
3322
|
// Check only the mainAxis.
|
|
3319
|
-
|
|
3320
|
-
),
|
|
3321
|
-
}).sort((a, b) => a[1] - b[1]), resetPlacement = ((_placementsThatFitOnE = placementsSortedByMostSpace.filter((
|
|
3323
|
+
d.overflows[0]
|
|
3324
|
+
), d.overflows];
|
|
3325
|
+
}).sort((a, b) => a[1] - b[1]), resetPlacement = ((_placementsThatFitOnE = placementsSortedByMostSpace.filter((d) => d[2].slice(
|
|
3322
3326
|
0,
|
|
3323
3327
|
// Aligned placements should not check their opposite crossAxis
|
|
3324
3328
|
// side.
|
|
3325
|
-
getAlignment(
|
|
3329
|
+
getAlignment(d[0]) ? 2 : 3
|
|
3326
3330
|
).every((v) => v <= 0))[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
|
|
3327
3331
|
return resetPlacement !== placement ? {
|
|
3328
3332
|
data: {
|
|
@@ -3375,7 +3379,7 @@ const autoPlacement$1 = function(options) {
|
|
|
3375
3379
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1, nextPlacement = placements2[nextIndex];
|
|
3376
3380
|
if (nextPlacement && (!(checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : !1) || // We leave the current main axis only if every placement on that axis
|
|
3377
3381
|
// overflows the main axis.
|
|
3378
|
-
overflowsData.every((
|
|
3382
|
+
overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : !0)))
|
|
3379
3383
|
return {
|
|
3380
3384
|
data: {
|
|
3381
3385
|
index: nextIndex,
|
|
@@ -3385,20 +3389,20 @@ const autoPlacement$1 = function(options) {
|
|
|
3385
3389
|
placement: nextPlacement
|
|
3386
3390
|
}
|
|
3387
3391
|
};
|
|
3388
|
-
let resetPlacement = (_overflowsData$filter = overflowsData.filter((
|
|
3392
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
3389
3393
|
if (!resetPlacement)
|
|
3390
3394
|
switch (fallbackStrategy) {
|
|
3391
3395
|
case "bestFit": {
|
|
3392
3396
|
var _overflowsData$filter2;
|
|
3393
|
-
const placement2 = (_overflowsData$filter2 = overflowsData.filter((
|
|
3397
|
+
const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
|
|
3394
3398
|
if (hasFallbackAxisSideDirection) {
|
|
3395
|
-
const currentSideAxis = getSideAxis(
|
|
3399
|
+
const currentSideAxis = getSideAxis(d.placement);
|
|
3396
3400
|
return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
|
|
3397
3401
|
// reading directions favoring greater width.
|
|
3398
3402
|
currentSideAxis === "y";
|
|
3399
3403
|
}
|
|
3400
3404
|
return !0;
|
|
3401
|
-
}).map((
|
|
3405
|
+
}).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
3402
3406
|
placement2 && (resetPlacement = placement2);
|
|
3403
3407
|
break;
|
|
3404
3408
|
}
|
|
@@ -3502,11 +3506,11 @@ const inline$2 = function(options) {
|
|
|
3502
3506
|
} = state, {
|
|
3503
3507
|
padding = 2,
|
|
3504
3508
|
x,
|
|
3505
|
-
y
|
|
3509
|
+
y
|
|
3506
3510
|
} = evaluate(options, state), nativeClientRects = Array.from(await (platform2.getClientRects == null ? void 0 : platform2.getClientRects(elements.reference)) || []), clientRects = getRectsByLine(nativeClientRects), fallback = rectToClientRect(getBoundingRect(nativeClientRects)), paddingObject = getPaddingObject(padding);
|
|
3507
3511
|
function getBoundingClientRect2() {
|
|
3508
|
-
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null &&
|
|
3509
|
-
return clientRects.find((rect) => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right &&
|
|
3512
|
+
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null)
|
|
3513
|
+
return clientRects.find((rect) => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
|
|
3510
3514
|
if (clientRects.length >= 2) {
|
|
3511
3515
|
if (getSideAxis(placement) === "y") {
|
|
3512
3516
|
const firstRect = clientRects[0], lastRect = clientRects[clientRects.length - 1], isTop = getSide(placement) === "top", top2 = firstRect.top, bottom2 = lastRect.bottom, left2 = isTop ? firstRect.left : lastRect.left, right2 = isTop ? firstRect.right : lastRect.right, width2 = right2 - left2, height2 = bottom2 - top2;
|
|
@@ -3585,13 +3589,13 @@ const offset$3 = function(options) {
|
|
|
3585
3589
|
var _middlewareData$offse, _middlewareData$arrow;
|
|
3586
3590
|
const {
|
|
3587
3591
|
x,
|
|
3588
|
-
y
|
|
3592
|
+
y,
|
|
3589
3593
|
placement,
|
|
3590
3594
|
middlewareData
|
|
3591
3595
|
} = state, diffCoords = await convertValueToCoords(state, options);
|
|
3592
3596
|
return placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset ? {} : {
|
|
3593
3597
|
x: x + diffCoords.x,
|
|
3594
|
-
y:
|
|
3598
|
+
y: y + diffCoords.y,
|
|
3595
3599
|
data: {
|
|
3596
3600
|
...diffCoords,
|
|
3597
3601
|
placement
|
|
@@ -3606,7 +3610,7 @@ const offset$3 = function(options) {
|
|
|
3606
3610
|
async fn(state) {
|
|
3607
3611
|
const {
|
|
3608
3612
|
x,
|
|
3609
|
-
y
|
|
3613
|
+
y,
|
|
3610
3614
|
placement
|
|
3611
3615
|
} = state, {
|
|
3612
3616
|
mainAxis: checkMainAxis = !0,
|
|
@@ -3615,18 +3619,18 @@ const offset$3 = function(options) {
|
|
|
3615
3619
|
fn: (_ref) => {
|
|
3616
3620
|
let {
|
|
3617
3621
|
x: x2,
|
|
3618
|
-
y:
|
|
3622
|
+
y: y2
|
|
3619
3623
|
} = _ref;
|
|
3620
3624
|
return {
|
|
3621
3625
|
x: x2,
|
|
3622
|
-
y:
|
|
3626
|
+
y: y2
|
|
3623
3627
|
};
|
|
3624
3628
|
}
|
|
3625
3629
|
},
|
|
3626
3630
|
...detectOverflowOptions
|
|
3627
3631
|
} = evaluate(options, state), coords = {
|
|
3628
3632
|
x,
|
|
3629
|
-
y
|
|
3633
|
+
y
|
|
3630
3634
|
}, overflow = await detectOverflow(state, detectOverflowOptions), crossAxis = getSideAxis(getSide(placement)), mainAxis = getOppositeAxis(crossAxis);
|
|
3631
3635
|
let mainAxisCoord = coords[mainAxis], crossAxisCoord = coords[crossAxis];
|
|
3632
3636
|
if (checkMainAxis) {
|
|
@@ -3646,7 +3650,7 @@ const offset$3 = function(options) {
|
|
|
3646
3650
|
...limitedCoords,
|
|
3647
3651
|
data: {
|
|
3648
3652
|
x: limitedCoords.x - x,
|
|
3649
|
-
y: limitedCoords.y -
|
|
3653
|
+
y: limitedCoords.y - y,
|
|
3650
3654
|
enabled: {
|
|
3651
3655
|
[mainAxis]: checkMainAxis,
|
|
3652
3656
|
[crossAxis]: checkCrossAxis
|
|
@@ -3661,7 +3665,7 @@ const offset$3 = function(options) {
|
|
|
3661
3665
|
fn(state) {
|
|
3662
3666
|
const {
|
|
3663
3667
|
x,
|
|
3664
|
-
y
|
|
3668
|
+
y,
|
|
3665
3669
|
placement,
|
|
3666
3670
|
rects,
|
|
3667
3671
|
middlewareData
|
|
@@ -3671,7 +3675,7 @@ const offset$3 = function(options) {
|
|
|
3671
3675
|
crossAxis: checkCrossAxis = !0
|
|
3672
3676
|
} = evaluate(options, state), coords = {
|
|
3673
3677
|
x,
|
|
3674
|
-
y
|
|
3678
|
+
y
|
|
3675
3679
|
}, crossAxis = getSideAxis(placement), mainAxis = getOppositeAxis(crossAxis);
|
|
3676
3680
|
let mainAxisCoord = coords[mainAxis], crossAxisCoord = coords[crossAxis];
|
|
3677
3681
|
const rawOffset = evaluate(offset2, state), computedOffset = typeof rawOffset == "number" ? {
|
|
@@ -3760,10 +3764,10 @@ function getScale(element) {
|
|
|
3760
3764
|
height,
|
|
3761
3765
|
$
|
|
3762
3766
|
} = getCssDimensions(domElement);
|
|
3763
|
-
let x = ($ ? round(rect.width) : rect.width) / width,
|
|
3764
|
-
return (!x || !Number.isFinite(x)) && (x = 1), (!
|
|
3767
|
+
let x = ($ ? round(rect.width) : rect.width) / width, y = ($ ? round(rect.height) : rect.height) / height;
|
|
3768
|
+
return (!x || !Number.isFinite(x)) && (x = 1), (!y || !Number.isFinite(y)) && (y = 1), {
|
|
3765
3769
|
x,
|
|
3766
|
-
y
|
|
3770
|
+
y
|
|
3767
3771
|
};
|
|
3768
3772
|
}
|
|
3769
3773
|
const noOffsets = /* @__PURE__ */ createCoords(0);
|
|
@@ -3783,20 +3787,20 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
3783
3787
|
let scale2 = createCoords(1);
|
|
3784
3788
|
includeScale && (offsetParent ? isElement(offsetParent) && (scale2 = getScale(offsetParent)) : scale2 = getScale(element));
|
|
3785
3789
|
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
3786
|
-
let x = (clientRect.left + visualOffsets.x) / scale2.x,
|
|
3790
|
+
let x = (clientRect.left + visualOffsets.x) / scale2.x, y = (clientRect.top + visualOffsets.y) / scale2.y, width = clientRect.width / scale2.x, height = clientRect.height / scale2.y;
|
|
3787
3791
|
if (domElement) {
|
|
3788
3792
|
const win2 = getWindow(domElement), offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
3789
3793
|
let currentWin = win2, currentIFrame = getFrameElement(currentWin);
|
|
3790
3794
|
for (; currentIFrame && offsetParent && offsetWin !== currentWin; ) {
|
|
3791
3795
|
const iframeScale = getScale(currentIFrame), iframeRect = currentIFrame.getBoundingClientRect(), css2 = getComputedStyle$1(currentIFrame), left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css2.paddingLeft)) * iframeScale.x, top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css2.paddingTop)) * iframeScale.y;
|
|
3792
|
-
x *= iframeScale.x,
|
|
3796
|
+
x *= iframeScale.x, y *= iframeScale.y, width *= iframeScale.x, height *= iframeScale.y, x += left, y += top, currentWin = getWindow(currentIFrame), currentIFrame = getFrameElement(currentWin);
|
|
3793
3797
|
}
|
|
3794
3798
|
}
|
|
3795
3799
|
return rectToClientRect({
|
|
3796
3800
|
width,
|
|
3797
3801
|
height,
|
|
3798
3802
|
x,
|
|
3799
|
-
y
|
|
3803
|
+
y
|
|
3800
3804
|
});
|
|
3801
3805
|
}
|
|
3802
3806
|
function getWindowScrollBarX(element, rect) {
|
|
@@ -3804,10 +3808,10 @@ function getWindowScrollBarX(element, rect) {
|
|
|
3804
3808
|
return rect ? rect.left + leftScroll : getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
3805
3809
|
}
|
|
3806
3810
|
function getHTMLOffset(documentElement, scroll) {
|
|
3807
|
-
const htmlRect = documentElement.getBoundingClientRect(), x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect),
|
|
3811
|
+
const htmlRect = documentElement.getBoundingClientRect(), x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect), y = htmlRect.top + scroll.scrollTop;
|
|
3808
3812
|
return {
|
|
3809
3813
|
x,
|
|
3810
|
-
y
|
|
3814
|
+
y
|
|
3811
3815
|
};
|
|
3812
3816
|
}
|
|
3813
3817
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
@@ -3843,22 +3847,22 @@ function getClientRects(element) {
|
|
|
3843
3847
|
function getDocumentRect(element) {
|
|
3844
3848
|
const html = getDocumentElement(element), scroll = getNodeScroll(element), body2 = element.ownerDocument.body, width = max$1(html.scrollWidth, html.clientWidth, body2.scrollWidth, body2.clientWidth), height = max$1(html.scrollHeight, html.clientHeight, body2.scrollHeight, body2.clientHeight);
|
|
3845
3849
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
3846
|
-
const
|
|
3850
|
+
const y = -scroll.scrollTop;
|
|
3847
3851
|
return getComputedStyle$1(body2).direction === "rtl" && (x += max$1(html.clientWidth, body2.clientWidth) - width), {
|
|
3848
3852
|
width,
|
|
3849
3853
|
height,
|
|
3850
3854
|
x,
|
|
3851
|
-
y
|
|
3855
|
+
y
|
|
3852
3856
|
};
|
|
3853
3857
|
}
|
|
3854
3858
|
const SCROLLBAR_MAX = 25;
|
|
3855
3859
|
function getViewportRect(element, strategy) {
|
|
3856
3860
|
const win2 = getWindow(element), html = getDocumentElement(element), visualViewport = win2.visualViewport;
|
|
3857
|
-
let width = html.clientWidth, height = html.clientHeight, x = 0,
|
|
3861
|
+
let width = html.clientWidth, height = html.clientHeight, x = 0, y = 0;
|
|
3858
3862
|
if (visualViewport) {
|
|
3859
3863
|
width = visualViewport.width, height = visualViewport.height;
|
|
3860
3864
|
const visualViewportBased = isWebKit();
|
|
3861
|
-
(!visualViewportBased || visualViewportBased && strategy === "fixed") && (x = visualViewport.offsetLeft,
|
|
3865
|
+
(!visualViewportBased || visualViewportBased && strategy === "fixed") && (x = visualViewport.offsetLeft, y = visualViewport.offsetTop);
|
|
3862
3866
|
}
|
|
3863
3867
|
const windowScrollbarX = getWindowScrollBarX(html);
|
|
3864
3868
|
if (windowScrollbarX <= 0) {
|
|
@@ -3869,17 +3873,17 @@ function getViewportRect(element, strategy) {
|
|
|
3869
3873
|
width,
|
|
3870
3874
|
height,
|
|
3871
3875
|
x,
|
|
3872
|
-
y
|
|
3876
|
+
y
|
|
3873
3877
|
};
|
|
3874
3878
|
}
|
|
3875
3879
|
const absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
3876
3880
|
function getInnerBoundingClientRect(element, strategy) {
|
|
3877
|
-
const clientRect = getBoundingClientRect(element, !0, strategy === "fixed"), top = clientRect.top + element.clientTop, left = clientRect.left + element.clientLeft, scale2 = isHTMLElement(element) ? getScale(element) : createCoords(1), width = element.clientWidth * scale2.x, height = element.clientHeight * scale2.y, x = left * scale2.x,
|
|
3881
|
+
const clientRect = getBoundingClientRect(element, !0, strategy === "fixed"), top = clientRect.top + element.clientTop, left = clientRect.left + element.clientLeft, scale2 = isHTMLElement(element) ? getScale(element) : createCoords(1), width = element.clientWidth * scale2.x, height = element.clientHeight * scale2.y, x = left * scale2.x, y = top * scale2.y;
|
|
3878
3882
|
return {
|
|
3879
3883
|
width,
|
|
3880
3884
|
height,
|
|
3881
3885
|
x,
|
|
3882
|
-
y
|
|
3886
|
+
y
|
|
3883
3887
|
};
|
|
3884
3888
|
}
|
|
3885
3889
|
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
@@ -3962,10 +3966,10 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
3962
3966
|
offsets.x = offsetRect.x + offsetParent.clientLeft, offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
3963
3967
|
} else documentElement && setLeftRTLScrollbarOffset();
|
|
3964
3968
|
isFixed && !isOffsetParentAnElement && documentElement && setLeftRTLScrollbarOffset();
|
|
3965
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0), x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x,
|
|
3969
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0), x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x, y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
3966
3970
|
return {
|
|
3967
3971
|
x,
|
|
3968
|
-
y
|
|
3972
|
+
y,
|
|
3969
3973
|
width: rect.width,
|
|
3970
3974
|
height: rect.height
|
|
3971
3975
|
};
|
|
@@ -4249,17 +4253,17 @@ function useFloating$1(options) {
|
|
|
4249
4253
|
};
|
|
4250
4254
|
if (!elements.floating)
|
|
4251
4255
|
return initialStyles;
|
|
4252
|
-
const x = roundByDPR(elements.floating, data.x),
|
|
4256
|
+
const x = roundByDPR(elements.floating, data.x), y = roundByDPR(elements.floating, data.y);
|
|
4253
4257
|
return transform2 ? {
|
|
4254
4258
|
...initialStyles,
|
|
4255
|
-
transform: "translate(" + x + "px, " +
|
|
4259
|
+
transform: "translate(" + x + "px, " + y + "px)",
|
|
4256
4260
|
...getDPR(elements.floating) >= 1.5 && {
|
|
4257
4261
|
willChange: "transform"
|
|
4258
4262
|
}
|
|
4259
4263
|
} : {
|
|
4260
4264
|
position: strategy,
|
|
4261
4265
|
left: x,
|
|
4262
|
-
top:
|
|
4266
|
+
top: y
|
|
4263
4267
|
};
|
|
4264
4268
|
}, [strategy, transform2, elements.floating, data.x, data.y]);
|
|
4265
4269
|
return React.useMemo(() => ({
|
|
@@ -4365,7 +4369,7 @@ function createPubSub() {
|
|
|
4365
4369
|
},
|
|
4366
4370
|
off(event, listener) {
|
|
4367
4371
|
var _map$get2;
|
|
4368
|
-
map.set(event, ((_map$get2 = map.get(event)) == null ? void 0 : _map$get2.filter((
|
|
4372
|
+
map.set(event, ((_map$get2 = map.get(event)) == null ? void 0 : _map$get2.filter((l) => l !== listener)) || []);
|
|
4369
4373
|
}
|
|
4370
4374
|
};
|
|
4371
4375
|
}
|
|
@@ -5836,27 +5840,18 @@ function usePopover(options) {
|
|
|
5836
5840
|
}, floating = useFloating({
|
|
5837
5841
|
strategy: options.strategy,
|
|
5838
5842
|
placement: options.preventPositionChangeWhenVisible ? options.positionRef.current : options.position,
|
|
5839
|
-
middleware: getPopoverMiddlewares(options, () => floating, env)
|
|
5840
|
-
// Only use whileElementsMounted when elements are conditionally rendered (not keepMounted)
|
|
5841
|
-
// When keepMounted=true, elements are hidden with CSS and we need manual autoUpdate control
|
|
5842
|
-
whileElementsMounted: options.keepMounted ? void 0 : autoUpdate
|
|
5843
|
+
middleware: getPopoverMiddlewares(options, () => floating, env)
|
|
5843
5844
|
});
|
|
5844
5845
|
return useEffect(() => {
|
|
5845
|
-
if (!(!
|
|
5846
|
+
if (!(!floating.refs.reference.current || !floating.refs.floating.current) && _opened)
|
|
5846
5847
|
return autoUpdate(
|
|
5847
5848
|
floating.refs.reference.current,
|
|
5848
5849
|
floating.refs.floating.current,
|
|
5849
5850
|
floating.update
|
|
5850
5851
|
);
|
|
5851
|
-
}, [
|
|
5852
|
-
options.keepMounted,
|
|
5853
|
-
_opened,
|
|
5854
|
-
floating.refs.reference,
|
|
5855
|
-
floating.refs.floating,
|
|
5856
|
-
floating.update
|
|
5857
|
-
]), useDidUpdate(() => {
|
|
5852
|
+
}, [_opened, floating.update]), useDidUpdate(() => {
|
|
5858
5853
|
options.onPositionChange?.(floating.placement), options.positionRef.current = floating.placement;
|
|
5859
|
-
}, [floating.placement]), useDidUpdate(() => {
|
|
5854
|
+
}, [floating.placement, options.preventPositionChangeWhenVisible]), useDidUpdate(() => {
|
|
5860
5855
|
_opened !== previouslyOpened.current && (_opened ? options.onOpen?.() : options.onClose?.()), previouslyOpened.current = _opened;
|
|
5861
5856
|
}, [_opened, options.onClose, options.onOpen]), useDidUpdate(() => {
|
|
5862
5857
|
let timeout2 = -1;
|
|
@@ -7449,7 +7444,7 @@ function useFloatingTooltip({
|
|
|
7449
7444
|
position,
|
|
7450
7445
|
defaultOpened
|
|
7451
7446
|
}) {
|
|
7452
|
-
const [opened, setOpened] = useState(defaultOpened), boundaryRef = useRef(null), { x, y
|
|
7447
|
+
const [opened, setOpened] = useState(defaultOpened), boundaryRef = useRef(null), { x, y, elements, refs, update, placement } = useFloating({
|
|
7453
7448
|
placement: position,
|
|
7454
7449
|
middleware: [
|
|
7455
7450
|
shift({
|
|
@@ -7490,7 +7485,7 @@ function useFloatingTooltip({
|
|
|
7490
7485
|
});
|
|
7491
7486
|
};
|
|
7492
7487
|
}
|
|
7493
|
-
}, [elements.reference, refs.floating.current, update, handleMouseMove, opened]), { handleMouseMove, x, y
|
|
7488
|
+
}, [elements.reference, refs.floating.current, update, handleMouseMove, opened]), { handleMouseMove, x, y, opened, setOpened, boundaryRef, floating: refs.setFloating };
|
|
7494
7489
|
}
|
|
7495
7490
|
var classes$3 = { tooltip: "m_1b3c8819", arrow: "m_f898399f" };
|
|
7496
7491
|
const defaultProps$5 = {
|
|
@@ -7542,7 +7537,7 @@ const defaultProps$5 = {
|
|
|
7542
7537
|
rootSelector: "tooltip",
|
|
7543
7538
|
vars,
|
|
7544
7539
|
varsResolver: varsResolver$4
|
|
7545
|
-
}), { handleMouseMove, x, y
|
|
7540
|
+
}), { handleMouseMove, x, y, opened, boundaryRef, floating, setOpened } = useFloatingTooltip({
|
|
7546
7541
|
offset: offset2,
|
|
7547
7542
|
position,
|
|
7548
7543
|
defaultOpened
|
|
@@ -7566,7 +7561,7 @@ const defaultProps$5 = {
|
|
|
7566
7561
|
...getStyleObject(style2, theme),
|
|
7567
7562
|
zIndex,
|
|
7568
7563
|
display: !disabled && opened ? "block" : "none",
|
|
7569
|
-
top: (
|
|
7564
|
+
top: (y && Math.round(y)) ?? "",
|
|
7570
7565
|
left: (x && Math.round(x)) ?? ""
|
|
7571
7566
|
}
|
|
7572
7567
|
}),
|
|
@@ -7622,7 +7617,7 @@ function useTooltip(settings) {
|
|
|
7622
7617
|
[uid]
|
|
7623
7618
|
), {
|
|
7624
7619
|
x,
|
|
7625
|
-
y
|
|
7620
|
+
y,
|
|
7626
7621
|
context: context2,
|
|
7627
7622
|
refs,
|
|
7628
7623
|
placement,
|
|
@@ -7651,7 +7646,7 @@ function useTooltip(settings) {
|
|
|
7651
7646
|
const isGroupPhase = opened && currentId && currentId !== uid;
|
|
7652
7647
|
return {
|
|
7653
7648
|
x,
|
|
7654
|
-
y
|
|
7649
|
+
y,
|
|
7655
7650
|
arrowX,
|
|
7656
7651
|
arrowY,
|
|
7657
7652
|
reference: refs.setReference,
|
|
@@ -8220,7 +8215,7 @@ const defaultProps$1 = {
|
|
|
8220
8215
|
max: 100,
|
|
8221
8216
|
step: 1,
|
|
8222
8217
|
marks: [],
|
|
8223
|
-
label: (
|
|
8218
|
+
label: (f) => f,
|
|
8224
8219
|
labelTransitionProps: { transition: "fade", duration: 0 },
|
|
8225
8220
|
thumbLabel: "",
|
|
8226
8221
|
showLabelOnHover: !0,
|
|
@@ -8639,112 +8634,109 @@ const __iconNode$1 = [["path", { d: "M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0", key: "s
|
|
|
8639
8634
|
* See the LICENSE file in the root directory of this source tree.
|
|
8640
8635
|
*/
|
|
8641
8636
|
const __iconNode = [["path", { d: "M4 8v-2a2 2 0 0 1 2 -2h2", key: "svg-0" }], ["path", { d: "M4 16v2a2 2 0 0 0 2 2h2", key: "svg-1" }], ["path", { d: "M16 4h2a2 2 0 0 1 2 2v2", key: "svg-2" }], ["path", { d: "M16 20h2a2 2 0 0 0 2 -2v-2", key: "svg-3" }], ["path", { d: "M8 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0", key: "svg-4" }], ["path", { d: "M16 16l-2.5 -2.5", key: "svg-5" }]], IconZoomScan = createReactComponent("outline", "zoom-scan", "ZoomScan", __iconNode);
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8637
|
+
function e$5(e2, t2, n2) {
|
|
8638
|
+
let r2 = (n3) => e2(n3, ...t2);
|
|
8639
|
+
return n2 === void 0 ? r2 : Object.assign(r2, { lazy: n2, lazyArgs: t2 });
|
|
8640
|
+
}
|
|
8641
|
+
function t$a(t2, n2, r2) {
|
|
8642
|
+
let i2 = t2.length - n2.length;
|
|
8643
|
+
if (i2 === 0) return t2(...n2);
|
|
8644
|
+
if (i2 === 1) return e$5(t2, n2, r2);
|
|
8645
|
+
throw Error("Wrong number of arguments");
|
|
8646
|
+
}
|
|
8647
|
+
function t$9(...t2) {
|
|
8648
|
+
return t$a(n$5, t2);
|
|
8649
|
+
}
|
|
8650
|
+
const n$5 = (e2, { min: t2, max: n2 }) => t2 !== void 0 && e2 < t2 ? t2 : n2 !== void 0 && e2 > n2 ? n2 : e2, t$8 = { done: !1, hasNext: !1 };
|
|
8651
|
+
function t$7(e2, ...t2) {
|
|
8652
|
+
let a = e2, o = t2.map((e3) => "lazy" in e3 ? r$1(e3) : void 0), s = 0;
|
|
8653
|
+
for (; s < t2.length; ) {
|
|
8654
|
+
if (o[s] === void 0 || !i(a)) {
|
|
8655
|
+
let e4 = t2[s];
|
|
8656
|
+
a = e4(a), s += 1;
|
|
8649
8657
|
continue;
|
|
8650
8658
|
}
|
|
8651
|
-
let
|
|
8652
|
-
for (let
|
|
8653
|
-
let
|
|
8654
|
-
if (
|
|
8659
|
+
let e3 = [];
|
|
8660
|
+
for (let n2 = s; n2 < t2.length; n2++) {
|
|
8661
|
+
let t3 = o[n2];
|
|
8662
|
+
if (t3 === void 0 || (e3.push(t3), t3.isSingle)) break;
|
|
8655
8663
|
}
|
|
8656
|
-
let
|
|
8657
|
-
for (let
|
|
8658
|
-
let { isSingle:
|
|
8659
|
-
|
|
8664
|
+
let r2 = [];
|
|
8665
|
+
for (let t3 of a) if (n$4(t3, r2, e3)) break;
|
|
8666
|
+
let { isSingle: c } = e3.at(-1);
|
|
8667
|
+
a = c ? r2[0] : r2, s += e3.length;
|
|
8660
8668
|
}
|
|
8661
|
-
return
|
|
8669
|
+
return a;
|
|
8662
8670
|
}
|
|
8663
|
-
function
|
|
8664
|
-
if (
|
|
8665
|
-
let
|
|
8666
|
-
for (let [
|
|
8667
|
-
let { index:
|
|
8668
|
-
if (
|
|
8669
|
-
if (
|
|
8670
|
-
for (let
|
|
8671
|
-
return
|
|
8671
|
+
function n$4(t2, r2, i2) {
|
|
8672
|
+
if (i2.length === 0) return r2.push(t2), !1;
|
|
8673
|
+
let a = t2, o = t$8, s = !1;
|
|
8674
|
+
for (let [e2, t3] of i2.entries()) {
|
|
8675
|
+
let { index: c, items: l } = t3;
|
|
8676
|
+
if (l.push(a), o = t3(a, c, l), t3.index += 1, o.hasNext) {
|
|
8677
|
+
if (o.hasMany ?? !1) {
|
|
8678
|
+
for (let t4 of o.next) if (n$4(t4, r2, i2.slice(e2 + 1))) return !0;
|
|
8679
|
+
return s;
|
|
8672
8680
|
}
|
|
8673
|
-
|
|
8681
|
+
a = o.next;
|
|
8674
8682
|
}
|
|
8675
|
-
if (!
|
|
8676
|
-
|
|
8683
|
+
if (!o.hasNext) break;
|
|
8684
|
+
o.done && (s = !0);
|
|
8677
8685
|
}
|
|
8678
|
-
return
|
|
8679
|
-
}
|
|
8680
|
-
function y(t2) {
|
|
8681
|
-
let { lazy: o2, lazyArgs: n2 } = t2, u2 = o2(...n2);
|
|
8682
|
-
return Object.assign(u2, { isSingle: o2.single ?? !1, index: 0, items: [] });
|
|
8683
|
-
}
|
|
8684
|
-
function B(t2) {
|
|
8685
|
-
return typeof t2 == "string" || typeof t2 == "object" && t2 !== null && Symbol.iterator in t2;
|
|
8686
|
+
return o.hasNext && r2.push(a), s;
|
|
8686
8687
|
}
|
|
8687
|
-
function
|
|
8688
|
-
let t2 =
|
|
8689
|
-
return
|
|
8690
|
-
}
|
|
8691
|
-
function u$2(r2, n2, o2) {
|
|
8692
|
-
let a = r2.length - n2.length;
|
|
8693
|
-
if (a === 0) return r2(...n2);
|
|
8694
|
-
if (a === 1) return u$3(r2, n2, o2);
|
|
8695
|
-
throw new Error("Wrong number of arguments");
|
|
8688
|
+
function r$1(e2) {
|
|
8689
|
+
let { lazy: t2, lazyArgs: n2 } = e2, r2 = t2(...n2);
|
|
8690
|
+
return Object.assign(r2, { isSingle: t2.single ?? !1, index: 0, items: [] });
|
|
8696
8691
|
}
|
|
8697
|
-
function i
|
|
8698
|
-
return
|
|
8692
|
+
function i(e2) {
|
|
8693
|
+
return typeof e2 == "string" || typeof e2 == "object" && !!e2 && Symbol.iterator in e2;
|
|
8699
8694
|
}
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
return u$2(d, n2);
|
|
8695
|
+
function t$6(...t2) {
|
|
8696
|
+
return t$a(n$3, t2);
|
|
8703
8697
|
}
|
|
8704
|
-
|
|
8705
|
-
|
|
8706
|
-
|
|
8707
|
-
let [y2, u2] = o2(t2, a, n2);
|
|
8708
|
-
e2[y2] = u2;
|
|
8709
|
-
}
|
|
8710
|
-
return e2;
|
|
8698
|
+
const n$3 = (e2, t2) => e2.length >= t2;
|
|
8699
|
+
function t$5(...t2) {
|
|
8700
|
+
return t$a(Object.entries, t2);
|
|
8711
8701
|
}
|
|
8712
|
-
function
|
|
8713
|
-
return
|
|
8702
|
+
function t$4(...t2) {
|
|
8703
|
+
return t$a(n$2, t2, r);
|
|
8714
8704
|
}
|
|
8715
|
-
|
|
8716
|
-
|
|
8705
|
+
const n$2 = (e2, t2) => e2.flatMap(t2), r = (e2) => (t2, n2, r2) => {
|
|
8706
|
+
let i2 = e2(t2, n2, r2);
|
|
8707
|
+
return Array.isArray(i2) ? { done: !1, hasNext: !0, hasMany: !0, next: i2 } : { done: !1, hasNext: !0, next: i2 };
|
|
8708
|
+
};
|
|
8709
|
+
function e$4(e2) {
|
|
8710
|
+
return Array.isArray(e2);
|
|
8717
8711
|
}
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
-
return u$2(Object.keys, n2);
|
|
8712
|
+
function e$3(e2) {
|
|
8713
|
+
return e2 === "" || e2 === void 0 ? !0 : Array.isArray(e2) ? e2.length === 0 : Object.keys(e2).length === 0;
|
|
8721
8714
|
}
|
|
8722
|
-
|
|
8723
|
-
|
|
8715
|
+
const e$2 = (e2) => typeof e2 == "function";
|
|
8716
|
+
function e$1(e2) {
|
|
8717
|
+
return typeof e2 == "number" && !Number.isNaN(e2);
|
|
8724
8718
|
}
|
|
8725
|
-
function
|
|
8726
|
-
return e2
|
|
8719
|
+
function e(e2) {
|
|
8720
|
+
return !!e2;
|
|
8727
8721
|
}
|
|
8728
|
-
function t$
|
|
8729
|
-
return
|
|
8722
|
+
function t$3(...t2) {
|
|
8723
|
+
return t$a(n$1, t2);
|
|
8730
8724
|
}
|
|
8731
|
-
|
|
8732
|
-
|
|
8725
|
+
const n$1 = (e2, t2) => e2.join(t2);
|
|
8726
|
+
function t$2(...t2) {
|
|
8727
|
+
return t$a(Object.keys, t2);
|
|
8733
8728
|
}
|
|
8734
|
-
function
|
|
8735
|
-
return
|
|
8729
|
+
function t$1(...t2) {
|
|
8730
|
+
return t$a(n, t2);
|
|
8736
8731
|
}
|
|
8737
|
-
|
|
8738
|
-
let n2 =
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
function u(...n2) {
|
|
8745
|
-
return u$2(i, n2);
|
|
8732
|
+
function n(e2, t2) {
|
|
8733
|
+
let n2 = {};
|
|
8734
|
+
for (let [r2, i2] of e2.entries()) {
|
|
8735
|
+
let [a, o] = t2(i2, r2, e2);
|
|
8736
|
+
n2[a] = o;
|
|
8737
|
+
}
|
|
8738
|
+
return n2;
|
|
8746
8739
|
}
|
|
8747
|
-
var i = (n2, { min: e2, max: r2 }) => e2 !== void 0 && n2 < e2 ? e2 : r2 !== void 0 && n2 > r2 ? r2 : n2;
|
|
8748
8740
|
const LayoutGroupContext = createContext({});
|
|
8749
8741
|
function useConstant(init2) {
|
|
8750
8742
|
const ref = useRef(null);
|
|
@@ -9921,23 +9913,23 @@ function onRemove(typename) {
|
|
|
9921
9913
|
return function() {
|
|
9922
9914
|
var on = this.__on;
|
|
9923
9915
|
if (on) {
|
|
9924
|
-
for (var j = 0, i2 = -1, m2 = on.length,
|
|
9925
|
-
|
|
9916
|
+
for (var j = 0, i2 = -1, m2 = on.length, o; j < m2; ++j)
|
|
9917
|
+
o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name ? this.removeEventListener(o.type, o.listener, o.options) : on[++i2] = o;
|
|
9926
9918
|
++i2 ? on.length = i2 : delete this.__on;
|
|
9927
9919
|
}
|
|
9928
9920
|
};
|
|
9929
9921
|
}
|
|
9930
9922
|
function onAdd(typename, value, options) {
|
|
9931
9923
|
return function() {
|
|
9932
|
-
var on = this.__on,
|
|
9924
|
+
var on = this.__on, o, listener = contextListener(value);
|
|
9933
9925
|
if (on) {
|
|
9934
9926
|
for (var j = 0, m2 = on.length; j < m2; ++j)
|
|
9935
|
-
if ((
|
|
9936
|
-
this.removeEventListener(
|
|
9927
|
+
if ((o = on[j]).type === typename.type && o.name === typename.name) {
|
|
9928
|
+
this.removeEventListener(o.type, o.listener, o.options), this.addEventListener(o.type, o.listener = listener, o.options = options), o.value = value;
|
|
9937
9929
|
return;
|
|
9938
9930
|
}
|
|
9939
9931
|
}
|
|
9940
|
-
this.addEventListener(typename.type, listener, options),
|
|
9932
|
+
this.addEventListener(typename.type, listener, options), o = { type: typename.type, name: typename.name, value, listener, options }, on ? on.push(o) : this.__on = [o];
|
|
9941
9933
|
};
|
|
9942
9934
|
}
|
|
9943
9935
|
function selection_on(typename, value, options) {
|
|
@@ -9945,10 +9937,10 @@ function selection_on(typename, value, options) {
|
|
|
9945
9937
|
if (arguments.length < 2) {
|
|
9946
9938
|
var on = this.node().__on;
|
|
9947
9939
|
if (on) {
|
|
9948
|
-
for (var j = 0, m2 = on.length,
|
|
9949
|
-
for (i2 = 0,
|
|
9950
|
-
if ((t2 = typenames[i2]).type ===
|
|
9951
|
-
return
|
|
9940
|
+
for (var j = 0, m2 = on.length, o; j < m2; ++j)
|
|
9941
|
+
for (i2 = 0, o = on[j]; i2 < n2; ++i2)
|
|
9942
|
+
if ((t2 = typenames[i2]).type === o.type && t2.name === o.name)
|
|
9943
|
+
return o.value;
|
|
9952
9944
|
}
|
|
9953
9945
|
return;
|
|
9954
9946
|
}
|
|
@@ -10072,7 +10064,7 @@ function DragEvent(type, {
|
|
|
10072
10064
|
identifier,
|
|
10073
10065
|
active,
|
|
10074
10066
|
x,
|
|
10075
|
-
y
|
|
10067
|
+
y,
|
|
10076
10068
|
dx,
|
|
10077
10069
|
dy,
|
|
10078
10070
|
dispatch: dispatch2
|
|
@@ -10085,7 +10077,7 @@ function DragEvent(type, {
|
|
|
10085
10077
|
identifier: { value: identifier, enumerable: !0, configurable: !0 },
|
|
10086
10078
|
active: { value: active, enumerable: !0, configurable: !0 },
|
|
10087
10079
|
x: { value: x, enumerable: !0, configurable: !0 },
|
|
10088
|
-
y: { value:
|
|
10080
|
+
y: { value: y, enumerable: !0, configurable: !0 },
|
|
10089
10081
|
dx: { value: dx, enumerable: !0, configurable: !0 },
|
|
10090
10082
|
dy: { value: dy, enumerable: !0, configurable: !0 },
|
|
10091
10083
|
_: { value: dispatch2 }
|
|
@@ -10101,8 +10093,8 @@ function defaultFilter$1(event) {
|
|
|
10101
10093
|
function defaultContainer() {
|
|
10102
10094
|
return this.parentNode;
|
|
10103
10095
|
}
|
|
10104
|
-
function defaultSubject(event,
|
|
10105
|
-
return
|
|
10096
|
+
function defaultSubject(event, d) {
|
|
10097
|
+
return d ?? { x: event.x, y: event.y };
|
|
10106
10098
|
}
|
|
10107
10099
|
function defaultTouchable$1() {
|
|
10108
10100
|
return navigator.maxTouchPoints || "ontouchstart" in this;
|
|
@@ -10112,9 +10104,9 @@ function drag() {
|
|
|
10112
10104
|
function drag2(selection2) {
|
|
10113
10105
|
selection2.on("mousedown.drag", mousedowned).filter(touchable).on("touchstart.drag", touchstarted).on("touchmove.drag", touchmoved, nonpassive).on("touchend.drag touchcancel.drag", touchended).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
10114
10106
|
}
|
|
10115
|
-
function mousedowned(event,
|
|
10116
|
-
if (!(touchending || !filter2.call(this, event,
|
|
10117
|
-
var gesture = beforestart(this, container2.call(this, event,
|
|
10107
|
+
function mousedowned(event, d) {
|
|
10108
|
+
if (!(touchending || !filter2.call(this, event, d))) {
|
|
10109
|
+
var gesture = beforestart(this, container2.call(this, event, d), event, d, "mouse");
|
|
10118
10110
|
gesture && (select(event.view).on("mousemove.drag", mousemoved, nonpassivecapture).on("mouseup.drag", mouseupped, nonpassivecapture), dragDisable(event.view), nopropagation$1(event), mousemoving = !1, mousedownx = event.clientX, mousedowny = event.clientY, gesture("start", event));
|
|
10119
10111
|
}
|
|
10120
10112
|
}
|
|
@@ -10128,11 +10120,11 @@ function drag() {
|
|
|
10128
10120
|
function mouseupped(event) {
|
|
10129
10121
|
select(event.view).on("mousemove.drag mouseup.drag", null), yesdrag(event.view, mousemoving), noevent$1(event), gestures.mouse("end", event);
|
|
10130
10122
|
}
|
|
10131
|
-
function touchstarted(event,
|
|
10132
|
-
if (filter2.call(this, event,
|
|
10133
|
-
var touches = event.changedTouches, c = container2.call(this, event,
|
|
10123
|
+
function touchstarted(event, d) {
|
|
10124
|
+
if (filter2.call(this, event, d)) {
|
|
10125
|
+
var touches = event.changedTouches, c = container2.call(this, event, d), n2 = touches.length, i2, gesture;
|
|
10134
10126
|
for (i2 = 0; i2 < n2; ++i2)
|
|
10135
|
-
(gesture = beforestart(this, c, event,
|
|
10127
|
+
(gesture = beforestart(this, c, event, d, touches[i2].identifier, touches[i2])) && (nopropagation$1(event), gesture("start", event, touches[i2]));
|
|
10136
10128
|
}
|
|
10137
10129
|
}
|
|
10138
10130
|
function touchmoved(event) {
|
|
@@ -10147,9 +10139,9 @@ function drag() {
|
|
|
10147
10139
|
}, 500), i2 = 0; i2 < n2; ++i2)
|
|
10148
10140
|
(gesture = gestures[touches[i2].identifier]) && (nopropagation$1(event), gesture("end", event, touches[i2]));
|
|
10149
10141
|
}
|
|
10150
|
-
function beforestart(that, container3, event,
|
|
10151
|
-
var dispatch2 = listeners.copy(), p = pointer(touch || event, container3), dx, dy,
|
|
10152
|
-
if ((
|
|
10142
|
+
function beforestart(that, container3, event, d, identifier, touch) {
|
|
10143
|
+
var dispatch2 = listeners.copy(), p = pointer(touch || event, container3), dx, dy, s;
|
|
10144
|
+
if ((s = subject.call(that, new DragEvent("beforestart", {
|
|
10153
10145
|
sourceEvent: event,
|
|
10154
10146
|
target: drag2,
|
|
10155
10147
|
identifier,
|
|
@@ -10159,8 +10151,8 @@ function drag() {
|
|
|
10159
10151
|
dx: 0,
|
|
10160
10152
|
dy: 0,
|
|
10161
10153
|
dispatch: dispatch2
|
|
10162
|
-
}),
|
|
10163
|
-
return dx =
|
|
10154
|
+
}), d)) != null)
|
|
10155
|
+
return dx = s.x - p[0] || 0, dy = s.y - p[1] || 0, function gesture(type, event2, touch2) {
|
|
10164
10156
|
var p0 = p, n2;
|
|
10165
10157
|
switch (type) {
|
|
10166
10158
|
case "start":
|
|
@@ -10178,7 +10170,7 @@ function drag() {
|
|
|
10178
10170
|
that,
|
|
10179
10171
|
new DragEvent(type, {
|
|
10180
10172
|
sourceEvent: event2,
|
|
10181
|
-
subject:
|
|
10173
|
+
subject: s,
|
|
10182
10174
|
target: drag2,
|
|
10183
10175
|
identifier,
|
|
10184
10176
|
active: n2,
|
|
@@ -10188,7 +10180,7 @@ function drag() {
|
|
|
10188
10180
|
dy: p[1] - p0[1],
|
|
10189
10181
|
dispatch: dispatch2
|
|
10190
10182
|
}),
|
|
10191
|
-
|
|
10183
|
+
d
|
|
10192
10184
|
);
|
|
10193
10185
|
};
|
|
10194
10186
|
}
|
|
@@ -10395,8 +10387,8 @@ function color_formatRgb() {
|
|
|
10395
10387
|
return this.rgb().formatRgb();
|
|
10396
10388
|
}
|
|
10397
10389
|
function color(format) {
|
|
10398
|
-
var m2,
|
|
10399
|
-
return format = (format + "").trim().toLowerCase(), (m2 = reHex.exec(format)) ? (
|
|
10390
|
+
var m2, l;
|
|
10391
|
+
return format = (format + "").trim().toLowerCase(), (m2 = reHex.exec(format)) ? (l = m2[1].length, m2 = parseInt(m2[1], 16), l === 6 ? rgbn(m2) : l === 3 ? new Rgb(m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, (m2 & 15) << 4 | m2 & 15, 1) : l === 8 ? rgba(m2 >> 24 & 255, m2 >> 16 & 255, m2 >> 8 & 255, (m2 & 255) / 255) : l === 4 ? rgba(m2 >> 12 & 15 | m2 >> 8 & 240, m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, ((m2 & 15) << 4 | m2 & 15) / 255) : null) : (m2 = reRgbInteger.exec(format)) ? new Rgb(m2[1], m2[2], m2[3], 1) : (m2 = reRgbPercent.exec(format)) ? new Rgb(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, 1) : (m2 = reRgbaInteger.exec(format)) ? rgba(m2[1], m2[2], m2[3], m2[4]) : (m2 = reRgbaPercent.exec(format)) ? rgba(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, m2[4]) : (m2 = reHslPercent.exec(format)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, 1) : (m2 = reHslaPercent.exec(format)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, m2[4]) : named.hasOwnProperty(format) ? rgbn(named[format]) : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
|
|
10400
10392
|
}
|
|
10401
10393
|
function rgbn(n2) {
|
|
10402
10394
|
return new Rgb(n2 >> 16 & 255, n2 >> 8 & 255, n2 & 255, 1);
|
|
@@ -10404,8 +10396,8 @@ function rgbn(n2) {
|
|
|
10404
10396
|
function rgba(r2, g, b, a) {
|
|
10405
10397
|
return a <= 0 && (r2 = g = b = NaN), new Rgb(r2, g, b, a);
|
|
10406
10398
|
}
|
|
10407
|
-
function rgbConvert(
|
|
10408
|
-
return
|
|
10399
|
+
function rgbConvert(o) {
|
|
10400
|
+
return o instanceof Color || (o = color(o)), o ? (o = o.rgb(), new Rgb(o.r, o.g, o.b, o.opacity)) : new Rgb();
|
|
10409
10401
|
}
|
|
10410
10402
|
function rgb(r2, g, b, opacity) {
|
|
10411
10403
|
return arguments.length === 1 ? rgbConvert(r2) : new Rgb(r2, g, b, opacity ?? 1);
|
|
@@ -10455,22 +10447,22 @@ function clampi(value) {
|
|
|
10455
10447
|
function hex(value) {
|
|
10456
10448
|
return value = clampi(value), (value < 16 ? "0" : "") + value.toString(16);
|
|
10457
10449
|
}
|
|
10458
|
-
function hsla(h,
|
|
10459
|
-
return a <= 0 ? h =
|
|
10450
|
+
function hsla(h, s, l, a) {
|
|
10451
|
+
return a <= 0 ? h = s = l = NaN : l <= 0 || l >= 1 ? h = s = NaN : s <= 0 && (h = NaN), new Hsl(h, s, l, a);
|
|
10460
10452
|
}
|
|
10461
|
-
function hslConvert(
|
|
10462
|
-
if (
|
|
10463
|
-
if (
|
|
10464
|
-
if (
|
|
10465
|
-
|
|
10466
|
-
var r2 =
|
|
10467
|
-
return
|
|
10453
|
+
function hslConvert(o) {
|
|
10454
|
+
if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
|
|
10455
|
+
if (o instanceof Color || (o = color(o)), !o) return new Hsl();
|
|
10456
|
+
if (o instanceof Hsl) return o;
|
|
10457
|
+
o = o.rgb();
|
|
10458
|
+
var r2 = o.r / 255, g = o.g / 255, b = o.b / 255, min2 = Math.min(r2, g, b), max2 = Math.max(r2, g, b), h = NaN, s = max2 - min2, l = (max2 + min2) / 2;
|
|
10459
|
+
return s ? (r2 === max2 ? h = (g - b) / s + (g < b) * 6 : g === max2 ? h = (b - r2) / s + 2 : h = (r2 - g) / s + 4, s /= l < 0.5 ? max2 + min2 : 2 - max2 - min2, h *= 60) : s = l > 0 && l < 1 ? 0 : h, new Hsl(h, s, l, o.opacity);
|
|
10468
10460
|
}
|
|
10469
|
-
function hsl(h,
|
|
10470
|
-
return arguments.length === 1 ? hslConvert(h) : new Hsl(h,
|
|
10461
|
+
function hsl(h, s, l, opacity) {
|
|
10462
|
+
return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity ?? 1);
|
|
10471
10463
|
}
|
|
10472
|
-
function Hsl(h,
|
|
10473
|
-
this.h = +h, this.s = +
|
|
10464
|
+
function Hsl(h, s, l, opacity) {
|
|
10465
|
+
this.h = +h, this.s = +s, this.l = +l, this.opacity = +opacity;
|
|
10474
10466
|
}
|
|
10475
10467
|
define(Hsl, hsl, extend(Color, {
|
|
10476
10468
|
brighter(k) {
|
|
@@ -10480,7 +10472,7 @@ define(Hsl, hsl, extend(Color, {
|
|
|
10480
10472
|
return k = k == null ? darker : Math.pow(darker, k), new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
10481
10473
|
},
|
|
10482
10474
|
rgb() {
|
|
10483
|
-
var h = this.h % 360 + (this.h < 0) * 360,
|
|
10475
|
+
var h = this.h % 360 + (this.h < 0) * 360, s = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s, m1 = 2 * l - m2;
|
|
10484
10476
|
return new Rgb(
|
|
10485
10477
|
hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
|
|
10486
10478
|
hsl2rgb(h, m1, m2),
|
|
@@ -10509,27 +10501,27 @@ function hsl2rgb(h, m1, m2) {
|
|
|
10509
10501
|
return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
|
|
10510
10502
|
}
|
|
10511
10503
|
const constant$1 = (x) => () => x;
|
|
10512
|
-
function linear(a,
|
|
10504
|
+
function linear(a, d) {
|
|
10513
10505
|
return function(t2) {
|
|
10514
|
-
return a + t2 *
|
|
10506
|
+
return a + t2 * d;
|
|
10515
10507
|
};
|
|
10516
10508
|
}
|
|
10517
|
-
function exponential(a, b,
|
|
10518
|
-
return a = Math.pow(a,
|
|
10519
|
-
return Math.pow(a + t2 * b,
|
|
10509
|
+
function exponential(a, b, y) {
|
|
10510
|
+
return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t2) {
|
|
10511
|
+
return Math.pow(a + t2 * b, y);
|
|
10520
10512
|
};
|
|
10521
10513
|
}
|
|
10522
|
-
function gamma(
|
|
10523
|
-
return (
|
|
10524
|
-
return b - a ? exponential(a, b,
|
|
10514
|
+
function gamma(y) {
|
|
10515
|
+
return (y = +y) == 1 ? nogamma : function(a, b) {
|
|
10516
|
+
return b - a ? exponential(a, b, y) : constant$1(isNaN(a) ? b : a);
|
|
10525
10517
|
};
|
|
10526
10518
|
}
|
|
10527
10519
|
function nogamma(a, b) {
|
|
10528
|
-
var
|
|
10529
|
-
return
|
|
10520
|
+
var d = b - a;
|
|
10521
|
+
return d ? linear(a, d) : constant$1(isNaN(a) ? b : a);
|
|
10530
10522
|
}
|
|
10531
|
-
const interpolateRgb = (function rgbGamma(
|
|
10532
|
-
var color2 = gamma(
|
|
10523
|
+
const interpolateRgb = (function rgbGamma(y) {
|
|
10524
|
+
var color2 = gamma(y);
|
|
10533
10525
|
function rgb$1(start2, end) {
|
|
10534
10526
|
var r2 = color2((start2 = rgb(start2)).r, (end = rgb(end)).r), g = color2(start2.g, end.g), b = color2(start2.b, end.b), opacity = nogamma(start2.opacity, end.opacity);
|
|
10535
10527
|
return function(t2) {
|
|
@@ -10559,9 +10551,9 @@ function genericArray(a, b) {
|
|
|
10559
10551
|
};
|
|
10560
10552
|
}
|
|
10561
10553
|
function date(a, b) {
|
|
10562
|
-
var
|
|
10554
|
+
var d = /* @__PURE__ */ new Date();
|
|
10563
10555
|
return a = +a, b = +b, function(t2) {
|
|
10564
|
-
return
|
|
10556
|
+
return d.setTime(a * (1 - t2) + b * t2), d;
|
|
10565
10557
|
};
|
|
10566
10558
|
}
|
|
10567
10559
|
function interpolateNumber(a, b) {
|
|
@@ -10591,12 +10583,12 @@ function one(b) {
|
|
|
10591
10583
|
};
|
|
10592
10584
|
}
|
|
10593
10585
|
function interpolateString(a, b) {
|
|
10594
|
-
var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i2 = -1,
|
|
10586
|
+
var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i2 = -1, s = [], q = [];
|
|
10595
10587
|
for (a = a + "", b = b + ""; (am = reA.exec(a)) && (bm = reB.exec(b)); )
|
|
10596
|
-
(bs = bm.index) > bi && (bs = b.slice(bi, bs),
|
|
10597
|
-
return bi < b.length && (bs = b.slice(bi),
|
|
10598
|
-
for (var i3 = 0,
|
|
10599
|
-
return
|
|
10588
|
+
(bs = bm.index) > bi && (bs = b.slice(bi, bs), s[i2] ? s[i2] += bs : s[++i2] = bs), (am = am[0]) === (bm = bm[0]) ? s[i2] ? s[i2] += bm : s[++i2] = bm : (s[++i2] = null, q.push({ i: i2, x: interpolateNumber(am, bm) })), bi = reB.lastIndex;
|
|
10589
|
+
return bi < b.length && (bs = b.slice(bi), s[i2] ? s[i2] += bs : s[++i2] = bs), s.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function(t2) {
|
|
10590
|
+
for (var i3 = 0, o; i3 < b; ++i3) s[(o = q[i3]).i] = o.x(t2);
|
|
10591
|
+
return s.join("");
|
|
10600
10592
|
});
|
|
10601
10593
|
}
|
|
10602
10594
|
function interpolate$1(a, b) {
|
|
@@ -10611,11 +10603,11 @@ var degrees = 180 / Math.PI, identity$2 = {
|
|
|
10611
10603
|
scaleX: 1,
|
|
10612
10604
|
scaleY: 1
|
|
10613
10605
|
};
|
|
10614
|
-
function decompose(a, b, c,
|
|
10606
|
+
function decompose(a, b, c, d, e2, f) {
|
|
10615
10607
|
var scaleX, scaleY, skewX;
|
|
10616
|
-
return (scaleX = Math.sqrt(a * a + b * b)) && (a /= scaleX, b /= scaleX), (skewX = a * c + b *
|
|
10608
|
+
return (scaleX = Math.sqrt(a * a + b * b)) && (a /= scaleX, b /= scaleX), (skewX = a * c + b * d) && (c -= a * skewX, d -= b * skewX), (scaleY = Math.sqrt(c * c + d * d)) && (c /= scaleY, d /= scaleY, skewX /= scaleY), a * d < b * c && (a = -a, b = -b, skewX = -skewX, scaleX = -scaleX), {
|
|
10617
10609
|
translateX: e2,
|
|
10618
|
-
translateY:
|
|
10610
|
+
translateY: f,
|
|
10619
10611
|
rotate: Math.atan2(b, a) * degrees,
|
|
10620
10612
|
skewX: Math.atan(skewX) * degrees,
|
|
10621
10613
|
scaleX,
|
|
@@ -10631,32 +10623,32 @@ function parseSvg(value) {
|
|
|
10631
10623
|
return value == null || (svgNode || (svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g")), svgNode.setAttribute("transform", value), !(value = svgNode.transform.baseVal.consolidate())) ? identity$2 : (value = value.matrix, decompose(value.a, value.b, value.c, value.d, value.e, value.f));
|
|
10632
10624
|
}
|
|
10633
10625
|
function interpolateTransform(parse2, pxComma, pxParen, degParen) {
|
|
10634
|
-
function pop(
|
|
10635
|
-
return
|
|
10626
|
+
function pop(s) {
|
|
10627
|
+
return s.length ? s.pop() + " " : "";
|
|
10636
10628
|
}
|
|
10637
|
-
function translate(xa, ya, xb, yb,
|
|
10629
|
+
function translate(xa, ya, xb, yb, s, q) {
|
|
10638
10630
|
if (xa !== xb || ya !== yb) {
|
|
10639
|
-
var i2 =
|
|
10631
|
+
var i2 = s.push("translate(", null, pxComma, null, pxParen);
|
|
10640
10632
|
q.push({ i: i2 - 4, x: interpolateNumber(xa, xb) }, { i: i2 - 2, x: interpolateNumber(ya, yb) });
|
|
10641
|
-
} else (xb || yb) &&
|
|
10633
|
+
} else (xb || yb) && s.push("translate(" + xb + pxComma + yb + pxParen);
|
|
10642
10634
|
}
|
|
10643
|
-
function rotate(a, b,
|
|
10644
|
-
a !== b ? (a - b > 180 ? b += 360 : b - a > 180 && (a += 360), q.push({ i:
|
|
10635
|
+
function rotate(a, b, s, q) {
|
|
10636
|
+
a !== b ? (a - b > 180 ? b += 360 : b - a > 180 && (a += 360), q.push({ i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: interpolateNumber(a, b) })) : b && s.push(pop(s) + "rotate(" + b + degParen);
|
|
10645
10637
|
}
|
|
10646
|
-
function skewX(a, b,
|
|
10647
|
-
a !== b ? q.push({ i:
|
|
10638
|
+
function skewX(a, b, s, q) {
|
|
10639
|
+
a !== b ? q.push({ i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: interpolateNumber(a, b) }) : b && s.push(pop(s) + "skewX(" + b + degParen);
|
|
10648
10640
|
}
|
|
10649
|
-
function scale2(xa, ya, xb, yb,
|
|
10641
|
+
function scale2(xa, ya, xb, yb, s, q) {
|
|
10650
10642
|
if (xa !== xb || ya !== yb) {
|
|
10651
|
-
var i2 =
|
|
10643
|
+
var i2 = s.push(pop(s) + "scale(", null, ",", null, ")");
|
|
10652
10644
|
q.push({ i: i2 - 4, x: interpolateNumber(xa, xb) }, { i: i2 - 2, x: interpolateNumber(ya, yb) });
|
|
10653
|
-
} else (xb !== 1 || yb !== 1) &&
|
|
10645
|
+
} else (xb !== 1 || yb !== 1) && s.push(pop(s) + "scale(" + xb + "," + yb + ")");
|
|
10654
10646
|
}
|
|
10655
10647
|
return function(a, b) {
|
|
10656
|
-
var
|
|
10657
|
-
return a = parse2(a), b = parse2(b), translate(a.translateX, a.translateY, b.translateX, b.translateY,
|
|
10658
|
-
for (var i2 = -1, n2 = q.length,
|
|
10659
|
-
return
|
|
10648
|
+
var s = [], q = [];
|
|
10649
|
+
return a = parse2(a), b = parse2(b), translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q), rotate(a.rotate, b.rotate, s, q), skewX(a.skewX, b.skewX, s, q), scale2(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q), a = b = null, function(t2) {
|
|
10650
|
+
for (var i2 = -1, n2 = q.length, o; ++i2 < n2; ) s[(o = q[i2]).i] = o.x(t2);
|
|
10651
|
+
return s.join("");
|
|
10660
10652
|
};
|
|
10661
10653
|
};
|
|
10662
10654
|
}
|
|
@@ -10684,11 +10676,11 @@ const interpolateZoom = (function zoomRho(rho, rho2, rho4) {
|
|
|
10684
10676
|
else {
|
|
10685
10677
|
var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
|
|
10686
10678
|
S = (r1 - r0) / rho, i2 = function(t2) {
|
|
10687
|
-
var
|
|
10679
|
+
var s = t2 * S, coshr0 = cosh(r0), u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
|
|
10688
10680
|
return [
|
|
10689
|
-
ux0 +
|
|
10690
|
-
uy0 +
|
|
10691
|
-
w0 * coshr0 / cosh(rho *
|
|
10681
|
+
ux0 + u * dx,
|
|
10682
|
+
uy0 + u * dy,
|
|
10683
|
+
w0 * coshr0 / cosh(rho * s + r0)
|
|
10692
10684
|
];
|
|
10693
10685
|
};
|
|
10694
10686
|
}
|
|
@@ -10699,8 +10691,8 @@ const interpolateZoom = (function zoomRho(rho, rho2, rho4) {
|
|
|
10699
10691
|
return zoomRho(_1, _2, _4);
|
|
10700
10692
|
}, zoom2;
|
|
10701
10693
|
})(Math.SQRT2, 2, 4);
|
|
10702
|
-
var frame = 0, timeout$1 = 0, interval = 0, pokeDelay = 1e3, taskHead, taskTail, clockLast = 0, clockNow = 0, clockSkew = 0, clock = typeof performance == "object" && performance.now ? performance : Date, setFrame = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(
|
|
10703
|
-
setTimeout(
|
|
10694
|
+
var frame = 0, timeout$1 = 0, interval = 0, pokeDelay = 1e3, taskHead, taskTail, clockLast = 0, clockNow = 0, clockSkew = 0, clock = typeof performance == "object" && performance.now ? performance : Date, setFrame = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) {
|
|
10695
|
+
setTimeout(f, 17);
|
|
10704
10696
|
};
|
|
10705
10697
|
function now() {
|
|
10706
10698
|
return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
|
|
@@ -10804,18 +10796,18 @@ function create(node, id2, self2) {
|
|
|
10804
10796
|
self2.state = SCHEDULED, self2.timer.restart(start2, self2.delay, self2.time), self2.delay <= elapsed && start2(elapsed - self2.delay);
|
|
10805
10797
|
}
|
|
10806
10798
|
function start2(elapsed) {
|
|
10807
|
-
var i2, j, n2,
|
|
10799
|
+
var i2, j, n2, o;
|
|
10808
10800
|
if (self2.state !== SCHEDULED) return stop();
|
|
10809
10801
|
for (i2 in schedules)
|
|
10810
|
-
if (
|
|
10811
|
-
if (
|
|
10812
|
-
|
|
10802
|
+
if (o = schedules[i2], o.name === self2.name) {
|
|
10803
|
+
if (o.state === STARTED) return timeout(start2);
|
|
10804
|
+
o.state === RUNNING ? (o.state = ENDED, o.timer.stop(), o.on.call("interrupt", node, node.__data__, o.index, o.group), delete schedules[i2]) : +i2 < id2 && (o.state = ENDED, o.timer.stop(), o.on.call("cancel", node, node.__data__, o.index, o.group), delete schedules[i2]);
|
|
10813
10805
|
}
|
|
10814
10806
|
if (timeout(function() {
|
|
10815
10807
|
self2.state === STARTED && (self2.state = RUNNING, self2.timer.restart(tick, self2.delay, self2.time), tick(elapsed));
|
|
10816
10808
|
}), self2.state = STARTING, self2.on.call("start", node, node.__data__, self2.index, self2.group), self2.state === STARTING) {
|
|
10817
10809
|
for (self2.state = STARTED, tween = new Array(n2 = self2.tween.length), i2 = 0, j = -1; i2 < n2; ++i2)
|
|
10818
|
-
(
|
|
10810
|
+
(o = self2.tween[i2].value.call(node, node.__data__, self2.index, self2.group)) && (tween[++j] = o);
|
|
10819
10811
|
tween.length = j + 1;
|
|
10820
10812
|
}
|
|
10821
10813
|
}
|
|
@@ -11086,7 +11078,7 @@ function transition_selectAll(select2) {
|
|
|
11086
11078
|
for (var groups = this._groups, m2 = groups.length, subgroups = [], parents = [], j = 0; j < m2; ++j)
|
|
11087
11079
|
for (var group = groups[j], n2 = group.length, node, i2 = 0; i2 < n2; ++i2)
|
|
11088
11080
|
if (node = group[i2]) {
|
|
11089
|
-
for (var children2 = select2.call(node, node.__data__, i2, group), child, inherit2 = get(node, id2), k = 0,
|
|
11081
|
+
for (var children2 = select2.call(node, node.__data__, i2, group), child, inherit2 = get(node, id2), k = 0, l = children2.length; k < l; ++k)
|
|
11090
11082
|
(child = children2[k]) && schedule(child, name, id2, k, children2, inherit2);
|
|
11091
11083
|
subgroups.push(children2), parents.push(node);
|
|
11092
11084
|
}
|
|
@@ -11294,16 +11286,16 @@ function ZoomEvent(type, {
|
|
|
11294
11286
|
_: { value: dispatch2 }
|
|
11295
11287
|
});
|
|
11296
11288
|
}
|
|
11297
|
-
function Transform(k, x,
|
|
11298
|
-
this.k = k, this.x = x, this.y =
|
|
11289
|
+
function Transform(k, x, y) {
|
|
11290
|
+
this.k = k, this.x = x, this.y = y;
|
|
11299
11291
|
}
|
|
11300
11292
|
Transform.prototype = {
|
|
11301
11293
|
constructor: Transform,
|
|
11302
11294
|
scale: function(k) {
|
|
11303
11295
|
return k === 1 ? this : new Transform(this.k * k, this.x, this.y);
|
|
11304
11296
|
},
|
|
11305
|
-
translate: function(x,
|
|
11306
|
-
return x === 0 &
|
|
11297
|
+
translate: function(x, y) {
|
|
11298
|
+
return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);
|
|
11307
11299
|
},
|
|
11308
11300
|
apply: function(point) {
|
|
11309
11301
|
return [point[0] * this.k + this.x, point[1] * this.k + this.y];
|
|
@@ -11311,8 +11303,8 @@ Transform.prototype = {
|
|
|
11311
11303
|
applyX: function(x) {
|
|
11312
11304
|
return x * this.k + this.x;
|
|
11313
11305
|
},
|
|
11314
|
-
applyY: function(
|
|
11315
|
-
return
|
|
11306
|
+
applyY: function(y) {
|
|
11307
|
+
return y * this.k + this.y;
|
|
11316
11308
|
},
|
|
11317
11309
|
invert: function(location) {
|
|
11318
11310
|
return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
|
|
@@ -11320,14 +11312,14 @@ Transform.prototype = {
|
|
|
11320
11312
|
invertX: function(x) {
|
|
11321
11313
|
return (x - this.x) / this.k;
|
|
11322
11314
|
},
|
|
11323
|
-
invertY: function(
|
|
11324
|
-
return (
|
|
11315
|
+
invertY: function(y) {
|
|
11316
|
+
return (y - this.y) / this.k;
|
|
11325
11317
|
},
|
|
11326
11318
|
rescaleX: function(x) {
|
|
11327
11319
|
return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));
|
|
11328
11320
|
},
|
|
11329
|
-
rescaleY: function(
|
|
11330
|
-
return
|
|
11321
|
+
rescaleY: function(y) {
|
|
11322
|
+
return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));
|
|
11331
11323
|
},
|
|
11332
11324
|
toString: function() {
|
|
11333
11325
|
return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
|
|
@@ -11388,19 +11380,19 @@ function zoom() {
|
|
|
11388
11380
|
var e2 = extent.apply(this, arguments), t0 = this.__zoom, p0 = p == null ? centroid(e2) : typeof p == "function" ? p.apply(this, arguments) : p, p1 = t0.invert(p0), k1 = typeof k == "function" ? k.apply(this, arguments) : k;
|
|
11389
11381
|
return constrain(translate(scale2(t0, k1), p0, p1), e2, translateExtent);
|
|
11390
11382
|
}, p, event);
|
|
11391
|
-
}, zoom2.translateBy = function(selection2, x,
|
|
11383
|
+
}, zoom2.translateBy = function(selection2, x, y, event) {
|
|
11392
11384
|
zoom2.transform(selection2, function() {
|
|
11393
11385
|
return constrain(this.__zoom.translate(
|
|
11394
11386
|
typeof x == "function" ? x.apply(this, arguments) : x,
|
|
11395
|
-
typeof
|
|
11387
|
+
typeof y == "function" ? y.apply(this, arguments) : y
|
|
11396
11388
|
), extent.apply(this, arguments), translateExtent);
|
|
11397
11389
|
}, null, event);
|
|
11398
|
-
}, zoom2.translateTo = function(selection2, x,
|
|
11390
|
+
}, zoom2.translateTo = function(selection2, x, y, p, event) {
|
|
11399
11391
|
zoom2.transform(selection2, function() {
|
|
11400
11392
|
var e2 = extent.apply(this, arguments), t2 = this.__zoom, p0 = p == null ? centroid(e2) : typeof p == "function" ? p.apply(this, arguments) : p;
|
|
11401
11393
|
return constrain(identity$1.translate(p0[0], p0[1]).scale(t2.k).translate(
|
|
11402
11394
|
typeof x == "function" ? -x.apply(this, arguments) : -x,
|
|
11403
|
-
typeof
|
|
11395
|
+
typeof y == "function" ? -y.apply(this, arguments) : -y
|
|
11404
11396
|
), e2, translateExtent);
|
|
11405
11397
|
}, p, event);
|
|
11406
11398
|
};
|
|
@@ -11408,8 +11400,8 @@ function zoom() {
|
|
|
11408
11400
|
return k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k)), k === transform2.k ? transform2 : new Transform(k, transform2.x, transform2.y);
|
|
11409
11401
|
}
|
|
11410
11402
|
function translate(transform2, p0, p1) {
|
|
11411
|
-
var x = p0[0] - p1[0] * transform2.k,
|
|
11412
|
-
return x === transform2.x &&
|
|
11403
|
+
var x = p0[0] - p1[0] * transform2.k, y = p0[1] - p1[1] * transform2.k;
|
|
11404
|
+
return x === transform2.x && y === transform2.y ? transform2 : new Transform(transform2.k, x, y);
|
|
11413
11405
|
}
|
|
11414
11406
|
function centroid(extent2) {
|
|
11415
11407
|
return [(+extent2[0][0] + +extent2[1][0]) / 2, (+extent2[0][1] + +extent2[1][1]) / 2];
|
|
@@ -11424,8 +11416,8 @@ function zoom() {
|
|
|
11424
11416
|
return function(t2) {
|
|
11425
11417
|
if (t2 === 1) t2 = b;
|
|
11426
11418
|
else {
|
|
11427
|
-
var
|
|
11428
|
-
t2 = new Transform(k, p[0] -
|
|
11419
|
+
var l = i2(t2), k = w / l[2];
|
|
11420
|
+
t2 = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k);
|
|
11429
11421
|
}
|
|
11430
11422
|
g.zoom(null, t2);
|
|
11431
11423
|
};
|
|
@@ -11451,7 +11443,7 @@ function zoom() {
|
|
|
11451
11443
|
return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this;
|
|
11452
11444
|
},
|
|
11453
11445
|
emit: function(type) {
|
|
11454
|
-
var
|
|
11446
|
+
var d = select(this.that).datum();
|
|
11455
11447
|
listeners.call(
|
|
11456
11448
|
type,
|
|
11457
11449
|
this.that,
|
|
@@ -11461,7 +11453,7 @@ function zoom() {
|
|
|
11461
11453
|
transform: this.that.__zoom,
|
|
11462
11454
|
dispatch: listeners
|
|
11463
11455
|
}),
|
|
11464
|
-
|
|
11456
|
+
d
|
|
11465
11457
|
);
|
|
11466
11458
|
}
|
|
11467
11459
|
};
|
|
@@ -11512,15 +11504,15 @@ function zoom() {
|
|
|
11512
11504
|
}
|
|
11513
11505
|
function touchmoved(event, ...args) {
|
|
11514
11506
|
if (this.__zooming) {
|
|
11515
|
-
var g = gesture(this, args).event(event), touches = event.changedTouches, n2 = touches.length, i2, t2, p,
|
|
11507
|
+
var g = gesture(this, args).event(event), touches = event.changedTouches, n2 = touches.length, i2, t2, p, l;
|
|
11516
11508
|
for (noevent(event), i2 = 0; i2 < n2; ++i2)
|
|
11517
11509
|
t2 = touches[i2], p = pointer(t2, this), g.touch0 && g.touch0[2] === t2.identifier ? g.touch0[0] = p : g.touch1 && g.touch1[2] === t2.identifier && (g.touch1[0] = p);
|
|
11518
11510
|
if (t2 = g.that.__zoom, g.touch1) {
|
|
11519
11511
|
var p0 = g.touch0[0], l0 = g.touch0[1], p1 = g.touch1[0], l1 = g.touch1[1], dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp, dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;
|
|
11520
|
-
t2 = scale2(t2, Math.sqrt(dp / dl)), p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2],
|
|
11521
|
-
} else if (g.touch0) p = g.touch0[0],
|
|
11512
|
+
t2 = scale2(t2, Math.sqrt(dp / dl)), p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2], l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
|
|
11513
|
+
} else if (g.touch0) p = g.touch0[0], l = g.touch0[1];
|
|
11522
11514
|
else return;
|
|
11523
|
-
g.zoom("touch", constrain(translate(t2, p,
|
|
11515
|
+
g.zoom("touch", constrain(translate(t2, p, l), g.extent, translateExtent));
|
|
11524
11516
|
}
|
|
11525
11517
|
}
|
|
11526
11518
|
function touchended(event, ...args) {
|
|
@@ -11586,7 +11578,7 @@ const errorMessages = {
|
|
|
11586
11578
|
], elementSelectionKeys = ["Enter", " ", "Escape"], defaultAriaLabelConfig = {
|
|
11587
11579
|
"node.a11yDescription.default": "Press enter or space to select a node. Press delete to remove it and escape to cancel.",
|
|
11588
11580
|
"node.a11yDescription.keyboardDisabled": "Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.",
|
|
11589
|
-
"node.a11yDescription.ariaLiveMessage": ({ direction, x, y
|
|
11581
|
+
"node.a11yDescription.ariaLiveMessage": ({ direction, x, y }) => `Moved selected node ${direction}. New position, x: ${x}, y: ${y}`,
|
|
11590
11582
|
"edge.a11yDescription.default": "Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.",
|
|
11591
11583
|
// Control elements
|
|
11592
11584
|
"controls.ariaLabel": "Control Panel",
|
|
@@ -11774,31 +11766,31 @@ const calcAutoPanVelocity = (value, min2, max2) => value < min2 ? clamp(Math.abs
|
|
|
11774
11766
|
y: Math.min(box1.y, box2.y),
|
|
11775
11767
|
x2: Math.max(box1.x2, box2.x2),
|
|
11776
11768
|
y2: Math.max(box1.y2, box2.y2)
|
|
11777
|
-
}), rectToBox = ({ x, y
|
|
11769
|
+
}), rectToBox = ({ x, y, width, height }) => ({
|
|
11778
11770
|
x,
|
|
11779
|
-
y
|
|
11771
|
+
y,
|
|
11780
11772
|
x2: x + width,
|
|
11781
|
-
y2:
|
|
11782
|
-
}), boxToRect = ({ x, y
|
|
11773
|
+
y2: y + height
|
|
11774
|
+
}), boxToRect = ({ x, y, x2, y2 }) => ({
|
|
11783
11775
|
x,
|
|
11784
|
-
y
|
|
11776
|
+
y,
|
|
11785
11777
|
width: x2 - x,
|
|
11786
|
-
height:
|
|
11778
|
+
height: y2 - y
|
|
11787
11779
|
}), nodeToRect = (node, nodeOrigin = [0, 0]) => {
|
|
11788
|
-
const { x, y
|
|
11780
|
+
const { x, y } = isInternalNodeBase(node) ? node.internals.positionAbsolute : getNodePositionWithOrigin(node, nodeOrigin);
|
|
11789
11781
|
return {
|
|
11790
11782
|
x,
|
|
11791
|
-
y
|
|
11783
|
+
y,
|
|
11792
11784
|
width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0,
|
|
11793
11785
|
height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0
|
|
11794
11786
|
};
|
|
11795
11787
|
}, nodeToBox = (node, nodeOrigin = [0, 0]) => {
|
|
11796
|
-
const { x, y
|
|
11788
|
+
const { x, y } = isInternalNodeBase(node) ? node.internals.positionAbsolute : getNodePositionWithOrigin(node, nodeOrigin);
|
|
11797
11789
|
return {
|
|
11798
11790
|
x,
|
|
11799
|
-
y
|
|
11791
|
+
y,
|
|
11800
11792
|
x2: x + (node.measured?.width ?? node.width ?? node.initialWidth ?? 0),
|
|
11801
|
-
y2:
|
|
11793
|
+
y2: y + (node.measured?.height ?? node.height ?? node.initialHeight ?? 0)
|
|
11802
11794
|
};
|
|
11803
11795
|
}, getBoundsOfRects = (rect1, rect2) => boxToRect(getBoundsOfBoxes(rectToBox(rect1), rectToBox(rect2))), getOverlappingArea = (rectA, rectB) => {
|
|
11804
11796
|
const xOverlap = Math.max(0, Math.min(rectA.x + rectA.width, rectB.x + rectB.width) - Math.max(rectA.x, rectB.x)), yOverlap = Math.max(0, Math.min(rectA.y + rectA.height, rectB.y + rectB.height) - Math.max(rectA.y, rectB.y));
|
|
@@ -11807,15 +11799,15 @@ const calcAutoPanVelocity = (value, min2, max2) => value < min2 ? clamp(Math.abs
|
|
|
11807
11799
|
}, snapPosition = (position, snapGrid = [1, 1]) => ({
|
|
11808
11800
|
x: snapGrid[0] * Math.round(position.x / snapGrid[0]),
|
|
11809
11801
|
y: snapGrid[1] * Math.round(position.y / snapGrid[1])
|
|
11810
|
-
}), pointToRendererPoint = ({ x, y
|
|
11802
|
+
}), pointToRendererPoint = ({ x, y }, [tx, ty, tScale], snapToGrid = !1, snapGrid = [1, 1]) => {
|
|
11811
11803
|
const position = {
|
|
11812
11804
|
x: (x - tx) / tScale,
|
|
11813
|
-
y: (
|
|
11805
|
+
y: (y - ty) / tScale
|
|
11814
11806
|
};
|
|
11815
11807
|
return snapToGrid ? snapPosition(position, snapGrid) : position;
|
|
11816
|
-
}, rendererPointToPoint = ({ x, y
|
|
11808
|
+
}, rendererPointToPoint = ({ x, y }, [tx, ty, tScale]) => ({
|
|
11817
11809
|
x: x * tScale + tx,
|
|
11818
|
-
y:
|
|
11810
|
+
y: y * tScale + ty
|
|
11819
11811
|
});
|
|
11820
11812
|
function parsePadding(padding, viewport) {
|
|
11821
11813
|
if (typeof padding == "number")
|
|
@@ -11850,8 +11842,8 @@ function parsePaddings(padding, width, height) {
|
|
|
11850
11842
|
}
|
|
11851
11843
|
return { top: 0, right: 0, bottom: 0, left: 0, x: 0, y: 0 };
|
|
11852
11844
|
}
|
|
11853
|
-
function calculateAppliedPaddings(bounds, x,
|
|
11854
|
-
const { x: left, y: top } = rendererPointToPoint(bounds, [x,
|
|
11845
|
+
function calculateAppliedPaddings(bounds, x, y, zoom2, width, height) {
|
|
11846
|
+
const { x: left, y: top } = rendererPointToPoint(bounds, [x, y, zoom2]), { x: boundRight, y: boundBottom } = rendererPointToPoint({ x: bounds.x + bounds.width, y: bounds.y + bounds.height }, [x, y, zoom2]), right = width - boundRight, bottom = height - boundBottom;
|
|
11855
11847
|
return {
|
|
11856
11848
|
left: Math.floor(left),
|
|
11857
11849
|
top: Math.floor(top),
|
|
@@ -11860,7 +11852,7 @@ function calculateAppliedPaddings(bounds, x, y2, zoom2, width, height) {
|
|
|
11860
11852
|
};
|
|
11861
11853
|
}
|
|
11862
11854
|
const getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding) => {
|
|
11863
|
-
const p = parsePaddings(padding, width, height), xZoom = (width - p.x) / bounds.width, yZoom = (height - p.y) / bounds.height, zoom2 = Math.min(xZoom, yZoom), clampedZoom = clamp(zoom2, minZoom, maxZoom), boundsCenterX = bounds.x + bounds.width / 2, boundsCenterY = bounds.y + bounds.height / 2, x = width / 2 - boundsCenterX * clampedZoom,
|
|
11855
|
+
const p = parsePaddings(padding, width, height), xZoom = (width - p.x) / bounds.width, yZoom = (height - p.y) / bounds.height, zoom2 = Math.min(xZoom, yZoom), clampedZoom = clamp(zoom2, minZoom, maxZoom), boundsCenterX = bounds.x + bounds.width / 2, boundsCenterY = bounds.y + bounds.height / 2, x = width / 2 - boundsCenterX * clampedZoom, y = height / 2 - boundsCenterY * clampedZoom, newPadding = calculateAppliedPaddings(bounds, x, y, clampedZoom, width, height), offset2 = {
|
|
11864
11856
|
left: Math.min(newPadding.left - p.left, 0),
|
|
11865
11857
|
top: Math.min(newPadding.top - p.top, 0),
|
|
11866
11858
|
right: Math.min(newPadding.right - p.right, 0),
|
|
@@ -11868,7 +11860,7 @@ const getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding)
|
|
|
11868
11860
|
};
|
|
11869
11861
|
return {
|
|
11870
11862
|
x: x - offset2.left + offset2.right,
|
|
11871
|
-
y:
|
|
11863
|
+
y: y - offset2.top + offset2.bottom,
|
|
11872
11864
|
zoom: clampedZoom
|
|
11873
11865
|
};
|
|
11874
11866
|
}, isMacOs = () => typeof navigator < "u" && navigator?.userAgent?.indexOf("Mac") >= 0;
|
|
@@ -11910,7 +11902,7 @@ function mergeAriaLabelConfig(partial) {
|
|
|
11910
11902
|
return { ...defaultAriaLabelConfig, ...partial || {} };
|
|
11911
11903
|
}
|
|
11912
11904
|
function getPointerPosition(event, { snapGrid = [0, 0], snapToGrid = !1, transform: transform2, containerBounds }) {
|
|
11913
|
-
const { x, y
|
|
11905
|
+
const { x, y } = getEventPosition(event), pointerPos = pointToRendererPoint({ x: x - (containerBounds?.left ?? 0), y: y - (containerBounds?.top ?? 0) }, transform2), { x: xSnapped, y: ySnapped } = snapToGrid ? snapPosition(pointerPos, snapGrid) : pointerPos;
|
|
11914
11906
|
return {
|
|
11915
11907
|
xSnapped,
|
|
11916
11908
|
ySnapped,
|
|
@@ -12091,15 +12083,15 @@ function getPoints({ source, sourcePosition = Position.Bottom, target, targetPos
|
|
|
12091
12083
|
], centerX, centerY, defaultOffsetX, defaultOffsetY];
|
|
12092
12084
|
}
|
|
12093
12085
|
function getBend(a, b, c, size2) {
|
|
12094
|
-
const bendSize = Math.min(distance(a, b) / 2, distance(b, c) / 2, size2), { x, y
|
|
12095
|
-
if (a.x === x && x === c.x || a.y ===
|
|
12096
|
-
return `L${x} ${
|
|
12097
|
-
if (a.y ===
|
|
12086
|
+
const bendSize = Math.min(distance(a, b) / 2, distance(b, c) / 2, size2), { x, y } = b;
|
|
12087
|
+
if (a.x === x && x === c.x || a.y === y && y === c.y)
|
|
12088
|
+
return `L${x} ${y}`;
|
|
12089
|
+
if (a.y === y) {
|
|
12098
12090
|
const xDir2 = a.x < c.x ? -1 : 1, yDir2 = a.y < c.y ? 1 : -1;
|
|
12099
|
-
return `L ${x + bendSize * xDir2},${
|
|
12091
|
+
return `L ${x + bendSize * xDir2},${y}Q ${x},${y} ${x},${y + bendSize * yDir2}`;
|
|
12100
12092
|
}
|
|
12101
12093
|
const xDir = a.x < c.x ? 1 : -1, yDir = a.y < c.y ? -1 : 1;
|
|
12102
|
-
return `L ${x},${
|
|
12094
|
+
return `L ${x},${y + bendSize * yDir}Q ${x},${y} ${x + bendSize * xDir},${y}`;
|
|
12103
12095
|
}
|
|
12104
12096
|
function getSmoothStepPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, borderRadius: borderRadius2 = 5, centerX, centerY, offset: offset2 = 20, stepPosition = 0.5 }) {
|
|
12105
12097
|
const [points, labelX, labelY, offsetX, offsetY] = getPoints({
|
|
@@ -12156,22 +12148,22 @@ function toHandleBounds(handles) {
|
|
|
12156
12148
|
};
|
|
12157
12149
|
}
|
|
12158
12150
|
function getHandlePosition(node, handle, fallbackPosition = Position.Left, center = !1) {
|
|
12159
|
-
const x = (handle?.x ?? 0) + node.internals.positionAbsolute.x,
|
|
12151
|
+
const x = (handle?.x ?? 0) + node.internals.positionAbsolute.x, y = (handle?.y ?? 0) + node.internals.positionAbsolute.y, { width, height } = handle ?? getNodeDimensions(node);
|
|
12160
12152
|
if (center)
|
|
12161
|
-
return { x: x + width / 2, y:
|
|
12153
|
+
return { x: x + width / 2, y: y + height / 2 };
|
|
12162
12154
|
switch (handle?.position ?? fallbackPosition) {
|
|
12163
12155
|
case Position.Top:
|
|
12164
|
-
return { x: x + width / 2, y
|
|
12156
|
+
return { x: x + width / 2, y };
|
|
12165
12157
|
case Position.Right:
|
|
12166
|
-
return { x: x + width, y:
|
|
12158
|
+
return { x: x + width, y: y + height / 2 };
|
|
12167
12159
|
case Position.Bottom:
|
|
12168
|
-
return { x: x + width / 2, y:
|
|
12160
|
+
return { x: x + width / 2, y: y + height };
|
|
12169
12161
|
case Position.Left:
|
|
12170
|
-
return { x, y:
|
|
12162
|
+
return { x, y: y + height / 2 };
|
|
12171
12163
|
}
|
|
12172
12164
|
}
|
|
12173
12165
|
function getHandle$1(bounds, handleId) {
|
|
12174
|
-
return bounds && (handleId ? bounds.find((
|
|
12166
|
+
return bounds && (handleId ? bounds.find((d) => d.id === handleId) : bounds[0]) || null;
|
|
12175
12167
|
}
|
|
12176
12168
|
function getMarkerId(marker, id2) {
|
|
12177
12169
|
return marker ? typeof marker == "string" ? marker : `${id2 ? `${id2}__` : ""}${Object.keys(marker).sort().map((key) => `${key}=${marker[key]}`).join("&")}` : "";
|
|
@@ -12280,12 +12272,12 @@ function updateChildNode(node, nodeLookup, parentLookup, options) {
|
|
|
12280
12272
|
return;
|
|
12281
12273
|
}
|
|
12282
12274
|
updateParentLookup(node, parentLookup);
|
|
12283
|
-
const selectedNodeZ = elevateNodesOnSelect ? 1e3 : 0, { x, y
|
|
12275
|
+
const selectedNodeZ = elevateNodesOnSelect ? 1e3 : 0, { x, y, z } = calculateChildXYZ(node, parentNode, nodeOrigin, nodeExtent, selectedNodeZ), { positionAbsolute } = node.internals, positionChanged = x !== positionAbsolute.x || y !== positionAbsolute.y;
|
|
12284
12276
|
(positionChanged || z !== node.internals.z) && nodeLookup.set(node.id, {
|
|
12285
12277
|
...node,
|
|
12286
12278
|
internals: {
|
|
12287
12279
|
...node.internals,
|
|
12288
|
-
positionAbsolute: positionChanged ? { x, y
|
|
12280
|
+
positionAbsolute: positionChanged ? { x, y } : positionAbsolute,
|
|
12289
12281
|
z
|
|
12290
12282
|
}
|
|
12291
12283
|
});
|
|
@@ -12493,13 +12485,13 @@ function getEventHandlerParams({ nodeId, dragItems, nodeLookup, dragging = !0 })
|
|
|
12493
12485
|
nodesFromDragItems
|
|
12494
12486
|
];
|
|
12495
12487
|
}
|
|
12496
|
-
function calculateSnapOffset({ dragItems, snapGrid, x, y
|
|
12488
|
+
function calculateSnapOffset({ dragItems, snapGrid, x, y }) {
|
|
12497
12489
|
const refDragItem = dragItems.values().next().value;
|
|
12498
12490
|
if (!refDragItem)
|
|
12499
12491
|
return null;
|
|
12500
12492
|
const refPos = {
|
|
12501
12493
|
x: x - refDragItem.distance.x,
|
|
12502
|
-
y:
|
|
12494
|
+
y: y - refDragItem.distance.y
|
|
12503
12495
|
}, refPosSnapped = snapPosition(refPos, snapGrid);
|
|
12504
12496
|
return {
|
|
12505
12497
|
x: refPosSnapped.x - refPos.x,
|
|
@@ -12510,30 +12502,30 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
12510
12502
|
let lastPos = { x: null, y: null }, autoPanId = 0, dragItems = /* @__PURE__ */ new Map(), autoPanStarted = !1, mousePosition = { x: 0, y: 0 }, containerBounds = null, dragStarted = !1, d3Selection = null, abortDrag = !1, nodePositionsChanged = !1, dragEvent = null;
|
|
12511
12503
|
function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId, nodeClickDistance = 0 }) {
|
|
12512
12504
|
d3Selection = select(domNode);
|
|
12513
|
-
function updateNodes({ x, y
|
|
12505
|
+
function updateNodes({ x, y }) {
|
|
12514
12506
|
const { nodeLookup, nodeExtent, snapGrid, snapToGrid, nodeOrigin, onNodeDrag, onSelectionDrag, onError, updateNodePositions } = getStoreItems();
|
|
12515
|
-
lastPos = { x, y
|
|
12507
|
+
lastPos = { x, y };
|
|
12516
12508
|
let hasChange = !1;
|
|
12517
12509
|
const isMultiDrag = dragItems.size > 1, nodesBox = isMultiDrag && nodeExtent ? rectToBox(getInternalNodesBounds(dragItems)) : null, multiDragSnapOffset = isMultiDrag && snapToGrid ? calculateSnapOffset({
|
|
12518
12510
|
dragItems,
|
|
12519
12511
|
snapGrid,
|
|
12520
12512
|
x,
|
|
12521
|
-
y
|
|
12513
|
+
y
|
|
12522
12514
|
}) : null;
|
|
12523
12515
|
for (const [id2, dragItem] of dragItems) {
|
|
12524
12516
|
if (!nodeLookup.has(id2))
|
|
12525
12517
|
continue;
|
|
12526
|
-
let nextPosition = { x: x - dragItem.distance.x, y:
|
|
12518
|
+
let nextPosition = { x: x - dragItem.distance.x, y: y - dragItem.distance.y };
|
|
12527
12519
|
snapToGrid && (nextPosition = multiDragSnapOffset ? {
|
|
12528
12520
|
x: Math.round(nextPosition.x + multiDragSnapOffset.x),
|
|
12529
12521
|
y: Math.round(nextPosition.y + multiDragSnapOffset.y)
|
|
12530
12522
|
} : snapPosition(nextPosition, snapGrid));
|
|
12531
12523
|
let adjustedNodeExtent = null;
|
|
12532
12524
|
if (isMultiDrag && nodeExtent && !dragItem.extent && nodesBox) {
|
|
12533
|
-
const { positionAbsolute: positionAbsolute2 } = dragItem.internals, x1 = positionAbsolute2.x - nodesBox.x + nodeExtent[0][0], x2 = positionAbsolute2.x + dragItem.measured.width - nodesBox.x2 + nodeExtent[1][0], y1 = positionAbsolute2.y - nodesBox.y + nodeExtent[0][1],
|
|
12525
|
+
const { positionAbsolute: positionAbsolute2 } = dragItem.internals, x1 = positionAbsolute2.x - nodesBox.x + nodeExtent[0][0], x2 = positionAbsolute2.x + dragItem.measured.width - nodesBox.x2 + nodeExtent[1][0], y1 = positionAbsolute2.y - nodesBox.y + nodeExtent[0][1], y2 = positionAbsolute2.y + dragItem.measured.height - nodesBox.y2 + nodeExtent[1][1];
|
|
12534
12526
|
adjustedNodeExtent = [
|
|
12535
12527
|
[x1, y1],
|
|
12536
|
-
[x2,
|
|
12528
|
+
[x2, y2]
|
|
12537
12529
|
];
|
|
12538
12530
|
}
|
|
12539
12531
|
const { position, positionAbsolute } = calculateNodePosition({
|
|
@@ -12587,8 +12579,8 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
12587
12579
|
if (dragEvent = event.sourceEvent, (event.sourceEvent.type === "touchmove" && event.sourceEvent.touches.length > 1 || // if user deletes a node while dragging, we need to abort the drag to prevent errors
|
|
12588
12580
|
nodeId && !nodeLookup.has(nodeId)) && (abortDrag = !0), !abortDrag) {
|
|
12589
12581
|
if (!autoPanStarted && autoPanOnNodeDrag && dragStarted && (autoPanStarted = !0, autoPan()), !dragStarted) {
|
|
12590
|
-
const x = pointerPos.xSnapped - (lastPos.x ?? 0),
|
|
12591
|
-
Math.sqrt(x * x +
|
|
12582
|
+
const x = pointerPos.xSnapped - (lastPos.x ?? 0), y = pointerPos.ySnapped - (lastPos.y ?? 0);
|
|
12583
|
+
Math.sqrt(x * x + y * y) > nodeDragThreshold && startDrag(event);
|
|
12592
12584
|
}
|
|
12593
12585
|
(lastPos.x !== pointerPos.xSnapped || lastPos.y !== pointerPos.ySnapped) && dragItems && dragStarted && (mousePosition = getEventPosition(event.sourceEvent, containerBounds), updateNodes(pointerPos));
|
|
12594
12586
|
}
|
|
@@ -12639,8 +12631,8 @@ function getClosestHandle(position, connectionRadius, nodeLookup, fromHandle) {
|
|
|
12639
12631
|
for (const handle of allHandles) {
|
|
12640
12632
|
if (fromHandle.nodeId === handle.nodeId && fromHandle.type === handle.type && fromHandle.id === handle.id)
|
|
12641
12633
|
continue;
|
|
12642
|
-
const { x, y
|
|
12643
|
-
distance2 > connectionRadius || (distance2 < minDistance ? (closestHandles = [{ ...handle, x, y
|
|
12634
|
+
const { x, y } = getHandlePosition(node, handle, handle.position, !0), distance2 = Math.sqrt(Math.pow(x - position.x, 2) + Math.pow(y - position.y, 2));
|
|
12635
|
+
distance2 > connectionRadius || (distance2 < minDistance ? (closestHandles = [{ ...handle, x, y }], minDistance = distance2) : distance2 === minDistance && closestHandles.push({ ...handle, x, y }));
|
|
12644
12636
|
}
|
|
12645
12637
|
}
|
|
12646
12638
|
if (!closestHandles.length)
|
|
@@ -12669,7 +12661,7 @@ const alwaysValid = () => !0;
|
|
|
12669
12661
|
function onPointerDown(event, { connectionMode, connectionRadius, handleId, nodeId, edgeUpdaterType, isTarget, domNode, nodeLookup, lib, autoPanOnConnect, flowId, panBy: panBy2, cancelConnection, onConnectStart, onConnect, onConnectEnd, isValidConnection = alwaysValid, onReconnectEnd, updateConnection, getTransform, getFromHandle, autoPanSpeed, dragThreshold = 1, handleDomNode }) {
|
|
12670
12662
|
const doc = getHostForElement(event.target);
|
|
12671
12663
|
let autoPanId = 0, closestHandle;
|
|
12672
|
-
const { x, y
|
|
12664
|
+
const { x, y } = getEventPosition(event), handleType = getHandleType(edgeUpdaterType, handleDomNode), containerBounds = domNode?.getBoundingClientRect();
|
|
12673
12665
|
let connectionStarted = !1;
|
|
12674
12666
|
if (!containerBounds || !handleType)
|
|
12675
12667
|
return;
|
|
@@ -12680,8 +12672,8 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
12680
12672
|
function autoPan() {
|
|
12681
12673
|
if (!autoPanOnConnect || !containerBounds)
|
|
12682
12674
|
return;
|
|
12683
|
-
const [x2,
|
|
12684
|
-
panBy2({ x: x2, y:
|
|
12675
|
+
const [x2, y2] = calcAutoPan(position, containerBounds, autoPanSpeed);
|
|
12676
|
+
panBy2({ x: x2, y: y2 }), autoPanId = requestAnimationFrame(autoPan);
|
|
12685
12677
|
}
|
|
12686
12678
|
const fromHandle = {
|
|
12687
12679
|
...fromHandleInternal,
|
|
@@ -12707,7 +12699,7 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
12707
12699
|
dragThreshold === 0 && startConnection();
|
|
12708
12700
|
function onPointerMove(event2) {
|
|
12709
12701
|
if (!connectionStarted) {
|
|
12710
|
-
const { x: evtX, y: evtY } = getEventPosition(event2), dx = evtX - x, dy = evtY -
|
|
12702
|
+
const { x: evtX, y: evtY } = getEventPosition(event2), dx = evtX - x, dy = evtY - y;
|
|
12711
12703
|
if (!(dx * dx + dy * dy > dragThreshold * dragThreshold))
|
|
12712
12704
|
return;
|
|
12713
12705
|
startConnection();
|
|
@@ -12756,7 +12748,7 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
12756
12748
|
doc.addEventListener("mousemove", onPointerMove), doc.addEventListener("mouseup", onPointerUp), doc.addEventListener("touchmove", onPointerMove), doc.addEventListener("touchend", onPointerUp);
|
|
12757
12749
|
}
|
|
12758
12750
|
function isValidHandle(event, { handle, connectionMode, fromNodeId, fromHandleId, fromType, doc, lib, flowId, isValidConnection = alwaysValid, nodeLookup }) {
|
|
12759
|
-
const isTarget = fromType === "target", handleDomNode = handle ? doc.querySelector(`.${lib}-flow__handle[data-id="${flowId}-${handle?.nodeId}-${handle?.id}-${handle?.type}"]`) : null, { x, y
|
|
12751
|
+
const isTarget = fromType === "target", handleDomNode = handle ? doc.querySelector(`.${lib}-flow__handle[data-id="${flowId}-${handle?.nodeId}-${handle?.id}-${handle?.type}"]`) : null, { x, y } = getEventPosition(event), handleBelow = doc.elementFromPoint(x, y), handleToCheck = handleBelow?.classList.contains(`${lib}-flow__handle`) ? handleBelow : handleDomNode, result = {
|
|
12760
12752
|
handleDomNode: handleToCheck,
|
|
12761
12753
|
isValid: !1,
|
|
12762
12754
|
connection: null,
|
|
@@ -12834,7 +12826,7 @@ const viewChanged = (prevViewport, eventViewport) => prevViewport.x !== eventVie
|
|
|
12834
12826
|
x: transform2.x,
|
|
12835
12827
|
y: transform2.y,
|
|
12836
12828
|
zoom: transform2.k
|
|
12837
|
-
}), viewportToTransform = ({ x, y
|
|
12829
|
+
}), viewportToTransform = ({ x, y, zoom: zoom2 }) => identity$1.translate(x, y).scale(zoom2), isWrappedWithClass = (event, className) => event.target.closest(`.${className}`), isRightClickPan = (panOnDrag, usedButton) => usedButton === 2 && Array.isArray(panOnDrag) && panOnDrag.includes(2), defaultEase = (t2) => ((t2 *= 2) <= 1 ? t2 * t2 * t2 : (t2 -= 2) * t2 * t2 + 2) / 2, getD3Transition = (selection2, duration = 0, ease = defaultEase, onEnd = () => {
|
|
12838
12830
|
}) => {
|
|
12839
12831
|
const hasDuration = typeof duration == "number" && duration > 0;
|
|
12840
12832
|
return hasDuration || onEnd(), hasDuration ? selection2.transition().duration(duration).ease(ease).on("end", onEnd) : selection2;
|
|
@@ -12869,11 +12861,11 @@ function createPanOnScrollHandler({ zoomPanValues, noWheelClassName, d3Selection
|
|
|
12869
12861
|
};
|
|
12870
12862
|
}
|
|
12871
12863
|
function createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }) {
|
|
12872
|
-
return function(event,
|
|
12864
|
+
return function(event, d) {
|
|
12873
12865
|
const isWheel = event.type === "wheel", preventZoom = !preventScrolling && isWheel && !event.ctrlKey, hasNoWheelClass = isWrappedWithClass(event, noWheelClassName);
|
|
12874
12866
|
if (event.ctrlKey && isWheel && hasNoWheelClass && event.preventDefault(), preventZoom || hasNoWheelClass)
|
|
12875
12867
|
return null;
|
|
12876
|
-
event.preventDefault(), d3ZoomHandler.call(this, event,
|
|
12868
|
+
event.preventDefault(), d3ZoomHandler.call(this, event, d);
|
|
12877
12869
|
};
|
|
12878
12870
|
}
|
|
12879
12871
|
function createPanZoomStartHandler({ zoomPanValues, onDraggingChange, onPanZoomStart }) {
|
|
@@ -13123,12 +13115,12 @@ function getDimensionsAfterResize(startValues, controlDirection, pointerPosition
|
|
|
13123
13115
|
}
|
|
13124
13116
|
}
|
|
13125
13117
|
distY = distY + (distY < 0 ? clampY : -clampY), distX = distX + (distX < 0 ? clampX : -clampX), keepAspectRatio && (isDiagonal ? newWidth > newHeight * aspectRatio ? distY = (xor(affectsX, affectsY) ? -distX : distX) / aspectRatio : distX = (xor(affectsX, affectsY) ? -distY : distY) * aspectRatio : isHorizontal ? (distY = distX / aspectRatio, affectsY = affectsX) : (distX = distY * aspectRatio, affectsX = affectsY));
|
|
13126
|
-
const x = affectsX ? startX + distX : startX,
|
|
13118
|
+
const x = affectsX ? startX + distX : startX, y = affectsY ? startY + distY : startY;
|
|
13127
13119
|
return {
|
|
13128
13120
|
width: startWidth + (affectsX ? -distX : distX),
|
|
13129
13121
|
height: startHeight + (affectsY ? -distY : distY),
|
|
13130
13122
|
x: nodeOrigin[0] * distX * (affectsX ? -1 : 1) + x,
|
|
13131
|
-
y: nodeOrigin[1] * distY * (affectsY ? -1 : 1) +
|
|
13123
|
+
y: nodeOrigin[1] * distY * (affectsY ? -1 : 1) + y
|
|
13132
13124
|
};
|
|
13133
13125
|
}
|
|
13134
13126
|
const initPrevValues$1 = { width: 0, height: 0, x: 0, y: 0 }, initStartValues = {
|
|
@@ -13144,10 +13136,10 @@ function nodeToParentExtent(node) {
|
|
|
13144
13136
|
];
|
|
13145
13137
|
}
|
|
13146
13138
|
function nodeToChildExtent(child, parent, nodeOrigin) {
|
|
13147
|
-
const x = parent.position.x + child.position.x,
|
|
13139
|
+
const x = parent.position.x + child.position.x, y = parent.position.y + child.position.y, width = child.measured.width ?? 0, height = child.measured.height ?? 0, originOffsetX = nodeOrigin[0] * width, originOffsetY = nodeOrigin[1] * height;
|
|
13148
13140
|
return [
|
|
13149
|
-
[x - originOffsetX,
|
|
13150
|
-
[x + width - originOffsetX,
|
|
13141
|
+
[x - originOffsetX, y - originOffsetY],
|
|
13142
|
+
[x + width - originOffsetX, y + height - originOffsetY]
|
|
13151
13143
|
];
|
|
13152
13144
|
}
|
|
13153
13145
|
function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
|
|
@@ -13200,11 +13192,11 @@ function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
|
|
|
13200
13192
|
}), childChanges = [];
|
|
13201
13193
|
if (!node)
|
|
13202
13194
|
return;
|
|
13203
|
-
const { x: prevX, y: prevY, width: prevWidth, height: prevHeight } = prevValues, change = {}, nodeOrigin = node.origin ?? storeNodeOrigin, { width, height, x, y
|
|
13195
|
+
const { x: prevX, y: prevY, width: prevWidth, height: prevHeight } = prevValues, change = {}, nodeOrigin = node.origin ?? storeNodeOrigin, { width, height, x, y } = getDimensionsAfterResize(startValues, controlDirection, pointerPosition, boundaries, keepAspectRatio, nodeOrigin, parentExtent, childExtent), isWidthChange = width !== prevWidth, isHeightChange = height !== prevHeight, isXPosChange = x !== prevX && isWidthChange, isYPosChange = y !== prevY && isHeightChange;
|
|
13204
13196
|
if (!isXPosChange && !isYPosChange && !isWidthChange && !isHeightChange)
|
|
13205
13197
|
return;
|
|
13206
|
-
if ((isXPosChange || isYPosChange || nodeOrigin[0] === 1 || nodeOrigin[1] === 1) && (change.x = isXPosChange ? x : prevValues.x, change.y = isYPosChange ?
|
|
13207
|
-
const xChange = x - prevX, yChange =
|
|
13198
|
+
if ((isXPosChange || isYPosChange || nodeOrigin[0] === 1 || nodeOrigin[1] === 1) && (change.x = isXPosChange ? x : prevValues.x, change.y = isYPosChange ? y : prevValues.y, prevValues.x = change.x, prevValues.y = change.y, childNodes.length > 0)) {
|
|
13199
|
+
const xChange = x - prevX, yChange = y - prevY;
|
|
13208
13200
|
for (const childNode of childNodes)
|
|
13209
13201
|
childNode.position = {
|
|
13210
13202
|
x: childNode.position.x - xChange + nodeOrigin[0] * (width - prevWidth),
|
|
@@ -13257,8 +13249,8 @@ function requireUseSyncExternalStoreShim_production() {
|
|
|
13257
13249
|
if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
|
|
13258
13250
|
hasRequiredUseSyncExternalStoreShim_production = 1;
|
|
13259
13251
|
var React2 = React__default;
|
|
13260
|
-
function is(x,
|
|
13261
|
-
return x ===
|
|
13252
|
+
function is(x, y) {
|
|
13253
|
+
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
|
|
13262
13254
|
}
|
|
13263
13255
|
var objectIs = typeof Object.is == "function" ? Object.is : is, useState2 = React2.useState, useEffect2 = React2.useEffect, useLayoutEffect2 = React2.useLayoutEffect, useDebugValue2 = React2.useDebugValue;
|
|
13264
13256
|
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
@@ -13311,8 +13303,8 @@ function requireWithSelector_production() {
|
|
|
13311
13303
|
if (hasRequiredWithSelector_production) return withSelector_production;
|
|
13312
13304
|
hasRequiredWithSelector_production = 1;
|
|
13313
13305
|
var React2 = React__default, shim2 = requireShim();
|
|
13314
|
-
function is(x,
|
|
13315
|
-
return x ===
|
|
13306
|
+
function is(x, y) {
|
|
13307
|
+
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
|
|
13316
13308
|
}
|
|
13317
13309
|
var objectIs = typeof Object.is == "function" ? Object.is : is, useSyncExternalStore = shim2.useSyncExternalStore, useRef2 = React2.useRef, useEffect2 = React2.useEffect, useMemo2 = React2.useMemo, useDebugValue2 = React2.useDebugValue;
|
|
13318
13310
|
return withSelector_production.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector2, isEqual2) {
|
|
@@ -13445,7 +13437,7 @@ const style$1 = { display: "none" }, ariaLiveStyle = {
|
|
|
13445
13437
|
overflow: "hidden",
|
|
13446
13438
|
clip: "rect(0px, 0px, 0px, 0px)",
|
|
13447
13439
|
clipPath: "inset(100%)"
|
|
13448
|
-
}, ARIA_NODE_DESC_KEY = "react-flow__node-desc", ARIA_EDGE_DESC_KEY = "react-flow__edge-desc", ARIA_LIVE_MESSAGE = "react-flow__aria-live", ariaLiveSelector = (
|
|
13440
|
+
}, ARIA_NODE_DESC_KEY = "react-flow__node-desc", ARIA_EDGE_DESC_KEY = "react-flow__edge-desc", ARIA_LIVE_MESSAGE = "react-flow__aria-live", ariaLiveSelector = (s) => s.ariaLiveMessage, ariaLabelConfigSelector = (s) => s.ariaLabelConfig;
|
|
13449
13441
|
function AriaLiveMessage({ rfId }) {
|
|
13450
13442
|
const ariaLiveMessage = useStore(ariaLiveSelector);
|
|
13451
13443
|
return jsx("div", { id: `${ARIA_LIVE_MESSAGE}-${rfId}`, "aria-live": "assertive", "aria-atomic": "true", style: ariaLiveStyle, children: ariaLiveMessage });
|
|
@@ -13462,11 +13454,11 @@ Panel.displayName = "Panel";
|
|
|
13462
13454
|
function Attribution({ proOptions, position = "bottom-right" }) {
|
|
13463
13455
|
return proOptions?.hideAttribution ? null : jsx(Panel, { position, className: "react-flow__attribution", "data-message": "Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev", children: jsx("a", { href: "https://reactflow.dev", target: "_blank", rel: "noopener noreferrer", "aria-label": "React Flow attribution", children: "React Flow" }) });
|
|
13464
13456
|
}
|
|
13465
|
-
const selector$m = (
|
|
13457
|
+
const selector$m = (s) => {
|
|
13466
13458
|
const selectedNodes = [], selectedEdges = [];
|
|
13467
|
-
for (const [, node] of
|
|
13459
|
+
for (const [, node] of s.nodeLookup)
|
|
13468
13460
|
node.selected && selectedNodes.push(node.internals.userNode);
|
|
13469
|
-
for (const [, edge] of
|
|
13461
|
+
for (const [, edge] of s.edgeLookup)
|
|
13470
13462
|
edge.selected && selectedEdges.push(edge);
|
|
13471
13463
|
return { selectedNodes, selectedEdges };
|
|
13472
13464
|
}, selectId = (obj) => obj.id;
|
|
@@ -13480,7 +13472,7 @@ function SelectionListenerInner({ onSelectionChange }) {
|
|
|
13480
13472
|
onSelectionChange?.(params), store.getState().onSelectionChangeHandlers.forEach((fn) => fn(params));
|
|
13481
13473
|
}, [selectedNodes, selectedEdges, onSelectionChange]), null;
|
|
13482
13474
|
}
|
|
13483
|
-
const changeSelector = (
|
|
13475
|
+
const changeSelector = (s) => !!s.onSelectionChangeHandlers;
|
|
13484
13476
|
function SelectionListener({ onSelectionChange }) {
|
|
13485
13477
|
const storeHasSelectionChangeHandlers = useStore(changeSelector);
|
|
13486
13478
|
return onSelectionChange || storeHasSelectionChangeHandlers ? jsx(SelectionListenerInner, { onSelectionChange }) : null;
|
|
@@ -13544,16 +13536,16 @@ const defaultNodeOrigin = [0, 0], defaultViewport = { x: 0, y: 0, zoom: 1 }, rea
|
|
|
13544
13536
|
"autoPanSpeed",
|
|
13545
13537
|
"paneClickDistance",
|
|
13546
13538
|
"ariaLabelConfig"
|
|
13547
|
-
], fieldsToTrack = [...reactFlowFieldsToTrack, "rfId"], selector$l = (
|
|
13548
|
-
setNodes:
|
|
13549
|
-
setEdges:
|
|
13550
|
-
setMinZoom:
|
|
13551
|
-
setMaxZoom:
|
|
13552
|
-
setTranslateExtent:
|
|
13553
|
-
setNodeExtent:
|
|
13554
|
-
reset:
|
|
13555
|
-
setDefaultNodesAndEdges:
|
|
13556
|
-
setPaneClickDistance:
|
|
13539
|
+
], fieldsToTrack = [...reactFlowFieldsToTrack, "rfId"], selector$l = (s) => ({
|
|
13540
|
+
setNodes: s.setNodes,
|
|
13541
|
+
setEdges: s.setEdges,
|
|
13542
|
+
setMinZoom: s.setMinZoom,
|
|
13543
|
+
setMaxZoom: s.setMaxZoom,
|
|
13544
|
+
setTranslateExtent: s.setTranslateExtent,
|
|
13545
|
+
setNodeExtent: s.setNodeExtent,
|
|
13546
|
+
reset: s.reset,
|
|
13547
|
+
setDefaultNodesAndEdges: s.setDefaultNodesAndEdges,
|
|
13548
|
+
setPaneClickDistance: s.setPaneClickDistance
|
|
13557
13549
|
}), initPrevValues = {
|
|
13558
13550
|
/*
|
|
13559
13551
|
* these are values that are also passed directly to other components
|
|
@@ -13671,10 +13663,10 @@ const useViewportHelper = () => {
|
|
|
13671
13663
|
}, options), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
13672
13664
|
},
|
|
13673
13665
|
getViewport: () => {
|
|
13674
|
-
const [x,
|
|
13675
|
-
return { x, y
|
|
13666
|
+
const [x, y, zoom2] = store.getState().transform;
|
|
13667
|
+
return { x, y, zoom: zoom2 };
|
|
13676
13668
|
},
|
|
13677
|
-
setCenter: async (x,
|
|
13669
|
+
setCenter: async (x, y, options) => store.getState().setCenter(x, y, options),
|
|
13678
13670
|
fitBounds: async (bounds, options) => {
|
|
13679
13671
|
const { width, height, minZoom, maxZoom, panZoom } = store.getState(), viewport = getViewportForBounds(bounds, width, height, minZoom, maxZoom, options?.padding ?? 0.1);
|
|
13680
13672
|
return panZoom ? (await panZoom.setViewport(viewport, {
|
|
@@ -13848,7 +13840,7 @@ function useBatchContext() {
|
|
|
13848
13840
|
throw new Error("useBatchContext must be used within a BatchProvider");
|
|
13849
13841
|
return batchContext;
|
|
13850
13842
|
}
|
|
13851
|
-
const selector$k = (
|
|
13843
|
+
const selector$k = (s) => !!s.panZoom;
|
|
13852
13844
|
function useReactFlow() {
|
|
13853
13845
|
const viewportHelper = useViewportHelper(), store = useStoreApi(), batchContext = useBatchContext(), viewportInitialized = useStore(selector$k), generalHelper = useMemo(() => {
|
|
13854
13846
|
const getInternalNode = (id2) => store.getState().nodeLookup.get(id2), setNodes = (payload) => {
|
|
@@ -13900,13 +13892,13 @@ function useReactFlow() {
|
|
|
13900
13892
|
batchContext.edgeQueue.push((edges) => [...edges, ...newEdges]);
|
|
13901
13893
|
},
|
|
13902
13894
|
toObject: () => {
|
|
13903
|
-
const { nodes = [], edges = [], transform: transform2 } = store.getState(), [x,
|
|
13895
|
+
const { nodes = [], edges = [], transform: transform2 } = store.getState(), [x, y, zoom2] = transform2;
|
|
13904
13896
|
return {
|
|
13905
13897
|
nodes: nodes.map((n2) => ({ ...n2 })),
|
|
13906
13898
|
edges: edges.map((e2) => ({ ...e2 })),
|
|
13907
13899
|
viewport: {
|
|
13908
13900
|
x,
|
|
13909
|
-
y
|
|
13901
|
+
y,
|
|
13910
13902
|
zoom: zoom2
|
|
13911
13903
|
}
|
|
13912
13904
|
};
|
|
@@ -14014,9 +14006,9 @@ const containerStyle = {
|
|
|
14014
14006
|
height: "100%",
|
|
14015
14007
|
top: 0,
|
|
14016
14008
|
left: 0
|
|
14017
|
-
}, selector$j = (
|
|
14018
|
-
userSelectionActive:
|
|
14019
|
-
lib:
|
|
14009
|
+
}, selector$j = (s) => ({
|
|
14010
|
+
userSelectionActive: s.userSelectionActive,
|
|
14011
|
+
lib: s.lib
|
|
14020
14012
|
});
|
|
14021
14013
|
function ZoomPane({ onPaneContextMenu, zoomOnScroll = !0, zoomOnPinch = !0, panOnScroll = !1, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = !0, panOnDrag = !0, defaultViewport: defaultViewport2, translateExtent, minZoom, maxZoom, zoomActivationKeyCode, preventScrolling = !0, children: children2, noWheelClassName, noPanClassName, onViewportChange, isControlledViewport, paneClickDistance }) {
|
|
14022
14014
|
const store = useStoreApi(), zoomPane = useRef(null), { userSelectionActive, lib } = useStore(selector$j, shallow$1), zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode), panZoom = useRef();
|
|
@@ -14047,10 +14039,10 @@ function ZoomPane({ onPaneContextMenu, zoomOnScroll = !0, zoomOnPinch = !0, panO
|
|
|
14047
14039
|
onMoveEnd?.(event, vp), onViewportChangeEnd?.(vp);
|
|
14048
14040
|
}
|
|
14049
14041
|
});
|
|
14050
|
-
const { x, y
|
|
14042
|
+
const { x, y, zoom: zoom2 } = panZoom.current.getViewport();
|
|
14051
14043
|
return store.setState({
|
|
14052
14044
|
panZoom: panZoom.current,
|
|
14053
|
-
transform: [x,
|
|
14045
|
+
transform: [x, y, zoom2],
|
|
14054
14046
|
domNode: zoomPane.current.closest(".react-flow")
|
|
14055
14047
|
}), () => {
|
|
14056
14048
|
panZoom.current?.destroy();
|
|
@@ -14092,9 +14084,9 @@ function ZoomPane({ onPaneContextMenu, zoomOnScroll = !0, zoomOnPinch = !0, panO
|
|
|
14092
14084
|
onTransformChange
|
|
14093
14085
|
]), jsx("div", { className: "react-flow__renderer", ref: zoomPane, style: containerStyle, children: children2 });
|
|
14094
14086
|
}
|
|
14095
|
-
const selector$i = (
|
|
14096
|
-
userSelectionActive:
|
|
14097
|
-
userSelectionRect:
|
|
14087
|
+
const selector$i = (s) => ({
|
|
14088
|
+
userSelectionActive: s.userSelectionActive,
|
|
14089
|
+
userSelectionRect: s.userSelectionRect
|
|
14098
14090
|
});
|
|
14099
14091
|
function UserSelection() {
|
|
14100
14092
|
const { userSelectionActive, userSelectionRect } = useStore(selector$i, shallow$1);
|
|
@@ -14106,11 +14098,11 @@ function UserSelection() {
|
|
|
14106
14098
|
}
|
|
14107
14099
|
const wrapHandler = (handler, containerRef) => (event) => {
|
|
14108
14100
|
event.target === containerRef.current && handler?.(event);
|
|
14109
|
-
}, selector$h = (
|
|
14110
|
-
userSelectionActive:
|
|
14111
|
-
elementsSelectable:
|
|
14112
|
-
connectionInProgress:
|
|
14113
|
-
dragging:
|
|
14101
|
+
}, selector$h = (s) => ({
|
|
14102
|
+
userSelectionActive: s.userSelectionActive,
|
|
14103
|
+
elementsSelectable: s.elementsSelectable,
|
|
14104
|
+
connectionInProgress: s.connection.inProgress,
|
|
14105
|
+
dragging: s.paneDragging
|
|
14114
14106
|
});
|
|
14115
14107
|
function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.Full, panOnDrag, selectionOnDrag, onSelectionStart, onSelectionEnd, onPaneClick, onPaneContextMenu, onPaneScroll, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, children: children2 }) {
|
|
14116
14108
|
const store = useStoreApi(), { userSelectionActive, elementsSelectable, dragging, connectionInProgress } = useStore(selector$h, shallow$1), hasActiveSelection = elementsSelectable && (isSelecting || userSelectionActive), container2 = useRef(null), containerBounds = useRef(), selectedNodeIds = useRef(/* @__PURE__ */ new Set()), selectedEdgeIds = useRef(/* @__PURE__ */ new Set()), selectionInProgress = useRef(!1), selectionStarted = useRef(!1), onClick = (event) => {
|
|
@@ -14130,15 +14122,15 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
14130
14122
|
if (containerBounds.current = domNode?.getBoundingClientRect(), !elementsSelectable || !isSelecting || event.button !== 0 || event.target !== container2.current || !containerBounds.current)
|
|
14131
14123
|
return;
|
|
14132
14124
|
event.target?.setPointerCapture?.(event.pointerId), selectionStarted.current = !0, selectionInProgress.current = !1;
|
|
14133
|
-
const { x, y
|
|
14125
|
+
const { x, y } = getEventPosition(event.nativeEvent, containerBounds.current);
|
|
14134
14126
|
resetSelectedElements(), store.setState({
|
|
14135
14127
|
userSelectionRect: {
|
|
14136
14128
|
width: 0,
|
|
14137
14129
|
height: 0,
|
|
14138
14130
|
startX: x,
|
|
14139
|
-
startY:
|
|
14131
|
+
startY: y,
|
|
14140
14132
|
x,
|
|
14141
|
-
y
|
|
14133
|
+
y
|
|
14142
14134
|
}
|
|
14143
14135
|
}), onSelectionStart?.(event);
|
|
14144
14136
|
}, onPointerMove = (event) => {
|
|
@@ -14261,10 +14253,10 @@ function useMoveSelectedNodes() {
|
|
|
14261
14253
|
}
|
|
14262
14254
|
const NodeIdContext = createContext(null), Provider = NodeIdContext.Provider;
|
|
14263
14255
|
NodeIdContext.Consumer;
|
|
14264
|
-
const useNodeId = () => useContext(NodeIdContext), selector$g = (
|
|
14265
|
-
connectOnClick:
|
|
14266
|
-
noPanClassName:
|
|
14267
|
-
rfId:
|
|
14256
|
+
const useNodeId = () => useContext(NodeIdContext), selector$g = (s) => ({
|
|
14257
|
+
connectOnClick: s.connectOnClick,
|
|
14258
|
+
noPanClassName: s.noPanClassName,
|
|
14259
|
+
rfId: s.rfId
|
|
14268
14260
|
}), connectingSelector = (nodeId, handleId, type) => (state) => {
|
|
14269
14261
|
const { connectionClickStartHandle: clickHandle, connectionMode, connection } = state, { fromHandle, toHandle, isValid } = connection, connectingTo = toHandle?.nodeId === nodeId && toHandle?.id === handleId && toHandle?.type === type;
|
|
14270
14262
|
return {
|
|
@@ -14407,15 +14399,15 @@ function getNodeInlineStyleDimensions(node) {
|
|
|
14407
14399
|
height: node.height ?? node.style?.height
|
|
14408
14400
|
};
|
|
14409
14401
|
}
|
|
14410
|
-
const selector$f = (
|
|
14411
|
-
const { width, height, x, y
|
|
14402
|
+
const selector$f = (s) => {
|
|
14403
|
+
const { width, height, x, y } = getInternalNodesBounds(s.nodeLookup, {
|
|
14412
14404
|
filter: (node) => !!node.selected
|
|
14413
14405
|
});
|
|
14414
14406
|
return {
|
|
14415
14407
|
width: isNumeric(width) ? width : null,
|
|
14416
14408
|
height: isNumeric(height) ? height : null,
|
|
14417
|
-
userSelectionActive:
|
|
14418
|
-
transformString: `translate(${
|
|
14409
|
+
userSelectionActive: s.userSelectionActive,
|
|
14410
|
+
transformString: `translate(${s.transform[0]}px,${s.transform[1]}px) scale(${s.transform[2]}) translate(${x}px,${y}px)`
|
|
14419
14411
|
};
|
|
14420
14412
|
};
|
|
14421
14413
|
function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboardA11y }) {
|
|
@@ -14444,17 +14436,17 @@ function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboar
|
|
|
14444
14436
|
height
|
|
14445
14437
|
} }) });
|
|
14446
14438
|
}
|
|
14447
|
-
const win = typeof window < "u" ? window : void 0, selector$e = (
|
|
14439
|
+
const win = typeof window < "u" ? window : void 0, selector$e = (s) => ({ nodesSelectionActive: s.nodesSelectionActive, userSelectionActive: s.userSelectionActive });
|
|
14448
14440
|
function FlowRendererComponent({ children: children2, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneContextMenu, onPaneScroll, paneClickDistance, deleteKeyCode, selectionKeyCode, selectionOnDrag, selectionMode, onSelectionStart, onSelectionEnd, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, elementsSelectable, zoomOnScroll, zoomOnPinch, panOnScroll: _panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag: _panOnDrag, defaultViewport: defaultViewport2, translateExtent, minZoom, maxZoom, preventScrolling, onSelectionContextMenu, noWheelClassName, noPanClassName, disableKeyboardA11y, onViewportChange, isControlledViewport }) {
|
|
14449
14441
|
const { nodesSelectionActive, userSelectionActive } = useStore(selector$e), selectionKeyPressed = useKeyPress(selectionKeyCode, { target: win }), panActivationKeyPressed = useKeyPress(panActivationKeyCode, { target: win }), panOnDrag = panActivationKeyPressed || _panOnDrag, panOnScroll = panActivationKeyPressed || _panOnScroll, _selectionOnDrag = selectionOnDrag && panOnDrag !== !0, isSelecting = selectionKeyPressed || userSelectionActive || _selectionOnDrag;
|
|
14450
14442
|
return useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode }), jsx(ZoomPane, { onPaneContextMenu, elementsSelectable, zoomOnScroll, zoomOnPinch, panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag: !selectionKeyPressed && panOnDrag, defaultViewport: defaultViewport2, translateExtent, minZoom, maxZoom, zoomActivationKeyCode, preventScrolling, noWheelClassName, noPanClassName, onViewportChange, isControlledViewport, paneClickDistance, children: jsxs(Pane, { onSelectionStart, onSelectionEnd, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneContextMenu, onPaneScroll, panOnDrag, isSelecting: !!isSelecting, selectionMode, selectionKeyPressed, selectionOnDrag: _selectionOnDrag, children: [children2, nodesSelectionActive && jsx(NodesSelection, { onSelectionContextMenu, noPanClassName, disableKeyboardA11y })] }) });
|
|
14451
14443
|
}
|
|
14452
14444
|
FlowRendererComponent.displayName = "FlowRenderer";
|
|
14453
|
-
const FlowRenderer = memo$1(FlowRendererComponent), selector$d = (onlyRenderVisible) => (
|
|
14445
|
+
const FlowRenderer = memo$1(FlowRendererComponent), selector$d = (onlyRenderVisible) => (s) => onlyRenderVisible ? getNodesInside(s.nodeLookup, { x: 0, y: 0, width: s.width, height: s.height }, s.transform, !0).map((node) => node.id) : Array.from(s.nodeLookup.keys());
|
|
14454
14446
|
function useVisibleNodeIds(onlyRenderVisible) {
|
|
14455
14447
|
return useStore(useCallback(selector$d(onlyRenderVisible), [onlyRenderVisible]), shallow$1);
|
|
14456
14448
|
}
|
|
14457
|
-
const selector$c = (
|
|
14449
|
+
const selector$c = (s) => s.updateNodeInternals;
|
|
14458
14450
|
function useResizeObserver() {
|
|
14459
14451
|
const updateNodeInternals2 = useStore(selector$c), [resizeObserver] = useState(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((entries) => {
|
|
14460
14452
|
const updates = /* @__PURE__ */ new Map();
|
|
@@ -14485,8 +14477,8 @@ function useNodeObserver({ node, nodeType, hasDimensions, resizeObserver }) {
|
|
|
14485
14477
|
}, [node.id, nodeType, node.sourcePosition, node.targetPosition]), nodeRef;
|
|
14486
14478
|
}
|
|
14487
14479
|
function NodeWrapper({ id: id2, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, nodesDraggable, elementsSelectable, nodesConnectable, nodesFocusable, resizeObserver, noDragClassName, noPanClassName, disableKeyboardA11y, rfId, nodeTypes, nodeClickDistance, onError }) {
|
|
14488
|
-
const { node, internals, isParent: isParent2 } = useStore((
|
|
14489
|
-
const node2 =
|
|
14480
|
+
const { node, internals, isParent: isParent2 } = useStore((s) => {
|
|
14481
|
+
const node2 = s.nodeLookup.get(id2), isParent22 = s.parentLookup.has(id2);
|
|
14490
14482
|
return {
|
|
14491
14483
|
node: node2,
|
|
14492
14484
|
internals: node2.internals,
|
|
@@ -14572,12 +14564,12 @@ function NodeWrapper({ id: id2, onClick, onMouseEnter, onMouseMove, onMouseLeave
|
|
|
14572
14564
|
...inlineDimensions
|
|
14573
14565
|
}, "data-id": id2, "data-testid": `rf__node-${id2}`, onMouseEnter: onMouseEnterHandler, onMouseMove: onMouseMoveHandler, onMouseLeave: onMouseLeaveHandler, onContextMenu: onContextMenuHandler, onClick: onSelectNodeHandler, onDoubleClick: onDoubleClickHandler, onKeyDown: isFocusable ? onKeyDown : void 0, tabIndex: isFocusable ? 0 : void 0, onFocus: isFocusable ? onFocus : void 0, role: node.ariaRole ?? (isFocusable ? "group" : void 0), "aria-roledescription": "node", "aria-describedby": disableKeyboardA11y ? void 0 : `${ARIA_NODE_DESC_KEY}-${rfId}`, "aria-label": node.ariaLabel, ...node.domAttributes, children: jsx(Provider, { value: id2, children: jsx(NodeComponent, { id: id2, data: node.data, type: nodeType, positionAbsoluteX: internals.positionAbsolute.x, positionAbsoluteY: internals.positionAbsolute.y, selected: node.selected ?? !1, selectable: isSelectable, draggable: isDraggable, deletable: node.deletable ?? !0, isConnectable, sourcePosition: node.sourcePosition, targetPosition: node.targetPosition, dragging, dragHandle: node.dragHandle, zIndex: internals.z, parentId: node.parentId, ...nodeDimensions }) }) });
|
|
14574
14566
|
}
|
|
14575
|
-
const selector$b = (
|
|
14576
|
-
nodesDraggable:
|
|
14577
|
-
nodesConnectable:
|
|
14578
|
-
nodesFocusable:
|
|
14579
|
-
elementsSelectable:
|
|
14580
|
-
onError:
|
|
14567
|
+
const selector$b = (s) => ({
|
|
14568
|
+
nodesDraggable: s.nodesDraggable,
|
|
14569
|
+
nodesConnectable: s.nodesConnectable,
|
|
14570
|
+
nodesFocusable: s.nodesFocusable,
|
|
14571
|
+
elementsSelectable: s.elementsSelectable,
|
|
14572
|
+
onError: s.onError
|
|
14581
14573
|
});
|
|
14582
14574
|
function NodeRendererComponent(props) {
|
|
14583
14575
|
const { nodesDraggable, nodesConnectable, nodesFocusable, elementsSelectable, onError } = useStore(selector$b, shallow$1), nodeIds = useVisibleNodeIds(props.onlyRenderVisibleElements), resizeObserver = useResizeObserver();
|
|
@@ -14613,19 +14605,19 @@ function NodeRendererComponent(props) {
|
|
|
14613
14605
|
NodeRendererComponent.displayName = "NodeRenderer";
|
|
14614
14606
|
const NodeRenderer = memo$1(NodeRendererComponent);
|
|
14615
14607
|
function useVisibleEdgeIds(onlyRenderVisible) {
|
|
14616
|
-
return useStore(useCallback((
|
|
14608
|
+
return useStore(useCallback((s) => {
|
|
14617
14609
|
if (!onlyRenderVisible)
|
|
14618
|
-
return
|
|
14610
|
+
return s.edges.map((edge) => edge.id);
|
|
14619
14611
|
const visibleEdgeIds = [];
|
|
14620
|
-
if (
|
|
14621
|
-
for (const edge of
|
|
14622
|
-
const sourceNode =
|
|
14612
|
+
if (s.width && s.height)
|
|
14613
|
+
for (const edge of s.edges) {
|
|
14614
|
+
const sourceNode = s.nodeLookup.get(edge.source), targetNode = s.nodeLookup.get(edge.target);
|
|
14623
14615
|
sourceNode && targetNode && isEdgeVisible({
|
|
14624
14616
|
sourceNode,
|
|
14625
14617
|
targetNode,
|
|
14626
|
-
width:
|
|
14627
|
-
height:
|
|
14628
|
-
transform:
|
|
14618
|
+
width: s.width,
|
|
14619
|
+
height: s.height,
|
|
14620
|
+
transform: s.transform
|
|
14629
14621
|
}) && visibleEdgeIds.push(edge.id);
|
|
14630
14622
|
}
|
|
14631
14623
|
return visibleEdgeIds;
|
|
@@ -14655,7 +14647,7 @@ const Marker = ({ id: id2, type, color: color2, width = 12.5, height = 12.5, mar
|
|
|
14655
14647
|
const Symbol2 = useMarkerSymbol(type);
|
|
14656
14648
|
return Symbol2 ? jsx("marker", { className: "react-flow__arrowhead", id: id2, markerWidth: `${width}`, markerHeight: `${height}`, viewBox: "-10 -10 20 20", markerUnits, orient, refX: "0", refY: "0", children: jsx(Symbol2, { color: color2, strokeWidth }) }) : null;
|
|
14657
14649
|
}, MarkerDefinitions = ({ defaultColor, rfId }) => {
|
|
14658
|
-
const edges = useStore((
|
|
14650
|
+
const edges = useStore((s) => s.edges), defaultEdgeOptions = useStore((s) => s.defaultEdgeOptions), markers = useMemo(() => createMarkerIds(edges, {
|
|
14659
14651
|
id: rfId,
|
|
14660
14652
|
defaultColor,
|
|
14661
14653
|
defaultMarkerStart: defaultEdgeOptions?.markerStart,
|
|
@@ -14665,7 +14657,7 @@ const Marker = ({ id: id2, type, color: color2, width = 12.5, height = 12.5, mar
|
|
|
14665
14657
|
};
|
|
14666
14658
|
MarkerDefinitions.displayName = "MarkerDefinitions";
|
|
14667
14659
|
var MarkerDefinitions$1 = memo$1(MarkerDefinitions);
|
|
14668
|
-
function EdgeTextComponent({ x, y
|
|
14660
|
+
function EdgeTextComponent({ x, y, label, labelStyle, labelShowBg = !0, labelBgStyle, labelBgPadding = [2, 4], labelBgBorderRadius = 2, children: children2, className, ...rest }) {
|
|
14669
14661
|
const [edgeTextBbox, setEdgeTextBbox] = useState({ x: 1, y: 0, width: 0, height: 0 }), edgeTextClasses = cc(["react-flow__edge-textwrapper", className]), edgeTextRef = useRef(null);
|
|
14670
14662
|
return useEffect(() => {
|
|
14671
14663
|
if (edgeTextRef.current) {
|
|
@@ -14677,7 +14669,7 @@ function EdgeTextComponent({ x, y: y2, label, labelStyle, labelShowBg = !0, labe
|
|
|
14677
14669
|
height: textBbox.height
|
|
14678
14670
|
});
|
|
14679
14671
|
}
|
|
14680
|
-
}, [label]), label ? jsxs("g", { transform: `translate(${x - edgeTextBbox.width / 2} ${
|
|
14672
|
+
}, [label]), label ? jsxs("g", { transform: `translate(${x - edgeTextBbox.width / 2} ${y - edgeTextBbox.height / 2})`, className: edgeTextClasses, visibility: edgeTextBbox.width ? "visible" : "hidden", ...rest, children: [labelShowBg && jsx("rect", { width: edgeTextBbox.width + 2 * labelBgPadding[0], x: -labelBgPadding[0], y: -labelBgPadding[1], height: edgeTextBbox.height + 2 * labelBgPadding[1], className: "react-flow__edge-textbg", style: labelBgStyle, rx: labelBgBorderRadius, ry: labelBgBorderRadius }), jsx("text", { className: "react-flow__edge-text", y: edgeTextBbox.height / 2, dy: "0.3em", ref: edgeTextRef, style: labelStyle, children: label }), children2] }) : null;
|
|
14681
14673
|
}
|
|
14682
14674
|
EdgeTextComponent.displayName = "EdgeText";
|
|
14683
14675
|
const EdgeText = memo$1(EdgeTextComponent);
|
|
@@ -14801,7 +14793,7 @@ const builtinEdgeTypes = {
|
|
|
14801
14793
|
targetY: null,
|
|
14802
14794
|
sourcePosition: null,
|
|
14803
14795
|
targetPosition: null
|
|
14804
|
-
}, shiftX = (x, shift2, position) => position === Position.Left ? x - shift2 : position === Position.Right ? x + shift2 : x, shiftY = (
|
|
14796
|
+
}, shiftX = (x, shift2, position) => position === Position.Left ? x - shift2 : position === Position.Right ? x + shift2 : x, shiftY = (y, shift2, position) => position === Position.Top ? y - shift2 : position === Position.Bottom ? y + shift2 : y, EdgeUpdaterClassName = "react-flow__edgeupdater";
|
|
14805
14797
|
function EdgeAnchor({ position, centerX, centerY, radius = 10, onMouseDown, onMouseEnter, onMouseOut, type }) {
|
|
14806
14798
|
return jsx("circle", { onMouseDown, onMouseEnter, onMouseOut, className: cc([EdgeUpdaterClassName, `${EdgeUpdaterClassName}-${type}`]), cx: shiftX(centerX, radius, position), cy: shiftY(centerY, radius, position), r: radius, stroke: "transparent", fill: "transparent" });
|
|
14807
14799
|
}
|
|
@@ -14843,8 +14835,8 @@ function EdgeUpdateAnchors({ isReconnectable, reconnectRadius, edge, sourceX, so
|
|
|
14843
14835
|
return jsxs(Fragment$1, { children: [(isReconnectable === !0 || isReconnectable === "source") && jsx(EdgeAnchor, { position: sourcePosition, centerX: sourceX, centerY: sourceY, radius: reconnectRadius, onMouseDown: onReconnectSourceMouseDown, onMouseEnter: onReconnectMouseEnter, onMouseOut: onReconnectMouseOut, type: "source" }), (isReconnectable === !0 || isReconnectable === "target") && jsx(EdgeAnchor, { position: targetPosition, centerX: targetX, centerY: targetY, radius: reconnectRadius, onMouseDown: onReconnectTargetMouseDown, onMouseEnter: onReconnectMouseEnter, onMouseOut: onReconnectMouseOut, type: "target" })] });
|
|
14844
14836
|
}
|
|
14845
14837
|
function EdgeWrapper({ id: id2, edgesFocusable, edgesReconnectable, elementsSelectable, onClick, onDoubleClick, onContextMenu, onMouseEnter, onMouseMove, onMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, rfId, edgeTypes, noPanClassName, onError, disableKeyboardA11y }) {
|
|
14846
|
-
let edge = useStore((
|
|
14847
|
-
const defaultEdgeOptions = useStore((
|
|
14838
|
+
let edge = useStore((s) => s.edgeLookup.get(id2));
|
|
14839
|
+
const defaultEdgeOptions = useStore((s) => s.defaultEdgeOptions);
|
|
14848
14840
|
edge = defaultEdgeOptions ? { ...defaultEdgeOptions, ...edge } : edge;
|
|
14849
14841
|
let edgeType = edge.type || "default", EdgeComponent = edgeTypes?.[edgeType] || builtinEdgeTypes[edgeType];
|
|
14850
14842
|
EdgeComponent === void 0 && (onError?.("011", errorMessages.error011(edgeType)), edgeType = "default", EdgeComponent = edgeTypes?.default || builtinEdgeTypes.default);
|
|
@@ -14910,19 +14902,19 @@ function EdgeWrapper({ id: id2, edgesFocusable, edgesReconnectable, elementsSele
|
|
|
14910
14902
|
}
|
|
14911
14903
|
]), onClick: onEdgeClick, onDoubleClick: onEdgeDoubleClick, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onKeyDown: isFocusable ? onKeyDown : void 0, tabIndex: isFocusable ? 0 : void 0, role: edge.ariaRole ?? (isFocusable ? "group" : "img"), "aria-roledescription": "edge", "data-id": id2, "data-testid": `rf__edge-${id2}`, "aria-label": edge.ariaLabel === null ? void 0 : edge.ariaLabel || `Edge from ${edge.source} to ${edge.target}`, "aria-describedby": isFocusable ? `${ARIA_EDGE_DESC_KEY}-${rfId}` : void 0, ref: edgeRef, ...edge.domAttributes, children: [!reconnecting && jsx(EdgeComponent, { id: id2, source: edge.source, target: edge.target, type: edge.type, selected: edge.selected, animated: edge.animated, selectable: isSelectable, deletable: edge.deletable ?? !0, label: edge.label, labelStyle: edge.labelStyle, labelShowBg: edge.labelShowBg, labelBgStyle: edge.labelBgStyle, labelBgPadding: edge.labelBgPadding, labelBgBorderRadius: edge.labelBgBorderRadius, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, data: edge.data, style: edge.style, sourceHandleId: edge.sourceHandle, targetHandleId: edge.targetHandle, markerStart: markerStartUrl, markerEnd: markerEndUrl, pathOptions: "pathOptions" in edge ? edge.pathOptions : void 0, interactionWidth: edge.interactionWidth }), isReconnectable && jsx(EdgeUpdateAnchors, { edge, isReconnectable, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, setUpdateHover, setReconnecting })] }) });
|
|
14912
14904
|
}
|
|
14913
|
-
const selector$a = (
|
|
14914
|
-
edgesFocusable:
|
|
14915
|
-
edgesReconnectable:
|
|
14916
|
-
elementsSelectable:
|
|
14917
|
-
connectionMode:
|
|
14918
|
-
onError:
|
|
14905
|
+
const selector$a = (s) => ({
|
|
14906
|
+
edgesFocusable: s.edgesFocusable,
|
|
14907
|
+
edgesReconnectable: s.edgesReconnectable,
|
|
14908
|
+
elementsSelectable: s.elementsSelectable,
|
|
14909
|
+
connectionMode: s.connectionMode,
|
|
14910
|
+
onError: s.onError
|
|
14919
14911
|
});
|
|
14920
14912
|
function EdgeRendererComponent({ defaultMarkerColor, onlyRenderVisibleElements, rfId, edgeTypes, noPanClassName, onReconnect, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeClick, reconnectRadius, onEdgeDoubleClick, onReconnectStart, onReconnectEnd, disableKeyboardA11y }) {
|
|
14921
14913
|
const { edgesFocusable, edgesReconnectable, elementsSelectable, onError } = useStore(selector$a, shallow$1), edgeIds = useVisibleEdgeIds(onlyRenderVisibleElements);
|
|
14922
14914
|
return jsxs("div", { className: "react-flow__edges", children: [jsx(MarkerDefinitions$1, { defaultColor: defaultMarkerColor, rfId }), edgeIds.map((id2) => jsx(EdgeWrapper, { id: id2, edgesFocusable, edgesReconnectable, elementsSelectable, noPanClassName, onReconnect, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onClick: onEdgeClick, reconnectRadius, onDoubleClick: onEdgeDoubleClick, onReconnectStart, onReconnectEnd, rfId, onError, edgeTypes, disableKeyboardA11y }, id2))] });
|
|
14923
14915
|
}
|
|
14924
14916
|
EdgeRendererComponent.displayName = "EdgeRenderer";
|
|
14925
|
-
const EdgeRenderer = memo$1(EdgeRendererComponent), selector$9 = (
|
|
14917
|
+
const EdgeRenderer = memo$1(EdgeRendererComponent), selector$9 = (s) => `translate(${s.transform[0]}px,${s.transform[1]}px) scale(${s.transform[2]})`;
|
|
14926
14918
|
function Viewport({ children: children2 }) {
|
|
14927
14919
|
const transform2 = useStore(selector$9);
|
|
14928
14920
|
return jsx("div", { className: "react-flow__viewport xyflow__viewport react-flow__container", style: { transform: transform2 }, children: children2 });
|
|
@@ -14940,8 +14932,8 @@ function useViewportSync(viewport) {
|
|
|
14940
14932
|
viewport && (syncViewport?.(viewport), store.setState({ transform: [viewport.x, viewport.y, viewport.zoom] }));
|
|
14941
14933
|
}, [viewport, syncViewport]), null;
|
|
14942
14934
|
}
|
|
14943
|
-
function storeSelector$1(
|
|
14944
|
-
return
|
|
14935
|
+
function storeSelector$1(s) {
|
|
14936
|
+
return s.connection.inProgress ? { ...s.connection, to: pointToRendererPoint(s.connection.to, s.transform) } : { ...s.connection };
|
|
14945
14937
|
}
|
|
14946
14938
|
function getSelector(connectionSelector) {
|
|
14947
14939
|
return storeSelector$1;
|
|
@@ -14950,12 +14942,12 @@ function useConnection(connectionSelector) {
|
|
|
14950
14942
|
const combinedSelector = getSelector();
|
|
14951
14943
|
return useStore(combinedSelector, shallow$1);
|
|
14952
14944
|
}
|
|
14953
|
-
const selector$7 = (
|
|
14954
|
-
nodesConnectable:
|
|
14955
|
-
isValid:
|
|
14956
|
-
inProgress:
|
|
14957
|
-
width:
|
|
14958
|
-
height:
|
|
14945
|
+
const selector$7 = (s) => ({
|
|
14946
|
+
nodesConnectable: s.nodesConnectable,
|
|
14947
|
+
isValid: s.connection.isValid,
|
|
14948
|
+
inProgress: s.connection.inProgress,
|
|
14949
|
+
width: s.width,
|
|
14950
|
+
height: s.height
|
|
14959
14951
|
});
|
|
14960
14952
|
function ConnectionLineWrapper({ containerStyle: containerStyle2, style: style2, type, component }) {
|
|
14961
14953
|
const { nodesConnectable, width, height, isValid, inProgress } = useStore(selector$7, shallow$1);
|
|
@@ -15023,8 +15015,8 @@ const GraphView = memo$1(GraphViewComponent), getInitialState = ({ nodes, edges,
|
|
|
15023
15015
|
if (fitView && width && height) {
|
|
15024
15016
|
const bounds = getInternalNodesBounds(nodeLookup, {
|
|
15025
15017
|
filter: (node) => !!((node.width || node.initialWidth) && (node.height || node.initialHeight))
|
|
15026
|
-
}), { x, y
|
|
15027
|
-
transform2 = [x,
|
|
15018
|
+
}), { x, y, zoom: zoom2 } = getViewportForBounds(bounds, width, height, minZoom, maxZoom, fitViewOptions?.padding ?? 0.1);
|
|
15019
|
+
transform2 = [x, y, zoom2];
|
|
15028
15020
|
}
|
|
15029
15021
|
return {
|
|
15030
15022
|
rfId: "1",
|
|
@@ -15254,14 +15246,14 @@ const GraphView = memo$1(GraphViewComponent), getInitialState = ({ nodes, edges,
|
|
|
15254
15246
|
const { transform: transform2, width: width2, height: height2, panZoom, translateExtent } = get2();
|
|
15255
15247
|
return panBy({ delta, panZoom, transform: transform2, translateExtent, width: width2, height: height2 });
|
|
15256
15248
|
},
|
|
15257
|
-
setCenter: async (x,
|
|
15249
|
+
setCenter: async (x, y, options) => {
|
|
15258
15250
|
const { width: width2, height: height2, maxZoom: maxZoom2, panZoom } = get2();
|
|
15259
15251
|
if (!panZoom)
|
|
15260
15252
|
return Promise.resolve(!1);
|
|
15261
15253
|
const nextZoom = typeof options?.zoom < "u" ? options.zoom : maxZoom2;
|
|
15262
15254
|
return await panZoom.setViewport({
|
|
15263
15255
|
x: width2 / 2 - x * nextZoom,
|
|
15264
|
-
y: height2 / 2 -
|
|
15256
|
+
y: height2 / 2 - y * nextZoom,
|
|
15265
15257
|
zoom: nextZoom
|
|
15266
15258
|
}, { duration: options?.duration, ease: options?.ease, interpolate: options?.interpolate }), Promise.resolve(!0);
|
|
15267
15259
|
},
|
|
@@ -15310,13 +15302,13 @@ function ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTy
|
|
|
15310
15302
|
return jsx("div", { "data-testid": "rf__wrapper", ...rest, onScroll: wrapperOnScroll, style: { ...style2, ...wrapperStyle }, ref, className: cc(["react-flow", className, colorModeClassName]), id: id2, role: "application", children: jsxs(Wrapper, { nodes, edges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, children: [jsx(GraphView, { onInit, onNodeClick, onEdgeClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, nodeTypes, edgeTypes, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, deleteKeyCode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent, minZoom, maxZoom, preventScrolling, zoomOnScroll, zoomOnPinch, zoomOnDoubleClick, panOnScroll, panOnScrollSpeed, panOnScrollMode, panOnDrag, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, defaultMarkerColor, noDragClassName, noWheelClassName, noPanClassName, rfId, disableKeyboardA11y, nodeExtent, viewport, onViewportChange }), jsx(StoreUpdater, { nodes, edges, defaultNodes, defaultEdges, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, nodesDraggable, autoPanOnNodeFocus, nodesConnectable, nodesFocusable, edgesFocusable, edgesReconnectable, elementsSelectable, elevateNodesOnSelect, elevateEdgesOnSelect, minZoom, maxZoom, nodeExtent, onNodesChange, onEdgesChange, snapToGrid, snapGrid, connectionMode, translateExtent, connectOnClick, defaultEdgeOptions, fitView, fitViewOptions, onNodesDelete, onEdgesDelete, onDelete, onNodeDragStart, onNodeDrag, onNodeDragStop, onSelectionDrag, onSelectionDragStart, onSelectionDragStop, onMove, onMoveStart, onMoveEnd, noPanClassName, nodeOrigin, rfId, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, onError, connectionRadius, isValidConnection, selectNodesOnDrag, nodeDragThreshold, connectionDragThreshold, onBeforeDelete, paneClickDistance, debug, ariaLabelConfig }), jsx(SelectionListener, { onSelectionChange }), children2, jsx(Attribution, { proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId, disableKeyboardA11y })] }) });
|
|
15311
15303
|
}
|
|
15312
15304
|
var index = fixedForwardRef(ReactFlow);
|
|
15313
|
-
const selector$6 = (
|
|
15305
|
+
const selector$6 = (s) => s.domNode?.querySelector(".react-flow__edgelabel-renderer");
|
|
15314
15306
|
function EdgeLabelRenderer({ children: children2 }) {
|
|
15315
15307
|
const edgeLabelRenderer = useStore(selector$6);
|
|
15316
15308
|
return edgeLabelRenderer ? createPortal(children2, edgeLabelRenderer) : null;
|
|
15317
15309
|
}
|
|
15318
15310
|
function useInternalNode(id2) {
|
|
15319
|
-
return useStore(useCallback((
|
|
15311
|
+
return useStore(useCallback((s) => s.nodeLookup.get(id2), [id2]), shallow$1);
|
|
15320
15312
|
}
|
|
15321
15313
|
function LinePattern({ dimensions, lineWidth, variant, className }) {
|
|
15322
15314
|
return jsx("path", { strokeWidth: lineWidth, d: `M${dimensions[0] / 2} 0 V${dimensions[1]} M0 ${dimensions[1] / 2} H${dimensions[0]}`, className: cc(["react-flow__background-pattern", variant, className]) });
|
|
@@ -15332,7 +15324,7 @@ const defaultSize = {
|
|
|
15332
15324
|
[BackgroundVariant.Dots]: 1,
|
|
15333
15325
|
[BackgroundVariant.Lines]: 1,
|
|
15334
15326
|
[BackgroundVariant.Cross]: 6
|
|
15335
|
-
}, selector$3 = (
|
|
15327
|
+
}, selector$3 = (s) => ({ transform: s.transform, patternId: `pattern-${s.rfId}` });
|
|
15336
15328
|
function BackgroundComponent({
|
|
15337
15329
|
id: id2,
|
|
15338
15330
|
variant = BackgroundVariant.Dots,
|
|
@@ -15379,11 +15371,11 @@ function UnlockIcon() {
|
|
|
15379
15371
|
function ControlButton({ children: children2, className, ...rest }) {
|
|
15380
15372
|
return jsx("button", { type: "button", className: cc(["react-flow__controls-button", className]), ...rest, children: children2 });
|
|
15381
15373
|
}
|
|
15382
|
-
const selector$2 = (
|
|
15383
|
-
isInteractive:
|
|
15384
|
-
minZoomReached:
|
|
15385
|
-
maxZoomReached:
|
|
15386
|
-
ariaLabelConfig:
|
|
15374
|
+
const selector$2 = (s) => ({
|
|
15375
|
+
isInteractive: s.nodesDraggable || s.nodesConnectable || s.elementsSelectable,
|
|
15376
|
+
minZoomReached: s.transform[2] <= s.minZoom,
|
|
15377
|
+
maxZoomReached: s.transform[2] >= s.maxZoom,
|
|
15378
|
+
ariaLabelConfig: s.ariaLabelConfig
|
|
15387
15379
|
});
|
|
15388
15380
|
function ControlsComponent({ style: style2, showZoom = !0, showFitView = !0, showInteractive = !0, fitViewOptions, onZoomIn, onZoomOut, onFitView, onInteractiveChange, className, children: children2, position = "bottom-left", orientation = "vertical", "aria-label": ariaLabel }) {
|
|
15389
15381
|
const store = useStoreApi(), { isInteractive, minZoomReached, maxZoomReached, ariaLabelConfig } = useStore(selector$2, shallow$1), { zoomIn, zoomOut, fitView } = useReactFlow(), onZoomInHandler = () => {
|
|
@@ -15403,15 +15395,15 @@ function ControlsComponent({ style: style2, showZoom = !0, showFitView = !0, sho
|
|
|
15403
15395
|
}
|
|
15404
15396
|
ControlsComponent.displayName = "Controls";
|
|
15405
15397
|
memo$1(ControlsComponent);
|
|
15406
|
-
function MiniMapNodeComponent({ id: id2, x, y
|
|
15398
|
+
function MiniMapNodeComponent({ id: id2, x, y, width, height, style: style2, color: color2, strokeColor, strokeWidth, className, borderRadius: borderRadius2, shapeRendering, selected: selected2, onClick }) {
|
|
15407
15399
|
const { background, backgroundColor } = style2 || {}, fill = color2 || background || backgroundColor;
|
|
15408
|
-
return jsx("rect", { className: cc(["react-flow__minimap-node", { selected: selected2 }, className]), x, y
|
|
15400
|
+
return jsx("rect", { className: cc(["react-flow__minimap-node", { selected: selected2 }, className]), x, y, rx: borderRadius2, ry: borderRadius2, width, height, style: {
|
|
15409
15401
|
fill,
|
|
15410
15402
|
stroke: strokeColor,
|
|
15411
15403
|
strokeWidth
|
|
15412
15404
|
}, shapeRendering, onClick: onClick ? (event) => onClick(event, id2) : void 0 });
|
|
15413
15405
|
}
|
|
15414
|
-
const MiniMapNode = memo$1(MiniMapNodeComponent), selectorNodeIds = (
|
|
15406
|
+
const MiniMapNode = memo$1(MiniMapNodeComponent), selectorNodeIds = (s) => s.nodes.map((node) => node.id), getAttrFunction = (func) => func instanceof Function ? func : () => func;
|
|
15415
15407
|
function MiniMapNodes({
|
|
15416
15408
|
nodeStrokeColor,
|
|
15417
15409
|
nodeColor,
|
|
@@ -15438,36 +15430,36 @@ function MiniMapNodes({
|
|
|
15438
15430
|
)) });
|
|
15439
15431
|
}
|
|
15440
15432
|
function NodeComponentWrapperInner({ id: id2, nodeColorFunc, nodeStrokeColorFunc, nodeClassNameFunc, nodeBorderRadius, nodeStrokeWidth, shapeRendering, NodeComponent, onClick }) {
|
|
15441
|
-
const { node, x, y
|
|
15442
|
-
const { internals } =
|
|
15433
|
+
const { node, x, y, width, height } = useStore((s) => {
|
|
15434
|
+
const { internals } = s.nodeLookup.get(id2), node2 = internals.userNode, { x: x2, y: y2 } = internals.positionAbsolute, { width: width2, height: height2 } = getNodeDimensions(node2);
|
|
15443
15435
|
return {
|
|
15444
15436
|
node: node2,
|
|
15445
15437
|
x: x2,
|
|
15446
|
-
y:
|
|
15438
|
+
y: y2,
|
|
15447
15439
|
width: width2,
|
|
15448
15440
|
height: height2
|
|
15449
15441
|
};
|
|
15450
15442
|
}, shallow$1);
|
|
15451
|
-
return !node || node.hidden || !nodeHasDimensions(node) ? null : jsx(NodeComponent, { x, y
|
|
15443
|
+
return !node || node.hidden || !nodeHasDimensions(node) ? null : jsx(NodeComponent, { x, y, width, height, style: node.style, selected: !!node.selected, className: nodeClassNameFunc(node), color: nodeColorFunc(node), borderRadius: nodeBorderRadius, strokeColor: nodeStrokeColorFunc(node), strokeWidth: nodeStrokeWidth, shapeRendering, onClick, id: node.id });
|
|
15452
15444
|
}
|
|
15453
15445
|
const NodeComponentWrapper = memo$1(NodeComponentWrapperInner);
|
|
15454
15446
|
var MiniMapNodes$1 = memo$1(MiniMapNodes);
|
|
15455
|
-
const defaultWidth = 200, defaultHeight = 150, filterHidden = (node) => !node.hidden, selector$1 = (
|
|
15447
|
+
const defaultWidth = 200, defaultHeight = 150, filterHidden = (node) => !node.hidden, selector$1 = (s) => {
|
|
15456
15448
|
const viewBB = {
|
|
15457
|
-
x: -
|
|
15458
|
-
y: -
|
|
15459
|
-
width:
|
|
15460
|
-
height:
|
|
15449
|
+
x: -s.transform[0] / s.transform[2],
|
|
15450
|
+
y: -s.transform[1] / s.transform[2],
|
|
15451
|
+
width: s.width / s.transform[2],
|
|
15452
|
+
height: s.height / s.transform[2]
|
|
15461
15453
|
};
|
|
15462
15454
|
return {
|
|
15463
15455
|
viewBB,
|
|
15464
|
-
boundingRect:
|
|
15465
|
-
rfId:
|
|
15466
|
-
panZoom:
|
|
15467
|
-
translateExtent:
|
|
15468
|
-
flowWidth:
|
|
15469
|
-
flowHeight:
|
|
15470
|
-
ariaLabelConfig:
|
|
15456
|
+
boundingRect: s.nodeLookup.size > 0 ? getBoundsOfRects(getInternalNodesBounds(s.nodeLookup, { filter: filterHidden }), viewBB) : viewBB,
|
|
15457
|
+
rfId: s.rfId,
|
|
15458
|
+
panZoom: s.panZoom,
|
|
15459
|
+
translateExtent: s.translateExtent,
|
|
15460
|
+
flowWidth: s.width,
|
|
15461
|
+
flowHeight: s.height,
|
|
15462
|
+
ariaLabelConfig: s.ariaLabelConfig
|
|
15471
15463
|
};
|
|
15472
15464
|
}, ARIA_LABEL_KEY = "react-flow__minimap-desc";
|
|
15473
15465
|
function MiniMapComponent({
|
|
@@ -15497,7 +15489,7 @@ function MiniMapComponent({
|
|
|
15497
15489
|
zoomStep = 1,
|
|
15498
15490
|
offsetScale = 5
|
|
15499
15491
|
}) {
|
|
15500
|
-
const store = useStoreApi(), svg = useRef(null), { boundingRect, viewBB, rfId, panZoom, translateExtent, flowWidth, flowHeight, ariaLabelConfig } = useStore(selector$1, shallow$1), elementWidth = style2?.width ?? defaultWidth, elementHeight = style2?.height ?? defaultHeight, scaledWidth = boundingRect.width / elementWidth, scaledHeight = boundingRect.height / elementHeight, viewScale = Math.max(scaledWidth, scaledHeight), viewWidth = viewScale * elementWidth, viewHeight = viewScale * elementHeight, offset2 = offsetScale * viewScale, x = boundingRect.x - (viewWidth - boundingRect.width) / 2 - offset2,
|
|
15492
|
+
const store = useStoreApi(), svg = useRef(null), { boundingRect, viewBB, rfId, panZoom, translateExtent, flowWidth, flowHeight, ariaLabelConfig } = useStore(selector$1, shallow$1), elementWidth = style2?.width ?? defaultWidth, elementHeight = style2?.height ?? defaultHeight, scaledWidth = boundingRect.width / elementWidth, scaledHeight = boundingRect.height / elementHeight, viewScale = Math.max(scaledWidth, scaledHeight), viewWidth = viewScale * elementWidth, viewHeight = viewScale * elementHeight, offset2 = offsetScale * viewScale, x = boundingRect.x - (viewWidth - boundingRect.width) / 2 - offset2, y = boundingRect.y - (viewHeight - boundingRect.height) / 2 - offset2, width = viewWidth + offset2 * 2, height = viewHeight + offset2 * 2, labelledBy = `${ARIA_LABEL_KEY}-${rfId}`, viewScaleRef = useRef(0), minimapInstance = useRef();
|
|
15501
15493
|
viewScaleRef.current = viewScale, useEffect(() => {
|
|
15502
15494
|
if (svg.current && panZoom)
|
|
15503
15495
|
return minimapInstance.current = XYMinimap({
|
|
@@ -15520,8 +15512,8 @@ function MiniMapComponent({
|
|
|
15520
15512
|
});
|
|
15521
15513
|
}, [pannable, zoomable, inversePan, zoomStep, translateExtent, flowWidth, flowHeight]);
|
|
15522
15514
|
const onSvgClick = onClick ? (event) => {
|
|
15523
|
-
const [x2,
|
|
15524
|
-
onClick(event, { x: x2, y:
|
|
15515
|
+
const [x2, y2] = minimapInstance.current?.pointer(event) || [0, 0];
|
|
15516
|
+
onClick(event, { x: x2, y: y2 });
|
|
15525
15517
|
} : void 0, onSvgNodeClick = onNodeClick ? useCallback((event, nodeId) => {
|
|
15526
15518
|
const node = store.getState().nodeLookup.get(nodeId).internals.userNode;
|
|
15527
15519
|
onNodeClick(event, node);
|
|
@@ -15535,7 +15527,7 @@ function MiniMapComponent({
|
|
|
15535
15527
|
"--xy-minimap-node-background-color-props": typeof nodeColor == "string" ? nodeColor : void 0,
|
|
15536
15528
|
"--xy-minimap-node-stroke-color-props": typeof nodeStrokeColor == "string" ? nodeStrokeColor : void 0,
|
|
15537
15529
|
"--xy-minimap-node-stroke-width-props": typeof nodeStrokeWidth == "number" ? nodeStrokeWidth : void 0
|
|
15538
|
-
}, className: cc(["react-flow__minimap", className]), "data-testid": "rf__minimap", children: jsxs("svg", { width: elementWidth, height: elementHeight, viewBox: `${x} ${
|
|
15530
|
+
}, className: cc(["react-flow__minimap", className]), "data-testid": "rf__minimap", children: jsxs("svg", { width: elementWidth, height: elementHeight, viewBox: `${x} ${y} ${width} ${height}`, className: "react-flow__minimap-svg", role: "img", "aria-labelledby": labelledBy, ref: svg, onClick: onSvgClick, children: [_ariaLabel && jsx("title", { id: labelledBy, children: _ariaLabel }), jsx(MiniMapNodes$1, { onClick: onSvgNodeClick, nodeColor, nodeStrokeColor, nodeBorderRadius, nodeClassName, nodeStrokeWidth, nodeComponent }), jsx("path", { className: "react-flow__minimap-mask", d: `M${x - offset2},${y - offset2}h${width + offset2 * 2}v${height + offset2 * 2}h${-width - offset2 * 2}z
|
|
15539
15531
|
M${viewBB.x},${viewBB.y}h${viewBB.width}v${viewBB.height}h${-viewBB.width}z`, fillRule: "evenodd", pointerEvents: "none" })] }) });
|
|
15540
15532
|
}
|
|
15541
15533
|
MiniMapComponent.displayName = "MiniMap";
|
|
@@ -15680,12 +15672,12 @@ function NodeToolbar({ nodeId, children: children2, className, style: style2, is
|
|
|
15680
15672
|
const contextNodeId = useNodeId(), nodesSelector2 = useCallback((state) => (Array.isArray(nodeId) ? nodeId : [nodeId || contextNodeId || ""]).reduce((res, id2) => {
|
|
15681
15673
|
const node = state.nodeLookup.get(id2);
|
|
15682
15674
|
return node && res.set(node.id, node), res;
|
|
15683
|
-
}, /* @__PURE__ */ new Map()), [nodeId, contextNodeId]), nodes = useStore(nodesSelector2, nodesEqualityFn), { x, y
|
|
15675
|
+
}, /* @__PURE__ */ new Map()), [nodeId, contextNodeId]), nodes = useStore(nodesSelector2, nodesEqualityFn), { x, y, zoom: zoom2, selectedNodesCount } = useStore(storeSelector, shallow$1);
|
|
15684
15676
|
if (!(typeof isVisible == "boolean" ? isVisible : nodes.size === 1 && nodes.values().next().value?.selected && selectedNodesCount === 1) || !nodes.size)
|
|
15685
15677
|
return null;
|
|
15686
15678
|
const nodeRect = getInternalNodesBounds(nodes), nodesArray = Array.from(nodes.values()), zIndex = Math.max(...nodesArray.map((node) => node.internals.z + 1)), wrapperStyle2 = {
|
|
15687
15679
|
position: "absolute",
|
|
15688
|
-
transform: getNodeToolbarTransform(nodeRect, { x, y
|
|
15680
|
+
transform: getNodeToolbarTransform(nodeRect, { x, y, zoom: zoom2 }, position, offset2, align),
|
|
15689
15681
|
zIndex,
|
|
15690
15682
|
...style2
|
|
15691
15683
|
};
|
|
@@ -15798,8 +15790,8 @@ const { valueOf, toString } = Object.prototype, isEqual = (a, b) => {
|
|
|
15798
15790
|
return a2.toString() === b2.toString();
|
|
15799
15791
|
const aKeys = Object.keys(a2);
|
|
15800
15792
|
let key;
|
|
15801
|
-
for (let
|
|
15802
|
-
if (key = aKeys[
|
|
15793
|
+
for (let l = aKeys.length; l-- !== 0; )
|
|
15794
|
+
if (key = aKeys[l], !Object.hasOwn(b2, key) || !inner(a2[key], b2[key]))
|
|
15803
15795
|
return !1;
|
|
15804
15796
|
return Object.keys(b2).length === aKeys.length;
|
|
15805
15797
|
};
|
|
@@ -15848,7 +15840,7 @@ const HandlerNames = [
|
|
|
15848
15840
|
"onChange",
|
|
15849
15841
|
"onCanvasDblClick"
|
|
15850
15842
|
], DiagramEventHandlersReactContext = createContext({
|
|
15851
|
-
...
|
|
15843
|
+
...t$1(HandlerNames, (name) => [name, null]),
|
|
15852
15844
|
handlersRef: {
|
|
15853
15845
|
current: {}
|
|
15854
15846
|
}
|
|
@@ -15857,8 +15849,8 @@ function DiagramEventHandlers({
|
|
|
15857
15849
|
handlers,
|
|
15858
15850
|
children: children2
|
|
15859
15851
|
}) {
|
|
15860
|
-
const handlersRef = useSyncedRef(handlers), deps = HandlerNames.map((name) =>
|
|
15861
|
-
...
|
|
15852
|
+
const handlersRef = useSyncedRef(handlers), deps = HandlerNames.map((name) => e$2(handlers[name])), value = useMemo(() => ({
|
|
15853
|
+
...t$1(HandlerNames, (name) => handlersRef.current[name] ? [name, (...args) => handlersRef.current[name]?.(...args)] : [name, null]),
|
|
15862
15854
|
handlersRef
|
|
15863
15855
|
}), [handlersRef, ...deps]);
|
|
15864
15856
|
return /* @__PURE__ */ jsx(DiagramEventHandlersReactContext.Provider, { value, children: children2 });
|
|
@@ -16148,7 +16140,7 @@ const FeatureNames = [
|
|
|
16148
16140
|
*/
|
|
16149
16141
|
"Vscode",
|
|
16150
16142
|
"ElementTags"
|
|
16151
|
-
], AllDisabled =
|
|
16143
|
+
], AllDisabled = t$1(
|
|
16152
16144
|
FeatureNames,
|
|
16153
16145
|
(name) => [`enable${name}`, !1]
|
|
16154
16146
|
), DiagramFeaturesContext = createContext(AllDisabled), validate = (features) => {
|
|
@@ -16459,14 +16451,14 @@ const TagStylesContext = createContext({}), radixColors = [
|
|
|
16459
16451
|
function TagStylesProvider({ children: children2, rootSelector }) {
|
|
16460
16452
|
const tags = useLikeC4Specification().tags, { specs, stylesheet } = useDeepCompareMemo(() => tags ? {
|
|
16461
16453
|
specs: tags,
|
|
16462
|
-
stylesheet:
|
|
16463
|
-
t$
|
|
16464
|
-
|
|
16454
|
+
stylesheet: t$7(
|
|
16455
|
+
t$5(tags),
|
|
16456
|
+
t$4(([tag, spec]) => [
|
|
16465
16457
|
`:is(${rootSelector} [data-likec4-tag="${tag}"]) {`,
|
|
16466
16458
|
generateColorVars(spec),
|
|
16467
16459
|
"}"
|
|
16468
16460
|
]),
|
|
16469
|
-
|
|
16461
|
+
t$3(`
|
|
16470
16462
|
`)
|
|
16471
16463
|
)
|
|
16472
16464
|
} : { specs: {}, stylesheet: "" }, [tags, rootSelector]);
|
|
@@ -16547,7 +16539,7 @@ function useIsZoomTooSmall() {
|
|
|
16547
16539
|
}
|
|
16548
16540
|
function getDevicePixelRatio() {
|
|
16549
16541
|
const dpr = typeof window < "u" && typeof window.devicePixelRatio == "number" ? window.devicePixelRatio : 1;
|
|
16550
|
-
return
|
|
16542
|
+
return t$9(Math.floor(dpr), {
|
|
16551
16543
|
min: 1,
|
|
16552
16544
|
max: 4
|
|
16553
16545
|
});
|
|
@@ -16616,9 +16608,9 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16616
16608
|
0.0123412297999872
|
|
16617
16609
|
],
|
|
16618
16610
|
arcfn: function(t2, derivativeFn) {
|
|
16619
|
-
const
|
|
16620
|
-
let
|
|
16621
|
-
return typeof
|
|
16611
|
+
const d = derivativeFn(t2);
|
|
16612
|
+
let l = d.x * d.x + d.y * d.y;
|
|
16613
|
+
return typeof d.z < "u" && (l += d.z * d.z), sqrt$1(l);
|
|
16622
16614
|
},
|
|
16623
16615
|
compute: function(t2, points, _3d) {
|
|
16624
16616
|
if (t2 === 0)
|
|
@@ -16639,14 +16631,14 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16639
16631
|
return _3d && (ret.z = mt * p[0].z + t2 * p[1].z), ret;
|
|
16640
16632
|
}
|
|
16641
16633
|
if (order < 4) {
|
|
16642
|
-
let mt2 = mt * mt, t22 = t2 * t2, a, b, c,
|
|
16643
|
-
order === 2 ? (p = [p[0], p[1], p[2], ZERO], a = mt2, b = mt * t2 * 2, c = t22) : order === 3 && (a = mt2 * mt, b = mt2 * t2 * 3, c = mt * t22 * 3,
|
|
16634
|
+
let mt2 = mt * mt, t22 = t2 * t2, a, b, c, d = 0;
|
|
16635
|
+
order === 2 ? (p = [p[0], p[1], p[2], ZERO], a = mt2, b = mt * t2 * 2, c = t22) : order === 3 && (a = mt2 * mt, b = mt2 * t2 * 3, c = mt * t22 * 3, d = t2 * t22);
|
|
16644
16636
|
const ret = {
|
|
16645
|
-
x: a * p[0].x + b * p[1].x + c * p[2].x +
|
|
16646
|
-
y: a * p[0].y + b * p[1].y + c * p[2].y +
|
|
16637
|
+
x: a * p[0].x + b * p[1].x + c * p[2].x + d * p[3].x,
|
|
16638
|
+
y: a * p[0].y + b * p[1].y + c * p[2].y + d * p[3].y,
|
|
16647
16639
|
t: t2
|
|
16648
16640
|
};
|
|
16649
|
-
return _3d && (ret.z = a * p[0].z + b * p[1].z + c * p[2].z +
|
|
16641
|
+
return _3d && (ret.z = a * p[0].z + b * p[1].z + c * p[2].z + d * p[3].z), ret;
|
|
16650
16642
|
}
|
|
16651
16643
|
const dCpts = JSON.parse(JSON.stringify(points));
|
|
16652
16644
|
for (; dCpts.length > 1; ) {
|
|
@@ -16661,32 +16653,32 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16661
16653
|
},
|
|
16662
16654
|
computeWithRatios: function(t2, points, ratios, _3d) {
|
|
16663
16655
|
const mt = 1 - t2, r2 = ratios, p = points;
|
|
16664
|
-
let f1 = r2[0], f2 = r2[1], f3 = r2[2], f4 = r2[3],
|
|
16656
|
+
let f1 = r2[0], f2 = r2[1], f3 = r2[2], f4 = r2[3], d;
|
|
16665
16657
|
if (f1 *= mt, f2 *= t2, p.length === 2)
|
|
16666
|
-
return
|
|
16667
|
-
x: (f1 * p[0].x + f2 * p[1].x) /
|
|
16668
|
-
y: (f1 * p[0].y + f2 * p[1].y) /
|
|
16669
|
-
z: _3d ? (f1 * p[0].z + f2 * p[1].z) /
|
|
16658
|
+
return d = f1 + f2, {
|
|
16659
|
+
x: (f1 * p[0].x + f2 * p[1].x) / d,
|
|
16660
|
+
y: (f1 * p[0].y + f2 * p[1].y) / d,
|
|
16661
|
+
z: _3d ? (f1 * p[0].z + f2 * p[1].z) / d : !1,
|
|
16670
16662
|
t: t2
|
|
16671
16663
|
};
|
|
16672
16664
|
if (f1 *= mt, f2 *= 2 * mt, f3 *= t2 * t2, p.length === 3)
|
|
16673
|
-
return
|
|
16674
|
-
x: (f1 * p[0].x + f2 * p[1].x + f3 * p[2].x) /
|
|
16675
|
-
y: (f1 * p[0].y + f2 * p[1].y + f3 * p[2].y) /
|
|
16676
|
-
z: _3d ? (f1 * p[0].z + f2 * p[1].z + f3 * p[2].z) /
|
|
16665
|
+
return d = f1 + f2 + f3, {
|
|
16666
|
+
x: (f1 * p[0].x + f2 * p[1].x + f3 * p[2].x) / d,
|
|
16667
|
+
y: (f1 * p[0].y + f2 * p[1].y + f3 * p[2].y) / d,
|
|
16668
|
+
z: _3d ? (f1 * p[0].z + f2 * p[1].z + f3 * p[2].z) / d : !1,
|
|
16677
16669
|
t: t2
|
|
16678
16670
|
};
|
|
16679
16671
|
if (f1 *= mt, f2 *= 1.5 * mt, f3 *= 3 * mt, f4 *= t2 * t2 * t2, p.length === 4)
|
|
16680
|
-
return
|
|
16681
|
-
x: (f1 * p[0].x + f2 * p[1].x + f3 * p[2].x + f4 * p[3].x) /
|
|
16682
|
-
y: (f1 * p[0].y + f2 * p[1].y + f3 * p[2].y + f4 * p[3].y) /
|
|
16683
|
-
z: _3d ? (f1 * p[0].z + f2 * p[1].z + f3 * p[2].z + f4 * p[3].z) /
|
|
16672
|
+
return d = f1 + f2 + f3 + f4, {
|
|
16673
|
+
x: (f1 * p[0].x + f2 * p[1].x + f3 * p[2].x + f4 * p[3].x) / d,
|
|
16674
|
+
y: (f1 * p[0].y + f2 * p[1].y + f3 * p[2].y + f4 * p[3].y) / d,
|
|
16675
|
+
z: _3d ? (f1 * p[0].z + f2 * p[1].z + f3 * p[2].z + f4 * p[3].z) / d : !1,
|
|
16684
16676
|
t: t2
|
|
16685
16677
|
};
|
|
16686
16678
|
},
|
|
16687
16679
|
derive: function(points, _3d) {
|
|
16688
16680
|
const dpoints = [];
|
|
16689
|
-
for (let p = points,
|
|
16681
|
+
for (let p = points, d = p.length, c = d - 1; d > 1; d--, c--) {
|
|
16690
16682
|
const list = [];
|
|
16691
16683
|
for (let j = 0, dpt; j < c; j++)
|
|
16692
16684
|
dpt = {
|
|
@@ -16722,8 +16714,8 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16722
16714
|
return v1.z !== void 0 && v2.z !== void 0 && (ret.z = v1.z + r2 * (v2.z - v1.z)), ret;
|
|
16723
16715
|
},
|
|
16724
16716
|
pointToString: function(p) {
|
|
16725
|
-
let
|
|
16726
|
-
return typeof p.z < "u" && (
|
|
16717
|
+
let s = p.x + "/" + p.y;
|
|
16718
|
+
return typeof p.z < "u" && (s += "/" + p.z), s;
|
|
16727
16719
|
},
|
|
16728
16720
|
pointsToString: function(points) {
|
|
16729
16721
|
return "[" + points.map(utils.pointToString).join(", ") + "]";
|
|
@@ -16731,23 +16723,23 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16731
16723
|
copy: function(obj) {
|
|
16732
16724
|
return JSON.parse(JSON.stringify(obj));
|
|
16733
16725
|
},
|
|
16734
|
-
angle: function(
|
|
16735
|
-
const dx1 = v1.x -
|
|
16726
|
+
angle: function(o, v1, v2) {
|
|
16727
|
+
const dx1 = v1.x - o.x, dy1 = v1.y - o.y, dx2 = v2.x - o.x, dy2 = v2.y - o.y, cross = dx1 * dy2 - dy1 * dx2, dot = dx1 * dx2 + dy1 * dy2;
|
|
16736
16728
|
return atan2(cross, dot);
|
|
16737
16729
|
},
|
|
16738
16730
|
// round as string, to avoid rounding errors
|
|
16739
|
-
round: function(v,
|
|
16740
|
-
const
|
|
16741
|
-
return parseFloat(
|
|
16731
|
+
round: function(v, d) {
|
|
16732
|
+
const s = "" + v, pos = s.indexOf(".");
|
|
16733
|
+
return parseFloat(s.substring(0, pos + 1 + d));
|
|
16742
16734
|
},
|
|
16743
16735
|
dist: function(p1, p2) {
|
|
16744
16736
|
const dx = p1.x - p2.x, dy = p1.y - p2.y;
|
|
16745
16737
|
return sqrt$1(dx * dx + dy * dy);
|
|
16746
16738
|
},
|
|
16747
16739
|
closest: function(LUT, point) {
|
|
16748
|
-
let mdist = pow(2, 63), mpos,
|
|
16740
|
+
let mdist = pow(2, 63), mpos, d;
|
|
16749
16741
|
return LUT.forEach(function(p, idx) {
|
|
16750
|
-
|
|
16742
|
+
d = utils.dist(point, p), d < mdist && (mdist = d, mpos = idx);
|
|
16751
16743
|
}), { mdist, mpos };
|
|
16752
16744
|
},
|
|
16753
16745
|
abcratio: function(t2, n2) {
|
|
@@ -16771,8 +16763,8 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16771
16763
|
return top / bottom;
|
|
16772
16764
|
},
|
|
16773
16765
|
lli8: function(x1, y1, x2, y2, x3, y3, x4, y4) {
|
|
16774
|
-
const nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4), ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),
|
|
16775
|
-
return
|
|
16766
|
+
const nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4), ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4), d = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
|
|
16767
|
+
return d == 0 ? !1 : { x: nx / d, y: ny / d };
|
|
16776
16768
|
},
|
|
16777
16769
|
lli4: function(p1, p2, p3, p4) {
|
|
16778
16770
|
const x1 = p1.x, y1 = p1.y, x2 = p2.x, y2 = p2.y, x3 = p3.x, y3 = p3.y, x4 = p4.x, y4 = p4.y;
|
|
@@ -16793,8 +16785,8 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16793
16785
|
},
|
|
16794
16786
|
findbbox: function(sections) {
|
|
16795
16787
|
let mx = nMax, my = nMax, MX = nMin, MY = nMin;
|
|
16796
|
-
return sections.forEach(function(
|
|
16797
|
-
const bbox =
|
|
16788
|
+
return sections.forEach(function(s) {
|
|
16789
|
+
const bbox = s.bbox();
|
|
16798
16790
|
mx > bbox.x.min && (mx = bbox.x.min), my > bbox.y.min && (my = bbox.y.min), MX < bbox.x.max && (MX = bbox.x.max), MY < bbox.y.max && (MY = bbox.y.max);
|
|
16799
16791
|
}), {
|
|
16800
16792
|
x: { min: mx, mid: (mx + MX) / 2, max: MX, size: MX - mx },
|
|
@@ -16830,22 +16822,22 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16830
16822
|
);
|
|
16831
16823
|
}, shape;
|
|
16832
16824
|
},
|
|
16833
|
-
getminmax: function(curve,
|
|
16825
|
+
getminmax: function(curve, d, list) {
|
|
16834
16826
|
if (!list) return { min: 0, max: 0 };
|
|
16835
16827
|
let min2 = nMax, max2 = nMin, t2, c;
|
|
16836
16828
|
list.indexOf(0) === -1 && (list = [0].concat(list)), list.indexOf(1) === -1 && list.push(1);
|
|
16837
16829
|
for (let i2 = 0, len = list.length; i2 < len; i2++)
|
|
16838
|
-
t2 = list[i2], c = curve.get(t2), c[
|
|
16830
|
+
t2 = list[i2], c = curve.get(t2), c[d] < min2 && (min2 = c[d]), c[d] > max2 && (max2 = c[d]);
|
|
16839
16831
|
return { min: min2, mid: (min2 + max2) / 2, max: max2, size: max2 - min2 };
|
|
16840
16832
|
},
|
|
16841
16833
|
align: function(points, line) {
|
|
16842
|
-
const tx = line.p1.x, ty = line.p1.y, a = -atan2(line.p2.y - ty, line.p2.x - tx),
|
|
16834
|
+
const tx = line.p1.x, ty = line.p1.y, a = -atan2(line.p2.y - ty, line.p2.x - tx), d = function(v) {
|
|
16843
16835
|
return {
|
|
16844
16836
|
x: (v.x - tx) * cos$1(a) - (v.y - ty) * sin$1(a),
|
|
16845
16837
|
y: (v.x - tx) * sin$1(a) + (v.y - ty) * cos$1(a)
|
|
16846
16838
|
};
|
|
16847
16839
|
};
|
|
16848
|
-
return points.map(
|
|
16840
|
+
return points.map(d);
|
|
16849
16841
|
},
|
|
16850
16842
|
roots: function(points, line) {
|
|
16851
16843
|
line = line || { p1: { x: 0, y: 0 }, p2: { x: 1, y: 0 } };
|
|
@@ -16853,23 +16845,23 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16853
16845
|
return 0 <= t2 && t2 <= 1;
|
|
16854
16846
|
};
|
|
16855
16847
|
if (order === 2) {
|
|
16856
|
-
const a2 = aligned[0].y, b2 = aligned[1].y, c2 = aligned[2].y,
|
|
16857
|
-
if (
|
|
16858
|
-
const m1 = -sqrt$1(b2 * b2 - a2 * c2), m2 = -a2 + b2, v12 = -(m1 + m2) /
|
|
16848
|
+
const a2 = aligned[0].y, b2 = aligned[1].y, c2 = aligned[2].y, d2 = a2 - 2 * b2 + c2;
|
|
16849
|
+
if (d2 !== 0) {
|
|
16850
|
+
const m1 = -sqrt$1(b2 * b2 - a2 * c2), m2 = -a2 + b2, v12 = -(m1 + m2) / d2, v2 = -(-m1 + m2) / d2;
|
|
16859
16851
|
return [v12, v2].filter(reduce);
|
|
16860
|
-
} else if (b2 !== c2 &&
|
|
16852
|
+
} else if (b2 !== c2 && d2 === 0)
|
|
16861
16853
|
return [(2 * b2 - c2) / (2 * b2 - 2 * c2)].filter(reduce);
|
|
16862
16854
|
return [];
|
|
16863
16855
|
}
|
|
16864
16856
|
const pa = aligned[0].y, pb = aligned[1].y, pc = aligned[2].y, pd = aligned[3].y;
|
|
16865
|
-
let
|
|
16866
|
-
if (utils.approximately(
|
|
16857
|
+
let d = -pa + 3 * pb - 3 * pc + pd, a = 3 * pa - 6 * pb + 3 * pc, b = -3 * pa + 3 * pb, c = pa;
|
|
16858
|
+
if (utils.approximately(d, 0)) {
|
|
16867
16859
|
if (utils.approximately(a, 0))
|
|
16868
16860
|
return utils.approximately(b, 0) ? [] : [-c / b].filter(reduce);
|
|
16869
16861
|
const q3 = sqrt$1(b * b - 4 * a * c), a2 = 2 * a;
|
|
16870
16862
|
return [(q3 - b) / a2, (-b - q3) / a2].filter(reduce);
|
|
16871
16863
|
}
|
|
16872
|
-
a /=
|
|
16864
|
+
a /= d, b /= d, c /= d;
|
|
16873
16865
|
const p = (3 * b - a * a) / 3, p3 = p / 3, q = (2 * a * a * a - 9 * a * b + 27 * c) / 27, q2 = q / 2, discriminant = q2 * q2 + p3 * p3 * p3;
|
|
16874
16866
|
let u1, v1, x1, x2, x3;
|
|
16875
16867
|
if (discriminant < 0) {
|
|
@@ -16886,11 +16878,11 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16886
16878
|
},
|
|
16887
16879
|
droots: function(p) {
|
|
16888
16880
|
if (p.length === 3) {
|
|
16889
|
-
const a = p[0], b = p[1], c = p[2],
|
|
16890
|
-
if (
|
|
16891
|
-
const m1 = -sqrt$1(b * b - a * c), m2 = -a + b, v1 = -(m1 + m2) /
|
|
16881
|
+
const a = p[0], b = p[1], c = p[2], d = a - 2 * b + c;
|
|
16882
|
+
if (d !== 0) {
|
|
16883
|
+
const m1 = -sqrt$1(b * b - a * c), m2 = -a + b, v1 = -(m1 + m2) / d, v2 = -(-m1 + m2) / d;
|
|
16892
16884
|
return [v1, v2];
|
|
16893
|
-
} else if (b !== c &&
|
|
16885
|
+
} else if (b !== c && d === 0)
|
|
16894
16886
|
return [(2 * b - c) / (2 * (b - c))];
|
|
16895
16887
|
return [];
|
|
16896
16888
|
}
|
|
@@ -16902,10 +16894,10 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16902
16894
|
},
|
|
16903
16895
|
curvature: function(t2, d1, d2, _3d, kOnly) {
|
|
16904
16896
|
let num, dnm, adk, dk, k = 0, r2 = 0;
|
|
16905
|
-
const
|
|
16897
|
+
const d = utils.compute(t2, d1), dd = utils.compute(t2, d2), qdsum = d.x * d.x + d.y * d.y;
|
|
16906
16898
|
if (_3d ? (num = sqrt$1(
|
|
16907
|
-
pow(
|
|
16908
|
-
), dnm = pow(qdsum +
|
|
16899
|
+
pow(d.y * dd.z - dd.y * d.z, 2) + pow(d.z * dd.x - dd.z * d.x, 2) + pow(d.x * dd.y - dd.x * d.y, 2)
|
|
16900
|
+
), dnm = pow(qdsum + d.z * d.z, 3 / 2)) : (num = d.x * dd.y - d.y * dd.x, dnm = pow(qdsum, 3 / 2)), num === 0 || dnm === 0)
|
|
16909
16901
|
return { k: 0, r: 0 };
|
|
16910
16902
|
if (k = num / dnm, r2 = dnm / num, !kOnly) {
|
|
16911
16903
|
const pk = utils.curvature(t2 - 1e-3, d1, d2, _3d, !0).k, nk = utils.curvature(t2 + 1e-3, d1, d2, _3d, !0).k;
|
|
@@ -16915,7 +16907,7 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16915
16907
|
},
|
|
16916
16908
|
inflections: function(points) {
|
|
16917
16909
|
if (points.length < 4) return [];
|
|
16918
|
-
const p = utils.align(points, { p1: points[0], p2: points.slice(-1)[0] }), a = p[2].x * p[1].y, b = p[3].x * p[1].y, c = p[1].x * p[2].y,
|
|
16910
|
+
const p = utils.align(points, { p1: points[0], p2: points.slice(-1)[0] }), a = p[2].x * p[1].y, b = p[3].x * p[1].y, c = p[1].x * p[2].y, d = p[3].x * p[2].y, v1 = 18 * (-3 * a + 2 * b + 3 * c - d), v2 = 18 * (3 * a - b - 3 * c), v3 = 18 * (c - a);
|
|
16919
16911
|
if (utils.approximately(v1, 0)) {
|
|
16920
16912
|
if (!utils.approximately(v2, 0)) {
|
|
16921
16913
|
let t2 = -v3 / v2;
|
|
@@ -16923,19 +16915,19 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16923
16915
|
}
|
|
16924
16916
|
return [];
|
|
16925
16917
|
}
|
|
16926
|
-
const
|
|
16927
|
-
if (utils.approximately(
|
|
16918
|
+
const d2 = 2 * v1;
|
|
16919
|
+
if (utils.approximately(d2, 0)) return [];
|
|
16928
16920
|
const trm = v2 * v2 - 4 * v1 * v3;
|
|
16929
16921
|
if (trm < 0) return [];
|
|
16930
16922
|
const sq = Math.sqrt(trm);
|
|
16931
|
-
return [(sq - v2) /
|
|
16923
|
+
return [(sq - v2) / d2, -(v2 + sq) / d2].filter(function(r2) {
|
|
16932
16924
|
return 0 <= r2 && r2 <= 1;
|
|
16933
16925
|
});
|
|
16934
16926
|
},
|
|
16935
16927
|
bboxoverlap: function(b1, b2) {
|
|
16936
16928
|
const dims = ["x", "y"], len = dims.length;
|
|
16937
|
-
for (let i2 = 0, dim,
|
|
16938
|
-
if (dim = dims[i2],
|
|
16929
|
+
for (let i2 = 0, dim, l, t2, d; i2 < len; i2++)
|
|
16930
|
+
if (dim = dims[i2], l = b1[dim].mid, t2 = b2[dim].mid, d = (b1[dim].size + b2[dim].size) / 2, abs$1(l - t2) >= d) return !1;
|
|
16939
16931
|
return !0;
|
|
16940
16932
|
},
|
|
16941
16933
|
expandbox: function(bbox, _bbox) {
|
|
@@ -16967,8 +16959,8 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16967
16959
|
},
|
|
16968
16960
|
getccenter: function(p1, p2, p3) {
|
|
16969
16961
|
const dx1 = p2.x - p1.x, dy1 = p2.y - p1.y, dx2 = p3.x - p2.x, dy2 = p3.y - p2.y, dx1p = dx1 * cos$1(quart) - dy1 * sin$1(quart), dy1p = dx1 * sin$1(quart) + dy1 * cos$1(quart), dx2p = dx2 * cos$1(quart) - dy2 * sin$1(quart), dy2p = dx2 * sin$1(quart) + dy2 * cos$1(quart), mx1 = (p1.x + p2.x) / 2, my1 = (p1.y + p2.y) / 2, mx2 = (p2.x + p3.x) / 2, my2 = (p2.y + p3.y) / 2, mx1n = mx1 + dx1p, my1n = my1 + dy1p, mx2n = mx2 + dx2p, my2n = my2 + dy2p, arc = utils.lli8(mx1, my1, mx1n, my1n, mx2, my2, mx2n, my2n), r2 = utils.dist(arc, p1);
|
|
16970
|
-
let
|
|
16971
|
-
return
|
|
16962
|
+
let s = atan2(p1.y - arc.y, p1.x - arc.x), m2 = atan2(p2.y - arc.y, p2.x - arc.x), e2 = atan2(p3.y - arc.y, p3.x - arc.x), _;
|
|
16963
|
+
return s < e2 ? ((s > m2 || m2 > e2) && (s += tau), s > e2 && (_ = e2, e2 = s, s = _)) : e2 < m2 && m2 < s ? (_ = e2, e2 = s, s = _) : e2 += tau, arc.s = s, arc.e = e2, arc.r = r2, arc;
|
|
16972
16964
|
},
|
|
16973
16965
|
numberSort: function(a, b) {
|
|
16974
16966
|
return a - b;
|
|
@@ -17005,10 +16997,10 @@ class PolyBezier {
|
|
|
17005
16997
|
utils.expandbox(bbox, c[i2].bbox());
|
|
17006
16998
|
return bbox;
|
|
17007
16999
|
}
|
|
17008
|
-
offset(
|
|
17000
|
+
offset(d) {
|
|
17009
17001
|
const offset2 = [];
|
|
17010
17002
|
return this.curves.forEach(function(v) {
|
|
17011
|
-
offset2.push(...v.offset(
|
|
17003
|
+
offset2.push(...v.offset(d));
|
|
17012
17004
|
}), new PolyBezier(offset2);
|
|
17013
17005
|
}
|
|
17014
17006
|
}
|
|
@@ -17020,8 +17012,8 @@ class Bezier {
|
|
|
17020
17012
|
coordlen = args.length;
|
|
17021
17013
|
const newargs = [];
|
|
17022
17014
|
args.forEach(function(point2) {
|
|
17023
|
-
["x", "y", "z"].forEach(function(
|
|
17024
|
-
typeof point2[
|
|
17015
|
+
["x", "y", "z"].forEach(function(d) {
|
|
17016
|
+
typeof point2[d] < "u" && newargs.push(point2[d]);
|
|
17025
17017
|
});
|
|
17026
17018
|
}), args = newargs;
|
|
17027
17019
|
}
|
|
@@ -17060,11 +17052,11 @@ class Bezier {
|
|
|
17060
17052
|
const abc = Bezier.getABC(2, p1, p2, p3, t2);
|
|
17061
17053
|
return new Bezier(p1, abc.A, p3);
|
|
17062
17054
|
}
|
|
17063
|
-
static cubicFromPoints(S,
|
|
17055
|
+
static cubicFromPoints(S, B, E, t2, d1) {
|
|
17064
17056
|
typeof t2 > "u" && (t2 = 0.5);
|
|
17065
|
-
const abc = Bezier.getABC(3, S,
|
|
17066
|
-
typeof d1 > "u" && (d1 = utils.dist(
|
|
17067
|
-
const d2 = d1 * (1 - t2) / t2, selen = utils.dist(S, E), lx = (E.x - S.x) / selen, ly = (E.y - S.y) / selen, bx1 = d1 * lx, by1 = d1 * ly, bx2 = d2 * lx, by2 = d2 * ly, e1 = { x:
|
|
17057
|
+
const abc = Bezier.getABC(3, S, B, E, t2);
|
|
17058
|
+
typeof d1 > "u" && (d1 = utils.dist(B, abc.C));
|
|
17059
|
+
const d2 = d1 * (1 - t2) / t2, selen = utils.dist(S, E), lx = (E.x - S.x) / selen, ly = (E.y - S.y) / selen, bx1 = d1 * lx, by1 = d1 * ly, bx2 = d2 * lx, by2 = d2 * ly, e1 = { x: B.x - bx1, y: B.y - by1 }, e2 = { x: B.x + bx2, y: B.y + by2 }, A = abc.A, v1 = { x: A.x + (e1.x - A.x) / (1 - t2), y: A.y + (e1.y - A.y) / (1 - t2) }, v2 = { x: A.x + (e2.x - A.x) / t2, y: A.y + (e2.y - A.y) / t2 }, nc1 = { x: S.x + (v1.x - S.x) / t2, y: S.y + (v1.y - S.y) / t2 }, nc2 = {
|
|
17068
17060
|
x: E.x + (v2.x - E.x) / (1 - t2),
|
|
17069
17061
|
y: E.y + (v2.y - E.y) / (1 - t2)
|
|
17070
17062
|
};
|
|
@@ -17087,10 +17079,10 @@ class Bezier {
|
|
|
17087
17079
|
}
|
|
17088
17080
|
toSVG() {
|
|
17089
17081
|
if (this._3d) return !1;
|
|
17090
|
-
const p = this.points, x = p[0].x,
|
|
17082
|
+
const p = this.points, x = p[0].x, y = p[0].y, s = ["M", x, y, this.order === 2 ? "Q" : "C"];
|
|
17091
17083
|
for (let i2 = 1, last = p.length; i2 < last; i2++)
|
|
17092
|
-
|
|
17093
|
-
return
|
|
17084
|
+
s.push(p[i2].x), s.push(p[i2].y);
|
|
17085
|
+
return s.join(" ");
|
|
17094
17086
|
}
|
|
17095
17087
|
setRatios(ratios) {
|
|
17096
17088
|
if (ratios.length !== this.points.length)
|
|
@@ -17116,20 +17108,20 @@ class Bezier {
|
|
|
17116
17108
|
length() {
|
|
17117
17109
|
return utils.length(this.derivative.bind(this));
|
|
17118
17110
|
}
|
|
17119
|
-
static getABC(order = 2, S,
|
|
17120
|
-
const
|
|
17121
|
-
x:
|
|
17122
|
-
y:
|
|
17123
|
-
},
|
|
17111
|
+
static getABC(order = 2, S, B, E, t2 = 0.5) {
|
|
17112
|
+
const u = utils.projectionratio(t2, order), um = 1 - u, C = {
|
|
17113
|
+
x: u * S.x + um * E.x,
|
|
17114
|
+
y: u * S.y + um * E.y
|
|
17115
|
+
}, s = utils.abcratio(t2, order);
|
|
17124
17116
|
return { A: {
|
|
17125
|
-
x:
|
|
17126
|
-
y:
|
|
17127
|
-
}, B
|
|
17117
|
+
x: B.x + (B.x - C.x) / s,
|
|
17118
|
+
y: B.y + (B.y - C.y) / s
|
|
17119
|
+
}, B, C, S, E };
|
|
17128
17120
|
}
|
|
17129
|
-
getABC(t2,
|
|
17130
|
-
|
|
17121
|
+
getABC(t2, B) {
|
|
17122
|
+
B = B || this.get(t2);
|
|
17131
17123
|
let S = this.points[0], E = this.points[this.order];
|
|
17132
|
-
return Bezier.getABC(this.order, S,
|
|
17124
|
+
return Bezier.getABC(this.order, S, B, E, t2);
|
|
17133
17125
|
}
|
|
17134
17126
|
getLUT(steps) {
|
|
17135
17127
|
if (this.verify(), steps = steps || 100, this._lut.length === steps + 1)
|
|
@@ -17147,11 +17139,11 @@ class Bezier {
|
|
|
17147
17139
|
return hits.length ? t /= hits.length : !1;
|
|
17148
17140
|
}
|
|
17149
17141
|
project(point) {
|
|
17150
|
-
const LUT = this.getLUT(),
|
|
17142
|
+
const LUT = this.getLUT(), l = LUT.length - 1, closest = utils.closest(LUT, point), mpos = closest.mpos, t1 = (mpos - 1) / l, t2 = (mpos + 1) / l, step = 0.1 / l;
|
|
17151
17143
|
let mdist = closest.mdist, t3 = t1, ft = t3, p;
|
|
17152
17144
|
mdist += 1;
|
|
17153
|
-
for (let
|
|
17154
|
-
p = this.compute(t3),
|
|
17145
|
+
for (let d; t3 < t2 + step; t3 += step)
|
|
17146
|
+
p = this.compute(t3), d = utils.dist(point, p), d < mdist && (mdist = d, ft = t3);
|
|
17155
17147
|
return ft = ft < 0 ? 0 : ft > 1 ? 1 : ft, p = this.compute(ft), p.t = ft, p.d = mdist, p;
|
|
17156
17148
|
}
|
|
17157
17149
|
get(t2) {
|
|
@@ -17192,8 +17184,8 @@ class Bezier {
|
|
|
17192
17184
|
return this._3d ? this.__normal3(t2) : this.__normal2(t2);
|
|
17193
17185
|
}
|
|
17194
17186
|
__normal2(t2) {
|
|
17195
|
-
const
|
|
17196
|
-
return { t: t2, x: -
|
|
17187
|
+
const d = this.derivative(t2), q = sqrt(d.x * d.x + d.y * d.y);
|
|
17188
|
+
return { t: t2, x: -d.y / q, y: d.x / q };
|
|
17197
17189
|
}
|
|
17198
17190
|
__normal3(t2) {
|
|
17199
17191
|
const r1 = this.derivative(t2), r2 = this.derivative(t2 + 0.01), q1 = sqrt(r1.x * r1.x + r1.y * r1.y + r1.z * r1.z), q2 = sqrt(r2.x * r2.x + r2.y * r2.y + r2.z * r2.z);
|
|
@@ -17226,7 +17218,7 @@ class Bezier {
|
|
|
17226
17218
|
let p = this.points, _p = [], q = [], idx = 0;
|
|
17227
17219
|
for (q[idx++] = p[0], q[idx++] = p[1], q[idx++] = p[2], this.order === 3 && (q[idx++] = p[3]); p.length > 1; ) {
|
|
17228
17220
|
_p = [];
|
|
17229
|
-
for (let i2 = 0, pt,
|
|
17221
|
+
for (let i2 = 0, pt, l = p.length - 1; i2 < l; i2++)
|
|
17230
17222
|
pt = utils.lerp(t2, p[i2], p[i2 + 1]), q[idx++] = pt, _p.push(pt);
|
|
17231
17223
|
p = _p;
|
|
17232
17224
|
}
|
|
@@ -17263,8 +17255,8 @@ class Bezier {
|
|
|
17263
17255
|
bbox() {
|
|
17264
17256
|
const extrema = this.extrema(), result = {};
|
|
17265
17257
|
return this.dims.forEach(
|
|
17266
|
-
function(
|
|
17267
|
-
result[
|
|
17258
|
+
function(d) {
|
|
17259
|
+
result[d] = utils.getminmax(this, d, extrema[d]);
|
|
17268
17260
|
}.bind(this)
|
|
17269
17261
|
), result;
|
|
17270
17262
|
}
|
|
@@ -17272,15 +17264,15 @@ class Bezier {
|
|
|
17272
17264
|
const lbbox = this.bbox(), tbbox = curve.bbox();
|
|
17273
17265
|
return utils.bboxoverlap(lbbox, tbbox);
|
|
17274
17266
|
}
|
|
17275
|
-
offset(t2,
|
|
17276
|
-
if (typeof
|
|
17267
|
+
offset(t2, d) {
|
|
17268
|
+
if (typeof d < "u") {
|
|
17277
17269
|
const c = this.get(t2), n2 = this.normal(t2), ret = {
|
|
17278
17270
|
c,
|
|
17279
17271
|
n: n2,
|
|
17280
|
-
x: c.x + n2.x *
|
|
17281
|
-
y: c.y + n2.y *
|
|
17272
|
+
x: c.x + n2.x * d,
|
|
17273
|
+
y: c.y + n2.y * d
|
|
17282
17274
|
};
|
|
17283
|
-
return this._3d && (ret.z = c.z + n2.z *
|
|
17275
|
+
return this._3d && (ret.z = c.z + n2.z * d), ret;
|
|
17284
17276
|
}
|
|
17285
17277
|
if (this._linear) {
|
|
17286
17278
|
const nv = this.normal(0), coords = this.points.map(function(p) {
|
|
@@ -17292,8 +17284,8 @@ class Bezier {
|
|
|
17292
17284
|
});
|
|
17293
17285
|
return [new Bezier(coords)];
|
|
17294
17286
|
}
|
|
17295
|
-
return this.reduce().map(function(
|
|
17296
|
-
return
|
|
17287
|
+
return this.reduce().map(function(s) {
|
|
17288
|
+
return s._linear ? s.offset(t2)[0] : s.scale(t2);
|
|
17297
17289
|
});
|
|
17298
17290
|
}
|
|
17299
17291
|
simple() {
|
|
@@ -17302,8 +17294,8 @@ class Bezier {
|
|
|
17302
17294
|
if (a1 > 0 && a2 < 0 || a1 < 0 && a2 > 0) return !1;
|
|
17303
17295
|
}
|
|
17304
17296
|
const n1 = this.normal(0), n2 = this.normal(1);
|
|
17305
|
-
let
|
|
17306
|
-
return this._3d && (
|
|
17297
|
+
let s = n1.x * n2.x + n1.y * n2.y;
|
|
17298
|
+
return this._3d && (s += n1.z * n2.z), abs(acos(s)) < pi / 3;
|
|
17307
17299
|
}
|
|
17308
17300
|
reduce() {
|
|
17309
17301
|
let i2, t1 = 0, t2 = 0, step = 0.01, segment, pass1 = [], pass2 = [], extrema = this.extrema().values;
|
|
@@ -17323,29 +17315,29 @@ class Bezier {
|
|
|
17323
17315
|
}
|
|
17324
17316
|
translate(v, d1, d2) {
|
|
17325
17317
|
d2 = typeof d2 == "number" ? d2 : d1;
|
|
17326
|
-
const
|
|
17327
|
-
let
|
|
17318
|
+
const o = this.order;
|
|
17319
|
+
let d = this.points.map((_, i2) => (1 - i2 / o) * d1 + i2 / o * d2);
|
|
17328
17320
|
return new Bezier(
|
|
17329
17321
|
this.points.map((p, i2) => ({
|
|
17330
|
-
x: p.x + v.x *
|
|
17331
|
-
y: p.y + v.y *
|
|
17322
|
+
x: p.x + v.x * d[i2],
|
|
17323
|
+
y: p.y + v.y * d[i2]
|
|
17332
17324
|
}))
|
|
17333
17325
|
);
|
|
17334
17326
|
}
|
|
17335
|
-
scale(
|
|
17327
|
+
scale(d) {
|
|
17336
17328
|
const order = this.order;
|
|
17337
17329
|
let distanceFn = !1;
|
|
17338
|
-
if (typeof
|
|
17330
|
+
if (typeof d == "function" && (distanceFn = d), distanceFn && order === 2)
|
|
17339
17331
|
return this.raise().scale(distanceFn);
|
|
17340
17332
|
const clockwise = this.clockwise, points = this.points;
|
|
17341
17333
|
if (this._linear)
|
|
17342
17334
|
return this.translate(
|
|
17343
17335
|
this.normal(0),
|
|
17344
|
-
distanceFn ? distanceFn(0) :
|
|
17345
|
-
distanceFn ? distanceFn(1) :
|
|
17336
|
+
distanceFn ? distanceFn(0) : d,
|
|
17337
|
+
distanceFn ? distanceFn(1) : d
|
|
17346
17338
|
);
|
|
17347
|
-
const r1 = distanceFn ? distanceFn(0) :
|
|
17348
|
-
if (!
|
|
17339
|
+
const r1 = distanceFn ? distanceFn(0) : d, r2 = distanceFn ? distanceFn(1) : d, v = [this.offset(0, 10), this.offset(1, 10)], np = [], o = utils.lli4(v[0], v[0].c, v[1], v[1].c);
|
|
17340
|
+
if (!o)
|
|
17349
17341
|
throw new Error("cannot scale this curve. Try reducing it first.");
|
|
17350
17342
|
return [0, 1].forEach(function(t2) {
|
|
17351
17343
|
const p = np[t2 * order] = utils.copy(points[t2 * order]);
|
|
@@ -17353,9 +17345,9 @@ class Bezier {
|
|
|
17353
17345
|
}), distanceFn ? ([0, 1].forEach(function(t2) {
|
|
17354
17346
|
if (!(order === 2 && t2)) {
|
|
17355
17347
|
var p = points[t2 + 1], ov = {
|
|
17356
|
-
x: p.x -
|
|
17357
|
-
y: p.y -
|
|
17358
|
-
}, rc = distanceFn ? distanceFn((t2 + 1) / order) :
|
|
17348
|
+
x: p.x - o.x,
|
|
17349
|
+
y: p.y - o.y
|
|
17350
|
+
}, rc = distanceFn ? distanceFn((t2 + 1) / order) : d;
|
|
17359
17351
|
distanceFn && !clockwise && (rc = -rc);
|
|
17360
17352
|
var m2 = sqrt(ov.x * ov.x + ov.y * ov.y);
|
|
17361
17353
|
ov.x /= m2, ov.y /= m2, np[t2 + 1] = {
|
|
@@ -17365,27 +17357,27 @@ class Bezier {
|
|
|
17365
17357
|
}
|
|
17366
17358
|
}), new Bezier(np)) : ([0, 1].forEach((t2) => {
|
|
17367
17359
|
if (order === 2 && t2) return;
|
|
17368
|
-
const p = np[t2 * order],
|
|
17369
|
-
np[t2 + 1] = utils.lli4(p, p2,
|
|
17360
|
+
const p = np[t2 * order], d2 = this.derivative(t2), p2 = { x: p.x + d2.x, y: p.y + d2.y };
|
|
17361
|
+
np[t2 + 1] = utils.lli4(p, p2, o, points[t2 + 1]);
|
|
17370
17362
|
}), new Bezier(np));
|
|
17371
17363
|
}
|
|
17372
17364
|
outline(d1, d2, d3, d4) {
|
|
17373
17365
|
if (d2 = d2 === void 0 ? d1 : d2, this._linear) {
|
|
17374
17366
|
const n2 = this.normal(0), start2 = this.points[0], end = this.points[this.points.length - 1];
|
|
17375
|
-
let
|
|
17376
|
-
d3 === void 0 && (d3 = d1, d4 = d2),
|
|
17377
|
-
const fline = [
|
|
17378
|
-
|
|
17379
|
-
const bline = [e2, mid,
|
|
17367
|
+
let s, mid, e2;
|
|
17368
|
+
d3 === void 0 && (d3 = d1, d4 = d2), s = { x: start2.x + n2.x * d1, y: start2.y + n2.y * d1 }, e2 = { x: end.x + n2.x * d3, y: end.y + n2.y * d3 }, mid = { x: (s.x + e2.x) / 2, y: (s.y + e2.y) / 2 };
|
|
17369
|
+
const fline = [s, mid, e2];
|
|
17370
|
+
s = { x: start2.x - n2.x * d2, y: start2.y - n2.y * d2 }, e2 = { x: end.x - n2.x * d4, y: end.y - n2.y * d4 }, mid = { x: (s.x + e2.x) / 2, y: (s.y + e2.y) / 2 };
|
|
17371
|
+
const bline = [e2, mid, s], ls2 = utils.makeline(bline[2], fline[0]), le2 = utils.makeline(fline[2], bline[0]), segments2 = [ls2, new Bezier(fline), le2, new Bezier(bline)];
|
|
17380
17372
|
return new PolyBezier(segments2);
|
|
17381
17373
|
}
|
|
17382
17374
|
const reduced = this.reduce(), len = reduced.length, fcurves = [];
|
|
17383
17375
|
let bcurves = [], p, alen = 0, tlen = this.length();
|
|
17384
17376
|
const graduated = typeof d3 < "u" && typeof d4 < "u";
|
|
17385
|
-
function linearDistanceFunction(
|
|
17377
|
+
function linearDistanceFunction(s, e2, tlen2, alen2, slen) {
|
|
17386
17378
|
return function(v) {
|
|
17387
|
-
const f1 = alen2 / tlen2, f2 = (alen2 + slen) / tlen2,
|
|
17388
|
-
return utils.map(v, 0, 1,
|
|
17379
|
+
const f1 = alen2 / tlen2, f2 = (alen2 + slen) / tlen2, d = e2 - s;
|
|
17380
|
+
return utils.map(v, 0, 1, s + f1 * d, s + f2 * d);
|
|
17389
17381
|
};
|
|
17390
17382
|
}
|
|
17391
17383
|
reduced.forEach(function(segment) {
|
|
@@ -17395,8 +17387,8 @@ class Bezier {
|
|
|
17395
17387
|
), bcurves.push(
|
|
17396
17388
|
segment.scale(linearDistanceFunction(-d2, -d4, tlen, alen, slen))
|
|
17397
17389
|
)) : (fcurves.push(segment.scale(d1)), bcurves.push(segment.scale(-d2))), alen += slen;
|
|
17398
|
-
}), bcurves = bcurves.map(function(
|
|
17399
|
-
return p =
|
|
17390
|
+
}), bcurves = bcurves.map(function(s) {
|
|
17391
|
+
return p = s.points, p[3] ? s.points = [p[3], p[2], p[1], p[0]] : s.points = [p[2], p[1], p[0]], s;
|
|
17400
17392
|
}).reverse();
|
|
17401
17393
|
const fs = fcurves[0].points[0], fe = fcurves[len - 1].points[fcurves[len - 1].points.length - 1], bs = bcurves[len - 1].points[bcurves[len - 1].points.length - 1], be = bcurves[0].points[0], ls = utils.makeline(bs, fs), le = utils.makeline(fe, be), segments = [ls].concat(fcurves).concat([le]).concat(bcurves);
|
|
17402
17394
|
return new PolyBezier(segments);
|
|
@@ -17436,9 +17428,9 @@ class Bezier {
|
|
|
17436
17428
|
}
|
|
17437
17429
|
curveintersects(c1, c2, curveIntersectionThreshold) {
|
|
17438
17430
|
const pairs = [];
|
|
17439
|
-
c1.forEach(function(
|
|
17431
|
+
c1.forEach(function(l) {
|
|
17440
17432
|
c2.forEach(function(r2) {
|
|
17441
|
-
|
|
17433
|
+
l.overlaps(r2) && pairs.push({ left: l, right: r2 });
|
|
17442
17434
|
});
|
|
17443
17435
|
});
|
|
17444
17436
|
let intersections = [];
|
|
@@ -17454,8 +17446,8 @@ class Bezier {
|
|
|
17454
17446
|
arcs(errorThreshold) {
|
|
17455
17447
|
return errorThreshold = errorThreshold || 0.5, this._iterate(errorThreshold, []);
|
|
17456
17448
|
}
|
|
17457
|
-
_error(pc, np1,
|
|
17458
|
-
const q = (e2 -
|
|
17449
|
+
_error(pc, np1, s, e2) {
|
|
17450
|
+
const q = (e2 - s) / 4, c1 = this.get(s + q), c2 = this.get(e2 - q), ref = utils.dist(pc, np1), d1 = utils.dist(pc, c1), d2 = utils.dist(pc, c2);
|
|
17459
17451
|
return abs(d1 - ref) + abs(d2 - ref);
|
|
17460
17452
|
}
|
|
17461
17453
|
_iterate(errorThreshold, circles) {
|
|
@@ -17470,11 +17462,11 @@ class Bezier {
|
|
|
17470
17462
|
}, curr_good = this._error(arc, np1, t_s, t_e) <= errorThreshold, done = prev_good && !curr_good, done || (prev_e = t_e), curr_good) {
|
|
17471
17463
|
if (t_e >= 1) {
|
|
17472
17464
|
if (arc.interval.end = prev_e = 1, prev_arc = arc, t_e > 1) {
|
|
17473
|
-
let
|
|
17465
|
+
let d = {
|
|
17474
17466
|
x: arc.x + arc.r * cos(arc.e),
|
|
17475
17467
|
y: arc.y + arc.r * sin(arc.e)
|
|
17476
17468
|
};
|
|
17477
|
-
arc.e += utils.angle({ x: arc.x, y: arc.y },
|
|
17469
|
+
arc.e += utils.angle({ x: arc.x, y: arc.y }, d, this.get(1));
|
|
17478
17470
|
}
|
|
17479
17471
|
break;
|
|
17480
17472
|
}
|
|
@@ -17495,13 +17487,13 @@ function bezierControlPoints(diagramEdge) {
|
|
|
17495
17487
|
const handles = [
|
|
17496
17488
|
// start
|
|
17497
17489
|
];
|
|
17498
|
-
for (;
|
|
17490
|
+
for (; t$6(bezierPoints, 3); ) {
|
|
17499
17491
|
const [cp1, cp2, end, ...rest] = bezierPoints, bezier = new Bezier(start2[0], start2[1], cp1[0], cp1[1], cp2[0], cp2[1], end[0], end[1]), inflections = bezier.inflections();
|
|
17500
17492
|
inflections.length === 0 && inflections.push(0.5), inflections.forEach((t2) => {
|
|
17501
|
-
const { x, y
|
|
17493
|
+
const { x, y } = bezier.get(t2);
|
|
17502
17494
|
handles.push({
|
|
17503
17495
|
x: Math.round(x),
|
|
17504
|
-
y: Math.round(
|
|
17496
|
+
y: Math.round(y)
|
|
17505
17497
|
});
|
|
17506
17498
|
}), bezierPoints = rest, start2 = end;
|
|
17507
17499
|
}
|
|
@@ -17509,7 +17501,7 @@ function bezierControlPoints(diagramEdge) {
|
|
|
17509
17501
|
}
|
|
17510
17502
|
const isClose = (a, b) => Math.abs(a - b) < 3.1;
|
|
17511
17503
|
function isSamePoint(a, b) {
|
|
17512
|
-
const [ax, ay] =
|
|
17504
|
+
const [ax, ay] = e$4(a) ? a : [a.x, a.y], [bx, by] = e$4(b) ? b : [b.x, b.y];
|
|
17513
17505
|
return isClose(ax, bx) && isClose(ay, by);
|
|
17514
17506
|
}
|
|
17515
17507
|
function stopPropagation(e2) {
|
|
@@ -17526,7 +17518,7 @@ function bezierPath(bezierSpline) {
|
|
|
17526
17518
|
let [start2, ...points] = bezierSpline;
|
|
17527
17519
|
invariant(start2, "start should be defined");
|
|
17528
17520
|
let path = `M ${start2[0]},${start2[1]}`;
|
|
17529
|
-
for (;
|
|
17521
|
+
for (; t$6(points, 3); ) {
|
|
17530
17522
|
const [cp1, cp2, end, ...rest] = points;
|
|
17531
17523
|
path = path + ` C ${cp1[0]},${cp1[1]} ${cp2[0]},${cp2[1]} ${end[0]},${end[1]}`, points = rest;
|
|
17532
17524
|
}
|
|
@@ -18414,19 +18406,19 @@ function getProperAncestors(stateNode, toStateNode) {
|
|
|
18414
18406
|
}
|
|
18415
18407
|
function getAllStateNodes(stateNodes) {
|
|
18416
18408
|
const nodeSet = new Set(stateNodes), adjList = getAdjList(nodeSet);
|
|
18417
|
-
for (const
|
|
18418
|
-
if (
|
|
18419
|
-
getInitialStateNodesWithTheirAncestors(
|
|
18420
|
-
else if (
|
|
18421
|
-
for (const child of getChildren(
|
|
18409
|
+
for (const s of nodeSet)
|
|
18410
|
+
if (s.type === "compound" && (!adjList.get(s) || !adjList.get(s).length))
|
|
18411
|
+
getInitialStateNodesWithTheirAncestors(s).forEach((sn) => nodeSet.add(sn));
|
|
18412
|
+
else if (s.type === "parallel") {
|
|
18413
|
+
for (const child of getChildren(s))
|
|
18422
18414
|
if (child.type !== "history" && !nodeSet.has(child)) {
|
|
18423
18415
|
const initialStates = getInitialStateNodesWithTheirAncestors(child);
|
|
18424
18416
|
for (const initialStateNode of initialStates)
|
|
18425
18417
|
nodeSet.add(initialStateNode);
|
|
18426
18418
|
}
|
|
18427
18419
|
}
|
|
18428
|
-
for (const
|
|
18429
|
-
let m2 =
|
|
18420
|
+
for (const s of nodeSet) {
|
|
18421
|
+
let m2 = s.parent;
|
|
18430
18422
|
for (; m2; )
|
|
18431
18423
|
nodeSet.add(m2), m2 = m2.parent;
|
|
18432
18424
|
}
|
|
@@ -18451,8 +18443,8 @@ function getValueFromAdj(baseNode, adjList) {
|
|
|
18451
18443
|
}
|
|
18452
18444
|
function getAdjList(stateNodes) {
|
|
18453
18445
|
const adjList = /* @__PURE__ */ new Map();
|
|
18454
|
-
for (const
|
|
18455
|
-
adjList.has(
|
|
18446
|
+
for (const s of stateNodes)
|
|
18447
|
+
adjList.has(s) || adjList.set(s, []), s.parent && (adjList.has(s.parent) || adjList.set(s.parent, []), adjList.get(s.parent).push(s));
|
|
18456
18448
|
return adjList;
|
|
18457
18449
|
}
|
|
18458
18450
|
function getStateValue(rootNode, stateNodes) {
|
|
@@ -18460,7 +18452,7 @@ function getStateValue(rootNode, stateNodes) {
|
|
|
18460
18452
|
return getValueFromAdj(rootNode, getAdjList(config));
|
|
18461
18453
|
}
|
|
18462
18454
|
function isInFinalState(stateNodeSet, stateNode) {
|
|
18463
|
-
return stateNode.type === "compound" ? getChildren(stateNode).some((
|
|
18455
|
+
return stateNode.type === "compound" ? getChildren(stateNode).some((s) => s.type === "final" && stateNodeSet.has(s)) : stateNode.type === "parallel" ? getChildren(stateNode).every((sn) => isInFinalState(stateNodeSet, sn)) : stateNode.type === "final";
|
|
18464
18456
|
}
|
|
18465
18457
|
const isStateId = (str) => str[0] === STATE_IDENTIFIER;
|
|
18466
18458
|
function getCandidates(stateNode, receivedEventType) {
|
|
@@ -18850,15 +18842,15 @@ function enterStates(currentSnapshot, event, actorScope, filteredTransitions, mu
|
|
|
18850
18842
|
function computeEntrySet(transitions2, historyValue, statesForDefaultEntry, statesToEnter) {
|
|
18851
18843
|
for (const t2 of transitions2) {
|
|
18852
18844
|
const domain = getTransitionDomain(t2, historyValue);
|
|
18853
|
-
for (const
|
|
18854
|
-
!isHistoryNode(
|
|
18855
|
-
(t2.source !==
|
|
18845
|
+
for (const s of t2.target || [])
|
|
18846
|
+
!isHistoryNode(s) && // if the target is different than the source then it will *definitely* be entered
|
|
18847
|
+
(t2.source !== s || // we know that the domain can't lie within the source
|
|
18856
18848
|
// if it's different than the source then it's outside of it and it means that the target has to be entered as well
|
|
18857
18849
|
t2.source !== domain || // reentering transitions always enter the target, even if it's the source itself
|
|
18858
|
-
t2.reenter) && (statesToEnter.add(
|
|
18850
|
+
t2.reenter) && (statesToEnter.add(s), statesForDefaultEntry.add(s)), addDescendantStatesToEnter(s, historyValue, statesForDefaultEntry, statesToEnter);
|
|
18859
18851
|
const targetStates = getEffectiveTargetStates(t2, historyValue);
|
|
18860
|
-
for (const
|
|
18861
|
-
const ancestors = getProperAncestors(
|
|
18852
|
+
for (const s of targetStates) {
|
|
18853
|
+
const ancestors = getProperAncestors(s, domain);
|
|
18862
18854
|
domain?.type === "parallel" && ancestors.push(domain), addAncestorStatesToEnter(statesToEnter, historyValue, statesForDefaultEntry, ancestors, !t2.source.parent && t2.reenter ? void 0 : domain);
|
|
18863
18855
|
}
|
|
18864
18856
|
}
|
|
@@ -18867,29 +18859,29 @@ function addDescendantStatesToEnter(stateNode, historyValue, statesForDefaultEnt
|
|
|
18867
18859
|
if (isHistoryNode(stateNode))
|
|
18868
18860
|
if (historyValue[stateNode.id]) {
|
|
18869
18861
|
const historyStateNodes = historyValue[stateNode.id];
|
|
18870
|
-
for (const
|
|
18871
|
-
statesToEnter.add(
|
|
18872
|
-
for (const
|
|
18873
|
-
addProperAncestorStatesToEnter(
|
|
18862
|
+
for (const s of historyStateNodes)
|
|
18863
|
+
statesToEnter.add(s), addDescendantStatesToEnter(s, historyValue, statesForDefaultEntry, statesToEnter);
|
|
18864
|
+
for (const s of historyStateNodes)
|
|
18865
|
+
addProperAncestorStatesToEnter(s, stateNode.parent, statesToEnter, historyValue, statesForDefaultEntry);
|
|
18874
18866
|
} else {
|
|
18875
18867
|
const historyDefaultTransition = resolveHistoryDefaultTransition(stateNode);
|
|
18876
|
-
for (const
|
|
18877
|
-
statesToEnter.add(
|
|
18878
|
-
for (const
|
|
18879
|
-
addProperAncestorStatesToEnter(
|
|
18868
|
+
for (const s of historyDefaultTransition.target)
|
|
18869
|
+
statesToEnter.add(s), historyDefaultTransition === stateNode.parent?.initial && statesForDefaultEntry.add(stateNode.parent), addDescendantStatesToEnter(s, historyValue, statesForDefaultEntry, statesToEnter);
|
|
18870
|
+
for (const s of historyDefaultTransition.target)
|
|
18871
|
+
addProperAncestorStatesToEnter(s, stateNode.parent, statesToEnter, historyValue, statesForDefaultEntry);
|
|
18880
18872
|
}
|
|
18881
18873
|
else if (stateNode.type === "compound") {
|
|
18882
18874
|
const [initialState] = stateNode.initial.target;
|
|
18883
18875
|
isHistoryNode(initialState) || (statesToEnter.add(initialState), statesForDefaultEntry.add(initialState)), addDescendantStatesToEnter(initialState, historyValue, statesForDefaultEntry, statesToEnter), addProperAncestorStatesToEnter(initialState, stateNode, statesToEnter, historyValue, statesForDefaultEntry);
|
|
18884
18876
|
} else if (stateNode.type === "parallel")
|
|
18885
18877
|
for (const child of getChildren(stateNode).filter((sn) => !isHistoryNode(sn)))
|
|
18886
|
-
[...statesToEnter].some((
|
|
18878
|
+
[...statesToEnter].some((s) => isDescendant(s, child)) || (isHistoryNode(child) || (statesToEnter.add(child), statesForDefaultEntry.add(child)), addDescendantStatesToEnter(child, historyValue, statesForDefaultEntry, statesToEnter));
|
|
18887
18879
|
}
|
|
18888
18880
|
function addAncestorStatesToEnter(statesToEnter, historyValue, statesForDefaultEntry, ancestors, reentrancyDomain) {
|
|
18889
18881
|
for (const anc of ancestors)
|
|
18890
18882
|
if ((!reentrancyDomain || isDescendant(anc, reentrancyDomain)) && statesToEnter.add(anc), anc.type === "parallel")
|
|
18891
18883
|
for (const child of getChildren(anc).filter((sn) => !isHistoryNode(sn)))
|
|
18892
|
-
[...statesToEnter].some((
|
|
18884
|
+
[...statesToEnter].some((s) => isDescendant(s, child)) || (statesToEnter.add(child), addDescendantStatesToEnter(child, historyValue, statesForDefaultEntry, statesToEnter));
|
|
18893
18885
|
}
|
|
18894
18886
|
function addProperAncestorStatesToEnter(stateNode, toStateNode, statesToEnter, historyValue, statesForDefaultEntry) {
|
|
18895
18887
|
addAncestorStatesToEnter(statesToEnter, historyValue, statesForDefaultEntry, getProperAncestors(stateNode, toStateNode));
|
|
@@ -18906,8 +18898,8 @@ function exitStates(currentSnapshot, event, actorScope, transitions2, mutStateNo
|
|
|
18906
18898
|
...historyValue
|
|
18907
18899
|
}, changedHistory[historyNode.id] = Array.from(mutStateNodeSet).filter(predicate);
|
|
18908
18900
|
}
|
|
18909
|
-
for (const
|
|
18910
|
-
nextSnapshot = resolveActionsAndContext(nextSnapshot, event, actorScope, [...
|
|
18901
|
+
for (const s of statesToExit)
|
|
18902
|
+
nextSnapshot = resolveActionsAndContext(nextSnapshot, event, actorScope, [...s.exit, ...s.invoke.map((def) => stopChild(def.id))], internalQueue, void 0), mutStateNodeSet.delete(s);
|
|
18911
18903
|
return [nextSnapshot, changedHistory || historyValue];
|
|
18912
18904
|
}
|
|
18913
18905
|
function getAction(machine, actionType) {
|
|
@@ -19034,9 +19026,9 @@ function selectTransitions(event, nextState) {
|
|
|
19034
19026
|
function selectEventlessTransitions(nextState, event) {
|
|
19035
19027
|
const enabledTransitionSet = /* @__PURE__ */ new Set(), atomicStates = nextState._nodes.filter(isAtomicStateNode);
|
|
19036
19028
|
for (const stateNode of atomicStates)
|
|
19037
|
-
loop: for (const
|
|
19038
|
-
if (
|
|
19039
|
-
for (const transition of
|
|
19029
|
+
loop: for (const s of [stateNode].concat(getProperAncestors(stateNode, void 0)))
|
|
19030
|
+
if (s.always) {
|
|
19031
|
+
for (const transition of s.always)
|
|
19040
19032
|
if (transition.guard === void 0 || evaluateGuard(transition.guard, nextState.context, event, nextState)) {
|
|
19041
19033
|
enabledTransitionSet.add(transition);
|
|
19042
19034
|
break loop;
|
|
@@ -19449,7 +19441,7 @@ function useDiagramActorSnapshot(selector2, compare = shallowEqual) {
|
|
|
19449
19441
|
return useSelector(actorRef, useCallbackRef(selector2), compare);
|
|
19450
19442
|
}
|
|
19451
19443
|
function useDiagramContext(selector2, compare = shallowEqual, deps) {
|
|
19452
|
-
const actorRef = useDiagramActorRef(), select2 = useCallback((
|
|
19444
|
+
const actorRef = useDiagramActorRef(), select2 = useCallback((s) => selector2(s.context), deps ?? []);
|
|
19453
19445
|
return useSelector(actorRef, select2, compare);
|
|
19454
19446
|
}
|
|
19455
19447
|
function useOnDiagramEvent(event, callback) {
|
|
@@ -19826,18 +19818,18 @@ function CompoundNodeContainer({
|
|
|
19826
19818
|
style: style2,
|
|
19827
19819
|
...rest
|
|
19828
19820
|
}) {
|
|
19829
|
-
let opacity =
|
|
19821
|
+
let opacity = t$9(data.style.opacity ?? 100, {
|
|
19830
19822
|
min: 0,
|
|
19831
19823
|
max: 100
|
|
19832
19824
|
});
|
|
19833
|
-
const isTransparent = opacity < 99, MIN_OPACITY = 65, borderOpacity = MIN_OPACITY +
|
|
19825
|
+
const isTransparent = opacity < 99, MIN_OPACITY = 65, borderOpacity = MIN_OPACITY + t$9((100 - MIN_OPACITY) * (opacity / 100), {
|
|
19834
19826
|
min: 0,
|
|
19835
19827
|
max: 100 - MIN_OPACITY
|
|
19836
19828
|
}), compoundClass = compoundNode({
|
|
19837
19829
|
isTransparent,
|
|
19838
19830
|
inverseColor: opacity < 60,
|
|
19839
19831
|
borderStyle: data.style.border ?? (isTransparent ? "dashed" : "none")
|
|
19840
|
-
}), depth =
|
|
19832
|
+
}), depth = t$9(data.depth ?? 1, {
|
|
19841
19833
|
min: 1,
|
|
19842
19834
|
max: 5
|
|
19843
19835
|
});
|
|
@@ -20507,9 +20499,9 @@ function ElementTitle({ id: id2, data, iconSize }) {
|
|
|
20507
20499
|
},
|
|
20508
20500
|
className: elementNodeIcon()
|
|
20509
20501
|
}), classes2 = elementNodeData({
|
|
20510
|
-
hasIcon:
|
|
20502
|
+
hasIcon: e(elementIcon),
|
|
20511
20503
|
hasDescription: !!data.description?.nonEmpty,
|
|
20512
|
-
hasTechnology: !
|
|
20504
|
+
hasTechnology: !e$3(data.technology ?? "")
|
|
20513
20505
|
}), size2 = nodeSizes(data.style).size, isSmOrXs = size2 === "sm" || size2 === "xs";
|
|
20514
20506
|
return /* @__PURE__ */ jsxs(
|
|
20515
20507
|
Box,
|
|
@@ -20518,7 +20510,7 @@ function ElementTitle({ id: id2, data, iconSize }) {
|
|
|
20518
20510
|
classes2.root,
|
|
20519
20511
|
"likec4-element"
|
|
20520
20512
|
),
|
|
20521
|
-
style: e(iconSize) ? {
|
|
20513
|
+
style: e$1(iconSize) ? {
|
|
20522
20514
|
// @ts-ignore
|
|
20523
20515
|
"--likec4-icon-size": `${iconSize}px`
|
|
20524
20516
|
} : void 0,
|
|
@@ -20597,7 +20589,7 @@ const style = {
|
|
|
20597
20589
|
}
|
|
20598
20590
|
}), buttons2;
|
|
20599
20591
|
}, [enableNavigateTo, enableRelationshipBrowser, diagram, modelFqn, navigateTo, props.id]);
|
|
20600
|
-
return extraButtons &&
|
|
20592
|
+
return extraButtons && t$6(extraButtons, 1) && (buttons = [...buttons, ...extraButtons]), /* @__PURE__ */ jsx(ElementActionButtons, { ...props, buttons });
|
|
20601
20593
|
}, DeploymentElementActions = ({
|
|
20602
20594
|
extraButtons,
|
|
20603
20595
|
...props
|
|
@@ -20619,7 +20611,7 @@ const style = {
|
|
|
20619
20611
|
}
|
|
20620
20612
|
}), buttons2;
|
|
20621
20613
|
}, [enableNavigateTo, enableRelationshipBrowser, diagram, modelFqn, navigateTo, props.id]);
|
|
20622
|
-
return extraButtons &&
|
|
20614
|
+
return extraButtons && t$6(extraButtons, 1) && (buttons = [...buttons, ...extraButtons]), /* @__PURE__ */ jsx(ElementActionButtons, { ...props, buttons });
|
|
20623
20615
|
}, {
|
|
20624
20616
|
primary,
|
|
20625
20617
|
secondary,
|
|
@@ -20629,7 +20621,7 @@ const style = {
|
|
|
20629
20621
|
{ key: "primary", value: primary.fill },
|
|
20630
20622
|
{ key: "secondary", value: secondary.fill },
|
|
20631
20623
|
{ key: "muted", value: muted.fill }
|
|
20632
|
-
], colors = t$
|
|
20624
|
+
], colors = t$2(otherColors).map((key) => ({
|
|
20633
20625
|
key,
|
|
20634
20626
|
value: defaultTheme.elements[key].fill
|
|
20635
20627
|
})), Tooltip = Tooltip$1.withProps({
|
|
@@ -20868,7 +20860,7 @@ const toolbarTitle = css({
|
|
|
20868
20860
|
textOverflow: "ellipsis",
|
|
20869
20861
|
overflow: "hidden",
|
|
20870
20862
|
whiteSpace: "nowrap"
|
|
20871
|
-
}), useSelectedNodesCount = () => useDiagramContext((
|
|
20863
|
+
}), useSelectedNodesCount = () => useDiagramContext((s) => s.xynodes.filter((x) => x.selected).length);
|
|
20872
20864
|
function Toolbar({ title, children: children2, nodeProps, ...props }) {
|
|
20873
20865
|
const selectedNodesCount = useSelectedNodesCount(), {
|
|
20874
20866
|
selected: selected2 = !1,
|
|
@@ -21236,34 +21228,11 @@ function useCurrentViewModel() {
|
|
|
21236
21228
|
throw new Error("No LikeC4ViewModel in context found");
|
|
21237
21229
|
return vm;
|
|
21238
21230
|
}
|
|
21239
|
-
const selectViewId = (
|
|
21231
|
+
const selectViewId = (s) => s.context.view.id;
|
|
21240
21232
|
function useCurrentViewId() {
|
|
21241
21233
|
const actorRef = useDiagramActorRef();
|
|
21242
21234
|
return useSelector(actorRef, selectViewId);
|
|
21243
21235
|
}
|
|
21244
|
-
const LikeC4ProjectsContext = createContext(null), emptyProjects = [];
|
|
21245
|
-
function useLikeC4Projects() {
|
|
21246
|
-
const ctx = useContext(LikeC4ProjectsContext);
|
|
21247
|
-
return ctx ? ctx.projects : emptyProjects;
|
|
21248
|
-
}
|
|
21249
|
-
const emptyOnProjectChange = () => {
|
|
21250
|
-
}, emptyContext = {
|
|
21251
|
-
projects: emptyProjects,
|
|
21252
|
-
onProjectChange: emptyOnProjectChange
|
|
21253
|
-
};
|
|
21254
|
-
function useLikeC4ProjectsContext() {
|
|
21255
|
-
return useContext(LikeC4ProjectsContext) ?? emptyContext;
|
|
21256
|
-
}
|
|
21257
|
-
function useHasProjects() {
|
|
21258
|
-
const ctx = useContext(LikeC4ProjectsContext);
|
|
21259
|
-
return ctx ? ctx.projects.length > 1 : !1;
|
|
21260
|
-
}
|
|
21261
|
-
function useLikeC4ProjectId() {
|
|
21262
|
-
const ctx = useContext(LikeC4ModelContext);
|
|
21263
|
-
if (!ctx)
|
|
21264
|
-
throw new Error("No LikeC4ModelContext found");
|
|
21265
|
-
return ctx.projectId;
|
|
21266
|
-
}
|
|
21267
21236
|
const backdropBlur = "--_blur", backdropOpacity = "--_opacity", level = "--_level", offset = "--_offset", inset = "--_inset", borderRadius = "--_border-radius", dialog = css.raw({
|
|
21268
21237
|
boxSizing: "border-box",
|
|
21269
21238
|
margin: "0",
|
|
@@ -21488,6 +21457,29 @@ const backdropBlur = "--_blur", backdropOpacity = "--_opacity", level = "--_leve
|
|
|
21488
21457
|
);
|
|
21489
21458
|
});
|
|
21490
21459
|
Overlay.displayName = "Overlay";
|
|
21460
|
+
const LikeC4ProjectsContext = createContext(null), emptyProjects = [];
|
|
21461
|
+
function useLikeC4Projects() {
|
|
21462
|
+
const ctx = useContext(LikeC4ProjectsContext);
|
|
21463
|
+
return ctx ? ctx.projects : emptyProjects;
|
|
21464
|
+
}
|
|
21465
|
+
const emptyOnProjectChange = () => {
|
|
21466
|
+
}, emptyContext = {
|
|
21467
|
+
projects: emptyProjects,
|
|
21468
|
+
onProjectChange: emptyOnProjectChange
|
|
21469
|
+
};
|
|
21470
|
+
function useLikeC4ProjectsContext() {
|
|
21471
|
+
return useContext(LikeC4ProjectsContext) ?? emptyContext;
|
|
21472
|
+
}
|
|
21473
|
+
function useHasProjects() {
|
|
21474
|
+
const ctx = useContext(LikeC4ProjectsContext);
|
|
21475
|
+
return ctx ? ctx.projects.length > 1 : !1;
|
|
21476
|
+
}
|
|
21477
|
+
function useLikeC4ProjectId() {
|
|
21478
|
+
const ctx = useContext(LikeC4ModelContext);
|
|
21479
|
+
if (!ctx)
|
|
21480
|
+
throw new Error("No LikeC4ModelContext found");
|
|
21481
|
+
return ctx.projectId;
|
|
21482
|
+
}
|
|
21491
21483
|
export {
|
|
21492
21484
|
FloatingDelayGroup as $,
|
|
21493
21485
|
createVarsResolver as A,
|
|
@@ -21559,10 +21551,10 @@ export {
|
|
|
21559
21551
|
findElementAncestor as aa,
|
|
21560
21552
|
useClickOutside as ab,
|
|
21561
21553
|
createReactComponent as ac,
|
|
21562
|
-
|
|
21563
|
-
|
|
21564
|
-
|
|
21565
|
-
|
|
21554
|
+
t$a as ad,
|
|
21555
|
+
t$7 as ae,
|
|
21556
|
+
t$8 as af,
|
|
21557
|
+
t$6 as ag,
|
|
21566
21558
|
number as ah,
|
|
21567
21559
|
alpha as ai,
|
|
21568
21560
|
clamp$1 as aj,
|
|
@@ -21648,11 +21640,11 @@ export {
|
|
|
21648
21640
|
getStateNodeByPath as by,
|
|
21649
21641
|
getPersistedSnapshot as bz,
|
|
21650
21642
|
useMantineStyleNonce as c,
|
|
21651
|
-
|
|
21643
|
+
ElementActionButtons as c$,
|
|
21652
21644
|
Box as c0,
|
|
21653
|
-
|
|
21645
|
+
e as c1,
|
|
21654
21646
|
EdgeLabelRenderer as c2,
|
|
21655
|
-
e as c3,
|
|
21647
|
+
e$1 as c3,
|
|
21656
21648
|
getNodeDimensions as c4,
|
|
21657
21649
|
useXYFlow as c5,
|
|
21658
21650
|
useDiagram as c6,
|
|
@@ -21676,16 +21668,16 @@ export {
|
|
|
21676
21668
|
MenuTarget as cO,
|
|
21677
21669
|
MenuDropdown as cP,
|
|
21678
21670
|
MenuItem as cQ,
|
|
21679
|
-
|
|
21680
|
-
|
|
21681
|
-
|
|
21682
|
-
|
|
21683
|
-
|
|
21684
|
-
|
|
21685
|
-
|
|
21686
|
-
|
|
21687
|
-
|
|
21688
|
-
|
|
21671
|
+
useOnDiagramEvent as cR,
|
|
21672
|
+
useLikeC4Model as cS,
|
|
21673
|
+
Divider as cT,
|
|
21674
|
+
e$4 as cU,
|
|
21675
|
+
useDiagramActorRef as cV,
|
|
21676
|
+
useCurrentViewModel as cW,
|
|
21677
|
+
useActorRef as cX,
|
|
21678
|
+
useUpdateEffect$1 as cY,
|
|
21679
|
+
Group as cZ,
|
|
21680
|
+
getBezierPath as c_,
|
|
21689
21681
|
bezierControlPoints as ca,
|
|
21690
21682
|
bezierPath as cb,
|
|
21691
21683
|
ViewGroupNode as cc,
|
|
@@ -21694,7 +21686,7 @@ export {
|
|
|
21694
21686
|
DeploymentNode as cf,
|
|
21695
21687
|
ElementNode as cg,
|
|
21696
21688
|
useDiagramActorSnapshot as ch,
|
|
21697
|
-
|
|
21689
|
+
e$3 as ci,
|
|
21698
21690
|
MotionButton as cj,
|
|
21699
21691
|
Tooltip$1 as ck,
|
|
21700
21692
|
useDiagramEventHandlers as cl,
|
|
@@ -21714,21 +21706,21 @@ export {
|
|
|
21714
21706
|
useCurrentViewId as cz,
|
|
21715
21707
|
alpha$1 as d,
|
|
21716
21708
|
getBoundsOfRects as d$,
|
|
21717
|
-
|
|
21718
|
-
|
|
21719
|
-
|
|
21720
|
-
|
|
21721
|
-
|
|
21722
|
-
|
|
21723
|
-
|
|
21724
|
-
|
|
21725
|
-
|
|
21726
|
-
|
|
21727
|
-
|
|
21728
|
-
|
|
21729
|
-
|
|
21730
|
-
|
|
21731
|
-
|
|
21709
|
+
IconTransform as d0,
|
|
21710
|
+
CompoundNodeContainer as d1,
|
|
21711
|
+
CompoundTitle as d2,
|
|
21712
|
+
CompoundDetailsButton as d3,
|
|
21713
|
+
ElementNodeContainer as d4,
|
|
21714
|
+
ElementShape as d5,
|
|
21715
|
+
ElementTitle as d6,
|
|
21716
|
+
ElementTags as d7,
|
|
21717
|
+
Handle as d8,
|
|
21718
|
+
Position as d9,
|
|
21719
|
+
e$2 as dA,
|
|
21720
|
+
VisuallyHidden as dB,
|
|
21721
|
+
IconOrShapeRenderer as dC,
|
|
21722
|
+
FocusTrap as dD,
|
|
21723
|
+
t$2 as dE,
|
|
21732
21724
|
findDiagramEdge as dF,
|
|
21733
21725
|
findDiagramNode as dG,
|
|
21734
21726
|
autoUpdate as dH,
|
|
@@ -21745,37 +21737,37 @@ export {
|
|
|
21745
21737
|
useTimeout as dS,
|
|
21746
21738
|
useCustomCompareMemo as dT,
|
|
21747
21739
|
useLikeC4Specification as dU,
|
|
21748
|
-
|
|
21740
|
+
t$3 as dV,
|
|
21749
21741
|
applyEdgeChanges as dW,
|
|
21750
21742
|
applyNodeChanges as dX,
|
|
21751
21743
|
getViewportForBounds as dY,
|
|
21752
21744
|
typedSystem as dZ,
|
|
21753
21745
|
centerXYInternalNode as d_,
|
|
21754
|
-
|
|
21755
|
-
|
|
21756
|
-
|
|
21757
|
-
|
|
21758
|
-
|
|
21759
|
-
|
|
21760
|
-
|
|
21761
|
-
|
|
21762
|
-
|
|
21763
|
-
|
|
21764
|
-
|
|
21765
|
-
|
|
21766
|
-
|
|
21767
|
-
|
|
21768
|
-
|
|
21769
|
-
|
|
21770
|
-
|
|
21771
|
-
|
|
21772
|
-
|
|
21773
|
-
|
|
21774
|
-
|
|
21775
|
-
|
|
21776
|
-
|
|
21777
|
-
|
|
21778
|
-
|
|
21746
|
+
ElementDetailsButton as da,
|
|
21747
|
+
getDefaultExportFromCjs as db,
|
|
21748
|
+
t$1 as dc,
|
|
21749
|
+
IconSelector as dd,
|
|
21750
|
+
SegmentedControl as de,
|
|
21751
|
+
ReactFlowProvider as df,
|
|
21752
|
+
useStoreApi as dg,
|
|
21753
|
+
useReactFlow as dh,
|
|
21754
|
+
Panel as di,
|
|
21755
|
+
m as dj,
|
|
21756
|
+
Stack as dk,
|
|
21757
|
+
t$9 as dl,
|
|
21758
|
+
useSyncedRef as dm,
|
|
21759
|
+
IconRenderer as dn,
|
|
21760
|
+
useTimeoutEffect as dp,
|
|
21761
|
+
ReactRemoveScroll as dq,
|
|
21762
|
+
ActionIconGroup as dr,
|
|
21763
|
+
IfEnabled as ds,
|
|
21764
|
+
DiagramFeatures as dt,
|
|
21765
|
+
t$5 as du,
|
|
21766
|
+
customNode as dv,
|
|
21767
|
+
useXYStore as dw,
|
|
21768
|
+
useReducedMotionConfig as dx,
|
|
21769
|
+
Overlay as dy,
|
|
21770
|
+
sva as dz,
|
|
21779
21771
|
em as e,
|
|
21780
21772
|
boxToRect as e0,
|
|
21781
21773
|
and as e1,
|