mudlet-map-renderer 1.2.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MapState.d.ts +6 -1
- package/dist/ScenePipeline.d.ts +1 -1
- package/dist/SvgTypes.d.ts +1 -1
- package/dist/camera/Camera.d.ts +1 -1
- package/dist/draw/DrawCommand.d.ts +4 -4
- package/dist/export/CanvasExporter.d.ts +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.mjs +887 -637
- package/dist/index.mjs.map +1 -1
- package/dist/render/RecordingLayer.d.ts +4 -3
- package/dist/render/canvasGradient.d.ts +2 -0
- package/dist/rendering/KonvaRenderBackend.d.ts +9 -7
- package/dist/rendering/MapRenderer.d.ts +6 -1
- package/dist/scene/OverlayStyle.d.ts +7 -3
- package/dist/scene/Shape.d.ts +56 -2
- package/dist/scene/elements/OverlayLayout.d.ts +3 -0
- package/dist/style/index.d.ts +8 -1
- package/dist/style/shape/GradientRoomsStyle.d.ts +23 -0
- package/dist/style/shape/index.d.ts +2 -0
- package/dist/style/shape/paintMap.d.ts +6 -6
- package/dist/types/Settings.d.ts +11 -3
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -43,7 +43,8 @@ function g() {
|
|
|
43
43
|
sizeFactor: 1.425,
|
|
44
44
|
dash: [.05, .05],
|
|
45
45
|
dashEnabled: !0,
|
|
46
|
-
matchRoomShape: !0
|
|
46
|
+
matchRoomShape: !0,
|
|
47
|
+
shape: "match"
|
|
47
48
|
},
|
|
48
49
|
gridEnabled: !1,
|
|
49
50
|
gridSize: 1,
|
|
@@ -318,18 +319,23 @@ var T = class {
|
|
|
318
319
|
}
|
|
319
320
|
addHighlight(e, t) {
|
|
320
321
|
let n = this.mapReader.getRoom(e);
|
|
321
|
-
|
|
322
|
-
|
|
322
|
+
if (!n) return !1;
|
|
323
|
+
let r = Array.isArray(t) ? t.length > 0 ? [...t] : ["#ffffff"] : [t];
|
|
324
|
+
return this.highlights.set(e, {
|
|
325
|
+
colors: r,
|
|
326
|
+
color: r[0],
|
|
323
327
|
area: n.area,
|
|
324
328
|
z: n.z
|
|
325
329
|
}), this.events.emit("highlight", {
|
|
326
330
|
roomId: e,
|
|
327
|
-
|
|
328
|
-
|
|
331
|
+
colors: r,
|
|
332
|
+
color: r[0]
|
|
333
|
+
}), !0;
|
|
329
334
|
}
|
|
330
335
|
removeHighlight(e) {
|
|
331
336
|
this.highlights.has(e) && (this.highlights.delete(e), this.events.emit("highlight", {
|
|
332
337
|
roomId: e,
|
|
338
|
+
colors: void 0,
|
|
333
339
|
color: void 0
|
|
334
340
|
}));
|
|
335
341
|
}
|
|
@@ -357,7 +363,7 @@ var T = class {
|
|
|
357
363
|
let n = [...e?.highlights ?? []];
|
|
358
364
|
for (let [e, t] of this.highlights) t.area === this.currentArea && t.z === this.currentZIndex && n.push({
|
|
359
365
|
roomId: e,
|
|
360
|
-
color: t.
|
|
366
|
+
color: t.colors
|
|
361
367
|
});
|
|
362
368
|
n.length > 0 && (t.highlights = n);
|
|
363
369
|
let r = [...e?.paths ?? []];
|
|
@@ -654,7 +660,7 @@ var D = class e extends S {
|
|
|
654
660
|
x: -1,
|
|
655
661
|
y: 1
|
|
656
662
|
}
|
|
657
|
-
},
|
|
663
|
+
}, te = [
|
|
658
664
|
"north",
|
|
659
665
|
"south",
|
|
660
666
|
"east",
|
|
@@ -663,7 +669,7 @@ var D = class e extends S {
|
|
|
663
669
|
"northwest",
|
|
664
670
|
"southeast",
|
|
665
671
|
"southwest"
|
|
666
|
-
],
|
|
672
|
+
], N = {
|
|
667
673
|
north: "south",
|
|
668
674
|
south: "north",
|
|
669
675
|
east: "west",
|
|
@@ -673,11 +679,11 @@ var D = class e extends S {
|
|
|
673
679
|
southeast: "northwest",
|
|
674
680
|
southwest: "northeast"
|
|
675
681
|
};
|
|
676
|
-
function
|
|
682
|
+
function P(e) {
|
|
677
683
|
return e ? Object.prototype.hasOwnProperty.call(M, e) : !1;
|
|
678
684
|
}
|
|
679
|
-
function
|
|
680
|
-
if (!
|
|
685
|
+
function F(e, t, n, r = 1) {
|
|
686
|
+
if (!P(n)) return {
|
|
681
687
|
x: e,
|
|
682
688
|
y: t
|
|
683
689
|
};
|
|
@@ -687,21 +693,21 @@ function I(e, t, n, r = 1) {
|
|
|
687
693
|
y: t + i.y * r
|
|
688
694
|
};
|
|
689
695
|
}
|
|
690
|
-
function
|
|
691
|
-
if (!
|
|
696
|
+
function ne(e, t, n, r = 1, i = 0) {
|
|
697
|
+
if (!P(n)) return {
|
|
692
698
|
x: e,
|
|
693
699
|
y: t
|
|
694
700
|
};
|
|
695
701
|
let a = M[n];
|
|
696
|
-
if (!(a.x !== 0 && a.y !== 0) || i <= 0) return
|
|
702
|
+
if (!(a.x !== 0 && a.y !== 0) || i <= 0) return F(e, t, n, r);
|
|
697
703
|
let o = r - i + i / Math.SQRT2;
|
|
698
704
|
return {
|
|
699
705
|
x: e + a.x * o,
|
|
700
706
|
y: t + a.y * o
|
|
701
707
|
};
|
|
702
708
|
}
|
|
703
|
-
function
|
|
704
|
-
if (!
|
|
709
|
+
function re(e, t, n, r = 1) {
|
|
710
|
+
if (!P(n)) return {
|
|
705
711
|
x: e,
|
|
706
712
|
y: t
|
|
707
713
|
};
|
|
@@ -713,26 +719,26 @@ function te(e, t, n, r = 1) {
|
|
|
713
719
|
}
|
|
714
720
|
//#endregion
|
|
715
721
|
//#region src/ExitRenderer.ts
|
|
716
|
-
var
|
|
722
|
+
var ie = {
|
|
717
723
|
OPEN_DOOR: "rgb(10, 155, 10)",
|
|
718
724
|
CLOSED_DOOR: "rgb(226, 205, 59)",
|
|
719
725
|
LOCKED_DOOR: "rgb(155, 10, 10)",
|
|
720
726
|
ONE_WAY_FILL: "rgb(155, 10, 10)"
|
|
721
727
|
};
|
|
722
|
-
function
|
|
728
|
+
function ae(e) {
|
|
723
729
|
switch (e) {
|
|
724
|
-
case 1: return
|
|
725
|
-
case 2: return
|
|
726
|
-
default: return
|
|
730
|
+
case 1: return ie.OPEN_DOOR;
|
|
731
|
+
case 2: return ie.CLOSED_DOOR;
|
|
732
|
+
default: return ie.LOCKED_DOOR;
|
|
727
733
|
}
|
|
728
734
|
}
|
|
729
|
-
var
|
|
735
|
+
var oe = class {
|
|
730
736
|
constructor(e, t) {
|
|
731
737
|
this.mapReader = e, this.settings = t;
|
|
732
738
|
}
|
|
733
739
|
getRoomEdgePoint(e, t, n, r) {
|
|
734
740
|
let i = r - (this.settings.borders ? this.settings.lineWidth / 2 : 0);
|
|
735
|
-
return this.settings.roomShape === "circle" ?
|
|
741
|
+
return this.settings.roomShape === "circle" ? re(e, t, n, i) : this.settings.roomShape === "roundedRectangle" ? ne(e, t, n, i, this.settings.roomSize * .2) : F(e, t, n, i);
|
|
736
742
|
}
|
|
737
743
|
renderData(e, t) {
|
|
738
744
|
return this.renderDataWithColor(e, this.settings.lineColor, t);
|
|
@@ -765,7 +771,7 @@ var ie = class {
|
|
|
765
771
|
y: t - this.settings.roomSize / 4,
|
|
766
772
|
width: this.settings.roomSize / 2,
|
|
767
773
|
height: this.settings.roomSize / 2,
|
|
768
|
-
stroke:
|
|
774
|
+
stroke: ae(u),
|
|
769
775
|
strokeWidth: this.settings.lineWidth
|
|
770
776
|
});
|
|
771
777
|
}
|
|
@@ -798,7 +804,7 @@ var ie = class {
|
|
|
798
804
|
let r = n === "a" || !n && e.aDir, i = r ? this.mapReader.getRoom(e.a) : this.mapReader.getRoom(e.b), a = r ? this.mapReader.getRoom(e.b) : this.mapReader.getRoom(e.a), o = r ? e.aDir : e.bDir;
|
|
799
805
|
if (!o || !i || !a || !k.includes(o) || i.customLines[j[o] || o]) return;
|
|
800
806
|
if (i.area != a.area && o) {
|
|
801
|
-
let e = this.mapReader.getColorValue(a.env), t = this.getRoomEdgePoint(i.x, i.y, o, this.settings.roomSize / 2), n =
|
|
807
|
+
let e = this.mapReader.getColorValue(a.env), t = this.getRoomEdgePoint(i.x, i.y, o, this.settings.roomSize / 2), n = F(i.x, i.y, o, this.settings.roomSize * 1.5), r = e;
|
|
802
808
|
return {
|
|
803
809
|
lines: [],
|
|
804
810
|
arrows: [{
|
|
@@ -837,8 +843,8 @@ var ie = class {
|
|
|
837
843
|
x: a.x,
|
|
838
844
|
y: a.y
|
|
839
845
|
};
|
|
840
|
-
s && (c =
|
|
841
|
-
let l =
|
|
846
|
+
s && (c = F(i.x, i.y, o, this.settings.roomSize / 2));
|
|
847
|
+
let l = F(i.x, i.y, o, .3), u = l.x - (l.x - c.x) / 2, d = l.y - (l.y - c.y) / 2, f = this.getRoomEdgePoint(i.x, i.y, o, this.settings.roomSize / 2), p = [
|
|
842
848
|
f.x,
|
|
843
849
|
f.y,
|
|
844
850
|
c.x,
|
|
@@ -870,7 +876,7 @@ var ie = class {
|
|
|
870
876
|
pointerWidth: .35,
|
|
871
877
|
strokeWidth: this.settings.lineWidth * 1.4,
|
|
872
878
|
stroke: t,
|
|
873
|
-
fill:
|
|
879
|
+
fill: ie.ONE_WAY_FILL,
|
|
874
880
|
dash: [.1, .05]
|
|
875
881
|
}],
|
|
876
882
|
doors: [],
|
|
@@ -957,7 +963,7 @@ var ie = class {
|
|
|
957
963
|
}
|
|
958
964
|
return t;
|
|
959
965
|
}
|
|
960
|
-
},
|
|
966
|
+
}, se = {
|
|
961
967
|
1: "north",
|
|
962
968
|
2: "northeast",
|
|
963
969
|
3: "northwest",
|
|
@@ -971,15 +977,15 @@ var ie = class {
|
|
|
971
977
|
11: "in",
|
|
972
978
|
12: "out"
|
|
973
979
|
};
|
|
974
|
-
function
|
|
975
|
-
return e.roomShape === "circle" ?
|
|
980
|
+
function ce(e, t, n, r, i) {
|
|
981
|
+
return e.roomShape === "circle" ? re(t, n, r, i) : e.roomShape === "roundedRectangle" ? ne(t, n, r, i, e.roomSize * .2) : F(t, n, r, i);
|
|
976
982
|
}
|
|
977
|
-
function
|
|
983
|
+
function le(e, t, n) {
|
|
978
984
|
let r = [];
|
|
979
985
|
for (let i of e.stubs) {
|
|
980
|
-
let a =
|
|
986
|
+
let a = se[i];
|
|
981
987
|
if (!a) continue;
|
|
982
|
-
let o =
|
|
988
|
+
let o = ce(t, e.x, e.y, a, t.roomSize / 2), s = F(e.x, e.y, a, t.roomSize / 2 + .5);
|
|
983
989
|
r.push({
|
|
984
990
|
roomId: e.id,
|
|
985
991
|
direction: a,
|
|
@@ -995,12 +1001,12 @@ function se(e, t, n) {
|
|
|
995
1001
|
}
|
|
996
1002
|
//#endregion
|
|
997
1003
|
//#region src/scene/SpecialExitStyle.ts
|
|
998
|
-
var
|
|
1004
|
+
var ue = {
|
|
999
1005
|
1: "rgb(10, 155, 10)",
|
|
1000
1006
|
2: "rgb(226, 205, 59)",
|
|
1001
1007
|
3: "rgb(155, 10, 10)"
|
|
1002
1008
|
};
|
|
1003
|
-
function
|
|
1009
|
+
function de(e, t, n) {
|
|
1004
1010
|
let r = [];
|
|
1005
1011
|
for (let [i, a] of Object.entries(e.customLines)) {
|
|
1006
1012
|
let o = [e.x, e.y];
|
|
@@ -1047,7 +1053,7 @@ function le(e, t, n) {
|
|
|
1047
1053
|
y: n - r / 2,
|
|
1048
1054
|
width: r,
|
|
1049
1055
|
height: r,
|
|
1050
|
-
stroke:
|
|
1056
|
+
stroke: ue[f] ?? ue[3],
|
|
1051
1057
|
strokeWidth: t.lineWidth
|
|
1052
1058
|
};
|
|
1053
1059
|
}
|
|
@@ -1062,33 +1068,33 @@ function le(e, t, n) {
|
|
|
1062
1068
|
}
|
|
1063
1069
|
//#endregion
|
|
1064
1070
|
//#region src/utils/textMeasure.ts
|
|
1065
|
-
var
|
|
1066
|
-
function
|
|
1067
|
-
return
|
|
1071
|
+
var fe = 72, I = 200, pe = 120, me = /* @__PURE__ */ new Map(), L = null;
|
|
1072
|
+
function he() {
|
|
1073
|
+
return L || (L = r.Util.createCanvasElement(), L.width = I, L.height = I), L;
|
|
1068
1074
|
}
|
|
1069
|
-
function
|
|
1070
|
-
let n = `${e}::${t}`, r =
|
|
1075
|
+
function ge(e, t) {
|
|
1076
|
+
let n = `${e}::${t}`, r = me.get(n);
|
|
1071
1077
|
if (r !== void 0) return r;
|
|
1072
|
-
let i =
|
|
1073
|
-
i.clearRect(0, 0,
|
|
1074
|
-
let { data: o } = i.getImageData(0, 0,
|
|
1075
|
-
for (let e = 0; e <
|
|
1078
|
+
let i = he().getContext("2d", { willReadFrequently: !0 }), a = `bold ${fe}px ${t}`;
|
|
1079
|
+
i.clearRect(0, 0, I, I), i.font = a, i.textBaseline = "alphabetic", i.textAlign = "center", i.fillStyle = "#ffffff", i.fillText(e, I / 2, pe);
|
|
1080
|
+
let { data: o } = i.getImageData(0, 0, I, I), s = I, c = -1;
|
|
1081
|
+
for (let e = 0; e < I; e++) for (let t = 0; t < I; t++) o[(e * I + t) * 4 + 3] > 16 && (e < s && (s = e), e > c && (c = e));
|
|
1076
1082
|
if (c === -1) {
|
|
1077
1083
|
let e = {
|
|
1078
1084
|
baselineRatio: .35,
|
|
1079
1085
|
konvaCorrectionRatio: 0
|
|
1080
1086
|
};
|
|
1081
|
-
return
|
|
1087
|
+
return me.set(n, e), e;
|
|
1082
1088
|
}
|
|
1083
|
-
let l = (
|
|
1089
|
+
let l = (pe - s - Math.max(0, c - pe)) / 2 / fe, u = i.measureText("M"), d = {
|
|
1084
1090
|
baselineRatio: l,
|
|
1085
|
-
konvaCorrectionRatio: ((u.fontBoundingBoxAscent ?? u.actualBoundingBoxAscent ?? 0) - (u.fontBoundingBoxDescent ?? u.actualBoundingBoxDescent ?? 0)) / 2 /
|
|
1091
|
+
konvaCorrectionRatio: ((u.fontBoundingBoxAscent ?? u.actualBoundingBoxAscent ?? 0) - (u.fontBoundingBoxDescent ?? u.actualBoundingBoxDescent ?? 0)) / 2 / fe - l
|
|
1086
1092
|
};
|
|
1087
|
-
return
|
|
1093
|
+
return me.set(n, d), d;
|
|
1088
1094
|
}
|
|
1089
1095
|
//#endregion
|
|
1090
1096
|
//#region src/scene/RoomStyle.ts
|
|
1091
|
-
function
|
|
1097
|
+
function _e(e, t, n, r) {
|
|
1092
1098
|
let i = t.getColorValue(e.env), a = n.coloredMode ? v(i, .5) : n.frameMode ? n.backgroundColor : i, o = n.coloredMode ? y(i, .1) : i;
|
|
1093
1099
|
return {
|
|
1094
1100
|
fillColor: a,
|
|
@@ -1098,7 +1104,7 @@ function he(e, t, n, r) {
|
|
|
1098
1104
|
envColor: i
|
|
1099
1105
|
};
|
|
1100
1106
|
}
|
|
1101
|
-
function
|
|
1107
|
+
function ve(e, t) {
|
|
1102
1108
|
if (!t.emboss) return null;
|
|
1103
1109
|
let n = t.roomSize, r = t.borders ? t.lineWidth / 2 : 0, i = t.lineWidth, a = y(e, .35), o = v(e, .45);
|
|
1104
1110
|
if (t.roomShape === "circle") {
|
|
@@ -1202,8 +1208,8 @@ function ge(e, t) {
|
|
|
1202
1208
|
}
|
|
1203
1209
|
//#endregion
|
|
1204
1210
|
//#region src/scene/elements/RoomLayout.ts
|
|
1205
|
-
function
|
|
1206
|
-
let { fillColor: i, strokeColor: a, borderWidth: o, symbolColor: s } =
|
|
1211
|
+
function ye(e, t, n, r) {
|
|
1212
|
+
let { fillColor: i, strokeColor: a, borderWidth: o, symbolColor: s } = _e(e, t, n, r.strokeOverride), c = n.roomSize, l = [], u = ve(i, n), d = u ? 0 : o, f = n.coloredMode && d > 0 && r.flatPipeline, p = (e) => n.roomShape === "roundedRectangle" ? Math.max(0, (c - 2 * e) * .2) : 0;
|
|
1207
1213
|
if (f) {
|
|
1208
1214
|
let e = [v(a, .5), a], t = o * 2;
|
|
1209
1215
|
n.roomShape === "circle" ? l.push({
|
|
@@ -1287,7 +1293,7 @@ function _e(e, t, n, r) {
|
|
|
1287
1293
|
lineCap: u.highlight.lineCap,
|
|
1288
1294
|
lineJoin: u.shadow.lineJoin
|
|
1289
1295
|
})), e.roomChar) {
|
|
1290
|
-
let t = c * .75, { baselineRatio: r, konvaCorrectionRatio: i } =
|
|
1296
|
+
let t = c * .75, { baselineRatio: r, konvaCorrectionRatio: i } = ge(e.roomChar, n.fontFamily), a = Math.max(c, e.roomChar.length * t * .8), o = (a - c) / 2;
|
|
1291
1297
|
l.push({
|
|
1292
1298
|
type: "text",
|
|
1293
1299
|
x: -o,
|
|
@@ -1320,13 +1326,13 @@ function _e(e, t, n, r) {
|
|
|
1320
1326
|
}
|
|
1321
1327
|
//#endregion
|
|
1322
1328
|
//#region src/scene/InnerExitStyle.ts
|
|
1323
|
-
var
|
|
1329
|
+
var be = [
|
|
1324
1330
|
"up",
|
|
1325
1331
|
"down",
|
|
1326
1332
|
"in",
|
|
1327
1333
|
"out"
|
|
1328
1334
|
];
|
|
1329
|
-
function
|
|
1335
|
+
function xe(e, t, n, r) {
|
|
1330
1336
|
let i = r * Math.PI / 180, a = [];
|
|
1331
1337
|
for (let r = 0; r < 3; r++) {
|
|
1332
1338
|
let o = 2 * Math.PI * r / 3 - Math.PI / 2, s = Math.cos(o) * n * 1.4, c = Math.sin(o) * n * .8, l = s * Math.cos(i) - c * Math.sin(i), u = s * Math.sin(i) + c * Math.cos(i);
|
|
@@ -1334,50 +1340,50 @@ function ye(e, t, n, r) {
|
|
|
1334
1340
|
}
|
|
1335
1341
|
return a;
|
|
1336
1342
|
}
|
|
1337
|
-
function
|
|
1343
|
+
function Se(e, t, n) {
|
|
1338
1344
|
let r = e.userData?.["system.fallback_symbol_color"];
|
|
1339
1345
|
return {
|
|
1340
1346
|
symbolColor: r ?? (n.frameMode || n.coloredMode ? t.getColorValue(e.env) : t.getSymbolColor(e.env)),
|
|
1341
1347
|
symbolFill: r ?? (n.frameMode || n.coloredMode ? t.getColorValue(e.env) : t.getSymbolColor(e.env, .6))
|
|
1342
1348
|
};
|
|
1343
1349
|
}
|
|
1344
|
-
var
|
|
1350
|
+
var Ce = {
|
|
1345
1351
|
1: "rgb(10, 155, 10)",
|
|
1346
1352
|
2: "rgb(226, 205, 59)",
|
|
1347
1353
|
3: "rgb(155, 10, 10)"
|
|
1348
1354
|
};
|
|
1349
|
-
function
|
|
1355
|
+
function we(e, t, n) {
|
|
1350
1356
|
let r = n.roomSize, i = r / 5, a = (e, t, n) => ({
|
|
1351
1357
|
cx: e,
|
|
1352
1358
|
cy: t,
|
|
1353
|
-
vertices:
|
|
1359
|
+
vertices: xe(e, t, i, n)
|
|
1354
1360
|
});
|
|
1355
1361
|
switch (t) {
|
|
1356
1362
|
case "up": {
|
|
1357
|
-
let t =
|
|
1363
|
+
let t = F(e.x, e.y, "south", r / 4);
|
|
1358
1364
|
return [a(t.x, t.y, 0)];
|
|
1359
1365
|
}
|
|
1360
1366
|
case "down": {
|
|
1361
|
-
let t =
|
|
1367
|
+
let t = F(e.x, e.y, "north", r / 4);
|
|
1362
1368
|
return [a(t.x, t.y, 180)];
|
|
1363
1369
|
}
|
|
1364
1370
|
case "in": {
|
|
1365
|
-
let t =
|
|
1371
|
+
let t = F(e.x, e.y, "west", r / 4), n = F(e.x, e.y, "east", r / 4);
|
|
1366
1372
|
return [a(t.x, t.y, 90), a(n.x, n.y, -90)];
|
|
1367
1373
|
}
|
|
1368
1374
|
case "out": {
|
|
1369
|
-
let t =
|
|
1375
|
+
let t = F(e.x, e.y, "west", r / 4), n = F(e.x, e.y, "east", r / 4);
|
|
1370
1376
|
return [a(t.x, t.y, -90), a(n.x, n.y, 90)];
|
|
1371
1377
|
}
|
|
1372
1378
|
default: return [];
|
|
1373
1379
|
}
|
|
1374
1380
|
}
|
|
1375
|
-
function
|
|
1376
|
-
let r = [], { symbolColor: i, symbolFill: a } =
|
|
1377
|
-
for (let t of
|
|
1381
|
+
function Te(e, t, n) {
|
|
1382
|
+
let r = [], { symbolColor: i, symbolFill: a } = Se(e, t, n);
|
|
1383
|
+
for (let t of be) {
|
|
1378
1384
|
if (!e.exits[t]) continue;
|
|
1379
|
-
let o = e.doors[t], s = o === void 0 ? i :
|
|
1380
|
-
for (let i of
|
|
1385
|
+
let o = e.doors[t], s = o === void 0 ? i : Ce[o] ?? Ce[3];
|
|
1386
|
+
for (let i of we(e, t, n)) r.push({
|
|
1381
1387
|
cx: i.cx,
|
|
1382
1388
|
cy: i.cy,
|
|
1383
1389
|
vertices: i.vertices,
|
|
@@ -1390,8 +1396,8 @@ function Ce(e, t, n) {
|
|
|
1390
1396
|
}
|
|
1391
1397
|
//#endregion
|
|
1392
1398
|
//#region src/scene/elements/ExitLayout.ts
|
|
1393
|
-
function
|
|
1394
|
-
let r = n.roomSize, i = e.x - r / 2, a = e.y - r / 2, { triangles: o } =
|
|
1399
|
+
function Ee(e, t, n) {
|
|
1400
|
+
let r = n.roomSize, i = e.x - r / 2, a = e.y - r / 2, { triangles: o } = Te(e, t, n);
|
|
1395
1401
|
return o.map((e) => {
|
|
1396
1402
|
let t = Array(e.vertices.length);
|
|
1397
1403
|
for (let n = 0; n < e.vertices.length; n += 2) t[n] = e.vertices[n] - i, t[n + 1] = e.vertices[n + 1] - a;
|
|
@@ -1406,7 +1412,7 @@ function we(e, t, n) {
|
|
|
1406
1412
|
};
|
|
1407
1413
|
});
|
|
1408
1414
|
}
|
|
1409
|
-
function
|
|
1415
|
+
function De(e, t) {
|
|
1410
1416
|
let n = [];
|
|
1411
1417
|
for (let t of e.lines) n.push({
|
|
1412
1418
|
type: "line",
|
|
@@ -1417,7 +1423,7 @@ function Te(e, t) {
|
|
|
1417
1423
|
dash: t.dash
|
|
1418
1424
|
}
|
|
1419
1425
|
});
|
|
1420
|
-
for (let t of e.arrows)
|
|
1426
|
+
for (let t of e.arrows) Oe(n, t);
|
|
1421
1427
|
for (let t of e.doors) n.push({
|
|
1422
1428
|
type: "rect",
|
|
1423
1429
|
x: t.x,
|
|
@@ -1438,7 +1444,7 @@ function Te(e, t) {
|
|
|
1438
1444
|
children: n
|
|
1439
1445
|
};
|
|
1440
1446
|
}
|
|
1441
|
-
function
|
|
1447
|
+
function Oe(e, t) {
|
|
1442
1448
|
e.push({
|
|
1443
1449
|
type: "line",
|
|
1444
1450
|
points: t.points,
|
|
@@ -1468,7 +1474,7 @@ function Ee(e, t) {
|
|
|
1468
1474
|
}
|
|
1469
1475
|
//#endregion
|
|
1470
1476
|
//#region src/scene/elements/SpecialExitLayout.ts
|
|
1471
|
-
function
|
|
1477
|
+
function ke(e, t) {
|
|
1472
1478
|
let n = [];
|
|
1473
1479
|
if (n.push({
|
|
1474
1480
|
type: "line",
|
|
@@ -1529,7 +1535,7 @@ function De(e, t) {
|
|
|
1529
1535
|
}
|
|
1530
1536
|
//#endregion
|
|
1531
1537
|
//#region src/scene/elements/StubLayout.ts
|
|
1532
|
-
function
|
|
1538
|
+
function Ae(e) {
|
|
1533
1539
|
return {
|
|
1534
1540
|
type: "group",
|
|
1535
1541
|
x: 0,
|
|
@@ -1557,11 +1563,11 @@ function Oe(e) {
|
|
|
1557
1563
|
}
|
|
1558
1564
|
//#endregion
|
|
1559
1565
|
//#region src/scene/elements/LabelLayout.ts
|
|
1560
|
-
function
|
|
1566
|
+
function je(e) {
|
|
1561
1567
|
let t = (e?.alpha ?? 255) / 255, n = (e) => Math.min(255, Math.max(0, e ?? 0));
|
|
1562
1568
|
return `rgba(${n(e?.r)}, ${n(e?.g)}, ${n(e?.b)}, ${t})`;
|
|
1563
1569
|
}
|
|
1564
|
-
function
|
|
1570
|
+
function Me(e, t) {
|
|
1565
1571
|
if (t.labelRenderMode === "none") return null;
|
|
1566
1572
|
let n = e.X, r = -e.Y, i = !!e.noScaling, a = i ? n : 0, o = i ? r : 0, s = i ? 0 : n, c = i ? 0 : r;
|
|
1567
1573
|
if (t.labelRenderMode === "image" && e.pixMap) return {
|
|
@@ -1590,7 +1596,7 @@ function Ae(e, t) {
|
|
|
1590
1596
|
y: c,
|
|
1591
1597
|
width: e.Width,
|
|
1592
1598
|
height: e.Height,
|
|
1593
|
-
paint: { fill:
|
|
1599
|
+
paint: { fill: je(e.BgColor) }
|
|
1594
1600
|
}), e.Text) {
|
|
1595
1601
|
let t = Math.min(.75, e.Width / Math.max(e.Text.length / 2, 1)), n = Math.max(.1, Math.min(t, Math.max(e.Height * .9, .1)));
|
|
1596
1602
|
l.push({
|
|
@@ -1601,7 +1607,7 @@ function Ae(e, t) {
|
|
|
1601
1607
|
height: e.Height,
|
|
1602
1608
|
text: e.Text,
|
|
1603
1609
|
fontSize: n,
|
|
1604
|
-
fill:
|
|
1610
|
+
fill: je(e.FgColor),
|
|
1605
1611
|
align: "center",
|
|
1606
1612
|
verticalAlign: "middle"
|
|
1607
1613
|
});
|
|
@@ -1621,11 +1627,11 @@ function Ae(e, t) {
|
|
|
1621
1627
|
}
|
|
1622
1628
|
//#endregion
|
|
1623
1629
|
//#region src/ScenePipeline.ts
|
|
1624
|
-
function
|
|
1625
|
-
let n =
|
|
1630
|
+
function Ne(e, t) {
|
|
1631
|
+
let n = Pe(e);
|
|
1626
1632
|
return n ? `rgba(${n.r}, ${n.g}, ${n.b}, ${t})` : e;
|
|
1627
1633
|
}
|
|
1628
|
-
function
|
|
1634
|
+
function Pe(e) {
|
|
1629
1635
|
let t = e.match(/(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);
|
|
1630
1636
|
if (t) return {
|
|
1631
1637
|
r: +t[1],
|
|
@@ -1638,11 +1644,11 @@ function Me(e) {
|
|
|
1638
1644
|
b: parseInt(e.slice(5, 7), 16)
|
|
1639
1645
|
};
|
|
1640
1646
|
}
|
|
1641
|
-
function
|
|
1642
|
-
let r =
|
|
1647
|
+
function Fe(e, t, n) {
|
|
1648
|
+
let r = Pe(e), i = Pe(t);
|
|
1643
1649
|
return !r || !i ? e : `rgb(${Math.round(r.r * n + i.r * (1 - n))}, ${Math.round(r.g * n + i.g * (1 - n))}, ${Math.round(r.b * n + i.b * (1 - n))})`;
|
|
1644
1650
|
}
|
|
1645
|
-
function
|
|
1651
|
+
function Ie(e, t) {
|
|
1646
1652
|
let n = t * t, r = [];
|
|
1647
1653
|
outer: for (let t of e) {
|
|
1648
1654
|
for (let e of r) for (let r of e) {
|
|
@@ -1656,9 +1662,9 @@ function Pe(e, t) {
|
|
|
1656
1662
|
}
|
|
1657
1663
|
return r;
|
|
1658
1664
|
}
|
|
1659
|
-
var
|
|
1665
|
+
var R = class {
|
|
1660
1666
|
constructor(e, t) {
|
|
1661
|
-
this.linkShapes = [], this.roomShapes = [], this.topLabelShapes = [], this.labelShapeRefs = [], this.specialExitShapeRefs = [], this.stubShapeRefs = [], this.areaExitLabelShapeRefs = [], this.mapReader = e, this.settings = t, this.exitRenderer = new
|
|
1667
|
+
this.linkShapes = [], this.roomShapes = [], this.topLabelShapes = [], this.labelShapeRefs = [], this.specialExitShapeRefs = [], this.stubShapeRefs = [], this.areaExitLabelShapeRefs = [], this.mapReader = e, this.settings = t, this.exitRenderer = new oe(e, t);
|
|
1662
1668
|
}
|
|
1663
1669
|
buildScene(e, t, n, r = C) {
|
|
1664
1670
|
this.linkShapes = [], this.roomShapes = [], this.topLabelShapes = [], this.labelShapeRefs = [], this.specialExitShapeRefs = [], this.stubShapeRefs = [], this.areaExitLabelShapeRefs = [], this.renderLabels(t.getLabels(), e.getAreaId());
|
|
@@ -1697,10 +1703,10 @@ var B = class {
|
|
|
1697
1703
|
renderRooms(e, t) {
|
|
1698
1704
|
let n = /* @__PURE__ */ new Map(), r = [], i = [], a = [], o = [];
|
|
1699
1705
|
e.forEach((e) => {
|
|
1700
|
-
let t =
|
|
1701
|
-
t.children.push(...
|
|
1702
|
-
for (let t of
|
|
1703
|
-
let n =
|
|
1706
|
+
let t = ye(e, this.mapReader, this.settings, { flatPipeline: !0 });
|
|
1707
|
+
t.children.push(...Ee(e, this.mapReader, this.settings));
|
|
1708
|
+
for (let t of de(e, this.settings)) {
|
|
1709
|
+
let n = ke(t, e.id);
|
|
1704
1710
|
this.linkShapes.push(n);
|
|
1705
1711
|
let r = t.line.points, a = Infinity, o = Infinity, s = -Infinity, c = -Infinity;
|
|
1706
1712
|
for (let e = 0; e < r.length; e += 2) r[e] < a && (a = r[e]), r[e] > s && (s = r[e]), r[e + 1] < o && (o = r[e + 1]), r[e + 1] > c && (c = r[e + 1]);
|
|
@@ -1745,8 +1751,8 @@ var B = class {
|
|
|
1745
1751
|
arrowColor: e.arrowColor
|
|
1746
1752
|
});
|
|
1747
1753
|
});
|
|
1748
|
-
for (let t of
|
|
1749
|
-
let e =
|
|
1754
|
+
for (let t of le(e, this.settings)) {
|
|
1755
|
+
let e = Ae(t);
|
|
1750
1756
|
this.linkShapes.push(e), a.push({
|
|
1751
1757
|
roomId: t.roomId,
|
|
1752
1758
|
direction: t.direction,
|
|
@@ -1793,7 +1799,7 @@ var B = class {
|
|
|
1793
1799
|
}
|
|
1794
1800
|
let l = this.exitRenderer.renderData(e, t);
|
|
1795
1801
|
if (!l) return;
|
|
1796
|
-
let u =
|
|
1802
|
+
let u = De(l, {
|
|
1797
1803
|
kind: "exit",
|
|
1798
1804
|
id: `${e.a}:${e.b}:${e.aDir ?? ""}:${e.bDir ?? ""}`,
|
|
1799
1805
|
payload: {
|
|
@@ -1834,7 +1840,7 @@ var B = class {
|
|
|
1834
1840
|
if (i === r.isVisible(n)) return;
|
|
1835
1841
|
let a = i ? t : n, o = i ? e.aDir : e.bDir;
|
|
1836
1842
|
if (!o || !k.includes(o) || a.customLines[j[o]]) return;
|
|
1837
|
-
let s = this.settings.roomSize, c = this.getRoomEdgePoint(a.x, a.y, o, s / 2), l =
|
|
1843
|
+
let s = this.settings.roomSize, c = this.getRoomEdgePoint(a.x, a.y, o, s / 2), l = F(a.x, a.y, o, s / 2 + .5);
|
|
1838
1844
|
return {
|
|
1839
1845
|
roomId: a.id,
|
|
1840
1846
|
direction: o,
|
|
@@ -1847,7 +1853,7 @@ var B = class {
|
|
|
1847
1853
|
};
|
|
1848
1854
|
}
|
|
1849
1855
|
emitLensStub(e) {
|
|
1850
|
-
let t =
|
|
1856
|
+
let t = Ae(e);
|
|
1851
1857
|
this.linkShapes.push(t), this.stubShapeRefs.push({
|
|
1852
1858
|
shape: t,
|
|
1853
1859
|
bounds: {
|
|
@@ -1859,14 +1865,14 @@ var B = class {
|
|
|
1859
1865
|
});
|
|
1860
1866
|
}
|
|
1861
1867
|
getRoomEdgePoint(e, t, n, r) {
|
|
1862
|
-
return this.settings.roomShape === "circle" ?
|
|
1868
|
+
return this.settings.roomShape === "circle" ? re(e, t, n, r) : this.settings.roomShape === "roundedRectangle" ? ne(e, t, n, r, this.settings.roomSize * .2) : F(e, t, n, r);
|
|
1863
1869
|
}
|
|
1864
1870
|
buildExitShape(e) {
|
|
1865
|
-
return
|
|
1871
|
+
return De(e);
|
|
1866
1872
|
}
|
|
1867
1873
|
renderLabels(e, t) {
|
|
1868
1874
|
for (let n of e) {
|
|
1869
|
-
let e =
|
|
1875
|
+
let e = Me(n, this.settings);
|
|
1870
1876
|
e && (e.hit = {
|
|
1871
1877
|
kind: "label",
|
|
1872
1878
|
id: n.labelId,
|
|
@@ -1935,15 +1941,15 @@ var B = class {
|
|
|
1935
1941
|
}
|
|
1936
1942
|
let O = D > 3, ee = w / C >= .4, k = n?.x ?? (O ? (m + _) / 2 : o / C), A = n?.y ?? (O ? (v + x) / 2 : d / C), j = "white", M = 0;
|
|
1937
1943
|
for (let [e, t] of S) t > M && (j = e, M = t);
|
|
1938
|
-
let
|
|
1944
|
+
let te = h.concat(g).concat(r), N = (e, t, n = 0) => .5 + n + Math.abs(e) * i / 2 + Math.abs(t) * a / 2, P = [];
|
|
1939
1945
|
if (ee) {
|
|
1940
|
-
let e =
|
|
1941
|
-
|
|
1946
|
+
let e = N(T, E);
|
|
1947
|
+
P.push({
|
|
1942
1948
|
x: k + T * e,
|
|
1943
1949
|
y: A + E * e
|
|
1944
1950
|
});
|
|
1945
1951
|
}
|
|
1946
|
-
|
|
1952
|
+
P.push({
|
|
1947
1953
|
x: k,
|
|
1948
1954
|
y: A
|
|
1949
1955
|
});
|
|
@@ -1952,15 +1958,15 @@ var B = class {
|
|
|
1952
1958
|
.6,
|
|
1953
1959
|
1.4
|
|
1954
1960
|
]) for (let [t, n] of b) {
|
|
1955
|
-
let r =
|
|
1956
|
-
|
|
1961
|
+
let r = N(t, n, e);
|
|
1962
|
+
P.push({
|
|
1957
1963
|
x: k + t * r,
|
|
1958
1964
|
y: A + n * r
|
|
1959
1965
|
});
|
|
1960
1966
|
}
|
|
1961
|
-
for (let t of
|
|
1967
|
+
for (let t of P) {
|
|
1962
1968
|
let n = t.x - i / 2, r = t.y - a / 2;
|
|
1963
|
-
if (!y(n, r, i, a,
|
|
1969
|
+
if (!y(n, r, i, a, te)) return {
|
|
1964
1970
|
cluster: e,
|
|
1965
1971
|
boxX: n,
|
|
1966
1972
|
boxY: r,
|
|
@@ -1971,7 +1977,7 @@ var B = class {
|
|
|
1971
1977
|
}
|
|
1972
1978
|
};
|
|
1973
1979
|
for (let [e, t] of a) {
|
|
1974
|
-
let n = this.mapReader.getArea(e)?.getAreaName() || `Area ${e}`, r =
|
|
1980
|
+
let n = this.mapReader.getArea(e)?.getAreaName() || `Area ${e}`, r = Ie(t, 10).map((e) => x(e, n)).filter((e) => e !== void 0), a = !0;
|
|
1975
1981
|
for (; a && r.length > 1;) {
|
|
1976
1982
|
a = !1;
|
|
1977
1983
|
outer: for (let e = 0; e < r.length; e++) for (let t = e + 1; t < r.length; t++) {
|
|
@@ -1997,7 +2003,7 @@ var B = class {
|
|
|
1997
2003
|
}
|
|
1998
2004
|
}
|
|
1999
2005
|
for (let e of r) {
|
|
2000
|
-
let t =
|
|
2006
|
+
let t = Ne(e.color, f), r = _(Fe(e.color, this.settings.backgroundColor, f)) > .55 ? "#000" : "#fff", a = {
|
|
2001
2007
|
type: "group",
|
|
2002
2008
|
x: 0,
|
|
2003
2009
|
y: 0,
|
|
@@ -2073,7 +2079,7 @@ var B = class {
|
|
|
2073
2079
|
};
|
|
2074
2080
|
//#endregion
|
|
2075
2081
|
//#region src/scene/elements/GridLayout.ts
|
|
2076
|
-
function
|
|
2082
|
+
function Le(e, t, n = {}) {
|
|
2077
2083
|
if (!t.gridEnabled) return [];
|
|
2078
2084
|
let r = n.inverseTransform ?? ((e, t) => ({
|
|
2079
2085
|
x: e,
|
|
@@ -2110,11 +2116,11 @@ function Fe(e, t, n = {}) {
|
|
|
2110
2116
|
}
|
|
2111
2117
|
//#endregion
|
|
2112
2118
|
//#region src/export/clipSceneToViewport.ts
|
|
2113
|
-
function
|
|
2119
|
+
function Re(e, t, n, r) {
|
|
2114
2120
|
if (!n.cullingEnabled) return /* @__PURE__ */ new Map();
|
|
2115
2121
|
let { minX: i, maxX: a, minY: o, maxY: s } = t, c = n.roomSize / 2, l = r?.forward, u = (e, t, n, r) => {
|
|
2116
2122
|
if (l) {
|
|
2117
|
-
let c =
|
|
2123
|
+
let c = ze(e, t, n, r, l);
|
|
2118
2124
|
return c.maxX >= i && c.minX <= a && c.maxY >= o && c.minY <= s;
|
|
2119
2125
|
}
|
|
2120
2126
|
return n >= i && e <= a && r >= o && t <= s;
|
|
@@ -2127,7 +2133,7 @@ function Ie(e, t, n, r) {
|
|
|
2127
2133
|
for (let { shape: t, bounds: n } of e.areaExitLabelShapeRefs) d.set(t, u(n.x, n.y, n.x + n.width, n.y + n.height));
|
|
2128
2134
|
return d;
|
|
2129
2135
|
}
|
|
2130
|
-
function
|
|
2136
|
+
function ze(e, t, n, r, i) {
|
|
2131
2137
|
let a = i(e, t), o = i(n, t), s = i(n, r), c = i(e, r);
|
|
2132
2138
|
return {
|
|
2133
2139
|
minX: Math.min(a.x, o.x, s.x, c.x),
|
|
@@ -2136,13 +2142,13 @@ function Le(e, t, n, r, i) {
|
|
|
2136
2142
|
maxY: Math.max(a.y, o.y, s.y, c.y)
|
|
2137
2143
|
};
|
|
2138
2144
|
}
|
|
2139
|
-
function
|
|
2140
|
-
let i =
|
|
2145
|
+
function Be(e, t, n, r) {
|
|
2146
|
+
let i = Le(t, n, { inverseTransform: r?.inverse });
|
|
2141
2147
|
if (!n.cullingEnabled) return {
|
|
2142
2148
|
...e.sceneShapes,
|
|
2143
2149
|
grid: i
|
|
2144
2150
|
};
|
|
2145
|
-
let a =
|
|
2151
|
+
let a = Re(e, t, n, r);
|
|
2146
2152
|
return {
|
|
2147
2153
|
grid: i,
|
|
2148
2154
|
link: e.sceneShapes.link.filter((e) => a.get(e) ?? !0),
|
|
@@ -2152,14 +2158,14 @@ function Re(e, t, n, r) {
|
|
|
2152
2158
|
}
|
|
2153
2159
|
//#endregion
|
|
2154
2160
|
//#region src/rendering/SceneManager.ts
|
|
2155
|
-
var
|
|
2161
|
+
var Ve = {
|
|
2156
2162
|
grid: [],
|
|
2157
2163
|
link: [],
|
|
2158
2164
|
room: [],
|
|
2159
2165
|
topLabel: []
|
|
2160
|
-
},
|
|
2166
|
+
}, He = class {
|
|
2161
2167
|
constructor(e, t, n) {
|
|
2162
|
-
this.camera = e, this.settings = t, this.standaloneExitShapeSet = /* @__PURE__ */ new Set(), this.pipeline = new
|
|
2168
|
+
this.camera = e, this.settings = t, this.standaloneExitShapeSet = /* @__PURE__ */ new Set(), this.pipeline = new R(n, t);
|
|
2163
2169
|
}
|
|
2164
2170
|
get exitRenderer() {
|
|
2165
2171
|
return this.pipeline.exitRenderer;
|
|
@@ -2192,23 +2198,23 @@ var ze = {
|
|
|
2192
2198
|
this.lastBuildResult = void 0, this.standaloneExitShapeSet = /* @__PURE__ */ new Set();
|
|
2193
2199
|
}
|
|
2194
2200
|
resetPipeline(e) {
|
|
2195
|
-
this.pipeline = new
|
|
2201
|
+
this.pipeline = new R(e, this.settings), this.reset();
|
|
2196
2202
|
}
|
|
2197
2203
|
cullInteractive(e = O) {
|
|
2198
2204
|
if (!this.lastBuildResult) return /* @__PURE__ */ new Map();
|
|
2199
2205
|
let t = this.camera.getCullingViewport(this.settings.cullingBounds), n = e === O ? void 0 : { forward: e };
|
|
2200
|
-
return
|
|
2206
|
+
return Re(this.lastBuildResult, t, this.settings, n);
|
|
2201
2207
|
}
|
|
2202
2208
|
cull(e = O) {
|
|
2203
2209
|
if (!this.lastBuildResult) return {
|
|
2204
|
-
shapes:
|
|
2210
|
+
shapes: Ve,
|
|
2205
2211
|
stats: {
|
|
2206
2212
|
visibleRooms: 0,
|
|
2207
2213
|
totalRooms: 0,
|
|
2208
2214
|
visibleExits: 0
|
|
2209
2215
|
}
|
|
2210
2216
|
};
|
|
2211
|
-
let t = this.camera.getCullingViewport(this.settings.cullingBounds), n = e === O ? void 0 : { forward: e }, r =
|
|
2217
|
+
let t = this.camera.getCullingViewport(this.settings.cullingBounds), n = e === O ? void 0 : { forward: e }, r = Be(this.lastBuildResult, t, this.settings, n);
|
|
2212
2218
|
return {
|
|
2213
2219
|
shapes: r,
|
|
2214
2220
|
stats: {
|
|
@@ -2218,7 +2224,7 @@ var ze = {
|
|
|
2218
2224
|
}
|
|
2219
2225
|
};
|
|
2220
2226
|
}
|
|
2221
|
-
},
|
|
2227
|
+
}, Ue = class {
|
|
2222
2228
|
setCursor(e) {
|
|
2223
2229
|
this.container.dataset.editorCursor || (this.container.style.cursor = e);
|
|
2224
2230
|
}
|
|
@@ -2412,14 +2418,27 @@ var ze = {
|
|
|
2412
2418
|
}
|
|
2413
2419
|
};
|
|
2414
2420
|
//#endregion
|
|
2421
|
+
//#region src/render/canvasGradient.ts
|
|
2422
|
+
function z(e, t) {
|
|
2423
|
+
if (typeof t == "string") return t;
|
|
2424
|
+
if (t.type === "linear") {
|
|
2425
|
+
let n = e.createLinearGradient(t.x0, t.y0, t.x1, t.y1);
|
|
2426
|
+
for (let e of t.stops) n.addColorStop(e.offset, e.color);
|
|
2427
|
+
return n;
|
|
2428
|
+
}
|
|
2429
|
+
let n = t.fx ?? t.cx, r = t.fy ?? t.cy, i = t.fr ?? 0, a = e.createRadialGradient(n, r, i, t.cx, t.cy, t.r);
|
|
2430
|
+
for (let e of t.stops) a.addColorStop(e.offset, e.color);
|
|
2431
|
+
return a;
|
|
2432
|
+
}
|
|
2433
|
+
//#endregion
|
|
2415
2434
|
//#region src/render/RecordingLayer.ts
|
|
2416
|
-
function
|
|
2435
|
+
function We(e, t) {
|
|
2417
2436
|
switch (t.type) {
|
|
2418
2437
|
case "rect":
|
|
2419
|
-
e.beginPath(), t.cr > 0 && typeof e.roundRect == "function" ? e.roundRect(t.x, t.y, t.w, t.h, t.cr) : e.rect(t.x, t.y, t.w, t.h), t.fill && (e.fillStyle = t.fill, e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, t.dash ? e.setLineDash(t.dash) : e.setLineDash([]), e.stroke());
|
|
2438
|
+
e.beginPath(), t.cr > 0 && typeof e.roundRect == "function" ? e.roundRect(t.x, t.y, t.w, t.h, t.cr) : e.rect(t.x, t.y, t.w, t.h), t.fill && (e.fillStyle = z(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, t.dash ? e.setLineDash(t.dash) : e.setLineDash([]), e.stroke());
|
|
2420
2439
|
break;
|
|
2421
2440
|
case "circle":
|
|
2422
|
-
e.beginPath(), e.arc(t.cx, t.cy, t.r, 0, Math.PI * 2), t.fill && (e.fillStyle = t.fill, e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, t.dash ? e.setLineDash(t.dash) : e.setLineDash([]), e.stroke());
|
|
2441
|
+
e.beginPath(), e.arc(t.cx, t.cy, t.r, 0, Math.PI * 2), t.fill && (e.fillStyle = z(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, t.dash ? e.setLineDash(t.dash) : e.setLineDash([]), e.stroke());
|
|
2423
2442
|
break;
|
|
2424
2443
|
case "line": {
|
|
2425
2444
|
if (t.points.length < 4) break;
|
|
@@ -2433,7 +2452,7 @@ function He(e, t) {
|
|
|
2433
2452
|
if (t.vertices.length < 4) break;
|
|
2434
2453
|
e.beginPath(), e.moveTo(t.vertices[0], t.vertices[1]);
|
|
2435
2454
|
for (let n = 2; n < t.vertices.length; n += 2) e.lineTo(t.vertices[n], t.vertices[n + 1]);
|
|
2436
|
-
e.closePath(), t.fill && (e.fillStyle = t.fill, e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash([]), e.stroke());
|
|
2455
|
+
e.closePath(), t.fill && (e.fillStyle = z(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash([]), e.stroke());
|
|
2437
2456
|
break;
|
|
2438
2457
|
case "text": {
|
|
2439
2458
|
let n = t.fontSize * 100, r = `${t.fontStyle} ${n}px ${t.fontFamily}`;
|
|
@@ -2470,7 +2489,7 @@ function He(e, t) {
|
|
|
2470
2489
|
break;
|
|
2471
2490
|
}
|
|
2472
2491
|
}
|
|
2473
|
-
var
|
|
2492
|
+
var Ge = class {
|
|
2474
2493
|
constructor(e, t) {
|
|
2475
2494
|
this._visible = !0, this.noScaling = !1, this.commands = [], this.x = e, this.y = t;
|
|
2476
2495
|
}
|
|
@@ -2511,11 +2530,11 @@ var Ue = class {
|
|
|
2511
2530
|
perfectDrawEnabled: !1,
|
|
2512
2531
|
sceneFunc: (e) => {
|
|
2513
2532
|
let n = e._context;
|
|
2514
|
-
for (let e of t)
|
|
2533
|
+
for (let e of t) We(n, e);
|
|
2515
2534
|
}
|
|
2516
2535
|
})), this._konvaGroup = e, e;
|
|
2517
2536
|
}
|
|
2518
|
-
},
|
|
2537
|
+
}, Ke = class {
|
|
2519
2538
|
constructor(e) {
|
|
2520
2539
|
this.entries = [], this.nodeToEntry = /* @__PURE__ */ new Map(), this.konvaLayer = e, e.destroyChildren();
|
|
2521
2540
|
let t = this;
|
|
@@ -2528,7 +2547,7 @@ var Ue = class {
|
|
|
2528
2547
|
if (!e.visible) continue;
|
|
2529
2548
|
let t = i * e.x + o * e.y + r.e, c = a * e.x + s * e.y + r.f;
|
|
2530
2549
|
e.noScaling ? n.setTransform(75, 0, 0, 75, t, c) : n.setTransform(i, a, o, s, t, c);
|
|
2531
|
-
for (let t of e.commands)
|
|
2550
|
+
for (let t of e.commands) We(n, t);
|
|
2532
2551
|
}
|
|
2533
2552
|
n.setTransform(r);
|
|
2534
2553
|
}
|
|
@@ -2556,7 +2575,7 @@ var Ue = class {
|
|
|
2556
2575
|
ensureShape() {
|
|
2557
2576
|
this.konvaShape.getParent() || this.konvaLayer.add(this.konvaShape);
|
|
2558
2577
|
}
|
|
2559
|
-
},
|
|
2578
|
+
}, B = class {
|
|
2560
2579
|
constructor(e) {
|
|
2561
2580
|
this.groups = [], this.konvaLayer = e, e.destroyChildren();
|
|
2562
2581
|
let t = this;
|
|
@@ -2569,7 +2588,7 @@ var Ue = class {
|
|
|
2569
2588
|
if (!e._visible) continue;
|
|
2570
2589
|
let t = i * e.x + o * e.y + r.e, c = a * e.x + s * e.y + r.f;
|
|
2571
2590
|
e.noScaling ? n.setTransform(75, 0, 0, 75, t, c) : n.setTransform(i, a, o, s, t, c);
|
|
2572
|
-
for (let t of e.commands)
|
|
2591
|
+
for (let t of e.commands) We(n, t);
|
|
2573
2592
|
}
|
|
2574
2593
|
n.setTransform(r);
|
|
2575
2594
|
}
|
|
@@ -2587,7 +2606,7 @@ var Ue = class {
|
|
|
2587
2606
|
ensureShape() {
|
|
2588
2607
|
this.konvaShape.getParent() || this.konvaLayer.add(this.konvaShape);
|
|
2589
2608
|
}
|
|
2590
|
-
},
|
|
2609
|
+
}, qe = class {
|
|
2591
2610
|
constructor(e) {
|
|
2592
2611
|
this.konvaLayer = e;
|
|
2593
2612
|
}
|
|
@@ -2602,15 +2621,42 @@ var Ue = class {
|
|
|
2602
2621
|
}
|
|
2603
2622
|
};
|
|
2604
2623
|
//#endregion
|
|
2624
|
+
//#region src/scene/Shape.ts
|
|
2625
|
+
function Je(e) {
|
|
2626
|
+
return typeof e == "object" && !!e;
|
|
2627
|
+
}
|
|
2628
|
+
function Ye(e, t) {
|
|
2629
|
+
return t !== !1 && e ? e : void 0;
|
|
2630
|
+
}
|
|
2631
|
+
function V(e, t, n, r, i, a) {
|
|
2632
|
+
return Je(e) ? e.type === "linear" ? {
|
|
2633
|
+
type: "linear",
|
|
2634
|
+
x0: (t + e.x0) * r + i,
|
|
2635
|
+
y0: (n + e.y0) * r + a,
|
|
2636
|
+
x1: (t + e.x1) * r + i,
|
|
2637
|
+
y1: (n + e.y1) * r + a,
|
|
2638
|
+
stops: e.stops
|
|
2639
|
+
} : {
|
|
2640
|
+
type: "radial",
|
|
2641
|
+
cx: (t + e.cx) * r + i,
|
|
2642
|
+
cy: (n + e.cy) * r + a,
|
|
2643
|
+
r: e.r * r,
|
|
2644
|
+
fx: e.fx === void 0 ? void 0 : (t + e.fx) * r + i,
|
|
2645
|
+
fy: e.fy === void 0 ? void 0 : (n + e.fy) * r + a,
|
|
2646
|
+
fr: e.fr === void 0 ? void 0 : e.fr * r,
|
|
2647
|
+
stops: e.stops
|
|
2648
|
+
} : e;
|
|
2649
|
+
}
|
|
2650
|
+
//#endregion
|
|
2605
2651
|
//#region src/render/shapeToRecording.ts
|
|
2606
|
-
function
|
|
2607
|
-
let t = new
|
|
2608
|
-
return e.noScale && (t.noScaling = !0),
|
|
2652
|
+
function Xe(e) {
|
|
2653
|
+
let t = new Ge(e.x, e.y);
|
|
2654
|
+
return e.noScale && (t.noScaling = !0), Ze(t, e.children, 0, 0), t;
|
|
2609
2655
|
}
|
|
2610
|
-
function
|
|
2611
|
-
for (let i of t)
|
|
2656
|
+
function Ze(e, t, n, r) {
|
|
2657
|
+
for (let i of t) Qe(e, i, n, r);
|
|
2612
2658
|
}
|
|
2613
|
-
function
|
|
2659
|
+
function Qe(e, t, n, r) {
|
|
2614
2660
|
switch (t.type) {
|
|
2615
2661
|
case "rect":
|
|
2616
2662
|
e.commands.push({
|
|
@@ -2619,11 +2665,11 @@ function Je(e, t, n, r) {
|
|
|
2619
2665
|
y: t.y + r,
|
|
2620
2666
|
w: t.width,
|
|
2621
2667
|
h: t.height,
|
|
2622
|
-
fill: t.paint.fill,
|
|
2668
|
+
fill: V(t.paint.fill, n, r, 1, 0, 0),
|
|
2623
2669
|
stroke: t.paint.stroke,
|
|
2624
2670
|
sw: t.paint.strokeWidth ?? 0,
|
|
2625
2671
|
cr: t.cornerRadius ?? 0,
|
|
2626
|
-
dash: t.paint.
|
|
2672
|
+
dash: Ye(t.paint.dash, t.paint.dashEnabled)
|
|
2627
2673
|
});
|
|
2628
2674
|
return;
|
|
2629
2675
|
case "circle":
|
|
@@ -2632,20 +2678,20 @@ function Je(e, t, n, r) {
|
|
|
2632
2678
|
cx: t.cx + n,
|
|
2633
2679
|
cy: t.cy + r,
|
|
2634
2680
|
r: t.radius,
|
|
2635
|
-
fill: t.paint.fill,
|
|
2681
|
+
fill: V(t.paint.fill, n, r, 1, 0, 0),
|
|
2636
2682
|
stroke: t.paint.stroke,
|
|
2637
2683
|
sw: t.paint.strokeWidth ?? 0,
|
|
2638
|
-
dash: t.paint.
|
|
2684
|
+
dash: Ye(t.paint.dash, t.paint.dashEnabled)
|
|
2639
2685
|
});
|
|
2640
2686
|
return;
|
|
2641
2687
|
case "line": {
|
|
2642
|
-
let i = n === 0 && r === 0 ? t.points :
|
|
2688
|
+
let i = n === 0 && r === 0 ? t.points : $e(t.points, n, r);
|
|
2643
2689
|
e.commands.push({
|
|
2644
2690
|
type: "line",
|
|
2645
2691
|
points: i,
|
|
2646
2692
|
stroke: t.paint.stroke,
|
|
2647
2693
|
sw: t.paint.strokeWidth ?? 0,
|
|
2648
|
-
dash: t.paint.dash,
|
|
2694
|
+
dash: Ye(t.paint.dash, t.paint.dashEnabled),
|
|
2649
2695
|
lineCap: t.lineCap,
|
|
2650
2696
|
lineJoin: t.lineJoin,
|
|
2651
2697
|
alpha: t.paint.alpha
|
|
@@ -2655,8 +2701,8 @@ function Je(e, t, n, r) {
|
|
|
2655
2701
|
case "polygon":
|
|
2656
2702
|
e.commands.push({
|
|
2657
2703
|
type: "polygon",
|
|
2658
|
-
vertices: n === 0 && r === 0 ? t.vertices :
|
|
2659
|
-
fill: t.paint.fill,
|
|
2704
|
+
vertices: n === 0 && r === 0 ? t.vertices : $e(t.vertices, n, r),
|
|
2705
|
+
fill: V(t.paint.fill, n, r, 1, 0, 0),
|
|
2660
2706
|
stroke: t.paint.stroke,
|
|
2661
2707
|
sw: t.paint.strokeWidth ?? 0
|
|
2662
2708
|
});
|
|
@@ -2682,7 +2728,7 @@ function Je(e, t, n, r) {
|
|
|
2682
2728
|
});
|
|
2683
2729
|
return;
|
|
2684
2730
|
case "image": {
|
|
2685
|
-
let i =
|
|
2731
|
+
let i = et(t.src);
|
|
2686
2732
|
e.commands.push({
|
|
2687
2733
|
type: "image",
|
|
2688
2734
|
x: t.x + n,
|
|
@@ -2695,16 +2741,16 @@ function Je(e, t, n, r) {
|
|
|
2695
2741
|
return;
|
|
2696
2742
|
}
|
|
2697
2743
|
case "group":
|
|
2698
|
-
|
|
2744
|
+
Ze(e, t.children, n + t.x, r + t.y);
|
|
2699
2745
|
return;
|
|
2700
2746
|
}
|
|
2701
2747
|
}
|
|
2702
|
-
function
|
|
2748
|
+
function $e(e, t, n) {
|
|
2703
2749
|
let r = Array(e.length);
|
|
2704
2750
|
for (let i = 0; i < e.length; i += 2) r[i] = e[i] + t, r[i + 1] = e[i + 1] + n;
|
|
2705
2751
|
return r;
|
|
2706
2752
|
}
|
|
2707
|
-
function
|
|
2753
|
+
function et(e) {
|
|
2708
2754
|
let t = r === void 0 ? typeof Image < "u" ? new Image() : null : r.Util.createImageElement();
|
|
2709
2755
|
return t && (t.src = e), t;
|
|
2710
2756
|
}
|
|
@@ -2716,10 +2762,10 @@ var H = [
|
|
|
2716
2762
|
"in",
|
|
2717
2763
|
"out"
|
|
2718
2764
|
];
|
|
2719
|
-
function
|
|
2720
|
-
return e.roomShape === "circle" ?
|
|
2765
|
+
function tt(e, t, n, r, i) {
|
|
2766
|
+
return e.roomShape === "circle" ? re(t, n, r, i) : e.roomShape === "roundedRectangle" ? ne(t, n, r, i, e.roomSize * .2) : F(t, n, r, i);
|
|
2721
2767
|
}
|
|
2722
|
-
function
|
|
2768
|
+
function nt(e, t, n) {
|
|
2723
2769
|
for (let [e, r] of Object.entries(t.exits)) if (r === n.id) {
|
|
2724
2770
|
let r = e;
|
|
2725
2771
|
if (H.includes(r)) {
|
|
@@ -2748,7 +2794,7 @@ function Qe(e, t, n) {
|
|
|
2748
2794
|
} : {
|
|
2749
2795
|
type: "regular",
|
|
2750
2796
|
fromDir: r,
|
|
2751
|
-
toDir:
|
|
2797
|
+
toDir: rt(n, t.id),
|
|
2752
2798
|
fromRoom: t,
|
|
2753
2799
|
toRoom: n
|
|
2754
2800
|
};
|
|
@@ -2811,39 +2857,39 @@ function Qe(e, t, n) {
|
|
|
2811
2857
|
toRoom: n
|
|
2812
2858
|
};
|
|
2813
2859
|
}
|
|
2814
|
-
function
|
|
2860
|
+
function rt(e, t) {
|
|
2815
2861
|
for (let [n, r] of Object.entries(e.exits)) if (r === t) return n;
|
|
2816
2862
|
}
|
|
2817
|
-
function
|
|
2863
|
+
function it(e, t, n) {
|
|
2818
2864
|
return e ? e.area === t && e.z === n : !1;
|
|
2819
2865
|
}
|
|
2820
|
-
function
|
|
2866
|
+
function at(e, t) {
|
|
2821
2867
|
for (let [n, r] of Object.entries(e.exits)) if (r === t.id) return { direction: n };
|
|
2822
2868
|
for (let [n, r] of Object.entries(e.specialExits)) if (r === t.id) return;
|
|
2823
2869
|
}
|
|
2824
|
-
function
|
|
2825
|
-
for (let n of
|
|
2826
|
-
for (let n of
|
|
2870
|
+
function ot(e, t) {
|
|
2871
|
+
for (let n of te) if (e.exits[n] === t.id) return n;
|
|
2872
|
+
for (let n of te) if (t.exits[n] === e.id) return N[n];
|
|
2827
2873
|
}
|
|
2828
|
-
function
|
|
2874
|
+
function st(e, t, n) {
|
|
2829
2875
|
let { fromRoom: r, toRoom: i, fromDir: a, toDir: o } = t;
|
|
2830
2876
|
if (n.length === 0 && n.push(r.x, r.y), a && k.includes(a)) {
|
|
2831
|
-
let t =
|
|
2877
|
+
let t = tt(e, r.x, r.y, a, e.roomSize / 2);
|
|
2832
2878
|
n.push(t.x, t.y);
|
|
2833
2879
|
}
|
|
2834
2880
|
if (o && k.includes(o)) {
|
|
2835
|
-
let t =
|
|
2881
|
+
let t = tt(e, i.x, i.y, o, e.roomSize / 2);
|
|
2836
2882
|
n.push(t.x, t.y);
|
|
2837
2883
|
}
|
|
2838
2884
|
n.push(i.x, i.y);
|
|
2839
2885
|
}
|
|
2840
|
-
function
|
|
2886
|
+
function ct(e, t) {
|
|
2841
2887
|
let { fromRoom: n, toRoom: r, customLineKey: i } = e, a = n, o;
|
|
2842
2888
|
i && (o = n.customLines[i], o || (o = r.customLines[i], a = r)), t.length === 0 && t.push(a.x, a.y), o && o.points.forEach((e) => {
|
|
2843
2889
|
t.push(e.x, -e.y);
|
|
2844
2890
|
}), t.push(r.x, r.y);
|
|
2845
2891
|
}
|
|
2846
|
-
function
|
|
2892
|
+
function lt(e, t, n, r, i) {
|
|
2847
2893
|
let a = [], o = [], s = [], c = n.map((t) => e.getRoom(t)).filter((e) => e !== void 0), l = [], u = () => {
|
|
2848
2894
|
l.length >= 4 && a.push({ points: [...l] }), l = [];
|
|
2849
2895
|
}, d = (e) => {
|
|
@@ -2866,19 +2912,19 @@ function at(e, t, n, r, i) {
|
|
|
2866
2912
|
});
|
|
2867
2913
|
};
|
|
2868
2914
|
for (let n = 0; n < c.length - 1; n++) {
|
|
2869
|
-
let a = c[n], s = c[n + 1], f =
|
|
2915
|
+
let a = c[n], s = c[n + 1], f = it(a, r, i), p = it(s, r, i);
|
|
2870
2916
|
if (!f && !p) {
|
|
2871
2917
|
u();
|
|
2872
2918
|
continue;
|
|
2873
2919
|
}
|
|
2874
2920
|
if (f && p) {
|
|
2875
|
-
let n =
|
|
2921
|
+
let n = nt(e, a, s);
|
|
2876
2922
|
switch (n.type) {
|
|
2877
2923
|
case "regular":
|
|
2878
|
-
|
|
2924
|
+
st(t, n, l);
|
|
2879
2925
|
break;
|
|
2880
2926
|
case "special":
|
|
2881
|
-
|
|
2927
|
+
ct(n, l);
|
|
2882
2928
|
break;
|
|
2883
2929
|
case "inner":
|
|
2884
2930
|
u(), d(n);
|
|
@@ -2888,7 +2934,7 @@ function at(e, t, n, r, i) {
|
|
|
2888
2934
|
break;
|
|
2889
2935
|
}
|
|
2890
2936
|
} else {
|
|
2891
|
-
let e = f ? a : s, n = f ? s : a, r =
|
|
2937
|
+
let e = f ? a : s, n = f ? s : a, r = at(e, n);
|
|
2892
2938
|
if (r) {
|
|
2893
2939
|
if (H.includes(r.direction)) u(), o.push({
|
|
2894
2940
|
room: e,
|
|
@@ -2896,14 +2942,14 @@ function at(e, t, n, r, i) {
|
|
|
2896
2942
|
});
|
|
2897
2943
|
else if (k.includes(r.direction)) {
|
|
2898
2944
|
l.length === 0 && l.push(e.x, e.y);
|
|
2899
|
-
let n =
|
|
2945
|
+
let n = tt(t, e.x, e.y, r.direction, t.roomSize / 2), i = F(e.x, e.y, r.direction, t.roomSize);
|
|
2900
2946
|
l.push(n.x, n.y, i.x, i.y), u();
|
|
2901
2947
|
}
|
|
2902
2948
|
} else {
|
|
2903
|
-
let r =
|
|
2949
|
+
let r = ot(e, n);
|
|
2904
2950
|
if (r) {
|
|
2905
2951
|
l.length === 0 && l.push(e.x, e.y);
|
|
2906
|
-
let n =
|
|
2952
|
+
let n = tt(t, e.x, e.y, r, t.roomSize / 2), i = F(e.x, e.y, r, t.roomSize);
|
|
2907
2953
|
l.push(n.x, n.y, i.x, i.y), u();
|
|
2908
2954
|
}
|
|
2909
2955
|
}
|
|
@@ -2917,24 +2963,27 @@ function at(e, t, n, r, i) {
|
|
|
2917
2963
|
}
|
|
2918
2964
|
//#endregion
|
|
2919
2965
|
//#region src/scene/OverlayStyle.ts
|
|
2920
|
-
function
|
|
2921
|
-
let
|
|
2966
|
+
function ut(e, t) {
|
|
2967
|
+
let n = e.shape ?? "match";
|
|
2968
|
+
return n === "match" ? (e.matchRoomShape ?? !0) && t !== "circle" ? t === "roundedRectangle" ? "roundedRectangle" : "rectangle" : "circle" : n;
|
|
2969
|
+
}
|
|
2970
|
+
function dt(e, t, n) {
|
|
2971
|
+
let r = n.highlight, i = n.roomSize, a = r.sizeFactor, o = ut(r, n.roomShape), s = Array.isArray(t) ? t.length > 0 ? [...t] : ["#ffffff"] : [t];
|
|
2922
2972
|
return {
|
|
2923
|
-
shape: o ? "
|
|
2973
|
+
shape: o === "circle" ? "circle" : "rect",
|
|
2924
2974
|
cx: e.x,
|
|
2925
2975
|
cy: e.y,
|
|
2926
2976
|
size: i / 2 * a,
|
|
2927
|
-
cornerRadius: o
|
|
2928
|
-
|
|
2977
|
+
cornerRadius: o === "roundedRectangle" ? i * a * .2 : 0,
|
|
2978
|
+
colors: s,
|
|
2929
2979
|
strokeAlpha: r.strokeAlpha,
|
|
2930
2980
|
strokeWidth: r.strokeWidth,
|
|
2931
|
-
fillColor: t,
|
|
2932
2981
|
fillAlpha: r.fillAlpha,
|
|
2933
2982
|
dash: r.dash,
|
|
2934
2983
|
dashEnabled: r.dashEnabled
|
|
2935
2984
|
};
|
|
2936
2985
|
}
|
|
2937
|
-
function
|
|
2986
|
+
function ft(e, t) {
|
|
2938
2987
|
let n = t.playerMarker, r = t.roomSize * n.sizeFactor, i = n.matchRoomShape && t.roomShape !== "circle";
|
|
2939
2988
|
return {
|
|
2940
2989
|
shape: i ? "rect" : "circle",
|
|
@@ -2951,12 +3000,12 @@ function st(e, t) {
|
|
|
2951
3000
|
dashEnabled: n.dashEnabled
|
|
2952
3001
|
};
|
|
2953
3002
|
}
|
|
2954
|
-
function
|
|
2955
|
-
let o =
|
|
3003
|
+
function pt(e, t, n, r, i, a) {
|
|
3004
|
+
let o = lt(e, t, n, i, a), s = t.lineWidth, c = [];
|
|
2956
3005
|
for (let e of o.segments) e.points.length >= 4 && c.push({ points: e.points });
|
|
2957
3006
|
for (let e of o.customLines) e.points.length >= 4 && c.push({ points: e.points });
|
|
2958
3007
|
let l = [];
|
|
2959
|
-
for (let e of o.innerMarkers) for (let n of
|
|
3008
|
+
for (let e of o.innerMarkers) for (let n of we(e.room, e.direction, t)) l.push({ vertices: n.vertices });
|
|
2960
3009
|
return {
|
|
2961
3010
|
segments: c,
|
|
2962
3011
|
triangles: l,
|
|
@@ -2967,63 +3016,80 @@ function ct(e, t, n, r, i, a) {
|
|
|
2967
3016
|
}
|
|
2968
3017
|
//#endregion
|
|
2969
3018
|
//#region src/scene/elements/OverlayLayout.ts
|
|
2970
|
-
function
|
|
2971
|
-
|
|
3019
|
+
function mt(e) {
|
|
3020
|
+
if (e.colors.length > 1) return ht(e);
|
|
3021
|
+
let t = e.colors[0], n = x(t, e.strokeAlpha), r = e.fillAlpha > 0 ? x(t, e.fillAlpha) : void 0;
|
|
2972
3022
|
if (e.shape === "circle") return {
|
|
2973
3023
|
type: "circle",
|
|
2974
3024
|
cx: e.cx,
|
|
2975
3025
|
cy: e.cy,
|
|
2976
3026
|
radius: e.size,
|
|
2977
3027
|
paint: {
|
|
2978
|
-
fill:
|
|
2979
|
-
stroke:
|
|
3028
|
+
fill: r,
|
|
3029
|
+
stroke: n,
|
|
3030
|
+
strokeWidth: e.strokeWidth,
|
|
3031
|
+
dash: e.dash,
|
|
3032
|
+
dashEnabled: e.dashEnabled
|
|
3033
|
+
},
|
|
3034
|
+
layer: "overlay"
|
|
3035
|
+
};
|
|
3036
|
+
if (e.cornerRadius > 0) return {
|
|
3037
|
+
type: "rect",
|
|
3038
|
+
x: e.cx - e.size,
|
|
3039
|
+
y: e.cy - e.size,
|
|
3040
|
+
width: e.size * 2,
|
|
3041
|
+
height: e.size * 2,
|
|
3042
|
+
cornerRadius: e.cornerRadius,
|
|
3043
|
+
paint: {
|
|
3044
|
+
fill: r,
|
|
3045
|
+
stroke: n,
|
|
2980
3046
|
strokeWidth: e.strokeWidth,
|
|
2981
3047
|
dash: e.dash,
|
|
2982
3048
|
dashEnabled: e.dashEnabled
|
|
2983
3049
|
},
|
|
2984
3050
|
layer: "overlay"
|
|
2985
3051
|
};
|
|
2986
|
-
let
|
|
3052
|
+
let i = e.cx - e.size, a = e.cy - e.size, o = e.cx + e.size, s = e.cy + e.size, c = [
|
|
2987
3053
|
[
|
|
2988
|
-
r,
|
|
2989
3054
|
i,
|
|
2990
3055
|
a,
|
|
2991
|
-
|
|
3056
|
+
o,
|
|
3057
|
+
a
|
|
2992
3058
|
],
|
|
2993
3059
|
[
|
|
3060
|
+
o,
|
|
2994
3061
|
a,
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
o
|
|
3062
|
+
o,
|
|
3063
|
+
s
|
|
2998
3064
|
],
|
|
2999
3065
|
[
|
|
3000
|
-
a,
|
|
3001
3066
|
o,
|
|
3002
|
-
|
|
3003
|
-
|
|
3067
|
+
s,
|
|
3068
|
+
i,
|
|
3069
|
+
s
|
|
3004
3070
|
],
|
|
3005
3071
|
[
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3072
|
+
i,
|
|
3073
|
+
s,
|
|
3074
|
+
i,
|
|
3075
|
+
a
|
|
3010
3076
|
]
|
|
3011
|
-
],
|
|
3012
|
-
|
|
3077
|
+
], l = [];
|
|
3078
|
+
r && l.push({
|
|
3013
3079
|
type: "rect",
|
|
3014
|
-
x:
|
|
3015
|
-
y:
|
|
3080
|
+
x: i,
|
|
3081
|
+
y: a,
|
|
3016
3082
|
width: e.size * 2,
|
|
3017
3083
|
height: e.size * 2,
|
|
3018
3084
|
cornerRadius: e.cornerRadius,
|
|
3019
|
-
paint: { fill:
|
|
3085
|
+
paint: { fill: r },
|
|
3020
3086
|
layer: "overlay"
|
|
3021
3087
|
});
|
|
3022
|
-
for (let
|
|
3088
|
+
for (let t of c) l.push({
|
|
3023
3089
|
type: "line",
|
|
3024
|
-
points:
|
|
3090
|
+
points: t,
|
|
3025
3091
|
paint: {
|
|
3026
|
-
stroke:
|
|
3092
|
+
stroke: n,
|
|
3027
3093
|
strokeWidth: e.strokeWidth,
|
|
3028
3094
|
dash: e.dash,
|
|
3029
3095
|
dashEnabled: e.dashEnabled
|
|
@@ -3035,11 +3101,72 @@ function lt(e) {
|
|
|
3035
3101
|
type: "group",
|
|
3036
3102
|
x: 0,
|
|
3037
3103
|
y: 0,
|
|
3038
|
-
children:
|
|
3104
|
+
children: l,
|
|
3105
|
+
layer: "overlay"
|
|
3106
|
+
};
|
|
3107
|
+
}
|
|
3108
|
+
function ht(e) {
|
|
3109
|
+
let t = e.colors.length, n = Math.PI * 2 / t, r = -Math.PI / 2, i = [];
|
|
3110
|
+
for (let a = 0; a < t; a++) {
|
|
3111
|
+
let t = e.colors[a], o = x(t, e.strokeAlpha), s = e.fillAlpha > 0 ? x(t, e.fillAlpha) : void 0, c = r + a * n, l = _t(e, c, c + n);
|
|
3112
|
+
if (s) {
|
|
3113
|
+
let t = [e.cx, e.cy];
|
|
3114
|
+
for (let [e, n] of l) t.push(e, n);
|
|
3115
|
+
i.push({
|
|
3116
|
+
type: "polygon",
|
|
3117
|
+
vertices: t,
|
|
3118
|
+
paint: { fill: s },
|
|
3119
|
+
layer: "overlay"
|
|
3120
|
+
});
|
|
3121
|
+
}
|
|
3122
|
+
let u = [];
|
|
3123
|
+
for (let [e, t] of l) u.push(e, t);
|
|
3124
|
+
i.push({
|
|
3125
|
+
type: "line",
|
|
3126
|
+
points: u,
|
|
3127
|
+
paint: {
|
|
3128
|
+
stroke: o,
|
|
3129
|
+
strokeWidth: e.strokeWidth,
|
|
3130
|
+
dash: e.dash,
|
|
3131
|
+
dashEnabled: e.dashEnabled
|
|
3132
|
+
},
|
|
3133
|
+
lineCap: "butt",
|
|
3134
|
+
layer: "overlay"
|
|
3135
|
+
});
|
|
3136
|
+
}
|
|
3137
|
+
return {
|
|
3138
|
+
type: "group",
|
|
3139
|
+
x: 0,
|
|
3140
|
+
y: 0,
|
|
3141
|
+
children: i,
|
|
3039
3142
|
layer: "overlay"
|
|
3040
3143
|
};
|
|
3041
3144
|
}
|
|
3042
|
-
function
|
|
3145
|
+
function gt(e, t) {
|
|
3146
|
+
let n = Math.cos(t), r = Math.sin(t);
|
|
3147
|
+
if (e.shape === "circle") return [e.cx + e.size * n, e.cy + e.size * r];
|
|
3148
|
+
let i = e.size, a = Math.max(Math.abs(n), Math.abs(r)), o = i / a * n, s = i / a * r, c = Math.min(e.cornerRadius, i), l = i - c;
|
|
3149
|
+
if (c > 0 && Math.abs(o) > l && Math.abs(s) > l) {
|
|
3150
|
+
let t = Math.sign(o) * l, i = Math.sign(s) * l, a = t * n + i * r, u = t * t + i * i, d = a + Math.sqrt(Math.max(0, a * a - (u - c * c)));
|
|
3151
|
+
return [e.cx + d * n, e.cy + d * r];
|
|
3152
|
+
}
|
|
3153
|
+
return [e.cx + o, e.cy + s];
|
|
3154
|
+
}
|
|
3155
|
+
function _t(e, t, n) {
|
|
3156
|
+
let r = [t], i = e.shape !== "circle" && e.cornerRadius > 0;
|
|
3157
|
+
if (e.shape === "circle" || i) {
|
|
3158
|
+
let e = i ? Math.PI / 36 : Math.PI / 18, a = Math.max(1, Math.ceil((n - t) / e));
|
|
3159
|
+
for (let e = 1; e < a; e++) r.push(t + (n - t) * e / a);
|
|
3160
|
+
} else {
|
|
3161
|
+
let e = Math.PI / 2, i = Math.PI / 4, a = Math.ceil((t - i) / e), o = Math.floor((n - i) / e);
|
|
3162
|
+
for (let s = a; s <= o; s++) {
|
|
3163
|
+
let a = i + s * e;
|
|
3164
|
+
a > t + 1e-9 && a < n - 1e-9 && r.push(a);
|
|
3165
|
+
}
|
|
3166
|
+
}
|
|
3167
|
+
return r.push(n), r.sort((e, t) => e - t), r.map((t) => gt(e, t));
|
|
3168
|
+
}
|
|
3169
|
+
function vt(e) {
|
|
3043
3170
|
let t = x(e.strokeColor, e.strokeAlpha), n = e.fillAlpha > 0 ? x(e.fillColor, e.fillAlpha) : void 0;
|
|
3044
3171
|
return e.shape === "circle" ? {
|
|
3045
3172
|
type: "circle",
|
|
@@ -3071,7 +3198,7 @@ function ut(e) {
|
|
|
3071
3198
|
layer: "overlay"
|
|
3072
3199
|
};
|
|
3073
3200
|
}
|
|
3074
|
-
function
|
|
3201
|
+
function yt(e) {
|
|
3075
3202
|
let t = [];
|
|
3076
3203
|
for (let n of e.segments) t.push({
|
|
3077
3204
|
type: "line",
|
|
@@ -3110,29 +3237,29 @@ function dt(e) {
|
|
|
3110
3237
|
}
|
|
3111
3238
|
//#endregion
|
|
3112
3239
|
//#region src/hit/HitTester.ts
|
|
3113
|
-
var
|
|
3240
|
+
var bt = {
|
|
3114
3241
|
areaExit: 110,
|
|
3115
3242
|
room: 100,
|
|
3116
3243
|
label: 80,
|
|
3117
3244
|
specialExit: 60,
|
|
3118
3245
|
exit: 40,
|
|
3119
3246
|
stub: 20
|
|
3120
|
-
},
|
|
3247
|
+
}, xt = {
|
|
3121
3248
|
room: .3,
|
|
3122
3249
|
areaExit: 1,
|
|
3123
3250
|
label: 1,
|
|
3124
3251
|
specialExit: .5,
|
|
3125
3252
|
exit: .35,
|
|
3126
3253
|
stub: .3
|
|
3127
|
-
},
|
|
3254
|
+
}, St = (e, t) => ({
|
|
3128
3255
|
x: e,
|
|
3129
3256
|
y: t
|
|
3130
|
-
}),
|
|
3257
|
+
}), Ct = class {
|
|
3131
3258
|
constructor() {
|
|
3132
|
-
this.entries = [], this.bucketSize = 5, this.roomSize = 1, this.spatialIndex = /* @__PURE__ */ new Map(), this.transform =
|
|
3259
|
+
this.entries = [], this.bucketSize = 5, this.roomSize = 1, this.spatialIndex = /* @__PURE__ */ new Map(), this.transform = St;
|
|
3133
3260
|
}
|
|
3134
3261
|
build(e, t, n) {
|
|
3135
|
-
this.clear(), this.roomSize = t, this.bucketSize = Math.max(t * 10, 5), this.transform = n ??
|
|
3262
|
+
this.clear(), this.roomSize = t, this.bucketSize = Math.max(t * 10, 5), this.transform = n ?? St, this.collectHitShapes(e, 0, 0);
|
|
3136
3263
|
}
|
|
3137
3264
|
clear() {
|
|
3138
3265
|
this.entries = [], this.spatialIndex.clear();
|
|
@@ -3176,13 +3303,13 @@ var ft = {
|
|
|
3176
3303
|
forEachCandidate(e, t, n) {
|
|
3177
3304
|
let r = Math.floor(e / this.bucketSize), i = Math.floor(t / this.bucketSize), a = /* @__PURE__ */ new Set();
|
|
3178
3305
|
for (let o = -1; o <= 1; o++) for (let s = -1; s <= 1; s++) {
|
|
3179
|
-
let c = this.spatialIndex.get(
|
|
3306
|
+
let c = this.spatialIndex.get(Mt(r + o, i + s));
|
|
3180
3307
|
if (c) for (let r of c) {
|
|
3181
3308
|
if (a.has(r)) continue;
|
|
3182
3309
|
a.add(r);
|
|
3183
3310
|
let i = r.margin * this.roomSize;
|
|
3184
3311
|
if (e < r.rMinX - i || e > r.rMaxX + i || t < r.rMinY - i || t > r.rMaxY + i) continue;
|
|
3185
|
-
let o =
|
|
3312
|
+
let o = Dt(r, e, t);
|
|
3186
3313
|
o > i || n(r, o);
|
|
3187
3314
|
}
|
|
3188
3315
|
}
|
|
@@ -3201,14 +3328,14 @@ var ft = {
|
|
|
3201
3328
|
collectHitShapes(e, t, n) {
|
|
3202
3329
|
for (let r of e) {
|
|
3203
3330
|
if (r.hit) {
|
|
3204
|
-
let e = [], i =
|
|
3205
|
-
|
|
3331
|
+
let e = [], i = wt();
|
|
3332
|
+
Tt(r, t, n, this.transform, e, i), e.length > 0 && i.minX <= i.maxX && this.indexEntry(i, e, r.hit);
|
|
3206
3333
|
}
|
|
3207
3334
|
r.type === "group" && this.collectHitShapes(r.children, t + r.x, n + r.y);
|
|
3208
3335
|
}
|
|
3209
3336
|
}
|
|
3210
3337
|
indexEntry(e, t, n) {
|
|
3211
|
-
let r = n.margin ??
|
|
3338
|
+
let r = n.margin ?? xt[n.kind] ?? 1, i = n.priority ?? bt[n.kind] ?? 50, a = (e.minX + e.maxX) / 2, o = (e.minY + e.maxY) / 2, s = {
|
|
3212
3339
|
info: n,
|
|
3213
3340
|
margin: r,
|
|
3214
3341
|
priority: i,
|
|
@@ -3223,12 +3350,12 @@ var ft = {
|
|
|
3223
3350
|
this.entries.push(s);
|
|
3224
3351
|
let c = this.bucketSize, l = Math.floor(e.minX / c), u = Math.floor(e.maxX / c), d = Math.floor(e.minY / c), f = Math.floor(e.maxY / c);
|
|
3225
3352
|
for (let e = l; e <= u; e++) for (let t = d; t <= f; t++) {
|
|
3226
|
-
let n =
|
|
3353
|
+
let n = Mt(e, t), r = this.spatialIndex.get(n);
|
|
3227
3354
|
r || (r = [], this.spatialIndex.set(n, r)), r.push(s);
|
|
3228
3355
|
}
|
|
3229
3356
|
}
|
|
3230
3357
|
};
|
|
3231
|
-
function
|
|
3358
|
+
function wt() {
|
|
3232
3359
|
return {
|
|
3233
3360
|
minX: Infinity,
|
|
3234
3361
|
minY: Infinity,
|
|
@@ -3239,14 +3366,14 @@ function gt() {
|
|
|
3239
3366
|
function U(e, t, n) {
|
|
3240
3367
|
t < e.minX && (e.minX = t), t > e.maxX && (e.maxX = t), n < e.minY && (e.minY = n), n > e.maxY && (e.maxY = n);
|
|
3241
3368
|
}
|
|
3242
|
-
function
|
|
3369
|
+
function Tt(e, t, n, r, i, a) {
|
|
3243
3370
|
if (e.type === "group") {
|
|
3244
|
-
for (let o of e.children) o.hit ||
|
|
3371
|
+
for (let o of e.children) o.hit || Et(o, t + e.x, n + e.y, r, i, a);
|
|
3245
3372
|
return;
|
|
3246
3373
|
}
|
|
3247
|
-
|
|
3374
|
+
Et(e, t, n, r, i, a);
|
|
3248
3375
|
}
|
|
3249
|
-
function
|
|
3376
|
+
function Et(e, t, n, r, i, a) {
|
|
3250
3377
|
switch (e.type) {
|
|
3251
3378
|
case "rect":
|
|
3252
3379
|
case "image": {
|
|
@@ -3330,42 +3457,42 @@ function vt(e, t, n, r, i, a) {
|
|
|
3330
3457
|
return;
|
|
3331
3458
|
}
|
|
3332
3459
|
case "group":
|
|
3333
|
-
for (let o of e.children) o.hit ||
|
|
3460
|
+
for (let o of e.children) o.hit || Et(o, t + e.x, n + e.y, r, i, a);
|
|
3334
3461
|
return;
|
|
3335
3462
|
}
|
|
3336
3463
|
}
|
|
3337
|
-
function
|
|
3464
|
+
function Dt(e, t, n) {
|
|
3338
3465
|
let r = Infinity;
|
|
3339
3466
|
for (let i of e.geoms) {
|
|
3340
|
-
let e =
|
|
3467
|
+
let e = Ot(i, t, n);
|
|
3341
3468
|
if (e < r && (r = e), r === 0) return 0;
|
|
3342
3469
|
}
|
|
3343
3470
|
return r;
|
|
3344
3471
|
}
|
|
3345
|
-
function
|
|
3472
|
+
function Ot(e, t, n) {
|
|
3346
3473
|
if (e.type === "circle") {
|
|
3347
3474
|
let r = t - e.cx, i = n - e.cy;
|
|
3348
3475
|
return Math.max(0, Math.hypot(r, i) - e.r);
|
|
3349
3476
|
}
|
|
3350
|
-
return e.closed &&
|
|
3477
|
+
return e.closed && jt(e.pts, t, n) ? 0 : kt(e.pts, t, n, e.closed);
|
|
3351
3478
|
}
|
|
3352
|
-
function
|
|
3479
|
+
function kt(e, t, n, r) {
|
|
3353
3480
|
let i = e.length / 2;
|
|
3354
3481
|
if (i < 2) return i === 1 ? Math.hypot(t - e[0], n - e[1]) : Infinity;
|
|
3355
3482
|
let a = Infinity, o = r ? i : i - 1;
|
|
3356
3483
|
for (let r = 0; r < o; r++) {
|
|
3357
|
-
let o = r * 2, s = (r + 1) % i * 2, c =
|
|
3484
|
+
let o = r * 2, s = (r + 1) % i * 2, c = At(t, n, e[o], e[o + 1], e[s], e[s + 1]);
|
|
3358
3485
|
c < a && (a = c);
|
|
3359
3486
|
}
|
|
3360
3487
|
return a;
|
|
3361
3488
|
}
|
|
3362
|
-
function
|
|
3489
|
+
function At(e, t, n, r, i, a) {
|
|
3363
3490
|
let o = i - n, s = a - r, c = o * o + s * s, l = c === 0 ? 0 : ((e - n) * o + (t - r) * s) / c;
|
|
3364
3491
|
l < 0 ? l = 0 : l > 1 && (l = 1);
|
|
3365
3492
|
let u = n + l * o, d = r + l * s;
|
|
3366
3493
|
return Math.hypot(e - u, t - d);
|
|
3367
3494
|
}
|
|
3368
|
-
function
|
|
3495
|
+
function jt(e, t, n) {
|
|
3369
3496
|
let r = !1, i = e.length / 2;
|
|
3370
3497
|
for (let a = 0, o = i - 1; a < i; o = a++) {
|
|
3371
3498
|
let i = e[a * 2], s = e[a * 2 + 1], c = e[o * 2], l = e[o * 2 + 1], u = l - s || 1e-12;
|
|
@@ -3373,13 +3500,13 @@ function Ct(e, t, n) {
|
|
|
3373
3500
|
}
|
|
3374
3501
|
return r;
|
|
3375
3502
|
}
|
|
3376
|
-
function
|
|
3503
|
+
function Mt(e, t) {
|
|
3377
3504
|
return e * 1000003 + t;
|
|
3378
3505
|
}
|
|
3379
3506
|
//#endregion
|
|
3380
3507
|
//#region src/style/Style.ts
|
|
3381
3508
|
var W = { transform: (e) => e };
|
|
3382
|
-
function
|
|
3509
|
+
function Nt(...e) {
|
|
3383
3510
|
return e.length === 0 ? W : e.length === 1 ? e[0] : {
|
|
3384
3511
|
transform(t, n) {
|
|
3385
3512
|
let r = [t];
|
|
@@ -3416,19 +3543,19 @@ function Tt(...e) {
|
|
|
3416
3543
|
}
|
|
3417
3544
|
//#endregion
|
|
3418
3545
|
//#region src/style/applyStyle.ts
|
|
3419
|
-
function
|
|
3546
|
+
function Pt(e, t, n) {
|
|
3420
3547
|
let r = [];
|
|
3421
3548
|
for (let i of e) {
|
|
3422
|
-
let e =
|
|
3549
|
+
let e = Ft(i, t, n);
|
|
3423
3550
|
Array.isArray(e) ? r.push(...e) : r.push(e);
|
|
3424
3551
|
}
|
|
3425
3552
|
return r;
|
|
3426
3553
|
}
|
|
3427
|
-
function
|
|
3554
|
+
function Ft(e, t, n) {
|
|
3428
3555
|
if (e.type === "group") {
|
|
3429
3556
|
let r = [];
|
|
3430
3557
|
for (let i of e.children) {
|
|
3431
|
-
let e =
|
|
3558
|
+
let e = Ft(i, t, n);
|
|
3432
3559
|
Array.isArray(e) ? r.push(...e) : r.push(e);
|
|
3433
3560
|
}
|
|
3434
3561
|
return t.transform({
|
|
@@ -3440,12 +3567,12 @@ function Et(e, t, n) {
|
|
|
3440
3567
|
}
|
|
3441
3568
|
//#endregion
|
|
3442
3569
|
//#region src/rendering/KonvaRenderBackend.ts
|
|
3443
|
-
var
|
|
3570
|
+
var G = "rgb(120, 72, 0)", It = class {
|
|
3444
3571
|
get coordinateTransform() {
|
|
3445
3572
|
return this._coordinateTransform;
|
|
3446
3573
|
}
|
|
3447
3574
|
constructor(e, t) {
|
|
3448
|
-
this.gridCachedBounds = null, this.currentStyle = W, this.hitTester = new
|
|
3575
|
+
this.gridCachedBounds = null, this.currentStyle = W, this.hitTester = new Ct(), this.lastHitShapes = [], this.shapeToDrawEntry = /* @__PURE__ */ new Map(), this.shapeToGroup = /* @__PURE__ */ new Map(), this.highlightShapes = /* @__PURE__ */ new Map(), this.pathShapes = [], this.currentRoomOverlay = [], this.destroyed = !1, this._coordinateTransform = O, this.coordinateInverse = O, this.liveEffects = /* @__PURE__ */ new Map(), this.sceneOverlays = /* @__PURE__ */ new Map(), this.sceneOverlayNodes = /* @__PURE__ */ new Map(), this.viewportSubscribers = /* @__PURE__ */ new Set(), this.state = e, this.container = t, t ? (this.stage = new r.Stage({
|
|
3449
3576
|
container: t,
|
|
3450
3577
|
width: t.clientWidth,
|
|
3451
3578
|
height: t.clientHeight,
|
|
@@ -3455,12 +3582,12 @@ var K = "rgb(120, 72, 0)", Dt = class {
|
|
|
3455
3582
|
height: 1
|
|
3456
3583
|
}), this.camera = new D(1, 1)), this.gridLayer = new r.Layer({ listening: !1 }), this.stage.add(this.gridLayer);
|
|
3457
3584
|
let n = new r.Layer({ listening: !1 });
|
|
3458
|
-
if (this.linkLayer = n, this.roomLayer = n, this.stage.add(n), this.positionLayer = new r.Layer({ listening: !1 }), this.stage.add(this.positionLayer), this.overlayLayer = new r.Layer({ listening: !1 }), this.stage.add(this.overlayLayer), this.topLabelLayer = new r.Layer({ listening: !1 }), this.stage.add(this.topLabelLayer), this.positionLayerNode = new
|
|
3585
|
+
if (this.linkLayer = n, this.roomLayer = n, this.stage.add(n), this.positionLayer = new r.Layer({ listening: !1 }), this.stage.add(this.positionLayer), this.overlayLayer = new r.Layer({ listening: !1 }), this.stage.add(this.overlayLayer), this.topLabelLayer = new r.Layer({ listening: !1 }), this.stage.add(this.topLabelLayer), this.positionLayerNode = new qe(this.positionLayer), this.overlayLayerNode = new qe(this.overlayLayer), this.sceneNode = new Ke(n), this.gridLayerNode = new B(this.gridLayer), this.topLabelLayerNode = new B(this.topLabelLayer), this.sceneManager = new He(this.camera, e.settings, e.mapReader), this.events = new S(t), this.culling = new ee(e.settings, () => this.applyClipping()), this.cameraChangeHandler = () => this.applyViewportToStage(), this.camera.on("change", this.cameraChangeHandler), t) {
|
|
3459
3586
|
this.origSetSize = this.camera.setSize.bind(this.camera);
|
|
3460
3587
|
let n = this.origSetSize;
|
|
3461
3588
|
this.camera.setSize = (e, t) => {
|
|
3462
3589
|
n(e, t), this.stage.width(e), this.stage.height(t);
|
|
3463
|
-
}, this.interactionHandler = new
|
|
3590
|
+
}, this.interactionHandler = new Ue(t, this.camera, e, {
|
|
3464
3591
|
clientToMapPoint: (e, n) => this.camera.clientToMapPoint(e, n, t.getBoundingClientRect()),
|
|
3465
3592
|
pickAtPoint: (e, t) => this.hitTester.pick(e, t)
|
|
3466
3593
|
}, this.events);
|
|
@@ -3468,7 +3595,7 @@ var K = "rgb(120, 72, 0)", Dt = class {
|
|
|
3468
3595
|
this.applyStyleTransforms(), this.subscribeToState(e);
|
|
3469
3596
|
}
|
|
3470
3597
|
setStyle(e) {
|
|
3471
|
-
this.currentStyle = e, this.sceneNode = new
|
|
3598
|
+
this.currentStyle = e, this.sceneNode = new Ke(this.linkLayer), this.gridLayerNode = new B(this.gridLayer), this.topLabelLayerNode = new B(this.topLabelLayer), this.gridCachedBounds = null, this.sceneManager.resetPipeline(this.state.mapReader), this.shapeToDrawEntry = /* @__PURE__ */ new Map(), this.shapeToGroup.clear(), this.lastHitShapes = [], this.hitTester.clear(), this.applyStyleTransforms(), this.refresh();
|
|
3472
3599
|
}
|
|
3473
3600
|
applyStyleTransforms() {
|
|
3474
3601
|
let e = this.currentStyle, t = e.worldToScene ? (t, n) => e.worldToScene(t, n) : O, n = e.sceneToWorld ? (t, n) => e.sceneToWorld(t, n) : O, r = this.coordinateInverse;
|
|
@@ -3601,7 +3728,7 @@ var K = "rgb(120, 72, 0)", Dt = class {
|
|
|
3601
3728
|
let e = this.mapPoint(r.x, r.y);
|
|
3602
3729
|
this.camera.panToMapPointAnimated(e.x, e.y, n || this.state.settings.instantMapMove);
|
|
3603
3730
|
}
|
|
3604
|
-
}), e.events.on("highlight", ({ roomId: e,
|
|
3731
|
+
}), e.events.on("highlight", ({ roomId: e, colors: t }) => {
|
|
3605
3732
|
this.syncHighlight(e, t);
|
|
3606
3733
|
}), e.events.on("path", () => {
|
|
3607
3734
|
this.syncPaths();
|
|
@@ -3625,22 +3752,20 @@ var K = "rgb(120, 72, 0)", Dt = class {
|
|
|
3625
3752
|
}
|
|
3626
3753
|
for (let e of r.sceneShapes.topLabel) this.addStyledShape(e, this.topLabelLayerNode);
|
|
3627
3754
|
}
|
|
3628
|
-
|
|
3629
|
-
|
|
3755
|
+
addStyledShape(e, t) {
|
|
3756
|
+
let n = this.currentStyle === W ? [e] : Pt([e], this.currentStyle, this.styleContext());
|
|
3757
|
+
if (n.length === 0) return;
|
|
3758
|
+
let r;
|
|
3759
|
+
r = n.length === 1 && n[0].type === "group" ? n[0] : {
|
|
3630
3760
|
type: "group",
|
|
3631
3761
|
x: 0,
|
|
3632
3762
|
y: 0,
|
|
3633
|
-
children:
|
|
3634
|
-
layer: e.layer
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
for (let e of n) {
|
|
3640
|
-
let n = this.shapeToRecordingNode(e);
|
|
3641
|
-
t.addNode(n), r ||= n;
|
|
3642
|
-
}
|
|
3643
|
-
return r;
|
|
3763
|
+
children: n,
|
|
3764
|
+
layer: e.layer,
|
|
3765
|
+
noScale: e.noScale
|
|
3766
|
+
};
|
|
3767
|
+
let i = Xe(r);
|
|
3768
|
+
return t.addNode(i), i;
|
|
3644
3769
|
}
|
|
3645
3770
|
refreshGrid(e) {
|
|
3646
3771
|
let t = this.state.settings;
|
|
@@ -3651,7 +3776,7 @@ var K = "rgb(120, 72, 0)", Dt = class {
|
|
|
3651
3776
|
let n = this.coordinateInverse, r = n(e.minX, e.minY), i = n(e.maxX, e.minY), a = n(e.maxX, e.maxY), o = n(e.minX, e.maxY), s = Math.min(r.x, i.x, a.x, o.x), c = Math.max(r.x, i.x, a.x, o.x), l = Math.min(r.y, i.y, a.y, o.y), u = Math.max(r.y, i.y, a.y, o.y), d = t.gridSize * 2, f = Math.floor((s - d) / t.gridSize) * t.gridSize, p = Math.ceil((c + d) / t.gridSize) * t.gridSize, m = Math.floor((l - d) / t.gridSize) * t.gridSize, h = Math.ceil((u + d) / t.gridSize) * t.gridSize, g = this.gridCachedBounds;
|
|
3652
3777
|
if (g && g.left === f && g.right === p && g.top === m && g.bottom === h) return;
|
|
3653
3778
|
this.gridLayerNode.destroyChildren();
|
|
3654
|
-
let _ =
|
|
3779
|
+
let _ = Le(e, t, { inverseTransform: this.coordinateInverse });
|
|
3655
3780
|
for (let e of _) this.addStyledShape(e, this.gridLayerNode);
|
|
3656
3781
|
this.gridCachedBounds = {
|
|
3657
3782
|
left: f,
|
|
@@ -3661,7 +3786,7 @@ var K = "rgb(120, 72, 0)", Dt = class {
|
|
|
3661
3786
|
}, this.gridLayerNode.batchDraw();
|
|
3662
3787
|
}
|
|
3663
3788
|
onSceneBuilt() {
|
|
3664
|
-
this.
|
|
3789
|
+
this.lastHitShapes = this.sceneManager.hitShapes, this.hitTester.build(this.lastHitShapes, this.state.settings.roomSize, this._coordinateTransform);
|
|
3665
3790
|
let e = this.camera.getScale();
|
|
3666
3791
|
this.stage.scale({
|
|
3667
3792
|
x: e,
|
|
@@ -3701,8 +3826,8 @@ var K = "rgb(120, 72, 0)", Dt = class {
|
|
|
3701
3826
|
this.positionLayerNode.batchDraw();
|
|
3702
3827
|
return;
|
|
3703
3828
|
}
|
|
3704
|
-
let t =
|
|
3705
|
-
this.positionMarker = this.addStyledShape(
|
|
3829
|
+
let t = ft(e, this.state.settings);
|
|
3830
|
+
this.positionMarker = this.addStyledShape(vt(t), this.positionLayerNode);
|
|
3706
3831
|
}
|
|
3707
3832
|
clearCurrentRoomOverlay() {
|
|
3708
3833
|
this.currentRoomOverlay.forEach((e) => e.destroy()), this.currentRoomOverlay = [], this.positionLayerNode.batchDraw();
|
|
@@ -3721,11 +3846,11 @@ var K = "rgb(120, 72, 0)", Dt = class {
|
|
|
3721
3846
|
n.set(e.id, e);
|
|
3722
3847
|
let r = [], i = this.sceneManager.exitRenderer, a = this.state.lens;
|
|
3723
3848
|
this.state.currentAreaInstance && this.state.currentZIndex !== void 0 && this.state.currentAreaInstance.getLinkExits(this.state.currentZIndex).filter((t) => t.a === e.id || t.b === e.id).forEach((e) => {
|
|
3724
|
-
let t = i.renderDataWithColor(e,
|
|
3849
|
+
let t = i.renderDataWithColor(e, G, this.state.currentZIndex);
|
|
3725
3850
|
t && r.push(this.sceneManager.buildExitShape(t));
|
|
3726
3851
|
});
|
|
3727
|
-
for (let n of
|
|
3728
|
-
for (let n of
|
|
3852
|
+
for (let n of de(e, t, G)) r.push(ke(n, e.id));
|
|
3853
|
+
for (let n of le(e, t, G)) r.push(Ae(n));
|
|
3729
3854
|
[...Object.values(e.exits), ...Object.values(e.specialExits)].forEach((e) => {
|
|
3730
3855
|
let t = this.state.mapReader.getRoom(e);
|
|
3731
3856
|
t && t.area === this.state.currentArea && t.z === this.state.currentZIndex && a.isVisible(t) && n.set(e, t);
|
|
@@ -3733,11 +3858,11 @@ var K = "rgb(120, 72, 0)", Dt = class {
|
|
|
3733
3858
|
let t = this.addStyledShape(e, this.positionLayerNode);
|
|
3734
3859
|
t && this.currentRoomOverlay.push(t);
|
|
3735
3860
|
}), n.forEach((n, r) => {
|
|
3736
|
-
let i = r === e.id, a =
|
|
3737
|
-
strokeOverride: i ?
|
|
3861
|
+
let i = r === e.id, a = ye(n, this.state.mapReader, t, {
|
|
3862
|
+
strokeOverride: i ? G : t.lineColor,
|
|
3738
3863
|
flatPipeline: !0
|
|
3739
3864
|
});
|
|
3740
|
-
a.children.push(...
|
|
3865
|
+
a.children.push(...Ee(n, this.state.mapReader, t));
|
|
3741
3866
|
let o = this.addStyledShape(a, this.positionLayerNode);
|
|
3742
3867
|
o && this.currentRoomOverlay.push(o);
|
|
3743
3868
|
}), this.positionMarker && this.positionMarker.moveToTop(), this.positionLayerNode.batchDraw();
|
|
@@ -3747,7 +3872,7 @@ var K = "rgb(120, 72, 0)", Dt = class {
|
|
|
3747
3872
|
if (n && (n.destroy(), this.highlightShapes.delete(e)), t !== void 0) {
|
|
3748
3873
|
let n = this.state.mapReader.getRoom(e);
|
|
3749
3874
|
if (n && n.area === this.state.currentArea && n.z === this.state.currentZIndex) {
|
|
3750
|
-
let r =
|
|
3875
|
+
let r = dt(n, t, this.state.settings), i = this.addStyledShape(mt(r), this.overlayLayerNode);
|
|
3751
3876
|
i && this.highlightShapes.set(e, i);
|
|
3752
3877
|
}
|
|
3753
3878
|
}
|
|
@@ -3760,7 +3885,7 @@ var K = "rgb(120, 72, 0)", Dt = class {
|
|
|
3760
3885
|
if (t.area !== this.state.currentArea || t.z !== this.state.currentZIndex) continue;
|
|
3761
3886
|
let n = this.state.mapReader.getRoom(e);
|
|
3762
3887
|
if (!n) continue;
|
|
3763
|
-
let r =
|
|
3888
|
+
let r = dt(n, t.colors, this.state.settings), i = this.addStyledShape(mt(r), this.overlayLayerNode);
|
|
3764
3889
|
i && this.highlightShapes.set(e, i);
|
|
3765
3890
|
}
|
|
3766
3891
|
this.overlayLayerNode.batchDraw();
|
|
@@ -3770,8 +3895,8 @@ var K = "rgb(120, 72, 0)", Dt = class {
|
|
|
3770
3895
|
let { currentArea: e, currentZIndex: t } = this.state;
|
|
3771
3896
|
if (!(e === void 0 || t === void 0)) {
|
|
3772
3897
|
for (let n of this.state.paths) {
|
|
3773
|
-
let r =
|
|
3774
|
-
for (let e of
|
|
3898
|
+
let r = pt(this.state.mapReader, this.state.settings, n.locations, n.color, e, t);
|
|
3899
|
+
for (let e of yt(r)) {
|
|
3775
3900
|
let t = this.addStyledShape(e, this.overlayLayerNode);
|
|
3776
3901
|
t && this.pathShapes.push(t);
|
|
3777
3902
|
}
|
|
@@ -3790,6 +3915,15 @@ var K = "rgb(120, 72, 0)", Dt = class {
|
|
|
3790
3915
|
};
|
|
3791
3916
|
//#endregion
|
|
3792
3917
|
//#region src/style/shape/paintMap.ts
|
|
3918
|
+
function K(e, t) {
|
|
3919
|
+
if (e !== void 0) return typeof e == "string" ? t(e) : {
|
|
3920
|
+
...e,
|
|
3921
|
+
stops: e.stops.map((e) => ({
|
|
3922
|
+
offset: e.offset,
|
|
3923
|
+
color: t(e.color)
|
|
3924
|
+
}))
|
|
3925
|
+
};
|
|
3926
|
+
}
|
|
3793
3927
|
function q(e) {
|
|
3794
3928
|
let t = e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?\s*\)/);
|
|
3795
3929
|
return t ? {
|
|
@@ -3807,97 +3941,97 @@ function q(e) {
|
|
|
3807
3941
|
function J(e, t, n, r = 1) {
|
|
3808
3942
|
return r < 1 ? `rgba(${e}, ${t}, ${n}, ${r})` : `rgb(${e}, ${t}, ${n})`;
|
|
3809
3943
|
}
|
|
3810
|
-
function
|
|
3944
|
+
function Lt(e) {
|
|
3811
3945
|
return (.299 * e.r + .587 * e.g + .114 * e.b) / 255;
|
|
3812
3946
|
}
|
|
3813
3947
|
//#endregion
|
|
3814
3948
|
//#region src/style/shape/ParchmentStyle.ts
|
|
3815
|
-
var
|
|
3816
|
-
function
|
|
3949
|
+
var Rt = "#4a3728", zt = "#3b2a1a", Bt = 139, Vt = 115, Ht = 85, Ut = 244, Wt = 228, Gt = 193;
|
|
3950
|
+
function Kt(e) {
|
|
3817
3951
|
let t = q(e);
|
|
3818
|
-
if (!t) return J(
|
|
3819
|
-
let n =
|
|
3820
|
-
return J(Math.round(
|
|
3952
|
+
if (!t) return J(Ut, Wt, Gt);
|
|
3953
|
+
let n = Lt(t);
|
|
3954
|
+
return J(Math.round(Bt + (Ut - Bt) * n), Math.round(Vt + (Wt - Vt) * n), Math.round(Ht + (Gt - Ht) * n), t.a);
|
|
3821
3955
|
}
|
|
3822
|
-
function
|
|
3956
|
+
function qt(e) {
|
|
3823
3957
|
let t = q(e);
|
|
3824
|
-
if (!t || t.a >= 1) return
|
|
3825
|
-
let n = q(
|
|
3958
|
+
if (!t || t.a >= 1) return Rt;
|
|
3959
|
+
let n = q(Rt);
|
|
3826
3960
|
return J(n.r, n.g, n.b, t.a);
|
|
3827
3961
|
}
|
|
3828
|
-
function
|
|
3962
|
+
function Jt(e) {
|
|
3829
3963
|
return {
|
|
3830
3964
|
...e,
|
|
3831
|
-
fill: e.fill
|
|
3832
|
-
stroke: e.stroke ?
|
|
3965
|
+
fill: K(e.fill, Kt),
|
|
3966
|
+
stroke: e.stroke ? qt(e.stroke) : e.stroke
|
|
3833
3967
|
};
|
|
3834
3968
|
}
|
|
3835
|
-
var
|
|
3969
|
+
var Yt = { transform(e) {
|
|
3836
3970
|
switch (e.type) {
|
|
3837
3971
|
case "rect":
|
|
3838
3972
|
case "circle":
|
|
3839
3973
|
case "polygon": return {
|
|
3840
3974
|
...e,
|
|
3841
|
-
paint:
|
|
3975
|
+
paint: Jt(e.paint)
|
|
3842
3976
|
};
|
|
3843
3977
|
case "line": return {
|
|
3844
3978
|
...e,
|
|
3845
3979
|
paint: e.paint.stroke ? {
|
|
3846
3980
|
...e.paint,
|
|
3847
|
-
stroke:
|
|
3981
|
+
stroke: qt(e.paint.stroke)
|
|
3848
3982
|
} : e.paint
|
|
3849
3983
|
};
|
|
3850
3984
|
case "text": return {
|
|
3851
3985
|
...e,
|
|
3852
|
-
fill:
|
|
3986
|
+
fill: zt
|
|
3853
3987
|
};
|
|
3854
3988
|
case "image":
|
|
3855
3989
|
case "group": return e;
|
|
3856
3990
|
}
|
|
3857
|
-
} },
|
|
3858
|
-
function
|
|
3991
|
+
} }, Xt = "#c0deff", Zt = "#e0f0ff", Qt = 20, $t = 40, en = 80, tn = 60, nn = 100, rn = 160;
|
|
3992
|
+
function an(e) {
|
|
3859
3993
|
let t = q(e);
|
|
3860
|
-
if (!t) return J(
|
|
3861
|
-
let n =
|
|
3862
|
-
return J(Math.round(
|
|
3994
|
+
if (!t) return J(tn, nn, rn);
|
|
3995
|
+
let n = Lt(t);
|
|
3996
|
+
return J(Math.round(Qt + (tn - Qt) * n), Math.round($t + (nn - $t) * n), Math.round(en + (rn - en) * n), t.a);
|
|
3863
3997
|
}
|
|
3864
|
-
function
|
|
3998
|
+
function on(e) {
|
|
3865
3999
|
let t = q(e);
|
|
3866
|
-
if (!t || t.a >= 1) return
|
|
3867
|
-
let n = q(
|
|
4000
|
+
if (!t || t.a >= 1) return Xt;
|
|
4001
|
+
let n = q(Xt);
|
|
3868
4002
|
return J(n.r, n.g, n.b, t.a);
|
|
3869
4003
|
}
|
|
3870
|
-
function
|
|
4004
|
+
function sn(e) {
|
|
3871
4005
|
return {
|
|
3872
4006
|
...e,
|
|
3873
|
-
fill: e.fill
|
|
3874
|
-
stroke: e.stroke ?
|
|
4007
|
+
fill: K(e.fill, an),
|
|
4008
|
+
stroke: e.stroke ? on(e.stroke) : e.stroke
|
|
3875
4009
|
};
|
|
3876
4010
|
}
|
|
3877
|
-
var
|
|
4011
|
+
var cn = { transform(e) {
|
|
3878
4012
|
switch (e.type) {
|
|
3879
4013
|
case "rect":
|
|
3880
4014
|
case "circle":
|
|
3881
4015
|
case "polygon": return {
|
|
3882
4016
|
...e,
|
|
3883
|
-
paint:
|
|
4017
|
+
paint: sn(e.paint)
|
|
3884
4018
|
};
|
|
3885
4019
|
case "line": return {
|
|
3886
4020
|
...e,
|
|
3887
4021
|
paint: e.paint.stroke ? {
|
|
3888
4022
|
...e.paint,
|
|
3889
|
-
stroke:
|
|
4023
|
+
stroke: on(e.paint.stroke)
|
|
3890
4024
|
} : e.paint
|
|
3891
4025
|
};
|
|
3892
4026
|
case "text": return {
|
|
3893
4027
|
...e,
|
|
3894
|
-
fill:
|
|
4028
|
+
fill: Zt
|
|
3895
4029
|
};
|
|
3896
4030
|
case "image":
|
|
3897
4031
|
case "group": return e;
|
|
3898
4032
|
}
|
|
3899
|
-
} },
|
|
3900
|
-
function
|
|
4033
|
+
} }, ln = "#00ffd0", un = .3, dn = 3;
|
|
4034
|
+
function fn(e, t, n) {
|
|
3901
4035
|
e /= 255, t /= 255, n /= 255;
|
|
3902
4036
|
let r = Math.max(e, t, n), i = Math.min(e, t, n), a = (r + i) / 2;
|
|
3903
4037
|
if (r === i) return [
|
|
@@ -3912,68 +4046,68 @@ function nn(e, t, n) {
|
|
|
3912
4046
|
a
|
|
3913
4047
|
];
|
|
3914
4048
|
}
|
|
3915
|
-
function
|
|
4049
|
+
function pn(e, t, n, r = 1) {
|
|
3916
4050
|
e = (e % 360 + 360) % 360;
|
|
3917
4051
|
let i = (1 - Math.abs(2 * n - 1)) * t, a = i * (1 - Math.abs(e / 60 % 2 - 1)), o = n - i / 2, s, c, l;
|
|
3918
4052
|
e < 60 ? (s = i, c = a, l = 0) : e < 120 ? (s = a, c = i, l = 0) : e < 180 ? (s = 0, c = i, l = a) : e < 240 ? (s = 0, c = a, l = i) : e < 300 ? (s = a, c = 0, l = i) : (s = i, c = 0, l = a);
|
|
3919
4053
|
let u = Math.round((s + o) * 255), d = Math.round((c + o) * 255), f = Math.round((l + o) * 255);
|
|
3920
4054
|
return r < 1 ? `rgba(${u}, ${d}, ${f}, ${r})` : `rgb(${u}, ${d}, ${f})`;
|
|
3921
4055
|
}
|
|
3922
|
-
function
|
|
4056
|
+
function mn(e) {
|
|
3923
4057
|
let t = q(e);
|
|
3924
4058
|
if (!t) return {
|
|
3925
4059
|
h: 150,
|
|
3926
4060
|
a: 1
|
|
3927
4061
|
};
|
|
3928
|
-
let [n] =
|
|
4062
|
+
let [n] = fn(t.r, t.g, t.b);
|
|
3929
4063
|
return {
|
|
3930
4064
|
h: n,
|
|
3931
4065
|
a: t.a
|
|
3932
4066
|
};
|
|
3933
4067
|
}
|
|
3934
|
-
function
|
|
3935
|
-
let { h: t, a: n } =
|
|
3936
|
-
return
|
|
4068
|
+
function hn(e) {
|
|
4069
|
+
let { h: t, a: n } = mn(e);
|
|
4070
|
+
return pn(t, .95, .65, n);
|
|
3937
4071
|
}
|
|
3938
|
-
function
|
|
4072
|
+
function gn(e) {
|
|
3939
4073
|
let t = q(e);
|
|
3940
4074
|
if (!t) return "rgb(8, 12, 10)";
|
|
3941
|
-
let [n] =
|
|
3942
|
-
return
|
|
4075
|
+
let [n] = fn(t.r, t.g, t.b);
|
|
4076
|
+
return pn(n, .4, .1, t.a);
|
|
3943
4077
|
}
|
|
3944
|
-
function
|
|
3945
|
-
let { h: t, a: n } =
|
|
3946
|
-
return
|
|
4078
|
+
function _n(e) {
|
|
4079
|
+
let { h: t, a: n } = mn(e);
|
|
4080
|
+
return pn(t, .95, .65, Math.min(n, un));
|
|
3947
4081
|
}
|
|
3948
|
-
function
|
|
4082
|
+
function vn(e) {
|
|
3949
4083
|
return {
|
|
3950
4084
|
...e,
|
|
3951
|
-
fill: e.fill
|
|
3952
|
-
stroke: e.stroke ?
|
|
4085
|
+
fill: K(e.fill, gn),
|
|
4086
|
+
stroke: e.stroke ? hn(e.stroke) : e.stroke
|
|
3953
4087
|
};
|
|
3954
4088
|
}
|
|
3955
|
-
function
|
|
4089
|
+
function yn(e, t = !1) {
|
|
3956
4090
|
if (!e.stroke) return e;
|
|
3957
|
-
let n = (e.strokeWidth ?? 1) *
|
|
4091
|
+
let n = (e.strokeWidth ?? 1) * dn;
|
|
3958
4092
|
return {
|
|
3959
|
-
stroke:
|
|
4093
|
+
stroke: _n(e.stroke),
|
|
3960
4094
|
strokeWidth: n,
|
|
3961
4095
|
dash: e.dash,
|
|
3962
4096
|
dashEnabled: e.dashEnabled,
|
|
3963
|
-
alpha: t ?
|
|
4097
|
+
alpha: t ? un : e.alpha
|
|
3964
4098
|
};
|
|
3965
4099
|
}
|
|
3966
|
-
var
|
|
4100
|
+
var bn = { transform(e) {
|
|
3967
4101
|
switch (e.type) {
|
|
3968
4102
|
case "rect": {
|
|
3969
4103
|
let t = {
|
|
3970
4104
|
...e,
|
|
3971
|
-
paint:
|
|
4105
|
+
paint: vn(e.paint)
|
|
3972
4106
|
};
|
|
3973
4107
|
return e.paint.stroke ? [{
|
|
3974
4108
|
...e,
|
|
3975
4109
|
paint: {
|
|
3976
|
-
...
|
|
4110
|
+
...yn(e.paint),
|
|
3977
4111
|
fill: void 0
|
|
3978
4112
|
}
|
|
3979
4113
|
}, t] : t;
|
|
@@ -3981,12 +4115,12 @@ var dn = { transform(e) {
|
|
|
3981
4115
|
case "circle": {
|
|
3982
4116
|
let t = {
|
|
3983
4117
|
...e,
|
|
3984
|
-
paint:
|
|
4118
|
+
paint: vn(e.paint)
|
|
3985
4119
|
};
|
|
3986
4120
|
return e.paint.stroke ? [{
|
|
3987
4121
|
...e,
|
|
3988
4122
|
paint: {
|
|
3989
|
-
...
|
|
4123
|
+
...yn(e.paint),
|
|
3990
4124
|
fill: void 0
|
|
3991
4125
|
}
|
|
3992
4126
|
}, t] : t;
|
|
@@ -3996,21 +4130,21 @@ var dn = { transform(e) {
|
|
|
3996
4130
|
...e,
|
|
3997
4131
|
paint: e.paint.stroke ? {
|
|
3998
4132
|
...e.paint,
|
|
3999
|
-
stroke:
|
|
4133
|
+
stroke: hn(e.paint.stroke)
|
|
4000
4134
|
} : e.paint
|
|
4001
4135
|
};
|
|
4002
4136
|
return e.paint.stroke ? [{
|
|
4003
4137
|
...e,
|
|
4004
|
-
paint:
|
|
4138
|
+
paint: yn(e.paint, !0)
|
|
4005
4139
|
}, t] : t;
|
|
4006
4140
|
}
|
|
4007
4141
|
case "polygon": return {
|
|
4008
4142
|
...e,
|
|
4009
|
-
paint:
|
|
4143
|
+
paint: vn(e.paint)
|
|
4010
4144
|
};
|
|
4011
4145
|
case "text": return {
|
|
4012
4146
|
...e,
|
|
4013
|
-
fill:
|
|
4147
|
+
fill: ln
|
|
4014
4148
|
};
|
|
4015
4149
|
case "image":
|
|
4016
4150
|
case "group": return e;
|
|
@@ -4018,16 +4152,16 @@ var dn = { transform(e) {
|
|
|
4018
4152
|
} };
|
|
4019
4153
|
//#endregion
|
|
4020
4154
|
//#region src/style/shape/wobble.ts
|
|
4021
|
-
function
|
|
4155
|
+
function xn(e) {
|
|
4022
4156
|
let t = e | 0 || 1;
|
|
4023
4157
|
return () => (t = t * 1664525 + 1013904223 | 0, (t >>> 0) / 4294967296);
|
|
4024
4158
|
}
|
|
4025
|
-
function
|
|
4159
|
+
function Sn(...e) {
|
|
4026
4160
|
let t = 2654435769;
|
|
4027
4161
|
for (let n of e) t ^= (n * 1e3 | 0) + 2654435769 + (t << 6) + (t >> 2);
|
|
4028
4162
|
return t;
|
|
4029
4163
|
}
|
|
4030
|
-
function
|
|
4164
|
+
function Cn(e, t, n, r, i, a) {
|
|
4031
4165
|
let o = n - e, s = r - t, c = Math.sqrt(o * o + s * s);
|
|
4032
4166
|
if (c < .001) return [
|
|
4033
4167
|
e,
|
|
@@ -4042,17 +4176,17 @@ function fn(e, t, n, r, i, a) {
|
|
|
4042
4176
|
}
|
|
4043
4177
|
return f.push(n + l * (a() - .5) * i * .3, r + u * (a() - .5) * i * .3), f;
|
|
4044
4178
|
}
|
|
4045
|
-
function
|
|
4179
|
+
function wn(e, t, n) {
|
|
4046
4180
|
if (e.length < 4) return e;
|
|
4047
4181
|
let r = [];
|
|
4048
4182
|
for (let i = 0; i < e.length - 2; i += 2) {
|
|
4049
|
-
let a =
|
|
4183
|
+
let a = Cn(e[i], e[i + 1], e[i + 2], e[i + 3], t, n);
|
|
4050
4184
|
if (i === 0) r.push(...a);
|
|
4051
4185
|
else for (let e = 2; e < a.length; e++) r.push(a[e]);
|
|
4052
4186
|
}
|
|
4053
4187
|
return r;
|
|
4054
4188
|
}
|
|
4055
|
-
function
|
|
4189
|
+
function Tn(e, t, n, r, i, a) {
|
|
4056
4190
|
let o = [
|
|
4057
4191
|
e,
|
|
4058
4192
|
t,
|
|
@@ -4064,12 +4198,12 @@ function mn(e, t, n, r, i, a) {
|
|
|
4064
4198
|
t + r
|
|
4065
4199
|
], s = [];
|
|
4066
4200
|
for (let e = 0; e < 4; e++) {
|
|
4067
|
-
let t = o[e * 2], n = o[e * 2 + 1], r = (e + 1) % 4, c = o[r * 2], l = o[r * 2 + 1], u =
|
|
4201
|
+
let t = o[e * 2], n = o[e * 2 + 1], r = (e + 1) % 4, c = o[r * 2], l = o[r * 2 + 1], u = Cn(t, n, c, l, i, a);
|
|
4068
4202
|
for (let e = 0; e < u.length - 2; e++) s.push(u[e]);
|
|
4069
4203
|
}
|
|
4070
4204
|
return s;
|
|
4071
4205
|
}
|
|
4072
|
-
function
|
|
4206
|
+
function En(e, t, n, r, i) {
|
|
4073
4207
|
let a = [];
|
|
4074
4208
|
for (let o = 0; o < 24; o++) {
|
|
4075
4209
|
let s = o / 24 * Math.PI * 2, c = n + (i() - .5) * 2 * r;
|
|
@@ -4077,31 +4211,31 @@ function hn(e, t, n, r, i) {
|
|
|
4077
4211
|
}
|
|
4078
4212
|
return a;
|
|
4079
4213
|
}
|
|
4080
|
-
function
|
|
4214
|
+
function Dn(e, t, n) {
|
|
4081
4215
|
let r = e.length / 2;
|
|
4082
4216
|
if (r < 2) return e;
|
|
4083
4217
|
let i = [];
|
|
4084
4218
|
for (let a = 0; a < r; a++) {
|
|
4085
|
-
let o = e[a * 2], s = e[a * 2 + 1], c = (a + 1) % r, l = e[c * 2], u = e[c * 2 + 1], d =
|
|
4219
|
+
let o = e[a * 2], s = e[a * 2 + 1], c = (a + 1) % r, l = e[c * 2], u = e[c * 2 + 1], d = Cn(o, s, l, u, t, n);
|
|
4086
4220
|
for (let e = 0; e < d.length - 2; e++) i.push(d[e]);
|
|
4087
4221
|
}
|
|
4088
4222
|
return i;
|
|
4089
4223
|
}
|
|
4090
4224
|
//#endregion
|
|
4091
4225
|
//#region src/style/shape/SketchyStyle.ts
|
|
4092
|
-
function
|
|
4226
|
+
function On(e, t) {
|
|
4093
4227
|
if (!t) return e;
|
|
4094
4228
|
let n = t.match(/^rgba\(.+,\s*([\d.]+)\s*\)$/);
|
|
4095
4229
|
if (!n) return e;
|
|
4096
4230
|
let r = parseFloat(n[1]);
|
|
4097
4231
|
return r >= 1 ? e : `rgba(${parseInt(e.slice(1, 3), 16)}, ${parseInt(e.slice(3, 5), 16)}, ${parseInt(e.slice(5, 7), 16)}, ${r})`;
|
|
4098
4232
|
}
|
|
4099
|
-
function
|
|
4233
|
+
function kn(e) {
|
|
4100
4234
|
let { jitter: t, color: n } = e;
|
|
4101
4235
|
return { transform(e) {
|
|
4102
4236
|
switch (e.type) {
|
|
4103
4237
|
case "rect": {
|
|
4104
|
-
let r =
|
|
4238
|
+
let r = xn(Sn(e.x, e.y, e.width, e.height)), i = e.paint.fill ? "#ffffff" : void 0, a = e.paint.stroke ? n : void 0;
|
|
4105
4239
|
if (e.cornerRadius && e.cornerRadius > 0) {
|
|
4106
4240
|
let n = [];
|
|
4107
4241
|
if (i && n.push({
|
|
@@ -4114,7 +4248,7 @@ function vn(e) {
|
|
|
4114
4248
|
}), a && e.paint.strokeWidth) {
|
|
4115
4249
|
let i = {
|
|
4116
4250
|
type: "polygon",
|
|
4117
|
-
vertices:
|
|
4251
|
+
vertices: Tn(e.x, e.y, e.width, e.height, t, r),
|
|
4118
4252
|
paint: {
|
|
4119
4253
|
stroke: a,
|
|
4120
4254
|
strokeWidth: e.paint.strokeWidth
|
|
@@ -4129,7 +4263,7 @@ function vn(e) {
|
|
|
4129
4263
|
}
|
|
4130
4264
|
return {
|
|
4131
4265
|
type: "polygon",
|
|
4132
|
-
vertices:
|
|
4266
|
+
vertices: Tn(e.x, e.y, e.width, e.height, t, r),
|
|
4133
4267
|
paint: {
|
|
4134
4268
|
fill: i,
|
|
4135
4269
|
stroke: a,
|
|
@@ -4141,10 +4275,10 @@ function vn(e) {
|
|
|
4141
4275
|
};
|
|
4142
4276
|
}
|
|
4143
4277
|
case "circle": {
|
|
4144
|
-
let r =
|
|
4278
|
+
let r = xn(Sn(e.cx, e.cy, e.radius));
|
|
4145
4279
|
return {
|
|
4146
4280
|
type: "polygon",
|
|
4147
|
-
vertices:
|
|
4281
|
+
vertices: En(e.cx, e.cy, e.radius, t, r),
|
|
4148
4282
|
paint: {
|
|
4149
4283
|
fill: e.paint.fill ? "#ffffff" : void 0,
|
|
4150
4284
|
stroke: e.paint.stroke ? n : void 0,
|
|
@@ -4156,7 +4290,7 @@ function vn(e) {
|
|
|
4156
4290
|
};
|
|
4157
4291
|
}
|
|
4158
4292
|
case "line": {
|
|
4159
|
-
let r =
|
|
4293
|
+
let r = xn(Sn(...e.points.slice(0, 4))), i = wn(e.points, t, r), a = On(n, e.paint.stroke), o = {
|
|
4160
4294
|
...e.paint,
|
|
4161
4295
|
stroke: a
|
|
4162
4296
|
};
|
|
@@ -4167,7 +4301,7 @@ function vn(e) {
|
|
|
4167
4301
|
};
|
|
4168
4302
|
}
|
|
4169
4303
|
case "polygon": {
|
|
4170
|
-
let r =
|
|
4304
|
+
let r = xn(Sn(...e.vertices.slice(0, 4))), i = Dn(e.vertices, t, r);
|
|
4171
4305
|
return {
|
|
4172
4306
|
...e,
|
|
4173
4307
|
vertices: i,
|
|
@@ -4189,16 +4323,42 @@ function vn(e) {
|
|
|
4189
4323
|
}
|
|
4190
4324
|
//#endregion
|
|
4191
4325
|
//#region src/style/shape/IsometricStyle.ts
|
|
4192
|
-
function
|
|
4326
|
+
function An(e, t) {
|
|
4327
|
+
return K(e, (e) => v(e, t));
|
|
4328
|
+
}
|
|
4329
|
+
function jn(e, t) {
|
|
4330
|
+
if (!t || typeof t == "string") return t;
|
|
4331
|
+
if (t.type === "linear") {
|
|
4332
|
+
let [n, r] = e(t.x0, t.y0), [i, a] = e(t.x1, t.y1);
|
|
4333
|
+
return {
|
|
4334
|
+
...t,
|
|
4335
|
+
x0: n,
|
|
4336
|
+
y0: r,
|
|
4337
|
+
x1: i,
|
|
4338
|
+
y1: a
|
|
4339
|
+
};
|
|
4340
|
+
}
|
|
4341
|
+
let [n, r] = e(t.cx, t.cy), i = {
|
|
4342
|
+
...t,
|
|
4343
|
+
cx: n,
|
|
4344
|
+
cy: r
|
|
4345
|
+
};
|
|
4346
|
+
if (t.fx !== void 0 && t.fy !== void 0) {
|
|
4347
|
+
let [n, r] = e(t.fx, t.fy);
|
|
4348
|
+
i.fx = n, i.fy = r;
|
|
4349
|
+
}
|
|
4350
|
+
return i;
|
|
4351
|
+
}
|
|
4352
|
+
function Mn(e) {
|
|
4193
4353
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
4194
4354
|
return (e, t) => [e * n - t * r, (e * r + t * n) * .5];
|
|
4195
4355
|
}
|
|
4196
|
-
function
|
|
4356
|
+
function Nn(e) {
|
|
4197
4357
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
4198
4358
|
return (e, t) => [e * n + 2 * t * r, -e * r + 2 * t * n];
|
|
4199
4359
|
}
|
|
4200
|
-
var
|
|
4201
|
-
function
|
|
4360
|
+
var Y = 32;
|
|
4361
|
+
function Pn(e, t) {
|
|
4202
4362
|
let n = Array(t.length);
|
|
4203
4363
|
for (let r = 0; r < t.length; r += 2) {
|
|
4204
4364
|
let [i, a] = e(t[r], t[r + 1]);
|
|
@@ -4206,7 +4366,7 @@ function xn(e, t) {
|
|
|
4206
4366
|
}
|
|
4207
4367
|
return n;
|
|
4208
4368
|
}
|
|
4209
|
-
function
|
|
4369
|
+
function Fn(e, t, n, r, i) {
|
|
4210
4370
|
let [a, o] = e(t, n), [s, c] = e(t + r, n), [l, u] = e(t + r, n + i), [d, f] = e(t, n + i);
|
|
4211
4371
|
return [
|
|
4212
4372
|
a,
|
|
@@ -4219,8 +4379,8 @@ function Sn(e, t, n, r, i) {
|
|
|
4219
4379
|
f
|
|
4220
4380
|
];
|
|
4221
4381
|
}
|
|
4222
|
-
function
|
|
4223
|
-
let t = e.rotation ?? 0, n = e.depth ?? .18, r =
|
|
4382
|
+
function In(e = {}) {
|
|
4383
|
+
let t = e.rotation ?? 0, n = e.depth ?? .18, r = Mn(t), i = Nn(t);
|
|
4224
4384
|
function a(e, t, n, i) {
|
|
4225
4385
|
let [a, o] = r(e, t), [s, c] = r(e + n, t), [l, u] = r(e, t + i);
|
|
4226
4386
|
return [
|
|
@@ -4233,7 +4393,7 @@ function Cn(e = {}) {
|
|
|
4233
4393
|
];
|
|
4234
4394
|
}
|
|
4235
4395
|
function o(e) {
|
|
4236
|
-
let { x: t, y: i, width: a, height: o, paint: s } = e, c =
|
|
4396
|
+
let { x: t, y: i, width: a, height: o, paint: s } = e, c = Fn(r, t, i, a, o);
|
|
4237
4397
|
if (s.dash || s.dashEnabled) {
|
|
4238
4398
|
let t = [];
|
|
4239
4399
|
for (let n = 0; n < 8; n += 2) {
|
|
@@ -4257,83 +4417,83 @@ function Cn(e = {}) {
|
|
|
4257
4417
|
return t;
|
|
4258
4418
|
}
|
|
4259
4419
|
if (n > 0 && s.fill) {
|
|
4260
|
-
let t = [],
|
|
4261
|
-
for (let e = 1; e < 4; e++) c[e * 2 + 1] > c[
|
|
4262
|
-
let
|
|
4420
|
+
let t = [], i = 0;
|
|
4421
|
+
for (let e = 1; e < 4; e++) c[e * 2 + 1] > c[i * 2 + 1] && (i = e);
|
|
4422
|
+
let a = c[i * 2], o = c[i * 2 + 1], l = (i + 3) % 4, u = c[l * 2], d = c[l * 2 + 1], f = (i + 1) % 4, p = c[f * 2], m = c[f * 2 + 1], h = (i + 2) % 4, g = c[h * 2], _ = c[h * 2 + 1], v = jn(r, s.fill);
|
|
4263
4423
|
if (t.push({
|
|
4264
4424
|
type: "polygon",
|
|
4265
4425
|
vertices: [
|
|
4266
|
-
l,
|
|
4267
4426
|
u,
|
|
4268
|
-
|
|
4427
|
+
d,
|
|
4269
4428
|
a,
|
|
4270
|
-
|
|
4271
|
-
a
|
|
4272
|
-
|
|
4273
|
-
u
|
|
4429
|
+
o,
|
|
4430
|
+
a,
|
|
4431
|
+
o + n,
|
|
4432
|
+
u,
|
|
4433
|
+
d + n
|
|
4274
4434
|
],
|
|
4275
|
-
paint: { fill: v
|
|
4435
|
+
paint: { fill: An(v, .2) },
|
|
4276
4436
|
layer: e.layer
|
|
4277
4437
|
}), t.push({
|
|
4278
4438
|
type: "polygon",
|
|
4279
4439
|
vertices: [
|
|
4280
|
-
i,
|
|
4281
4440
|
a,
|
|
4282
|
-
|
|
4441
|
+
o,
|
|
4442
|
+
p,
|
|
4443
|
+
m,
|
|
4283
4444
|
p,
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
a + n
|
|
4445
|
+
m + n,
|
|
4446
|
+
a,
|
|
4447
|
+
o + n
|
|
4288
4448
|
],
|
|
4289
|
-
paint: { fill: v
|
|
4449
|
+
paint: { fill: An(v, .4) },
|
|
4290
4450
|
layer: e.layer
|
|
4291
4451
|
}), t.push({
|
|
4292
4452
|
type: "polygon",
|
|
4293
4453
|
vertices: c,
|
|
4294
|
-
paint: { fill:
|
|
4454
|
+
paint: { fill: v },
|
|
4295
4455
|
layer: e.layer,
|
|
4296
4456
|
hit: e.hit
|
|
4297
4457
|
}), s.stroke && s.strokeWidth) {
|
|
4298
|
-
let r = s.strokeWidth,
|
|
4458
|
+
let r = s.strokeWidth, i = s.stroke, c = e.layer, l = (e) => t.push({
|
|
4299
4459
|
type: "line",
|
|
4300
4460
|
points: e,
|
|
4301
4461
|
paint: {
|
|
4302
|
-
stroke:
|
|
4462
|
+
stroke: i,
|
|
4303
4463
|
strokeWidth: r
|
|
4304
4464
|
},
|
|
4305
4465
|
layer: c
|
|
4306
4466
|
});
|
|
4307
|
-
|
|
4308
|
-
h,
|
|
4467
|
+
l([
|
|
4309
4468
|
g,
|
|
4310
|
-
|
|
4311
|
-
u
|
|
4312
|
-
|
|
4313
|
-
|
|
4469
|
+
_,
|
|
4470
|
+
u,
|
|
4471
|
+
d
|
|
4472
|
+
]), l([
|
|
4473
|
+
p,
|
|
4474
|
+
m,
|
|
4475
|
+
g,
|
|
4476
|
+
_
|
|
4477
|
+
]), l([
|
|
4478
|
+
u,
|
|
4479
|
+
d,
|
|
4480
|
+
u,
|
|
4481
|
+
d + n
|
|
4482
|
+
]), l([
|
|
4483
|
+
p,
|
|
4484
|
+
m,
|
|
4314
4485
|
p,
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
]), d([
|
|
4318
|
-
l,
|
|
4486
|
+
m + n
|
|
4487
|
+
]), l([
|
|
4319
4488
|
u,
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4489
|
+
d + n,
|
|
4490
|
+
a,
|
|
4491
|
+
o + n
|
|
4492
|
+
]), l([
|
|
4493
|
+
a,
|
|
4494
|
+
o + n,
|
|
4324
4495
|
p,
|
|
4325
|
-
|
|
4326
|
-
p + n
|
|
4327
|
-
]), d([
|
|
4328
|
-
l,
|
|
4329
|
-
u + n,
|
|
4330
|
-
i,
|
|
4331
|
-
a + n
|
|
4332
|
-
]), d([
|
|
4333
|
-
i,
|
|
4334
|
-
a + n,
|
|
4335
|
-
f,
|
|
4336
|
-
p + n
|
|
4496
|
+
m + n
|
|
4337
4497
|
]);
|
|
4338
4498
|
}
|
|
4339
4499
|
return t;
|
|
@@ -4342,7 +4502,7 @@ function Cn(e = {}) {
|
|
|
4342
4502
|
type: "polygon",
|
|
4343
4503
|
vertices: c,
|
|
4344
4504
|
paint: {
|
|
4345
|
-
fill: s.fill,
|
|
4505
|
+
fill: jn(r, s.fill),
|
|
4346
4506
|
stroke: s.stroke,
|
|
4347
4507
|
strokeWidth: s.strokeWidth
|
|
4348
4508
|
},
|
|
@@ -4352,15 +4512,15 @@ function Cn(e = {}) {
|
|
|
4352
4512
|
};
|
|
4353
4513
|
}
|
|
4354
4514
|
function s(e) {
|
|
4355
|
-
let { cx: t, cy: i, radius: a, paint: o } = e, s = Array(
|
|
4356
|
-
for (let e = 0; e <
|
|
4357
|
-
let n = e /
|
|
4515
|
+
let { cx: t, cy: i, radius: a, paint: o } = e, s = Array(Y * 2);
|
|
4516
|
+
for (let e = 0; e < Y; e++) {
|
|
4517
|
+
let n = e / Y * Math.PI * 2, [o, c] = r(t + Math.cos(n) * a, i + Math.sin(n) * a);
|
|
4358
4518
|
s[e * 2] = o, s[e * 2 + 1] = c;
|
|
4359
4519
|
}
|
|
4360
4520
|
if (o.dash || o.dashEnabled) {
|
|
4361
4521
|
let t = [];
|
|
4362
|
-
for (let n = 0; n <
|
|
4363
|
-
let r = (n + 1) %
|
|
4522
|
+
for (let n = 0; n < Y; n++) {
|
|
4523
|
+
let r = (n + 1) % Y;
|
|
4364
4524
|
t.push({
|
|
4365
4525
|
type: "line",
|
|
4366
4526
|
points: [
|
|
@@ -4379,43 +4539,43 @@ function Cn(e = {}) {
|
|
|
4379
4539
|
}
|
|
4380
4540
|
return t;
|
|
4381
4541
|
}
|
|
4382
|
-
let c = [];
|
|
4542
|
+
let c = [], l = jn(r, o.fill);
|
|
4383
4543
|
if (n > 0 && o.fill) {
|
|
4384
|
-
let t = 0, r = 0, i = 0, a = -Infinity,
|
|
4385
|
-
for (let e = 0; e <
|
|
4386
|
-
let
|
|
4387
|
-
for (let e = 0; e <=
|
|
4388
|
-
for (let e =
|
|
4544
|
+
let t = 0, r = 0, i = 0, a = -Infinity, u = Infinity, d = -Infinity;
|
|
4545
|
+
for (let e = 0; e < Y; e++) s[e * 2] > a && (a = s[e * 2], t = e), s[e * 2] < u && (u = s[e * 2], r = e), s[e * 2 + 1] > d && (d = s[e * 2 + 1], i = e);
|
|
4546
|
+
let f = [], p = t;
|
|
4547
|
+
for (let e = 0; e <= Y && (f.push(s[p * 2], s[p * 2 + 1]), p !== i); e++) p = (p + 1) % Y;
|
|
4548
|
+
for (let e = f.length - 2; e >= 0; e -= 2) f.push(f[e], f[e + 1] + n);
|
|
4389
4549
|
c.push({
|
|
4390
4550
|
type: "polygon",
|
|
4391
|
-
vertices:
|
|
4551
|
+
vertices: f,
|
|
4392
4552
|
paint: {
|
|
4393
|
-
fill:
|
|
4553
|
+
fill: An(l, .2),
|
|
4394
4554
|
stroke: o.stroke,
|
|
4395
4555
|
strokeWidth: o.strokeWidth ? o.strokeWidth * .5 : void 0
|
|
4396
4556
|
},
|
|
4397
4557
|
layer: e.layer
|
|
4398
4558
|
});
|
|
4399
|
-
let
|
|
4400
|
-
|
|
4401
|
-
for (let e = 0; e <=
|
|
4402
|
-
for (let e =
|
|
4559
|
+
let m = [];
|
|
4560
|
+
p = i;
|
|
4561
|
+
for (let e = 0; e <= Y && (m.push(s[p * 2], s[p * 2 + 1]), p !== r); e++) p = (p + 1) % Y;
|
|
4562
|
+
for (let e = m.length - 2; e >= 0; e -= 2) m.push(m[e], m[e + 1] + n);
|
|
4403
4563
|
c.push({
|
|
4404
4564
|
type: "polygon",
|
|
4405
|
-
vertices:
|
|
4565
|
+
vertices: m,
|
|
4406
4566
|
paint: {
|
|
4407
|
-
fill:
|
|
4567
|
+
fill: An(l, .4),
|
|
4408
4568
|
stroke: o.stroke,
|
|
4409
4569
|
strokeWidth: o.strokeWidth ? o.strokeWidth * .5 : void 0
|
|
4410
4570
|
},
|
|
4411
4571
|
layer: e.layer
|
|
4412
4572
|
});
|
|
4413
4573
|
}
|
|
4414
|
-
let
|
|
4574
|
+
let u = {
|
|
4415
4575
|
type: "polygon",
|
|
4416
4576
|
vertices: s,
|
|
4417
4577
|
paint: {
|
|
4418
|
-
fill:
|
|
4578
|
+
fill: l,
|
|
4419
4579
|
stroke: o.stroke,
|
|
4420
4580
|
strokeWidth: o.strokeWidth
|
|
4421
4581
|
},
|
|
@@ -4423,7 +4583,7 @@ function Cn(e = {}) {
|
|
|
4423
4583
|
hit: e.hit,
|
|
4424
4584
|
noScale: e.noScale
|
|
4425
4585
|
};
|
|
4426
|
-
return c.push(
|
|
4586
|
+
return c.push(u), c.length === 1 ? c[0] : c;
|
|
4427
4587
|
}
|
|
4428
4588
|
return {
|
|
4429
4589
|
transform(e) {
|
|
@@ -4432,11 +4592,15 @@ function Cn(e = {}) {
|
|
|
4432
4592
|
case "circle": return s(e);
|
|
4433
4593
|
case "line": return {
|
|
4434
4594
|
...e,
|
|
4435
|
-
points:
|
|
4595
|
+
points: Pn(r, e.points)
|
|
4436
4596
|
};
|
|
4437
4597
|
case "polygon": return {
|
|
4438
4598
|
...e,
|
|
4439
|
-
vertices:
|
|
4599
|
+
vertices: Pn(r, e.vertices),
|
|
4600
|
+
paint: {
|
|
4601
|
+
...e.paint,
|
|
4602
|
+
fill: jn(r, e.paint.fill)
|
|
4603
|
+
}
|
|
4440
4604
|
};
|
|
4441
4605
|
case "text": {
|
|
4442
4606
|
let t = e.width ?? 0, n = e.height ?? 0;
|
|
@@ -4491,21 +4655,21 @@ function Cn(e = {}) {
|
|
|
4491
4655
|
}
|
|
4492
4656
|
//#endregion
|
|
4493
4657
|
//#region src/style/shape/ConstructionStyle.ts
|
|
4494
|
-
var
|
|
4495
|
-
function
|
|
4658
|
+
var X = "#1a1a1a", Ln = "#ffc200", Rn = "#ff6600", zn = 26, Bn = 26, Vn = 26, Hn = 255, Un = 194, Wn = 0;
|
|
4659
|
+
function Gn(e) {
|
|
4496
4660
|
let t = q(e);
|
|
4497
|
-
if (!t) return J(
|
|
4498
|
-
let n =
|
|
4499
|
-
return J(Math.round(
|
|
4661
|
+
if (!t) return J(Hn, Un, Wn);
|
|
4662
|
+
let n = Lt(t);
|
|
4663
|
+
return J(Math.round(zn + (Hn - zn) * n), Math.round(Bn + (Un - Bn) * n), Math.round(Vn + (Wn - Vn) * n), t.a);
|
|
4500
4664
|
}
|
|
4501
|
-
function
|
|
4665
|
+
function Kn(e) {
|
|
4502
4666
|
return {
|
|
4503
4667
|
...e,
|
|
4504
|
-
fill: e.fill
|
|
4505
|
-
stroke: e.stroke ?
|
|
4668
|
+
fill: K(e.fill, Gn),
|
|
4669
|
+
stroke: e.stroke ? X : e.stroke
|
|
4506
4670
|
};
|
|
4507
4671
|
}
|
|
4508
|
-
function
|
|
4672
|
+
function qn(e, t, n, r) {
|
|
4509
4673
|
let i = [], a = e.length;
|
|
4510
4674
|
for (let o = 0; o < a; o++) {
|
|
4511
4675
|
let s = e[o], c = e[(o + 1) % a], l = t * s[0] + n * s[1] - r, u = t * c[0] + n * c[1] - r;
|
|
@@ -4516,7 +4680,7 @@ function Pn(e, t, n, r) {
|
|
|
4516
4680
|
}
|
|
4517
4681
|
return i;
|
|
4518
4682
|
}
|
|
4519
|
-
function
|
|
4683
|
+
function Jn(e, t, n, r, i) {
|
|
4520
4684
|
let a = [
|
|
4521
4685
|
[e, t],
|
|
4522
4686
|
[e + n, t],
|
|
@@ -4524,37 +4688,37 @@ function Fn(e, t, n, r, i) {
|
|
|
4524
4688
|
[e, t + r]
|
|
4525
4689
|
], o = i * .4, s = o * .35, c = e + t, l = e + n + t + r, u = Math.floor(c / o) - 1, d = Math.ceil(l / o) + 1, f = [];
|
|
4526
4690
|
for (let e = u; e <= d; e++) {
|
|
4527
|
-
let t = e * o, n = t + s, r =
|
|
4528
|
-
r =
|
|
4691
|
+
let t = e * o, n = t + s, r = qn(a, 1, 1, t);
|
|
4692
|
+
r = qn(r, -1, -1, -n), r.length >= 3 && f.push(r.flatMap((e) => [e[0], e[1]]));
|
|
4529
4693
|
}
|
|
4530
4694
|
return f;
|
|
4531
4695
|
}
|
|
4532
|
-
var
|
|
4696
|
+
var Yn = { transform(e, t) {
|
|
4533
4697
|
switch (e.type) {
|
|
4534
4698
|
case "rect": {
|
|
4535
4699
|
if (!e.paint.fill) return {
|
|
4536
4700
|
...e,
|
|
4537
|
-
paint:
|
|
4701
|
+
paint: Kn(e.paint)
|
|
4538
4702
|
};
|
|
4539
4703
|
let n = {
|
|
4540
4704
|
...e,
|
|
4541
4705
|
paint: {
|
|
4542
|
-
fill:
|
|
4706
|
+
fill: X,
|
|
4543
4707
|
strokeWidth: e.paint.strokeWidth
|
|
4544
4708
|
}
|
|
4545
|
-
}, r =
|
|
4709
|
+
}, r = Jn(e.x, e.y, e.width, e.height, t.roomSize).map((t) => ({
|
|
4546
4710
|
type: "polygon",
|
|
4547
4711
|
vertices: t,
|
|
4548
4712
|
layer: e.layer,
|
|
4549
4713
|
paint: {
|
|
4550
|
-
fill:
|
|
4714
|
+
fill: Ln,
|
|
4551
4715
|
alpha: .65
|
|
4552
4716
|
}
|
|
4553
4717
|
})), i = {
|
|
4554
4718
|
...e,
|
|
4555
4719
|
hit: void 0,
|
|
4556
4720
|
paint: {
|
|
4557
|
-
stroke:
|
|
4721
|
+
stroke: X,
|
|
4558
4722
|
strokeWidth: e.paint.strokeWidth
|
|
4559
4723
|
}
|
|
4560
4724
|
};
|
|
@@ -4566,38 +4730,38 @@ var In = { transform(e, t) {
|
|
|
4566
4730
|
}
|
|
4567
4731
|
case "circle": return {
|
|
4568
4732
|
...e,
|
|
4569
|
-
paint:
|
|
4733
|
+
paint: Kn(e.paint)
|
|
4570
4734
|
};
|
|
4571
4735
|
case "polygon": return {
|
|
4572
4736
|
...e,
|
|
4573
4737
|
paint: {
|
|
4574
4738
|
...e.paint,
|
|
4575
|
-
fill: e.paint.fill ?
|
|
4576
|
-
stroke: e.paint.stroke ?
|
|
4739
|
+
fill: e.paint.fill ? Rn : e.paint.fill,
|
|
4740
|
+
stroke: e.paint.stroke ? X : e.paint.stroke
|
|
4577
4741
|
}
|
|
4578
4742
|
};
|
|
4579
4743
|
case "line": return {
|
|
4580
4744
|
...e,
|
|
4581
4745
|
paint: e.paint.stroke ? {
|
|
4582
4746
|
...e.paint,
|
|
4583
|
-
stroke:
|
|
4747
|
+
stroke: Rn
|
|
4584
4748
|
} : e.paint
|
|
4585
4749
|
};
|
|
4586
4750
|
case "text": return {
|
|
4587
4751
|
...e,
|
|
4588
|
-
fill:
|
|
4589
|
-
stroke:
|
|
4752
|
+
fill: Rn,
|
|
4753
|
+
stroke: X,
|
|
4590
4754
|
strokeWidth: t.roomSize * .25
|
|
4591
4755
|
};
|
|
4592
4756
|
case "image":
|
|
4593
4757
|
case "group": return e;
|
|
4594
4758
|
}
|
|
4595
|
-
} },
|
|
4596
|
-
function
|
|
4759
|
+
} }, Xn = "#c8eeff", Zn = "#00c8ff", Qn = "#00ffaa", $n = .2, er = 5, tr = 190;
|
|
4760
|
+
function nr(e, t, n) {
|
|
4597
4761
|
e /= 255, t /= 255, n /= 255;
|
|
4598
4762
|
let r = Math.max(e, t, n), i = Math.min(e, t, n), a = (r + i) / 2;
|
|
4599
4763
|
if (r === i) return [
|
|
4600
|
-
|
|
4764
|
+
tr,
|
|
4601
4765
|
0,
|
|
4602
4766
|
a
|
|
4603
4767
|
];
|
|
@@ -4608,54 +4772,54 @@ function Un(e, t, n) {
|
|
|
4608
4772
|
a
|
|
4609
4773
|
];
|
|
4610
4774
|
}
|
|
4611
|
-
function
|
|
4775
|
+
function rr(e, t, n, r = 1) {
|
|
4612
4776
|
e = (e % 360 + 360) % 360;
|
|
4613
4777
|
let i = (1 - Math.abs(2 * n - 1)) * t, a = i * (1 - Math.abs(e / 60 % 2 - 1)), o = n - i / 2, s, c, l;
|
|
4614
4778
|
e < 60 ? (s = i, c = a, l = 0) : e < 120 ? (s = a, c = i, l = 0) : e < 180 ? (s = 0, c = i, l = a) : e < 240 ? (s = 0, c = a, l = i) : e < 300 ? (s = a, c = 0, l = i) : (s = i, c = 0, l = a);
|
|
4615
4779
|
let u = Math.round((s + o) * 255), d = Math.round((c + o) * 255), f = Math.round((l + o) * 255);
|
|
4616
4780
|
return r < 1 ? `rgba(${u},${d},${f},${r})` : `rgb(${u},${d},${f})`;
|
|
4617
4781
|
}
|
|
4618
|
-
function
|
|
4782
|
+
function ir(e) {
|
|
4619
4783
|
let t = q(e);
|
|
4620
|
-
if (!t) return
|
|
4621
|
-
let [n, r] =
|
|
4622
|
-
return
|
|
4784
|
+
if (!t) return rr(tr, .55, .18);
|
|
4785
|
+
let [n, r] = nr(t.r, t.g, t.b);
|
|
4786
|
+
return rr(r < .08 ? tr : n, .55, .18, t.a);
|
|
4623
4787
|
}
|
|
4624
|
-
function
|
|
4788
|
+
function ar(e) {
|
|
4625
4789
|
return {
|
|
4626
4790
|
...e,
|
|
4627
|
-
fill: e.fill
|
|
4628
|
-
stroke: e.stroke ?
|
|
4791
|
+
fill: K(e.fill, ir),
|
|
4792
|
+
stroke: e.stroke ? Zn : e.stroke
|
|
4629
4793
|
};
|
|
4630
4794
|
}
|
|
4631
|
-
function
|
|
4795
|
+
function or(e) {
|
|
4632
4796
|
return {
|
|
4633
|
-
stroke:
|
|
4634
|
-
strokeWidth: (e.strokeWidth ?? 1) *
|
|
4635
|
-
alpha:
|
|
4797
|
+
stroke: Zn,
|
|
4798
|
+
strokeWidth: (e.strokeWidth ?? 1) * er,
|
|
4799
|
+
alpha: $n
|
|
4636
4800
|
};
|
|
4637
4801
|
}
|
|
4638
|
-
function
|
|
4802
|
+
function sr(e) {
|
|
4639
4803
|
return {
|
|
4640
|
-
stroke:
|
|
4641
|
-
strokeWidth: (e.strokeWidth ?? 1) *
|
|
4642
|
-
alpha:
|
|
4804
|
+
stroke: Qn,
|
|
4805
|
+
strokeWidth: (e.strokeWidth ?? 1) * er,
|
|
4806
|
+
alpha: $n,
|
|
4643
4807
|
dash: e.dash,
|
|
4644
4808
|
dashEnabled: e.dashEnabled
|
|
4645
4809
|
};
|
|
4646
4810
|
}
|
|
4647
|
-
var
|
|
4811
|
+
var cr = { transform(e) {
|
|
4648
4812
|
switch (e.type) {
|
|
4649
4813
|
case "rect": {
|
|
4650
4814
|
let t = {
|
|
4651
4815
|
...e,
|
|
4652
|
-
paint:
|
|
4816
|
+
paint: ar(e.paint)
|
|
4653
4817
|
};
|
|
4654
4818
|
return e.paint.stroke ? [{
|
|
4655
4819
|
...e,
|
|
4656
4820
|
hit: void 0,
|
|
4657
4821
|
paint: {
|
|
4658
|
-
...
|
|
4822
|
+
...or(e.paint),
|
|
4659
4823
|
fill: void 0
|
|
4660
4824
|
}
|
|
4661
4825
|
}, t] : t;
|
|
@@ -4663,13 +4827,13 @@ var Yn = { transform(e) {
|
|
|
4663
4827
|
case "circle": {
|
|
4664
4828
|
let t = {
|
|
4665
4829
|
...e,
|
|
4666
|
-
paint:
|
|
4830
|
+
paint: ar(e.paint)
|
|
4667
4831
|
};
|
|
4668
4832
|
return e.paint.stroke ? [{
|
|
4669
4833
|
...e,
|
|
4670
4834
|
hit: void 0,
|
|
4671
4835
|
paint: {
|
|
4672
|
-
...
|
|
4836
|
+
...or(e.paint),
|
|
4673
4837
|
fill: void 0
|
|
4674
4838
|
}
|
|
4675
4839
|
}, t] : t;
|
|
@@ -4686,38 +4850,100 @@ var Yn = { transform(e) {
|
|
|
4686
4850
|
...e,
|
|
4687
4851
|
paint: e.paint.stroke ? {
|
|
4688
4852
|
...e.paint,
|
|
4689
|
-
stroke:
|
|
4853
|
+
stroke: Qn
|
|
4690
4854
|
} : e.paint
|
|
4691
4855
|
};
|
|
4692
4856
|
return e.paint.stroke ? [{
|
|
4693
4857
|
...e,
|
|
4694
4858
|
hit: void 0,
|
|
4695
|
-
paint:
|
|
4859
|
+
paint: sr(e.paint)
|
|
4696
4860
|
}, t] : t;
|
|
4697
4861
|
}
|
|
4698
4862
|
case "polygon": return {
|
|
4699
4863
|
...e,
|
|
4700
4864
|
paint: {
|
|
4701
4865
|
...e.paint,
|
|
4702
|
-
fill: e.paint.fill ?
|
|
4866
|
+
fill: e.paint.fill ? Qn : e.paint.fill,
|
|
4703
4867
|
stroke: void 0
|
|
4704
4868
|
}
|
|
4705
4869
|
};
|
|
4706
4870
|
case "text": return {
|
|
4707
4871
|
...e,
|
|
4708
|
-
fill:
|
|
4872
|
+
fill: Xn
|
|
4709
4873
|
};
|
|
4710
4874
|
case "image":
|
|
4711
4875
|
case "group": return e;
|
|
4712
4876
|
}
|
|
4713
|
-
} },
|
|
4714
|
-
|
|
4715
|
-
|
|
4877
|
+
} }, lr = {
|
|
4878
|
+
lighten: .35,
|
|
4879
|
+
darken: .25
|
|
4880
|
+
};
|
|
4881
|
+
function ur(e = {}) {
|
|
4882
|
+
let t = e.lighten ?? lr.lighten, n = e.darken ?? lr.darken;
|
|
4883
|
+
function r(e, r, i, a, o) {
|
|
4884
|
+
let s = e.fill;
|
|
4885
|
+
if (typeof s != "string") return e;
|
|
4886
|
+
let c = {
|
|
4887
|
+
type: "linear",
|
|
4888
|
+
x0: r,
|
|
4889
|
+
y0: i,
|
|
4890
|
+
x1: r,
|
|
4891
|
+
y1: i + o,
|
|
4892
|
+
stops: [{
|
|
4893
|
+
offset: 0,
|
|
4894
|
+
color: y(s, t)
|
|
4895
|
+
}, {
|
|
4896
|
+
offset: 1,
|
|
4897
|
+
color: v(s, n)
|
|
4898
|
+
}]
|
|
4899
|
+
};
|
|
4900
|
+
return {
|
|
4901
|
+
...e,
|
|
4902
|
+
fill: c
|
|
4903
|
+
};
|
|
4904
|
+
}
|
|
4905
|
+
return { transform(e) {
|
|
4906
|
+
switch (e.type) {
|
|
4907
|
+
case "rect": return {
|
|
4908
|
+
...e,
|
|
4909
|
+
paint: r(e.paint, e.x, e.y, e.width, e.height)
|
|
4910
|
+
};
|
|
4911
|
+
case "circle": return {
|
|
4912
|
+
...e,
|
|
4913
|
+
paint: r(e.paint, e.cx - e.radius, e.cy - e.radius, e.radius * 2, e.radius * 2)
|
|
4914
|
+
};
|
|
4915
|
+
case "polygon": {
|
|
4916
|
+
if (typeof e.paint.fill != "string") return e;
|
|
4917
|
+
let t = Infinity, n = -Infinity, i = Infinity;
|
|
4918
|
+
for (let r = 0; r < e.vertices.length; r += 2) {
|
|
4919
|
+
let a = e.vertices[r], o = e.vertices[r + 1];
|
|
4920
|
+
o < t && (t = o), o > n && (n = o), a < i && (i = a);
|
|
4921
|
+
}
|
|
4922
|
+
return {
|
|
4923
|
+
...e,
|
|
4924
|
+
paint: r(e.paint, i, t, 1, n - t)
|
|
4925
|
+
};
|
|
4926
|
+
}
|
|
4927
|
+
default: return e;
|
|
4928
|
+
}
|
|
4929
|
+
} };
|
|
4930
|
+
}
|
|
4931
|
+
//#endregion
|
|
4932
|
+
//#region src/style/index.ts
|
|
4933
|
+
var dr = Yt, fr = cn, pr = bn;
|
|
4934
|
+
function mr(e) {
|
|
4935
|
+
return kn(e);
|
|
4716
4936
|
}
|
|
4717
|
-
function
|
|
4718
|
-
return
|
|
4937
|
+
function hr(e = {}) {
|
|
4938
|
+
return In(e);
|
|
4719
4939
|
}
|
|
4720
|
-
var
|
|
4940
|
+
var gr = Yn, _r = cr;
|
|
4941
|
+
function vr(e = {}) {
|
|
4942
|
+
return ur(e);
|
|
4943
|
+
}
|
|
4944
|
+
//#endregion
|
|
4945
|
+
//#region src/rendering/MapRenderer.ts
|
|
4946
|
+
var yr = class {
|
|
4721
4947
|
get settings() {
|
|
4722
4948
|
return this.state.settings;
|
|
4723
4949
|
}
|
|
@@ -4734,7 +4960,7 @@ var tr = In, nr = Yn, rr = class {
|
|
|
4734
4960
|
return this.backend.events;
|
|
4735
4961
|
}
|
|
4736
4962
|
constructor(e, t, n, r) {
|
|
4737
|
-
this.currentStyle = W, this.state = new T(e, t ?? g()), this.backend = r ? r(this.state) : new
|
|
4963
|
+
this.currentStyle = W, this.state = new T(e, t ?? g()), this.backend = r ? r(this.state) : new It(this.state, n);
|
|
4738
4964
|
}
|
|
4739
4965
|
destroy() {
|
|
4740
4966
|
this.backend.destroy();
|
|
@@ -4806,10 +5032,10 @@ var tr = In, nr = Yn, rr = class {
|
|
|
4806
5032
|
this.backend.removeSceneOverlay(e);
|
|
4807
5033
|
}
|
|
4808
5034
|
addLiveEffect(e, t) {
|
|
4809
|
-
this.backend instanceof
|
|
5035
|
+
this.backend instanceof It && this.backend.addLiveEffect(e, t);
|
|
4810
5036
|
}
|
|
4811
5037
|
removeLiveEffect(e) {
|
|
4812
|
-
this.backend instanceof
|
|
5038
|
+
this.backend instanceof It && this.backend.removeLiveEffect(e);
|
|
4813
5039
|
}
|
|
4814
5040
|
hitTest(e, t) {
|
|
4815
5041
|
let n = this.backend.coordinateTransform(e, t);
|
|
@@ -4890,15 +5116,15 @@ var tr = In, nr = Yn, rr = class {
|
|
|
4890
5116
|
getCullingMode() {
|
|
4891
5117
|
return this.state.settings.cullingMode;
|
|
4892
5118
|
}
|
|
4893
|
-
},
|
|
4894
|
-
function
|
|
5119
|
+
}, br = "room";
|
|
5120
|
+
function xr(e, t) {
|
|
4895
5121
|
let n = /* @__PURE__ */ new Map();
|
|
4896
5122
|
function r(e) {
|
|
4897
5123
|
let t = n.get(e);
|
|
4898
5124
|
return t || (t = [], n.set(e, t)), t;
|
|
4899
5125
|
}
|
|
4900
5126
|
function i(e, t, n, i, o, s, c) {
|
|
4901
|
-
let l = e.layer ?? c ??
|
|
5127
|
+
let l = e.layer ?? c ?? br;
|
|
4902
5128
|
switch (e.type) {
|
|
4903
5129
|
case "rect": {
|
|
4904
5130
|
let a = {
|
|
@@ -4907,11 +5133,11 @@ function ar(e, t) {
|
|
|
4907
5133
|
y: (n + e.y) * i + s,
|
|
4908
5134
|
w: e.width * i,
|
|
4909
5135
|
h: e.height * i,
|
|
4910
|
-
fill: e.paint.fill,
|
|
5136
|
+
fill: V(e.paint.fill, t, n, i, o, s),
|
|
4911
5137
|
stroke: e.paint.stroke,
|
|
4912
5138
|
sw: (e.paint.strokeWidth ?? 0) * i,
|
|
4913
5139
|
cr: (e.cornerRadius ?? 0) * i,
|
|
4914
|
-
dash:
|
|
5140
|
+
dash: Cr(e.paint.dash, i, e.paint.dashEnabled)
|
|
4915
5141
|
};
|
|
4916
5142
|
r(l).push(a);
|
|
4917
5143
|
return;
|
|
@@ -4922,19 +5148,19 @@ function ar(e, t) {
|
|
|
4922
5148
|
cx: (t + e.cx) * i + o,
|
|
4923
5149
|
cy: (n + e.cy) * i + s,
|
|
4924
5150
|
r: e.radius * i,
|
|
4925
|
-
fill: e.paint.fill,
|
|
5151
|
+
fill: V(e.paint.fill, t, n, i, o, s),
|
|
4926
5152
|
stroke: e.paint.stroke,
|
|
4927
5153
|
sw: (e.paint.strokeWidth ?? 0) * i,
|
|
4928
|
-
dash:
|
|
5154
|
+
dash: Cr(e.paint.dash, i, e.paint.dashEnabled)
|
|
4929
5155
|
});
|
|
4930
5156
|
return;
|
|
4931
5157
|
case "line": {
|
|
4932
5158
|
let a = {
|
|
4933
5159
|
type: "line",
|
|
4934
|
-
points:
|
|
5160
|
+
points: Sr(e.points, t, n, i, o, s),
|
|
4935
5161
|
stroke: e.paint.stroke,
|
|
4936
5162
|
sw: (e.paint.strokeWidth ?? 0) * i,
|
|
4937
|
-
dash:
|
|
5163
|
+
dash: Cr(e.paint.dash, i, e.paint.dashEnabled),
|
|
4938
5164
|
lineCap: e.lineCap,
|
|
4939
5165
|
lineJoin: e.lineJoin,
|
|
4940
5166
|
alpha: e.paint.alpha
|
|
@@ -4945,8 +5171,8 @@ function ar(e, t) {
|
|
|
4945
5171
|
case "polygon": {
|
|
4946
5172
|
let a = {
|
|
4947
5173
|
type: "polygon",
|
|
4948
|
-
vertices:
|
|
4949
|
-
fill: e.paint.fill,
|
|
5174
|
+
vertices: Sr(e.vertices, t, n, i, o, s),
|
|
5175
|
+
fill: V(e.paint.fill, t, n, i, o, s),
|
|
4950
5176
|
stroke: e.paint.stroke,
|
|
4951
5177
|
sw: (e.paint.strokeWidth ?? 0) * i
|
|
4952
5178
|
};
|
|
@@ -4954,7 +5180,7 @@ function ar(e, t) {
|
|
|
4954
5180
|
return;
|
|
4955
5181
|
}
|
|
4956
5182
|
case "text": {
|
|
4957
|
-
let a =
|
|
5183
|
+
let a = wr(e.transform, t, n, i, o, s), c = {
|
|
4958
5184
|
type: "text",
|
|
4959
5185
|
x: a ? 0 : (t + e.x) * i + o,
|
|
4960
5186
|
y: a ? 0 : (n + e.y) * i + s,
|
|
@@ -4977,7 +5203,7 @@ function ar(e, t) {
|
|
|
4977
5203
|
return;
|
|
4978
5204
|
}
|
|
4979
5205
|
case "image": {
|
|
4980
|
-
let a =
|
|
5206
|
+
let a = wr(e.transform, t, n, i, o, s), c = a ? 0 : (t + e.x) * i + o, u = a ? 0 : (n + e.y) * i + s;
|
|
4981
5207
|
r(l).push({
|
|
4982
5208
|
type: "image",
|
|
4983
5209
|
x: c,
|
|
@@ -4997,7 +5223,7 @@ function ar(e, t) {
|
|
|
4997
5223
|
function a(e, t, n, a, o, s, c) {
|
|
4998
5224
|
let l = e.layer ?? c;
|
|
4999
5225
|
if (e.noScale) {
|
|
5000
|
-
let c = (t + e.x) * a + o, u = (n + e.y) * a + s, d = r(l ??
|
|
5226
|
+
let c = (t + e.x) * a + o, u = (n + e.y) * a + s, d = r(l ?? br);
|
|
5001
5227
|
d.push({
|
|
5002
5228
|
type: "pushTransform",
|
|
5003
5229
|
matrix: [
|
|
@@ -5024,19 +5250,19 @@ function ar(e, t) {
|
|
|
5024
5250
|
});
|
|
5025
5251
|
return o;
|
|
5026
5252
|
}
|
|
5027
|
-
function
|
|
5253
|
+
function Sr(e, t, n, r, i, a) {
|
|
5028
5254
|
let o = Array(e.length);
|
|
5029
5255
|
for (let s = 0; s < e.length; s += 2) o[s] = (t + e[s]) * r + i, o[s + 1] = (n + e[s + 1]) * r + a;
|
|
5030
5256
|
return o;
|
|
5031
5257
|
}
|
|
5032
|
-
function
|
|
5258
|
+
function Cr(e, t, n) {
|
|
5033
5259
|
if (n === !1) return;
|
|
5034
5260
|
if (!e || e.length === 0) return e;
|
|
5035
5261
|
let r = Array(e.length);
|
|
5036
5262
|
for (let n = 0; n < e.length; n++) r[n] = e[n] * t;
|
|
5037
5263
|
return r;
|
|
5038
5264
|
}
|
|
5039
|
-
function
|
|
5265
|
+
function wr(e, t, n, r, i, a) {
|
|
5040
5266
|
if (!e) return;
|
|
5041
5267
|
let [o, s, c, l, u, d] = e;
|
|
5042
5268
|
return [
|
|
@@ -5050,21 +5276,39 @@ function cr(e, t, n, r, i, a) {
|
|
|
5050
5276
|
}
|
|
5051
5277
|
//#endregion
|
|
5052
5278
|
//#region src/render/SvgRenderer.ts
|
|
5053
|
-
function
|
|
5279
|
+
function Z(e) {
|
|
5054
5280
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
5055
5281
|
}
|
|
5056
|
-
function
|
|
5057
|
-
return t === void 0 ? "" : ` ${e}="${typeof t == "string" ?
|
|
5282
|
+
function Q(e, t) {
|
|
5283
|
+
return t === void 0 ? "" : ` ${e}="${typeof t == "string" ? Z(t) : t}"`;
|
|
5058
5284
|
}
|
|
5059
|
-
function
|
|
5285
|
+
function Tr(e) {
|
|
5060
5286
|
return !e || e.length === 0 ? "" : ` stroke-dasharray="${e.join(" ")}"`;
|
|
5061
5287
|
}
|
|
5062
|
-
|
|
5288
|
+
var Er = 0;
|
|
5289
|
+
function Dr() {
|
|
5290
|
+
return `mmr-grad-${++Er}`;
|
|
5291
|
+
}
|
|
5292
|
+
function Or(e, t) {
|
|
5293
|
+
let n = t.stops.map((e) => `<stop offset="${e.offset}" stop-color="${Z(e.color)}"/>`).join("");
|
|
5294
|
+
return `<defs><linearGradient id="${e}" gradientUnits="userSpaceOnUse" x1="${t.x0}" y1="${t.y0}" x2="${t.x1}" y2="${t.y1}">${n}</linearGradient></defs>`;
|
|
5295
|
+
}
|
|
5296
|
+
function kr(e, t) {
|
|
5297
|
+
let n = t.stops.map((e) => `<stop offset="${e.offset}" stop-color="${Z(e.color)}"/>`).join(""), r = (t.fx === void 0 ? "" : ` fx="${t.fx}"`) + (t.fy === void 0 ? "" : ` fy="${t.fy}"`) + (t.fr === void 0 ? "" : ` fr="${t.fr}"`);
|
|
5298
|
+
return `<defs><radialGradient id="${e}" gradientUnits="userSpaceOnUse" cx="${t.cx}" cy="${t.cy}" r="${t.r}"${r}>${n}</radialGradient></defs>`;
|
|
5299
|
+
}
|
|
5300
|
+
function Ar(e, t) {
|
|
5301
|
+
if (e === void 0) return;
|
|
5302
|
+
if (typeof e == "string") return e;
|
|
5303
|
+
let n = Dr();
|
|
5304
|
+
return t.push(e.type === "linear" ? Or(n, e) : kr(n, e)), `url(#${n})`;
|
|
5305
|
+
}
|
|
5306
|
+
function jr(e) {
|
|
5063
5307
|
let t = [];
|
|
5064
|
-
for (let n of e)
|
|
5308
|
+
for (let n of e) Mr(n.commands, t);
|
|
5065
5309
|
return t;
|
|
5066
5310
|
}
|
|
5067
|
-
function
|
|
5311
|
+
function Mr(e, t) {
|
|
5068
5312
|
let n = [];
|
|
5069
5313
|
for (let r of e) switch (r.type) {
|
|
5070
5314
|
case "pushTransform": {
|
|
@@ -5081,66 +5325,72 @@ function fr(e, t) {
|
|
|
5081
5325
|
e && t.push(e);
|
|
5082
5326
|
break;
|
|
5083
5327
|
}
|
|
5084
|
-
default:
|
|
5085
|
-
|
|
5086
|
-
e && t.push(e);
|
|
5328
|
+
default:
|
|
5329
|
+
Nr(r, t);
|
|
5087
5330
|
break;
|
|
5088
|
-
}
|
|
5089
5331
|
}
|
|
5090
5332
|
for (; n.length > 0;) t.push(n.pop());
|
|
5091
5333
|
}
|
|
5092
|
-
function
|
|
5334
|
+
function Nr(e, t) {
|
|
5093
5335
|
switch (e.type) {
|
|
5094
5336
|
case "rect": {
|
|
5095
|
-
let
|
|
5096
|
-
|
|
5337
|
+
let n = Ar(e.fill, t) ?? "none", r = e.cr > 0 ? `${Q("rx", e.cr)}${Q("ry", e.cr)}` : "";
|
|
5338
|
+
t.push(`<rect${Q("x", e.x)}${Q("y", e.y)}${Q("width", e.w)}${Q("height", e.h)}${Q("fill", n)}${Q("stroke", e.stroke)}${e.sw ? Q("stroke-width", e.sw) : ""}${r}${Tr(e.dash)}/>`);
|
|
5339
|
+
return;
|
|
5097
5340
|
}
|
|
5098
5341
|
case "circle": {
|
|
5099
|
-
let
|
|
5100
|
-
|
|
5342
|
+
let n = Ar(e.fill, t) ?? "none";
|
|
5343
|
+
t.push(`<circle${Q("cx", e.cx)}${Q("cy", e.cy)}${Q("r", e.r)}${Q("fill", n)}${Q("stroke", e.stroke)}${e.sw ? Q("stroke-width", e.sw) : ""}${Tr(e.dash)}/>`);
|
|
5344
|
+
return;
|
|
5101
5345
|
}
|
|
5102
5346
|
case "line": {
|
|
5103
|
-
let
|
|
5104
|
-
if (
|
|
5105
|
-
let
|
|
5106
|
-
for (let e = 0; e <
|
|
5107
|
-
|
|
5347
|
+
let n = e.points;
|
|
5348
|
+
if (n.length < 2) return;
|
|
5349
|
+
let r = [];
|
|
5350
|
+
for (let e = 0; e < n.length; e += 2) r.push(`${n[e]},${n[e + 1]}`);
|
|
5351
|
+
t.push(`<polyline points="${r.join(" ")}"${Q("stroke", e.stroke)}${e.sw ? Q("stroke-width", e.sw) : ""}${Tr(e.dash)}${Q("stroke-linecap", e.lineCap)}${Q("stroke-linejoin", e.lineJoin)}${Q("opacity", e.alpha)} fill="none"/>`);
|
|
5352
|
+
return;
|
|
5108
5353
|
}
|
|
5109
5354
|
case "polygon": {
|
|
5110
|
-
let
|
|
5111
|
-
if (
|
|
5112
|
-
let
|
|
5113
|
-
for (let e = 0; e <
|
|
5114
|
-
|
|
5355
|
+
let n = e.vertices;
|
|
5356
|
+
if (n.length < 4) return;
|
|
5357
|
+
let r = [];
|
|
5358
|
+
for (let e = 0; e < n.length; e += 2) r.push(`${n[e]},${n[e + 1]}`);
|
|
5359
|
+
let i = Ar(e.fill, t);
|
|
5360
|
+
t.push(`<polygon points="${r.join(" ")}"${Q("fill", i)}${Q("stroke", e.stroke)}${e.sw ? Q("stroke-width", e.sw) : ""}/>`);
|
|
5361
|
+
return;
|
|
5115
5362
|
}
|
|
5116
5363
|
case "text": {
|
|
5117
|
-
let
|
|
5118
|
-
e.w > 0 && (e.align === "center" ? (
|
|
5119
|
-
let
|
|
5120
|
-
|
|
5364
|
+
let n = e.x, r = e.y, i = "start", a = "auto";
|
|
5365
|
+
e.w > 0 && (e.align === "center" ? (n = e.x + e.w / 2, i = "middle") : e.align === "right" && (n = e.x + e.w, i = "end")), e.h > 0 && e.vAlign === "middle" && (e.baselineRatio === void 0 ? (r = e.y + e.h / 2, a = "central") : r = e.y + e.h / 2 + e.baselineRatio * e.fontSize);
|
|
5366
|
+
let o = e.transform ? ` transform="matrix(${e.transform.join(",")})"` : "", s = e.fontStyle === "bold" ? " font-weight=\"bold\"" : "", c = e.stroke && e.sw > 0 ? ` stroke="${e.stroke}" stroke-width="${e.sw}" paint-order="stroke fill"` : "";
|
|
5367
|
+
t.push(`<text${Q("x", n)}${Q("y", r)}${Q("font-size", e.fontSize)}${e.fontFamily ? Q("font-family", e.fontFamily) : ""}${s}${Q("fill", e.fill)}${c} text-anchor="${i}" dominant-baseline="${a}"${o}>${Z(e.text)}</text>`);
|
|
5368
|
+
return;
|
|
5121
5369
|
}
|
|
5122
5370
|
case "image":
|
|
5123
5371
|
if (e.transform) {
|
|
5124
|
-
let [
|
|
5125
|
-
|
|
5372
|
+
let [n, r, i, a, o, s] = e.transform;
|
|
5373
|
+
t.push(`<image${Q("width", e.w)}${Q("height", e.h)} href="${Z(e.src)}" transform="matrix(${n},${r},${i},${a},${o},${s})"/>`);
|
|
5374
|
+
return;
|
|
5126
5375
|
}
|
|
5127
|
-
|
|
5376
|
+
t.push(`<image${Q("x", e.x)}${Q("y", e.y)}${Q("width", e.w)}${Q("height", e.h)} href="${Z(e.src)}"/>`);
|
|
5377
|
+
return;
|
|
5128
5378
|
}
|
|
5129
5379
|
}
|
|
5130
5380
|
//#endregion
|
|
5131
5381
|
//#region src/render/CanvasRenderer.ts
|
|
5132
|
-
var
|
|
5382
|
+
var Pr = (e) => {
|
|
5133
5383
|
if (typeof Image < "u") {
|
|
5134
5384
|
let t = new Image();
|
|
5135
5385
|
return t.src = e, t;
|
|
5136
5386
|
}
|
|
5137
5387
|
return null;
|
|
5138
5388
|
};
|
|
5139
|
-
function
|
|
5140
|
-
let r = n.imageFactory ??
|
|
5141
|
-
for (let n of t)
|
|
5389
|
+
function Fr(e, t, n = {}) {
|
|
5390
|
+
let r = n.imageFactory ?? Pr;
|
|
5391
|
+
for (let n of t) Ir(e, n.commands, r);
|
|
5142
5392
|
}
|
|
5143
|
-
function
|
|
5393
|
+
function Ir(e, t, n) {
|
|
5144
5394
|
let r = 0;
|
|
5145
5395
|
for (let i of t) switch (i.type) {
|
|
5146
5396
|
case "pushTransform":
|
|
@@ -5154,18 +5404,18 @@ function gr(e, t, n) {
|
|
|
5154
5404
|
r > 0 && (e.restore(), r--);
|
|
5155
5405
|
break;
|
|
5156
5406
|
default:
|
|
5157
|
-
|
|
5407
|
+
Lr(e, i, n);
|
|
5158
5408
|
break;
|
|
5159
5409
|
}
|
|
5160
5410
|
for (; r > 0;) e.restore(), r--;
|
|
5161
5411
|
}
|
|
5162
|
-
function
|
|
5412
|
+
function Lr(e, t, n) {
|
|
5163
5413
|
switch (t.type) {
|
|
5164
5414
|
case "rect":
|
|
5165
|
-
e.beginPath(), t.cr > 0 && typeof e.roundRect == "function" ? e.roundRect(t.x, t.y, t.w, t.h, t.cr) : e.rect(t.x, t.y, t.w, t.h), t.fill && (e.fillStyle = t.fill, e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash(t.dash ?? []), e.stroke());
|
|
5415
|
+
e.beginPath(), t.cr > 0 && typeof e.roundRect == "function" ? e.roundRect(t.x, t.y, t.w, t.h, t.cr) : e.rect(t.x, t.y, t.w, t.h), t.fill && (e.fillStyle = z(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash(t.dash ?? []), e.stroke());
|
|
5166
5416
|
break;
|
|
5167
5417
|
case "circle":
|
|
5168
|
-
e.beginPath(), e.arc(t.cx, t.cy, t.r, 0, Math.PI * 2), t.fill && (e.fillStyle = t.fill, e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash(t.dash ?? []), e.stroke());
|
|
5418
|
+
e.beginPath(), e.arc(t.cx, t.cy, t.r, 0, Math.PI * 2), t.fill && (e.fillStyle = z(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash(t.dash ?? []), e.stroke());
|
|
5169
5419
|
break;
|
|
5170
5420
|
case "line": {
|
|
5171
5421
|
if (t.points.length < 4) break;
|
|
@@ -5179,7 +5429,7 @@ function _r(e, t, n) {
|
|
|
5179
5429
|
if (t.vertices.length < 4) break;
|
|
5180
5430
|
e.beginPath(), e.moveTo(t.vertices[0], t.vertices[1]);
|
|
5181
5431
|
for (let n = 2; n < t.vertices.length; n += 2) e.lineTo(t.vertices[n], t.vertices[n + 1]);
|
|
5182
|
-
e.closePath(), t.fill && (e.fillStyle = t.fill, e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash([]), e.stroke());
|
|
5432
|
+
e.closePath(), t.fill && (e.fillStyle = z(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash([]), e.stroke());
|
|
5183
5433
|
break;
|
|
5184
5434
|
case "text": {
|
|
5185
5435
|
let n = t.fontSize * 100, r = `${t.fontStyle} ${n}px ${t.fontFamily}`;
|
|
@@ -5220,35 +5470,35 @@ function _r(e, t, n) {
|
|
|
5220
5470
|
}
|
|
5221
5471
|
//#endregion
|
|
5222
5472
|
//#region src/export/flushSceneShapes.ts
|
|
5223
|
-
function
|
|
5224
|
-
n(e.grid), n(e.link), n(e.room), n(
|
|
5473
|
+
function Rr(e, t, n) {
|
|
5474
|
+
n(e.grid), n(e.link), n(e.room), n(zr(t.state, t.overlays));
|
|
5225
5475
|
for (let e of t.sceneOverlays) {
|
|
5226
5476
|
let r = e.render(t.state, t.viewportBounds);
|
|
5227
5477
|
r && n(Array.isArray(r) ? r : [r]);
|
|
5228
5478
|
}
|
|
5229
5479
|
n(e.topLabel);
|
|
5230
5480
|
}
|
|
5231
|
-
function
|
|
5481
|
+
function zr(e, t) {
|
|
5232
5482
|
let n = e.getOverlaysForArea(t);
|
|
5233
5483
|
if (!n) return [];
|
|
5234
5484
|
let r = e.settings, i = [];
|
|
5235
5485
|
if (n.paths) for (let t of n.paths) {
|
|
5236
|
-
let n =
|
|
5237
|
-
i.push(...
|
|
5486
|
+
let n = pt(e.mapReader, r, t.locations, t.color, e.currentArea, e.currentZIndex);
|
|
5487
|
+
i.push(...yt(n));
|
|
5238
5488
|
}
|
|
5239
5489
|
if (n.highlights) for (let t of n.highlights) {
|
|
5240
5490
|
let n = e.mapReader.getRoom(t.roomId);
|
|
5241
|
-
n && i.push(
|
|
5491
|
+
n && i.push(mt(dt(n, t.color, r)));
|
|
5242
5492
|
}
|
|
5243
5493
|
if (n.position) {
|
|
5244
5494
|
let t = e.mapReader.getRoom(n.position.roomId);
|
|
5245
|
-
t && i.push(
|
|
5495
|
+
t && i.push(vt(ft(t, r)));
|
|
5246
5496
|
}
|
|
5247
5497
|
return i;
|
|
5248
5498
|
}
|
|
5249
5499
|
//#endregion
|
|
5250
5500
|
//#region src/export/sceneBounds.ts
|
|
5251
|
-
function
|
|
5501
|
+
function Br(e, t, n = 0) {
|
|
5252
5502
|
if (!t.worldToScene) return e;
|
|
5253
5503
|
let r = [
|
|
5254
5504
|
t.worldToScene(e.x, e.y),
|
|
@@ -5266,15 +5516,15 @@ function br(e, t, n = 0) {
|
|
|
5266
5516
|
}
|
|
5267
5517
|
//#endregion
|
|
5268
5518
|
//#region src/export/SvgExporter.ts
|
|
5269
|
-
var
|
|
5519
|
+
var Vr = {
|
|
5270
5520
|
scale: 1,
|
|
5271
5521
|
offsetX: 0,
|
|
5272
5522
|
offsetY: 0
|
|
5273
5523
|
};
|
|
5274
|
-
function
|
|
5524
|
+
function Hr(e) {
|
|
5275
5525
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
5276
5526
|
}
|
|
5277
|
-
var
|
|
5527
|
+
var Ur = class {
|
|
5278
5528
|
constructor(e = {}) {
|
|
5279
5529
|
this.options = e;
|
|
5280
5530
|
}
|
|
@@ -5283,30 +5533,30 @@ var Cr = class {
|
|
|
5283
5533
|
if (r === void 0 || i === void 0 || !a) return;
|
|
5284
5534
|
let o = a, s = o.getPlane(i);
|
|
5285
5535
|
if (!s) return;
|
|
5286
|
-
let c = e.settings, l = this.options.padding ?? 3, u = e.computeExportBounds(o, s, this.options.roomId, l), d = D.forMapBounds(u.x, u.x + u.w, u.y, u.y + u.h).getViewportBounds(), f =
|
|
5536
|
+
let c = e.settings, l = this.options.padding ?? 3, u = e.computeExportBounds(o, s, this.options.roomId, l), d = D.forMapBounds(u.x, u.x + u.w, u.y, u.y + u.h).getViewportBounds(), f = Be(new R(e.mapReader, c).buildScene(o, s, i, e.lens), d, c, {
|
|
5287
5537
|
forward: t.worldToScene ? (e, n) => t.worldToScene(e, n) : void 0,
|
|
5288
5538
|
inverse: t.sceneToWorld ? (e, n) => t.sceneToWorld(e, n) : void 0
|
|
5289
5539
|
}), p = {
|
|
5290
5540
|
scale: 1,
|
|
5291
5541
|
roomSize: c.roomSize
|
|
5292
|
-
}, m = (e) => t === W ? e :
|
|
5293
|
-
return g.push(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${h.x} ${h.y} ${h.w} ${h.h}">`), g.push(`<rect x="${h.x}" y="${h.y}" width="${h.w}" height="${h.h}" fill="${
|
|
5542
|
+
}, m = (e) => t === W ? e : Pt(e, t, p), h = Br(u, t, c.roomSize * .5), g = [];
|
|
5543
|
+
return g.push(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${h.x} ${h.y} ${h.w} ${h.h}">`), g.push(`<rect x="${h.x}" y="${h.y}" width="${h.w}" height="${h.h}" fill="${Hr(c.backgroundColor)}"/>`), Rr(f, {
|
|
5294
5544
|
state: e,
|
|
5295
5545
|
viewportBounds: d,
|
|
5296
5546
|
sceneOverlays: n,
|
|
5297
5547
|
overlays: this.options.overlays
|
|
5298
5548
|
}, (e) => {
|
|
5299
|
-
e.length !== 0 && g.push(...
|
|
5549
|
+
e.length !== 0 && g.push(...jr(xr(m(e), Vr)));
|
|
5300
5550
|
}), g.push("</svg>"), g.join("\n");
|
|
5301
5551
|
}
|
|
5302
|
-
},
|
|
5552
|
+
}, Wr = class {
|
|
5303
5553
|
constructor(e = {}) {
|
|
5304
5554
|
this.options = e;
|
|
5305
5555
|
}
|
|
5306
5556
|
render({ backend: e }) {
|
|
5307
5557
|
return e.exportCanvas(this.options)?.toDataURL("image/png");
|
|
5308
5558
|
}
|
|
5309
|
-
},
|
|
5559
|
+
}, Gr = class {
|
|
5310
5560
|
constructor(e = {}) {
|
|
5311
5561
|
this.options = e;
|
|
5312
5562
|
}
|
|
@@ -5323,14 +5573,14 @@ var Cr = class {
|
|
|
5323
5573
|
};
|
|
5324
5574
|
//#endregion
|
|
5325
5575
|
//#region src/export/canvasToBytes.ts
|
|
5326
|
-
function
|
|
5576
|
+
function Kr(e, t = "image/png", n) {
|
|
5327
5577
|
let r = e.toDataURL(t, n), i = r.indexOf(","), a = i >= 0 ? r.slice(i + 1) : r, o = atob(a), s = new Uint8Array(o.length);
|
|
5328
5578
|
for (let e = 0; e < o.length; e++) s[e] = o.charCodeAt(e);
|
|
5329
5579
|
return s;
|
|
5330
5580
|
}
|
|
5331
5581
|
//#endregion
|
|
5332
5582
|
//#region src/export/CanvasExporter.ts
|
|
5333
|
-
var
|
|
5583
|
+
var qr = class {
|
|
5334
5584
|
constructor(e) {
|
|
5335
5585
|
this.options = e;
|
|
5336
5586
|
}
|
|
@@ -5339,14 +5589,14 @@ var Dr = class {
|
|
|
5339
5589
|
if (i === void 0 || a === void 0 || !o) return;
|
|
5340
5590
|
let s = o, c = s.getPlane(a);
|
|
5341
5591
|
if (!c) return;
|
|
5342
|
-
let l = e.settings, { width: u, height: d } = this.options, f = this.options.padding ?? 3, p = e.computeExportBounds(s, c, this.options.roomId, f), m =
|
|
5592
|
+
let l = e.settings, { width: u, height: d } = this.options, f = this.options.padding ?? 3, p = e.computeExportBounds(s, c, this.options.roomId, f), m = Br(p, t, l.roomSize * .5), h = Math.min(u / m.w, d / m.h), g = m.w * h, _ = m.h * h, v = (u - g) / 2 - m.x * h, y = (d - _) / 2 - m.y * h, b = {
|
|
5343
5593
|
scale: h,
|
|
5344
5594
|
offsetX: v,
|
|
5345
5595
|
offsetY: y
|
|
5346
5596
|
}, x = D.forRenderCamera(u, d, h, v, y), S = {
|
|
5347
5597
|
forward: t.worldToScene ? (e, n) => t.worldToScene(e, n) : void 0,
|
|
5348
5598
|
inverse: t.sceneToWorld ? (e, n) => t.sceneToWorld(e, n) : void 0
|
|
5349
|
-
}, C =
|
|
5599
|
+
}, C = Be(new R(e.mapReader, l).buildScene(s, c, a, e.lens), x.getViewportBounds(), l, S), w = r.Util.createCanvasElement();
|
|
5350
5600
|
w.width = u, w.height = d;
|
|
5351
5601
|
let T = w.getContext("2d");
|
|
5352
5602
|
if (!T) return;
|
|
@@ -5354,56 +5604,56 @@ var Dr = class {
|
|
|
5354
5604
|
let E = {
|
|
5355
5605
|
scale: h,
|
|
5356
5606
|
roomSize: l.roomSize
|
|
5357
|
-
}, O = (e) => t === W ? e :
|
|
5358
|
-
return
|
|
5607
|
+
}, O = (e) => t === W ? e : Pt(e, t, E);
|
|
5608
|
+
return Rr(C, {
|
|
5359
5609
|
state: e,
|
|
5360
5610
|
viewportBounds: D.forMapBounds(p.x, p.x + p.w, p.y, p.y + p.h).getViewportBounds(),
|
|
5361
5611
|
sceneOverlays: n,
|
|
5362
5612
|
overlays: this.options.overlays
|
|
5363
5613
|
}, (e) => {
|
|
5364
|
-
e.length !== 0 &&
|
|
5614
|
+
e.length !== 0 && Fr(T, xr(O(e), b));
|
|
5365
5615
|
}), w;
|
|
5366
5616
|
}
|
|
5367
|
-
},
|
|
5617
|
+
}, Jr = class {
|
|
5368
5618
|
constructor(e) {
|
|
5369
|
-
this.options = e, this.canvasExporter = new
|
|
5619
|
+
this.options = e, this.canvasExporter = new qr(e);
|
|
5370
5620
|
}
|
|
5371
5621
|
render(e) {
|
|
5372
5622
|
let t = this.canvasExporter.render(e);
|
|
5373
|
-
if (t) return
|
|
5623
|
+
if (t) return Kr(t, this.options.mimeType, this.options.quality);
|
|
5374
5624
|
}
|
|
5375
|
-
},
|
|
5376
|
-
function
|
|
5625
|
+
}, $, Yr, Xr = 256;
|
|
5626
|
+
function Zr(e, t, n) {
|
|
5377
5627
|
let r = `${e.toFixed(2)}:${t}:${n.toFixed(3)}`;
|
|
5378
|
-
if (
|
|
5379
|
-
let i =
|
|
5628
|
+
if (Yr === r && $) return $;
|
|
5629
|
+
let i = Xr, a = i / 2, o = document.createElement("canvas");
|
|
5380
5630
|
o.width = i, o.height = i;
|
|
5381
5631
|
let s = o.getContext("2d");
|
|
5382
5632
|
s.fillStyle = `rgba(0, 0, 0, ${e})`, s.fillRect(0, 0, i, i), s.globalCompositeOperation = "destination-out";
|
|
5383
5633
|
let c = s.createRadialGradient(a, a, 0, a, a, a), l = Math.min(n, .99);
|
|
5384
5634
|
c.addColorStop(0, "rgba(0, 0, 0, 1)"), c.addColorStop(l * .25, "rgba(0, 0, 0, 0.97)"), c.addColorStop(l * .5, "rgba(0, 0, 0, 0.82)"), c.addColorStop(l * .7, "rgba(0, 0, 0, 0.50)"), c.addColorStop(l * .85, "rgba(0, 0, 0, 0.22)"), c.addColorStop(l * .95, "rgba(0, 0, 0, 0.06)"), c.addColorStop(l, "rgba(0, 0, 0, 0)"), l < .98 && c.addColorStop(1, "rgba(0, 0, 0, 0)"), s.fillStyle = c, s.beginPath(), s.arc(a, a, a, 0, Math.PI * 2), s.fill(), s.globalCompositeOperation = "source-over";
|
|
5385
5635
|
let u = parseInt(t.slice(1, 3), 16), d = parseInt(t.slice(3, 5), 16), f = parseInt(t.slice(5, 7), 16), p = s.createRadialGradient(a, a, 0, a, a, a * l);
|
|
5386
|
-
return p.addColorStop(0, `rgba(${u}, ${d}, ${f}, 0.05)`), p.addColorStop(1, `rgba(${u}, ${d}, ${f}, 0)`), s.fillStyle = p, s.fillRect(0, 0, i, i),
|
|
5636
|
+
return p.addColorStop(0, `rgba(${u}, ${d}, ${f}, 0.05)`), p.addColorStop(1, `rgba(${u}, ${d}, ${f}, 0)`), s.fillStyle = p, s.fillRect(0, 0, i, i), $ = o.toDataURL(), Yr = r, $;
|
|
5387
5637
|
}
|
|
5388
|
-
function
|
|
5638
|
+
function Qr(e, t, n, r) {
|
|
5389
5639
|
let { radius: i, intensity: a, color: o } = r, s = n.maxX - n.minX, c = n.maxY - n.minY, l = Math.sqrt(s * s + c * c), u = Math.max(l * 2.5, i * 4);
|
|
5390
5640
|
return {
|
|
5391
5641
|
cx: e,
|
|
5392
5642
|
cy: t,
|
|
5393
5643
|
displaySize: u,
|
|
5394
|
-
src:
|
|
5644
|
+
src: Zr(a, o, Math.round(i / (u / 2) * 50) / 50)
|
|
5395
5645
|
};
|
|
5396
5646
|
}
|
|
5397
5647
|
//#endregion
|
|
5398
5648
|
//#region src/overlay/AmbientLightOverlay.ts
|
|
5399
|
-
var
|
|
5649
|
+
var $r = {
|
|
5400
5650
|
color: "#ffcc44",
|
|
5401
5651
|
radius: 12,
|
|
5402
5652
|
intensity: .7
|
|
5403
|
-
},
|
|
5653
|
+
}, ei = class {
|
|
5404
5654
|
constructor(e) {
|
|
5405
5655
|
this.onPosition = () => this.ctx?.invalidate(), this.params = {
|
|
5406
|
-
|
|
5656
|
+
...$r,
|
|
5407
5657
|
...e
|
|
5408
5658
|
};
|
|
5409
5659
|
}
|
|
@@ -5426,7 +5676,7 @@ var Pr = {
|
|
|
5426
5676
|
if (e.positionRoomId === void 0) return;
|
|
5427
5677
|
let n = e.mapReader.getRoom(e.positionRoomId);
|
|
5428
5678
|
if (!n) return;
|
|
5429
|
-
let r =
|
|
5679
|
+
let r = Qr(n.x, n.y, t, this.params);
|
|
5430
5680
|
return {
|
|
5431
5681
|
type: "image",
|
|
5432
5682
|
x: r.cx - r.displaySize / 2,
|
|
@@ -5437,7 +5687,7 @@ var Pr = {
|
|
|
5437
5687
|
layer: "overlay"
|
|
5438
5688
|
};
|
|
5439
5689
|
}
|
|
5440
|
-
},
|
|
5690
|
+
}, ti = /* @__PURE__ */ u(((e, t) => {
|
|
5441
5691
|
t.exports = class {
|
|
5442
5692
|
constructor() {
|
|
5443
5693
|
this.keys = /* @__PURE__ */ new Set(), this.queue = [];
|
|
@@ -5467,14 +5717,14 @@ var Pr = {
|
|
|
5467
5717
|
return this.queue.find((t) => t.key === e);
|
|
5468
5718
|
}
|
|
5469
5719
|
};
|
|
5470
|
-
})),
|
|
5720
|
+
})), ni = /* @__PURE__ */ u(((e, t) => {
|
|
5471
5721
|
function n(e, t) {
|
|
5472
5722
|
let r = /* @__PURE__ */ new Map();
|
|
5473
5723
|
for (let [i, a] of e) i !== t && a instanceof Map ? r.set(i, n(a, t)) : i !== t && r.set(i, a);
|
|
5474
5724
|
return r;
|
|
5475
5725
|
}
|
|
5476
5726
|
t.exports = n;
|
|
5477
|
-
})),
|
|
5727
|
+
})), ri = /* @__PURE__ */ u(((e, t) => {
|
|
5478
5728
|
function n(e) {
|
|
5479
5729
|
let t = Number(e);
|
|
5480
5730
|
return !(isNaN(t) || t <= 0);
|
|
@@ -5489,7 +5739,7 @@ var Pr = {
|
|
|
5489
5739
|
}), t;
|
|
5490
5740
|
}
|
|
5491
5741
|
t.exports = r;
|
|
5492
|
-
})),
|
|
5742
|
+
})), ii = /* @__PURE__ */ u(((e, t) => {
|
|
5493
5743
|
function n(e) {
|
|
5494
5744
|
if (!(e instanceof Map)) throw Error(`Invalid graph: Expected Map instead found ${typeof e}`);
|
|
5495
5745
|
e.forEach((e, t) => {
|
|
@@ -5501,8 +5751,8 @@ var Pr = {
|
|
|
5501
5751
|
});
|
|
5502
5752
|
}
|
|
5503
5753
|
t.exports = n;
|
|
5504
|
-
})),
|
|
5505
|
-
var n =
|
|
5754
|
+
})), ai = /* @__PURE__ */ f((/* @__PURE__ */ u(((e, t) => {
|
|
5755
|
+
var n = ti(), r = ni(), i = ri(), a = ii();
|
|
5506
5756
|
t.exports = class {
|
|
5507
5757
|
constructor(e) {
|
|
5508
5758
|
e instanceof Map ? (a(e), this.graph = e) : e ? this.graph = i(e) : this.graph = /* @__PURE__ */ new Map();
|
|
@@ -5552,7 +5802,7 @@ var Pr = {
|
|
|
5552
5802
|
return this.path(...e);
|
|
5553
5803
|
}
|
|
5554
5804
|
};
|
|
5555
|
-
})))(), 1),
|
|
5805
|
+
})))(), 1), oi = {
|
|
5556
5806
|
1: "north",
|
|
5557
5807
|
2: "northeast",
|
|
5558
5808
|
3: "northwest",
|
|
@@ -5565,7 +5815,7 @@ var Pr = {
|
|
|
5565
5815
|
10: "down",
|
|
5566
5816
|
11: "in",
|
|
5567
5817
|
12: "out"
|
|
5568
|
-
},
|
|
5818
|
+
}, si = {
|
|
5569
5819
|
north: "n",
|
|
5570
5820
|
northeast: "ne",
|
|
5571
5821
|
northwest: "nw",
|
|
@@ -5578,7 +5828,7 @@ var Pr = {
|
|
|
5578
5828
|
down: "down",
|
|
5579
5829
|
in: "in",
|
|
5580
5830
|
out: "out"
|
|
5581
|
-
},
|
|
5831
|
+
}, ci = class {
|
|
5582
5832
|
constructor(e) {
|
|
5583
5833
|
this.mapReader = e, this.data = this.buildGraph();
|
|
5584
5834
|
}
|
|
@@ -5604,12 +5854,12 @@ var Pr = {
|
|
|
5604
5854
|
buildGraph() {
|
|
5605
5855
|
let e = /* @__PURE__ */ new Map(), t = {}, n = 1, r = Infinity;
|
|
5606
5856
|
return this.mapReader.getRooms().forEach((i) => {
|
|
5607
|
-
let a = [], o = {}, s = new Set((i.exitLocks ?? []).map((e) =>
|
|
5857
|
+
let a = [], o = {}, s = new Set((i.exitLocks ?? []).map((e) => oi[e]).filter((e) => !!e)), c = new Set(i.mSpecialExitLocks ?? []);
|
|
5608
5858
|
Object.entries(i.exits ?? {}).forEach(([e, t]) => {
|
|
5609
5859
|
if (s.has(e)) return;
|
|
5610
5860
|
let c = this.mapReader.getRoom(t);
|
|
5611
5861
|
if (c) {
|
|
5612
|
-
let s =
|
|
5862
|
+
let s = si[e] ?? e, l = this.resolveEdgeWeight(i, s, c);
|
|
5613
5863
|
a.push({
|
|
5614
5864
|
id: t,
|
|
5615
5865
|
weight: l
|
|
@@ -5640,7 +5890,7 @@ var Pr = {
|
|
|
5640
5890
|
};
|
|
5641
5891
|
//#endregion
|
|
5642
5892
|
//#region src/PathFinder.ts
|
|
5643
|
-
function
|
|
5893
|
+
function li(e, t) {
|
|
5644
5894
|
e.push(t);
|
|
5645
5895
|
let n = e.length - 1;
|
|
5646
5896
|
for (; n > 0;) {
|
|
@@ -5649,7 +5899,7 @@ function Wr(e, t) {
|
|
|
5649
5899
|
[e[t], e[n]] = [e[n], e[t]], n = t;
|
|
5650
5900
|
}
|
|
5651
5901
|
}
|
|
5652
|
-
function
|
|
5902
|
+
function ui(e) {
|
|
5653
5903
|
if (e.length === 0) return;
|
|
5654
5904
|
let t = e[0], n = e.pop();
|
|
5655
5905
|
if (e.length > 0) {
|
|
@@ -5663,16 +5913,16 @@ function Gr(e) {
|
|
|
5663
5913
|
}
|
|
5664
5914
|
return t;
|
|
5665
5915
|
}
|
|
5666
|
-
function
|
|
5916
|
+
function di(e, t, n) {
|
|
5667
5917
|
let r = [n], i = n;
|
|
5668
5918
|
for (; i !== t;) i = e.get(i), r.push(i);
|
|
5669
5919
|
return r.reverse(), r;
|
|
5670
5920
|
}
|
|
5671
|
-
function
|
|
5921
|
+
function fi(e, t, n) {
|
|
5672
5922
|
let r = e.path(t.toString(), n.toString()), i = Array.isArray(r) ? r : r?.path;
|
|
5673
5923
|
return i ? i.map((e) => Number(e)) : null;
|
|
5674
5924
|
}
|
|
5675
|
-
function
|
|
5925
|
+
function pi(e, t, n, r) {
|
|
5676
5926
|
let i = r.getRoom(n);
|
|
5677
5927
|
if (!i) return null;
|
|
5678
5928
|
let a = i.x, o = i.y, s = i.z, c = r.getMaxEdgeDistance(), l = r.getMinEdgeWeight(), u = (e) => {
|
|
@@ -5681,16 +5931,16 @@ function Jr(e, t, n, r) {
|
|
|
5681
5931
|
let n = t.x - a, i = t.y - o, u = t.z - s;
|
|
5682
5932
|
return Math.sqrt(n * n + i * i + u * u) / c * l;
|
|
5683
5933
|
}, d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), p = [];
|
|
5684
|
-
for (d.set(t, 0),
|
|
5934
|
+
for (d.set(t, 0), li(p, {
|
|
5685
5935
|
id: t,
|
|
5686
5936
|
priority: u(t)
|
|
5687
5937
|
}); p.length > 0;) {
|
|
5688
|
-
let { id: r } =
|
|
5689
|
-
if (r === n) return
|
|
5938
|
+
let { id: r } = ui(p);
|
|
5939
|
+
if (r === n) return di(f, t, n);
|
|
5690
5940
|
let i = d.get(r) ?? Infinity, a = e.get(r);
|
|
5691
5941
|
if (a) for (let e of a) {
|
|
5692
5942
|
let t = i + e.weight;
|
|
5693
|
-
t < (d.get(e.id) ?? Infinity) && (d.set(e.id, t), f.set(e.id, r),
|
|
5943
|
+
t < (d.get(e.id) ?? Infinity) && (d.set(e.id, t), f.set(e.id, r), li(p, {
|
|
5694
5944
|
id: e.id,
|
|
5695
5945
|
priority: t + u(e.id)
|
|
5696
5946
|
}));
|
|
@@ -5698,9 +5948,9 @@ function Jr(e, t, n, r) {
|
|
|
5698
5948
|
}
|
|
5699
5949
|
return null;
|
|
5700
5950
|
}
|
|
5701
|
-
var
|
|
5951
|
+
var mi = class {
|
|
5702
5952
|
constructor(e, t = "dijkstra") {
|
|
5703
|
-
this.cache = /* @__PURE__ */ new Map(), this._algorithm = t, this.mapGraph = new
|
|
5953
|
+
this.cache = /* @__PURE__ */ new Map(), this._algorithm = t, this.mapGraph = new ci(e), this.dijkstraGraph = new ai.default(this.mapGraph.getGraphDefinition());
|
|
5704
5954
|
}
|
|
5705
5955
|
get algorithm() {
|
|
5706
5956
|
return this._algorithm;
|
|
@@ -5719,23 +5969,23 @@ var Yr = class {
|
|
|
5719
5969
|
let r;
|
|
5720
5970
|
switch (this._algorithm) {
|
|
5721
5971
|
case "dijkstra":
|
|
5722
|
-
r =
|
|
5972
|
+
r = fi(this.dijkstraGraph, e, t);
|
|
5723
5973
|
break;
|
|
5724
5974
|
case "astar":
|
|
5725
|
-
r =
|
|
5975
|
+
r = pi(this.mapGraph.getAdj(), e, t, this.mapGraph);
|
|
5726
5976
|
break;
|
|
5727
5977
|
}
|
|
5728
5978
|
return this.cache.set(n, r), r;
|
|
5729
5979
|
}
|
|
5730
|
-
},
|
|
5980
|
+
}, hi = {
|
|
5731
5981
|
hidden: 2,
|
|
5732
5982
|
stub: 1,
|
|
5733
5983
|
full: 0
|
|
5734
5984
|
};
|
|
5735
|
-
function
|
|
5736
|
-
return n === "first" ? e : n === "least-restrictive" ?
|
|
5985
|
+
function gi(e, t, n) {
|
|
5986
|
+
return n === "first" ? e : n === "least-restrictive" ? hi[e] < hi[t] ? e : t : hi[e] > hi[t] ? e : t;
|
|
5737
5987
|
}
|
|
5738
|
-
function
|
|
5988
|
+
function _i(e, ...t) {
|
|
5739
5989
|
let n = {}, r;
|
|
5740
5990
|
e && typeof e.isVisible == "function" ? r = [e, ...t] : (n = e ?? {}, r = t);
|
|
5741
5991
|
let i = n.exitStrategy ?? "most-restrictive", a = n.visibility ?? "and";
|
|
@@ -5751,7 +6001,7 @@ function Qr(e, ...t) {
|
|
|
5751
6001
|
for (let o of r) {
|
|
5752
6002
|
let r = o.getExitTreatment ? o.getExitTreatment(e, t, n) : w(o, e, t, n);
|
|
5753
6003
|
if (a === void 0) a = r;
|
|
5754
|
-
else if (a =
|
|
6004
|
+
else if (a = gi(a, r, i), i === "first") break;
|
|
5755
6005
|
}
|
|
5756
6006
|
return a ?? "full";
|
|
5757
6007
|
},
|
|
@@ -5764,7 +6014,7 @@ function Qr(e, ...t) {
|
|
|
5764
6014
|
}
|
|
5765
6015
|
//#endregion
|
|
5766
6016
|
//#region src/lens/ExplorationLens.ts
|
|
5767
|
-
var
|
|
6017
|
+
var vi = class {
|
|
5768
6018
|
constructor(e) {
|
|
5769
6019
|
this.version = 0, this.visited = e instanceof Set ? new Set(e) : new Set(e ?? []);
|
|
5770
6020
|
}
|
|
@@ -5799,7 +6049,7 @@ var $r = class {
|
|
|
5799
6049
|
clear() {
|
|
5800
6050
|
this.visited.size !== 0 && (this.visited.clear(), this.version++);
|
|
5801
6051
|
}
|
|
5802
|
-
},
|
|
6052
|
+
}, yi = {
|
|
5803
6053
|
1: "north",
|
|
5804
6054
|
2: "northeast",
|
|
5805
6055
|
3: "northwest",
|
|
@@ -5813,7 +6063,7 @@ var $r = class {
|
|
|
5813
6063
|
11: "in",
|
|
5814
6064
|
12: "out"
|
|
5815
6065
|
};
|
|
5816
|
-
function
|
|
6066
|
+
function bi() {
|
|
5817
6067
|
return {
|
|
5818
6068
|
areaWidth: 150,
|
|
5819
6069
|
areaHeight: 80,
|
|
@@ -5827,9 +6077,9 @@ function ti() {
|
|
|
5827
6077
|
highlightColor: "#ff9900"
|
|
5828
6078
|
};
|
|
5829
6079
|
}
|
|
5830
|
-
var
|
|
6080
|
+
var xi = class {
|
|
5831
6081
|
constructor(e, t, n) {
|
|
5832
|
-
this.areaNodes = /* @__PURE__ */ new Map(), this.connectionGroups = [], this.currentZoom = 1, this.domainInfo = /* @__PURE__ */ new Map(), this.domainFilter = "all", this.dotsMode = !1, this.settings = n ??
|
|
6082
|
+
this.areaNodes = /* @__PURE__ */ new Map(), this.connectionGroups = [], this.currentZoom = 1, this.domainInfo = /* @__PURE__ */ new Map(), this.domainFilter = "all", this.dotsMode = !1, this.settings = n ?? bi(), this.stage = new r.Stage({
|
|
5833
6083
|
container: e,
|
|
5834
6084
|
width: e.clientWidth,
|
|
5835
6085
|
height: e.clientHeight,
|
|
@@ -6012,14 +6262,14 @@ var ni = class {
|
|
|
6012
6262
|
toAreaId: e.fromAreaId,
|
|
6013
6263
|
fromRoomId: e.toRoomId,
|
|
6014
6264
|
toRoomId: e.fromRoomId,
|
|
6015
|
-
direction: e.direction ?
|
|
6265
|
+
direction: e.direction ? N[e.direction] : null,
|
|
6016
6266
|
fromRoomPosition: e.toRoomPosition,
|
|
6017
6267
|
toRoomPosition: e.fromRoomPosition
|
|
6018
6268
|
});
|
|
6019
6269
|
}
|
|
6020
6270
|
}
|
|
6021
6271
|
getLockedDirections(e) {
|
|
6022
|
-
return new Set((e.exitLocks ?? []).map((e) =>
|
|
6272
|
+
return new Set((e.exitLocks ?? []).map((e) => yi[e]).filter((e) => !!e));
|
|
6023
6273
|
}
|
|
6024
6274
|
createConnection(e, t, n) {
|
|
6025
6275
|
let r = this.toPlanarDirection(n);
|
|
@@ -6088,7 +6338,7 @@ var ni = class {
|
|
|
6088
6338
|
}[e.toLowerCase().trim()] ?? null;
|
|
6089
6339
|
}
|
|
6090
6340
|
toPlanarDirection(e) {
|
|
6091
|
-
return e &&
|
|
6341
|
+
return e && te.includes(e) ? e : null;
|
|
6092
6342
|
}
|
|
6093
6343
|
layoutAreas() {
|
|
6094
6344
|
if (Array.from(this.areaNodes.values()).length === 0) return;
|
|
@@ -6631,6 +6881,6 @@ var ni = class {
|
|
|
6631
6881
|
}
|
|
6632
6882
|
};
|
|
6633
6883
|
//#endregion
|
|
6634
|
-
export { C as ALL_VISIBLE,
|
|
6884
|
+
export { C as ALL_VISIBLE, ei as AmbientLightOverlay, e as Area, xi as AreaMapRenderer, fr as Blueprint, D as Camera, qr as CanvasExporter, gr as Construction, ee as CullingManager, Ke as DrawCommandLayerNode, vi as ExplorationLens, vr as GradientRooms, Ct as HitTester, O as IDENTITY_TRANSFORM, hr as Isometric, ci as MapGraph, n as MapReader, yr as MapRenderer, T as MapState, qe as MaterializingLayerNode, pr as Neon, dr as Parchment, mi as PathFinder, t as Plane, Gr as PngBlobExporter, Jr as PngBytesExporter, Wr as PngExporter, Ge as RecordingGroupNode, B as RecordingLayerNode, _r as SciFi, mr as Sketchy, Ur as SvgExporter, Pt as applyStyleToShapes, xr as buildDrawCommands, Kr as canvasToBytes, _ as colorLightness, Nt as compose, _i as composeLenses, lt as computePathData, bi as createAreaMapSettings, g as createSettings, v as darkenColor, w as defaultExitTreatment, x as hexToRgba, W as identityStyle, Je as isGradientFill, Fr as renderToCanvas, Xe as shapeToRecording, jr as svgFromBatches, V as transformFill };
|
|
6635
6885
|
|
|
6636
6886
|
//# sourceMappingURL=index.mjs.map
|